re-rearrange movie code so it actually works all of the time

This commit is contained in:
rog 2012-10-19 19:42:44 -04:00
parent b1dee5fc23
commit 0384f61af3
2 changed files with 7 additions and 8 deletions

View File

@ -103,7 +103,7 @@ struct DTMHeader {
u64 recordingStartTime; // seconds since 1970 that recording started (used for RTC) u64 recordingStartTime; // seconds since 1970 that recording started (used for RTC)
bool bSaveConfig; bool bSaveConfig; // Loads the settings below on startup if true
bool bSkipIdle; bool bSkipIdle;
bool bDualCore; bool bDualCore;
bool bProgressive; bool bProgressive;

View File

@ -201,12 +201,11 @@ void CompressAndDumpState(CompressAndDumpState_args save_args)
if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav") || !File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm")) if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav") || !File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm"))
Core::DisplayMessage("Failed to move previous state to state undo backup", 1000); Core::DisplayMessage("Failed to move previous state to state undo backup", 1000);
}
if ((Movie::IsRecordingInput() || Movie::IsPlayingInput()) && !Movie::IsJustStartingRecordingInputFromSaveState()) if ((Movie::IsRecordingInput() || Movie::IsPlayingInput()) && !Movie::IsJustStartingRecordingInputFromSaveState())
Movie::SaveRecording((filename + ".dtm").c_str()); Movie::SaveRecording((filename + ".dtm").c_str());
else if (!Movie::IsRecordingInput() && !Movie::IsPlayingInput()) else if (!Movie::IsRecordingInput() && !Movie::IsPlayingInput())
File::Delete(filename + ".dtm"); File::Delete(filename + ".dtm");
}
File::IOFile f(filename, "wb"); File::IOFile f(filename, "wb");
if (!f) if (!f)