X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainGameLoop.c;h=6c8d5d1814eb16df3849e3cf00c068f73f4c02bc;hb=ce0bba1a070e5e64939491eb68087f68ef8fe870;hp=2baa7435cc542dd2f258e55ad3a15b99b8971fe0;hpb=3b19d917acb541df11a45e0d4b4e40ad4e38a717;p=rocksndiamonds.git diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 2baa7435..6c8d5d18 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 @@ -82,7 +82,7 @@ int subMainGameLoop_Init() return subMainGameLoop; } -int subMainGameLoop_Main() +int subMainGameLoop_Main(byte action, boolean warp_mode) { int subMainGameLoop; int bx; @@ -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 // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -155,7 +162,7 @@ locRepeatMainGameLoop: // start repeating game loop // loc_g_186F: - subProcessKeyboardInput(); // Check keyboard, act on keys + subProcessKeyboardInput(action); // Check keyboard, act on keys // 'HACK: // TimerVar = TimerVar + 1 @@ -182,7 +189,7 @@ locRepeatMainGameLoop: // start repeating game loop // Call subDisplayPlayingTime ' playing time on screen - subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole + // subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole subRedDiskReleaseExplosion(); // Red Disk release and explode subFollowUpExplosions(); // every explosion may cause up to 8 following explosions @@ -192,8 +199,8 @@ locRepeatMainGameLoop: // start repeating game loop ScreenPosition = bx; // Now new X and new Y are calculated, and bx = screen position = ScreenPosition - data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll - data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll + // data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll + // data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll if ((! UserDragFlag) && AutoScrollFlag) { #if 0 @@ -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.LevelSolved) + game_sp.GameOver = TRUE; +#endif #if 1 return subMainGameLoop; @@ -326,6 +338,8 @@ locExitMainGameLoop: return subMainGameLoop; } // subMainGameLoop +#if 0 + int subMainGameLoop() { int subMainGameLoop; @@ -465,7 +479,7 @@ locRepeatMainGameLoop: // start repeating game loop // Call subDisplayPlayingTime ' playing time on screen - subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole + // subCheckRestoreRedDiskCountDisplay(); // Restore panel: red-disk hole subRedDiskReleaseExplosion(); // Red Disk release and explode subFollowUpExplosions(); // every explosion may cause up to 8 following explosions @@ -475,8 +489,8 @@ locRepeatMainGameLoop: // start repeating game loop ScreenPosition = bx; // Now new X and new Y are calculated, and bx = screen position = ScreenPosition - data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll - data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll + // data_h_Ytmp = ScreenScrollYPos; // copy Y for next soft scroll + // data_h_Xtmp = ScreenScrollXPos; // copy X for next soft scroll if ((! UserDragFlag) && AutoScrollFlag) { #if 0 @@ -555,6 +569,8 @@ locExitMainGameLoop: return subMainGameLoop; } // subMainGameLoop +#endif + void subUpdatePlayingTime() { } @@ -565,9 +581,26 @@ 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(); + + // printf("::: ExplosionShake [%d]\n", FrameCounter); } {