Browse Source

Merge branch 'master' into bshift

bshift
Andrey Akhmichin 4 years ago
parent
commit
1013b1e145
  1. 23
      cl_dll/hud_spectator.cpp
  2. 6
      cl_dll/input.cpp
  3. 4
      cl_dll/scoreboard.cpp
  4. 4
      cl_dll/view.cpp
  5. 5
      cmake/LibraryNaming.cmake
  6. 5
      dlls/bigmomma.cpp
  7. 5
      dlls/cbase.cpp
  8. 2
      dlls/cbase.h
  9. 2
      dlls/crowbar.cpp
  10. 16
      dlls/multiplay_gamerules.cpp
  11. 3
      dlls/turret.cpp
  12. 4
      dlls/weapons.cpp
  13. 14
      pm_shared/pm_shared.c
  14. 4
      public/build.h
  15. 3
      scripts/waifulib/library_naming.py
  16. 12
      waf
  17. 43
      wscript

23
cl_dll/hud_spectator.cpp

@ -824,6 +824,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -824,6 +824,7 @@ bool CHudSpectator::ParseOverviewFile()
char levelname[256] = { 0 };
char token[1024] = { 0 };
float height;
bool ret = false;
char *afile = NULL, *pfile = NULL;
@ -843,7 +844,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -843,7 +844,7 @@ bool CHudSpectator::ParseOverviewFile()
strcpy( m_OverviewData.map, gEngfuncs.pfnGetLevelName() );
if( m_OverviewData.map[0] == '\0' )
return false; // not active yet
return ret; // not active yet
strcpy( levelname, m_OverviewData.map + 5 );
levelname[strlen( levelname ) - 4] = 0;
@ -855,7 +856,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -855,7 +856,7 @@ bool CHudSpectator::ParseOverviewFile()
if( !pfile )
{
gEngfuncs.Con_DPrintf( "Couldn't open file %s. Using default values for overiew mode.\n", filename );
return false;
return ret;
}
while( true )
@ -872,7 +873,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -872,7 +873,7 @@ bool CHudSpectator::ParseOverviewFile()
if( stricmp( token, "{" ) )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (expected { )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -912,7 +913,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -912,7 +913,7 @@ bool CHudSpectator::ParseOverviewFile()
else
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (%s unkown)\n", filename, token );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token ); // parse next token
@ -924,7 +925,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -924,7 +925,7 @@ bool CHudSpectator::ParseOverviewFile()
if( m_OverviewData.layers == OVERVIEW_MAX_LAYERS )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. ( too many layers )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -932,7 +933,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -932,7 +933,7 @@ bool CHudSpectator::ParseOverviewFile()
if( stricmp( token, "{" ) )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (expected { )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -953,7 +954,7 @@ bool CHudSpectator::ParseOverviewFile() @@ -953,7 +954,7 @@ bool CHudSpectator::ParseOverviewFile()
else
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (%s unkown)\n", filename, token );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token ); // parse next token
@ -963,12 +964,14 @@ bool CHudSpectator::ParseOverviewFile() @@ -963,12 +964,14 @@ bool CHudSpectator::ParseOverviewFile()
}
}
gEngfuncs.COM_FreeFile( afile );
m_mapZoom = m_OverviewData.zoom;
m_mapOrigin = m_OverviewData.origin;
return true;
ret = true;
end:
gEngfuncs.COM_FreeFile( afile );
return ret;
}
void CHudSpectator::LoadMapSprites()

6
cl_dll/input.cpp

@ -645,11 +645,13 @@ void IN_Impulse( void ) @@ -645,11 +645,13 @@ void IN_Impulse( void )
void IN_ScoreDown( void )
{
KeyDown( &in_score );
gHUD.m_Scoreboard.UserCmd_ShowScores();
}
void IN_ScoreUp( void )
{
KeyUp( &in_score );
gHUD.m_Scoreboard.UserCmd_HideScores();
}
void IN_MLookUp( void )
@ -1082,6 +1084,10 @@ void InitInput( void ) @@ -1082,6 +1084,10 @@ void InitInput( void )
gEngfuncs.pfnAddCommand( "-reload", IN_ReloadUp );
gEngfuncs.pfnAddCommand( "+alt1", IN_Alt1Down );
gEngfuncs.pfnAddCommand( "-alt1", IN_Alt1Up );
gEngfuncs.pfnAddCommand( "+score", IN_ScoreDown );
gEngfuncs.pfnAddCommand( "-score", IN_ScoreUp );
gEngfuncs.pfnAddCommand( "+showscores", IN_ScoreDown );
gEngfuncs.pfnAddCommand( "-showscores", IN_ScoreUp );
gEngfuncs.pfnAddCommand( "+graph", IN_GraphDown );
gEngfuncs.pfnAddCommand( "-graph", IN_GraphUp );
gEngfuncs.pfnAddCommand( "+break", IN_BreakDown );

