init prefs before dctx, and dcxt before game

This commit is contained in:
ehouse 2004-04-03 16:39:18 +00:00
parent 58160fe160
commit 6a8320e504

View file

@ -732,16 +732,15 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
/* here's where we want to behave differently if there's saved state. /* here's where we want to behave differently if there's saved state.
But that's a long ways off. */ But that's a long ways off. */
prevStateExists = ceLoadPrefs( globals ); prevStateExists = ceLoadPrefs( globals );
if ( prevStateExists && ceLoadSavedGame( globals ) ) { if ( !prevStateExists ) {
oldGameLoaded = XP_TRUE;
/* nothing to do? */
} else {
ceInitPrefs( globals ); ceInitPrefs( globals );
oldGameLoaded = XP_FALSE;
} }
/* must load prefs before creating draw ctxt */
globals->draw = ce_drawctxt_make( MPPARM(globals->mpool) globals->draw = ce_drawctxt_make( MPPARM(globals->mpool)
hWnd, globals ); hWnd, globals );
oldGameLoaded = prevStateExists && ceLoadSavedGame( globals );
if ( !oldGameLoaded ) { if ( !oldGameLoaded ) {
game_makeNewGame( MPPARM(mpool) &globals->game, &globals->gameInfo, game_makeNewGame( MPPARM(mpool) &globals->game, &globals->gameInfo,
&globals->util, globals->draw, &globals->appPrefs.cp, &globals->util, globals->draw, &globals->appPrefs.cp,