From 06424ce6fa35fa32e58c8b68c874ec92fe6cb87e Mon Sep 17 00:00:00 2001 From: FreeSlave Date: Fri, 30 Dec 2022 10:57:07 +0300 Subject: [PATCH 1/3] Track m_rawinput changes when weapon prediction is disabled --- cl_dll/input_goldsource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index bf029639..a11d26b1 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -158,7 +158,6 @@ bool isMouseRelative = false; #if _WIN32 #include "progdefs.h" -extern globalvars_t *gpGlobals; #endif int CL_IsDead( void ); @@ -781,9 +780,10 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) #if _WIN32 // update m_bRawInput occasionally: - if ( gpGlobals && gpGlobals->time - s_flRawInputUpdateTime > 1.0f ) + const float currentTime = gEngfuncs.GetClientTime(); + if ( currentTime - s_flRawInputUpdateTime > 1.0f || s_flRawInputUpdateTime == 0.0f ) { - s_flRawInputUpdateTime = gpGlobals->time; + s_flRawInputUpdateTime = currentTime; bool lockEntered = MouseThread_ActiveLock_Enter(); From e0279920c7bf32b9a67c6c383cff90a32a99d573 Mon Sep 17 00:00:00 2001 From: FreeSlave Date: Fri, 30 Dec 2022 13:14:00 +0300 Subject: [PATCH 2/3] Access m_rawinput cvar via pointer instead of CVAR_GET_FLOAT --- cl_dll/input_goldsource.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index a11d26b1..615cb3d6 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -150,6 +150,7 @@ extern cvar_t *cl_pitchspeed; extern cvar_t *cl_movespeedkey; #if _WIN32 +static cvar_t* m_rawinput = NULL; static double s_flRawInputUpdateTime = 0.0f; static bool m_bRawInput = false; static bool m_bMouseThread = false; @@ -385,7 +386,7 @@ void IN_SetMouseMode(bool enable) if (mouseparmsvalid) restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0); - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_bRawInput = m_rawinput->value != 0; if(m_bRawInput) { #if USE_SDL2 @@ -787,7 +788,7 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) bool lockEntered = MouseThread_ActiveLock_Enter(); - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_bRawInput = m_rawinput->value != 0; if(m_bRawInput && !isMouseRelative) { @@ -1571,7 +1572,8 @@ void GoldSourceInput::IN_Init (void) m_customaccel_exponent = gEngfuncs.pfnRegisterVariable ( "m_customaccel_exponent", "1", FCVAR_ARCHIVE ); #if _WIN32 - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_rawinput = gEngfuncs.pfnGetCvarPointer("m_rawinput"); + m_bRawInput = m_rawinput->value != 0; m_bMouseThread = gEngfuncs.CheckParm ("-mousethread", NULL ) != NULL; m_mousethread_sleep = gEngfuncs.pfnRegisterVariable ( "m_mousethread_sleep", "1", FCVAR_ARCHIVE ); // default to less than 1000 Hz From d11f853464ee5d951e25ce9d0eea001780b92196 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:42:23 +0500 Subject: [PATCH 3/3] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6bd77f0e..8797f054 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ git clone --recursive https://github.com/FWGS/hlsdk-portable # Build Instructions -## Windows +## Windows x86. ### Prerequisites @@ -131,7 +131,7 @@ cmake -G "Visual Studio 16 2019" -A Win32 -B build After the configuration step, `HLSDK-PORTABLE.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there. -## Windows. Using Microsoft Visual Studio 6 +## Windows x86. Using Microsoft Visual Studio 6 Microsoft Visual Studio 6 is very old, but if you still have it installed, you can use it to build this hlsdk. There are no project files, but two `.bat` files, for server and client libraries. They require variable **MSVCDir** to be set to the installation path of Visual Studio: @@ -142,7 +142,7 @@ cd dlls && compile.bat && cd ../cl_dll && compile.bat `hl.dll` and `client.dll` will appear in `dlls/` and `cl_dll/` diretories. The libraries built with msvc6 should be compatible with Windows XP. -## Linux. Using Steam Runtime in chroot +## Linux x86. Portable steam-compatible build using Steam Runtime in chroot ### Prerequisites @@ -168,7 +168,7 @@ schroot --chroot steamrt_scout_i386 -- cmake -B build-in-steamrt -S . schroot --chroot steamrt_scout_i386 -- cmake --build build-in-steamrt ``` -## Linux. Build without Steam Runtime +## Linux x86. Portable steam-compatible build without Steam Runtime ### Prerequisites @@ -190,7 +190,7 @@ cmake .. -DCMAKE_C_FLAGS="-static-libstdc++ -static-libgcc" ``` To ensure portability it's still better to build using Steam Runtime or another chroot of some older distro. -## Linux. Build in your own chroot +## Linux x86. Portable steam-compatible build in your own chroot ### Prerequisites @@ -272,11 +272,11 @@ make -j ## Other platforms -Building on other Unix-like platforms (e.g. FreeBSD) is supported. +Building on other architectures (e.g x86_64 or arm) and POSIX-compliant OSes (e.g. FreeBSD) is supported. ### Prerequisites -Install C and C++ compilers (like gcc or clang), cmake and make (or gmake) +Install C and C++ compilers (like gcc or clang), cmake and make. ### Building