From 44ffcf24fd8301ae79c69640ba2d1e6b5a12e56a Mon Sep 17 00:00:00 2001 From: pierow Date: Tue, 21 Nov 2023 03:46:47 -0500 Subject: [PATCH 1/7] version number to v33b8 --- main/source/util/Balance.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/source/util/Balance.txt b/main/source/util/Balance.txt index b6d67114..376db59e 100644 --- a/main/source/util/Balance.txt +++ b/main/source/util/Balance.txt @@ -121,7 +121,7 @@ #define kGameHDSpaceNeeded 300 #define kGameVersionMajor 3 #define kGameVersionMinor 3 -#define kGameVersionRevision 7 +#define kGameVersionRevision 8 #define kGestateBaseArmor 150 #define kGestateHealth 200 #define kGorgeArmorUpgrade 50 From deffcba07cffd93d8c0fa2981f0955ecdeedb275 Mon Sep 17 00:00:00 2001 From: pierow Date: Sat, 25 Nov 2023 13:44:53 -0500 Subject: [PATCH 2/7] sv_rollangle 0 --- main/config.cfg | 1 + main/listenserver.cfg | 3 +++ main/server.cfg | 3 +++ 3 files changed, 7 insertions(+) diff --git a/main/config.cfg b/main/config.cfg index b8354cfb..d075d0c9 100644 --- a/main/config.cfg +++ b/main/config.cfg @@ -181,6 +181,7 @@ cl_cross "1" rate "30000" cl_bob "0" cl_weaponswap "2" +sv_rollangle "0" +mlook exec userconfig.cfg diff --git a/main/listenserver.cfg b/main/listenserver.cfg index 33b1b43e..24c924b6 100644 --- a/main/listenserver.cfg +++ b/main/listenserver.cfg @@ -83,3 +83,6 @@ mp_uplink 0 // Needed so this file is executed on map change, like pre-NS v2.1 mapchangecfgfile listenserver.cfg + +//Post HL 25th Aniversary update +sv_rollangle 0 diff --git a/main/server.cfg b/main/server.cfg index d94fdd1d..f97ab581 100644 --- a/main/server.cfg +++ b/main/server.cfg @@ -100,3 +100,6 @@ mp_uplink 1 // Needed so this file is executed on map change, like pre-NS v2.1 mapchangecfgfile server.cfg + +//Post HL 25th Aniversary update +sv_rollangle 0 From bf34643be302bdd2e14af9b8ba68d71139e00b16 Mon Sep 17 00:00:00 2001 From: pierow Date: Sat, 25 Nov 2023 13:46:15 -0500 Subject: [PATCH 3/7] revise mouse paramater comments --- main/source/cl_dll/inputw32.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main/source/cl_dll/inputw32.cpp b/main/source/cl_dll/inputw32.cpp index 13f76358..9660f29e 100644 --- a/main/source/cl_dll/inputw32.cpp +++ b/main/source/cl_dll/inputw32.cpp @@ -96,8 +96,9 @@ int old_mouse_x, old_mouse_y, mx_accum, my_accum; float mouse_x, mouse_y; static int restore_spi; -//// Previous code from HL SDK windows98 for era paramaters. See comments in IN_StartupMouse. +//// Previous code from Quake era forced mouse accel. Also adjusted launch params in IN_StartupMouse. //static int originalmouseparms[3], newmouseparms[3] = {0, 0, 1}; +////Mouse accel forced off. static int originalmouseparms[3], newmouseparms[3] = { 0, 0, 0}; static int mouseactive = 0; int mouseinitialized; @@ -389,12 +390,7 @@ void IN_StartupMouse (void) if (mouseparmsvalid) { - //// Original mouse parameter code. SPI_GETMOUSE windows parameters changed either in win2000 or winxp and these launch parameters haven't made sense since. - //// The newmouseparms[2] (mouse accel on/off in newer windows) was also hardcoded to 1 previously, forcing acceleration on for players without noforcemspd or noforcemparms parameters. This was done so to make mouse speed = 1 in win98. - //// SPI_GETMOUSE documentation: - //// Win10: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa - //// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event - //// Win98: Retrieve the x-axis and y-axis threshold values for the mouse as well as the mouse speed. uiParam must be 0. pvParam is a 3-element array of Long-type variables which receives the x-threshold, y-threshold, and mouse speed. + //// Original mouse parameter code before disabling forced mouse acceleration. //if ( gEngfuncs.CheckParm ("-noforcemspd", NULL ) ) // newmouseparms[2] = originalmouseparms[2]; // From 0e88d368b93c768d54a7c6a06b1f5c2b02f9a3a1 Mon Sep 17 00:00:00 2001 From: pierow Date: Mon, 27 Nov 2023 16:01:49 -0500 Subject: [PATCH 4/7] HL25 fixes -Add new widescreen method and exploit prevention -disable old widescreen method and exploit prevention -force sv_rollangle 0 -add sv_widescreenclamp to limit fov expansion to 16:9 --- main/source/cl_dll/hud_update.cpp | 71 ++++++++++++++-------------- main/source/cl_dll/input.cpp | 4 +- main/source/cl_dll/util.cpp | 9 +++- main/source/dlls/game.cpp | 5 ++ main/source/mod/AvHClientVariables.h | 2 +- main/source/mod/AvHGamerules.cpp | 2 + main/source/mod/AvHHud.cpp | 50 ++++++++++++++++++++ main/source/mod/AvHHud.h | 3 ++ main/source/mod/AvHServerVariables.h | 3 ++ 9 files changed, 109 insertions(+), 40 deletions(-) diff --git a/main/source/cl_dll/hud_update.cpp b/main/source/cl_dll/hud_update.cpp index 7ae6be42..061e6906 100644 --- a/main/source/cl_dll/hud_update.cpp +++ b/main/source/cl_dll/hud_update.cpp @@ -41,47 +41,46 @@ int CHud::UpdateClientData(client_data_t *cdata, float time) Think(); - //cdata->fov = m_iFOV; + cdata->fov = m_iFOV; - float width = ScreenWidth(); - float height = ScreenHeight(); + //// Horizontal+ widescreen view correction - Removed after HL25 update + //float width = ScreenWidth(); + //float height = ScreenHeight(); - // Horizontal+ widescreen view correction - engine uses vertical- cropping + //// Cvar to let players use old widescreen. Only allow it to change when not alive so it can't be used as a zoom toggle. + //if (!gHUD.GetIsAlive(false)) + //{ + // wstoggle = CVAR_GET_FLOAT("cl_widescreen") != 0; + //} - // Cvar to let players use old widescreen. Only allow it to change when not alive so it can't be used as a zoom toggle. - if (!gHUD.GetIsAlive(false)) - { - wstoggle = CVAR_GET_FLOAT("cl_widescreen") != 0; - } + //if (wstoggle) + //{ + // m_wsFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI; - if (wstoggle) - { - m_wsFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI; + // //clamp for game balance + // if (m_iFOV == 105 && m_wsFOV > 121) + // { + // m_wsFOV = 120; + // } + // else if (m_iFOV == 100 && m_wsFOV > 117) + // { + // m_wsFOV = 116; + // } + // else if (m_iFOV == 90 && m_wsFOV > 107) + // { + // m_wsFOV = 106; + // } + // else if (m_wsFOV < 90) + // { + // m_wsFOV = 90; + // } + //} + //else + //{ + // m_wsFOV = m_iFOV; + //} - //clamp for game balance - if (m_iFOV == 105 && m_wsFOV > 121) - { - m_wsFOV = 120; - } - else if (m_iFOV == 100 && m_wsFOV > 117) - { - m_wsFOV = 116; - } - else if (m_iFOV == 90 && m_wsFOV > 107) - { - m_wsFOV = 106; - } - else if (m_wsFOV < 90) - { - m_wsFOV = 90; - } - } - else - { - m_wsFOV = m_iFOV; - } - - cdata->fov = m_wsFOV; + //cdata->fov = m_wsFOV; CL_ResetButtonBits( m_iKeyBits ); diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp index 5724e271..ba805e31 100644 --- a/main/source/cl_dll/input.cpp +++ b/main/source/cl_dll/input.cpp @@ -138,7 +138,7 @@ cvar_t *cl_dynamiclights; cvar_t *r_dynamic; cvar_t *cl_buildmessages; cvar_t *cl_particleinfo; -cvar_t *cl_widescreen; +//cvar_t *cl_widescreen; cvar_t *cl_ambientsound; cvar_t *senslock; cvar_t *hud_style; @@ -1638,7 +1638,7 @@ void InitInput (void) cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE ); //cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE ); cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE ); - cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE ); + //cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE ); cl_ambientsound = gEngfuncs.pfnRegisterVariable ( kvAmbientSound, "0", FCVAR_ARCHIVE); senslock = gEngfuncs.pfnRegisterVariable ("senslock", "0", FCVAR_ARCHIVE); hud_style = gEngfuncs.pfnRegisterVariable ("hud_style", "1", FCVAR_ARCHIVE); diff --git a/main/source/cl_dll/util.cpp b/main/source/cl_dll/util.cpp index f6d3e454..ef53dfea 100644 --- a/main/source/cl_dll/util.cpp +++ b/main/source/cl_dll/util.cpp @@ -182,7 +182,14 @@ void CreatePickingRay( int mousex, int mousey, Vector& outVecPickingRay ) // char gDebugMessage[256]; - float fovDegrees = gHUD.m_wsFOV; + //float fovDegrees = gHUD.m_wsFOV; + bool wideScreen = CVAR_GET_FLOAT("gl_widescreen_yfov"); + float fovDegrees = gHUD.m_iFOV; + //Adjust for widescreen FOV + if (wideScreen) + { + fovDegrees = atanf(tan(gHUD.m_iFOV * M_PI / 360) * 0.75f * ScreenWidth() / ScreenHeight()) * 360 / M_PI; + } //cl_entity_s* theLocalEntity = gEngfuncs.GetLocalPlayer(); //Vector vecRenderOrigin = theLocalEntity->origin; diff --git a/main/source/dlls/game.cpp b/main/source/dlls/game.cpp index 03554246..4fd05f8b 100644 --- a/main/source/dlls/game.cpp +++ b/main/source/dlls/game.cpp @@ -123,6 +123,7 @@ cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER}; cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER}; cvar_t avh_jumpmode = {kvJumpMode, "1", FCVAR_SERVER}; cvar_t avh_version = {kvVersion, "330", FCVAR_SERVER}; +cvar_t avh_widescreenclamp = {kvWidescreenClamp, "0", FCVAR_SERVER}; //playtest cvars cvar_t avh_fastjp = {kvfastjp, "0", FCVAR_SERVER}; cvar_t avh_randomrfk = {kvRandomRfk, "1", FCVAR_SERVER}; @@ -239,6 +240,7 @@ void GameDLLInit( void ) CVAR_REGISTER (&avh_blockscripts); CVAR_REGISTER (&avh_jumpmode); CVAR_REGISTER (&avh_version); + CVAR_REGISTER (&avh_widescreenclamp); //playtest cvars CVAR_REGISTER (&avh_fastjp); CVAR_REGISTER (&avh_randomrfk); @@ -270,5 +272,8 @@ void GameDLLInit( void ) CVAR_REGISTER (&avh_uplink); CVAR_REGISTER (&avh_killdelay); + //Remove HL25 addition of roll angle in code so servers don't need to update configs. + CVAR_SET_FLOAT("sv_rollangle", 0.0f); + } diff --git a/main/source/mod/AvHClientVariables.h b/main/source/mod/AvHClientVariables.h index 9c507a83..9e5d1c56 100644 --- a/main/source/mod/AvHClientVariables.h +++ b/main/source/mod/AvHClientVariables.h @@ -47,7 +47,7 @@ extern cvar_t* cl_musicdir; // : #define kvCMHotKeys "cl_cmhotkeys" //#define kvForceDefaultFOV "cl_forcedefaultfov" -#define kvWidescreen "cl_widescreen" +//#define kvWidescreen "cl_widescreen" #define kvAmbientSound "cl_ambientsound" #define kvCenterEntityID "cl_centerentityid" #define kvHighDetail "cl_highdetail" diff --git a/main/source/mod/AvHGamerules.cpp b/main/source/mod/AvHGamerules.cpp index 56c5ae32..598197f7 100644 --- a/main/source/mod/AvHGamerules.cpp +++ b/main/source/mod/AvHGamerules.cpp @@ -338,6 +338,8 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO) RegisterServerVariable(avh_cheats); RegisterServerVariable(&avh_structurelimit); RegisterServerVariable(&avh_version); + RegisterServerVariable(&avh_widescreenclamp); + //playtest cvars RegisterServerVariable(&avh_fastjp); RegisterServerVariable(&avh_randomrfk); diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index f400937c..a437cf0a 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -4883,6 +4883,8 @@ cvar_t *lightgamma = NULL; cvar_t *texgamma = NULL; cvar_t *r_detailtextures = NULL; cvar_t *gl_max_size = NULL; +cvar_t *gl_widescreen_yfov = NULL; +cvar_t *sv_widescreenclamp = NULL; void AvHHud::InitExploitPrevention() { gl_monolights = gEngfuncs.pfnGetCvarPointer("gl_monolights"); @@ -4897,6 +4899,7 @@ void AvHHud::InitExploitPrevention() { texgamma = gEngfuncs.pfnGetCvarPointer("texgamma"); r_detailtextures = gEngfuncs.pfnGetCvarPointer("r_detailtextures"); gl_max_size = gEngfuncs.pfnGetCvarPointer("gl_max_size"); + gl_widescreen_yfov = gEngfuncs.pfnGetCvarPointer("gl_widescreen_yfov"); ForceCvar("gl_monolights", gl_monolights, 0.0f); ForceCvar("gl_overbright", gl_overbright, 0.0f); @@ -4922,6 +4925,11 @@ void AvHHud::InitExploitPrevention() { if(texgamma && texgamma->value > 5.0) { ForceCvar("texgamma", texgamma, 5.0f); } + RemoveAlias("gl_widescreen_yfov"); + if (gl_widescreen_yfov) + { + mWideScreen = gl_widescreen_yfov->value; + } } @@ -4952,6 +4960,48 @@ void AvHHud::UpdateExploitPrevention() if(texgamma && texgamma->value > 5.0) { ForceCvar("texgamma", texgamma, 5.0f); } + //Widescreen exploit prevention + if (gViewPort) + { + if (gHUD.GetIsAlive(false)) + { + if (gl_widescreen_yfov && gl_widescreen_yfov->value == 0 && mWideScreen) { + ForceCvar("gl_widescreen_yfov", gl_widescreen_yfov, 1.0f); + mWideScreenChanged = true; + gEngfuncs.pfnCenterPrint("The Widescreen FOV\n will change after death\n"); + } + if (gl_widescreen_yfov && gl_widescreen_yfov->value != 0 && !mWideScreen) { + ForceCvar("gl_widescreen_yfov", gl_widescreen_yfov, 0); + mWideScreenChanged = true; + gEngfuncs.pfnCenterPrint("The Widescreen FOV\n will change after death\n"); + } + } + else if (mWideScreenChanged) + { + mWideScreen = !mWideScreen; + ForceCvar("gl_widescreen_yfov", gl_widescreen_yfov, (float)mWideScreen); + mWideScreenChanged = false; + } + else + { + mWideScreen = gl_widescreen_yfov->value; + } + + //sv_widescreenclamp is to prevent abuse of ultra-widescreen FOVs in competitive play. + if ((ScreenWidth() / ScreenHeight()) > 1.8f) + { + if (this->GetServerVariableFloat(kvWidescreenClamp) != 0 && gl_widescreen_yfov && gl_widescreen_yfov->value != 0) + { + ForceCvar("gl_widescreen_yfov", gl_widescreen_yfov, 0); + gEngfuncs.pfnCenterPrint("This aspect ratio is not allowed\n on this server\n"); + } + } + } + //else if (gl_widescreen_yfov) + //{ + // mWideScreen = gl_widescreen_yfov->value; + // gEngfuncs.Con_Printf("init mwidescreen from update %d\n", mWideScreen); + //} } void AvHHud::UpdateAlienUI(float inCurrentTime) diff --git a/main/source/mod/AvHHud.h b/main/source/mod/AvHHud.h index 5090f5c3..53085d8e 100644 --- a/main/source/mod/AvHHud.h +++ b/main/source/mod/AvHHud.h @@ -876,6 +876,9 @@ private: static bool sShowMap; + bool mWideScreen; + bool mWideScreenChanged; + }; #endif diff --git a/main/source/mod/AvHServerVariables.h b/main/source/mod/AvHServerVariables.h index 63d1af9c..e5eae623 100644 --- a/main/source/mod/AvHServerVariables.h +++ b/main/source/mod/AvHServerVariables.h @@ -96,6 +96,7 @@ extern cvar_t *violence_agibs; extern cvar_t avh_killdelay; extern cvar_t *showtriggers; extern cvar_t avh_version; +extern cvar_t avh_widescreenclamp; //playtest cvars extern cvar_t avh_fastjp; extern cvar_t avh_randomrfk; @@ -149,6 +150,8 @@ float ns_cvar_float(const cvar_t *cvar); #define kvBlockScripts "mp_blockscripts" #define kvJumpMode "sv_jumpmode" #define kvVersion "sv_nsversion" +#define kvWidescreenClamp "sv_widescreenclamp" + //playtest cvars #define kvfastjp "sv_fastjp" #define kvRandomRfk "mp_randomresfromkill" From 56512a8f45ba0d24a16509f59571a26248b10639 Mon Sep 17 00:00:00 2001 From: pierow Date: Wed, 6 Dec 2023 05:46:16 -0500 Subject: [PATCH 5/7] additional removal of old widescreen --- main/source/cl_dll/chud.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/source/cl_dll/chud.h b/main/source/cl_dll/chud.h index c3d26efc..f2cab7a1 100644 --- a/main/source/cl_dll/chud.h +++ b/main/source/cl_dll/chud.h @@ -24,7 +24,7 @@ public: AVHHSPRITE m_hsprCursor; float m_flTime; // the current client time float m_fOldTime; // the time at which the HUD was last redrawn - float m_wsFOV; //fov recalc corrected for widescreen + //float m_wsFOV; //fov recalc corrected for widescreen double m_flTimeDelta; // the difference between flTime and fOldTime Vector m_vecOrigin; Vector m_vecAngles; From abef5c5cca085c2debf30541d11b97cbf7b98356 Mon Sep 17 00:00:00 2001 From: pierow Date: Sat, 13 Jan 2024 21:22:04 -0500 Subject: [PATCH 6/7] fix view spin when disabling the cursor -revisit this when HL25 SDK is released --- main/source/cl_dll/inputw32.cpp | 31 ++++++++++++++++++++--- main/source/mod/AvHPieMenuHandler.cpp | 36 +++++++++++++++------------ main/source/ui/UIManager.cpp | 11 +++++--- 3 files changed, 55 insertions(+), 23 deletions(-) diff --git a/main/source/cl_dll/inputw32.cpp b/main/source/cl_dll/inputw32.cpp index 9660f29e..b741c25f 100644 --- a/main/source/cl_dll/inputw32.cpp +++ b/main/source/cl_dll/inputw32.cpp @@ -105,6 +105,9 @@ int mouseinitialized; static int mouseparmsvalid; static int mouseshowtoggle = 1; +////2024 - Added to fix view spin when disabling the cursor. +static bool cursorDisabledThisFrame = false; + // joystick defines and variables // where should defines be moved? #define JOY_ABSOLUTE_AXIS 0x00000000 // control like a joystick @@ -312,7 +315,21 @@ void IN_SetVisibleMouse(bool visible) g_iVisibleMouse = visible; - IN_SetMouseMode(!visible); + ////2024 - Disabled this as SDL mouse mode is handled per use of UIManager::SetMouseVisibility to fix edge case bugs with centering and showing/not showing cursor in game and in the escape menu. + //IN_SetMouseMode(!visible); + + //2024 - Added to fix view spin when disabling the cursor. Reassess after new SDK is released. + cursorDisabledThisFrame = (!visible); + + ////2024 - Move centering here? + //if (visible && gHUD.m_bWindowed) + //{ + // gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); + //} + //else + //{ + // gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //} #ifdef _WIN32 UpdateMouseThreadActive(); @@ -642,6 +659,14 @@ void IN_GetMouseDelta( int *pOutX, int *pOutY) mx = deltaX + mx_accum; my = deltaY + my_accum; } + //2024 - Added to fix view spin when disabling the cursor. + if (cursorDisabledThisFrame) + { + mx = 0; + my = 0; + + cursorDisabledThisFrame = false; + } mx_accum = 0; my_accum = 0; @@ -756,7 +781,7 @@ void IN_MouseMove ( float frametime, usercmd_t *cmd) } } } - + gEngfuncs.SetViewAngles( (float *)viewangles ); /* @@ -801,7 +826,7 @@ void CL_DLLEXPORT IN_Accumulate (void) int deltaX, deltaY; SDL_GetRelativeMouseState( &deltaX, &deltaY ); mx_accum += deltaX; - my_accum += deltaY; + my_accum += deltaY; } // force the mouse to the center, so there's room to move diff --git a/main/source/mod/AvHPieMenuHandler.cpp b/main/source/mod/AvHPieMenuHandler.cpp index ef25c164..79e05bff 100644 --- a/main/source/mod/AvHPieMenuHandler.cpp +++ b/main/source/mod/AvHPieMenuHandler.cpp @@ -79,7 +79,7 @@ PieMenu* AvHPieMenuHandler::GetActivePieMenu() void AvHPieMenuHandler::ClosePieMenu(void) { - + //if (!sPieMenuOpen) //{ // return; @@ -138,7 +138,7 @@ void AvHPieMenuHandler::InternalClosePieMenu(void) if(!gHUD.GetInTopDownMode()) { gHUD.GetManager().SetMouseVisibility(false); - + // OS cursor displaying over in game cursor fix. Remove if showcursor code in SetMouseVisibility is made bug free. #ifdef WIN32 if(sPieMenuOpen) @@ -153,11 +153,12 @@ void AvHPieMenuHandler::InternalClosePieMenu(void) } sLastNodeHighlighted = NULL; - // Return to raw input after menu closes - if (CVAR_GET_FLOAT("m_rawinput") != 0 && sPieMenuOpen) - { - SDL_SetRelativeMouseMode(SDL_TRUE); - } + //// Not needed post-HL25. + //// Return to raw input after menu closes + //if (CVAR_GET_FLOAT("m_rawinput") != 0 && sPieMenuOpen) + //{ + // SDL_SetRelativeMouseMode(SDL_TRUE); + //} // if(sTheDebugBool) // { @@ -199,10 +200,11 @@ void AvHPieMenuHandler::OpenPieMenu(void) gHUD.HideCrosshair(); - // Workaround for not being able to center mouse with raw input enabled. + // Center mouse for raw input. if (CVAR_GET_FLOAT("m_rawinput") != 0 && !sPieMenuOpen) { - SDL_SetRelativeMouseMode(SDL_FALSE); + //// Not needed post-HL25. + //SDL_SetRelativeMouseMode(SDL_FALSE); if (gHUD.m_bWindowed) { @@ -299,13 +301,15 @@ void AvHPieMenuHandler::cursorMoved(int x,int y,Panel* panel) // char theMessage[128]; // sprintf(theMessage, "AvHPieMenuHandler::cursorMoved %d, %d (panel ptr: %d).\n", x, y, (int)panel); // CenterPrint(theMessage); - if (sPieMenuOpen && CVAR_GET_FLOAT("m_rawinput") != 0) - { - if (SDL_GetRelativeMouseMode() != SDL_TRUE) - { - SDL_SetRelativeMouseMode(SDL_TRUE); - } - } + + //// Not needed post-HL25. + //if (sPieMenuOpen && CVAR_GET_FLOAT("m_rawinput") != 0) + //{ + // if (SDL_GetRelativeMouseMode() != SDL_TRUE) + // { + // SDL_SetRelativeMouseMode(SDL_TRUE); + // } + //} } void AvHPieMenuHandler::cursorEntered(Panel* panel) diff --git a/main/source/ui/UIManager.cpp b/main/source/ui/UIManager.cpp index 90064c29..d7ea9a74 100644 --- a/main/source/ui/UIManager.cpp +++ b/main/source/ui/UIManager.cpp @@ -27,6 +27,7 @@ extern "C" void* VGui_GetPanel(); } extern int g_iVisibleMouse; +void IN_SetVisibleMouse(bool visible); UIManager::UIManager(UIFactory* inFactory) { @@ -295,12 +296,14 @@ bool UIManager::SetLMBActionRelative(const TRTag& inTag) void UIManager::SetMouseVisibility(bool inState) { // 2021 - Check if we need to run code. Prevents showcursor from incrementing or decrementing outside of useful range. - int NewDesiredState = (inState) ? 1 : 0; + int newDesiredState = (inState) ? 1 : 0; - if (g_iVisibleMouse != NewDesiredState) + if (g_iVisibleMouse != newDesiredState) { // To change whether the mouse is visible, just change this variable - g_iVisibleMouse = NewDesiredState; + //g_iVisibleMouse = newDesiredState; + //2024 - Using this to fix view spin on reactivation in HL25. SDL mouse modes are changed alongside the use of SetMouseVisibility instead of in this function so the cursor doesn't disappear in the escape menu. + IN_SetVisibleMouse(newDesiredState); // Update cursor if(g_iVisibleMouse) @@ -326,7 +329,7 @@ void UIManager::SetMouseVisibility(bool inState) // Move mouse to center of screen so mouse look isn't changed // Only do this when in full screen - App::getInstance()->setCursorPos(ScreenWidth()/2, ScreenHeight()/2); + App::getInstance()->setCursorPos(ScreenWidth()/2, ScreenHeight()/2); // Hide cursor again App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_none) ); From 1dc828e071946b08887045efaed4b2427b717d4d Mon Sep 17 00:00:00 2001 From: pierow Date: Mon, 4 Mar 2024 23:15:08 -0500 Subject: [PATCH 7/7] force sv_allow_shaders 0 --- main/source/dlls/game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/source/dlls/game.cpp b/main/source/dlls/game.cpp index 4fd05f8b..4dabefe4 100644 --- a/main/source/dlls/game.cpp +++ b/main/source/dlls/game.cpp @@ -272,8 +272,9 @@ void GameDLLInit( void ) CVAR_REGISTER (&avh_uplink); CVAR_REGISTER (&avh_killdelay); - //Remove HL25 addition of roll angle in code so servers don't need to update configs. + //Remove HL25 addition of roll angle and overbright shader in code so servers don't need to update configs. CVAR_SET_FLOAT("sv_rollangle", 0.0f); + CVAR_SET_FLOAT("sv_allow_shaders", 0.0f); }