Browse Source

Merge branch 'master' into dmc

dmc
Andrey Akhmichin 4 years ago
parent
commit
2c76a05958
  1. 3
      cl_dll/CMakeLists.txt
  2. 20
      cl_dll/wscript
  3. 8
      cmake/LibraryNaming.cmake
  4. 1
      dlls/monsters.cpp
  5. 13
      dlls/multiplay_gamerules.cpp
  6. 6
      dlls/singleplay_gamerules.cpp
  7. 19
      dlls/wscript
  8. 17
      public/build.h
  9. 12
      scripts/waifulib/library_naming.py
  10. 4
      wscript

3
cl_dll/CMakeLists.txt

@ -122,6 +122,9 @@ endif() @@ -122,6 +122,9 @@ endif()
if(WIN32)
target_link_libraries( ${CLDLL_LIBRARY} user32.lib )
if (GOLDSOURCE_SUPPORT)
target_link_libraries( ${CLDLL_LIBRARY} winmm.lib )
endif()
endif()
set_target_properties (${CLDLL_LIBRARY} PROPERTIES

20
cl_dll/wscript

@ -10,12 +10,15 @@ def options(opt): @@ -10,12 +10,15 @@ def options(opt):
return
def configure(conf):
if conf.env.GOLDSRC and conf.env.DEST_OS != 'win32':
conf.check_cc(lib='dl')
if conf.env.DEST_OS == 'win32':
conf.check_cxx(lib='user32')
if conf.env.GOLDSRC:
if conf.env.DEST_OS == 'win32':
conf.check_cxx(lib='winmm')
else:
conf.check_cc(lib='dl')
def build(bld):
source = bld.path.parent.ant_glob([
'pm_shared/*.c'
@ -88,7 +91,6 @@ def build(bld): @@ -88,7 +91,6 @@ def build(bld):
'.',
'hl/',
'../dlls',
'../dlls/wpn_shared',
'../common',
'../engine',
'../pm_shared',
@ -102,12 +104,15 @@ def build(bld): @@ -102,12 +104,15 @@ def build(bld):
defines += ['GOLDSOURCE_SUPPORT']
libs = []
if bld.env.GOLDSRC and bld.env.DEST_OS != 'win32':
libs += ['DL']
if bld.env.DEST_OS == 'win32':
libs += ["USER32"]
if bld.env.GOLDSRC:
if bld.env.DEST_OS == 'win32':
libs += ["WINMM"]
else:
libs += ['DL']
if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR)
else:
@ -125,3 +130,4 @@ def build(bld): @@ -125,3 +130,4 @@ def build(bld):
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

8
cmake/LibraryNaming.cmake

@ -7,13 +7,13 @@ check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) @@ -7,13 +7,13 @@ check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID)
check_symbol_exists(XASH_APPLE "build.h" XASH_APPLE)
check_symbol_exists(XASH_ARM "build.h" XASH_ARM)
check_symbol_exists(XASH_ARM64 "build.h" XASH_ARM64)
check_symbol_exists(XASH_ARM_HARDFP "build.h" XASH_ARM_HARDFP)
check_symbol_exists(XASH_ARM_SOFTFP "build.h" XASH_ARM_SOFTFP)
check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4)
check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5)
check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6)
check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7)
check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8)
check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN)
check_symbol_exists(XASH_BSD "build.h" XASH_BSD)
check_symbol_exists(XASH_E2K "build.h" XASH_E2K)
@ -55,11 +55,13 @@ if(XASH_AMD64) @@ -55,11 +55,13 @@ if(XASH_AMD64)
set(BUILDARCH "amd64")
elseif(XASH_X86)
set(BUILDARCH "")
elseif(XASH_ARM64)
elseif(XASH_ARM AND XASH_64BIT)
set(BUILDARCH "arm64")
elseif(XASH_ARM)
set(BUILDARCH "armv")
if(XASH_ARMv7)
if(XASH_ARMv8)
set(BUILDARCH "${BUILDARCH}8_32")
elseif(XASH_ARMv7)
set(BUILDARCH "${BUILDARCH}7")
elseif(XASH_ARMv6)
set(BUILDARCH "${BUILDARCH}6")

1
dlls/monsters.cpp

@ -130,4 +130,3 @@ void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib ) {} @@ -130,4 +130,3 @@ void CBaseMonster :: Killed( entvars_t *pevAttacker, int iGib ) {}
int CBaseMonster :: TakeHealth (float flHealth, int bitsDamageType) { return 0; }
int CBaseMonster::Restore( class CRestore & ) { return 1; }
int CBaseMonster::Save( class CSave & ) { return 1; }

13
dlls/multiplay_gamerules.cpp

@ -371,6 +371,12 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI @@ -371,6 +371,12 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI
return FALSE;
}
if( pPlayer->m_iAutoWepSwitch == 2
&& pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) )
{
return FALSE;
}
if( !pPlayer->m_pActiveItem->CanHolster() )
{
// can't put away the active item.
@ -644,6 +650,11 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) @@ -644,6 +650,11 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
{
BOOL addDefault;
CBaseEntity *pWeaponEntity = NULL;
int iOldAutoWepSwitch;
iOldAutoWepSwitch = pPlayer->m_iAutoWepSwitch;
pPlayer->m_iAutoWepSwitch = 1;
pPlayer->pev->weapons |= ( 1 << IT_AXE );
@ -682,6 +693,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) @@ -682,6 +693,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
pPlayer->m_iQuakeWeapon = pPlayer->W_BestWeapon();
pPlayer->W_SetCurrentAmmo();
}
pPlayer->m_iAutoWepSwitch = iOldAutoWepSwitch;
}
//=========================================================

