From e5d38b2d307a972f6fdf3d6d3fa05600c8e6217b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 23 Oct 2019 00:59:01 +0200 Subject: [PATCH] - in_mouseflip and in_mousesmoothing in_mousemode removed from persistent state because of how it is used. Saving it makes no sense. --- source/blood/src/config.cpp | 7 ------- source/blood/src/config.h | 3 +-- source/blood/src/controls.cpp | 4 ++-- source/blood/src/menu.cpp | 18 +++++++++--------- source/blood/src/menus.cpp | 6 +++--- source/common/gamecvars.cpp | 28 +++++++++++++++------------- source/common/gamecvars.h | 5 ++++- source/duke3d/src/config.cpp | 3 +-- source/duke3d/src/game.h | 3 +-- source/duke3d/src/gamestructures.cpp | 4 ++-- source/duke3d/src/menus.cpp | 6 +++--- source/duke3d/src/player.cpp | 2 +- source/rr/src/config.cpp | 4 +--- source/rr/src/game.h | 3 +-- source/rr/src/menus.cpp | 6 +++--- source/rr/src/player.cpp | 6 +++--- source/rr/src/player.h | 1 - 17 files changed, 50 insertions(+), 59 deletions(-) diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 71ab07e16..1755acb23 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -56,7 +56,6 @@ BEGIN_BLD_NS hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL }; -int32_t SmoothInput; int32_t MouseFunctions[MAXMOUSEBUTTONS][2]; int32_t MouseDigitalFunctions[MAXMOUSEAXES][2]; int32_t MouseAnalogueAxes[MAXMOUSEAXES]; @@ -92,7 +91,6 @@ int32_t gMessageFont; int32_t gbAdultContent; char gzAdultPassword[9]; int32_t gMouseSensitivity; -int32_t gMouseAimingFlipped; bool gNoClip; bool gInfiniteAmmo; bool gFullMap; @@ -281,7 +279,6 @@ void CONFIG_SetDefaults(void) CheckForUpdates = 1; gBrightness = 8; //ud.config.ShowWeapons = 0; - SmoothInput = 1; useprecache = 1; configversion = 0; @@ -301,8 +298,6 @@ void CONFIG_SetDefaults(void) //ud.menu_slidebarmargin = 65536; //ud.menu_slidebarz = 65536; //ud.menu_slidecursorz = 65536; - //ud.menubackground = 1; - //ud.mouseflip = 1; //ud.msgdisptime = 120; //ud.pwlockout[0] = '\0'; //ud.screen_size = 4; @@ -335,8 +330,6 @@ void CONFIG_SetDefaults(void) gbAdultContent = 0; gzAdultPassword[0] = 0; - gMouseAimingFlipped = 0; - gMouseAim = 1; cl_weaponswitch = 1; Bstrcpy(szPlayerName, "Player"); diff --git a/source/blood/src/config.h b/source/blood/src/config.h index fe3113a39..29168924e 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -38,7 +38,6 @@ BEGIN_BLD_NS #define MAXPLAYERNAME 16 #define MAXMOUSEAXES 2 -extern int32_t SmoothInput; extern int32_t MouseFunctions[MAXMOUSEBUTTONS][2]; extern int32_t MouseDigitalFunctions[MAXMOUSEAXES][2]; extern int32_t MouseAnalogueAxes[MAXMOUSEAXES]; @@ -71,7 +70,7 @@ extern int32_t gMessageFont; extern int32_t gbAdultContent; extern char gzAdultPassword[9]; extern int32_t gMouseSensitivity; -extern int32_t gMouseAimingFlipped; +extern int32_t in_mouseflip; extern bool gNoClip; extern bool gInfiniteAmmo; extern bool gFullMap; diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index e8a9c0f04..d2aecf160 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -79,7 +79,7 @@ void ctrlInit(void) CONTROL_JoystickEnabled = (in_joystick && CONTROL_JoyPresent); CONTROL_MouseEnabled = (in_mouse && CONTROL_MousePresent); - CONTROL_SmoothMouse = SmoothInput; + CONTROL_SmoothMouse = in_mousesmoothing; // JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too for (int i = 0; i < joystick.numAxes; i++) @@ -492,7 +492,7 @@ void ctrlGetInput(void) gInput.q16mlook = fix16_clamp(fix16_div(fix16_from_int(info.mousey), F16(128)), F16(-127)>>2, F16(127)>>2); else forward = ClipRange(forward - info.mousey, -2048, 2048); - if (!gMouseAimingFlipped) + if (!in_mouseflip) gInput.q16mlook = -gInput.q16mlook; if (KB_KeyPressed(sc_Pause)) // 0xc5 in disassembly diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index bf597e893..3fb0bf5ba 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -237,7 +237,7 @@ CGameMenuItemChain itemChainParentalLock("PARENTAL LOCK", 3, 0, 170, 320, 1, &me CGameMenuItemTitle itemControlsTitle("CONTROLS", 1, 160, 20, 2038); CGameMenuItemSliderFloat sliderMouseSpeed("Mouse Sensitivity:", 1, 10, 70, 300, CONTROL_MouseSensitivity, 0.5f, 16.f, 0.5f, SetMouseSensitivity, -1,-1); -CGameMenuItemZBool boolMouseFlipped("Invert Mouse Aim:", 1, 10, 90, 300, gMouseAimingFlipped, SetMouseAimFlipped, NULL, NULL); +CGameMenuItemZBool boolMouseFlipped("Invert Mouse Aim:", 1, 10, 90, 300, in_mouseflip, SetMouseAimFlipped, NULL, NULL); CGameMenuItemSlider sliderTurnSpeed("Key Turn Speed:", 1, 10, 110, 300, gTurnSpeed, 64, 128, 4, SetTurnSpeed, -1, -1); CGameMenuItemChain itemChainKeyList("Configure Keys...", 1, 0, 130, 320, 1, &menuKeys, -1, NULL, 0); CGameMenuItemChain itemChainKeyReset("Reset Keys (default)...", 1, 0, 150, 320, 1, &menuKeys, -1, ResetKeys, 0); @@ -733,7 +733,7 @@ void SetupControlsMenu(void) { sliderMouseSpeed.fValue = ClipRangeF(CONTROL_MouseSensitivity, sliderMouseSpeed.fRangeLow, sliderMouseSpeed.fRangeHigh); sliderTurnSpeed.nValue = ClipRange(gTurnSpeed, sliderTurnSpeed.nRangeLow, sliderTurnSpeed.nRangeHigh); - boolMouseFlipped.at20 = gMouseAimingFlipped; + boolMouseFlipped.at20 = in_mouseflip; menuControls.Add(&itemControlsTitle, false); menuControls.Add(&sliderMouseSpeed, true); menuControls.Add(&boolMouseFlipped, false); @@ -1459,7 +1459,7 @@ void SetMouseSensitivity(CGameMenuItemSliderFloat *pItem) void SetMouseAimFlipped(CGameMenuItemZBool *pItem) { - gMouseAimingFlipped = pItem->at20; + in_mouseflip = pItem->at20; } void SetTurnSpeed(CGameMenuItemSlider *pItem) @@ -1899,12 +1899,12 @@ void UpdatePlayerName(CGameMenuItemZEdit *pItem, CGameMenuEvent *pEvent) void SetMouseFilterInput(CGameMenuItemZBool *pItem) { CONTROL_SmoothMouse = pItem->at20; - SmoothInput = pItem->at20; + in_mousesmoothing = pItem->at20; } void SetMouseAimMode(CGameMenuItemZBool *pItem) { - gMouseAiming = pItem->at20; + in_aimmode = pItem->at20; } void SetMouseVerticalAim(CGameMenuItemZBool *pItem) @@ -1970,16 +1970,16 @@ void SetupMouseMenu(CGameMenuItemChain *pItem) } } } - itemOptionsControlMouseAimFlipped.at20 = gMouseAimingFlipped; - itemOptionsControlMouseFilterInput.at20 = SmoothInput; - itemOptionsControlMouseAimMode.at20 = gMouseAiming; + itemOptionsControlMouseAimFlipped.at20 = in_mouseflip; + itemOptionsControlMouseFilterInput.at20 = in_mousesmoothing; + itemOptionsControlMouseAimMode.at20 = in_aimmode; itemOptionsControlMouseVerticalAim.at20 = gMouseAim; } void PreDrawControlMouse(CGameMenuItem *pItem) { if (pItem == &itemOptionsControlMouseVerticalAim) - pItem->bEnable = !gMouseAiming; + pItem->bEnable = !in_aimmode; } void SetMouseButton(CGameMenuItemZCycle *pItem) diff --git a/source/blood/src/menus.cpp b/source/blood/src/menus.cpp index a7686a74b..067c81cde 100644 --- a/source/blood/src/menus.cpp +++ b/source/blood/src/menus.cpp @@ -888,9 +888,9 @@ static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:" 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 ); #endif -static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip ); +static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &in_mouseflip.Value ); static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option ); -static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput ); +static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &in_mousesmoothing.Value ); static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option ); #ifndef EDUKE32_SIMPLE_MENU static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, }; @@ -3300,7 +3300,7 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption) else if (entry == &ME_SOUND_DUKETALK) snd_speech = (snd_speech&~1) | newOption; else if (entry == &ME_MOUSESETUP_SMOOTH) - CONTROL_SmoothMouse = ud.config.SmoothInput; + CONTROL_SmoothMouse = in_mousesmoothing; else if (entry == &ME_JOYSTICK_ENABLE) { if (newOption) diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index a174b234d..8c3789ff8 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -231,30 +231,35 @@ CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCAL } CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold to aim") +CVARD(Bool, in_mouseflip, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "invert vertical mouse movement") -CUSTOM_CVARD(Int, in_mousebias, 0, CVAR_INT|CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time") +CUSTOM_CVARD(Int, in_mousebias, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time") { if (self < 0) self = 0; else if (self > 32) self = 32; } -CUSTOM_CVARD(Int, in_mousedeadzone, 0, CVAR_INT|CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "amount of mouse movement to filter out") +CUSTOM_CVARD(Int, in_mousedeadzone, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "amount of mouse movement to filter out") { if (self < 0) self = 0; else if (self > 512) self = 512; } +CUSTOM_CVARD(Bool, in_mousesmoothing, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "enable/disable mouse input smoothing") +{ + CONTROL_SmoothMouse = self; +} + #if 0 +{ "in_mousesmoothing", , (void *)&in_mousesmoothing.Value, CVAR_BOOL, 0, 1 }, + +{ "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&in_mousesmoothing.Value, CVAR_BOOL, 0, 1 }, // DN3D static osdcvardata_t cvars_game[] = { - { "in_mouseflip", "invert vertical mouse movement", (void *)&ud.mouseflip, CVAR_BOOL, 0, 1 }, - { "in_mousemode", "toggles vertical mouse view", (void *)&g_myAimMode, CVAR_BOOL, 0, 1 }, - { "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&ud.config.SmoothInput, CVAR_BOOL, 0, 1 }, - { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, { "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 }, { "r_showfps", "show the frame rate counter", (void *)&ud.showfps, CVAR_INT, 0, 3 }, @@ -296,10 +301,6 @@ CUSTOM_CVARD(Int, in_mousedeadzone, 0, CVAR_INT|CVAR_GLOBALCONFIG|CVAR_ARCHIVE, static osdcvardata_t cvars_game[] = { - { "in_mouseflip", "invert vertical mouse movement", (void *)&ud.mouseflip, CVAR_BOOL, 0, 1 }, - { "in_mousemode", "toggles vertical mouse view", (void *)&g_myAimMode, CVAR_BOOL, 0, 1 }, - { "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&ud.config.SmoothInput, CVAR_BOOL, 0, 1 }, - { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, { "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 }, { "r_showfps", "show the frame rate counter", (void *)&ud.showfps, CVAR_INT, 0, 3 }, @@ -344,9 +345,6 @@ int32_t registerosdcommands(void) char buffer[256]; static osdcvardata_t cvars_game[] = { - { "in_mouseflip", "invert vertical mouse movement", (void *)&gMouseAimingFlipped, CVAR_BOOL, 0, 1 }, - { "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 }, - { "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&SmoothInput, CVAR_BOOL, 0, 1 }, // // { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, // { "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 }, @@ -410,5 +408,9 @@ int32_t registerosdcommands(void) // This needs some serious internal cleanup first, the implementation is all over the place and prone to whacking the user setting. { "color", "changes player palette", (void *)&ud.color, CVAR_INT|CVAR_MULTI, 0, MAXPALOOKUPS-1 }, + // This one gets changed at run time by the game code, so making it persistent does not work + { "in_mousemode", "toggles vertical mouse view", (void *)&in_mousemode.Value, CVAR_BOOL, 0, 1 }, + { "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 }, + */ #endif diff --git a/source/common/gamecvars.h b/source/common/gamecvars.h index 9f38c4ac7..ed44ea5bd 100644 --- a/source/common/gamecvars.h +++ b/source/common/gamecvars.h @@ -60,9 +60,12 @@ EXTERN_CVAR(Bool, r_horizcenter) EXTERN_CVAR(Bool, in_joystick) EXTERN_CVAR(Bool, in_mouse) -EXTERN_CVAR(Int, in_aimmode) +EXTERN_CVAR(Bool, in_aimmode) EXTERN_CVAR(Int, in_mousebias) EXTERN_CVAR(Int, in_mousedeadzone) +EXTERN_CVAR(Bool, in_mouseflip) +EXTERN_CVAR(Bool, in_mousemode) +EXTERN_CVAR(Bool, in_mousesmoothing) extern int hud_statusbarrange; // will be set by the game's configuration setup. bool G_ChangeHudLayout(int direction); diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 8abb0fa3c..988438e4b 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -244,7 +244,7 @@ void CONFIG_SetDefaults(void) ud.color = 0; ud.config.CheckForUpdates = 1; ud.config.ShowWeapons = 0; - ud.config.SmoothInput = 1; + in_mousesmoothing = 1; ud.config.useprecache = 1; ud.configversion = 0; ud.default_skill = 1; @@ -261,7 +261,6 @@ void CONFIG_SetDefaults(void) ud.menu_slidebarz = 65536; ud.menu_slidecursorz = 65536; ud.menubackground = 1; - ud.mouseflip = 1; ud.msgdisptime = 120; ud.pwlockout[0] = '\0'; ud.runkey_mode = 0; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 462acdb83..775cf383e 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -191,7 +191,7 @@ typedef struct { int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness; int32_t m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail; int32_t m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode; - int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip; + int32_t player_skill,level_number,volume_number,m_marker,marker; int32_t music_episode, music_level, skill_voice; int32_t playerbest; @@ -219,7 +219,6 @@ typedef struct { struct { int32_t AutoAim; int32_t ShowWeapons; - int32_t SmoothInput; // JBF 20031211: Store the input settings because // (currently) mact can't regurgitate them diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index 922562d4f..932934ceb 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -1445,7 +1445,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_USER_MAP: labelNum = G_HaveUserMap(); break; case USERDEFS_M_MARKER: labelNum = ud.m_marker; break; case USERDEFS_MARKER: labelNum = ud.marker; break; - case USERDEFS_MOUSEFLIP: labelNum = ud.mouseflip; break; + case USERDEFS_MOUSEFLIP: labelNum = !in_mouseflip; break; case USERDEFS_STATUSBARSCALE: labelNum = ud.statusbarscale; break; case USERDEFS_DRAWWEAPON: labelNum = ud.drawweapon; break; case USERDEFS_MOUSEAIMING: labelNum = in_aimmode; break; @@ -1646,7 +1646,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_VOLUME_NUMBER: ud.volume_number = iSet; break; case USERDEFS_M_MARKER: ud.m_marker = iSet; break; case USERDEFS_MARKER: ud.marker = iSet; break; - case USERDEFS_MOUSEFLIP: ud.mouseflip = iSet; break; + case USERDEFS_MOUSEFLIP: in_mouseflip = !iSet; break;//!!! case USERDEFS_STATUSBARSCALE: ud.statusbarscale = iSet; break; case USERDEFS_DRAWWEAPON: ud.drawweapon = iSet; break; case USERDEFS_MOUSEAIMING: in_aoimmode = iSet; break;//!!! diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index f4cbbd9c6..1277f4bc3 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -887,9 +887,9 @@ static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:" 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 ); #endif -static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip ); +static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &in_mouseflip.Value ); static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option ); -static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput ); +static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &in_mousesmoothing.Value ); static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option ); #ifndef EDUKE32_SIMPLE_MENU static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, }; @@ -3316,7 +3316,7 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption) else if (entry == &ME_SOUND_DUKETALK) snd_speech = (snd_speech&~1) | newOption; else if (entry == &ME_MOUSESETUP_SMOOTH) - CONTROL_SmoothMouse = ud.config.SmoothInput; + CONTROL_SmoothMouse = in_mousesmoothing; else if (entry == &ME_JOYSTICK_ENABLE) { if (newOption) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 5260d7156..d9b38c672 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2973,7 +2973,7 @@ void P_GetInput(int const playerNum) else input.fvel = -(info.mousey >> 6); - if (ud.mouseflip) input.q16horz = -input.q16horz; + if (!in_mouseflip) input.q16horz = -input.q16horz; input.q16horz -= fix16_from_int(info.dpitch) / analogExtent * analogTurnAmount; input.svel -= info.dx * keyMove / analogExtent; diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index f1c89113d..e6018c4cd 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -213,9 +213,8 @@ void CONFIG_SetDefaults(void) #endif ud.config.useprecache = 1; in_mousebias = 0; - g_myAimMode = g_player[0].ps->aim_mode = 1; + g_player[0].ps->aim_mode = 1; ud.config.ShowOpponentWeapons = 0; - ud.config.SmoothInput = 1; ud.althud = 1; ud.automsg = 0; ud.brightness = 8; @@ -238,7 +237,6 @@ void CONFIG_SetDefaults(void) ud.menu_slidebarz = 65536; ud.menu_slidebarmargin = RR ? 6 * 65536 : 65536; ud.menu_slidecursorz = RR ? 32768 : 65536; - ud.mouseflip = 1; ud.msgdisptime = 120; ud.pwlockout[0] = '\0'; ud.runkey_mode = 0; diff --git a/source/rr/src/game.h b/source/rr/src/game.h index abd134d45..a48f473a3 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -170,7 +170,7 @@ typedef struct { int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness; int32_t m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail; int32_t m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode; - int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip; + int32_t player_skill,level_number,volume_number,m_marker,marker; int32_t music_episode, music_level; int32_t playerbest; @@ -194,7 +194,6 @@ typedef struct { struct { int32_t AutoAim; int32_t ShowOpponentWeapons; - int32_t SmoothInput; // JBF 20031211: Store the input settings because // (currently) mact can't regurgitate them diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index 7d16bde5c..175e2dea8 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -841,9 +841,9 @@ static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:" 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 ); #endif -static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip ); +static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &in_mouseflip.Value ); static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option ); -static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput ); +static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &in_mousesmoothing.Value ); static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option ); #ifndef EDUKE32_SIMPLE_MENU static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, }; @@ -3721,7 +3721,7 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption) else if (entry == &ME_SOUND_DUKETALK) snd_speech = (snd_speech&~1) | newOption; else if (entry == &ME_MOUSESETUP_SMOOTH) - CONTROL_SmoothMouse = ud.config.SmoothInput; + CONTROL_SmoothMouse = in_mousesmoothing; else if (entry == &ME_JOYSTICKAXIS_ANALOG) CONTROL_MapAnalogAxis(M_JOYSTICKAXES.currentEntry, newOption, controldevice_joystick); else if (entry == &ME_NETOPTIONS_EPISODE) diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 4989e8e62..307130328 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -2824,7 +2824,7 @@ void P_GetInput(int playerNum) else input.fvel = -(info.mousey >> 6); - if (ud.mouseflip) input.q16horz = -input.q16horz; + if (!in_mouseflip) input.q16horz = -input.q16horz; input.q16horz -= fix16_from_int(info.dpitch) / analogExtent * analogTurnAmount; input.svel -= info.dx * keyMove / analogExtent; @@ -3113,7 +3113,7 @@ void P_GetInputMotorcycle(int playerNum) input.q16horz = fix16_div(fix16_from_int(info.mousey), F16(64)); - if (ud.mouseflip) input.q16horz = -input.q16horz; + if (!in_mouseflip) input.q16horz = -input.q16horz; input.q16horz -= fix16_from_int(info.dpitch) / analogExtent * analogTurnAmount; input.svel -= info.dx * keyMove / analogExtent; @@ -3411,7 +3411,7 @@ void P_GetInputBoat(int playerNum) input.q16horz = fix16_div(fix16_from_int(info.mousey), F16(64)); - if (ud.mouseflip) input.q16horz = -input.q16horz; + if (!in_mouseflip) input.q16horz = -input.q16horz; input.q16horz -= fix16_from_int(info.dpitch) / analogExtent * analogTurnAmount; input.svel -= info.dx * keyMove / analogExtent; diff --git a/source/rr/src/player.h b/source/rr/src/player.h index 527e5d6cb..41a4209d8 100644 --- a/source/rr/src/player.h +++ b/source/rr/src/player.h @@ -237,7 +237,6 @@ extern playerdata_t *const g_player; extern int16_t WeaponPickupSprites[MAX_WEAPONS]; extern hudweapon_t hudweap; extern int32_t g_levelTextTime; -extern int32_t g_myAimMode; extern int32_t g_numObituaries; extern int32_t g_numSelfObituaries; extern int32_t mouseyaxismode;