4
cl_dll/scoreboard.cpp

@ -51,8 +51,8 @@ int CHudScoreboard::Init( void ) @@ -51,8 +51,8 @@ int CHudScoreboard::Init( void )
gHUD.AddHudElem( this );
// Hook messages & commands here
HOOK_COMMAND( "+showscores", ShowScores );
HOOK_COMMAND( "-showscores", HideScores );
// HOOK_COMMAND( "+showscores", ShowScores );
// HOOK_COMMAND( "-showscores", HideScores );
HOOK_MESSAGE( ScoreInfo );
HOOK_MESSAGE( TeamScore );

4
cl_dll/view.cpp

@ -736,6 +736,10 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) @@ -736,6 +736,10 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
if( CL_IsThirdPerson() )
{
VectorCopy( camAngles, pparams->viewangles );
}
// Apply this at all times
{
float pitch = camAngles[0];
// Normalize angles

5
cmake/LibraryNaming.cmake

@ -29,6 +29,7 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM) @@ -29,6 +29,7 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM)
check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC)
check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD)
check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU)
check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32)
check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64)
check_symbol_exists(XASH_X86 "build.h" XASH_X86)
@ -45,6 +46,8 @@ elseif(XASH_NETBSD) @@ -45,6 +46,8 @@ elseif(XASH_NETBSD)
set(BUILDOS "netbsd")
elseif(XASH_OPENBSD)
set(BUILDOS "openbsd")
elseif(XASH_HAIKU)
set(BUILDOS "haiku")
elseif(XASH_EMSCRIPTEN)
set(BUILDOS "emscripten")
else()
@ -92,7 +95,7 @@ endif() @@ -92,7 +95,7 @@ endif()
if(BUILDOS STREQUAL "android")
set(POSTFIX "") # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming
elif(BUILDOS AND BUILDARCH)
elseif(BUILDOS AND BUILDARCH)
set(POSTFIX "_${BUILDOS}_${BUILDARCH}")
elseif(BUILDARCH)
set(POSTFIX "_${BUILDARCH}")

5
dlls/bigmomma.cpp

@ -1034,7 +1034,7 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot @@ -1034,7 +1034,7 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot
Vector vecScale;
Vector vecGrenadeVel;
Vector vecTemp;
float flGravity = g_psv_gravity->value;
float flGravity = Q_max( g_psv_gravity->value, 0.1f );
// calculate the midpoint and apex of the 'triangle'
vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f;
@ -1050,6 +1050,9 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot @@ -1050,6 +1050,9 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot
// Don't worry about actually hitting the target, this won't hurt us!
// TODO: Need another way to calculate height because current calculation is completely wrong
// and there posible crash.
// How high should the grenade travel (subtract 15 so the grenade doesn't hit the ceiling)?
float height = vecApex.z - vecSpot1.z - 15.0f;
// How fast does the grenade need to travel to reach that height given gravity?

5
dlls/cbase.cpp

