oops, fixed bug in UpdateRecentROM()

This commit is contained in:
adelikat 2008-11-15 18:21:27 +00:00
parent da981a84ed
commit ac2ef12a39
1 changed files with 6 additions and 6 deletions

View File

@ -543,7 +543,7 @@ void UpdateRecentRomsMenu()
moo.fType = 0; moo.fType = 0;
moo.wID = baseid + x; moo.wID = baseid + x;
moo.dwTypeData = (LPSTR)tmp.c_str(); moo.dwTypeData = (LPSTR)tmp.c_str();
//printlog("Inserting: %s\n",tmp.c_str()); //Debug printlog("Inserting: %s\n",tmp.c_str()); //Debug
InsertMenuItem(recentromsmenu, 0, 1, &moo); InsertMenuItem(recentromsmenu, 0, 1, &moo);
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@ -573,19 +573,19 @@ void UpdateRecentRoms(char* filename)
} }
} }
//---------------------------------------------------------------- //----------------------------------------------------------------
RecentRoms.insert(RecentRoms.begin(), newROM); //Add to the array
//If there was a match, remove it //If there was a match, remove it
if (match) if (match)
RecentRoms.erase(theMatch); RecentRoms.erase(theMatch);
RecentRoms.insert(RecentRoms.begin(), newROM); //Add to the array
//If over the max, we have too many, so remove the last entry //If over the max, we have too many, so remove the last entry
if (RecentRoms.size() == MAX_RECENT_ROMS) if (RecentRoms.size() == MAX_RECENT_ROMS)
RecentRoms.pop_back(); RecentRoms.pop_back();
//Debug //Debug
//for (int x = 0; x < RecentRoms.size(); x++) for (int x = 0; x < RecentRoms.size(); x++)
// printlog("Recent ROM: %s\n",RecentRoms[x].c_str()); printlog("Recent ROM: %s\n",RecentRoms[x].c_str());
UpdateRecentRomsMenu(); UpdateRecentRomsMenu();
} }
@ -1041,7 +1041,7 @@ BOOL LoadROM(char * filename, const char *cflash_disk_image)
if (NDS_LoadROM(filename, backupmemorytype, backupmemorysize, cflash_disk_image) > 0) if (NDS_LoadROM(filename, backupmemorytype, backupmemorysize, cflash_disk_image) > 0)
{ {
printlog("Loading %s was successful\n",filename); printlog("Loading %s was successful\n",filename);
//UpdateRecentRoms(filename); UpdateRecentRoms(filename);
return TRUE; return TRUE;
} }
printlog("Loading %s FAILED.\n",filename); printlog("Loading %s FAILED.\n",filename);