diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 210b8a66b..6f6e064ee 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -151,8 +151,8 @@ void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN]) Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys)); - Bmemset(&KeyBindings,0,sizeof(KeyBindings)); - Bmemset(&MouseBindings,0,sizeof(MouseBindings)); + Bmemset(&CONTROL_KeyBinds,0,sizeof(CONTROL_KeyBinds)); + Bmemset(&CONTROL_MouseBinds,0,sizeof(CONTROL_MouseBinds)); for (i=0; i < (int32_t)(sizeof(keydefaults)/sizeof(keydefaults[0])); i+=3) { @@ -347,10 +347,10 @@ void CONFIG_MapKey(int32_t which, kb_scancode key1, kb_scancode oldkey1, kb_scan if (ii[k] == ConsoleKeys[j].id) break; if (ConsoleKeys[j].name) - KeyBindings[ii[k]].key=Bstrdup(ConsoleKeys[j].name); + CONTROL_KeyBinds[ii[k]].key=Bstrdup(ConsoleKeys[j].name); - KeyBindings[ii[k]].repeat = 1; - KeyBindings[ii[k]].cmd[0] = 0; + CONTROL_KeyBinds[ii[k]].repeat = 1; + CONTROL_KeyBinds[ii[k]].cmd[0] = 0; tempbuf[0] = 0; for (i=NUMGAMEFUNCTIONS-1; i>=0; i--) @@ -362,11 +362,11 @@ void CONFIG_MapKey(int32_t which, kb_scancode key1, kb_scancode oldkey1, kb_scan } } - Bstrncpyz(KeyBindings[ii[k]].cmd, tempbuf, MAXBINDSTRINGLENGTH); + Bstrncpyz(CONTROL_KeyBinds[ii[k]].cmd, tempbuf, MAXBINDSTRINGLENGTH); - i = Bstrlen(KeyBindings[ii[k]].cmd); + i = Bstrlen(CONTROL_KeyBinds[ii[k]].cmd); if (i) - KeyBindings[ii[k]].cmd[i-2] = 0; // cut off the trailing "; " + CONTROL_KeyBinds[ii[k]].cmd[i-2] = 0; // cut off the trailing "; " } } @@ -734,12 +734,12 @@ void CONFIG_WriteBinds(void) // save binds and aliases to _settings.cfg Bfprintf(fp,"unbindall\n"); for (i=0; inext) if (symb->func == (void *)OSD_ALIAS) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index fb6cb3fe4..9f640d460 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -10616,7 +10616,7 @@ MAIN_LOOP_RESTART: Net_GetPackets(); // only allow binds to function if the player is actually in a game (not in a menu, typing, et cetera) or demo - bindsenabled = g_player[myconnectindex].ps->gm & (MODE_GAME|MODE_DEMO); + CONTROL_BindsEnabled = g_player[myconnectindex].ps->gm & (MODE_GAME|MODE_DEMO); #ifndef _WIN32 // stdin -> OSD input for dedicated server @@ -11005,7 +11005,7 @@ void G_BonusScreen(int32_t bonusonly) FX_StopAllSounds(); S_ClearSoundLocks(); FX_SetReverb(0L); - bindsenabled = 1; // so you can use your screenshot bind on the score screens + CONTROL_BindsEnabled = 1; // so you can use your screenshot bind on the score screens if (bonusonly) goto FRAGBONUS; diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 94adcf680..ce375ad73 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -54,10 +54,11 @@ int32_t CONTROL_Started = FALSE; //static int32_t ticrate; static int32_t CONTROL_DoubleClickSpeed; -int32_t extinput[CONTROL_NUM_FLAGS]; -keybind KeyBindings[MAXBOUNDKEYS], MouseBindings[MAXMOUSEBUTTONS]; -int32_t bindsenabled = 0; -int32_t control_smoothmouse = 0; +int32_t CONTROL_OSDInput[CONTROL_NUM_FLAGS]; +keybind CONTROL_KeyBinds[MAXBOUNDKEYS]; +keybind CONTROL_MouseBinds[MAXMOUSEBUTTONS]; +int32_t CONTROL_BindsEnabled = 0; +int32_t CONTROL_SmoothMouse = 0; static void CONTROL_GetMouseDelta(void) { @@ -65,7 +66,7 @@ static void CONTROL_GetMouseDelta(void) MOUSE_GetDelta(&x, &y); - if (control_smoothmouse) + if (CONTROL_SmoothMouse) { static int32_t lastx = 0, lasty = 0; @@ -682,7 +683,7 @@ static void CONTROL_ButtonFunctionState(int32_t *p1) do { - if (!MouseBindings[i].cmd[0]) + if (!CONTROL_MouseBinds[i].cmd[0]) { j = CONTROL_MouseButtonMapping[i].doubleclicked; if (j != KEYUNDEFINED) @@ -693,15 +694,15 @@ static void CONTROL_ButtonFunctionState(int32_t *p1) p1[j] |= CONTROL_MouseButtonState[i]; } - if (!bindsenabled) + if (!CONTROL_BindsEnabled) continue; - if (MouseBindings[i].cmd[0] && CONTROL_MouseButtonState[i]) + if (CONTROL_MouseBinds[i].cmd[0] && CONTROL_MouseButtonState[i]) { - if (MouseBindings[i].repeat || (MouseBindings[i].laststate == 0)) - OSD_Dispatch(MouseBindings[i].cmd); + if (CONTROL_MouseBinds[i].repeat || (CONTROL_MouseBinds[i].laststate == 0)) + OSD_Dispatch(CONTROL_MouseBinds[i].cmd); } - MouseBindings[i].laststate = CONTROL_MouseButtonState[i]; + CONTROL_MouseBinds[i].laststate = CONTROL_MouseButtonState[i]; } while (i--); } @@ -735,19 +736,19 @@ void CONTROL_ProcessBinds(void) { int32_t i=MAXBOUNDKEYS-1; - if (!bindsenabled) + if (!CONTROL_BindsEnabled) return; do { - if (KeyBindings[i].cmd[0]) + if (CONTROL_KeyBinds[i].cmd[0]) { - if (KB_KeyPressed(i) && (KeyBindings[i].repeat || (KeyBindings[i].laststate == 0))) + if (KB_KeyPressed(i) && (CONTROL_KeyBinds[i].repeat || (CONTROL_KeyBinds[i].laststate == 0))) { - OSD_Dispatch(KeyBindings[i].cmd); + OSD_Dispatch(CONTROL_KeyBinds[i].cmd); } - KeyBindings[i].laststate = KB_KeyPressed(i); + CONTROL_KeyBinds[i].laststate = KB_KeyPressed(i); } } while (i--); @@ -767,14 +768,14 @@ static void CONTROL_GetFunctionInput(void) do { - CONTROL_SetFlag(i, /*CONTROL_KeyboardFunctionPressed(i) | */periphs[i] | extinput[i]); + CONTROL_SetFlag(i, /*CONTROL_KeyboardFunctionPressed(i) | */periphs[i] | CONTROL_OSDInput[i]); if (CONTROL_Flags[i].cleared == FALSE) BUTTONSET(i, CONTROL_Flags[i].active); else if (CONTROL_Flags[i].active == FALSE) CONTROL_Flags[i].cleared = 0; } while (i--); - memset(extinput, 0, sizeof(extinput)); + memset(CONTROL_OSDInput, 0, sizeof(CONTROL_OSDInput)); } void CONTROL_GetInput(ControlInfo *info) diff --git a/polymer/eduke32/source/jmact/control.h b/polymer/eduke32/source/jmact/control.h index 217b24db0..96f7e7629 100644 --- a/polymer/eduke32/source/jmact/control.h +++ b/polymer/eduke32/source/jmact/control.h @@ -210,14 +210,14 @@ typedef struct binding { #define MAXMOUSEBUTTONS 10 -extern keybind KeyBindings[MAXBOUNDKEYS], MouseBindings[MAXMOUSEBUTTONS]; -extern int32_t bindsenabled; +extern keybind CONTROL_KeyBinds[MAXBOUNDKEYS], CONTROL_MouseBinds[MAXMOUSEBUTTONS]; +extern int32_t CONTROL_BindsEnabled; void CONTROL_ProcessBinds(void); #define CONTROL_NUM_FLAGS 64 -extern int32_t extinput[CONTROL_NUM_FLAGS]; -extern int32_t control_smoothmouse; +extern int32_t CONTROL_OSDInput[CONTROL_NUM_FLAGS]; +extern int32_t CONTROL_SmoothMouse; #ifdef EXTERNC }; diff --git a/polymer/eduke32/source/jmact/keyboard.h b/polymer/eduke32/source/jmact/keyboard.h index 4b8dffc42..244a86bbe 100644 --- a/polymer/eduke32/source/jmact/keyboard.h +++ b/polymer/eduke32/source/jmact/keyboard.h @@ -78,7 +78,7 @@ extern kb_scancode KB_LastScan; #define KB_ClearKeyDown( scan ) { keystatus[ ( scan ) ] = FALSE; } -#define KB_UnBoundKeyPressed( scan ) ( keystatus[ ( scan ) ] != 0 && !KeyBindings[scan].cmd[0]) +#define KB_UnBoundKeyPressed( scan ) ( keystatus[ ( scan ) ] != 0 && !CONTROL_KeyBinds[scan].cmd[0]) /* ============================================================================= diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 46d6a21e2..520c9643b 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -3833,7 +3833,7 @@ cheat_for_port_credits2: { //input smoothing ud.config.SmoothInput = !ud.config.SmoothInput; - control_smoothmouse = ud.config.SmoothInput; + CONTROL_SmoothMouse = ud.config.SmoothInput; } else if (x == NUMMOUSEFUNCTIONS+2+2) { @@ -3912,7 +3912,7 @@ cheat_for_port_credits2: if (probey == NUMMOUSEFUNCTIONS+2+1) { // mgametext(160,160+9,"This option incurs a movement delay",0,2+8+16); - control_smoothmouse = ud.config.SmoothInput; + CONTROL_SmoothMouse = ud.config.SmoothInput; } mgametextpal(240,118+9, g_myAimMode && !ud.mouseaiming ? "Yes" : "No", @@ -3973,13 +3973,13 @@ cheat_for_port_credits2: { ud.config.MouseFunctions[whichkey>>1][whichkey&1] = x; CONTROL_MapButton(x, whichkey>>1, whichkey&1, controldevice_mouse); - MouseBindings[whichkey>>1].cmd[0] = 0; // kill the bind when changing the button in the menu + CONTROL_MouseBinds[whichkey>>1].cmd[0] = 0; // kill the bind when changing the button in the menu } else { ud.config.MouseFunctions[whichkey-NUMDOUBLEMBTNS][0] = x; CONTROL_MapButton(x, whichkey-NUMDOUBLEMBTNS, 0, controldevice_mouse); - MouseBindings[whichkey-NUMDOUBLEMBTNS].cmd[0] = 0; + CONTROL_MouseBinds[whichkey-NUMDOUBLEMBTNS].cmd[0] = 0; } M_ChangeMenu(205); probey = whichkey; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 92ee7e59f..fc1057f78 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -785,7 +785,7 @@ static int32_t osdcmd_button(const osdfuncparm_t *parm) { char *p = (char *)parm->name+9; // skip "gamefunc_" // if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game - extinput[CONFIG_FunctionNameToNum(p)] = 1; // FIXME + CONTROL_OSDInput[CONFIG_FunctionNameToNum(p)] = 1; // FIXME return OSDCMD_OK; } @@ -921,19 +921,19 @@ static int32_t osdcmd_bind(const osdfuncparm_t *parm) OSD_Printf("Current key bindings:\n"); for (i=0; inumparms < 2) { - OSD_Printf("%-9s %s\"%s\"\n", ConsoleButtons[i], MouseBindings[i].repeat?"":"norepeat ", - MouseBindings[i].cmd); + OSD_Printf("%-9s %s\"%s\"\n", ConsoleButtons[i], CONTROL_MouseBinds[i].repeat?"":"norepeat ", + CONTROL_MouseBinds[i].cmd); return OSDCMD_OK; } j = 1; - MouseBindings[i].repeat = 1; + CONTROL_MouseBinds[i].repeat = 1; if (parm->numparms >= 2 && !Bstrcasecmp(parm->parms[j],"norepeat")) { - MouseBindings[i].repeat = 0; + CONTROL_MouseBinds[i].repeat = 0; j++; } @@ -976,9 +976,9 @@ static int32_t osdcmd_bind(const osdfuncparm_t *parm) Bstrcat(tempbuf," "); Bstrcat(tempbuf,parm->parms[j++]); } - Bstrncpy(MouseBindings[i].cmd,tempbuf, MAXBINDSTRINGLENGTH-1); + Bstrncpy(CONTROL_MouseBinds[i].cmd,tempbuf, MAXBINDSTRINGLENGTH-1); - MouseBindings[i].key=ConsoleButtons[i]; + CONTROL_MouseBinds[i].key=ConsoleButtons[i]; if (!OSD_ParsingScript()) OSD_Printf("%s\n",parm->raw); return OSDCMD_OK; @@ -986,17 +986,17 @@ static int32_t osdcmd_bind(const osdfuncparm_t *parm) if (parm->numparms < 2) { - OSD_Printf("%-9s %s\"%s\"\n", ConsoleKeys[i].name, KeyBindings[ConsoleKeys[i].id].repeat?"":"norepeat ", - KeyBindings[ConsoleKeys[i].id].cmd); + OSD_Printf("%-9s %s\"%s\"\n", ConsoleKeys[i].name, CONTROL_KeyBinds[ConsoleKeys[i].id].repeat?"":"norepeat ", + CONTROL_KeyBinds[ConsoleKeys[i].id].cmd); return OSDCMD_OK; } j = 1; - KeyBindings[ConsoleKeys[i].id].repeat = 1; + CONTROL_KeyBinds[ConsoleKeys[i].id].repeat = 1; if (parm->numparms >= 2 && !Bstrcasecmp(parm->parms[j],"norepeat")) { - KeyBindings[ConsoleKeys[i].id].repeat = 0; + CONTROL_KeyBinds[ConsoleKeys[i].id].repeat = 0; j++; } @@ -1006,9 +1006,9 @@ static int32_t osdcmd_bind(const osdfuncparm_t *parm) Bstrcat(tempbuf," "); Bstrcat(tempbuf,parm->parms[j++]); } - Bstrncpy(KeyBindings[ConsoleKeys[i].id].cmd,tempbuf, MAXBINDSTRINGLENGTH-1); + Bstrncpy(CONTROL_KeyBinds[ConsoleKeys[i].id].cmd,tempbuf, MAXBINDSTRINGLENGTH-1); - KeyBindings[ConsoleKeys[i].id].key=ConsoleKeys[i].name; + CONTROL_KeyBinds[ConsoleKeys[i].id].key=ConsoleKeys[i].name; { char *cp = tempbuf; @@ -1055,12 +1055,12 @@ static int32_t osdcmd_unbindall(const osdfuncparm_t *parm) UNREFERENCED_PARAMETER(parm); for (i=0; i= MAXMOUSEBUTTONS) return OSDCMD_SHOWHELP; - MouseBindings[i].repeat = 0; - MouseBindings[i].cmd[0] = 0; + CONTROL_MouseBinds[i].repeat = 0; + CONTROL_MouseBinds[i].cmd[0] = 0; OSD_Printf("unbound %s\n",ConsoleButtons[i]); return OSDCMD_OK; } - KeyBindings[ConsoleKeys[i].id].repeat = 0; - KeyBindings[ConsoleKeys[i].id].cmd[0] = 0; + CONTROL_KeyBinds[ConsoleKeys[i].id].repeat = 0; + CONTROL_KeyBinds[ConsoleKeys[i].id].cmd[0] = 0; OSD_Printf("unbound key %s\n",ConsoleKeys[i].name);