X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FInput.c;h=a846aaf6e047dd37e50748014dc5856d1420bb89;hb=725f2361ad1932897edef8849a86d9ba7f65424f;hp=a7ac7798d545d0038d2a881eaa5f0db87cc1c280;hpb=8d3d7d213a9691455a49544624bf380e85f43461;p=rocksndiamonds.git diff --git a/src/game_sp/Input.c b/src/game_sp/Input.c index a7ac7798..a846aaf6 100644 --- a/src/game_sp/Input.c +++ b/src/game_sp/Input.c @@ -37,11 +37,32 @@ int subCheckRightMouseButton() return subCheckRightMouseButton; } -int subProcessKeyboardInput() +int subProcessKeyboardInput(byte action) { int subProcessKeyboardInput; - int LastKey; + 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 @@ -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); @@ -126,6 +149,10 @@ int subProcessKeyboardInput() } else { +#if 1 + printf("::: Input.c: subProcessKeyboardInput(): kill murphy\n"); +#endif + KillMurphyFlag = 1; // ExplodeFieldSP MurphyPosIndex // LeadOutCounter = &H20