X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainGameLoop.c;h=38f76fc7f6a1f7b760f5f1fd3a96ba4122f27171;hb=843029e7c2253a35aa1b4ac87241978808b9e6fc;hp=eddb4cdd3ec60bab33f71b12d9cd2eb4d4104130;hpb=725f2361ad1932897edef8849a86d9ba7f65424f;p=rocksndiamonds.git diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index eddb4cdd..38f76fc7 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -35,7 +35,7 @@ int subMainGameLoop_Init() if (DemoFlag != 0) { -#if 1 +#if 0 printf("::: playing demo ...\n"); #endif @@ -45,7 +45,7 @@ int subMainGameLoop_Init() } else // loc_g_1836: { -#if 1 +#if 0 printf("::: playing game ...\n"); #endif @@ -117,8 +117,15 @@ locRepeatMainGameLoop: // start repeating game loop LastFrame = Clock.TickNow(); // store the frame time #endif // never any additional code between here! + + + +#if 0 if (! NoDisplayFlag) // copy the BackBuffer(=Stage) to visible screen Stage.Blt(); +#endif + + // FS end of synchronization // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -281,9 +288,14 @@ locExitMainGameLoop: #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; @@ -569,6 +581,21 @@ int subCalculateScreenScrollPos() int ax, Ay; +#if 1 + int jump_pos = TILEX / 2; + + if (MurphyScreenXPos < -jump_pos) + { + MurphyScreenXPos = FieldWidth * TILEX + MurphyScreenXPos; + MurphyScreenYPos -= TILEY; + } + else if (MurphyScreenXPos >= FieldWidth * TILEX - jump_pos) + { + MurphyScreenXPos = MurphyScreenXPos - FieldWidth * TILEX; + MurphyScreenYPos += TILEY; + } +#endif + if (ExplosionShake != 0) { subGetRandomNumber();