mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Keep track of whether a savestate has been used.
Mostly to improve info we get in reporting.
This commit is contained in:
parent
274160bc22
commit
a8b55c3e10
@ -20,6 +20,7 @@
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/SaveState.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/HLE/sceDisplay.h"
|
||||
#include "Core/HLE/sceKernelMemory.h"
|
||||
@ -219,7 +220,8 @@ namespace Reporting
|
||||
postdata.Add("fps", fps);
|
||||
}
|
||||
|
||||
// TODO: Settings, savestate/savedata status, some measure of speed/fps?
|
||||
// TODO: Settings?
|
||||
postdata.Add("savestate_used", SaveState::HasLoadedState());
|
||||
|
||||
switch (payload.type)
|
||||
{
|
||||
|
@ -203,6 +203,7 @@ namespace SaveState
|
||||
static bool needsProcess = false;
|
||||
static std::vector<Operation> pending;
|
||||
static std::recursive_mutex mutex;
|
||||
static bool hasLoadedState = false;
|
||||
|
||||
// TODO: Should this be configurable?
|
||||
static const int REWIND_NUM_STATES = 20;
|
||||
@ -430,6 +431,11 @@ namespace SaveState
|
||||
rewindStates.Save();
|
||||
}
|
||||
|
||||
bool HasLoadedState()
|
||||
{
|
||||
return hasLoadedState;
|
||||
}
|
||||
|
||||
void Process()
|
||||
{
|
||||
#ifndef MOBILE_DEVICE
|
||||
@ -474,6 +480,7 @@ namespace SaveState
|
||||
if (result == CChunkFileReader::ERROR_NONE) {
|
||||
osm.Show(s->T("Loaded State"), 2.0);
|
||||
callbackResult = true;
|
||||
hasLoadedState = true;
|
||||
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
||||
HandleFailure();
|
||||
osm.Show(i18nLoadFailure, 2.0);
|
||||
@ -513,12 +520,14 @@ namespace SaveState
|
||||
if (result == CChunkFileReader::ERROR_NONE) {
|
||||
osm.Show(s->T("Loaded State"), 2.0);
|
||||
callbackResult = true;
|
||||
hasLoadedState = true;
|
||||
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
||||
// Cripes. Good news is, we might have more. Let's try those too, better than a reset.
|
||||
if (HandleFailure()) {
|
||||
// Well, we did rewind, even if too much...
|
||||
osm.Show(s->T("Loaded State"), 2.0);
|
||||
callbackResult = true;
|
||||
hasLoadedState = true;
|
||||
} else {
|
||||
osm.Show(i18nLoadFailure, 2.0);
|
||||
callbackResult = false;
|
||||
@ -547,5 +556,7 @@ namespace SaveState
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(mutex);
|
||||
rewindStates.Clear();
|
||||
|
||||
hasLoadedState = false;
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,9 @@ namespace SaveState
|
||||
// Returns true if there are rewind snapshots available.
|
||||
bool CanRewind();
|
||||
|
||||
// Returns true if a savestate has been used during this session.
|
||||
bool HasLoadedState();
|
||||
|
||||
// Check if there's any save stating needing to be done. Normally called once per frame.
|
||||
void Process();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user