void DrawAllPlayBorderSides (void) { unsigned i,temp; temp = bufferofs; for (i=0;i<3;i++) { bufferofs = screenloc[i]; DrawPlayBorderSides (); } bufferofs = temp; }
void CheckKeys (void) { ScanCode scan; if (screenfaded || demoplayback) // don't do anything with a faded screen return; scan = LastScan; #ifdef SPEAR // // SECRET CHEAT CODE: TAB-G-F10 // if (Keyboard[sc_Tab] && Keyboard[sc_G] && Keyboard[sc_F10]) { WindowH = 160; if (godmode) { Message ("God mode OFF"); SD_PlaySound (NOBONUSSND); } else { Message ("God mode ON"); SD_PlaySound (ENDBONUS2SND); } IN_Ack (); godmode ^= 1; DrawPlayBorderSides (); IN_ClearKeysDown (); return; } #endif // // SECRET CHEAT CODE: 'MLI' // if (Keyboard[sc_M] && Keyboard[sc_L] && Keyboard[sc_I]) { gamestate.health = 100; gamestate.ammo = 99; gamestate.keys = 3; gamestate.score = 0; gamestate.TimeCount += 42000L; GiveWeapon (wp_chaingun); DrawWeapon (); DrawHealth (); DrawKeys (); DrawAmmo (); DrawScore (); ClearMemory (); CA_CacheGrChunk (STARTFONT + 1); ClearSplitVWB (); Message (STR_CHEATER1 "\n" STR_CHEATER2 "\n\n" STR_CHEATER3 "\n" STR_CHEATER4 "\n" STR_CHEATER5); UNCACHEGRCHUNK (STARTFONT + 1); IN_ClearKeysDown (); IN_Ack (); if (viewsize < 17) DrawPlayBorder (); } // // OPEN UP DEBUG KEYS // #ifdef DEBUGKEYS if (Keyboard[sc_BackSpace] && Keyboard[sc_LShift] && Keyboard[sc_Alt] && param_debugmode) { ClearMemory (); CA_CacheGrChunk (STARTFONT + 1); ClearSplitVWB (); Message ("Debugging keys are\nnow available!"); UNCACHEGRCHUNK (STARTFONT + 1); IN_ClearKeysDown (); IN_Ack (); DrawPlayBorderSides (); DebugOk = 1; } #endif // // TRYING THE KEEN CHEAT CODE! // if (Keyboard[sc_B] && Keyboard[sc_A] && Keyboard[sc_T]) { ClearMemory (); CA_CacheGrChunk (STARTFONT + 1); ClearSplitVWB (); Message ("Commander Keen is also\n" "available from Apogee, but\n" "then, you already know\n" "that - right, Cheatmeister?!"); UNCACHEGRCHUNK (STARTFONT + 1); IN_ClearKeysDown (); IN_Ack (); if (viewsize < 18) DrawPlayBorder (); } // // pause key weirdness can't be checked as a scan code // if(buttonstate[bt_pause]) Paused = true; if(Paused) { int lastoffs = StopMusic(); LatchDrawPic (20 - 4, 80 - 2 * 8, PAUSEDPIC); VH_UpdateScreen(); IN_Ack (); Paused = false; ContinueMusic(lastoffs); if (MousePresent && IN_IsInputGrabbed()) IN_CenterMouse(); // Clear accumulated mouse movement lasttimecount = GetTimeCount(); return; } // // F1-F7/ESC to enter control panel // if ( #ifndef DEBCHECK scan == sc_F10 || #endif scan == sc_F9 || scan == sc_F7 || scan == sc_F8) // pop up quit dialog { short oldmapon = gamestate.mapon; short oldepisode = gamestate.episode; ClearMemory (); ClearSplitVWB (); US_ControlPanel (scan); DrawPlayBorderSides (); SETFONTCOLOR (0, 15); IN_ClearKeysDown (); return; } if ((scan >= sc_F1 && scan <= sc_F9) || scan == sc_Escape || buttonstate[bt_esc]) { int lastoffs = StopMusic (); ClearMemory (); VW_FadeOut (); US_ControlPanel (buttonstate[bt_esc] ? sc_Escape : scan); SETFONTCOLOR (0, 15); IN_ClearKeysDown (); VW_FadeOut(); if(viewsize != 21) DrawPlayScreen (); if (!startgame && !loadedgame) ContinueMusic (lastoffs); if (loadedgame) playstate = ex_abort; lasttimecount = GetTimeCount(); if (MousePresent && IN_IsInputGrabbed()) IN_CenterMouse(); // Clear accumulated mouse movement return; } // // TAB-? debug keys // #ifdef DEBUGKEYS if (Keyboard[sc_Tab] && DebugOk) { CA_CacheGrChunk (STARTFONT); fontnumber = 0; SETFONTCOLOR (0, 15); if (DebugKeys () && viewsize < 20) DrawPlayBorder (); // dont let the blue borders flash if (MousePresent && IN_IsInputGrabbed()) IN_CenterMouse(); // Clear accumulated mouse movement lasttimecount = GetTimeCount(); return; } #endif }