diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 0261066bb..7d8c42e27 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -665,42 +665,9 @@ void ParseOptions(void) void ReadAllRFS(); -static const char* actions[] = { - "Move_Forward", - "Move_Backward", - "Turn_Left", - "Turn_Right", - "Strafe", - "Fire", - "Open", - "Run", - "Alt_Fire", // Duke3D", Blood - "Jump", - "Crouch", - "Look_Up", - "Look_Down", - "Look_Left", - "Look_Right", - "Strafe_Left", - "Strafe_Right", - "Aim_Up", - "Aim_Down", - "SendMessage", - "Shrink_Screen", - "Enlarge_Screen", - "Show_Opponents_Weapon", - "See_Coop_View", - "Mouse_Aiming", - "Dpad_Select", - "Dpad_Aiming", - "Third_Person_View", - "Toggle_Crouch", -}; - void GameInterface::app_init() { InitCheats(); - buttonMap.SetButtons(actions, NUM_ACTIONS); memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS)); gGameOptions.nMonsterSettings = !userConfig.nomonsters; ReadAllRFS(); diff --git a/source/blood/src/blood.h b/source/blood/src/blood.h index b447e4692..71b77fc59 100644 --- a/source/blood/src/blood.h +++ b/source/blood/src/blood.h @@ -29,41 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. -enum GameFunction_t -{ - gamefunc_Move_Forward, - gamefunc_Move_Backward, - gamefunc_Turn_Left, - gamefunc_Turn_Right, - gamefunc_Strafe, - gamefunc_Fire, - gamefunc_Open, - gamefunc_Run, - gamefunc_Alt_Fire, // Duke3D, Blood - gamefunc_Jump, - gamefunc_Crouch, - gamefunc_Look_Up, - gamefunc_Look_Down, - gamefunc_Look_Left, - gamefunc_Look_Right, - gamefunc_Strafe_Left, - gamefunc_Strafe_Right, - gamefunc_Aim_Up, - gamefunc_Aim_Down, - gamefunc_SendMessage, - gamefunc_Shrink_Screen, - gamefunc_Enlarge_Screen, - gamefunc_Show_Opponents_Weapon, - gamefunc_See_Coop_View, - gamefunc_Mouse_Aiming, - gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming, - gamefunc_Third_Person_View, - gamefunc_Toggle_Crouch, - NUM_ACTIONS -}; - struct INIDESCRIPTION { const char *pzName; const char *pzFilename; diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 2f53733b4..07fafdd0e 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -871,6 +871,7 @@ int RunGame() if (exec) exec->ExecCommands(); gamestate = GS_LEVEL; + SetupGameButtons(); gi->app_init(); app_loop(); return 0; // this is never reached. app_loop only exits via exception. diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index d24afb35a..b437ba160 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -38,6 +38,8 @@ #include "gamecvars.h" #include "v_video.h" #include "statusbar.h" +#include"packet.h" +#include "gamecontrol.h" //========================================================================== // @@ -175,3 +177,46 @@ void CONTROL_GetInput(ControlInfo* info) info->dpitch += -joyaxes[JOYAXIS_Pitch] * 22.5f; } } + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +void SetupGameButtons() +{ + static const char* actions[] = { + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Shrink_Screen", + "Enlarge_Screen", + "Show_Opponents_Weapon", + "See_Coop_View", + "Mouse_Aiming", + "Dpad_Select", + "Dpad_Aiming", + "Third_Person_View", + "Toggle_Crouch", + "Quick_Kick", + }; + buttonMap.SetButtons(actions, NUM_ACTIONS); +} + diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 22f0d5c24..161fa31b8 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -62,3 +62,39 @@ extern InputState inputState; void CONTROL_GetInput(ControlInfo* info); int32_t handleevents(void); + +enum GameFunction_t +{ + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Shrink_Screen, // Automap only + gamefunc_Enlarge_Screen, // Automap only + gamefunc_Show_Opponents_Weapon, // CCMD + gamefunc_See_Coop_View, // CCMD + gamefunc_Mouse_Aiming, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Third_Person_View, // CCMD + gamefunc_Toggle_Crouch, + gamefunc_Quick_Kick, + NUM_ACTIONS +}; + +void SetupGameButtons(); diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 47bfa58db..a68d9b27a 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -36,43 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. -enum GameFunction_t -{ - gamefunc_Move_Forward, - gamefunc_Move_Backward, - gamefunc_Turn_Left, - gamefunc_Turn_Right, - gamefunc_Strafe, - gamefunc_Fire, - gamefunc_Open, - gamefunc_Run, - gamefunc_Alt_Fire, // Duke3D, Blood - gamefunc_Jump, - gamefunc_Crouch, - gamefunc_Look_Up, - gamefunc_Look_Down, - gamefunc_Look_Left, - gamefunc_Look_Right, - gamefunc_Strafe_Left, - gamefunc_Strafe_Right, - gamefunc_Aim_Up, - gamefunc_Aim_Down, - gamefunc_SendMessage, - gamefunc_Shrink_Screen, - gamefunc_Enlarge_Screen, - gamefunc_Show_Opponents_Weapon, - gamefunc_See_Coop_View, - gamefunc_Mouse_Aiming, - gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming, - gamefunc_Last_Weapon, - gamefunc_Alt_Weapon, - gamefunc_Third_Person_View, - gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. - NUM_ACTIONS, - -}; #define kTimerTicks 120 diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index 64822083a..3d441fe0c 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -3,41 +3,6 @@ // all game constants got collected here. -// Most of these should be replaced by CCMDs eventually -enum GameFunction_t -{ - gamefunc_Move_Forward, - gamefunc_Move_Backward, - gamefunc_Turn_Left, - gamefunc_Turn_Right, - gamefunc_Strafe, - gamefunc_Fire, - gamefunc_Open, - gamefunc_Run, - gamefunc_Jump, - gamefunc_Crouch, - gamefunc_Look_Up, - gamefunc_Look_Down, - gamefunc_Look_Left, - gamefunc_Look_Right, - gamefunc_Strafe_Left, - gamefunc_Strafe_Right, - gamefunc_Aim_Up, - gamefunc_Aim_Down, - gamefunc_Shrink_Screen, // CCMD - gamefunc_Enlarge_Screen, // CCMD - gamefunc_Show_Opponents_Weapon, // CCMD - gamefunc_See_Coop_View, // CCMD - gamefunc_Mouse_Aiming, // CCMD - gamefunc_Quick_Kick, - gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming, - gamefunc_Third_Person_View, // CCMD - gamefunc_Toggle_Crouch, - NUM_ACTIONS -}; - - enum { TICRATE = 120, diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index 7fc48316f..caa264c8f 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -234,47 +234,6 @@ static void setupbackdrop() // //--------------------------------------------------------------------------- -static void SetupGameButtons() -{ - static const char* actions[] = { - "Move_Forward", - "Move_Backward", - "Turn_Left", - "Turn_Right", - "Strafe", - "Fire", - "Open", - "Run", - "Jump", - "Crouch", - "Look_Up", - "Look_Down", - "Look_Left", - "Look_Right", - "Strafe_Left", - "Strafe_Right", - "Aim_Up", - "Aim_Down", - "Shrink_Screen", - "Enlarge_Screen", - "Show_Opponents_Weapon", - "See_Coop_View", - "Mouse_Aiming", - "Quick_Kick", - "Dpad_Select", - "Dpad_Aiming", - "Third_Person_View", - "Toggle_Crouch", - }; - buttonMap.SetButtons(actions, NUM_ACTIONS); -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - static void loaddefs() { const char* defsfile = G_DefFile(); diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index edf851112..e67c1283d 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -175,46 +175,10 @@ void SybexScreen(void); // //--------------------------------------------------------------------------- -static const char* actions[] = { - "Move_Forward", - "Move_Backward", - "Turn_Left", - "Turn_Right", - "Strafe", - "Fire", - "Open", - "Run", - "Alt_Fire", // Duke3D", Blood - "Jump", - "Crouch", - "Look_Up", - "Look_Down", - "Look_Left", - "Look_Right", - "Strafe_Left", - "Strafe_Right", - "Aim_Up", - "Aim_Down", - "SendMessage", - "Shrink_Screen", - "Enlarge_Screen", - "Show_Opponents_Weapon", - "See_Coop_View", - "Mouse_Aiming", - "Dpad_Select", - "Dpad_Aiming", - "Last_Weapon", - "Alt_Weapon", - "Third_Person_View", - "Toggle_Crouch", // This is the last one used by EDuke32"", - -}; - void GameInterface::app_init() { GameTicRate = 40; InitCheats(); - buttonMap.SetButtons(actions, NUM_ACTIONS); automapping = 1; gs = gs_defaults; diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 2f21873bc..b1b4244a0 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -73,42 +73,6 @@ typedef struct extern const GAME_SET gs_defaults; extern GAME_SET gs; -enum GameFunction_t -{ - gamefunc_Move_Forward, - gamefunc_Move_Backward, - gamefunc_Turn_Left, - gamefunc_Turn_Right, - gamefunc_Strafe, - gamefunc_Fire, - gamefunc_Open, - gamefunc_Run, - gamefunc_Alt_Fire, // Duke3D, Blood - gamefunc_Jump, - gamefunc_Crouch, - gamefunc_Look_Up, - gamefunc_Look_Down, - gamefunc_Look_Left, - gamefunc_Look_Right, - gamefunc_Strafe_Left, - gamefunc_Strafe_Right, - gamefunc_Aim_Up, - gamefunc_Aim_Down, - gamefunc_SendMessage, - gamefunc_Shrink_Screen, - gamefunc_Enlarge_Screen, - gamefunc_Show_Opponents_Weapon, - gamefunc_See_Coop_View, - gamefunc_Mouse_Aiming, - gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming, - gamefunc_Last_Weapon, - gamefunc_Alt_Weapon, - gamefunc_Third_Person_View, - gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. - NUM_ACTIONS -}; - enum { DREALMSPAL = 1, diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 0fff211b7..b92554978 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -420,9 +420,9 @@ getinput(InputPacket *loc, SWBOOL tied) SET(loc->bits, prev_weapon + 1); } - if (buttonMap.ButtonDown(gamefunc_Alt_Weapon)) + if (false)//buttonMap.ButtonDown(gamefunc_Alt_Weapon)) will be renabled in an upcoming commit. { - buttonMap.ClearButton(gamefunc_Alt_Weapon); + //buttonMap.ClearButton(gamefunc_Alt_Weapon); USERp u = User[pp->PlayerSprite]; short const which_weapon = u->WeaponNum + 1; SET(loc->bits, which_weapon);