Browse Source

Merge branch 'master' into mobile_hacks

mobile_hacks
Andrey Akhmichin 4 years ago
parent
commit
a602a557c9
  1. 2
      dlls/crowbar.cpp
  2. 4
      dlls/weapons.cpp
  3. 12
      waf
  4. 43
      wscript

2
dlls/crowbar.cpp

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

4
dlls/weapons.cpp

@ -1110,13 +1110,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, // 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. // 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; m_iDefaultAmmo = 0;
} }
if( pszAmmo2() != NULL ) if( pszAmmo2() != NULL )
{ {
iReturn = pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() ); iReturn |= pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
} }
return iReturn; return iReturn;

12
waf vendored

File diff suppressed because one or more lines are too long

43
wscript

@ -46,13 +46,14 @@ def options(opt):
grp.add_option('--enable-simple-mod-hacks', action = 'store_true', dest = 'SIMPLE_MOD_HACKS', default = False, grp.add_option('--enable-simple-mod-hacks', action = 'store_true', dest = 'SIMPLE_MOD_HACKS', default = False,
help = 'enable hacks for simple mods that don\'t touch HL game logic so much but still require small patches. Enforced for Android. [default: %default]') help = 'enable hacks for simple mods that don\'t touch HL game logic so much but still require small patches. 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.add_subproject(['cl_dll', 'dlls'])
opt.load('msvc msdev msvs')
opt.load('reconfigure subproject') opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install msdev msvs')
opt.add_subproject(["cl_dll", "dlls"]) if sys.platform == 'win32':
opt.load('msvc')
opt.load('reconfigure')
def configure(conf): def configure(conf):
# Configuration # Configuration
@ -62,7 +63,7 @@ def configure(conf):
conf.env.SERVER_NAME = 'hl' conf.env.SERVER_NAME = 'hl'
conf.env.PREFIX = '' conf.env.PREFIX = ''
conf.load('fwgslib reconfigure') conf.load('fwgslib reconfigure enforce_pic')
enforce_pic = True # modern defaults enforce_pic = True # modern defaults
valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none']
@ -87,10 +88,19 @@ def configure(conf):
# subsystem=bld.env.MSVC_SUBSYSTEM # subsystem=bld.env.MSVC_SUBSYSTEM
# TODO: wrapper around bld.stlib, bld.shlib and so on? # TODO: wrapper around bld.stlib, bld.shlib and so on?
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01' conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64']
if sys.platform == 'win32':
conf.load('msvc msdev') # Load compilers early
conf.load('xcompile compiler_c compiler_cxx strip_on_install') 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: try:
conf.env.CC_VERSION[0] conf.env.CC_VERSION[0]
@ -104,17 +114,8 @@ def configure(conf):
conf.env.MAGX = conf.options.MAGX conf.env.MAGX = conf.options.MAGX
if conf.options.MAGX: if conf.options.MAGX:
enforce_pic = False enforce_pic = False
if enforce_pic: conf.check_pic(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')
# We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture
# Because compatibility with original GoldSrc # Because compatibility with original GoldSrc

Loading…
Cancel
Save