diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 27b62d196..1019dd406 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -62,6 +62,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS +void LocalKeys(void); char bAddUserMap = false; bool bNoDemo = false; @@ -538,64 +539,6 @@ void StartLevel(GAMEOPTIONS *gameOptions) } -void LocalKeys(void) -{ - bool alt = inputState.AltPressed(); - bool ctrl = inputState.CtrlPressed(); - bool shift = inputState.ShiftPressed(); - if (buttonMap.ButtonDown(gamefunc_Third_Person_View) && !alt && !shift) - { - buttonMap.ClearButton(gamefunc_Third_Person_View); - if (gViewPos > VIEWPOS_0) - gViewPos = VIEWPOS_0; - else - gViewPos = VIEWPOS_1; - } - if (buttonMap.ButtonDown(gamefunc_See_Coop_View)) - { - buttonMap.ClearButton(gamefunc_See_Coop_View); - if (gGameOptions.nGameType == 1) - { - gViewIndex = connectpoint2[gViewIndex]; - if (gViewIndex == -1) - gViewIndex = connecthead; - gView = &gPlayer[gViewIndex]; - } - else if (gGameOptions.nGameType == 3) - { - int oldViewIndex = gViewIndex; - do - { - gViewIndex = connectpoint2[gViewIndex]; - if (gViewIndex == -1) - gViewIndex = connecthead; - if (oldViewIndex == gViewIndex || gMe->teamId == gPlayer[gViewIndex].teamId) - break; - } while (oldViewIndex != gViewIndex); - gView = &gPlayer[gViewIndex]; - } - } - char key; - if ((key = inputState.keyGetScan()) != 0) - { - if ((alt || shift) && gGameOptions.nGameType > 0 && key >= sc_F1 && key <= sc_F10) - { - char fk = key - sc_F1; - if (alt) - { - netBroadcastTaunt(myconnectindex, fk); - } - else - { - gPlayerMsg.Set(*CombatMacros[fk]); - gPlayerMsg.Send(); - } - buttonMap.ClearButton(gamefunc_Third_Person_View); - return; - } - } -} - bool gRestartGame = false; void ProcessFrame(void) diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index 83e99ae4d..d1a0797f4 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -74,6 +74,66 @@ float gViewAngleAdjust; float gViewLookAdjust; int gViewLookRecenter; +void LocalKeys(void) +{ + bool alt = inputState.AltPressed(); + bool ctrl = inputState.CtrlPressed(); + bool shift = inputState.ShiftPressed(); + if (buttonMap.ButtonDown(gamefunc_Third_Person_View) && !alt && !shift) + { + buttonMap.ClearButton(gamefunc_Third_Person_View); + if (gViewPos > VIEWPOS_0) + gViewPos = VIEWPOS_0; + else + gViewPos = VIEWPOS_1; + } + if (buttonMap.ButtonDown(gamefunc_See_Coop_View)) + { + buttonMap.ClearButton(gamefunc_See_Coop_View); + if (gGameOptions.nGameType == 1) + { + gViewIndex = connectpoint2[gViewIndex]; + if (gViewIndex == -1) + gViewIndex = connecthead; + gView = &gPlayer[gViewIndex]; + } + else if (gGameOptions.nGameType == 3) + { + int oldViewIndex = gViewIndex; + do + { + gViewIndex = connectpoint2[gViewIndex]; + if (gViewIndex == -1) + gViewIndex = connecthead; + if (oldViewIndex == gViewIndex || gMe->teamId == gPlayer[gViewIndex].teamId) + break; + } while (oldViewIndex != gViewIndex); + gView = &gPlayer[gViewIndex]; + } + } + char key; + if ((key = inputState.keyGetScan()) != 0) + { + if ((alt || shift) && gGameOptions.nGameType > 0 && key >= sc_F1 && key <= sc_F10) + { + char fk = key - sc_F1; + if (alt) + { + netBroadcastTaunt(myconnectindex, fk); + } + else + { + gPlayerMsg.Set(*CombatMacros[fk]); + gPlayerMsg.Send(); + } + buttonMap.ClearButton(gamefunc_Third_Person_View); + return; + } + } +} + + + void ctrlGetInput(void) { int prevPauseState = paused;