From 27ebf408495a422c3e8db07ff52cf908bd4deb93 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 6 Jun 2021 22:15:36 +0300 Subject: [PATCH 1/8] Add github workflow and change the link and badge from travis to github actions (#174) --- .github/workflows/.github.yml | 27 +++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/.github.yml diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml new file mode 100644 index 00000000..d3d87559 --- /dev/null +++ b/.github/workflows/.github.yml @@ -0,0 +1,27 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + compiler: [gcc, clang] + include: + - compiler: gcc + cpp-compiler: g++ + - compiler: clang + cpp-compiler: clang++ + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cpp-compiler }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + run: sudo apt-get -y install gcc-multilib g++-multilib libgl1-mesa-dev + - name: Build client and server on ${{ matrix.os }} with ${{ matrix.compiler }} + run: | + cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" && cmake --build build --target all diff --git a/README.md b/README.md index fe9e883f..86c9c9c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Half-Life SDK for Xash3D [![Build Status](https://travis-ci.org/FWGS/hlsdk-xash3d.svg)](https://travis-ci.org/FWGS/hlsdk-xash3d) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-xash3d?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-xash3d) +# Half-Life SDK for Xash3D [![Build Status](https://github.com/FWGS/hlsdk-xash3d/actions/workflows/.github.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-xash3d/actions/workflows/.github.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-xash3d?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-xash3d) Half-Life SDK for Xash3D & GoldSource with some fixes. From 0dd90846fe33c3c75b640e64eedb2201be24aae0 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 05:05:58 +0500 Subject: [PATCH 2/8] #ifdef->#if --- cl_dll/cdll_int.cpp | 6 +-- cl_dll/ev_hldm.cpp | 2 +- cl_dll/in_camera.cpp | 8 ++-- cl_dll/in_defs.h | 2 +- cl_dll/input_goldsource.cpp | 84 ++++++++++++++++++------------------ cl_dll/input_mouse.cpp | 4 +- cl_dll/tf_defs.h | 2 +- dlls/AI_BaseNPC_Schedule.cpp | 2 +- dlls/apache.cpp | 2 +- dlls/barnacle.cpp | 4 +- dlls/cbase.cpp | 4 +- dlls/cbase.h | 4 +- dlls/client.cpp | 4 +- dlls/crossbow.cpp | 8 ++-- dlls/crowbar.cpp | 18 ++++---- dlls/doors.cpp | 2 +- dlls/egon.cpp | 12 +++--- dlls/exportdef.h | 2 +- dlls/extdll.h | 6 +-- dlls/gargantua.cpp | 2 +- dlls/gauss.cpp | 22 +++++----- dlls/h_cycler.cpp | 2 +- dlls/h_export.cpp | 2 +- dlls/handgrenade.cpp | 2 +- dlls/hornetgun.cpp | 6 +-- dlls/monsters.cpp | 2 +- dlls/mp5.cpp | 2 +- dlls/multiplay_gamerules.cpp | 12 +++--- dlls/nodes.cpp | 4 +- dlls/nodes.h | 6 +-- dlls/player.cpp | 2 +- dlls/python.cpp | 8 ++-- dlls/rpg.cpp | 16 +++---- dlls/satchel.cpp | 6 +-- dlls/saverestore.h | 2 +- dlls/schedule.cpp | 2 +- dlls/shotgun.cpp | 4 +- dlls/soundent.cpp | 2 +- dlls/squeakgrenade.cpp | 6 +-- dlls/teamplay_gamerules.cpp | 6 +-- dlls/tripmine.cpp | 6 +-- dlls/util.cpp | 18 ++++---- dlls/util.h | 4 +- dlls/weapons.h | 18 ++++---- dlls/world.cpp | 2 +- pm_shared/pm_debug.c | 6 +-- pm_shared/pm_defs.h | 6 +-- pm_shared/pm_math.c | 4 +- pm_shared/pm_shared.c | 10 ++--- 49 files changed, 183 insertions(+), 183 deletions(-) diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 29edfbde..4cbc2008 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -183,7 +183,7 @@ int *HUD_GetRect( void ) return extent; } -#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT class TeamFortressViewport : public vgui::Panel { public: @@ -238,7 +238,7 @@ so the HUD can reinitialize itself. int DLLEXPORT HUD_VidInit( void ) { gHUD.VidInit(); -#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT vgui::Panel* root=(vgui::Panel*)gEngfuncs.VGui_GetPanel(); if (root) { gEngfuncs.Con_Printf( "Root VGUI panel exists\n" ); @@ -337,7 +337,7 @@ Called by engine every frame that client .dll is loaded void DLLEXPORT HUD_Frame( double time ) { -#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT if (!gViewPort) gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect()); #else diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 0db780f7..a5011f33 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1140,7 +1140,7 @@ enum crowbar_e CROWBAR_ATTACK2MISS, CROWBAR_ATTACK2HIT, CROWBAR_ATTACK3MISS, -#ifndef CROWBAR_IDLE_ANIM +#if !CROWBAR_IDLE_ANIM CROWBAR_ATTACK3HIT #else CROWBAR_ATTACK3HIT, diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index 3b089577..ad5ec8bf 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -148,7 +148,7 @@ void DLLEXPORT CAM_Think( void ) float dist; vec3_t camAngles; float flSensitivity; -#ifdef LATER +#if LATER int i; #endif vec3_t viewangles; @@ -168,7 +168,7 @@ void DLLEXPORT CAM_Think( void ) if( !cam_thirdperson ) return; -#ifdef LATER +#if LATER if( cam_contain->value ) { gEngfuncs.GetClientOrigin( origin ); @@ -315,7 +315,7 @@ void DLLEXPORT CAM_Think( void ) cam_old_mouse_y = cam_mouse.y * gHUD.GetSensitivity(); SetCursorPos( gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY() ); } -#ifdef LATER +#if LATER if( cam_contain->value ) { // check new ideal @@ -368,7 +368,7 @@ void DLLEXPORT CAM_Think( void ) else camAngles[2] += ( cam_idealdist->value - camAngles[2] ) * 0.25f; } -#ifdef LATER +#if LATER if( cam_contain->value ) { // Test new position diff --git a/cl_dll/in_defs.h b/cl_dll/in_defs.h index b4c51730..7221c356 100644 --- a/cl_dll/in_defs.h +++ b/cl_dll/in_defs.h @@ -16,7 +16,7 @@ // fall over #define ROLL 2 -#ifdef _WIN32 +#if _WIN32 #define HSPRITE HSPRITE_win32 #include #undef HSPRITE diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index be85ee3a..1d1c9f8b 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -10,7 +10,7 @@ #include "input_mouse.h" -#ifdef SUPPORT_GOLDSOURCE_INPUT +#if SUPPORT_GOLDSOURCE_INPUT #include "hud.h" #include "cl_util.h" @@ -23,11 +23,11 @@ #include "keydefs.h" #include "view.h" -#ifndef _WIN32 +#if !_WIN32 #define USE_SDL2 #endif -#ifdef USE_SDL2 +#if USE_SDL2 #define ARRAYSIZE(p) ( sizeof(p) /sizeof(p[0]) ) #include #include @@ -114,7 +114,7 @@ static SDLFunction sdlFunctions[] = { }; #endif -#ifdef _WIN32 +#if _WIN32 #include #else typedef unsigned int DWORD; @@ -149,14 +149,14 @@ extern cvar_t *cl_forwardspeed; extern cvar_t *cl_pitchspeed; extern cvar_t *cl_movespeedkey; -#ifdef _WIN32 +#if _WIN32 static double s_flRawInputUpdateTime = 0.0f; static bool m_bRawInput = false; static bool m_bMouseThread = false; bool isMouseRelative = false; #endif -#ifdef _WIN32 +#if _WIN32 #include "progdefs.h" extern globalvars_t *gpGlobals; #endif @@ -184,7 +184,7 @@ static cvar_t *m_customaccel_max; //Mouse move is raised to this power before being scaled by scale factor static cvar_t *m_customaccel_exponent; -#ifdef _WIN32 +#if _WIN32 // if threaded mouse is enabled then the time to sleep between polls static cvar_t *m_mousethread_sleep; #endif @@ -242,7 +242,7 @@ DWORD joy_oldbuttonstate, joy_oldpovstate; int joy_id; DWORD joy_numbuttons; -#ifdef USE_SDL2 +#if USE_SDL2 SDL_GameController *s_pJoystick = NULL; #elif defined(_WIN32) DWORD joy_flags; @@ -276,7 +276,7 @@ cvar_t *joy_wwhack2; int joy_avail, joy_advancedinit, joy_haspov; -#ifdef _WIN32 +#if _WIN32 unsigned int s_hMouseThreadId = 0; HANDLE s_hMouseThread = 0; HANDLE s_hMouseQuitEvent = 0; @@ -300,7 +300,7 @@ void Force_CenterView_f (void) } } -#ifdef _WIN32 +#if _WIN32 LONG mouseThreadActive = 0; LONG mouseThreadCenterX = 0; @@ -382,14 +382,14 @@ void IN_SetMouseMode(bool enable) if(enable) { -#ifdef _WIN32 +#if _WIN32 if (mouseparmsvalid) restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0); m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; if(m_bRawInput) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_SetRelativeMouseMode(SDL_TRUE); #endif isMouseRelative = true; @@ -402,10 +402,10 @@ void IN_SetMouseMode(bool enable) } else { -#ifdef _WIN32 +#if _WIN32 if(isMouseRelative) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_SetRelativeMouseMode(SDL_FALSE); #endif isMouseRelative = false; @@ -423,7 +423,7 @@ void IN_SetMouseMode(bool enable) void IN_SetVisibleMouse(bool visible) { -#ifdef _WIN32 +#if _WIN32 bool lockEntered = MouseThread_ActiveLock_Enter(); #endif @@ -431,7 +431,7 @@ void IN_SetVisibleMouse(bool visible) IN_SetMouseMode(!visible); -#ifdef _WIN32 +#if _WIN32 UpdateMouseThreadActive(); if(lockEntered) MouseThread_ActiveLock_Exit(); #endif @@ -448,7 +448,7 @@ void GoldSourceInput::IN_ActivateMouse (void) { if (mouseinitialized) { -#ifdef _WIN32 +#if _WIN32 bool lockEntered = MouseThread_ActiveLock_Enter(); #endif @@ -456,7 +456,7 @@ void GoldSourceInput::IN_ActivateMouse (void) mouseactive = 1; -#ifdef _WIN32 +#if _WIN32 UpdateMouseThreadActive(); if(lockEntered) MouseThread_ActiveLock_Exit(); #endif @@ -476,7 +476,7 @@ void GoldSourceInput::IN_DeactivateMouse (void) { if (mouseinitialized) { -#ifdef _WIN32 +#if _WIN32 bool lockEntered = MouseThread_ActiveLock_Enter(); #endif @@ -484,7 +484,7 @@ void GoldSourceInput::IN_DeactivateMouse (void) mouseactive = 0; -#ifdef _WIN32 +#if _WIN32 UpdateMouseThreadActive(); if(lockEntered) MouseThread_ActiveLock_Exit(); #endif @@ -502,7 +502,7 @@ void GoldSourceInput::IN_StartupMouse (void) return; mouseinitialized = 1; -#ifdef _WIN32 +#if _WIN32 mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0); if (mouseparmsvalid) @@ -537,7 +537,7 @@ void GoldSourceInput::IN_Shutdown (void) { IN_DeactivateMouse (); -#ifdef _WIN32 +#if _WIN32 if ( s_hMouseQuitEvent ) { SetEvent( s_hMouseQuitEvent ); @@ -566,7 +566,7 @@ void GoldSourceInput::IN_Shutdown (void) } #endif -#ifdef USE_SDL2 +#if USE_SDL2 for (int j=0; jtime - s_flRawInputUpdateTime > 1.0f ) { @@ -791,14 +791,14 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) if(m_bRawInput && !isMouseRelative) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_SetRelativeMouseMode(SDL_TRUE); #endif isMouseRelative = true; } else if(!m_bRawInput && isMouseRelative) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_SetRelativeMouseMode(SDL_FALSE); #endif isMouseRelative = false; @@ -928,7 +928,7 @@ void GoldSourceInput::IN_Accumulate (void) { if (mouseactive) { -#ifdef _WIN32 +#if _WIN32 if ( !m_bRawInput ) { if ( !m_bMouseThread ) @@ -942,7 +942,7 @@ void GoldSourceInput::IN_Accumulate (void) else #endif { -#ifdef USE_SDL2 +#if USE_SDL2 int deltaX, deltaY; safe_pfnSDL_GetRelativeMouseState( &deltaX, &deltaY ); mx_accum += deltaX; @@ -956,7 +956,7 @@ void GoldSourceInput::IN_Accumulate (void) } // force the mouse to the center, so there's room to move -#ifdef _WIN32 +#if _WIN32 // do not reset if mousethread would do it: if ( m_bRawInput || !m_bMouseThread ) #else @@ -997,7 +997,7 @@ void IN_StartupJoystick (void) // assume no joystick joy_avail = 0; -#ifdef USE_SDL2 +#if USE_SDL2 int nJoysticks = safe_pfnSDL_NumJoysticks(); if ( nJoysticks > 0 ) { @@ -1084,7 +1084,7 @@ void IN_StartupJoystick (void) #endif } -#ifdef USE_SDL2 +#if USE_SDL2 int RawValuePointer (int axis) { switch (axis) @@ -1216,7 +1216,7 @@ void GoldSourceInput::IN_Commands (void) // loop through the joystick buttons // key a joystick event or auxillary event for higher number buttons for each state change -#ifdef USE_SDL2 +#if USE_SDL2 buttonstate = 0; for ( i = 0; i < SDL_CONTROLLER_BUTTON_MAX; i++ ) { @@ -1294,7 +1294,7 @@ IN_ReadJoystick */ int IN_ReadJoystick (void) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_JoystickUpdate(); return 1; #elif defined(_WIN32) @@ -1374,7 +1374,7 @@ void IN_JoyMove ( float frametime, usercmd_t *cmd ) for (i = 0; i < JOY_MAX_AXES; i++) { // get the floating point zero-centered, potentially-inverted data for the current axis -#ifdef USE_SDL2 +#if USE_SDL2 fAxisValue = (float)pdwRawValue[i]; #elif defined(_WIN32) fAxisValue = (float) *pdwRawValue[i]; @@ -1570,7 +1570,7 @@ void GoldSourceInput::IN_Init (void) m_customaccel_max = gEngfuncs.pfnRegisterVariable ( "m_customaccel_max", "0", FCVAR_ARCHIVE ); m_customaccel_exponent = gEngfuncs.pfnRegisterVariable ( "m_customaccel_exponent", "1", FCVAR_ARCHIVE ); -#ifdef _WIN32 +#if _WIN32 m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 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 @@ -1600,8 +1600,8 @@ void GoldSourceInput::IN_Init (void) } #endif -#ifdef USE_SDL2 -#ifdef __APPLE__ +#if USE_SDL2 +#if __APPLE__ #define SDL2_FULL_LIBNAME "libsdl2-2.0.0.dylib" #else #define SDL2_FULL_LIBNAME "libSDL2-2.0.so.0" diff --git a/cl_dll/input_mouse.cpp b/cl_dll/input_mouse.cpp index 3233d797..c5b1df6b 100644 --- a/cl_dll/input_mouse.cpp +++ b/cl_dll/input_mouse.cpp @@ -10,7 +10,7 @@ cvar_t *in_joystick; FWGSInput fwgsInput; -#ifdef SUPPORT_GOLDSOURCE_INPUT +#if SUPPORT_GOLDSOURCE_INPUT GoldSourceInput goldSourceInput; AbstractInput* currentInput = &goldSourceInput; #else @@ -68,7 +68,7 @@ void IN_Shutdown( void ) void IN_Init( void ) { -#ifdef SUPPORT_GOLDSOURCE_INPUT +#if SUPPORT_GOLDSOURCE_INPUT if (IsXashFWGS()) { gEngfuncs.Con_Printf( "FWGS Xash3D input is in use\n" ); currentInput = &fwgsInput; diff --git a/cl_dll/tf_defs.h b/cl_dll/tf_defs.h index a9270f1e..ba7ae0f9 100644 --- a/cl_dll/tf_defs.h +++ b/cl_dll/tf_defs.h @@ -46,7 +46,7 @@ // Debug Options //#define MAP_DEBUG // Debug for Map code. I suggest running in a hi-res // mode and/or piping the output from the server to a file. -#ifdef MAP_DEBUG +#if MAP_DEBUG #define MDEBUG(x) x #else #define MDEBUG(x) diff --git a/dlls/AI_BaseNPC_Schedule.cpp b/dlls/AI_BaseNPC_Schedule.cpp index 468bb358..a6e4962b 100644 --- a/dlls/AI_BaseNPC_Schedule.cpp +++ b/dlls/AI_BaseNPC_Schedule.cpp @@ -181,7 +181,7 @@ BOOL CBaseMonster :: FScheduleValid ( void ) if ( HasConditions( m_pSchedule->iInterruptMask | bits_COND_SCHEDULE_DONE | bits_COND_TASK_FAILED ) ) { -#ifdef DEBUG +#if DEBUG if ( HasConditions ( bits_COND_TASK_FAILED ) && m_failSchedule == SCHED_NONE ) { // fail! Send a visual indicator. diff --git a/dlls/apache.cpp b/dlls/apache.cpp index e69d72e9..0844e2c4 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#ifndef OEM_BUILD +#if !OEM_BUILD #include "extdll.h" #include "util.h" diff --git a/dlls/barnacle.cpp b/dlls/barnacle.cpp index 8db34740..5298bb32 100644 --- a/dlls/barnacle.cpp +++ b/dlls/barnacle.cpp @@ -57,7 +57,7 @@ public: // FIXME: need a custom barnacle model with non-generic hitgroup // otherwise we can apply to damage to tongue instead of body -#ifdef BARNACLE_FIX_VISIBILITY +#if BARNACLE_FIX_VISIBILITY void SetObjectCollisionBox( void ) { pev->absmin = pev->origin + Vector( -16.0f, -16.0f, -m_flCachedLength ); @@ -160,7 +160,7 @@ void CBarnacle::BarnacleThink( void ) CBaseEntity *pTouchEnt; CBaseMonster *pVictim; float flLength; -#ifdef BARNACLE_FIX_VISIBILITY +#if BARNACLE_FIX_VISIBILITY if( m_flCachedLength != ( m_flAltitude + m_flTongueAdj ) || ( pev->absmin.z != pev->origin.z + -m_flCachedLength ) ) { // recalc collision box here to avoid barnacle disappears bug diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index 7f1f204a..cfc78697 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -98,7 +98,7 @@ static DLL_FUNCTIONS gFunctionTable = static void SetObjectCollisionBox( entvars_t *pev ); -#ifndef _WIN32 +#if !_WIN32 extern "C" { #endif int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ) @@ -125,7 +125,7 @@ int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) return TRUE; } -#ifndef _WIN32 +#if !_WIN32 } #endif diff --git a/dlls/cbase.h b/dlls/cbase.h index ba1c0464..71f0fc26 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -279,7 +279,7 @@ public: } // Ugly code to lookup all functions to make sure they are exported when set. -#ifdef _DEBUG +#if _DEBUG void FunctionCheck( void *pFunction, char *name ) { if( pFunction && !NAME_FOR_FUNCTION( pFunction ) ) @@ -356,7 +356,7 @@ public: // Normally it's illegal to cast a pointer to a member function of a derived class to a pointer to a // member function of a base class. static_cast is a sleezy way around that problem. -#ifdef _DEBUG +#if _DEBUG #define SetThink( a ) ThinkSet( static_cast (a), #a ) #define SetTouch( a ) TouchSet( static_cast (a), #a ) diff --git a/dlls/client.cpp b/dlls/client.cpp index cade437a..9299e2f9 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -208,7 +208,7 @@ void ClientPutInServer( edict_t *pEntity ) pPlayer->pev->iuser2 = 0; } -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR #include "voice_gamemgr.h" extern CVoiceGameMgr g_VoiceGameMgr; #endif @@ -404,7 +404,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) if( !( client->IsNetClient() ) ) // Not a client ? (should never be true) continue; -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR // can the receiver hear the sender? or has he muted him? if( g_VoiceGameMgr.PlayerHasBlockedPlayer( client, player ) ) continue; diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index e6eea1c5..87e4bbc8 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -23,7 +23,7 @@ #include "player.h" #include "gamerules.h" -#ifndef CLIENT_DLL +#if !CLIENT_DLL #define BOLT_AIR_VELOCITY 2000 #define BOLT_WATER_VELOCITY 1000 @@ -338,7 +338,7 @@ void CCrossbow::Holster( int skiplocal /* = 0 */ ) void CCrossbow::PrimaryAttack( void ) { -#ifdef CLIENT_DLL +#if CLIENT_DLL if( m_fInZoom && bIsMultiplayer() ) #else if( m_fInZoom && g_pGameRules->IsMultiplayer() ) @@ -386,7 +386,7 @@ void CCrossbow::FireSniperBolt() UTIL_TraceLine( vecSrc, vecSrc + vecDir * 8192, dont_ignore_monsters, m_pPlayer->edict(), &tr ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( tr.pHit->v.takedamage ) { ClearMultiDamage(); @@ -427,7 +427,7 @@ void CCrossbow::FireBolt() anglesAim.x = -anglesAim.x; -#ifndef CLIENT_DLL +#if !CLIENT_DLL Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2.0f; Vector vecDir = gpGlobals->v_forward; diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index df702f76..f1b2393b 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -37,7 +37,7 @@ enum crowbar_e CROWBAR_ATTACK2MISS, CROWBAR_ATTACK2HIT, CROWBAR_ATTACK3MISS, -#ifndef CROWBAR_IDLE_ANIM +#if !CROWBAR_IDLE_ANIM CROWBAR_ATTACK3HIT #else CROWBAR_ATTACK3HIT, @@ -157,7 +157,7 @@ void CCrowbar::PrimaryAttack() { if( !Swing( 1 ) ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL SetThink( &CCrowbar::SwingAgain ); pev->nextthink = gpGlobals->time + 0.1f; #endif @@ -186,7 +186,7 @@ int CCrowbar::Swing( int fFirst ) UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( tr.flFraction >= 1.0f ) { UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); @@ -214,7 +214,7 @@ int CCrowbar::Swing( int fFirst ) { // miss m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); -#ifdef CROWBAR_IDLE_ANIM +#if CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); #endif // player "shoot" animation @@ -239,7 +239,7 @@ int CCrowbar::Swing( int fFirst ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL // hit fDidHit = TRUE; CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); @@ -254,7 +254,7 @@ int CCrowbar::Swing( int fFirst ) // If building with the clientside weapon prediction system, // UTIL_WeaponTimeBase() is always 0 and m_flNextPrimaryAttack is >= -1.0f, thus making // m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() always evaluate to false. -#ifdef CLIENT_WEAPONS +#if CLIENT_WEAPONS if( ( m_flNextPrimaryAttack + 1.0f == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) #else if( ( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) @@ -290,7 +290,7 @@ int CCrowbar::Swing( int fFirst ) if( !pEntity->IsAlive() ) { -#ifdef CROWBAR_FIX_RAPID_CROWBAR +#if CROWBAR_FIX_RAPID_CROWBAR m_flNextPrimaryAttack = GetNextAttackDelay(0.25); #endif return TRUE; @@ -343,13 +343,13 @@ int CCrowbar::Swing( int fFirst ) m_flNextPrimaryAttack = GetNextAttackDelay( 0.25f ); #endif } -#ifdef CROWBAR_IDLE_ANIM +#if CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); #endif return fDidHit; } -#ifdef CROWBAR_IDLE_ANIM +#if CROWBAR_IDLE_ANIM void CCrowbar::WeaponIdle( void ) { if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 235669af..1f5b4b06 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -685,7 +685,7 @@ void CBaseDoor::DoorGoDown( void ) if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN ) EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1.0f, ATTN_NORM ); -#ifdef DOOR_ASSERT +#if DOOR_ASSERT ASSERT( m_toggle_state == TS_AT_TOP ); #endif // DOOR_ASSERT m_toggle_state = TS_GOING_DOWN; diff --git a/dlls/egon.cpp b/dlls/egon.cpp index a52e58ab..c6a61f01 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -252,7 +252,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( tr.fAllSolid ) return; -#ifndef CLIENT_DLL +#if !CLIENT_DLL CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); if( pEntity == NULL ) @@ -275,7 +275,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) switch( m_fireMode ) { case FIRE_NARROW: -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( pev->dmgtime < gpGlobals->time ) { // Narrow mode only does damage to the entity it hits @@ -311,7 +311,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) timedist = ( pev->dmgtime - gpGlobals->time ) / GetPulseInterval(); break; case FIRE_WIDE: -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( pev->dmgtime < gpGlobals->time ) { // wide mode does damage to the ent, and radius damage @@ -373,7 +373,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, float timeBlend ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( !m_pBeam ) { CreateEffect(); @@ -399,7 +399,7 @@ void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, floa void CEgon::CreateEffect( void ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL DestroyEffect(); m_pBeam = CBeam::BeamCreate( EGON_BEAM_SPRITE, 40 ); @@ -445,7 +445,7 @@ void CEgon::CreateEffect( void ) void CEgon::DestroyEffect( void ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( m_pBeam ) { UTIL_Remove( m_pBeam ); diff --git a/dlls/exportdef.h b/dlls/exportdef.h index 363d8d12..bc3c6371 100644 --- a/dlls/exportdef.h +++ b/dlls/exportdef.h @@ -2,7 +2,7 @@ #ifndef EXPORTDEF_H #define EXPORTDEF_H #if defined _WIN32 || defined __CYGWIN__ - #ifdef __GNUC__ + #if __GNUC__ #define EXPORT __attribute__ ((dllexport)) #else #define EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. diff --git a/dlls/extdll.h b/dlls/extdll.h index d8fdb41f..0c35fe3a 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -21,12 +21,12 @@ // // Allow "DEBUG" in addition to default "_DEBUG" -#ifdef _DEBUG +#if _DEBUG #define DEBUG 1 #endif // Silence certain warnings -#ifdef _MSC_VER +#if _MSC_VER #pragma warning(disable : 4244) // int or float down-conversion #pragma warning(disable : 4305) // int or float data truncation #pragma warning(disable : 4201) // nameless struct/union @@ -35,7 +35,7 @@ #endif // Prevent tons of unused windows definitions -#ifdef _WIN32 +#if _WIN32 #define WIN32_LEAN_AND_MEAN #define NOWINRES #define NOSERVICE diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index b82bb02f..bc4205e5 100644 --- a/dlls/gargantua.cpp +++ b/dlls/gargantua.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#ifndef OEM_BUILD +#if !OEM_BUILD //========================================================= // Gargantua diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index c9352e8e..910de214 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -46,7 +46,7 @@ LINK_ENTITY_TO_CLASS( weapon_gauss, CGauss ) float CGauss::GetFullChargeTime( void ) { -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -58,7 +58,7 @@ float CGauss::GetFullChargeTime( void ) return 4.0f; } -#ifdef CLIENT_DLL +#if CLIENT_DLL extern int g_irunninggausspred; #endif @@ -228,7 +228,7 @@ void CGauss::SecondaryAttack() // during the charging process, eat one bit of ammo every once in a while if( UTIL_WeaponTimeBase() >= m_pPlayer->m_flNextAmmoBurn && m_pPlayer->m_flNextAmmoBurn != 1000 ) { -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -271,7 +271,7 @@ void CGauss::SecondaryAttack() if( m_iSoundState == 0 ) ALERT( at_console, "sound state %d\n", m_iSoundState ); -#ifdef GAUSS_OVERCHARGE_FIX +#if GAUSS_OVERCHARGE_FIX if (!overcharge) #endif PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, pitch, 0, ( m_iSoundState == SND_CHANGE_PITCH ) ? 1 : 0, 0 ); @@ -284,7 +284,7 @@ void CGauss::SecondaryAttack() if( overcharge ) { // Player charged up too long. Zap him. -#ifdef GAUSS_OVERCHARGE_FIX +#if GAUSS_OVERCHARGE_FIX PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, pitch, 0, 0, 1 ); #endif EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", 1.0f, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) ); @@ -293,7 +293,7 @@ void CGauss::SecondaryAttack() m_fInAttack = 0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; -#ifndef CLIENT_DLL +#if !CLIENT_DLL m_pPlayer->TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 50, DMG_SHOCK ); UTIL_ScreenFade( m_pPlayer, Vector( 255, 128, 0 ), 2, 0.5f, 128, FFADE_IN ); #endif @@ -331,7 +331,7 @@ void CGauss::StartFire( void ) if( m_fPrimaryFire ) { // fixed damage on primary attack -#ifdef CLIENT_DLL +#if CLIENT_DLL flDamage = 20.0f; #else flDamage = gSkillData.plrDmgGauss; @@ -341,7 +341,7 @@ void CGauss::StartFire( void ) if( m_fInAttack != 3 ) { //ALERT( at_console, "Time:%f Damage:%f\n", gpGlobals->time - m_pPlayer->m_flStartCharge, flDamage ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL float flZVel = m_pPlayer->pev->velocity.z; if( !m_fPrimaryFire ) @@ -369,7 +369,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) { m_pPlayer->m_iWeaponVolume = GAUSS_PRIMARY_FIRE_VOLUME; TraceResult tr, beam_tr; -#ifndef CLIENT_DLL +#if !CLIENT_DLL Vector vecSrc = vecOrigSrc; Vector vecDest = vecSrc + vecDir * 8192.0f; edict_t *pentIgnore; @@ -399,7 +399,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) //ALERT( at_console, "%f %f\n", tr.flFraction, flMaxFrac ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL while( flDamage > 10 && nMaxHits > 0 ) { nMaxHits--; @@ -591,7 +591,7 @@ void CGauss::WeaponIdle( void ) iAnim = GAUSS_FIDGET; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } -#ifndef CLIENT_DLL +#if !CLIENT_DLL SendWeaponAnim( iAnim ); #endif } diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index 1c5a9150..1dac96cf 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -29,7 +29,7 @@ #include "player.h" #define TEMP_FOR_SCREEN_SHOTS -#ifdef TEMP_FOR_SCREEN_SHOTS //=================================================== +#if TEMP_FOR_SCREEN_SHOTS //=================================================== class CCycler : public CBaseMonster { diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index d36bd5be..11884f9c 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -29,7 +29,7 @@ enginefuncs_t g_engfuncs; globalvars_t *gpGlobals; -#ifdef _WIN32 +#if _WIN32 // Required DLL entry point BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index 4d866708..0e9fde30 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -43,7 +43,7 @@ void CHandGrenade::Spawn() m_iId = WEAPON_HANDGRENADE; SET_MODEL( ENT( pev ), "models/w_grenade.mdl" ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL pev->dmg = gSkillData.plrDmgHandGrenade; #endif m_iDefaultAmmo = HANDGRENADE_DEFAULT_GIVE; diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index 5e903b0d..df2eb3b6 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -74,7 +74,7 @@ int CHgun::AddToPlayer( CBasePlayer *pPlayer ) { if( CBasePlayerWeapon::AddToPlayer( pPlayer ) ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( g_pGameRules->IsMultiplayer() ) { // in multiplayer, all hivehands come full. @@ -131,7 +131,7 @@ void CHgun::PrimaryAttack() { return; } -#ifndef CLIENT_DLL +#if !CLIENT_DLL UTIL_MakeVectors( m_pPlayer->pev->v_angle ); CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); @@ -175,7 +175,7 @@ void CHgun::SecondaryAttack( void ) } //Wouldn't be a bad idea to completely predict these, since they fly so fast... -#ifndef CLIENT_DLL +#if !CLIENT_DLL CBaseEntity *pHornet; Vector vecSrc; diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index ab82cca5..9f1f57f2 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -728,7 +728,7 @@ BOOL CBaseMonster::MoveToNode( Activity movementAct, float waitTime, const Vecto return FRefreshRoute(); } -#ifdef _DEBUG +#if _DEBUG void DrawRoute( entvars_t *pev, WayPoint_t *m_Route, int m_iRouteIndex, int r, int g, int b ) { int i; diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 47d0a24d..66d0521b 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -150,7 +150,7 @@ void CMP5::PrimaryAttack() Vector vecSrc = m_pPlayer->GetGunPosition(); Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES ); Vector vecDir; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 137b3eeb..da199271 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -26,7 +26,7 @@ #include "skill.h" #include "game.h" #include "items.h" -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR #include "voice_gamemgr.h" #endif #include "hltv.h" @@ -46,7 +46,7 @@ extern int g_teamplay; float g_flIntermissionStartTime = 0; -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR CVoiceGameMgr g_VoiceGameMgr; class CMultiplayGameMgrHelper : public IVoiceGameMgrHelper @@ -73,7 +73,7 @@ static CMultiplayGameMgrHelper g_GameMgrHelper; //********************************************************* CHalfLifeMultiplay::CHalfLifeMultiplay() { -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR g_VoiceGameMgr.Init( &g_GameMgrHelper, gpGlobals->maxClients ); #endif RefreshSkillData(); @@ -123,7 +123,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay() BOOL CHalfLifeMultiplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) { -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR if( g_VoiceGameMgr.ClientCommand( pPlayer, pcmd ) ) return TRUE; #endif @@ -194,7 +194,7 @@ extern cvar_t mp_chattime; //========================================================= void CHalfLifeMultiplay::Think( void ) { -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR g_VoiceGameMgr.Update( gpGlobals->frametime ); #endif @@ -414,7 +414,7 @@ BOOL CHalfLifeMultiplay::GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerIte //========================================================= BOOL CHalfLifeMultiplay::ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128] ) { -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR g_VoiceGameMgr.ClientConnected( pEntity ); #endif return TRUE; diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index f5f399a0..e74e3cc8 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -42,7 +42,7 @@ CGraph WorldGraph; LINK_ENTITY_TO_CLASS( info_node, CNodeEnt ) LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ) -#ifdef __DOS__ +#if __DOS__ #include #define CreateDirectoryA(p, n) mkdir(p) #elif !defined _WIN32 @@ -2060,7 +2060,7 @@ void CTestHull::BuildNodeGraph( void ) fprintf( file, "\nAll Connections are Paired!\n" ); } -#ifdef _MSC_VER +#if _MSC_VER #define SIZET_FMT "%Iu" #else #define SIZET_FMT "%zu" diff --git a/dlls/nodes.h b/dlls/nodes.h index 4bc1ec1b..0cdb893d 100644 --- a/dlls/nodes.h +++ b/dlls/nodes.h @@ -106,7 +106,7 @@ typedef struct // CGraph //========================================================= #define _GRAPH_VERSION_RETAIL 16 // Retail Half-Life graph version. Don't increment this -#ifdef XASH_64BIT +#if XASH_64BIT #define _GRAPH_VERSION (16 * 10) #else #define _GRAPH_VERSION (16) // !!!increment this whenever graph/node/link classes change, to obsolesce older disk files. @@ -215,7 +215,7 @@ public: inline CNode &Node( int i ) { -#ifdef _DEBUG +#if _DEBUG if ( !m_pNodes || i < 0 || i > m_cNodes ) ALERT( at_error, "Bad Node!\n" ); #endif @@ -224,7 +224,7 @@ public: inline CLink &Link( int i ) { -#ifdef _DEBUG +#if _DEBUG if ( !m_pLinkPool || i < 0 || i > m_cLinks ) ALERT( at_error, "Bad link!\n" ); #endif diff --git a/dlls/player.cpp b/dlls/player.cpp index 6f5f2541..ee21a24d 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3470,7 +3470,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) GiveNamedItem( "ammo_ARgrenades" ); GiveNamedItem( "weapon_handgrenade" ); GiveNamedItem( "weapon_tripmine" ); -#ifndef OEM_BUILD +#if !OEM_BUILD GiveNamedItem( "weapon_357" ); GiveNamedItem( "ammo_357" ); GiveNamedItem( "weapon_crossbow" ); diff --git a/dlls/python.cpp b/dlls/python.cpp index d8bfd35f..f12253dc 100644 --- a/dlls/python.cpp +++ b/dlls/python.cpp @@ -97,7 +97,7 @@ void CPython::Precache( void ) BOOL CPython::Deploy() { -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -130,7 +130,7 @@ void CPython::Holster( int skiplocal /* = 0 */ ) void CPython::SecondaryAttack( void ) { -#ifdef CLIENT_DLL +#if CLIENT_DLL if( !bIsMultiplayer() ) #else if( !g_pGameRules->IsMultiplayer() ) @@ -222,7 +222,7 @@ void CPython::Reload( void ) } int bUseScope = FALSE; -#ifdef CLIENT_DLL +#if CLIENT_DLL bUseScope = bIsMultiplayer(); #else bUseScope = g_pGameRules->IsMultiplayer(); @@ -273,7 +273,7 @@ void CPython::WeaponIdle( void ) } int bUseScope = FALSE; -#ifdef CLIENT_DLL +#if CLIENT_DLL bUseScope = bIsMultiplayer(); #else bUseScope = g_pGameRules->IsMultiplayer(); diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index 0b5b5f7b..597ed4f1 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -39,7 +39,7 @@ enum rpg_e LINK_ENTITY_TO_CLASS( weapon_rpg, CRpg ) -#ifndef CLIENT_DLL +#if !CLIENT_DLL LINK_ENTITY_TO_CLASS( laser_spot, CLaserSpot ) @@ -306,7 +306,7 @@ void CRpg::Reload( void ) return; } -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( m_pSpot && m_fSpotActive ) { m_pSpot->Suspend( 2.1f ); @@ -329,7 +329,7 @@ void CRpg::Spawn() SET_MODEL( ENT( pev ), "models/w_rpg.mdl" ); m_fSpotActive = 1; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -421,7 +421,7 @@ void CRpg::Holster( int skiplocal /* = 0 */ ) SendWeaponAnim( RPG_HOLSTER1 ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( m_pSpot ) { m_pSpot->Killed( NULL, GIB_NEVER ); @@ -437,7 +437,7 @@ void CRpg::PrimaryAttack() m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME; m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH; -#ifndef CLIENT_DLL +#if !CLIENT_DLL // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -480,7 +480,7 @@ void CRpg::SecondaryAttack() { m_fSpotActive = !m_fSpotActive; -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( !m_fSpotActive && m_pSpot ) { m_pSpot->Killed( NULL, GIB_NORMAL ); @@ -532,7 +532,7 @@ void CRpg::WeaponIdle( void ) void CRpg::UpdateSpot( void ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL if( m_fSpotActive ) { if (m_pPlayer->pev->viewmodel == 0) @@ -571,7 +571,7 @@ class CRpgAmmo : public CBasePlayerAmmo BOOL AddAmmo( CBaseEntity *pOther ) { int iGive; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 09e431c5..f15e1800 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -193,7 +193,7 @@ int CSatchel::AddDuplicate( CBasePlayerItem *pOriginal ) { CSatchel *pSatchel; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -376,7 +376,7 @@ void CSatchel::Throw( void ) { if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { -#ifndef CLIENT_DLL +#if !CLIENT_DLL Vector vecSrc = m_pPlayer->pev->origin; Vector vecThrow = gpGlobals->v_forward * 274 + m_pPlayer->pev->velocity; @@ -430,7 +430,7 @@ void CSatchel::WeaponIdle( void ) return; } -#ifndef CLIENT_DLL +#if !CLIENT_DLL m_pPlayer->pev->viewmodel = MAKE_STRING( "models/v_satchel.mdl" ); m_pPlayer->pev->weaponmodel = MAKE_STRING( "models/p_satchel.mdl" ); #else diff --git a/dlls/saverestore.h b/dlls/saverestore.h index 81f9f131..5eec01e2 100644 --- a/dlls/saverestore.h +++ b/dlls/saverestore.h @@ -157,7 +157,7 @@ public: int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; -//#ifdef _DEBUG +//#if _DEBUG void DumpGlobals( void ); //#endif diff --git a/dlls/schedule.cpp b/dlls/schedule.cpp index 2a4cc311..7512c9fa 100644 --- a/dlls/schedule.cpp +++ b/dlls/schedule.cpp @@ -181,7 +181,7 @@ BOOL CBaseMonster::FScheduleValid( void ) if( HasConditions( m_pSchedule->iInterruptMask | bits_COND_SCHEDULE_DONE | bits_COND_TASK_FAILED ) ) { -#ifdef DEBUG +#if DEBUG if( HasConditions( bits_COND_TASK_FAILED ) && m_failSchedule == SCHED_NONE ) { // fail! Send a visual indicator. diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index 9c84c5c2..30ccdab9 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -152,7 +152,7 @@ void CShotgun::PrimaryAttack() Vector vecDir; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) @@ -222,7 +222,7 @@ void CShotgun::SecondaryAttack( void ) Vector vecDir; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( bIsMultiplayer() ) #else if( g_pGameRules->IsMultiplayer() ) diff --git a/dlls/soundent.cpp b/dlls/soundent.cpp index 7d9583f0..ea319989 100644 --- a/dlls/soundent.cpp +++ b/dlls/soundent.cpp @@ -367,7 +367,7 @@ int CSoundEnt::ClientSoundIndex( edict_t *pClient ) { int iReturn = ENTINDEX( pClient ) - 1; -#ifdef _DEBUG +#if _DEBUG if( iReturn < 0 || iReturn > gpGlobals->maxClients ) { ALERT( at_console, "** ClientSoundIndex returning a bogus value! **\n" ); diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index 7e8a9d92..c852fd64 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -42,7 +42,7 @@ enum squeak_e SQUEAK_THROW }; -#ifndef CLIENT_DLL +#if !CLIENT_DLL class CSqueakGrenade : public CGrenade { void Spawn( void ); @@ -503,7 +503,7 @@ void CSqueak::PrimaryAttack() UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20.0f, trace_origin + gpGlobals->v_forward * 64.0f, dont_ignore_monsters, NULL, &tr ); int flags; -#ifdef CLIENT_WEAPONS +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; @@ -514,7 +514,7 @@ void CSqueak::PrimaryAttack() { // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); -#ifndef CLIENT_DLL +#if !CLIENT_DLL CBaseEntity *pSqueak = CBaseEntity::Create( "monster_snark", tr.vecEndPos, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); pSqueak->pev->velocity = gpGlobals->v_forward * 200.0f + m_pPlayer->pev->velocity; #endif diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index ea733fa4..6f53582a 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -69,7 +69,7 @@ CHalfLifeTeamplay::CHalfLifeTeamplay() extern cvar_t timeleft, fragsleft; -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR #include "voice_gamemgr.h" extern CVoiceGameMgr g_VoiceGameMgr; #endif @@ -82,7 +82,7 @@ void CHalfLifeTeamplay::Think( void ) int frags_remaining = 0; int time_remaining = 0; -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR g_VoiceGameMgr.Update(gpGlobals->frametime); #endif if( g_fGameOver ) // someone else quit the game already @@ -148,7 +148,7 @@ void CHalfLifeTeamplay::Think( void ) //========================================================= BOOL CHalfLifeTeamplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) { -#ifndef NO_VOICEGAMEMGR +#if !NO_VOICEGAMEMGR if( g_VoiceGameMgr.ClientCommand( pPlayer, pcmd ) ) return TRUE; #endif diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 50ea8c37..9da8b90e 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -38,7 +38,7 @@ enum tripmine_e TRIPMINE_GROUND }; -#ifndef CLIENT_DLL +#if !CLIENT_DLL class CTripmineGrenade : public CGrenade { void Spawn( void ); @@ -368,7 +368,7 @@ void CTripmine::Spawn() m_iDefaultAmmo = TRIPMINE_DEFAULT_GIVE; -#ifdef CLIENT_DLL +#if CLIENT_DLL if( !bIsMultiplayer() ) #else if( !g_pGameRules->IsDeathmatch() ) @@ -439,7 +439,7 @@ void CTripmine::PrimaryAttack( void ) UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128.0f, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); int flags; -#ifdef CLIENT_WEAPONS +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/util.cpp b/dlls/util.cpp index e2e4292d..74689193 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -309,7 +309,7 @@ TYPEDESCRIPTION gEntvarsDescription[] = #define ENTVARS_COUNT ( sizeof(gEntvarsDescription) / sizeof(gEntvarsDescription[0]) ) -#ifdef DEBUG +#if DEBUG edict_t *DBG_EntOfVars( const entvars_t *pev ) { if( pev->pContainingEntity != NULL ) @@ -1596,7 +1596,7 @@ static int gSizes[FIELD_TYPECOUNT] = sizeof(float) * 3, // FIELD_POSITION_VECTOR sizeof(void *), // FIELD_POINTER sizeof(int), // FIELD_INTEGER -#ifdef GNUC +#if GNUC sizeof(void *) * 2, // FIELD_FUNCTION #else sizeof(void *), // FIELD_FUNCTION @@ -1623,7 +1623,7 @@ static int gInputSizes[FIELD_TYPECOUNT] = sizeof(float) * 3, // FIELD_POSITION_VECTOR sizeof(void *), // FIELD_POINTER sizeof(int), // FIELD_INTEGER -#ifdef GNUC +#if GNUC sizeof(void *) * 2, // FIELD_FUNCTION #else sizeof(void *), // FIELD_FUNCTION @@ -1840,7 +1840,7 @@ void CSave::WriteTime( const char *pname, const float *data, int count ) void CSave::WriteString( const char *pname, const char *pdata ) { -#ifdef TOKENIZE +#if TOKENIZE short token = (short)TokenHash( pdata ); WriteShort( pname, &token, 1 ); #else @@ -1851,7 +1851,7 @@ void CSave::WriteString( const char *pname, const char *pdata ) void CSave::WriteString( const char *pname, const int *stringId, int count ) { int i, size; -#ifdef TOKENIZE +#if TOKENIZE short token = (short)TokenHash( STRING( *stringId ) ); WriteShort( pname, &token, 1 ); #else @@ -2169,7 +2169,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou switch( pTest->fieldType ) { case FIELD_TIME: - #ifdef __VFP_FP__ + #if __VFP_FP__ memcpy( &timeData, pInputData, 4 ); // Re-base time variables timeData += time; @@ -2255,7 +2255,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou *( (EOFFSET *)pOutputData ) = 0; break; case FIELD_VECTOR: - #ifdef __VFP_FP__ + #if __VFP_FP__ memcpy( pOutputData, pInputData, sizeof( Vector ) ); #else ( (float *)pOutputData )[0] = ( (float *)pInputData )[0]; @@ -2264,7 +2264,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou #endif break; case FIELD_POSITION_VECTOR: - #ifdef __VFP_FP__ + #if __VFP_FP__ { Vector tmp; memcpy( &tmp, pInputData, sizeof( Vector ) ); @@ -2401,7 +2401,7 @@ char *CRestore::ReadNamedString( const char *pName ) HEADER header; BufferReadHeader( &header ); -#ifdef TOKENIZE +#if TOKENIZE return (char *)( m_pdata->pTokens[*(short *)header.pData] ); #else return (char *)header.pData; diff --git a/dlls/util.h b/dlls/util.h index 08c5af05..6b6d2d7b 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -113,7 +113,7 @@ typedef int BOOL; // // Conversion among the three types of "entity", including identity-conversions. // -#ifdef DEBUG +#if DEBUG extern edict_t *DBG_EntOfVars(const entvars_t *pev); inline edict_t *ENT(const entvars_t *pev) { return DBG_EntOfVars(pev); } #else @@ -390,7 +390,7 @@ extern int BuildChangeList( LEVELLIST *pLevelList, int maxList ); // // How did I ever live without ASSERT? // -#ifdef DEBUG +#if DEBUG void DBG_AssertFunction(BOOL fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage); #define ASSERT(f) DBG_AssertFunction(f, #f, __FILE__, __LINE__, NULL) #define ASSERTSZ(f, sz) DBG_AssertFunction(f, #f, __FILE__, __LINE__, sz) diff --git a/dlls/weapons.h b/dlls/weapons.h index ad8f2fe4..833c08d6 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -452,7 +452,7 @@ public: int m_cAmmoTypes;// how many ammo types packed into this box (if packed by a level designer) }; -#ifdef CLIENT_DLL +#if CLIENT_DLL bool bIsMultiplayer ( void ); void LoadVModel ( const char *szViewModel, CBasePlayer *m_pPlayer ); #endif @@ -504,7 +504,7 @@ public: int Swing( int fFirst ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); -#ifdef CROWBAR_IDLE_ANIM +#if CROWBAR_IDLE_ANIM void WeaponIdle(); #endif int m_iSwing; @@ -622,7 +622,7 @@ private: class CShotgun : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -674,7 +674,7 @@ public: class CRpg : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -735,7 +735,7 @@ public: class CGauss : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -782,7 +782,7 @@ private: class CEgon : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -835,7 +835,7 @@ public: unsigned short m_usEgonStop; private: -#ifndef CLIENT_DLL +#if !CLIENT_DLL float m_shootTime; #endif EGON_FIREMODE m_fireMode; @@ -848,7 +848,7 @@ private: class CHgun : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -911,7 +911,7 @@ public: class CSatchel : public CBasePlayerWeapon { public: -#ifndef CLIENT_DLL +#if !CLIENT_DLL int Save( CSave &save ); int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; diff --git a/dlls/world.cpp b/dlls/world.cpp index 5adbdf9d..0d7db511 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -288,7 +288,7 @@ globalentity_t *CGlobalState::Find( string_t globalname ) } // This is available all the time now on impulse 104, remove later -//#ifdef _DEBUG +//#if _DEBUG void CGlobalState::DumpGlobals( void ) { static const char *estates[] = { "Off", "On", "Dead" }; diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index a11e0516..ce904760 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -14,7 +14,7 @@ ****/ #include #include "mathlib.h" -#ifdef HAVE_TGMATH_H +#if HAVE_TGMATH_H #include #endif @@ -27,7 +27,7 @@ #include -#ifdef _MSC_VER +#if _MSC_VER #pragma warning(disable : 4244) #pragma warning(disable : 4305) #endif @@ -268,7 +268,7 @@ void PM_DrawBBox(vec3_t mins, vec3_t maxs, vec3_t origin, int pcolor, float life } -#ifndef DEDICATED +#if !DEDICATED /* ================ diff --git a/pm_shared/pm_defs.h b/pm_shared/pm_defs.h index 82480806..7da29755 100644 --- a/pm_shared/pm_defs.h +++ b/pm_shared/pm_defs.h @@ -194,7 +194,7 @@ typedef struct playermove_s int (*PM_PointContents)( float *p, int *truecontents /*filled in if this is non-null*/ ); int (*PM_TruePointContents)( float *p ); int (*PM_HullPointContents)( struct hull_s *hull, int num, float *p ); -#ifdef __MINGW32__ +#if __MINGW32__ pmtrace_t *(*PM_PlayerTrace_real)( pmtrace_t * retvalue, float *start, float *end, int traceFlags, int ignore_pe ); #else @@ -218,7 +218,7 @@ typedef struct playermove_s void (*PM_PlaySound)( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); const char *(*PM_TraceTexture)( int ground, float *vstart, float *vend ); void (*PM_PlaybackEventFull)( int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); -#ifdef __MINGW32__ +#if __MINGW32__ pmtrace_t *(*PM_PlayerTraceEx_real) (pmtrace_t *retvalue, float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe )); #else pmtrace_t (*PM_PlayerTraceEx) (float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe )); @@ -228,7 +228,7 @@ typedef struct playermove_s struct msurface_s *(*PM_TraceSurface)( int ground, float *vstart, float *vend ); } playermove_t; -#ifdef __MINGW32__ +#if __MINGW32__ static pmtrace_t _pm_globalresult, _pm_globaltmp; static inline pmtrace_t PM_PlayerTrace_wrap( float *start, float *end, int traceFlags, int ignore_pe, playermove_t *pmove ) { diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index 87c65d9f..f10e8a59 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -15,7 +15,7 @@ // pm_math.c -- math primitives #include #include "mathlib.h" -#ifdef HAVE_TGMATH_H +#if HAVE_TGMATH_H #include #endif #include "const.h" @@ -27,7 +27,7 @@ // fall over #define ROLL 2 -#ifdef _MSC_VER +#if _MSC_VER #pragma warning(disable : 4244) #endif diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 2352b51f..e16072de 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -20,7 +20,7 @@ #include // atoi #include // isspace #include "mathlib.h" -#ifdef HAVE_TGMATH_H +#if HAVE_TGMATH_H #include #endif @@ -33,7 +33,7 @@ int g_bhopcap = 1; -#ifdef CLIENT_DLL +#if CLIENT_DLL // Spectator Mode int iJumpSpectator; extern float vJumpOrigin[3]; @@ -42,7 +42,7 @@ extern float vJumpAngles[3]; static int pm_shared_initialized = 0; -#ifdef _MSC_VER +#if _MSC_VER #pragma warning( disable : 4305 ) #endif @@ -86,7 +86,7 @@ playermove_t *pmove = NULL; #define PLAYER_DUCKING_MULTIPLIER 0.333f // double to float warning -#ifdef _MSC_VER +#if _MSC_VER #pragma warning(disable : 4244) #endif @@ -1798,7 +1798,7 @@ void PM_SpectatorMove( void ) if( pmove->iuser1 == OBS_ROAMING ) { -#ifdef CLIENT_DLL +#if CLIENT_DLL // jump only in roaming mode if( iJumpSpectator ) { From f0b649f50711814c99e758497eae3f0de352fbaf Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 05:12:53 +0500 Subject: [PATCH 3/8] wscript: update. --- wscript | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wscript b/wscript index 62279ae8..71048ce6 100644 --- a/wscript +++ b/wscript @@ -256,8 +256,8 @@ def configure(conf): conf.define_cond('HAVE_CMATH', cmath_usable) if conf.env.COMPILER_CC == 'msvc': - conf.define('_CRT_SECURE_NO_WARNINGS', 1) - conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) + conf.define('_CRT_SECURE_NO_WARNINGS', True) + conf.define('_CRT_NONSTDC_NO_DEPRECATE', True) elif conf.env.COMPILER_CC == 'owcc': pass else: @@ -271,14 +271,13 @@ def configure(conf): if conf.env.cxxshlib_PATTERN.startswith('lib'): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] - conf.define('CLIENT_WEAPONS', '1') + conf.define('BARNACLE_FIX_VISIBILITY', False) + conf.define('CLIENT_WEAPONS', True) conf.define('CROWBAR_IDLE_ANIM', False) conf.define('CROWBAR_DELAY_FIX', False) conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) - - if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: - conf.define('MOBILE_HACKS', '1') + conf.define('OEM_BUILD', False) conf.add_subproject(["cl_dll", "dlls"]) From 8366cb170c1b6817a97d421d6bbc6aaa798b38f3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 05:24:30 +0500 Subject: [PATCH 4/8] Fix compilation. --- dlls/h_cycler.cpp | 2 +- dlls/nodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index 1dac96cf..ef356e8a 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -29,7 +29,7 @@ #include "player.h" #define TEMP_FOR_SCREEN_SHOTS -#if TEMP_FOR_SCREEN_SHOTS //=================================================== +#if defined(TEMP_FOR_SCREEN_SHOTS) //=================================================== class CCycler : public CBaseMonster { diff --git a/dlls/nodes.h b/dlls/nodes.h index 0cdb893d..d6b36928 100644 --- a/dlls/nodes.h +++ b/dlls/nodes.h @@ -106,7 +106,7 @@ typedef struct // CGraph //========================================================= #define _GRAPH_VERSION_RETAIL 16 // Retail Half-Life graph version. Don't increment this -#if XASH_64BIT +#if defined(XASH_64BIT) #define _GRAPH_VERSION (16 * 10) #else #define _GRAPH_VERSION (16) // !!!increment this whenever graph/node/link classes change, to obsolesce older disk files. From 6d8e1c5d0ca32752965d9b3d362039d196922d1c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 19:17:22 +0500 Subject: [PATCH 5/8] Got rid "defined". --- dlls/bigmomma.cpp | 2 +- dlls/client.cpp | 4 ++-- dlls/controller.cpp | 2 +- dlls/crossbow.cpp | 6 +++--- dlls/egon.cpp | 4 ++-- dlls/gauss.cpp | 2 +- dlls/glock.cpp | 2 +- dlls/hassassin.cpp | 2 +- dlls/hornetgun.cpp | 6 +++--- dlls/ichthyosaur.cpp | 2 +- dlls/mp5.cpp | 4 ++-- dlls/nihilanth.cpp | 2 +- dlls/player.cpp | 10 +++++----- dlls/python.cpp | 4 ++-- dlls/rpg.cpp | 4 ++-- dlls/satchel.cpp | 2 +- dlls/shotgun.cpp | 4 ++-- dlls/squeakgrenade.cpp | 2 +- dlls/tentacle.cpp | 2 +- dlls/util.cpp | 2 +- dlls/util.h | 4 ++-- dlls/weapons.cpp | 12 ++++++------ dlls/weapons.h | 28 ++++++++++++++-------------- 23 files changed, 56 insertions(+), 56 deletions(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 584a6737..62188740 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD //========================================================= // monster template diff --git a/dlls/client.cpp b/dlls/client.cpp index 9299e2f9..52c9644d 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -1626,7 +1626,7 @@ void RegisterEncoders( void ) int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS int i; weapon_data_t *item; entvars_t *pev = &player->v; @@ -1755,7 +1755,7 @@ void UpdateClientData( const struct edict_s *ent, int sendweapons, struct client cd->iuser1 = pev->iuser1; cd->iuser2 = pev->iuser2; } -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( sendweapons ) { if( pl ) diff --git a/dlls/controller.cpp b/dlls/controller.cpp index 1f851766..20c9a502 100644 --- a/dlls/controller.cpp +++ b/dlls/controller.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD //========================================================= // CONTROLLER diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 87e4bbc8..68f4ba9c 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD ) && !HLDEMO_BUILD #include "extdll.h" #include "util.h" @@ -368,7 +368,7 @@ void CCrossbow::FireSniperBolt() m_iClip--; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; @@ -411,7 +411,7 @@ void CCrossbow::FireBolt() m_iClip--; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/egon.cpp b/dlls/egon.cpp index c6a61f01..efbe4449 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" @@ -178,7 +178,7 @@ void CEgon::Attack( void ) Vector vecSrc = m_pPlayer->GetGunPosition(); int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 910de214..6c4c0a08 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" diff --git a/dlls/glock.cpp b/dlls/glock.cpp index db0cf082..d9411d66 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -132,7 +132,7 @@ void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) m_pPlayer->pev->effects = (int)( m_pPlayer->pev->effects ) | EF_MUZZLEFLASH; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/hassassin.cpp b/dlls/hassassin.cpp index c98c940f..36672d56 100644 --- a/dlls/hassassin.cpp +++ b/dlls/hassassin.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD //========================================================= // hassassin - Human assassin, fast and stealthy diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index df2eb3b6..f8c54fbe 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" @@ -145,7 +145,7 @@ void CHgun::PrimaryAttack() m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; @@ -226,7 +226,7 @@ void CHgun::SecondaryAttack( void ) m_flRechargeTime = gpGlobals->time + 0.5f; #endif int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index 56ff96af..0f9fbf5a 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD //========================================================= // icthyosaur - evin, satan fish monster diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 66d0521b..2b2d07ab 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -166,7 +166,7 @@ void CMP5::PrimaryAttack() } int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; @@ -220,7 +220,7 @@ void CMP5::SecondaryAttack( void ) gpGlobals->v_forward * 800.0f ); int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index 29e1073e..951ee38c 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" diff --git a/dlls/player.cpp b/dlls/player.cpp index ee21a24d..002635c0 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2603,7 +2603,7 @@ pt_end: // Track button info so we can detect 'pressed' and 'released' buttons next frame m_afButtonLast = pev->button; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS // Decay timers on weapons // go through all of the weapons and make a list of the ones to pack for( int i = 0; i < MAX_ITEM_TYPES; i++ ) @@ -2998,7 +2998,7 @@ int CBasePlayer::Restore( CRestore &restore ) RenewItems(); -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS // HACK: This variable is saved/restored in CBaseMonster as a time variable, but we're using it // as just a counter. Ideally, this needs its own variable that's saved as a plain float. // Barring that, we clear it out here instead of using the incorrect restored time value. @@ -3433,7 +3433,7 @@ void CBasePlayer::ImpulseCommands() //========================================================= void CBasePlayer::CheatImpulseCommands( int iImpulse ) { -#if !defined( HLDEMO_BUILD ) +#if !HLDEMO_BUILD if( g_flWeaponCheat == 0.0f ) { return; @@ -3756,7 +3756,7 @@ Called every frame by the player PreThink */ void CBasePlayer::ItemPreFrame() { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( m_flNextAttack > 0 ) #else if( gpGlobals->time < m_flNextAttack ) @@ -3786,7 +3786,7 @@ void CBasePlayer::ItemPostFrame() if( m_pTank != 0 ) return; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( m_flNextAttack > 0 ) #else if( gpGlobals->time < m_flNextAttack ) diff --git a/dlls/python.cpp b/dlls/python.cpp index f12253dc..567187c0 100644 --- a/dlls/python.cpp +++ b/dlls/python.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" @@ -195,7 +195,7 @@ void CPython::PrimaryAttack() vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, VECTOR_CONE_1DEGREES, 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index 597ed4f1..65f1bd49 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) +#if !OEM_BUILD #include "extdll.h" #include "util.h" @@ -454,7 +454,7 @@ void CRpg::PrimaryAttack() // Ken signed up for this as a global change (sjb) int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index f15e1800..528a3ba8 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index 30ccdab9..7b263a21 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -137,7 +137,7 @@ void CShotgun::PrimaryAttack() m_iClip--; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; @@ -207,7 +207,7 @@ void CShotgun::SecondaryAttack( void ) m_iClip -= 2; int flags; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS flags = FEV_NOTHOST; #else flags = 0; diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index c852fd64..4bf2e3df 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index c860fcb3..685540d5 100644 --- a/dlls/tentacle.cpp +++ b/dlls/tentacle.cpp @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD /* diff --git a/dlls/util.cpp b/dlls/util.cpp index 74689193..483d6748 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -33,7 +33,7 @@ float UTIL_WeaponTimeBase( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return 0.0f; #else return gpGlobals->time; diff --git a/dlls/util.h b/dlls/util.h index 6b6d2d7b..ad7981ad 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -35,7 +35,7 @@ extern globalvars_t *gpGlobals; // Use this instead of ALLOC_STRING on constant strings #define STRING(offset) (const char *)(gpGlobals->pStringBase + (int)offset) -#if !defined XASH_64BIT || defined(CLIENT_DLL) +#if !defined(XASH_64BIT) || CLIENT_DLL #define MAKE_STRING(str) ((int)(long int)str - (int)(long int)STRING(0)) #else static inline int MAKE_STRING(const char *szValue) @@ -104,7 +104,7 @@ typedef int BOOL; // The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress() // The function is used to intialize / allocate the object for the entity -#if defined(CLIENT_DLL) +#if CLIENT_DLL #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) #else // CLIENT_DLL #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" EXPORT void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 88c91a36..773213b3 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -320,7 +320,7 @@ void W_Precache( void ) // 9mm ammo box UTIL_PrecacheOther( "ammo_9mmbox" ); -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD // python UTIL_PrecacheOtherWeapon( "weapon_357" ); UTIL_PrecacheOther( "ammo_357" ); @@ -342,13 +342,13 @@ void W_Precache( void ) #endif // tripmine UTIL_PrecacheOtherWeapon( "weapon_tripmine" ); -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD // satchel charge UTIL_PrecacheOtherWeapon( "weapon_satchel" ); #endif // hand grenade UTIL_PrecacheOtherWeapon("weapon_handgrenade"); -#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) +#if !OEM_BUILD && !HLDEMO_BUILD // squeak grenade UTIL_PrecacheOtherWeapon( "weapon_snark" ); @@ -402,7 +402,7 @@ IMPLEMENT_SAVERESTORE( CBasePlayerItem, CBaseAnimating ) TYPEDESCRIPTION CBasePlayerWeapon::m_SaveData[] = { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS DEFINE_FIELD( CBasePlayerWeapon, m_flNextPrimaryAttack, FIELD_FLOAT ), DEFINE_FIELD( CBasePlayerWeapon, m_flNextSecondaryAttack, FIELD_FLOAT ), DEFINE_FIELD( CBasePlayerWeapon, m_flTimeWeaponIdle, FIELD_FLOAT ), @@ -586,7 +586,7 @@ void CBasePlayerItem::DefaultTouch( CBaseEntity *pOther ) BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( !isPredicted ) #else if( 1 ) @@ -826,7 +826,7 @@ void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body ) m_pPlayer->pev->weaponanim = iAnim; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( skiplocal && ENGINE_CANSKIP( m_pPlayer->edict() ) ) return; #endif diff --git a/dlls/weapons.h b/dlls/weapons.h index 833c08d6..86e4cec9 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -475,7 +475,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -512,7 +512,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -542,7 +542,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -573,7 +573,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -607,7 +607,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -645,7 +645,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -703,7 +703,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -767,7 +767,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -825,7 +825,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -874,7 +874,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -900,7 +900,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -934,7 +934,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -963,7 +963,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; @@ -991,7 +991,7 @@ public: virtual BOOL UseDecrement( void ) { -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS return TRUE; #else return FALSE; From 0fab78ad245f573966b7fda8cb85ab39c3eec10d Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 19:18:13 +0500 Subject: [PATCH 6/8] wscript: update. --- wscript | 1 + 1 file changed, 1 insertion(+) diff --git a/wscript b/wscript index 71048ce6..ded363dd 100644 --- a/wscript +++ b/wscript @@ -278,6 +278,7 @@ def configure(conf): conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) conf.define('OEM_BUILD', False) + conf.define('HLDEMO_BUILD', False) conf.add_subproject(["cl_dll", "dlls"]) From 0557b2dfe319c6640b7c65956cdb55f521dd2fb5 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 7 Jun 2021 19:20:38 +0500 Subject: [PATCH 7/8] Fix compilation. --- dlls/crossbow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 68f4ba9c..c7b04f77 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -12,7 +12,7 @@ * without written permission from Valve LLC. * ****/ -#if !OEM_BUILD ) && !HLDEMO_BUILD +#if !OEM_BUILD && !HLDEMO_BUILD #include "extdll.h" #include "util.h" From 3f6ab0b2fda7bdc7ff6a59b4d9694f3d018b99e8 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 8 Jun 2021 00:05:47 +0300 Subject: [PATCH 8/8] Fix Goldsource build (#176) --- .github/workflows/.github.yml | 38 ++++++++++++++++++++++++++--------- cl_dll/cdll_int.cpp | 6 +++--- cl_dll/input_goldsource.cpp | 24 +++++++++++----------- cl_dll/input_mouse.cpp | 4 ++-- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index d3d87559..87f8bcb2 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -7,21 +7,39 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest] - compiler: [gcc, clang] include: - - compiler: gcc - cpp-compiler: g++ - - compiler: clang - cpp-compiler: clang++ + - os: ubuntu-latest + cc: gcc + cxx: g++ + - os: ubuntu-latest + cc: clang + cxx: clang++ env: - CC: ${{ matrix.compiler }} - CXX: ${{ matrix.cpp-compiler }} + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} steps: - name: Checkout uses: actions/checkout@v2 + + - name: Get SDL2 headers + uses: actions/checkout@v2 + with: + repository: libsdl-org/SDL + ref: release-2.0.9 + path: SDL2 + - name: Link SDL2 headers into system path + run: | + sudo ln -s "$GITHUB_WORKSPACE/SDL2/include" /usr/local/include/SDL2 + - name: Install dependencies - run: sudo apt-get -y install gcc-multilib g++-multilib libgl1-mesa-dev - - name: Build client and server on ${{ matrix.os }} with ${{ matrix.compiler }} + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get -y install gcc-multilib g++-multilib + + - name: Build with xash3d-fwgs input run: | cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" && cmake --build build --target all + - name: Build with goldsource input + run: | + cmake -B build-gs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON && cmake --build build-gs --target all + diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 4cbc2008..29edfbde 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -183,7 +183,7 @@ int *HUD_GetRect( void ) return extent; } -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT class TeamFortressViewport : public vgui::Panel { public: @@ -238,7 +238,7 @@ so the HUD can reinitialize itself. int DLLEXPORT HUD_VidInit( void ) { gHUD.VidInit(); -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT vgui::Panel* root=(vgui::Panel*)gEngfuncs.VGui_GetPanel(); if (root) { gEngfuncs.Con_Printf( "Root VGUI panel exists\n" ); @@ -337,7 +337,7 @@ Called by engine every frame that client .dll is loaded void DLLEXPORT HUD_Frame( double time ) { -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#ifdef USE_VGUI_FOR_GOLDSOURCE_SUPPORT if (!gViewPort) gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect()); #else diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index 1d1c9f8b..8698a5d3 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -10,7 +10,7 @@ #include "input_mouse.h" -#if SUPPORT_GOLDSOURCE_INPUT +#ifdef SUPPORT_GOLDSOURCE_INPUT #include "hud.h" #include "cl_util.h" @@ -27,7 +27,7 @@ #define USE_SDL2 #endif -#if USE_SDL2 +#ifdef USE_SDL2 #define ARRAYSIZE(p) ( sizeof(p) /sizeof(p[0]) ) #include #include @@ -242,7 +242,7 @@ DWORD joy_oldbuttonstate, joy_oldpovstate; int joy_id; DWORD joy_numbuttons; -#if USE_SDL2 +#ifdef USE_SDL2 SDL_GameController *s_pJoystick = NULL; #elif defined(_WIN32) DWORD joy_flags; @@ -566,7 +566,7 @@ void GoldSourceInput::IN_Shutdown (void) } #endif -#if USE_SDL2 +#ifdef USE_SDL2 for (int j=0; j 0 ) { @@ -1084,7 +1084,7 @@ void IN_StartupJoystick (void) #endif } -#if USE_SDL2 +#ifdef USE_SDL2 int RawValuePointer (int axis) { switch (axis) @@ -1216,7 +1216,7 @@ void GoldSourceInput::IN_Commands (void) // loop through the joystick buttons // key a joystick event or auxillary event for higher number buttons for each state change -#if USE_SDL2 +#ifdef USE_SDL2 buttonstate = 0; for ( i = 0; i < SDL_CONTROLLER_BUTTON_MAX; i++ ) { @@ -1294,7 +1294,7 @@ IN_ReadJoystick */ int IN_ReadJoystick (void) { -#if USE_SDL2 +#ifdef USE_SDL2 safe_pfnSDL_JoystickUpdate(); return 1; #elif defined(_WIN32) @@ -1374,7 +1374,7 @@ void IN_JoyMove ( float frametime, usercmd_t *cmd ) for (i = 0; i < JOY_MAX_AXES; i++) { // get the floating point zero-centered, potentially-inverted data for the current axis -#if USE_SDL2 +#ifdef USE_SDL2 fAxisValue = (float)pdwRawValue[i]; #elif defined(_WIN32) fAxisValue = (float) *pdwRawValue[i]; @@ -1600,7 +1600,7 @@ void GoldSourceInput::IN_Init (void) } #endif -#if USE_SDL2 +#ifdef USE_SDL2 #if __APPLE__ #define SDL2_FULL_LIBNAME "libsdl2-2.0.0.dylib" #else diff --git a/cl_dll/input_mouse.cpp b/cl_dll/input_mouse.cpp index c5b1df6b..3233d797 100644 --- a/cl_dll/input_mouse.cpp +++ b/cl_dll/input_mouse.cpp @@ -10,7 +10,7 @@ cvar_t *in_joystick; FWGSInput fwgsInput; -#if SUPPORT_GOLDSOURCE_INPUT +#ifdef SUPPORT_GOLDSOURCE_INPUT GoldSourceInput goldSourceInput; AbstractInput* currentInput = &goldSourceInput; #else @@ -68,7 +68,7 @@ void IN_Shutdown( void ) void IN_Init( void ) { -#if SUPPORT_GOLDSOURCE_INPUT +#ifdef SUPPORT_GOLDSOURCE_INPUT if (IsXashFWGS()) { gEngfuncs.Con_Printf( "FWGS Xash3D input is in use\n" ); currentInput = &fwgsInput;