From: Holger Schemel Date: Sun, 11 Oct 2009 22:35:20 +0000 (+0200) Subject: rnd-20091012-1-src X-Git-Tag: 3.3.0.0^2~78 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=79d7ca29718d025ed0b131bf5389685fe9b941c4;p=rocksndiamonds.git rnd-20091012-1-src --- diff --git a/src/conftime.h b/src/conftime.h index a00952ee..b228a4cc 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-10-11 22:17" +#define COMPILE_DATE_STRING "2009-10-12 00:32" diff --git a/src/game.c b/src/game.c index daf96fe5..eb115cb3 100644 --- a/src/game.c +++ b/src/game.c @@ -12037,6 +12037,18 @@ static void CheckLevelTime() level.native_em_level->ply[3]->alive == 0) /* all dead */ AllPlayersGone = TRUE; } + else if (level.game_engine_type == GAME_ENGINE_TYPE_SP) + { + if (game_sp_info.LevelSolved) /* game won */ + { + PlayerWins(local_player); + + AllPlayersGone = TRUE; + } + + if (game_sp_info.GameOver) /* game lost */ + AllPlayersGone = TRUE; + } if (TimeFrames >= FRAMES_PER_SECOND) { diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index 458f8aa6..3d856d54 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -85,6 +85,21 @@ int subDoGameStuff() ExplodeFieldSP(MurphyExplodePos); // Explode LeadOutCounter = 0x40; // quit: start lead-out } + +#if 1 + if (KillMurphyFlag == 1 && + !game_sp_info.LevelSolved && + !game_sp_info.GameOver) + { +#if 1 + printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n"); +#endif + + game_sp_info.GameOver = TRUE; + } +#endif + + } // loc_g_22FB: diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 1358ab02..4f7bee91 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -2523,7 +2523,7 @@ void menPlay_Click() } -#if 0 +#if 1 // static void menPlayDemo_Click() void menPlayDemo_Click() @@ -2538,7 +2538,7 @@ void menPlayDemo_Click() menPlay_Click(); #if 1 - return; + return; /* return after initialization phase */ #endif #if 0 diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 99c5dbe4..fd3fa859 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -206,11 +206,17 @@ locRepeatMainGameLoop: // start repeating game loop // .Refresh // End With // End If + if (ExitToMenuFlag == 1) goto locExitMainGameLoop; +#if 1 + if (LeadOutCounter == 0) // no lead-out: game busy + return subMainGameLoop; +#else if (LeadOutCounter == 0) // no lead-out: game busy goto locRepeatMainGameLoop; +#endif // ---------------------------------------------------------------------------- // ---------------------- END OF GAME-BUSY LOOP ------------------------------- diff --git a/src/game_sp/Murphy.c b/src/game_sp/Murphy.c index bcd61200..bab25f71 100644 --- a/src/game_sp/Murphy.c +++ b/src/game_sp/Murphy.c @@ -932,9 +932,12 @@ loc_g_6756: return subAnimateMurphy; #if 1 - printf("::: Murphy.c: !!!!!!!!!! LEVEL %d SOLVED !!!!!!!!!!\n", LevelNumber); + if (!game_sp_info.LevelSolved) + printf("::: Murphy.c: !!!!!!!!!! LEVEL %d SOLVED !!!!!!!!!!\n",LevelNumber); #endif + game_sp_info.LevelSolved = TRUE; + subSoundFXExit(); data_h_DemoDone = 1; // EP set level success bytes LevelStatus = 1; // set Level Status DONE diff --git a/src/game_sp/export.h b/src/game_sp/export.h index ffd78783..552e2ecb 100644 --- a/src/game_sp/export.h +++ b/src/game_sp/export.h @@ -80,6 +80,8 @@ struct GlobalInfo_SP struct GameInfo_SP { + boolean LevelSolved; + boolean GameOver; }; struct LevelInfo_SP @@ -125,6 +127,7 @@ struct EngineSnapshotInfo_SP /* ------------------------------------------------------------------------- */ extern struct GlobalInfo_SP global_sp_info; +extern struct GameInfo_SP game_sp_info; extern struct LevelInfo_SP native_sp_level; extern struct GraphicInfo_SP graphic_info_sp_object[TILE_MAX][8]; extern struct GraphicInfo_SP graphic_info_sp_player[MAX_PLAYERS][SPR_MAX][8]; diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 702cb7d3..3139a020 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -3,10 +3,14 @@ #include "global.h" +struct GameInfo_SP game_sp_info; struct LevelInfo_SP native_sp_level; void InitGameEngine_SP() { + game_sp_info.LevelSolved = FALSE; + game_sp_info.GameOver = FALSE; + #if 0 menPlay_Click(); #else @@ -22,4 +26,5 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode) { + subMainGameLoop_Main(); } diff --git a/src/game_sp/main_sp.h b/src/game_sp/main_sp.h index 0c0db95b..d9294194 100644 --- a/src/game_sp/main_sp.h +++ b/src/game_sp/main_sp.h @@ -60,8 +60,6 @@ extern struct LevelInfo_SP native_sp_level; -extern struct GameInfo_SP game_sp; - extern Bitmap *screenBitmap; extern Bitmap *sp_objects; diff --git a/src/game_sp/modAnimations.c b/src/game_sp/modAnimations.c index 3f9a1e88..7cd0123a 100644 --- a/src/game_sp/modAnimations.c +++ b/src/game_sp/modAnimations.c @@ -70,7 +70,7 @@ void GoPlay() // Call subFetchAndInitLevelB EndFlag = False; -#if 0 +#if 1 subMainGameLoop_Init(); #else subMainGameLoop();