diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 3e0ce2ea9..d959fe0ee 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -93,7 +93,6 @@ int32_t gMessageFont; int32_t gbAdultContent; char gzAdultPassword[9]; int32_t gMouseSensitivity; -int32_t gMouseAiming; int32_t gMouseAimingFlipped; bool gNoClip; bool gInfiniteAmmo; @@ -306,7 +305,6 @@ void CONFIG_SetDefaults(void) //ud.menu_slidebarz = 65536; //ud.menu_slidecursorz = 65536; //ud.menubackground = 1; - //ud.mouseaiming = 0; //ud.mouseflip = 1; //ud.msgdisptime = 120; //ud.pwlockout[0] = '\0'; diff --git a/source/blood/src/config.h b/source/blood/src/config.h index 167e10fc1..2c01c617b 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -72,7 +72,6 @@ extern int32_t gMessageFont; extern int32_t gbAdultContent; extern char gzAdultPassword[9]; extern int32_t gMouseSensitivity; -extern int32_t gMouseAiming; extern int32_t gMouseAimingFlipped; extern bool gNoClip; extern bool gInfiniteAmmo; diff --git a/source/blood/src/menus.cpp b/source/blood/src/menus.cpp index 6dc0b72f1..a7686a74b 100644 --- a/source/blood/src/menus.cpp +++ b/source/blood/src/menus.cpp @@ -883,7 +883,7 @@ static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", & #ifndef EDUKE32_SIMPLE_MENU static char const *MEOSN_MOUSESETUP_AIM_TYPE [] = { "Toggle", "Hold" }; static MenuOptionSet_t MEOS_MOUSESETUP_AIM_TYPE = MAKE_MENUOPTIONSET(MEOSN_MOUSESETUP_AIM_TYPE, NULL, 0x2); -static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &ud.mouseaiming); +static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &in_aimmode.Value); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMINGTYPE, Option); static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode ); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option ); @@ -2121,7 +2121,7 @@ static void Menu_Pre(MenuID_t cm) #ifndef EDUKE32_SIMPLE_MENU case MENU_MOUSESETUP: - MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, ud.mouseaiming); + MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, in_aimmode); break; #endif case MENU_NETOPTIONS: diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index 0b75b413e..3b79dd49e 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -220,25 +220,26 @@ CUSTOM_CVARD(Int, r_fov, 90, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "change the field o CVARD(Bool, r_horizcenter, false, CVAR_ARCHIVE|CVAR_FRONTEND_BLOOD, "enable/disable centered horizon line") // only present in Blood, maybe add to others? -CUSTOM_CVARD(Bool, in_joystick, false, CVAR_ARCHIVE|CVAR_NOINITCALL, "enables input from the joystick if it is present") +CUSTOM_CVARD(Bool, in_joystick, false, CVAR_ARCHIVE||CVAR_GLOBALCONFIG|CVAR_NOINITCALL, "enables input from the joystick if it is present") { CONTROL_JoystickEnabled = (self && CONTROL_JoyPresent); } -CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_NOINITCALL, "enables input from the mouse if it is present") +CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL, "enables input from the mouse if it is present") { CONTROL_MouseEnabled = (self && CONTROL_MousePresent); } +CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold to aim")// (void *)&ud.mouseaiming, CVAR_BOOL, 0, 1 }, + #if 0 + { "in_aimmode", "0:toggle, 1:hold to aim", (void *)&gMouseAiming, CVAR_BOOL, 0, 1 }, // DN3D static osdcvardata_t cvars_game[] = { - { "in_aimmode", "0:toggle, 1:hold to aim", (void *)&ud.mouseaiming, CVAR_BOOL, 0, 1 }, - { "in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time", (void *)&ud.config.MouseBias, CVAR_INT, 0, 32 }, @@ -288,7 +289,6 @@ CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_NOINITCALL, "enables input static osdcvardata_t cvars_game[] = { - { "in_aimmode", "0:toggle, 1:hold to aim", (void *)&ud.mouseaiming, CVAR_BOOL, 0, 1 }, { "in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time", (void *)&ud.config.MouseBias, CVAR_INT, 0, 32 @@ -342,7 +342,6 @@ int32_t registerosdcommands(void) char buffer[256]; static osdcvardata_t cvars_game[] = { - { "in_aimmode", "0:toggle, 1:hold to aim", (void *)&gMouseAiming, CVAR_BOOL, 0, 1 }, { "in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time", (void *)&MouseBias, CVAR_INT, 0, 32 diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 1cbb3c8e8..ede62b1ba 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -263,7 +263,6 @@ void CONFIG_SetDefaults(void) ud.menu_slidebarz = 65536; ud.menu_slidecursorz = 65536; ud.menubackground = 1; - ud.mouseaiming = 0; ud.mouseflip = 1; ud.msgdisptime = 120; ud.pwlockout[0] = '\0'; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 9de2abb7a..6d8fcefa1 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6134,7 +6134,7 @@ static void P_SetupMiscInputSettings(void) { auto ps = g_player[myconnectindex].ps; - ps->aim_mode = ud.mouseaiming; + ps->aim_mode = in_aimmode; ps->auto_aim = cl_autoaim; ps->weaponswitch = cl_weaponswitch; } diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 9bb752bb6..cd7082998 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -175,7 +175,7 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125 + int32_t runkey_mode,statusbarscale,weaponswitch,drawweapon; // JBF 20031125 int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits; int32_t team, althud, weaponscale, textscale; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index 8772e7ca6..922562d4f 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -1448,7 +1448,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_MOUSEFLIP: labelNum = ud.mouseflip; break; case USERDEFS_STATUSBARSCALE: labelNum = ud.statusbarscale; break; case USERDEFS_DRAWWEAPON: labelNum = ud.drawweapon; break; - case USERDEFS_MOUSEAIMING: labelNum = ud.mouseaiming; break; + case USERDEFS_MOUSEAIMING: labelNum = in_aimmode; break; case USERDEFS_WEAPONSWITCH: labelNum = cl_weaponswitch; break; case USERDEFS_DEMOCAMS: labelNum = cl_democams; break; case USERDEFS_COLOR: labelNum = ud.color; break; @@ -1649,7 +1649,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_MOUSEFLIP: ud.mouseflip = iSet; break; case USERDEFS_STATUSBARSCALE: ud.statusbarscale = iSet; break; case USERDEFS_DRAWWEAPON: ud.drawweapon = iSet; break; - case USERDEFS_MOUSEAIMING: ud.mouseaiming = iSet; break; + case USERDEFS_MOUSEAIMING: in_aoimmode = iSet; break;//!!! case USERDEFS_WEAPONSWITCH: cl_weaponswitch = iSet; break; //!!! case USERDEFS_DEMOCAMS: cl_democams = iSet; break; case USERDEFS_COLOR: ud.color = iSet; break; diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 72be977f3..f4cbbd9c6 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -882,7 +882,7 @@ static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", & #ifndef EDUKE32_SIMPLE_MENU static char const *MEOSN_MOUSESETUP_AIM_TYPE [] = { "Toggle", "Hold" }; static MenuOptionSet_t MEOS_MOUSESETUP_AIM_TYPE = MAKE_MENUOPTIONSET(MEOSN_MOUSESETUP_AIM_TYPE, NULL, 0x2); -static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &ud.mouseaiming); +static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &in_aimmode.Value); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMINGTYPE, Option); static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode ); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option ); @@ -2137,7 +2137,7 @@ static void Menu_Pre(MenuID_t cm) #ifndef EDUKE32_SIMPLE_MENU case MENU_MOUSESETUP: - MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, ud.mouseaiming); + MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, in_aimmode); break; #endif case MENU_NETOPTIONS: diff --git a/source/duke3d/src/network.cpp b/source/duke3d/src/network.cpp index 48afc247f..c00bf0d2d 100644 --- a/source/duke3d/src/network.cpp +++ b/source/duke3d/src/network.cpp @@ -4807,7 +4807,7 @@ void Net_SendClientInfo(void) } tempnetbuf[l++] = 0; - tempnetbuf[l++] = g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; + tempnetbuf[l++] = g_player[myconnectindex].ps->aim_mode = in_aimmode; tempnetbuf[l++] = g_player[myconnectindex].ps->auto_aim = cl_autoaim; tempnetbuf[l++] = g_player[myconnectindex].ps->weaponswitch = cl_weaponswitch; tempnetbuf[l++] = g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 461bd5075..5d0754c99 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2907,7 +2907,7 @@ void P_GetInput(int const playerNum) CONTROL_ProcessBinds(); - if (ud.mouseaiming) + if (in_aimmode) g_myAimMode = BUTTON(gamefunc_Mouse_Aiming); else { diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index 594863ca7..a766fb9c3 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -239,7 +239,6 @@ void CONFIG_SetDefaults(void) ud.menu_slidebarz = 65536; ud.menu_slidebarmargin = RR ? 6 * 65536 : 65536; ud.menu_slidecursorz = RR ? 32768 : 65536; - ud.mouseaiming = 0; ud.mouseflip = 1; ud.msgdisptime = 120; ud.pwlockout[0] = '\0'; diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 24a693f40..19812808a 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7523,7 +7523,7 @@ static void P_SetupMiscInputSettings(void) { DukePlayer_t *ps = g_player[myconnectindex].ps; - ps->aim_mode = ud.mouseaiming; + ps->aim_mode = in_aimmode; ps->auto_aim = cl_autoaim; ps->weaponswitch = cl_weaponswitch; } diff --git a/source/rr/src/game.h b/source/rr/src/game.h index a840725bc..35af6240d 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -154,7 +154,7 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125 + int32_t runkey_mode,statusbarscale,weaponswitch,drawweapon; // JBF 20031125 int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits,automsg; int32_t team, althud, weaponscale, textscale; diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index ae907ecad..7d16bde5c 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -836,7 +836,7 @@ static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", & #ifndef EDUKE32_SIMPLE_MENU static char const *MEOSN_MOUSESETUP_AIM_TYPE [] = { "Toggle", "Hold" }; static MenuOptionSet_t MEOS_MOUSESETUP_AIM_TYPE = MAKE_MENUOPTIONSET(MEOSN_MOUSESETUP_AIM_TYPE, NULL, 0x2); -static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &ud.mouseaiming); +static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &in_aimmode.Value); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMINGTYPE, Option); static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode ); static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option ); @@ -2066,7 +2066,7 @@ static void Menu_Pre(MenuID_t cm) #ifndef EDUKE32_SIMPLE_MENU case MENU_MOUSESETUP: - MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, ud.mouseaiming); + MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, in_aimmode); break; #endif case MENU_NETOPTIONS: diff --git a/source/rr/src/net.cpp b/source/rr/src/net.cpp index 42b94d703..313f421ba 100644 --- a/source/rr/src/net.cpp +++ b/source/rr/src/net.cpp @@ -3467,7 +3467,7 @@ void Net_SendClientInfo(void) } tempbuf[l++] = 0; - tempbuf[l++] = g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; + tempbuf[l++] = g_player[myconnectindex].ps->aim_mode = in_aimmode; tempbuf[l++] = g_player[myconnectindex].ps->auto_aim = cl_autoaim; tempbuf[l++] = g_player[myconnectindex].ps->weaponswitch = cl_weaponswitch; tempbuf[l++] = g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index cd7aea2da..25bcf7b54 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -2757,7 +2757,7 @@ void P_GetInput(int playerNum) CONTROL_ProcessBinds(); - if (ud.mouseaiming) + if (in_aimmode) g_myAimMode = BUTTON(gamefunc_Mouse_Aiming); else { @@ -3063,7 +3063,7 @@ void P_GetInputMotorcycle(int playerNum) CONTROL_ProcessBinds(); - if (ud.mouseaiming) + if (in_aimmode) g_myAimMode = BUTTON(gamefunc_Mouse_Aiming); else { @@ -3361,7 +3361,7 @@ void P_GetInputBoat(int playerNum) CONTROL_ProcessBinds(); - if (ud.mouseaiming) + if (in_aimmode) g_myAimMode = BUTTON(gamefunc_Mouse_Aiming); else {