From 2af2c61f4dde2d22c1dc0e8dfad033b40d81dc6c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 1 Nov 2009 00:03:04 +0100 Subject: [PATCH] rnd-20091101-1-src * fixed SP engine to set "game over" not before lead out counter done --- ChangeLog | 3 +++ src/conftime.h | 2 +- src/game_sp/DoGameStuff.c | 9 ++++++++- src/game_sp/MainGameLoop.c | 9 +++++++-- src/game_sp/file.c | 27 ++++++++++++++++++++------- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ad0fba1..a8395627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-10-31 + * fixed SP engine to set "game over" not before lead out counter done + 2009-10-30 * fixed (potential) compile error when using GCC option "-std=gnu99" (thanks to Tom "spot" Callaway) diff --git a/src/conftime.h b/src/conftime.h index 32328865..3cac76c2 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-10-30 22:02" +#define COMPILE_DATE_STRING "2009-10-31 23:44" diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index ce1d77e2..8e7d8830 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -83,7 +83,7 @@ int subDoGameStuff() if (LeadOutCounter == 0) #endif { -#if 0 +#if 1 printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag); #endif @@ -92,11 +92,18 @@ int subDoGameStuff() LeadOutCounter = 0x40; // quit: start lead-out #if 1 + #if 1 printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n"); + printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag); #endif +#if 1 + /* give Murphy some more time (LeadOutCounter) to reach the exit */ +#else game_sp_info.GameOver = TRUE; +#endif + #endif } diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index e1f81f4d..bae1d6d9 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -279,11 +279,16 @@ locRepeatMainGameLoop: // start repeating game loop locExitMainGameLoop: -#if 0 +#if 1 printf("::: locExitMainGameLoop reached [%d]\n", LeadOutCounter); + printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag); #endif - +#if 1 + /* if the game is not won when reaching this point, then it is lost */ + if (!game_sp_info.LevelSolved) + game_sp_info.GameOver = TRUE; +#endif #if 1 return subMainGameLoop; diff --git a/src/game_sp/file.c b/src/game_sp/file.c index 12b52c3a..2a657fcc 100644 --- a/src/game_sp/file.c +++ b/src/game_sp/file.c @@ -73,6 +73,12 @@ void copyInternalEngineVars_SP() #if 1 +#if 0 + /* fill preceding playfield buffer zone with (indestructible) "hardware" */ + for (i = -FieldWidth; i < 0; i++) + PlayField16[i] = 0x20; +#endif + count = 0; for (y = 0; y < native_sp_level.height; y++) for (x = 0; x < native_sp_level.width; x++) @@ -341,13 +347,20 @@ boolean LoadNativeLevel_SP(char *filename, int pos) ((name_first == '?' || name_first == '1') && (name_last == '?' || name_last == '1')); - /* correct leading multipart level meta information in level name */ - for (i = 0; i < SP_LEVEL_NAME_LEN && header->LevelTitle[i] == name_first; i++) - header->LevelTitle[i] = '-'; - - /* correct trailing multipart level meta information in level name */ - for (i = SP_LEVEL_NAME_LEN - 1; i >= 0 && header->LevelTitle[i] == name_last; i--) - header->LevelTitle[i] = '-'; + if (is_multipart_level) + { + /* correct leading multipart level meta information in level name */ + for (i = 0; + i < SP_LEVEL_NAME_LEN && header->LevelTitle[i] == name_first; + i++) + header->LevelTitle[i] = '-'; + + /* correct trailing multipart level meta information in level name */ + for (i = SP_LEVEL_NAME_LEN - 1; + i >= 0 && header->LevelTitle[i] == name_last; + i--) + header->LevelTitle[i] = '-'; + } /* ---------- check for normal single level ---------- */ -- 2.34.1