From: Holger Schemel Date: Thu, 22 Oct 2009 21:02:44 +0000 (+0200) Subject: rnd-20091022-1-src X-Git-Tag: 3.3.0.0^2~74 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=725f2361ad1932897edef8849a86d9ba7f65424f rnd-20091022-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 232d802c..ab8b8f0d 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-10-20 21:52" +#define COMPILE_DATE_STRING "2009-10-22 22:59" diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index d41da8c3..ce1d77e2 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -76,21 +76,37 @@ int subDoGameStuff() if (KillMurphyFlag == 1 || MurphyMoveCounter == 0) { #if 1 - if (LeadOutCounter == 0 && !game_sp_info.LevelSolved) + if (LeadOutCounter == 0 && + !game_sp_info.LevelSolved && + !game_sp_info.GameOver) #else if (LeadOutCounter == 0) #endif { -#if 1 +#if 0 printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag); #endif KillMurphyFlag = 0; // no more "kill Murphy" ExplodeFieldSP(MurphyExplodePos); // Explode LeadOutCounter = 0x40; // quit: start lead-out + +#if 1 +#if 1 + printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n"); +#endif + + game_sp_info.GameOver = TRUE; +#endif } #if 1 +#if 0 + printf("::: *** %d, %d, %d\n", KillMurphyFlag, + game_sp_info.LevelSolved, game_sp_info.GameOver); +#endif + +#if 0 if (KillMurphyFlag == 1 && !game_sp_info.LevelSolved && !game_sp_info.GameOver) @@ -102,7 +118,7 @@ int subDoGameStuff() game_sp_info.GameOver = TRUE; } #endif - +#endif } // loc_g_22FB: diff --git a/src/game_sp/Explosions.c b/src/game_sp/Explosions.c index 0dc2cc71..b6f009bf 100644 --- a/src/game_sp/Explosions.c +++ b/src/game_sp/Explosions.c @@ -85,7 +85,7 @@ void ExplodeFieldSP(int si) if (ax == fiMurphy) { #if 1 - printf("::: Explosions.c: ExplodeFieldSP(): kill murphy\n"); + printf("::: Explosions.c: ExplodeFieldSP(): killing murphy\n"); #endif KillMurphyFlag = 1; @@ -153,7 +153,7 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh) case fiMurphy: #if 1 - printf("::: Explosions.c: LetExplodeFieldSP(): kill murphy\n"); + printf("::: Explosions.c: LetExplodeFieldSP(): killing murphy\n"); #endif KillMurphyFlag = 1; diff --git a/src/game_sp/Input.c b/src/game_sp/Input.c index 42ad1201..a846aaf6 100644 --- a/src/game_sp/Input.c +++ b/src/game_sp/Input.c @@ -37,12 +37,33 @@ int subCheckRightMouseButton() return subCheckRightMouseButton; } -int subProcessKeyboardInput() +int subProcessKeyboardInput(byte action) { int subProcessKeyboardInput; static int LastKey = 0; +#if 1 + + if (action & KEY_BUTTON) + { + DemoKeyCode = (action & MV_UP ? keySpaceUp : + action & MV_LEFT ? keySpaceLeft : + action & MV_DOWN ? keySpaceDown : + action & MV_RIGHT ? keySpaceRight : keySpace); + } + else + { + DemoKeyCode = (action & MV_UP ? keyUp : + action & MV_LEFT ? keyLeft : + action & MV_DOWN ? keyDown : + action & MV_RIGHT ? keyRight : keyNone); + } + + return subProcessKeyboardInput; + +#else + // On Error GoTo NoKeyboardAccessEH // Call DKeyboard.Acquire // On Error GoTo 0 @@ -51,9 +72,9 @@ int subProcessKeyboardInput() if (DemoFlag != 0) { subGetNextDemoKey(); + if (ExitToMenuFlag != 0) return subProcessKeyboardInput; - } else { @@ -106,6 +127,8 @@ int subProcessKeyboardInput() } } +#endif + // demo recording if (RecordDemoFlag == 1) DemoBuffer.AddDemoKey(DemoKeyCode); diff --git a/src/game_sp/Input.h b/src/game_sp/Input.h index 2762b305..93b9f72d 100644 --- a/src/game_sp/Input.h +++ b/src/game_sp/Input.h @@ -14,7 +14,7 @@ extern void subCheckJoystick(); extern int subCheckRightMouseButton(); -extern int subProcessKeyboardInput(); +extern int subProcessKeyboardInput(byte); extern DemoBufferObject DemoBuffer; extern boolean KeyState[255 + 1]; diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 2baa7435..eddb4cdd 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -82,7 +82,7 @@ int subMainGameLoop_Init() return subMainGameLoop; } -int subMainGameLoop_Main() +int subMainGameLoop_Main(byte action, boolean warp_mode) { int subMainGameLoop; int bx; @@ -155,7 +155,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 @@ -326,6 +326,8 @@ locExitMainGameLoop: return subMainGameLoop; } // subMainGameLoop +#if 0 + int subMainGameLoop() { int subMainGameLoop; @@ -555,6 +557,8 @@ locExitMainGameLoop: return subMainGameLoop; } // subMainGameLoop +#endif + void subUpdatePlayingTime() { } diff --git a/src/game_sp/MainGameLoop.h b/src/game_sp/MainGameLoop.h index a686bcaf..a13900d1 100644 --- a/src/game_sp/MainGameLoop.h +++ b/src/game_sp/MainGameLoop.h @@ -15,7 +15,7 @@ extern int subCalculateScreenScrollPos(); extern int subMainGameLoop(); extern int subMainGameLoop_Init(); -extern int subMainGameLoop_Main(); +extern int subMainGameLoop_Main(byte, boolean); extern void subUpdatePlayingTime(); extern boolean AutoScrollFlag; diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 3139a020..a8d61e3f 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -26,5 +26,7 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode) { - subMainGameLoop_Main(); + byte single_player_action = action[0]; + + subMainGameLoop_Main(single_player_action, warp_mode); }