6
dlls/singleplay_gamerules.cpp

@ -80,6 +80,12 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem @@ -80,6 +80,12 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem
return FALSE;
}
if( pPlayer->m_iAutoWepSwitch == 2
&& pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) )
{
return FALSE;
}
if( !pPlayer->m_pActiveItem->CanHolster() )
{
return FALSE;

19
dlls/wscript

@ -21,7 +21,6 @@ def configure(conf): @@ -21,7 +21,6 @@ def configure(conf):
conf.fatal("Could not find hl.def")
def build(bld):
defines = []
source = bld.path.parent.ant_glob([
'pm_shared/*.c',
])
@ -128,16 +127,8 @@ def build(bld): @@ -128,16 +127,8 @@ def build(bld):
'zombie.cpp'
]
if bld.env.VOICEMGR:
source += bld.path.parent.ant_glob([
'game_shared/voice_gamemgr.cpp',
])
else:
defines += ['NO_VOICEGAMEMGR']
includes = [
'.',
'wpn_shared',
'../common',
'../engine',
'../pm_shared',
@ -145,6 +136,15 @@ def build(bld): @@ -145,6 +136,15 @@ def build(bld):
'../public'
]
defines = []
if bld.env.VOICEMGR:
source += bld.path.parent.ant_glob([
'game_shared/voice_gamemgr.cpp',
])
else:
defines += ['NO_VOICEGAMEMGR']
libs = []
if bld.env.DEST_OS not in ['android', 'dos']:
@ -164,3 +164,4 @@ def build(bld): @@ -164,3 +164,4 @@ def build(bld):
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)

17
public/build.h

@ -45,13 +45,13 @@ For more information, please refer to <http://unlicense.org/> @@ -45,13 +45,13 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_ANDROID
#undef XASH_APPLE
#undef XASH_ARM
#undef XASH_ARM64
#undef XASH_ARM_HARDFP
#undef XASH_ARM_SOFTFP
#undef XASH_ARMv4
#undef XASH_ARMv5
#undef XASH_ARMv6
#undef XASH_ARMv7
#undef XASH_ARMv8
//#undef XASH_BIG_ENDIAN
#undef XASH_BSD
#undef XASH_E2K
@ -169,14 +169,13 @@ For more information, please refer to <http://unlicense.org/> @@ -169,14 +169,13 @@ For more information, please refer to <http://unlicense.org/>
#define XASH_AMD64 1
#elif defined(__i386__) || defined(_X86_) || defined(_M_IX86)
#define XASH_X86 1
#elif defined __aarch64__
#elif defined __aarch64__ || defined _M_ARM64
#define XASH_64BIT 1
#define XASH_ARM64 1
#define XASH_ARM 8
#elif defined __arm__ || defined _M_ARM
#if defined _M_ARM
// msvc can only armv7 ?
#define XASH_ARM 7
#elif __ARM_ARCH == 7 || __ARM_ARCH_7__
#if __ARM_ARCH == 8 || __ARM_ARCH_8__
#define XASH_ARM 8
#elif __ARM_ARCH == 7 || __ARM_ARCH_7__ || defined _M_ARM // msvc can only armv7 in 32 bit
#define XASH_ARM 7
#elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__
#define XASH_ARM 6
@ -212,7 +211,9 @@ For more information, please refer to <http://unlicense.org/> @@ -212,7 +211,9 @@ For more information, please refer to <http://unlicense.org/>
#define XASH_64BIT 1
#endif
#if XASH_ARM == 7
#if XASH_ARM == 8
#define XASH_ARMv8 1
#elif XASH_ARM == 7
#define XASH_ARMv7 1
#elif XASH_ARM == 6
#define XASH_ARMv6 1

12
scripts/waifulib/library_naming.py

@ -25,13 +25,13 @@ DEFINES = [ @@ -25,13 +25,13 @@ DEFINES = [
'XASH_ANDROID',
'XASH_APPLE',
'XASH_ARM',
'XASH_ARM64',
'XASH_ARM_HARDFP',
'XASH_ARM_SOFTFP',
'XASH_ARMv4',
'XASH_ARMv5',
'XASH_ARMv6',
'XASH_ARMv7',
'XASH_ARMv8',
'XASH_BIG_ENDIAN',
'XASH_BSD',
'XASH_E2K',
@ -61,9 +61,9 @@ def configure(conf): @@ -61,9 +61,9 @@ def configure(conf):
'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x),
'includes': [conf.path.find_node('public/').abspath()],
'define_name': x }, DEFINES )
conf.multicheck(*tests, msg = '', mandatory = False, quiet = True)
# engine/common/build.c
if conf.env.XASH_ANDROID:
buildos = "android"
@ -87,11 +87,13 @@ def configure(conf): @@ -87,11 +87,13 @@ def configure(conf):
buildarch = "amd64"
elif conf.env.XASH_X86:
buildarch = ""
elif conf.env.XASH_ARM64:
elif conf.env.XASH_ARM and conf.env.XASH_64BIT:
buildarch = "arm64"
elif conf.env.XASH_ARM:
buildarch = "armv"
if conf.env.XASH_ARMv7:
if conf.env.XASH_ARMv8:
buildarch += "8_32"
elif conf.env.XASH_ARMv7:
buildarch += "7"
elif conf.env.XASH_ARMv6:
buildarch += "6"

4
wscript

@ -271,6 +271,10 @@ def configure(conf): @@ -271,6 +271,10 @@ def configure(conf):
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
conf.define('CLIENT_WEAPONS', '1')
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')

Loading…
Cancel
Save