Movies - Fixed read-only loadstate error logic & messages

This commit is contained in:
adelikat 2010-06-09 13:01:30 +00:00
parent 7b53114862
commit b03401b198
2 changed files with 12 additions and 9 deletions

View File

@ -1,3 +1,4 @@
09-june-2010 - adelikat - Movies - Fixed read-only loadstate error logic & messages
07-june-2010 - mart0258 - Movie loading now faster - TAS savestates moved from class MovieRecord to class MovieData 07-june-2010 - mart0258 - Movie loading now faster - TAS savestates moved from class MovieRecord to class MovieData
07-june-2010 - adelikat - Lua - new function: gui.screenshotas() 07-june-2010 - adelikat - Lua - new function: gui.screenshotas()
07-june-2010 - Deign/adelikat - Win32 - Added a SavestateAs Menu item 07-june-2010 - Deign/adelikat - Win32 - Added a SavestateAs Menu item

View File

@ -1393,16 +1393,18 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size)
if(currFrameCounter > (int)currMovieData.records.size()) if(currFrameCounter > (int)currMovieData.records.size())
{ {
//TODO: turn frame counter to red to get attention //TODO: turn frame counter to red to get attention
if (! (currFrameCounter > (int)tempMovieData.records.size() ) ) //This seemingly redundant check is necessary in order to not flag a post movie savestate as an error
if (!backupSavestates) //If backups are disabled we can just resume normally since we can't restore so stop movie and inform user
{ {
FCEU_PrintError("Error: Savestate is from a frame (%d) after the final frame in the movie (%d). This is not permitted.\nUnable to restore backup, movie playback stopped.", errorFrame); if (!backupSavestates) //If backups are disabled we can just resume normally since we can't restore so stop movie and inform user
FCEUI_StopMovie(); {
} FCEU_PrintError("Error: Savestate is from a frame (%d) after the final frame in the movie (%d). This is not permitted.\nUnable to restore backup, movie playback stopped.", currFrameCounter, currMovieData.records.size()-1);
else FCEUI_StopMovie();
FCEU_PrintError("Savestate is from a frame (%d) after the final frame in the movie (%d). This is not permitted.", tempMovieData.records.size(), currMovieData.records.size()-1); }
else
FCEU_PrintError("Savestate is from a frame (%d) after the final frame in the movie (%d). This is not permitted.", currFrameCounter, currMovieData.records.size()-1);
return false; return false;
}
} }
else else
{ {