rnd-20091012-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 11 Oct 2009 22:35:20 +0000 (00:35 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:57:41 +0000 (10:57 +0200)
src/conftime.h
src/game.c
src/game_sp/DoGameStuff.c
src/game_sp/MainForm.c
src/game_sp/MainGameLoop.c
src/game_sp/Murphy.c
src/game_sp/export.h
src/game_sp/main.c
src/game_sp/main_sp.h
src/game_sp/modAnimations.c

index a00952ee912e77828976725748000c2645d5a8e7..b228a4cccf0ed8ebe24c4550ac81de9acfbb97c9 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2009-10-11 22:17"
+#define COMPILE_DATE_STRING "2009-10-12 00:32"
index daf96fe52f7da0c1e22d0cfc4b6fa5539d17bd27..eb115cb3978c1e6e27da7a57d7a196f9b683b1b2 100644 (file)
@@ -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)
   {
index 458f8aa653075e9f05c2d0aa4c929ba4201a0ec0..3d856d542da029eb0cd8adcce9c509b85644dcd5 100644 (file)
@@ -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:
 
 
index 1358ab0278fe819540ac5c5d8593c1b25f54b691..4f7bee91c9cf26c209f0b9e9f882bdb04dfce4ed 100644 (file)
@@ -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
index 99c5dbe4496203bdde12c10eac4b96a40707ecaf..fd3fa85999f92441c50eeb10ffec323e3a5ac608 100644 (file)
@@ -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 -------------------------------
index bcd61200f89d6973bab19df1fdf29d10ea7d16fa..bab25f71e2d202a7649bd4ccadcf8efe8cf77bc0 100644 (file)
@@ -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
index ffd787839b2e2b0be04ccd905108ae39e1852dad..552e2ecb14a303618088f650666be38f6ec4eb14 100644 (file)
@@ -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];
index 702cb7d36e0367a7752df1e4b56cf5b4b3c304c7..3139a0206ef16793b1cc9ee1b048e131a0ee488c 100644 (file)
@@ -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();
 }
index 0c0db95bbb9283a2f853c2b6717586418606f31c..d9294194132c2bf45cafe567410fcba0ef5b0de1 100644 (file)
@@ -60,8 +60,6 @@
 
 extern struct LevelInfo_SP native_sp_level;
 
-extern struct GameInfo_SP game_sp;
-
 extern Bitmap *screenBitmap;
 
 extern Bitmap *sp_objects;
index 3f9a1e882e865a3a9a779addc92b52986b37aac8..7cd0123a10930fc68e1ae6ed0d29e6816fe8ee48 100644 (file)
@@ -70,7 +70,7 @@ void GoPlay()
   //  Call subFetchAndInitLevelB
   EndFlag = False;
 
-#if 0
+#if 1
   subMainGameLoop_Init();
 #else
   subMainGameLoop();