now auto loads most recent save state

This commit is contained in:
Siddharth committed 2013-10-30 23:21:25 +05:30
1 parent 10ca6cac90
commit b87342a433
2 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -246,7 +246,7 @@ namespace SaveState
return false;
}
int GetMostRecentSaveSlot() {
int GetNewestSlot() {
int newestSlot = -1;
tm newestDate = {0};
for (int i = 0; i < SAVESTATESLOTS; i++) {
+7 -4
View File
@@ -110,6 +110,8 @@ void EmuScreen::bootGame(const std::string &filename) {
g_gameInfoCache.FlushBGs();
NOTICE_LOG(BOOT, "Loading %s...", fileToStart.c_str());
autoLoad();
I18NCategory *s = GetI18NCategory("Screen");
#ifdef _WIN32
@@ -124,7 +126,6 @@ void EmuScreen::bootGame(const std::string &filename) {
osm.Show(s->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true);
}
autoLoad();
}
EmuScreen::~EmuScreen() {
@@ -144,9 +145,10 @@ void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
//user didn't click continue. he went back to the main screen and is loading
//the game from there.
/*
if (result != DR_CANCEL && result != DR_BACK){
autoLoad();
}
}*/
RecreateViews();
}
@@ -633,7 +635,8 @@ void EmuScreen::deviceLost() {
void EmuScreen::autoLoad(){
//check if save state has save, if so, load
if (g_Config.bEnableAutoLoad && SaveState::HasSaveInSlot(g_Config.iCurrentStateSlot)){
SaveState::LoadSlot(g_Config.iCurrentStateSlot, 0, 0);
int lastSlot = SaveState::GetNewestSlot();
if (g_Config.bEnableAutoLoad && lastSlot != -1){
SaveState::LoadSlot(lastSlot, 0, 0);
}
};