@ -255,6 +255,8 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) @@ -255,6 +255,8 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData )
{
ENTITYTABLE *pTable = &pSaveData->pTable[pSaveData->currentIndex];
gpGlobals->time = pSaveData->time;
if( pTable->pent != pent )
ALERT( at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n" );
@ -307,6 +309,9 @@ int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity @@ -307,6 +309,9 @@ int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity
Vector oldOffset;
CRestore restoreHelper( pSaveData );
gpGlobals->time = pSaveData->time;
if( globalEntity )
{
CRestore tmpRestore( pSaveData );

2
dlls/cbase.h

@ -193,7 +193,7 @@ public: @@ -193,7 +193,7 @@ public:
virtual BOOL IsAlive( void ) { return (pev->deadflag == DEAD_NO) && pev->health > 0; }
virtual BOOL IsBSPModel( void ) { return pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP; }
virtual BOOL ReflectGauss( void ) { return ( IsBSPModel() && !pev->takedamage ); }
virtual BOOL HasTarget( string_t targetname ) { return FStrEq(STRING(targetname), STRING(pev->targetname) ); }
virtual BOOL HasTarget( string_t targetname ) { return FStrEq(STRING(targetname), STRING(pev->target) ); }
virtual BOOL IsInWorld( void );
virtual BOOL IsPlayer( void ) { return FALSE; }
virtual BOOL IsNetClient( void ) { return FALSE; }

2
dlls/crowbar.cpp

@ -335,7 +335,7 @@ int CCrowbar::Swing( int fFirst ) @@ -335,7 +335,7 @@ int CCrowbar::Swing( int fFirst )
m_pPlayer->m_iWeaponVolume = (int)( flVol * CROWBAR_WALLHIT_VOLUME );
SetThink( &CCrowbar::Smack );
pev->nextthink = UTIL_WeaponTimeBase() + 0.2f;
pev->nextthink = gpGlobals->time + 0.2f;
#endif
#ifdef CROWBAR_DELAY_FIX
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f;

16
dlls/multiplay_gamerules.cpp

@ -709,12 +709,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, @@ -709,12 +709,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
const char *tau = "tau_cannon";
const char *gluon = "gluon gun";
if( pKiller->flags & FL_CLIENT )
if( pevInflictor )
{
killer_index = ENTINDEX( ENT( pKiller ) );
if( pevInflictor )
if( pKiller->flags & FL_CLIENT )
{
killer_index = ENTINDEX( ENT( pKiller ) );
if( pevInflictor == pKiller )
{
// If the inflictor is the killer, then it must be their current weapon doing the damage
@ -730,10 +730,10 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, @@ -730,10 +730,10 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
killer_weapon_name = STRING( pevInflictor->classname ); // it's just that easy
}
}
}
else
{
killer_weapon_name = STRING( pevInflictor->classname );
else
{
killer_weapon_name = STRING( pevInflictor->classname );
}
}
// strip the monster_* or weapon_* from the inflictor's classname

3
dlls/turret.cpp

@ -1150,6 +1150,9 @@ void CSentry::Precache() @@ -1150,6 +1150,9 @@ void CSentry::Precache()
{
CBaseTurret::Precache();
PRECACHE_MODEL( "models/sentry.mdl" );
PRECACHE_SOUND( "weapons/hks1.wav" );
PRECACHE_SOUND( "weapons/hks2.wav" );
PRECACHE_SOUND( "weapons/hks3.wav" );
}
void CSentry::Spawn()

4
dlls/weapons.cpp

@ -1101,13 +1101,13 @@ int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) @@ -1101,13 +1101,13 @@ int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon )
{
// blindly call with m_iDefaultAmmo. It's either going to be a value or zero. If it is zero,
// we only get the ammo in the weapon's clip, which is what we want.
iReturn = pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
iReturn |= pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
m_iDefaultAmmo = 0;
}
if( pszAmmo2() != NULL )
{
iReturn = pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
iReturn |= pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
}
return iReturn;

14
pm_shared/pm_shared.c

@ -63,19 +63,7 @@ playermove_t *pmove = NULL; @@ -63,19 +63,7 @@ playermove_t *pmove = NULL;
#define STOP_EPSILON 0.1f
#define CTEXTURESMAX 512 // max number of textures loaded
#define CBTEXTURENAMEMAX 13 // only load first n chars of name
#define CHAR_TEX_CONCRETE 'C' // texture types
#define CHAR_TEX_METAL 'M'
#define CHAR_TEX_DIRT 'D'
#define CHAR_TEX_VENT 'V'
#define CHAR_TEX_GRATE 'G'
#define CHAR_TEX_TILE 'T'
#define CHAR_TEX_SLOSH 'S'
#define CHAR_TEX_WOOD 'W'
#define CHAR_TEX_COMPUTER 'P'
#define CHAR_TEX_GLASS 'Y'
#define CHAR_TEX_FLESH 'F'
#include "pm_materials.h"
#define STEP_CONCRETE 0 // default step sound
#define STEP_METAL 1 // metal floor

4
public/build.h

@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/> @@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_MSVC
#undef XASH_NETBSD
#undef XASH_OPENBSD
#undef XASH_HAIKU
#undef XASH_WIN32
#undef XASH_WIN64
#undef XASH_X86
@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/> @@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/>
#elif defined __WATCOMC__ && defined __DOS__
#define XASH_DOS4GW 1
#define XASH_LITTLE_ENDIAN
#elif defined __HAIKU__
#define XASH_HAIKU 1
#define XASH_POSIX 1
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

3
scripts/waifulib/library_naming.py

@ -47,6 +47,7 @@ DEFINES = [ @@ -47,6 +47,7 @@ DEFINES = [
'XASH_MSVC',
'XASH_NETBSD',
'XASH_OPENBSD',
'XASH_HAIKU',
'XASH_WIN32',
'XASH_WIN64',
'XASH_X86',
@ -79,6 +80,8 @@ def configure(conf): @@ -79,6 +80,8 @@ def configure(conf):
buildos = "emscripten"
elif conf.env.XASH_DOS4GW:
buildos = "dos4gw" # unused, just in case
elif conf.env.XASH_HAIKU:
buildos = "haiku"
else:
conf.fatal("Place your operating system name in build.h and library_naming.py!\n"
"If this is a mistake, try to fix conditions above and report a bug")

12
waf vendored

File diff suppressed because one or more lines are too long

43
wscript

@ -46,13 +46,14 @@ def options(opt): @@ -46,13 +46,14 @@ def options(opt):
grp.add_option('--enable-simple-mod-hacks', action = 'store_true', dest = 'ENABLE_MOD_HACKS', default = False,
help = 'enable hacks for simple mods that mostly compatible with Half-Life but has little changes. Enforced for Android. [default: %default]')
opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install')
opt.load('subproject')
if sys.platform == 'win32':
opt.load('msvc msdev msvs')
opt.add_subproject(['cl_dll', 'dlls'])
opt.load('reconfigure subproject')
opt.add_subproject(["cl_dll", "dlls"])
opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install msdev msvs')
if sys.platform == 'win32':
opt.load('msvc')
opt.load('reconfigure')
def configure(conf):
# Configuration
@ -62,7 +63,7 @@ def configure(conf): @@ -62,7 +63,7 @@ def configure(conf):
conf.env.SERVER_NAME = 'bshift'
conf.env.PREFIX = ''
conf.load('fwgslib reconfigure')
conf.load('fwgslib reconfigure enforce_pic')
enforce_pic = True # modern defaults
valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none']
@ -87,10 +88,19 @@ def configure(conf): @@ -87,10 +88,19 @@ def configure(conf):
# subsystem=bld.env.MSVC_SUBSYSTEM
# TODO: wrapper around bld.stlib, bld.shlib and so on?
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC
if sys.platform == 'win32':
conf.load('msvc msdev')
conf.load('xcompile compiler_c compiler_cxx strip_on_install')
conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64']
# Load compilers early
conf.load('xcompile compiler_c compiler_cxx')
# HACKHACK: override msvc DEST_CPU value by something that we understand
if conf.env.DEST_CPU == 'amd64':
conf.env.DEST_CPU = 'x86_64'
if conf.env.COMPILER_CC == 'msvc':
conf.load('msvc_pdb')
conf.load('msvs msdev strip_on_install')
try:
conf.env.CC_VERSION[0]
@ -104,17 +114,8 @@ def configure(conf): @@ -104,17 +114,8 @@ def configure(conf):
conf.env.MAGX = conf.options.MAGX
if conf.options.MAGX:
enforce_pic = False
if enforce_pic:
# Every static library must have fPIC
if conf.env.DEST_OS != 'win32' and '-fPIC' in conf.env.CFLAGS_cshlib:
conf.env.append_unique('CFLAGS_cstlib', '-fPIC')
conf.env.append_unique('CXXFLAGS_cxxstlib', '-fPIC')
else:
conf.env.CFLAGS_cshlib.remove('-fPIC')
conf.env.CXXFLAGS_cxxshlib.remove('-fPIC')
conf.env.CFLAGS_MACBUNDLE.remove('-fPIC')
conf.env.CXXFLAGS_MACBUNDLE.remove('-fPIC')
conf.check_pic(enforce_pic)
# We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture
# Because compatibility with original GoldSrc

Loading…
Cancel
Save