Fixed the timeline checking function. The mistake was assuming that FCEUX didn't save the entire movie in a savestate. Now that I know it does, the fix was rather simple.

This commit is contained in:
adelikat 2010-05-17 15:51:11 +00:00
parent 5993feb80c
commit fb1240c262
1 changed files with 10 additions and 5 deletions

View File

@ -1213,12 +1213,17 @@ bool CheckTimelines(MovieData& stateMovie, MovieData& currMovie, int& error)
{ {
bool isInTimeline = true; bool isInTimeline = true;
int length; int length;
if (stateMovie.getNumRecords() > currMovie.getNumRecords())
length = currMovie.getNumRecords(); //First check, make sure we are checking is for a post-movie savestate, we just want to adjust the length for now, we will handle this situation later in another function
if (currFrameCounter <= stateMovie.getNumRecords())
length = currFrameCounter;
else else
length = stateMovie.getNumRecords(); //Whichever one is smaller length = stateMovie.getNumRecords();
//length logic - after this function we will check and handle statemovies that are bigger than the curent movie
//all we want to know at this time is if their timelines match for the data we do have //Now that we know the length of the records of the savestate we plan to load, let's match the length against the movie
//If length < currMovie records then this is a "future" event from the current movie, againt we will handle this situation later, we just want to find the right number of frames to compare
if (length > currMovie.getNumRecords())
length = currMovie.getNumRecords();
for (int x = 0; x < length; x++) for (int x = 0; x < length; x++)
{ {