Skip to content
Permalink
Browse files

Fix saving states freezing up emulation

Only for about half a second but noticeable nonetheless
  • Loading branch information...
spycrab committed Aug 1, 2019
1 parent c70da39 commit 04764f8b7f631384f890b870d0280278de86498f
@@ -323,7 +323,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)

if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav"))
Core::DisplayMessage("Failed to move previous state to state undo backup", 1000);
else
else if (File::Exists(filename + ".dtm"))
File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm");
}

@@ -1183,8 +1183,7 @@ void MainWindow::StateLoadSlot()

void MainWindow::StateSaveSlot()
{
State::Save(m_state_slot, true);
m_menu_bar->UpdateStateSlotMenu();
State::Save(m_state_slot);
}

void MainWindow::StateLoadSlotAt(int slot)
@@ -1199,8 +1198,7 @@ void MainWindow::StateLoadLastSavedAt(int slot)

void MainWindow::StateSaveSlotAt(int slot)
{
State::Save(slot, true);
m_menu_bar->UpdateStateSlotMenu();
State::Save(slot);
}

void MainWindow::StateLoadUndo()
@@ -313,6 +313,9 @@ void MenuBar::AddEmulationMenu()
AddStateSaveMenu(emu_menu);
AddStateSlotMenu(emu_menu);
UpdateStateSlotMenu();

for (QMenu* menu : {m_state_load_menu, m_state_save_menu, m_state_slot_menu})
connect(menu, &QMenu::aboutToShow, this, &MenuBar::UpdateStateSlotMenu);
}

void MenuBar::AddStateLoadMenu(QMenu* emu_menu)
@@ -37,7 +37,6 @@ class MenuBar final : public QMenuBar

explicit MenuBar(QWidget* parent = nullptr);

void UpdateStateSlotMenu();
void UpdateToolsMenu(bool emulation_started);

QMenu* GetListColumnsMenu() const { return m_cols_menu; }
@@ -140,6 +139,8 @@ class MenuBar final : public QMenuBar
void AddJITMenu();
void AddSymbolsMenu();

void UpdateStateSlotMenu();

void InstallWAD();
void ImportWiiSave();
void ExportWiiSaves();

0 comments on commit 04764f8

Please sign in to comment.
You can’t perform that action at this time.