Implemented the 'Start Again' menu option to properly restart the game

svn-id: r39981
This commit is contained in:
Paul Gilbert 2009-04-18 12:03:21 +00:00
parent 9efb96ce69
commit f53b4d3de4
4 changed files with 9 additions and 0 deletions

View file

@ -124,6 +124,7 @@ void closeAllMenu(void);
int removeFinishedScripts(scriptInstanceStruct *ptrHandle);
void initBigVar3(void);
void resetActorPtr(actorStruct *ptr);
int initAllData(void);
} // End of namespace Cruise

View file

@ -35,6 +35,7 @@ int16 computeZoom(int param);
int16 subOp23(int param1, int param2);
void freeObjectList(cellStruct *pListHead);
int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType);
int16 Op_FadeOut(void);
} // End of namespace Cruise

View file

@ -261,6 +261,12 @@ int playerMenu(int menuX, int menuY) {
loadSavegameData(0);
break;
case 6: // restart
Op_FadeOut();
memset(globalScreen, 0, 320 * 200);
initVars();
initAllData();
changeCursor(CURSOR_NORMAL);
userEnabled = 0;
break;
case 7: // exit
return 1;

View file

@ -42,6 +42,7 @@ struct CruiseSavegameHeader {
Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName);
Common::Error loadSavegameData(int saveGameIdx);
bool readSavegameHeader(Common::InSaveFile *in, CruiseSavegameHeader &header);
void initVars(void);
} // End of namespace Cruise