From b349bbfd82cde50181c94ccab725560b22cb0461 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 8 Jul 2019 21:11:06 +0300 Subject: [PATCH 001/298] Fix rapid crowbar bug --- dlls/crowbar.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 8a0ba9a3..e08a64fb 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -287,7 +287,10 @@ int CCrowbar::Swing( int fFirst ) } m_pPlayer->m_iWeaponVolume = CROWBAR_BODYHIT_VOLUME; if( !pEntity->IsAlive() ) + { + m_flNextPrimaryAttack = GetNextAttackDelay(0.25); return TRUE; + } else flVol = 0.1; From 1f584d72374b79b3c888841ea14ab3f992a04cbe Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 8 Jul 2019 21:20:14 +0300 Subject: [PATCH 002/298] Fix crowbar delay after the first hit --- dlls/crowbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 8a0ba9a3..735b47ff 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -330,7 +330,7 @@ int CCrowbar::Swing( int fFirst ) SetThink( &CCrowbar::Smack ); pev->nextthink = UTIL_WeaponTimeBase() + 0.2; #endif - m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 ); + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); From 413e2c941e5335dac43afa84a10ae80f87985573 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 27 Aug 2019 17:00:53 +0300 Subject: [PATCH 003/298] Add warning checks --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80c2c5d9..ffae124c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,11 @@ if(${CMAKE_VERSION} VERSION_LESS "3.0.2") endmacro() endif() +if(NOT MSVC) + add_compile_options(-Wempty-body) # GCC/Clang flag + add_compile_options(-Wreturn-type) # GCC/Clang flag +endif() + if(BUILD_CLIENT) add_subdirectory(cl_dll) endif() From 6143c74dc9ec26016767976f2d606979490b5728 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 10 Sep 2019 11:25:51 +0600 Subject: [PATCH 004/298] waifulib: allow compiling using host clang and NDK sysroots, thus enabling building engine from any environment that has clang(termux as example) --- scripts/waifulib/xcompile.py | 112 +++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 32 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index d6bb1a8b..c0365ddd 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -38,16 +38,18 @@ class Android: ndk_rev = 0 is_hardfloat = False clang = False - + def __init__(self, ctx, arch, toolchain, api): self.ctx = ctx + self.api = api + for i in ['ANDROID_NDK_HOME', 'ANDROID_NDK']: self.ndk_home = os.getenv(i) if self.ndk_home != None: break if not self.ndk_home: - conf.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') + ctx.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') # TODO: this were added at some point of NDK development # but I don't know at which version @@ -86,13 +88,18 @@ class Android: elif self.ndk_rev >= 19 and self.api < 16: Logs.warn('API level automatically was set to 16 due to NDK support') self.api = 16 - else: self.api = api self.toolchain_path = self.gen_toolchain_path() # TODO: Crystax support? # TODO: Support for everything else than linux-x86_64? # TODO: Determine if I actually need to implement listed above + def is_host(self): + ''' + Checks if we using host compiler(implies clang) + ''' + return self.toolchain == 'host' + def is_arm(self): ''' Checks if selected architecture is **32-bit** ARM @@ -126,7 +133,16 @@ class Android: def is_hardfp(self): return self.is_hardfloat - def gen_toolchain_path(self): + def ndk_triplet(self): + if self.is_x86(): + triplet = 'i686-linux-android' + elif self.is_arm(): + triplet = 'arm-linux-androideabi' + else: + triplet = self.arch + '-linux-android' + return triplet + + def gen_gcc_toolchain_path(self): path = 'toolchains' if sys.platform.startswith('linux'): @@ -149,13 +165,6 @@ class Android: raise Exception('Clang is not supported for this NDK') toolchain_folder = 'llvm' - - if self.is_x86(): - triplet = 'i686-linux-android{}-'.format(self.api) - elif self.is_arm(): - triplet = 'armv7a-linux-androideabi{}-'.format(self.api) - else: - triplet = self.arch + '-linux-android{}-'.format(self.api) else: if self.is_x86() or self.is_amd64(): toolchain_folder = self.arch + '-' + self.toolchain @@ -164,42 +173,70 @@ class Android: else: toolchain_folder = self.arch + '-linux-android-' + self.toolchain - if self.is_x86(): - triplet = 'i686-linux-android-' - elif self.is_arm(): - triplet = 'arm-linux-androideabi-' - else: - triplet = self.arch + '-linux-android-' + return os.path.abspath(os.path.join(self.ndk_home, path, toolchain_folder, 'prebuilt', toolchain_host)) - return os.path.join(path, toolchain_folder, 'prebuilt', toolchain_host, 'bin', triplet) + def gen_toolchain_path(self): + if self.is_clang(): + if self.is_x86(): + triplet = 'i686-linux-android{}-'.format(self.api) + elif self.is_arm(): + triplet = 'armv7a-linux-androideabi{}-'.format(self.api) + else: + triplet = self.arch + '-linux-android{}-'.format(self.api) + else: + triplet = self.ndk_triplet() + '-' + return os.path.join(self.gen_gcc_toolchain_path(), 'bin', triplet) def cc(self): - return os.path.abspath(os.path.join(self.ndk_home, self.toolchain_path + ('clang' if self.is_clang() else 'gcc'))) + if self.is_host(): + return 'clang' + return self.toolchain_path + ('clang' if self.is_clang() else 'gcc') def cxx(self): - return os.path.abspath(os.path.join(self.ndk_home, self.toolchain_path + ('clang++' if self.is_clang() else 'g++'))) + if self.is_host(): + return 'clang++' + return self.toolchain_path + ('clang++' if self.is_clang() else 'g++') def system_stl(self): # TODO: proper STL support return os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'system', 'include')) + def libsysroot(self): + arch = self.arch + if self.is_arm(): + arch = 'arm' + elif self.is_arm64(): + arch = 'arm64' + path = 'platforms/android-{}/arch-{}'.format(self.api, arch) + + return os.path.abspath(os.path.join(self.ndk_home, path)) + def sysroot(self): - if self.ndk_rev >= 19: + if self.ndk_rev >= 19 or self.is_host(): return os.path.abspath(os.path.join(self.ndk_home, 'sysroot')) else: - arch = self.arch - if self.is_arm(): - arch = 'arm' - elif self.is_arm64(): - arch = 'arm64' - path = 'platforms/android-{}/arch-{}'.format(self.api, arch) + return self.libsysroot() - return os.path.abspath(os.path.join(self.ndk_home, path)) + def clang_host_triplet(self): + triplet = '' + if self.is_arm(): + triplet += 'arm' + elif self.is_x86(): + triplet += 'i686' + else: + triplet += self.arch + triplet += '-linux-android' + return triplet def cflags(self): cflags = [] + if self.is_host(): + cflags += ['-nostdlib', '--target=%s' % self.clang_host_triplet()] + if self.ndk_rev < 20: - cflags = ['--sysroot={0}'.format(self.sysroot())] + cflags += ['--sysroot={0}'.format(self.sysroot())] + elif self.is_host(): + cflags += ['-isysroot={0}'.format(self.sysroot())] cflags += ['-DANDROID', '-D__ANDROID__'] cflags += ['-I{0}'.format(self.system_stl())] if self.is_arm(): @@ -222,15 +259,26 @@ class Android: # they go before object list def linkflags(self): linkflags = [] - if self.ndk_rev < 20: - linkflags = ['--sysroot={0}'.format(self.sysroot())] + if self.is_host(): + linkflags += ['-fuse-ld=lld', '-nostdlib', '--target=%s' % self.clang_host_triplet(), + '--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] + + if self.ndk_rev < 20 or self.is_host(): + linkflags += ['--sysroot={0}'.format(self.libsysroot())] + + if self.is_host(): + linkflags += ['-L{0}/usr/lib/{1}'.format(self.sysroot(), self.ndk_triplet()), + '-L{0}/sysroot/usr/lib/{1}/'.format(self.gen_gcc_toolchain_path(), self.ndk_triplet())] return linkflags def ldflags(self): ldflags = ['-lgcc', '-no-canonical-prefixes'] if self.is_arm(): if self.arch == 'armeabi-v7a': - ldflags += ['-march=armv7-a', '-Wl,--fix-cortex-a8', '-mthumb'] + ldflags += ['-march=armv7-a'] + if not self.is_host(): # lld only + ldflags += ['-Wl,--fix-cortex-a8'] + ldflags += ['-mthumb'] if self.is_hardfloat: ldflags += ['-Wl,--no-warn-mismatch', '-lm_hard'] else: From 07884957fbe15c5672dcf7a10dbda215ec20c380 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 10 Sep 2019 10:32:12 +0300 Subject: [PATCH 005/298] waf: update binary waf --- waf | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/waf b/waf index b35987aa..3bd5c703 100755 --- a/waf +++ b/waf @@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect -VERSION="2.0.17" -REVISION="da8474e646911ac5657990d535080c54" -GIT="31da55afb92d9865019eb5193e874d1ffb86c522" +VERSION="2.0.18" +REVISION="51fff4c95844a6b013877286b96a55d0" +GIT="68bf3867df33c04c944e8905820fc4cca4b663d1" INSTALL='' -C1='#9' -C2='#3' -C3='#*' +C1='#/' +C2='#-' +C3='#%' cwd = os.getcwd() join = os.path.join @@ -140,6 +140,9 @@ def find_lib(): if name.endswith('waf-light'): w = test(base) if w: return w + for dir in sys.path: + if test(dir): + return dir err('waf-light requires waflib -> export WAFDIR=/folder') dirname = '%s-%s-%s' % (WAF, VERSION, REVISION) @@ -165,5 +168,5 @@ if __name__ == '__main__': Scripting.waf_entry_point(cwd, VERSION, wafdir) #==> -#BZh91AY&SYL79u  8X0EbQ\{*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#3oKmCamvueJwt]Sf:lݶq:}S۹NNݺ7}ۡ{;RR]#9טͬ@aحٽy_>gv|axoyzw#*Ogmoޏl{3w|#*#*#*#*6>=#*N{r#*ݻaݭw+Z57:٦Im݅8F#9CMw#*DT#*"DPTzRJnT׽z>wsK+w*ۮ"jO[ppwcT>Jzz$c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A*ȖZdV4ϖbs{!*'4Se!<ΜnֳU1w&'DPR#drBL^Ypdj<)ZvOW5+#/lewhcլ,Cf$xޔ*㻧3ڙ̡# wˆ4<6xu7VE;lbH* 1!~,7CEʊi <>$W^2`¶hHS8xtwm#/@X`A10  5:9· ۛhґ1/kB*ҙmEf&,(2J(y)rlONa&'MV` L5)+C:{#/h N^)THK+#yB"]w:1NI9]Cr^͐e=2X/"-M(;@[%=#>qd4_Pt`<ٮ!9oT#-T!j8,'Ek_p}[{6h6Wvz9FX)5I8C^5dm661^-4Vؐhi#!cv5h7])`nbRoeBCձ,bmxˣb'DLQZc6f t)CBp$dc%B$>?h|qv/#-d 3x_{bq?+OP$DX @G-vjֹf[S3]-fK{ok[_E$ӿV}bmB6zunt%Jj&|fׁt oNegQQᦳ~-?AW(!y#-A'BY! ((O""JT?JHCM n=ѻ޴aS쯫._}Z;7kv"|>|)CۧO&ӆ67WaԗMM-7;?X燍v>Ӝ6^GEi_#/z݇ṓ7*#%̰~Y'E,x;u%.8RqWW!'?tB_Nu$#ep:Wo)}ڮg0ja#|}N@΃++X7 ^[ c~qQ-y[Na ~MGa_$ wD f8M๻5i |\y+2SȪb0<~X_~!dǂ/ӂN-1ojM_ނȬCh;e V^$?"(H~ #<== From a9d9f475b044f9c8026518e2af37d196bf6538d8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 10 Sep 2019 10:33:19 +0300 Subject: [PATCH 006/298] wscript: enable clang_compilation_database in options --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index ede9efa4..ef74ff6e 100644 --- a/wscript +++ b/wscript @@ -29,7 +29,7 @@ def options(opt): opt.recurse('cl_dll dlls') - opt.load('xcompile compiler_cxx compiler_c') + opt.load('xcompile compiler_cxx compiler_c clang_compilation_database') if sys.platform == 'win32': opt.load('msvc msdev') opt.load('reconfigure') From d9c5b04c54930398698dea62c9e138e674381540 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 11 Sep 2019 20:44:05 +0300 Subject: [PATCH 007/298] waf: add strip_on_install plugin from engine repository --- scripts/waifulib/strip_on_install.py | 46 ++++++++++++++++++++++++++++ scripts/waifulib/xcompile.py | 11 ++++++- wscript | 4 +-- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 scripts/waifulib/strip_on_install.py diff --git a/scripts/waifulib/strip_on_install.py b/scripts/waifulib/strip_on_install.py new file mode 100644 index 00000000..b334c901 --- /dev/null +++ b/scripts/waifulib/strip_on_install.py @@ -0,0 +1,46 @@ +#! /usr/bin/env python +# Modified: Alibek Omarov +# Originally taken from Thomas Nagy's blogpost + +""" +Strip executables upon installation +""" + +import shutil, os +from waflib import Build, Utils, Context, Errors, Logs + +def options(opt): + grp = opt.option_groups['install/uninstall options'] + grp.add_option('--no-strip', dest='no_strip', action='store_true', default=False, + help='don\'t strip binaries. You must pass this flag to install command(default: False)') + +def configure(conf): + if conf.env.DEST_BINFMT in ['elf', 'mac-o']: + conf.find_program('strip') + if not conf.env.STRIPFLAGS: + conf.env.STRIPFLAGS = os.environ['STRIPFLAGS'] if 'STRIPFLAGS' in os.environ else [] + +def copy_fun(self, src, tgt): + inst_copy_fun(self, src, tgt) + + if self.generator.bld.options.no_strip: + return + + if conf.env.DEST_BINFMT not in ['elf', 'mac-o']: # don't strip unknown formats or PE + return + + if getattr(self.generator, 'link_task', None) and self.generator.link_task.outputs[0] in self.inputs: + cmd = self.env.STRIP + self.env.STRIPFLAGS + [tgt] + try: + if not self.generator.bld.progress_bar: + c1 = Logs.colors.NORMAL + c2 = Logs.colors.CYAN + + Logs.info('%s+ strip %s%s%s', c1, c2, tgt, c2) + self.generator.bld.cmd_and_log(cmd, output=Context.BOTH, quiet=Context.BOTH) + except Errors.WafError as e: + print(e.stdout, e.stderr) + +inst_copy_fun = Build.inst.copy_fun +Build.inst.copy_fun = copy_fun + diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index c0365ddd..96f9450b 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -156,7 +156,7 @@ class Android: toolchain_host += '-' # Assuming we are building on x86 - if sys.maxsize > 2**32: + if sys.maxsize > 2**32: toolchain_host += 'x86_64' else: toolchain_host += 'x86' @@ -187,6 +187,9 @@ class Android: triplet = self.ndk_triplet() + '-' return os.path.join(self.gen_gcc_toolchain_path(), 'bin', triplet) + def gen_binutils_path(self): + return os.path.join(self.gen_gcc_toolchain_path(), self.ndk_triplet(), 'bin') + def cc(self): if self.is_host(): return 'clang' @@ -197,6 +200,11 @@ class Android: return 'clang++' return self.toolchain_path + ('clang++' if self.is_clang() else 'g++') + def strip(self): + if self.is_host(): + return 'strip' + return os.path.join(self.gen_binutils_path(), 'strip') + def system_stl(self): # TODO: proper STL support return os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'system', 'include')) @@ -305,6 +313,7 @@ def configure(conf): setattr(conf, 'android', android) conf.environ['CC'] = android.cc() conf.environ['CXX'] = android.cxx() + conf.environ['STRIP'] = android.strip() conf.env.CFLAGS += android.cflags() conf.env.CXXFLAGS += android.cflags() conf.env.LINKFLAGS += android.linkflags() diff --git a/wscript b/wscript index ef74ff6e..fe1abd93 100644 --- a/wscript +++ b/wscript @@ -29,7 +29,7 @@ def options(opt): opt.recurse('cl_dll dlls') - opt.load('xcompile compiler_cxx compiler_c clang_compilation_database') + opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install') if sys.platform == 'win32': opt.load('msvc msdev') opt.load('reconfigure') @@ -68,7 +68,7 @@ def configure(conf): 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') + conf.load('xcompile compiler_c compiler_cxx strip_on_install') if conf.env.DEST_OS2 == 'android': conf.options.ALLOW64 = True From a4548074ec50f52fb75063c6361186231590c60a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 19 Sep 2019 17:17:04 +0300 Subject: [PATCH 008/298] waifulib: strip_on_install: fix typo --- scripts/waifulib/strip_on_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/waifulib/strip_on_install.py b/scripts/waifulib/strip_on_install.py index b334c901..a535d0ba 100644 --- a/scripts/waifulib/strip_on_install.py +++ b/scripts/waifulib/strip_on_install.py @@ -26,7 +26,7 @@ def copy_fun(self, src, tgt): if self.generator.bld.options.no_strip: return - if conf.env.DEST_BINFMT not in ['elf', 'mac-o']: # don't strip unknown formats or PE + if self.env.DEST_BINFMT not in ['elf', 'mac-o']: # don't strip unknown formats or PE return if getattr(self.generator, 'link_task', None) and self.generator.link_task.outputs[0] in self.inputs: From 17e1af726df05c47289c7c66ab47100b341f0581 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 19 Sep 2019 17:18:57 +0300 Subject: [PATCH 009/298] wscript: remove DEST_OS2 --- cl_dll/wscript | 2 +- dlls/wscript | 2 +- scripts/waifulib/xcompile.py | 32 +++++++++++++++++--------------- wscript | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index d0bd0951..3ada920a 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -48,7 +48,7 @@ def build(bld): if bld.env.GOLDSRC: libs += ['DL'] - if bld.env.DEST_OS2 not in ['android']: + if bld.env.DEST_OS not in ['android']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) else: install_path = bld.env.PREFIX diff --git a/dlls/wscript b/dlls/wscript index 05a7d002..b1c8cffa 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -54,7 +54,7 @@ def build(bld): libs = [] - if bld.env.DEST_OS2 not in ['android']: + if bld.env.DEST_OS not in ['android']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR) else: install_path = bld.env.PREFIX diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 96f9450b..6ebae1f9 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -14,20 +14,11 @@ try: from fwgslib import get_flags_by_compiler except: from waflib.extras.fwgslib import get_flags_by_compiler from waflib import Logs +from waflib.Tools import c_config import os import sys -# Output: -# CROSSCOMPILING -- set to true, if crosscompiling is enabled -# DEST_OS2 -- as some operating systems is built on top of another, it's better to not change DEST_OS, -# instead of this DEST_OS2 is defined with target value -# For example: android is built on top of linux and have many things in common, -# but it can't be considered as default GNU/Linux. -# Possible values: -# DEST_OS2 DEST_OS -# 'android' 'linux' - -# This class does support ONLY r10e and r19c NDK +# This class does support ONLY r10e and r19c/r20 NDK class Android: ctx = None # waf context arch = None @@ -309,8 +300,7 @@ def configure(conf): if values[0] not in valid_archs: conf.fatal('Unknown arch: {}. Supported: {}'.format(values[0], ', '.join(valid_archs))) - android = Android(conf, values[0], values[1], int(values[2])) - setattr(conf, 'android', android) + conf.android = android = Android(conf, values[0], values[1], int(values[2])) conf.environ['CC'] = android.cc() conf.environ['CXX'] = android.cxx() conf.environ['STRIP'] = android.strip() @@ -334,10 +324,18 @@ def configure(conf): # conf.env.ANDROID_OPTS = android conf.env.DEST_OS2 = 'android' -# else: -# conf.load('compiler_c compiler_cxx') # Use host compiler :) + + MACRO_TO_DESTOS = { + '__ANDROID__' : 'android' + } + MACRO_TO_DESTOS.update(c_config.MACRO_TO_DESTOS) # ordering is important + c_config.MACRO_TO_DESTOS = MACRO_TO_DESTOS def post_compiler_cxx_configure(conf): + conf.msg('Target OS', conf.env.DEST_OS) + conf.msg('Target CPU', conf.env.DEST_CPU) + conf.msg('Target binfmt', conf.env.DEST_BINFMT) + if conf.options.ANDROID_OPTS: if conf.android.ndk_rev == 19: conf.env.CXXFLAGS_cxxshlib += ['-static-libstdc++'] @@ -345,6 +343,10 @@ def post_compiler_cxx_configure(conf): return def post_compiler_c_configure(conf): + conf.msg('Target OS', conf.env.DEST_OS) + conf.msg('Target CPU', conf.env.DEST_CPU) + conf.msg('Target binfmt', conf.env.DEST_BINFMT) + return from waflib.Tools import compiler_cxx, compiler_c diff --git a/wscript b/wscript index fe1abd93..622d9b84 100644 --- a/wscript +++ b/wscript @@ -70,7 +70,7 @@ def configure(conf): conf.load('msvc msdev') conf.load('xcompile compiler_c compiler_cxx strip_on_install') - if conf.env.DEST_OS2 == 'android': + if conf.env.DEST_OS == 'android': conf.options.ALLOW64 = True conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified From 9b1fe29eb7f0f9ef44a16daf7a6c8d9286c1d706 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 19 Sep 2019 18:20:11 +0300 Subject: [PATCH 010/298] waifulib: xcompile: use llvm-strip on host --- scripts/waifulib/xcompile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 6ebae1f9..78b2b4ac 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -193,7 +193,7 @@ class Android: def strip(self): if self.is_host(): - return 'strip' + return 'llvm-strip' return os.path.join(self.gen_binutils_path(), 'strip') def system_stl(self): From 784c8d91a339b94d6112f574873d9eadc01a75f2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 19 Sep 2019 18:20:19 +0300 Subject: [PATCH 011/298] waifulib: strip_on_install: add changed bytes counter --- scripts/waifulib/strip_on_install.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/waifulib/strip_on_install.py b/scripts/waifulib/strip_on_install.py index a535d0ba..6522065d 100644 --- a/scripts/waifulib/strip_on_install.py +++ b/scripts/waifulib/strip_on_install.py @@ -16,7 +16,7 @@ def options(opt): def configure(conf): if conf.env.DEST_BINFMT in ['elf', 'mac-o']: - conf.find_program('strip') + conf.find_program('strip', var='STRIP') if not conf.env.STRIPFLAGS: conf.env.STRIPFLAGS = os.environ['STRIPFLAGS'] if 'STRIPFLAGS' in os.environ else [] @@ -32,12 +32,15 @@ def copy_fun(self, src, tgt): if getattr(self.generator, 'link_task', None) and self.generator.link_task.outputs[0] in self.inputs: cmd = self.env.STRIP + self.env.STRIPFLAGS + [tgt] try: + self.generator.bld.cmd_and_log(cmd, output=Context.BOTH, quiet=Context.BOTH) if not self.generator.bld.progress_bar: c1 = Logs.colors.NORMAL c2 = Logs.colors.CYAN - Logs.info('%s+ strip %s%s%s', c1, c2, tgt, c2) - self.generator.bld.cmd_and_log(cmd, output=Context.BOTH, quiet=Context.BOTH) + f1 = os.path.getsize(src) + f2 = os.path.getsize(tgt) + + Logs.info('%s+ strip %s%s%s (%d bytes change)', c1, c2, tgt, c1, f2 - f1) except Errors.WafError as e: print(e.stdout, e.stderr) From b141cac977f4a3266c2d66097241abbee3a4e2fb Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 20 Sep 2019 16:30:59 +0300 Subject: [PATCH 012/298] wscript: remove DEST_OS2 --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index 622d9b84..b937ca85 100644 --- a/wscript +++ b/wscript @@ -143,7 +143,7 @@ def configure(conf): conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) # strip lib from pattern - if conf.env.DEST_OS in ['linux', 'darwin'] and conf.env.DEST_OS2 not in ['android']: + if conf.env.DEST_OS in ['linux', 'darwin']: if conf.env.cshlib_PATTERN.startswith('lib'): conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:] if conf.env.cxxshlib_PATTERN.startswith('lib'): From c93aa8c5689821719179d07df853a2a7241b003a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 20 Sep 2019 16:35:33 +0300 Subject: [PATCH 013/298] waifulib: xcompile: preserve order of MACROS_TO_DESTOS, add -stdlib=libstdc++ to use system provided C++ standard library, pass target in host clang --- scripts/waifulib/xcompile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 78b2b4ac..a0854106 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -15,6 +15,7 @@ try: from fwgslib import get_flags_by_compiler except: from waflib.extras.fwgslib import get_flags_by_compiler from waflib import Logs from waflib.Tools import c_config +from collections import OrderedDict import os import sys @@ -183,12 +184,12 @@ class Android: def cc(self): if self.is_host(): - return 'clang' + return 'clang --target=%s' % self.clang_host_triplet() return self.toolchain_path + ('clang' if self.is_clang() else 'gcc') def cxx(self): if self.is_host(): - return 'clang++' + return 'clang++ --target=%s' % self.clang_host_triplet() return self.toolchain_path + ('clang++' if self.is_clang() else 'g++') def strip(self): @@ -230,7 +231,7 @@ class Android: def cflags(self): cflags = [] if self.is_host(): - cflags += ['-nostdlib', '--target=%s' % self.clang_host_triplet()] + cflags += ['-nostdlib'] if self.ndk_rev < 20: cflags += ['--sysroot={0}'.format(self.sysroot())] @@ -271,7 +272,7 @@ class Android: return linkflags def ldflags(self): - ldflags = ['-lgcc', '-no-canonical-prefixes'] + ldflags = ['-stdlib=libstdc++', '-lgcc', '-no-canonical-prefixes'] if self.is_arm(): if self.arch == 'armeabi-v7a': ldflags += ['-march=armv7-a'] @@ -325,10 +326,9 @@ def configure(conf): # conf.env.ANDROID_OPTS = android conf.env.DEST_OS2 = 'android' - MACRO_TO_DESTOS = { - '__ANDROID__' : 'android' - } - MACRO_TO_DESTOS.update(c_config.MACRO_TO_DESTOS) # ordering is important + MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android' }) + for k in c_config.MACRO_TO_DESTOS: + MACRO_TO_DESTOS[k] = c_config.MACRO_TO_DESTOS[k] # ordering is important c_config.MACRO_TO_DESTOS = MACRO_TO_DESTOS def post_compiler_cxx_configure(conf): From 70c4279c251c7f18288465355ef62ebb2aa69637 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 20 Sep 2019 18:50:24 +0300 Subject: [PATCH 014/298] waifulib: xcompile: enhance compiling using host clang, refactoring --- scripts/waifulib/xcompile.py | 113 +++++++++++++++-------------------- 1 file changed, 48 insertions(+), 65 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index a0854106..84344080 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -34,6 +34,8 @@ class Android: def __init__(self, ctx, arch, toolchain, api): self.ctx = ctx self.api = api + self.toolchain = toolchain + self.arch = arch for i in ['ANDROID_NDK_HOME', 'ANDROID_NDK']: self.ndk_home = os.getenv(i) @@ -41,7 +43,7 @@ class Android: break if not self.ndk_home: - ctx.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') + ctx.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') # TODO: this were added at some point of NDK development # but I don't know at which version @@ -59,20 +61,20 @@ class Android: self.ndk_rev = 10 if self.ndk_rev not in [10, 19, 20]: - ctx.fatal('Unknown NDK revision: {}'.format(self.ndk_rev)) + ctx.fatal('Unknown NDK revision: %d' % (self.ndk_rev)) + + if self.is_host() and self.ndk_rev < 20: + ctx.fatal('Using host toolchain with this NDK revision is untested. You can comment this check, but you\'re on your own!') + + if self.ndk_rev >= 19 or 'clang' in self.toolchain: + self.clang = True - self.arch = arch if self.arch == 'armeabi-v7a-hard': if self.ndk_rev <= 10: self.arch = 'armeabi-v7a' # Only armeabi-v7a have hard float ABI self.is_hardfloat = True else: - raise Exception('NDK does not support hardfloat ABI') - - self.toolchain = toolchain - - if self.ndk_rev >= 19 or 'clang' in self.toolchain: - self.clang = True + ctx.fatal('NDK does not support hardfloat ABI') if self.is_arm64() or self.is_amd64() and self.api < 21: Logs.warn('API level for 64-bit target automatically was set to 21') @@ -82,10 +84,6 @@ class Android: self.api = 16 self.toolchain_path = self.gen_toolchain_path() - # TODO: Crystax support? - # TODO: Support for everything else than linux-x86_64? - # TODO: Determine if I actually need to implement listed above - def is_host(self): ''' Checks if we using host compiler(implies clang) @@ -125,19 +123,26 @@ class Android: def is_hardfp(self): return self.is_hardfloat - def ndk_triplet(self): + def ndk_triplet(self, llvm_toolchain = False, toolchain_folder = False): if self.is_x86(): - triplet = 'i686-linux-android' + if toolchain_folder: + return 'x86' + else: + return 'i686-linux-android' elif self.is_arm(): - triplet = 'arm-linux-androideabi' + if llvm_toolchain: + return 'armv7a-linux-androideabi' + else: + return 'arm-linux-androideabi' + elif self.is_amd64() and toolchain_folder: + return 'x86_64' else: - triplet = self.arch + '-linux-android' - return triplet + return self.arch + '-linux-android' def gen_gcc_toolchain_path(self): path = 'toolchains' - if sys.platform.startswith('linux'): + if sys.platform.startswith('linux') or self.is_host(): toolchain_host = 'linux' elif sys.platform.startswith('darwin'): toolchain_host = 'darwin' @@ -158,23 +163,13 @@ class Android: toolchain_folder = 'llvm' else: - if self.is_x86() or self.is_amd64(): - toolchain_folder = self.arch + '-' + self.toolchain - elif self.is_arm(): - toolchain_folder = 'arm-linux-androideabi-' + self.toolchain - else: - toolchain_folder = self.arch + '-linux-android-' + self.toolchain + toolchain_folder = '%s-%s' % (self.ndk_triplet(toolchain_folder = True), self.toolchain) return os.path.abspath(os.path.join(self.ndk_home, path, toolchain_folder, 'prebuilt', toolchain_host)) def gen_toolchain_path(self): if self.is_clang(): - if self.is_x86(): - triplet = 'i686-linux-android{}-'.format(self.api) - elif self.is_arm(): - triplet = 'armv7a-linux-androideabi{}-'.format(self.api) - else: - triplet = self.arch + '-linux-android{}-'.format(self.api) + triplet = '%s%d-' % (self.ndk_triplet(llvm_toolchain = True), self.api) else: triplet = self.ndk_triplet() + '-' return os.path.join(self.gen_gcc_toolchain_path(), 'bin', triplet) @@ -184,12 +179,12 @@ class Android: def cc(self): if self.is_host(): - return 'clang --target=%s' % self.clang_host_triplet() + return 'clang --target=%s%d' % (self.ndk_triplet(), self.api) return self.toolchain_path + ('clang' if self.is_clang() else 'gcc') def cxx(self): if self.is_host(): - return 'clang++ --target=%s' % self.clang_host_triplet() + return 'clang++ --target=%s%d' % (self.ndk_triplet(), self.api) return self.toolchain_path + ('clang++' if self.is_clang() else 'g++') def strip(self): @@ -207,7 +202,7 @@ class Android: arch = 'arm' elif self.is_arm64(): arch = 'arm64' - path = 'platforms/android-{}/arch-{}'.format(self.api, arch) + path = 'platforms/android-%s/arch-%s' % (self.api, arch) return os.path.abspath(os.path.join(self.ndk_home, path)) @@ -217,34 +212,25 @@ class Android: else: return self.libsysroot() - def clang_host_triplet(self): - triplet = '' - if self.is_arm(): - triplet += 'arm' - elif self.is_x86(): - triplet += 'i686' - else: - triplet += self.arch - triplet += '-linux-android' - return triplet - def cflags(self): cflags = [] if self.is_host(): - cflags += ['-nostdlib'] + cflags += [ + '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), + '-I%s/usr/include/' % (self.sysroot()) + ] + elif self.ndk_rev < 20: + cflags += ['--sysroot=%s' % (self.sysroot())] - if self.ndk_rev < 20: - cflags += ['--sysroot={0}'.format(self.sysroot())] - elif self.is_host(): - cflags += ['-isysroot={0}'.format(self.sysroot())] - cflags += ['-DANDROID', '-D__ANDROID__'] - cflags += ['-I{0}'.format(self.system_stl())] + cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] if self.is_arm(): if self.arch == 'armeabi-v7a': # ARMv7 support cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS'] + if not self.is_clang(): cflags += [ '-mvectorize-with-neon-quad' ] + if self.is_hardfloat: cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mhard-float', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] else: @@ -260,25 +246,22 @@ class Android: def linkflags(self): linkflags = [] if self.is_host(): - linkflags += ['-fuse-ld=lld', '-nostdlib', '--target=%s' % self.clang_host_triplet(), - '--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] + linkflags += ['--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] if self.ndk_rev < 20 or self.is_host(): - linkflags += ['--sysroot={0}'.format(self.libsysroot())] + linkflags += ['--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path())] - if self.is_host(): - linkflags += ['-L{0}/usr/lib/{1}'.format(self.sysroot(), self.ndk_triplet()), - '-L{0}/sysroot/usr/lib/{1}/'.format(self.gen_gcc_toolchain_path(), self.ndk_triplet())] + if self.is_clang(): + linkflags += ['-fuse-ld=lld'] return linkflags def ldflags(self): ldflags = ['-stdlib=libstdc++', '-lgcc', '-no-canonical-prefixes'] if self.is_arm(): if self.arch == 'armeabi-v7a': - ldflags += ['-march=armv7-a'] - if not self.is_host(): # lld only + ldflags += ['-march=armv7-a', '-mthumb'] + if not self.is_clang(): # lld only ldflags += ['-Wl,--fix-cortex-a8'] - ldflags += ['-mthumb'] if self.is_hardfloat: ldflags += ['-Wl,--no-warn-mismatch', '-lm_hard'] else: @@ -296,10 +279,10 @@ def configure(conf): if len(values) != 3: conf.fatal('Invalid --android paramater value!') - valid_archs = ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'aarch64', 'mipsel', 'mips64el'] + valid_archs = ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'aarch64'] if values[0] not in valid_archs: - conf.fatal('Unknown arch: {}. Supported: {}'.format(values[0], ', '.join(valid_archs))) + conf.fatal('Unknown arch: %s. Supported: %r' % (values[0], ', '.join(valid_archs))) conf.android = android = Android(conf, values[0], values[1], int(values[2])) conf.environ['CC'] = android.cc() @@ -315,9 +298,9 @@ def configure(conf): conf.env.LIB_M = ['m_hard'] else: conf.env.LIB_M = ['m'] - conf.env.PREFIX = '/lib/{}'.format(android.arch) + conf.env.PREFIX = '/lib/%s' % (android.arch) - conf.msg('Selected Android NDK', '{}, version: {}'.format(android.ndk_home, android.ndk_rev)) + conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev)) # no need to print C/C++ compiler, as it would be printed by compiler_c/cxx conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK')) conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK')) From cb51d2aa179f1eb622e08c1c07b053ccd49e40a5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 20 Sep 2019 21:28:52 +0300 Subject: [PATCH 015/298] Fix potential segfault when reading sentences.txt --- dlls/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 6637fe53..acc2dbf7 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -1281,9 +1281,9 @@ void SENTENCEG_Init() if( !buffer[j] ) continue; - if( gcallsentences > CVOXFILESENTENCEMAX ) + if( gcallsentences >= CVOXFILESENTENCEMAX ) { - ALERT( at_error, "Too many sentences in sentences.txt!\n" ); + ALERT( at_error, "Too many sentences in sentences.txt! >%d\n", gcallsentences ); break; } From 56ac3459778d406484297a3f8507a81976e491e0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 21 Sep 2019 03:53:32 +0300 Subject: [PATCH 016/298] waifulib: xcompile: append SONAME to shared libraries, experimental support for host compiling with NDK r10e(don't work), replace exceptions with fatal messages --- scripts/waifulib/xcompile.py | 63 ++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 84344080..fd6dd596 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -13,7 +13,7 @@ try: from fwgslib import get_flags_by_compiler except: from waflib.extras.fwgslib import get_flags_by_compiler -from waflib import Logs +from waflib import Logs, TaskGen from waflib.Tools import c_config from collections import OrderedDict import os @@ -142,13 +142,14 @@ class Android: def gen_gcc_toolchain_path(self): path = 'toolchains' - if sys.platform.startswith('linux') or self.is_host(): - toolchain_host = 'linux' + if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): + toolchain_host = 'windows' elif sys.platform.startswith('darwin'): toolchain_host = 'darwin' - elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): - toolchain_host = 'windows' - else: raise Exception('Unsupported by NDK host platform') + elif sys.platform.startswith('linux') or self.is_host(): + toolchain_host = 'linux' + else: + self.ctx.fatal('Unsupported by NDK host platform') toolchain_host += '-' @@ -159,11 +160,16 @@ class Android: if self.is_clang(): if self.ndk_rev < 19: - raise Exception('Clang is not supported for this NDK') + raise self.ctx.fatal('Clang is not supported for this NDK') toolchain_folder = 'llvm' else: - toolchain_folder = '%s-%s' % (self.ndk_triplet(toolchain_folder = True), self.toolchain) + if self.is_host(): + toolchain = '4.9' + else: + toolchain = self.toolchain + + toolchain_folder = '%s-%s' % (self.ndk_triplet(toolchain_folder = True), toolchain) return os.path.abspath(os.path.join(self.ndk_home, path, toolchain_folder, 'prebuilt', toolchain_host)) @@ -207,7 +213,7 @@ class Android: return os.path.abspath(os.path.join(self.ndk_home, path)) def sysroot(self): - if self.ndk_rev >= 19 or self.is_host(): + if self.ndk_rev >= 19: return os.path.abspath(os.path.join(self.ndk_home, 'sysroot')) else: return self.libsysroot() @@ -215,10 +221,12 @@ class Android: def cflags(self): cflags = [] if self.is_host(): - cflags += [ - '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), - '-I%s/usr/include/' % (self.sysroot()) - ] + if self.ndk_rev >= 19: + cflags += [ + '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), + '-I%s/usr/include/' % (self.sysroot()) + ] + else: cflags += ['--sysroot=%s' % (self.sysroot())] elif self.ndk_rev < 20: cflags += ['--sysroot=%s' % (self.sysroot())] @@ -228,7 +236,7 @@ class Android: # ARMv7 support cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS'] - if not self.is_clang(): + if not self.is_clang() and not self.is_host(): cflags += [ '-mvectorize-with-neon-quad' ] if self.is_hardfloat: @@ -248,11 +256,15 @@ class Android: if self.is_host(): linkflags += ['--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] - if self.ndk_rev < 20 or self.is_host(): + if self.ndk_rev < 20: + linkflags += ['--sysroot=%s' % (self.sysroot())] + elif self.is_host(): linkflags += ['--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path())] - if self.is_clang(): + if self.is_clang() or self.is_host(): linkflags += ['-fuse-ld=lld'] + + linkflags += ['-Wl,--hash-style=both'] return linkflags def ldflags(self): @@ -260,7 +272,7 @@ class Android: if self.is_arm(): if self.arch == 'armeabi-v7a': ldflags += ['-march=armv7-a', '-mthumb'] - if not self.is_clang(): # lld only + if not self.is_clang() and not self.is_host(): # lld only ldflags += ['-Wl,--fix-cortex-a8'] if self.is_hardfloat: ldflags += ['-Wl,--no-warn-mismatch', '-lm_hard'] @@ -347,3 +359,20 @@ def patch_compiler_c_configure(conf): setattr(compiler_cxx, 'configure', patch_compiler_cxx_configure) setattr(compiler_c, 'configure', patch_compiler_c_configure) + +@TaskGen.feature('cshlib', 'cxxshlib', 'dshlib', 'fcshlib', 'vnum') +@TaskGen.after_method('apply_link', 'propagate_uselib_vars') +@TaskGen.before_method('apply_vnum') +def apply_android_soname(self): + """ + Enforce SONAME on Android + """ + if self.env.DEST_OS != 'android': + return + + setattr(self, 'vnum', None) # remove vnum, so SONAME would not be overwritten + link = self.link_task + node = link.outputs[0] + libname = node.name + v = self.env.SONAME_ST % libname + self.env.append_value('LINKFLAGS', v.split()) From 4623cb0dc2cb456992776401a1a8697144d82fbe Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Tue, 24 Sep 2019 01:41:50 +0500 Subject: [PATCH 017/298] Revert "Merge https://github.com/SamVanheer/HLEnhanced/commit/89efd616d6aed0304db5bf63bfecd311c1cedbdd" This reverts commit c4820ad0df7bda569275452ad8f25c60d00301f9. --- dlls/subs.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dlls/subs.cpp b/dlls/subs.cpp index e24a5c08..b57d7d23 100644 --- a/dlls/subs.cpp +++ b/dlls/subs.cpp @@ -107,13 +107,6 @@ void CBaseEntity::UpdateOnRemove( void ) if( pev->globalname ) gGlobalState.EntitySetState( pev->globalname, GLOBAL_DEAD ); - - // tell owner ( if any ) that we're dead.This is mostly for MonsterMaker functionality. - //Killtarget didn't do this before, so the counter broke. - Solokiller - if( CBaseEntity* pOwner = pev->owner ? Instance( pev->owner ) : 0 ) - { - pOwner->DeathNotice( pev ); - } } // Convenient way to delay removing oneself From c9fdcd91e8eeffce706b65731fe67589176fa88a Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Tue, 24 Sep 2019 03:00:37 +0500 Subject: [PATCH 018/298] A little optimizations. --- cl_dll/hud_spectator.cpp | 2 +- cl_dll/input.cpp | 2 +- dlls/animation.cpp | 2 +- dlls/bmodels.cpp | 2 +- dlls/buttons.cpp | 2 +- dlls/doors.cpp | 6 ++---- dlls/h_battery.cpp | 15 ++++++--------- dlls/multiplay_gamerules.cpp | 15 ++++++++++----- dlls/plats.cpp | 3 +-- dlls/player.cpp | 4 ++-- dlls/scripted.cpp | 5 ++++- dlls/sound.cpp | 6 +++--- dlls/teamplay_gamerules.cpp | 4 ++-- dlls/triggers.cpp | 6 +++--- dlls/util.cpp | 4 ++-- 15 files changed, 40 insertions(+), 38 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index edb743ba..889dc686 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -842,7 +842,7 @@ bool CHudSpectator::ParseOverviewFile() m_OverviewData.layersHeights[0] = 0.0f; strcpy( m_OverviewData.map, gEngfuncs.pfnGetLevelName() ); - if( strlen( m_OverviewData.map ) == 0 ) + if( m_OverviewData.map[0] == '\0' ) return false; // not active yet strcpy( levelname, m_OverviewData.map + 5 ); diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index 0abd542b..628ff088 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -169,7 +169,7 @@ int KB_ConvertString( char *in, char **ppout ) *pEnd = '\0'; pBinding = NULL; - if( strlen( binding + 1 ) > 0 ) + if( binding[1] != '\0' ) { // See if there is a binding for binding? pBinding = gEngfuncs.Key_LookupBinding( binding + 1 ); diff --git a/dlls/animation.cpp b/dlls/animation.cpp index f84ec380..9f70f3d1 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -203,7 +203,7 @@ void SequencePrecache( void *pmodel, const char *pSequenceName ) // of it's name if it is. if( IsSoundEvent( pevent[i].event ) ) { - if( !strlen( pevent[i].options ) ) + if( pevent[i].options[0] == '\0' ) { ALERT( at_error, "Bad sound event %d in sequence %s :: %s (sound is \"%s\")\n", pevent[i].event, pstudiohdr->name, pSequenceName, pevent[i].options ); } diff --git a/dlls/bmodels.cpp b/dlls/bmodels.cpp index fe56b6ac..b75a0fa8 100644 --- a/dlls/bmodels.cpp +++ b/dlls/bmodels.cpp @@ -434,7 +434,7 @@ void CFuncRotating::Precache( void ) BOOL NullSound = FALSE; // set up fan sounds - if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 0 ) + if( !FStringNull( pev->message ) && szSoundFile[0] != '\0' ) { // if a path is set for a wave, use it } diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 90bc42e5..f7441b3f 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -694,7 +694,7 @@ CBaseButton::BUTTON_CODE CBaseButton::ButtonResponseToTouch( void ) void CBaseButton::ButtonTouch( CBaseEntity *pOther ) { // Ignore touches by anything but players - if( !FClassnameIs( pOther->pev, "player" ) ) + if( !pOther->IsPlayer() ) return; m_hActivator = pOther; diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 085ee441..9091d70a 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -520,10 +520,8 @@ void CBaseDoor::Precache( void ) // void CBaseDoor::DoorTouch( CBaseEntity *pOther ) { - entvars_t *pevToucher = pOther->pev; - // Ignore touches by anything but players - if( !FClassnameIs( pevToucher, "player" ) ) + if( !pOther->IsPlayer() ) return; // If door has master, and it's not ready to trigger, @@ -542,7 +540,7 @@ void CBaseDoor::DoorTouch( CBaseEntity *pOther ) m_hActivator = pOther;// remember who activated the door - if( DoorActivate()) + if( DoorActivate() ) SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished. } diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index dabbc06c..6c6b9869 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -106,8 +106,12 @@ void CRecharge::Precache() void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { + // Make sure that we have a caller + if( !pActivator ) + return; + // if it's not a player, ignore - if( !FClassnameIs( pActivator->pev, "player" ) ) + if( !pActivator->IsPlayer() ) return; // if there is no juice left, turn it off @@ -135,16 +139,8 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use if( m_flNextCharge >= gpGlobals->time ) return; - // Make sure that we have a caller - if( !pActivator ) - return; - m_hActivator = pActivator; - //only recharge the player - if( !m_hActivator->IsPlayer() ) - return; - // Play the on sound or the looping charging sound if( !m_iOn ) { @@ -152,6 +148,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeok1.wav", 0.85, ATTN_NORM ); m_flSoundTime = 0.56 + gpGlobals->time; } + if( ( m_iOn == 1 ) && ( m_flSoundTime <= gpGlobals->time ) ) { m_iOn++; diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index de91ac6e..358a4470 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -1331,7 +1331,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) hasbuffer = 0; pFileList = COM_Parse( pFileList ); - if( strlen( com_token ) <= 0 ) + + if( com_token[0] == '\0' ) break; strcpy( szMap, com_token ); @@ -1340,7 +1341,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) if( COM_TokenWaiting( pFileList ) ) { pFileList = COM_Parse( pFileList ); - if( strlen( com_token ) > 0 ) + + if( com_token[0] != '\0' ) { hasbuffer = 1; strcpy( szBuffer, com_token ); @@ -1496,7 +1498,8 @@ void ExtractCommandString( char *s, char *szCommand ) *o = 0; strcat( szCommand, pkey ); - if( strlen( value ) > 0 ) + + if( value[0] != '\0' ) { strcat( szCommand, " " ); strcat( szCommand, value ); @@ -1631,13 +1634,15 @@ void CHalfLifeMultiplay::ChangeLevel( void ) { ALERT( at_console, "PLAYER COUNT: min %i max %i current %i\n", minplayers, maxplayers, curplayers ); } - if( strlen( szRules ) > 0 ) + + if( szRules != '\0' ) { ALERT( at_console, "RULES: %s\n", szRules ); } CHANGE_LEVEL( szNextMap, NULL ); - if( strlen( szCommands ) > 0 ) + + if( szCommands[0] != '\0' ) { SERVER_COMMAND( szCommands ); } diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 5a96a36b..8356d55e 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -358,8 +358,7 @@ void CPlatTrigger::SpawnInsideTrigger( CFuncPlat *pPlatform ) void CPlatTrigger::Touch( CBaseEntity *pOther ) { // Ignore touches by non-players - entvars_t *pevToucher = pOther->pev; - if( !FClassnameIs( pevToucher, "player" ) ) + if( !pOther->IsPlayer() ) return; CFuncPlat *pPlatform = (CFuncPlat*)(CBaseEntity*)m_hPlatform; diff --git a/dlls/player.cpp b/dlls/player.cpp index 926bf1e1..43d1d28e 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2762,7 +2762,7 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer ) } // If startspot is set, (re)spawn there. - if( FStringNull( gpGlobals->startspot ) || !strlen(STRING( gpGlobals->startspot ) ) ) + if( FStringNull( gpGlobals->startspot ) || (STRING( gpGlobals->startspot ) )[0] == '\0') { pSpot = UTIL_FindEntityByClassname( NULL, "info_player_start" ); if( !FNullEnt( pSpot ) ) @@ -4432,7 +4432,7 @@ void CBasePlayer::DropPlayerItem( char *pszItemName ) return; } - if( !strlen( pszItemName ) ) + if( pszItemName[0] == '\0' ) { // if this string has no length, the client didn't type a name! // assume player wants to drop the active item. diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 41638b39..8e3a88ab 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -1068,14 +1068,17 @@ BOOL CScriptedSentence::AcceptableSpeaker( CBaseMonster *pMonster ) { if( pev->spawnflags & SF_SENTENCE_FOLLOWERS ) { - if( pMonster->m_hTargetEnt == 0 || !FClassnameIs( pMonster->m_hTargetEnt->pev, "player" ) ) + if( pMonster->m_hTargetEnt == 0 || !pMonster->m_hTargetEnt->IsPlayer() ) return FALSE; } + BOOL override; + if( pev->spawnflags & SF_SENTENCE_INTERRUPT ) override = TRUE; else override = FALSE; + if( pMonster->CanPlaySentence( override ) ) return TRUE; } diff --git a/dlls/sound.cpp b/dlls/sound.cpp index acc2dbf7..8fc5cb89 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -184,7 +184,7 @@ void CAmbientGeneric::Spawn( void ) const char *szSoundFile = STRING( pev->message ); - if( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 ) + if( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) { ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); pev->nextthink = gpGlobals->time + 0.1; @@ -218,7 +218,7 @@ void CAmbientGeneric::Precache( void ) { const char *szSoundFile = STRING( pev->message ); - if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 ) + if( !FStringNull( pev->message ) && szSoundFile[0] != '\0' ) { if( *szSoundFile != '!' ) PRECACHE_SOUND( szSoundFile ); @@ -1732,7 +1732,7 @@ void CSpeaker::Spawn( void ) { const char *szSoundFile = STRING( pev->message ); - if( !m_preset && ( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 ) ) + if( !m_preset && ( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) ) { ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); pev->nextthink = gpGlobals->time + 0.1; diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index 87b695e7..d3b5c5e3 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -52,14 +52,14 @@ CHalfLifeTeamplay::CHalfLifeTeamplay() if( teamoverride.value ) { const char *pTeamList = STRING( pWorld->v.team ); - if( pTeamList && strlen( pTeamList ) ) + if( pTeamList && pTeamList[0] != '\0' ) { strncpy( m_szTeamList, pTeamList, TEAMPLAY_TEAMLISTLENGTH ); } } } // Has the server set teams - if( strlen( m_szTeamList ) ) + if( m_szTeamList[0] != '\0' ) m_teamLimit = TRUE; else m_teamLimit = FALSE; diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 6d8fef04..b7633498 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -1124,7 +1124,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator ) if( pev->nextthink > gpGlobals->time ) return; // still waiting for reset time - if( !UTIL_IsMasterTriggered( m_sMaster,pActivator ) ) + if( !UTIL_IsMasterTriggered( m_sMaster, pActivator ) ) return; if( FClassnameIs( pev, "trigger_secret" ) ) @@ -1191,7 +1191,7 @@ void CBaseTrigger::CounterUse( CBaseEntity *pActivator, CBaseEntity *pCaller, US BOOL fTellActivator = ( m_hActivator != 0 ) && - FClassnameIs( m_hActivator->pev, "player" ) && + m_hActivator->IsPlayer() && !FBitSet( pev->spawnflags, SPAWNFLAG_NOMESSAGE ); if( m_cTriggersLeft != 0 ) { @@ -1499,7 +1499,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator ) // void CChangeLevel::TouchChangeLevel( CBaseEntity *pOther ) { - if( !FClassnameIs( pOther->pev, "player" ) ) + if( !pOther->IsPlayer() ) return; ChangeLevelNow( pOther ); diff --git a/dlls/util.cpp b/dlls/util.cpp index a5160876..a66b5fbc 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -2196,7 +2196,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou pString++; } pInputData = pString; - if( strlen( (char *)pInputData ) == 0 ) + if( ( (char *)pInputData )[0] == '\0' ) *( (string_t *)pOutputData ) = 0; else { @@ -2291,7 +2291,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou *( (void**)pOutputData ) = *(void **)pInputData; break; case FIELD_FUNCTION: - if( strlen( (char *)pInputData ) == 0 ) + if( ( (char *)pInputData )[0] == '\0' ) *( (void**)pOutputData ) = 0; else *( (void**)pOutputData ) = (void*)FUNCTION_FROM_NAME( (char *)pInputData ); From 5d85a3be8d796b1b335afcb0a2a962f979ad5ef4 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Tue, 24 Sep 2019 03:06:07 +0500 Subject: [PATCH 019/298] Fix build. --- dlls/multiplay_gamerules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 358a4470..8305a07f 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -1635,7 +1635,7 @@ void CHalfLifeMultiplay::ChangeLevel( void ) ALERT( at_console, "PLAYER COUNT: min %i max %i current %i\n", minplayers, maxplayers, curplayers ); } - if( szRules != '\0' ) + if( szRules[0] != '\0' ) { ALERT( at_console, "RULES: %s\n", szRules ); } From 04a31f4a1ab825e1a051a0b433f4644f11ceaeff Mon Sep 17 00:00:00 2001 From: iZarif Date: Wed, 2 Oct 2019 23:15:53 +0400 Subject: [PATCH 020/298] fix gcc 8.3.0 format-overflow warnings --- cl_dll/ammo.cpp | 2 +- cl_dll/hud_spectator.cpp | 2 +- dlls/nihilanth.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 4a4437bb..853cfe18 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -77,7 +77,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) else iRes = 640; - char sz[128]; + char sz[140]; if( !pWeapon ) return; diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 889dc686..51c97bdc 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -820,7 +820,7 @@ bool CHudSpectator::IsActivePlayer( cl_entity_t *ent ) bool CHudSpectator::ParseOverviewFile() { - char filename[255] = { 0 }; + char filename[270] = { 0 }; char levelname[255] = { 0 }; char token[1024] = { 0 }; float height; diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index 1d072db4..d121f22f 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -724,7 +724,7 @@ void CNihilanth::NextActivity() if( ( pev->health < gSkillData.nihilanthHealth / 2 || m_iActiveSpheres < N_SPHERES / 2 ) && m_hRecharger == 0 && m_iLevel <= 9 ) { - char szName[64]; + char szName[66]; CBaseEntity *pEnt = NULL; CBaseEntity *pRecharger = NULL; @@ -772,7 +772,7 @@ void CNihilanth::NextActivity() if( iseq != pev->sequence ) { - char szText[64]; + char szText[76]; sprintf( szText, "%s%d", m_szDrawUse, m_iLevel ); FireTargets( szText, this, this, USE_ON, 1.0 ); @@ -820,7 +820,7 @@ void CNihilanth::NextActivity() } else { - char szText[64]; + char szText[66]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); @@ -1100,7 +1100,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) // prayer if( m_hEnemy != 0 ) { - char szText[32]; + char szText[76]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); From a0ccf2d0a1ebe9e9126d5059691315029e6ee409 Mon Sep 17 00:00:00 2001 From: iZarif Date: Thu, 3 Oct 2019 00:19:50 +0400 Subject: [PATCH 021/298] size of arrays are now a power of two --- cl_dll/ammo.cpp | 2 +- cl_dll/hud_spectator.cpp | 2 +- dlls/nihilanth.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 853cfe18..c6aabfba 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -77,7 +77,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) else iRes = 640; - char sz[140]; + char sz[256]; if( !pWeapon ) return; diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 51c97bdc..b86834af 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -820,7 +820,7 @@ bool CHudSpectator::IsActivePlayer( cl_entity_t *ent ) bool CHudSpectator::ParseOverviewFile() { - char filename[270] = { 0 }; + char filename[512] = { 0 }; char levelname[255] = { 0 }; char token[1024] = { 0 }; float height; diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index d121f22f..c9ed0742 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -724,7 +724,7 @@ void CNihilanth::NextActivity() if( ( pev->health < gSkillData.nihilanthHealth / 2 || m_iActiveSpheres < N_SPHERES / 2 ) && m_hRecharger == 0 && m_iLevel <= 9 ) { - char szName[66]; + char szName[128]; CBaseEntity *pEnt = NULL; CBaseEntity *pRecharger = NULL; @@ -772,7 +772,7 @@ void CNihilanth::NextActivity() if( iseq != pev->sequence ) { - char szText[76]; + char szText[128]; sprintf( szText, "%s%d", m_szDrawUse, m_iLevel ); FireTargets( szText, this, this, USE_ON, 1.0 ); @@ -820,7 +820,7 @@ void CNihilanth::NextActivity() } else { - char szText[66]; + char szText[128]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); @@ -1100,7 +1100,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) // prayer if( m_hEnemy != 0 ) { - char szText[76]; + char szText[128]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); From 6ef4c8765f3860d1c9a822766e7e85ba8afbbd73 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 9 Oct 2019 03:50:25 +0300 Subject: [PATCH 022/298] waifulib: xcompile: merge xcompile from engine branch --- scripts/waifulib/xcompile.py | 134 +++++++++++++++++++++-------------- 1 file changed, 80 insertions(+), 54 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index fd6dd596..98516ce8 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -19,13 +19,21 @@ from collections import OrderedDict import os import sys +ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK'] +ANDROID_NDK_SUPPORTED = [10, 19, 20] +ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp +ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC +ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 +ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag +ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16 } # minimal API level ndk revision supports +ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets + # This class does support ONLY r10e and r19c/r20 NDK class Android: ctx = None # waf context arch = None toolchain = None api = None - toolchain_path = None ndk_home = None ndk_rev = 0 is_hardfloat = False @@ -37,13 +45,13 @@ class Android: self.toolchain = toolchain self.arch = arch - for i in ['ANDROID_NDK_HOME', 'ANDROID_NDK']: + for i in ANDROID_NDK_ENVVARS: self.ndk_home = os.getenv(i) if self.ndk_home != None: break - - if not self.ndk_home: - ctx.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') + else: + ctx.fatal('Set %s environment variable pointing to the root of Android NDK!' % + ' or '.join(ANDROID_NDK_ENVVARS)) # TODO: this were added at some point of NDK development # but I don't know at which version @@ -57,32 +65,29 @@ class Android: if 'Pkg.Revision' in trimed_tokens: self.ndk_rev = int(trimed_tokens[1].split('.')[0]) + + if self.ndk_rev not in ANDROID_NDK_SUPPORTED: + ctx.fatal('Unknown NDK revision: %d' % (self.ndk_rev)) else: - self.ndk_rev = 10 + self.ndk_rev = ANDROID_NDK_SUPPORTED[0] - if self.ndk_rev not in [10, 19, 20]: - ctx.fatal('Unknown NDK revision: %d' % (self.ndk_rev)) - - if self.is_host() and self.ndk_rev < 20: - ctx.fatal('Using host toolchain with this NDK revision is untested. You can comment this check, but you\'re on your own!') - - if self.ndk_rev >= 19 or 'clang' in self.toolchain: + if 'clang' in self.toolchain or self.ndk_rev > ANDROID_NDK_GCC_MAX: self.clang = True if self.arch == 'armeabi-v7a-hard': - if self.ndk_rev <= 10: + if self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: self.arch = 'armeabi-v7a' # Only armeabi-v7a have hard float ABI self.is_hardfloat = True else: ctx.fatal('NDK does not support hardfloat ABI') - if self.is_arm64() or self.is_amd64() and self.api < 21: - Logs.warn('API level for 64-bit target automatically was set to 21') - self.api = 21 - elif self.ndk_rev >= 19 and self.api < 16: - Logs.warn('API level automatically was set to 16 due to NDK support') - self.api = 16 - self.toolchain_path = self.gen_toolchain_path() + if self.api < ANDROID_NDK_API_MIN[self.ndk_rev]: + self.api = ANDROID_NDK_API_MIN[self.ndk_rev] + Logs.warn('API level automatically was set to %d due to NDK support' % self.api) + + if self.is_arm64() or self.is_amd64() and self.api < ANDROID_64BIT_API_MIN: + self.api = ANDROID_64BIT_API_MIN + Logs.warn('API level for 64-bit target automatically was set to %d' % self.api) def is_host(self): ''' @@ -139,29 +144,32 @@ class Android: else: return self.arch + '-linux-android' - def gen_gcc_toolchain_path(self): - path = 'toolchains' + def gen_host_toolchain(self): + # With host toolchain we don't care about OS + # so just download NDK for Linux x86_64 + if self.is_host(): + return 'linux-x86_64' if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): - toolchain_host = 'windows' + osname = 'windows' elif sys.platform.startswith('darwin'): - toolchain_host = 'darwin' - elif sys.platform.startswith('linux') or self.is_host(): - toolchain_host = 'linux' + osname = 'darwin' + elif sys.platform.startswith('linux'): + osname = 'linux' else: self.ctx.fatal('Unsupported by NDK host platform') - toolchain_host += '-' - - # Assuming we are building on x86 if sys.maxsize > 2**32: - toolchain_host += 'x86_64' - else: toolchain_host += 'x86' + arch = 'x86_64' + else: arch = 'x86' + + return '%s-%s' % (osname, arch) + + def gen_gcc_toolchain_path(self): + path = 'toolchains' + toolchain_host = self.gen_host_toolchain() if self.is_clang(): - if self.ndk_rev < 19: - raise self.ctx.fatal('Clang is not supported for this NDK') - toolchain_folder = 'llvm' else: if self.is_host(): @@ -186,12 +194,12 @@ class Android: def cc(self): if self.is_host(): return 'clang --target=%s%d' % (self.ndk_triplet(), self.api) - return self.toolchain_path + ('clang' if self.is_clang() else 'gcc') + return self.gen_toolchain_path() + ('clang' if self.is_clang() else 'gcc') def cxx(self): if self.is_host(): return 'clang++ --target=%s%d' % (self.ndk_triplet(), self.api) - return self.toolchain_path + ('clang++' if self.is_clang() else 'g++') + return self.gen_toolchain_path() + ('clang++' if self.is_clang() else 'g++') def strip(self): if self.is_host(): @@ -213,24 +221,28 @@ class Android: return os.path.abspath(os.path.join(self.ndk_home, path)) def sysroot(self): - if self.ndk_rev >= 19: + if self.ndk_rev >= ANDROID_NDK_UNIFIED_SYSROOT_MIN: return os.path.abspath(os.path.join(self.ndk_home, 'sysroot')) else: return self.libsysroot() - def cflags(self): + def cflags(self, cxx = False): cflags = [] - if self.is_host(): - if self.ndk_rev >= 19: + + if self.ndk_rev <= ANDROID_NDK_SYSROOT_FLAG_MAX: + cflags += ['--sysroot=%s' % (self.sysroot())] + else: + if self.is_host(): cflags += [ '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), '-I%s/usr/include/' % (self.sysroot()) ] - else: cflags += ['--sysroot=%s' % (self.sysroot())] - elif self.ndk_rev < 20: - cflags += ['--sysroot=%s' % (self.sysroot())] cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] + + if cxx and not self.is_clang() and self.toolchain not in ['4.8','4.9']: + cflags += ['-fno-sized-deallocation'] + if self.is_arm(): if self.arch == 'armeabi-v7a': # ARMv7 support @@ -239,8 +251,18 @@ class Android: if not self.is_clang() and not self.is_host(): cflags += [ '-mvectorize-with-neon-quad' ] - if self.is_hardfloat: - cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mhard-float', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] + if self.is_hardfp(): + cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] + + if self.is_host(): + # Clang builtin redefine w/ different calling convention bug + # NOTE: I did not added complex.h functions here, despite + # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex + # math functions + # I personally don't need complex numbers support, but if you want it + # just run sed to patch header + for f in ['strtod', 'strtof', 'strtold']: + cflags += ['-fno-builtin-%s' % f] else: cflags += ['-mfloat-abi=softfp'] else: @@ -256,7 +278,7 @@ class Android: if self.is_host(): linkflags += ['--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] - if self.ndk_rev < 20: + if self.ndk_rev <= ANDROID_NDK_SYSROOT_FLAG_MAX: linkflags += ['--sysroot=%s' % (self.sysroot())] elif self.is_host(): linkflags += ['--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path())] @@ -264,17 +286,21 @@ class Android: if self.is_clang() or self.is_host(): linkflags += ['-fuse-ld=lld'] - linkflags += ['-Wl,--hash-style=both'] + linkflags += ['-Wl,--hash-style=both','-Wl,--no-undefined'] return linkflags def ldflags(self): - ldflags = ['-stdlib=libstdc++', '-lgcc', '-no-canonical-prefixes'] + ldflags = ['-lgcc', '-no-canonical-prefixes'] + if self.is_clang() or self.is_host(): + ldflags += ['-stdlib=libstdc++'] if self.is_arm(): if self.arch == 'armeabi-v7a': ldflags += ['-march=armv7-a', '-mthumb'] + if not self.is_clang() and not self.is_host(): # lld only ldflags += ['-Wl,--fix-cortex-a8'] - if self.is_hardfloat: + + if self.is_hardfp(): ldflags += ['-Wl,--no-warn-mismatch', '-lm_hard'] else: ldflags += ['-march=armv5te'] @@ -301,7 +327,7 @@ def configure(conf): conf.environ['CXX'] = android.cxx() conf.environ['STRIP'] = android.strip() conf.env.CFLAGS += android.cflags() - conf.env.CXXFLAGS += android.cflags() + conf.env.CXXFLAGS += android.cflags(True) conf.env.LINKFLAGS += android.linkflags() conf.env.LDFLAGS += android.ldflags() @@ -314,9 +340,9 @@ def configure(conf): conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev)) # no need to print C/C++ compiler, as it would be printed by compiler_c/cxx - conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK')) - conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK')) - conf.msg('... ld flags', ' '.join(android.ldflags()).replace(android.ndk_home, '$NDK')) + conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK/')) + conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK/')) + conf.msg('... ld flags', ' '.join(android.ldflags()).replace(android.ndk_home, '$NDK/')) # conf.env.ANDROID_OPTS = android conf.env.DEST_OS2 = 'android' From 36516ddb47e6e0a244073208cdbbd1aeaf20d02e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 9 Oct 2019 05:52:13 +0300 Subject: [PATCH 023/298] waifulib: xcompile: fix aarch64 binary installation --- scripts/waifulib/xcompile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 98516ce8..fe9b0e27 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -144,6 +144,11 @@ class Android: else: return self.arch + '-linux-android' + def apk_arch(self): + if self.is_arm64(): + return 'arm64-v8a' + return self.arch + def gen_host_toolchain(self): # With host toolchain we don't care about OS # so just download NDK for Linux x86_64 @@ -336,7 +341,7 @@ def configure(conf): conf.env.LIB_M = ['m_hard'] else: conf.env.LIB_M = ['m'] - conf.env.PREFIX = '/lib/%s' % (android.arch) + conf.env.PREFIX = '/lib/%s' % android.apk_arch() conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev)) # no need to print C/C++ compiler, as it would be printed by compiler_c/cxx From fea49e2187b0152bdf2a55eed0850d27c1b84161 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 11 Oct 2019 08:37:33 +0300 Subject: [PATCH 024/298] waf: upgrade to latest waifu revision --- waf | 12 ++--- wscript | 153 +++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 114 insertions(+), 51 deletions(-) diff --git a/waf b/waf index 3bd5c703..53213cb6 100755 --- a/waf +++ b/waf @@ -33,12 +33,12 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect VERSION="2.0.18" -REVISION="51fff4c95844a6b013877286b96a55d0" -GIT="68bf3867df33c04c944e8905820fc4cca4b663d1" +REVISION="ff338576c6abcf8ea755ffa7e678f790" +GIT="6539bd1ad3e285b124c02859ee5862dbd80704b7" INSTALL='' -C1='#/' -C2='#-' -C3='#%' +C1='#[' +C2='#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%Mob#[;?*Yh5K }#2(NY]N*pM\e|!m:v: G9bo1yl%جDârBF76TtaPt4,.b٭Yuu5[@(qh+h WP7U 1Cw?a~jb/AzsAxXmrTHS֗N&@?!S [fmR[{oR??R #2#)„_@ #<== diff --git a/wscript b/wscript index b937ca85..f3b268f0 100644 --- a/wscript +++ b/wscript @@ -3,15 +3,16 @@ # a1batross, mittorn, 2018 from __future__ import print_function -from waflib import Logs +from waflib import Logs, Context, Configure import sys import os -sys.path.append(os.path.realpath('scripts/waflib')) VERSION = '2.4' APPNAME = 'hlsdk-xash3d' top = '.' +Context.Context.line_just = 55 # should fit for everything on 80x26 + def options(opt): grp = opt.add_option_group('Common options') @@ -19,19 +20,26 @@ def options(opt): help = 'build type: debug, release or none(custom flags)') grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False, - help = 'allow targetting 64-bit game dlls') + help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %default]') grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False, - help = 'enable voice manager') + help = 'enable voice manager [default: %default]') grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False, - help = 'enable GoldSource engine support') + help = 'enable GoldSource engine support [default: %default]') + + grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, + help = 'enable Link Time Optimization [default: %default]') + + grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, + help = 'enable polyhedral optimization if possible [default: %default]') + opt.recurse('cl_dll dlls') opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install') if sys.platform == 'win32': - opt.load('msvc msdev') + opt.load('msvc msdev msvs') opt.load('reconfigure') @@ -43,7 +51,7 @@ def configure(conf): conf.env.SERVER_NAME = 'hl' conf.env.PREFIX = '' - conf.load('reconfigure') + conf.load('fwgslib reconfigure') conf.start_msg('Build type') if conf.options.BUILD_TYPE == None: @@ -56,7 +64,7 @@ def configure(conf): # -march=native should not be used if conf.options.BUILD_TYPE == 'fast': - Logs.warn('WARNING: \'fast\' build type should not be used in release builds') + Logs.warn('WARNING: \'fast\' build type should not be used in release builds') conf.env.VOICEMGR = conf.options.VOICEMGR conf.env.GOLDSRC = conf.options.GOLDSRC @@ -71,76 +79,131 @@ def configure(conf): conf.load('xcompile compiler_c compiler_cxx strip_on_install') if conf.env.DEST_OS == 'android': - conf.options.ALLOW64 = True conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified - # print(conf.options.ALLOW64) - - conf.env.BIT32_MANDATORY = not conf.options.ALLOW64 - conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 - conf.load('force_32bit') - - if conf.env.DEST_SIZEOF_VOID_P == 4: - Logs.info('NOTE: will build game dlls for 32-bit target') + # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture + # Because compatibility with original GoldSrc + if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU in ['x86_64']: + conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 + if not conf.env.BIT32_ALLOW64: + Logs.info('WARNING: will build engine for 32-bit target') else: - Logs.warn('WARNING: 64-bit game dlls may be unstable') + conf.env.BIT32_ALLOW64 = True + conf.env.BIT32_MANDATORY = not conf.env.BIT32_ALLOW64 + conf.load('force_32bit') linker_flags = { 'common': { - 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries - 'gcc': ['-Wl,--no-undefined'] + 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries + 'gcc': ['-Wl,--no-undefined'] }, 'sanitize': { - 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], + 'clang': ['-fsanitize=undefined', '-fsanitize=address'], + 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], } } compiler_c_cxx_flags = { 'common': { - 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS'], - 'clang': ['-g', '-gdwarf-2'], - 'gcc': ['-g', '-Werror=implicit-function-declaration', '-fdiagnostics-color=always'] + # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP + 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'], + 'gcc': ['-g', '-fvisibility=hidden'] }, 'fast': { - 'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG - 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], + 'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG + 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], + 'clang': ['-Ofast', '-march=native'], 'default': ['-O3'] }, 'release': { - 'msvc': ['/O2'], + 'msvc': ['/O2'], 'default': ['-O3'] }, 'debug': { - 'msvc': ['/O1'], - 'gcc': ['-Og'], + 'msvc': ['/O1'], + 'gcc': ['-Og'], 'default': ['-O1'] }, 'sanitize': { - 'msvc': ['/Od', '/RTC1'], - 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], - 'default': ['-O1'] + 'msvc': ['/Od', '/RTC1'], + 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], + 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address'], + 'default': ['-O0'] }, 'nooptimize': { - 'msvc': ['/Od'], + 'msvc': ['/Od'], 'default': ['-O0'] } } - conf.env.append_unique('CFLAGS', conf.get_flags_by_type( - compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) - conf.env.append_unique('CXXFLAGS', conf.get_flags_by_type( - compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) - conf.env.append_unique('LINKFLAGS', conf.get_flags_by_type( - linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) + compiler_optional_flags = [ + '-fdiagnostics-color=always', + '-Werror=implicit-function-declaration', + '-Werror=int-conversion', + '-Werror=return-type', + '-Werror=parentheses', + '-Werror=vla', + '-Werror=tautological-compare', + '-Werror=duplicated-cond', + '-Werror=bool-compare', + '-Werror=bool-operation', + '-Wstrict-aliasing', + ] + + c_compiler_optional_flags = [ + '-Werror=implicit-int', + '-Werror=declaration-after-statement' + ] + + linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC) + cflags = conf.get_flags_by_type(compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC) + + # Here we don't differentiate C or C++ flags + if conf.options.LTO: + lto_cflags = { + 'msvc': ['/GL'], + 'gcc': ['-flto'], + 'clang': ['-flto'] + } + + lto_linkflags = { + 'msvc': ['/LTCG'], + 'gcc': ['-flto'], + 'clang': ['-flto'] + } + cflags += conf.get_flags_by_compiler(lto_cflags, conf.env.COMPILER_CC) + linkflags += conf.get_flags_by_compiler(lto_linkflags, conf.env.COMPILER_CC) + + if conf.options.POLLY: + polly_cflags = { + 'gcc': ['-fgraphite-identity'], + 'clang': ['-mllvm', '-polly'] + # msvc sosat :( + } + + cflags += conf.get_flags_by_compiler(polly_cflags, conf.env.COMPILER_CC) + + # And here C++ flags starts to be treated separately + cxxflags = list(cflags) + if conf.env.COMPILER_CC != 'msvc': + conf.check_cc(cflags=cflags, msg= 'Checking for required C flags') + conf.check_cxx(cxxflags=cflags, msg= 'Checking for required C++ flags') + + cflags += conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags) + cxxflags += conf.filter_cxxflags(compiler_optional_flags, cflags) + + conf.env.append_unique('CFLAGS', cflags) + conf.env.append_unique('CXXFLAGS', cxxflags) + conf.env.append_unique('LINKFLAGS', linkflags) if conf.env.COMPILER_CC == 'msvc': - conf.env.append_unique('DEFINES', ['_CRT_SECURE_NO_WARNINGS','_CRT_NONSTDC_NO_DEPRECATE']) + conf.define('_CRT_SECURE_NO_WARNINGS', 1) + conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) else: - conf.env.append_unique('DEFINES', ['stricmp=strcasecmp','strnicmp=strncasecmp','_LINUX','LINUX','_snprintf=snprintf','_vsnprintf=vsnprintf']) - cflags = ['-fvisibility=hidden','-Wno-write-strings'] - conf.env.append_unique('CFLAGS', cflags) - conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) + conf.env.append_unique('DEFINES', ['stricmp=strcasecmp', 'strnicmp=strncasecmp', '_snprintf=snprintf', '_vsnprintf=vsnprintf', '_LINUX', 'LINUX']) + conf.env.append_unique('CXXFLAGS', ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) # strip lib from pattern if conf.env.DEST_OS in ['linux', 'darwin']: @@ -149,7 +212,7 @@ def configure(conf): if conf.env.cxxshlib_PATTERN.startswith('lib'): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] - conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS') + conf.define('CLIENT_WEAPONS', '1') conf.recurse('cl_dll dlls') From fbb5da7051ec0a93994a9efcb9b25c81eb04b935 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 11 Oct 2019 09:08:05 +0300 Subject: [PATCH 025/298] cl_dll: death: fix char signness --- cl_dll/death.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index b0667ec2..c6631f71 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -204,7 +204,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu // Get the Victim's name const char *victim_name = ""; // If victim is -1, the killer killed a specific, non-player object (like a sentrygun) - if( ( (char)victim ) != -1 ) + if( ( (signed char)victim ) != -1 ) victim_name = g_PlayerInfoList[victim].name; if( !victim_name ) { @@ -219,7 +219,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu } // Is it a non-player object kill? - if( ( (char)victim ) == -1 ) + if( ( (signed char)victim ) == -1 ) { rgDeathNoticeList[i].iNonPlayerKill = TRUE; From c2849e43cf5900c330b7e00b3198dac9ae3b3726 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 11 Oct 2019 10:05:07 +0300 Subject: [PATCH 026/298] waifulib: xcompile: fix including system includes --- scripts/waifulib/xcompile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index fe9b0e27..a7818911 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -240,7 +240,7 @@ class Android: if self.is_host(): cflags += [ '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), - '-I%s/usr/include/' % (self.sysroot()) + '-isystem', '%s/usr/include/' % (self.sysroot()) ] cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] From ec9bffedaf1e9f2687bfeb5174f3f8cebefa9400 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 16:49:25 +0500 Subject: [PATCH 027/298] Partially fix double promotion. --- cl_dll/StudioModelRenderer.cpp | 168 +++++++++---------- cl_dll/battery.cpp | 2 +- cl_dll/com_weapons.cpp | 4 +- cl_dll/entity.cpp | 54 +++---- cl_dll/ev_hldm.cpp | 94 +++++------ cl_dll/flashlight.cpp | 10 +- cl_dll/geiger.cpp | 22 +-- cl_dll/health.cpp | 30 ++-- cl_dll/hl/hl_objects.cpp | 8 +- cl_dll/hl/hl_weapons.cpp | 76 ++++----- cl_dll/hud_redraw.cpp | 4 +- cl_dll/hud_spectator.cpp | 70 ++++---- cl_dll/in_camera.cpp | 56 +++---- cl_dll/input.cpp | 2 +- cl_dll/input_xash3d.cpp | 16 +- cl_dll/message.cpp | 48 +++--- cl_dll/studio_util.cpp | 54 +++---- cl_dll/studio_util.h | 4 + cl_dll/util.cpp | 32 ++-- cl_dll/view.cpp | 172 ++++++++++---------- common/mathlib.h | 4 + dlls/aflock.cpp | 80 ++++----- dlls/agrunt.cpp | 170 ++++++++++---------- dlls/animating.cpp | 28 ++-- dlls/animation.cpp | 50 +++--- dlls/apache.cpp | 286 ++++++++++++++++----------------- dlls/barnacle.cpp | 46 +++--- dlls/barney.cpp | 46 +++--- dlls/bigmomma.cpp | 107 ++++++------ dlls/bmodels.cpp | 94 +++++------ dlls/bullsquid.cpp | 170 ++++++++++---------- dlls/buttons.cpp | 82 +++++----- dlls/cbase.cpp | 38 ++--- dlls/client.cpp | 20 +-- dlls/combat.cpp | 226 +++++++++++++------------- dlls/controller.cpp | 159 +++++++++--------- dlls/crossbow.cpp | 56 +++---- dlls/crowbar.cpp | 56 +++---- dlls/doors.cpp | 96 +++++------ dlls/effects.cpp | 94 +++++------ dlls/egon.cpp | 56 +++---- dlls/explode.cpp | 50 +++--- dlls/extdll.h | 4 + dlls/flyingmonster.cpp | 46 +++--- dlls/func_break.cpp | 52 +++--- dlls/func_tank.cpp | 38 ++--- dlls/gargantua.cpp | 80 ++++----- dlls/gauss.cpp | 108 ++++++------- dlls/ggrenade.cpp | 54 +++---- dlls/glock.cpp | 20 +-- dlls/h_ai.cpp | 24 +-- dlls/h_battery.cpp | 8 +- dlls/h_cine.cpp | 20 +-- dlls/h_cycler.cpp | 44 ++--- dlls/handgrenade.cpp | 64 ++++---- dlls/hassassin.cpp | 26 +-- dlls/headcrab.cpp | 28 ++-- dlls/healthkit.cpp | 8 +- dlls/hgrunt.cpp | 28 ++-- dlls/hornet.cpp | 46 +++--- dlls/hornetgun.cpp | 66 ++++---- dlls/houndeye.cpp | 46 +++--- dlls/ichthyosaur.cpp | 88 +++++----- dlls/islave.cpp | 4 +- dlls/items.cpp | 4 +- dlls/leech.cpp | 104 ++++++------ dlls/lights.cpp | 12 +- dlls/monsters.cpp | 82 +++++----- dlls/mp5.cpp | 26 +-- dlls/nihilanth.cpp | 94 +++++------ dlls/nodes.cpp | 30 ++-- dlls/observer.cpp | 6 +- dlls/osprey.cpp | 82 +++++----- dlls/plats.cpp | 62 +++---- dlls/player.cpp | 108 ++++++------- dlls/python.cpp | 36 ++--- dlls/roach.cpp | 4 +- dlls/rpg.cpp | 66 ++++---- dlls/satchel.cpp | 40 ++--- dlls/schedule.cpp | 4 +- dlls/scientist.cpp | 76 ++++----- dlls/scripted.cpp | 34 ++-- dlls/shotgun.cpp | 48 +++--- dlls/sound.cpp | 132 +++++++-------- dlls/soundent.cpp | 4 +- dlls/squadmonster.cpp | 13 +- dlls/squeakgrenade.cpp | 112 ++++++------- dlls/subs.cpp | 6 +- dlls/talkmonster.cpp | 134 +++++++-------- dlls/talkmonster.h | 2 +- dlls/tentacle.cpp | 34 ++-- dlls/triggers.cpp | 32 ++-- dlls/tripmine.cpp | 72 ++++----- dlls/turret.cpp | 80 ++++----- dlls/util.cpp | 28 ++-- dlls/weapons.cpp | 34 ++-- dlls/world.cpp | 14 +- dlls/xen.cpp | 28 ++-- pm_shared/pm_debug.c | 14 +- pm_shared/pm_math.c | 92 +++++------ pm_shared/pm_shared.c | 151 ++++++++--------- 101 files changed, 2888 insertions(+), 2854 deletions(-) diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index a9859244..826ab9e7 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -138,27 +138,27 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte int a, b; a = ( pcontroller1[j] + 128 ) % 256; b = ( pcontroller2[j] + 128 ) % 256; - value = ( ( a * dadt ) + ( b * ( 1 - dadt ) ) - 128 ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start; + value = ( ( a * dadt ) + ( b * ( 1.0f - dadt ) ) - 128.0f ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start; } else { - value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0 - dadt ) ) ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start; + value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0f - dadt ) ) ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start; } } else { - value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0 - dadt ) ) / 255.0; - if( value < 0 ) value = 0; - if( value > 1.0 ) value = 1.0; - value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; + value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0f - dadt ) ) / 255.0f; + if( value < 0.0f ) value = 0.0f; + if( value > 1.0f ) value = 1.0f; + value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; } // Con_DPrintf( "%d %d %f : %f\n", m_pCurrentEntity->curstate.controller[j], m_pCurrentEntity->latched.prevcontroller[j], value, dadt ); } else { - value = mouthopen / 64.0; - if( value > 1.0 ) value = 1.0; - value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; + value = mouthopen / 64.0f; + if( value > 1.0f ) value = 1.0f; + value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; // Con_DPrintf( "%d %f\n", mouthopen, value ); } switch( pbonecontroller[j].type & STUDIO_TYPES ) @@ -166,7 +166,7 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte case STUDIO_XR: case STUDIO_YR: case STUDIO_ZR: - adj[j] = value * ( M_PI / 180.0 ); + adj[j] = value * ( M_PI_F / 180.0f ); break; case STUDIO_X: case STUDIO_Y: @@ -305,7 +305,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo // and there's more data in the span if( panimvalue->num.valid > k + 1 ) { - pos[j] += ( panimvalue[k + 1].value * ( 1.0 - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j]; + pos[j] += ( panimvalue[k + 1].value * ( 1.0f - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j]; } else { @@ -317,7 +317,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo // are we at the end of the repeating values section and there's another section with data? if( panimvalue->num.total <= k + 1 ) { - pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0 - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j]; + pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0f - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j]; } else { @@ -344,12 +344,12 @@ void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_ vec4_t q3; float s1; - if( s < 0 ) - s = 0; - else if( s > 1.0 ) - s = 1.0; + if( s < 0.0f ) + s = 0.0f; + else if( s > 1.0f ) + s = 1.0f; - s1 = 1.0 - s; + s1 = 1.0f - s; for( i = 0; i < m_pStudioHeader->numbones; i++ ) { @@ -410,17 +410,17 @@ void CStudioModelRenderer::StudioPlayerBlend( mstudioseqdesc_t *pseqdesc, int *p *pBlend = ( *pPitch * 3 ); if( *pBlend < pseqdesc->blendstart[0] ) { - *pPitch -= pseqdesc->blendstart[0] / 3.0; + *pPitch -= pseqdesc->blendstart[0] / 3.0f; *pBlend = 0; } else if( *pBlend > pseqdesc->blendend[0] ) { - *pPitch -= pseqdesc->blendend[0] / 3.0; + *pPitch -= pseqdesc->blendend[0] / 3.0f; *pBlend = 255; } else { - if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1 ) // catch qc error + if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1f ) // catch qc error *pBlend = 127; else *pBlend = 255 * ( *pBlend - pseqdesc->blendstart[0] ) / ( pseqdesc->blendend[0] - pseqdesc->blendstart[0] ); @@ -475,11 +475,11 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) if( m_fDoInterp ) { // ugly hack to interpolate angle, position. current is reached 0.1 seconds after being set - f = f - 1.0; + f = f - 1.0f; } else { - f = 0; + f = 0.0f; } for( i = 0; i < 3; i++ ) @@ -489,7 +489,7 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) // NOTE: Because multiplayer lag can be relatively large, we don't want to cap // f at 1.5 anymore. - //if( f > -1.0 && f < 1.5 ) {} + //if( f > -1.0f && f < 1.5f ) {} //Con_DPrintf( "%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] ); for( i = 0; i < 3; i++ ) { @@ -499,13 +499,13 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) ang2 = m_pCurrentEntity->latched.prevangles[i]; d = ang1 - ang2; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } angles[i] += d * f; @@ -547,9 +547,9 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) { for( i = 0; i < 4; i++ ) { - (*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0 / ( ZISCALE * 0x10000 ) ); - (*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0 / ( ZISCALE * 0x10000 ) ); - (*m_paliastransform)[2][i] *= 1.0 / ( ZISCALE * 0x10000 ); + (*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0f / ( ZISCALE * 0x10000 ) ); + (*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0f / ( ZISCALE * 0x10000 ) ); + (*m_paliastransform)[2][i] *= 1.0f / ( ZISCALE * 0x10000 ); } } } @@ -567,14 +567,14 @@ StudioEstimateInterpolant */ float CStudioModelRenderer::StudioEstimateInterpolant( void ) { - float dadt = 1.0; + float dadt = 1.0f; - if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01 ) ) + if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01f ) ) { - dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1; - if( dadt > 2.0 ) + dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1f; + if( dadt > 2.0f ) { - dadt = 2.0; + dadt = 2.0f; } } return dadt; @@ -598,14 +598,14 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud if( f > pseqdesc->numframes - 1 ) { - f = 0; // bah, fix this bug with changing sequences too fast + f = 0.0f; // bah, fix this bug with changing sequences too fast } // BUG ( somewhere else ) but this code should validate this data. // This could cause a crash if the frame # is negative, so we'll go ahead // and clamp it here - else if( f < -0.01 ) + else if( f < -0.01f ) { - f = -0.01; + f = -0.01f; } frame = (int)f; @@ -635,18 +635,18 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud if( pseqdesc->motiontype & STUDIO_X ) { - pos[pseqdesc->motionbone][0] = 0.0; + pos[pseqdesc->motionbone][0] = 0.0f; } if( pseqdesc->motiontype & STUDIO_Y ) { - pos[pseqdesc->motionbone][1] = 0.0; + pos[pseqdesc->motionbone][1] = 0.0f; } if( pseqdesc->motiontype & STUDIO_Z ) { - pos[pseqdesc->motionbone][2] = 0.0; + pos[pseqdesc->motionbone][2] = 0.0f; } - s = 0 * ( ( 1.0 - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate; + s = 0 * ( ( 1.0f - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate; if( pseqdesc->motiontype & STUDIO_LX ) { @@ -679,7 +679,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ int axis = gEngfuncs.pfnRandomLong( 0, 1 ); if( axis == 1 ) // Choose between x & z axis = 2; - VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1, 1.484 ), transform[axis] ); + VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1.0f, 1.484f ), transform[axis] ); } else if( gEngfuncs.pfnRandomLong( 0, 49 ) == 0 ) { @@ -687,7 +687,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ int axis = gEngfuncs.pfnRandomLong(0,1); if( axis == 1 ) // Choose between x & z axis = 2; - offset = gEngfuncs.pfnRandomFloat( -10, 10 ); + offset = gEngfuncs.pfnRandomFloat( -10.0f, 10.0f ); transform[gEngfuncs.pfnRandomLong( 0, 2 )][3] += offset; } break; @@ -695,7 +695,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ { float scale; - scale = 1.0 + ( m_clTime - ent->curstate.animtime ) * 10.0; + scale = 1.0f + ( m_clTime - ent->curstate.animtime ) * 10.0f; if( scale > 2 ) // Don't blow up more than 200% scale = 2; transform[0][1] *= scale; @@ -734,7 +734,7 @@ float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc ) if( pseqdesc->numframes <= 1 ) { - f = 0; + f = 0.0; } else { @@ -1188,10 +1188,10 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) vec3_t est_velocity; dt = ( m_clTime - m_clOldTime ); - if( dt < 0 ) - dt = 0; - else if( dt > 1.0 ) - dt = 1; + if( dt < 0.0f ) + dt = 0.0f; + else if( dt > 1.0f ) + dt = 1.0f; if( dt == 0 || m_pPlayerInfo->renderframe == m_nFrameCount ) { @@ -1221,29 +1221,29 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) if( est_velocity[1] == 0 && est_velocity[0] == 0 ) { float flYawDiff = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; - flYawDiff = flYawDiff - (int)( flYawDiff / 360 ) * 360; - if( flYawDiff > 180 ) - flYawDiff -= 360; - if( flYawDiff < -180 ) - flYawDiff += 360; + flYawDiff = flYawDiff - (int)( flYawDiff / 360.0f ) * 360.0f; + if( flYawDiff > 180.0f ) + flYawDiff -= 360.0f; + if( flYawDiff < -180.0f ) + flYawDiff += 360.0f; - if( dt < 0.25 ) - flYawDiff *= dt * 4; + if( dt < 0.25f ) + flYawDiff *= dt * 4.0f; else flYawDiff *= dt; m_pPlayerInfo->gaityaw += flYawDiff; - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360 ) * 360; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360.0f ) * 360.0f; m_flGaitMovement = 0; } else { - m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180 / M_PI ); - if( m_pPlayerInfo->gaityaw > 180 ) - m_pPlayerInfo->gaityaw = 180; - if( m_pPlayerInfo->gaityaw < -180 ) - m_pPlayerInfo->gaityaw = -180; + m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180.0f / M_PI_F ); + if( m_pPlayerInfo->gaityaw > 180.0f ) + m_pPlayerInfo->gaityaw = 180.0f; + if( m_pPlayerInfo->gaityaw < -180.0f ) + m_pPlayerInfo->gaityaw = -180.0f; } } @@ -1277,10 +1277,10 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) // Con_DPrintf( "%f %d\n", m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->blending[0] ); dt = ( m_clTime - m_clOldTime ); - if( dt < 0 ) - dt = 0; - else if( dt > 1.0 ) - dt = 1; + if( dt < 0.0f ) + dt = 0.0f; + else if( dt > 1.0f ) + dt = 1.0f; StudioEstimateGait( pplayer ); @@ -1288,38 +1288,38 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) // calc side to side turning flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; - flYaw = flYaw - (int)( flYaw / 360 ) * 360; - if( flYaw < -180 ) - flYaw = flYaw + 360; - if( flYaw > 180 ) - flYaw = flYaw - 360; + flYaw = flYaw - (int)( flYaw / 360.0f ) * 360.0f; + if( flYaw < -180.0f ) + flYaw = flYaw + 360.0f; + if( flYaw > 180.0f ) + flYaw = flYaw - 360.0f; - if( flYaw > 120 ) + if( flYaw > 120.0f ) { - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180.0f; m_flGaitMovement = -m_flGaitMovement; - flYaw = flYaw - 180; + flYaw = flYaw - 180.0f; } - else if( flYaw < -120 ) + else if( flYaw < -120.0f ) { - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180.0f; m_flGaitMovement = -m_flGaitMovement; - flYaw = flYaw + 180; + flYaw = flYaw + 180.0f; } // adjust torso - m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); + m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0]; m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1]; m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2]; m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3]; m_pCurrentEntity->angles[YAW] = m_pPlayerInfo->gaityaw; - if( m_pCurrentEntity->angles[YAW] < -0 ) - m_pCurrentEntity->angles[YAW] += 360; + if( m_pCurrentEntity->angles[YAW] < -0.0f ) + m_pCurrentEntity->angles[YAW] += 360.0f; m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW]; if( pplayer->gaitsequence >= m_pStudioHeader->numseq ) diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index b939a8b1..7933dd6b 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -78,7 +78,7 @@ int CHudBattery::Draw( float flTime ) wrect_t rc; rc = *m_prc2; - rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01 ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 + rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01f ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 UnpackRGB( r, g, b, RGB_YELLOWISH ); diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 198c533a..4b9ae338 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -161,7 +161,7 @@ Always 0.0 on client, even if not predicting weapons ( won't get called */ float UTIL_WeaponTimeBase( void ) { - return 0.0; + return 0.0f; } static unsigned int glSeed = 0; @@ -254,7 +254,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) tensixrand = U_Random() & 65535; - offset = (float)tensixrand / 65536.0; + offset = (float)tensixrand / 65536.0f; return ( low + offset * range ); } diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index 40649fa7..6a7fdc79 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -319,12 +319,12 @@ void Particles( void ) curtime = gEngfuncs.GetClientTime(); - if( ( curtime - lasttime ) < 2.0 ) + if( ( curtime - lasttime ) < 2.0f ) return; if( !color ) { - color = gEngfuncs.pfnRegisterVariable ( "color","255 0 0", 0 ); + color = gEngfuncs.pfnRegisterVariable( "color", "255 0 0", 0 ); } lasttime = curtime; @@ -342,8 +342,8 @@ void Particles( void ) for( j = 0; j < 3; j++ ) { - p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0, 32.0 ); - p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0, 100.0 ); + p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0f, 32.0f ); + p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f ); } if( color ) @@ -361,7 +361,7 @@ void Particles( void ) gEngfuncs.pEfxAPI->R_GetPackedColor( &p->packedColor, p->color ); // p->die is set to current time so all you have to do is add an additional time to it - p->die += 3.0; + p->die += 3.0f; } } */ @@ -384,7 +384,7 @@ void TempEnts( void ) curtime = gEngfuncs.GetClientTime(); - if( ( curtime - lasttime ) < 10.0 ) + if( ( curtime - lasttime ) < 10.0f ) return; lasttime = curtime; @@ -417,11 +417,11 @@ void TempEnts( void ) p->entity.curstate.origin[j] = origin[j]; // Store velocity in baseline origin - p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100, 100 ); + p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f ); } // p->die is set to current time so all you have to do is add an additional time to it - p->die += 10.0; + p->die += 10.0f; } } */ @@ -626,7 +626,7 @@ void DLLEXPORT HUD_TempEntUpdate ( //freq = client_time * 0.01; fastFreq = client_time * 5.5; gravity = -frametime * cl_gravity; - gravitySlow = gravity * 0.5; + gravitySlow = gravity * 0.5f; while( pTemp ) { @@ -634,7 +634,7 @@ void DLLEXPORT HUD_TempEntUpdate ( active = 1; - life = pTemp->die - client_time; + life = pTemp->die - (float)client_time; pnext = pTemp->next; if( life < 0 ) { @@ -674,9 +674,9 @@ void DLLEXPORT HUD_TempEntUpdate ( gEngfuncs.pEfxAPI->R_SparkEffect( pTemp->entity.origin, 8, -200, 200 ); // Reduce life - pTemp->entity.baseline.framerate -= 0.1; + pTemp->entity.baseline.framerate -= 0.1f; - if( pTemp->entity.baseline.framerate <= 0.0 ) + if( pTemp->entity.baseline.framerate <= 0.0f ) { pTemp->die = client_time; } @@ -700,11 +700,11 @@ void DLLEXPORT HUD_TempEntUpdate ( } else if( pTemp->flags & FTENT_SINEWAVE ) { - pTemp->x += pTemp->entity.baseline.origin[0] * frametime; - pTemp->y += pTemp->entity.baseline.origin[1] * frametime; + pTemp->x += pTemp->entity.baseline.origin[0] * (float)frametime; + pTemp->y += pTemp->entity.baseline.origin[1] * (float)frametime; pTemp->entity.origin[0] = pTemp->x + sin( pTemp->entity.baseline.origin[2] + client_time * pTemp->entity.prevstate.frame ) * ( 10 * pTemp->entity.curstate.framerate ); - pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7 ) * ( 8 * pTemp->entity.curstate.framerate ); + pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7f ) * ( 8 * pTemp->entity.curstate.framerate ); pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; } else if( pTemp->flags & FTENT_SPIRAL ) @@ -713,19 +713,19 @@ void DLLEXPORT HUD_TempEntUpdate ( s = sin( pTemp->entity.baseline.origin[2] + fastFreq ); c = cos( pTemp->entity.baseline.origin[2] + fastFreq );*/ - pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (size_t)pTemp ); - pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (size_t)pTemp ); - pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; + pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * (float)frametime + 8 * sin( client_time * 20 + (size_t)pTemp ); + pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * (float)frametime + 4 * sin( client_time * 30 + (size_t)pTemp ); + pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * (float)frametime; } else { for( i = 0; i < 3; i++ ) - pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * frametime; + pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * (float)frametime; } if( pTemp->flags & FTENT_SPRANIMATE ) { - pTemp->entity.curstate.frame += frametime * pTemp->entity.curstate.framerate; + pTemp->entity.curstate.frame += (float)frametime * pTemp->entity.curstate.framerate; if( pTemp->entity.curstate.frame >= pTemp->frameMax ) { pTemp->entity.curstate.frame = pTemp->entity.curstate.frame - (int)( pTemp->entity.curstate.frame ); @@ -755,9 +755,9 @@ void DLLEXPORT HUD_TempEntUpdate ( if( pTemp->flags & FTENT_ROTATE ) { - pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * frametime; - pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * frametime; - pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * frametime; + pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * (float)frametime; + pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * (float)frametime; + pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * (float)frametime; VectorCopy( pTemp->entity.angles, pTemp->entity.latched.prevangles ); } @@ -809,7 +809,7 @@ void DLLEXPORT HUD_TempEntUpdate ( { // Chop spark speeds a bit more // - VectorScale( pTemp->entity.baseline.origin, 0.6, pTemp->entity.baseline.origin ); + VectorScale( pTemp->entity.baseline.origin, 0.6f, pTemp->entity.baseline.origin ); if( Length( pTemp->entity.baseline.origin ) < 10 ) { @@ -829,13 +829,13 @@ void DLLEXPORT HUD_TempEntUpdate ( float proj, damp; // Place at contact point - VectorMA( pTemp->entity.prevstate.origin, traceFraction * frametime, pTemp->entity.baseline.origin, pTemp->entity.origin ); + VectorMA( pTemp->entity.prevstate.origin, traceFraction * (float)frametime, pTemp->entity.baseline.origin, pTemp->entity.origin ); // Damp velocity damp = pTemp->bounceFactor; if( pTemp->flags & ( FTENT_GRAVITY | FTENT_SLOWGRAVITY ) ) { - damp *= 0.5; - if( traceNormal[2] > 0.9 ) // Hit floor? + damp *= 0.5f; + if( traceNormal[2] > 0.9f ) // Hit floor? { if( pTemp->entity.baseline.origin[2] <= 0 && pTemp->entity.baseline.origin[2] >= gravity*3 ) { diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index f8fefad5..9b100439 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -72,18 +72,18 @@ void EV_SnarkFire( struct event_args_s *args ); void EV_TrainPitchAdjust( struct event_args_s *args ); } -#define VECTOR_CONE_1DEGREES Vector( 0.00873, 0.00873, 0.00873 ) -#define VECTOR_CONE_2DEGREES Vector( 0.01745, 0.01745, 0.01745 ) -#define VECTOR_CONE_3DEGREES Vector( 0.02618, 0.02618, 0.02618 ) -#define VECTOR_CONE_4DEGREES Vector( 0.03490, 0.03490, 0.03490 ) -#define VECTOR_CONE_5DEGREES Vector( 0.04362, 0.04362, 0.04362 ) -#define VECTOR_CONE_6DEGREES Vector( 0.05234, 0.05234, 0.05234 ) -#define VECTOR_CONE_7DEGREES Vector( 0.06105, 0.06105, 0.06105 ) -#define VECTOR_CONE_8DEGREES Vector( 0.06976, 0.06976, 0.06976 ) -#define VECTOR_CONE_9DEGREES Vector( 0.07846, 0.07846, 0.07846 ) -#define VECTOR_CONE_10DEGREES Vector( 0.08716, 0.08716, 0.08716 ) -#define VECTOR_CONE_15DEGREES Vector( 0.13053, 0.13053, 0.13053 ) -#define VECTOR_CONE_20DEGREES Vector( 0.17365, 0.17365, 0.17365 ) +#define VECTOR_CONE_1DEGREES Vector( 0.00873f, 0.00873f, 0.00873f ) +#define VECTOR_CONE_2DEGREES Vector( 0.01745f, 0.01745f, 0.01745f ) +#define VECTOR_CONE_3DEGREES Vector( 0.02618f, 0.02618f, 0.02618f ) +#define VECTOR_CONE_4DEGREES Vector( 0.03490f, 0.03490f, 0.03490f ) +#define VECTOR_CONE_5DEGREES Vector( 0.04362f, 0.04362f, 0.04362f ) +#define VECTOR_CONE_6DEGREES Vector( 0.05234f, 0.05234f, 0.05234f ) +#define VECTOR_CONE_7DEGREES Vector( 0.06105f, 0.06105f, 0.06105f ) +#define VECTOR_CONE_8DEGREES Vector( 0.06976f, 0.06976f, 0.06976f ) +#define VECTOR_CONE_9DEGREES Vector( 0.07846f, 0.07846f, 0.07846f ) +#define VECTOR_CONE_10DEGREES Vector( 0.08716f, 0.08716f, 0.08716f ) +#define VECTOR_CONE_15DEGREES Vector( 0.13053f, 0.13053f, 0.13053f ) +#define VECTOR_CONE_20DEGREES Vector( 0.17365f, 0.17365f, 0.17365f ) // play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the // original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture. @@ -425,7 +425,7 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount ); // do damage, paint decals - if( tr.fraction != 1.0 ) + if( tr.fraction != 1.0f ) { switch( iBulletType ) { @@ -901,14 +901,14 @@ void EV_FireGauss( event_args_t *args ) if( EV_IsLocal( idx ) ) { - V_PunchAxis( 0, -2.0 ); + V_PunchAxis( 0.0f, -2.0f ); gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 ); if( m_fPrimaryFire == false ) g_flApplyVel = flDamage; } - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5 + flDamage * ( 1.0 / 400.0 ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5f + flDamage * ( 1.0f / 400.0f ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); while( flDamage > 10 && nMaxHits > 0 ) { @@ -943,10 +943,10 @@ void EV_FireGauss( event_args_t *args ) idx | 0x1000, tr.endpos, m_iBeam, - 0.1, - m_fPrimaryFire ? 1.0 : 2.5, - 0.0, - m_fPrimaryFire ? 128.0 : flDamage, + 0.1f, + m_fPrimaryFire ? 1.0f : 2.5f, + 0.0f, + m_fPrimaryFire ? 128.0f : flDamage, 0, 0, 0, @@ -960,10 +960,10 @@ void EV_FireGauss( event_args_t *args ) gEngfuncs.pEfxAPI->R_BeamPoints( vecSrc, tr.endpos, m_iBeam, - 0.1, - m_fPrimaryFire ? 1.0 : 2.5, - 0.0, - m_fPrimaryFire ? 128.0 : flDamage, + 0.1f, + m_fPrimaryFire ? 1.0f : 2.5f, + 0.0f, + m_fPrimaryFire ? 128.0f : flDamage, 0, 0, 0, @@ -985,13 +985,13 @@ void EV_FireGauss( event_args_t *args ) n = -DotProduct( tr.plane.normal, forward ); - if( n < 0.5 ) // 60 degrees + if( n < 0.5f ) // 60 degrees { // ALERT( at_console, "reflect %f\n", n ); // reflect vec3_t r; - VectorMA( forward, 2.0 * n, tr.plane.normal, r ); + VectorMA( forward, 2.0f * n, tr.plane.normal, r ); flMaxFrac = flMaxFrac - tr.fraction; @@ -1000,18 +1000,18 @@ void EV_FireGauss( event_args_t *args ) VectorMA( tr.endpos, 8.0, forward, vecSrc ); VectorMA( vecSrc, 8192.0, forward, vecDest ); - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0, flDamage * n * 0.5 * 0.1, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0f, flDamage * n * 0.5f * 0.1f, FTENT_FADEOUT ); vec3_t fwd; VectorAdd( tr.endpos, tr.plane.normal, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 100 ); // lose energy - if( n == 0 ) + if( n == 0.0f ) { - n = 0.1; + n = 0.1f; } flDamage = flDamage * ( 1 - n ); @@ -1021,7 +1021,7 @@ void EV_FireGauss( event_args_t *args ) // tunnel EV_HLDM_DecalGunshot( &tr, BULLET_MONSTER_12MM ); - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT ); // limit it to one hole punch if( fHasPunched ) @@ -1067,7 +1067,7 @@ void EV_FireGauss( event_args_t *args ) { vec3_t fwd; VectorSubtract( tr.endpos, forward, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 100 ); } @@ -1076,13 +1076,13 @@ void EV_FireGauss( event_args_t *args ) EV_HLDM_DecalGunshot( &beam_tr, BULLET_MONSTER_12MM ); - gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT ); // balls { vec3_t fwd; VectorSubtract( beam_tr.endpos, forward, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3 ), 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 200, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3f ), 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 200, 255, 40 ); } @@ -1102,11 +1102,11 @@ void EV_FireGauss( event_args_t *args ) { // slug doesn't punch through ever with primary // fire, so leave a little glowy bit and make some balls - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0 / 255.0, 0.3, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0f / 255.0f, 0.3, FTENT_FADEOUT ); { vec3_t fwd; VectorAdd( tr.endpos, tr.plane.normal, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 200 ); } } @@ -1238,7 +1238,7 @@ void EV_FireCrossbow2( event_args_t *args ) VectorMA( vecSrc, 8192, forward, vecEnd ); gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); if( EV_IsLocal( idx ) ) { @@ -1257,7 +1257,7 @@ void EV_FireCrossbow2( event_args_t *args ) gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); //We hit something - if( tr.fraction < 1.0 ) + if( tr.fraction < 1.0f ) { physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); @@ -1277,7 +1277,7 @@ void EV_FireCrossbow2( event_args_t *args ) //Stick to world but don't stick to glass, it might break and leave the bolt floating. It can still stick to other non-transparent breakables though. else if( pe->rendermode == kRenderNormal ) { - gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, PITCH_NORM ); + gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, PITCH_NORM ); //Not underwater, do some sparks... if( gEngfuncs.PM_PointContents( tr.endpos, NULL ) != CONTENTS_WATER ) @@ -1313,7 +1313,7 @@ void EV_FireCrossbow( event_args_t *args ) VectorCopy( args->origin, origin ); gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); //Only play the weapon anims if I shot it. if( EV_IsLocal( idx ) ) @@ -1323,7 +1323,7 @@ void EV_FireCrossbow( event_args_t *args ) else if ( args->iparam2 ) gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); - V_PunchAxis( 0, -2.0 ); + V_PunchAxis( 0.0f, -2.0f ); } } //====================== @@ -1541,13 +1541,13 @@ void EV_EgonStop( event_args_t *args ) { if( pBeam ) { - pBeam->die = 0.0; + pBeam->die = 0.0f; pBeam = NULL; } if( pBeam2 ) { - pBeam2->die = 0.0; + pBeam2->die = 0.0f; pBeam2 = NULL; } @@ -1667,10 +1667,10 @@ void EV_TripmineFire( event_args_t *args ) // Now add in all of the players. gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); - gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128, PM_NORMAL, -1, &tr ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr ); //Hit something solid - if( tr.fraction < 1.0 ) + if( tr.fraction < 1.0f ) gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 ); gEngfuncs.pEventAPI->EV_PopPMStates(); @@ -1722,7 +1722,7 @@ void EV_SnarkFire( event_args_t *args ) gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc + forward * 20, vecSrc + forward * 64, PM_NORMAL, -1, &tr ); //Find space to drop the thing. - if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25 ) + if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f ) gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 ); gEngfuncs.pEventAPI->EV_PopPMStates(); @@ -1751,9 +1751,9 @@ void EV_TrainPitchAdjust( event_args_t *args ) us_params = (unsigned short)args->iparam1; stop = args->bparam1; - m_flVolume = (float)( us_params & 0x003f ) / 40.0; + m_flVolume = (float)( us_params & 0x003f ) / 40.0f; noise = (int)( ( ( us_params ) >> 12 ) & 0x0007 ); - pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) ); + pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) ); switch( noise ) { diff --git a/cl_dll/flashlight.cpp b/cl_dll/flashlight.cpp index ee3d6d22..3ec69973 100644 --- a/cl_dll/flashlight.cpp +++ b/cl_dll/flashlight.cpp @@ -50,7 +50,7 @@ void CHudFlashlight::Reset( void ) m_fFade = 0; m_fOn = 0; m_iBat = 100; - m_flBat = 1.0; + m_flBat = 1.0f; } int CHudFlashlight::VidInit( void ) @@ -75,7 +75,7 @@ int CHudFlashlight::MsgFunc_FlashBat( const char *pszName, int iSize, void *pbu BEGIN_READ( pbuf, iSize ); int x = READ_BYTE(); m_iBat = x; - m_flBat = ( (float)x ) / 100.0; + m_flBat = ( (float)x ) / 100.0f; return 1; } @@ -86,7 +86,7 @@ int CHudFlashlight::MsgFunc_Flashlight( const char *pszName, int iSize, void *p m_fOn = READ_BYTE(); int x = READ_BYTE(); m_iBat = x; - m_flBat = ( (float)x ) / 100.0; + m_flBat = ( (float)x ) / 100.0f; return 1; } @@ -119,7 +119,7 @@ int CHudFlashlight::Draw( float flTime ) else a = MIN_ALPHA; - if( m_flBat < 0.20 ) + if( m_flBat < 0.20f ) UnpackRGB( r,g,b, RGB_REDISH ); else UnpackRGB( r,g,b, RGB_YELLOWISH ); @@ -144,7 +144,7 @@ int CHudFlashlight::Draw( float flTime ) // draw the flashlight energy level x = ScreenWidth - m_iWidth - m_iWidth / 2; - int iOffset = m_iWidth * ( 1.0 - m_flBat ); + int iOffset = m_iWidth * ( 1.0f - m_flBat ); if( iOffset < m_iWidth ) { rc = *m_prc2; diff --git a/cl_dll/geiger.cpp b/cl_dll/geiger.cpp index 097889b9..339c8ee1 100644 --- a/cl_dll/geiger.cpp +++ b/cl_dll/geiger.cpp @@ -78,7 +78,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 600 ) { pct = 2; - flvol = 0.4; //Con_Printf( "range > 600\n" ); + flvol = 0.4f; //Con_Printf( "range > 600\n" ); //rg[0] = 1; //rg[1] = 1; i = 2; @@ -86,7 +86,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 500 ) { pct = 4; - flvol = 0.5; //Con_Printf( "range > 500\n" ); + flvol = 0.5f; //Con_Printf( "range > 500\n" ); //rg[0] = 1; //rg[1] = 2; i = 2; @@ -94,7 +94,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 400 ) { pct = 8; - flvol = 0.6; //Con_Printf( "range > 400\n" ); + flvol = 0.6f; //Con_Printf( "range > 400\n" ); //rg[0] = 1; //rg[1] = 2; //rg[2] = 3; @@ -103,7 +103,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 300 ) { pct = 8; - flvol = 0.7; //Con_Printf( "range > 300\n" ); + flvol = 0.7f; //Con_Printf( "range > 300\n" ); //rg[0] = 2; //rg[1] = 3; //rg[2] = 4; @@ -112,7 +112,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 200 ) { pct = 28; - flvol = 0.78; //Con_Printf( "range > 200\n" ); + flvol = 0.78f; //Con_Printf( "range > 200\n" ); //rg[0] = 2; //rg[1] = 3; //rg[2] = 4; @@ -121,7 +121,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 150 ) { pct = 40; - flvol = 0.80; //Con_Printf( "range > 150\n" ); + flvol = 0.80f; //Con_Printf( "range > 150\n" ); //rg[0] = 3; //rg[1] = 4; //rg[2] = 5; @@ -139,7 +139,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 75 ) { pct = 80; - flvol = 0.9; //Con_Printf( "range > 75\n" ); + flvol = 0.9f; //Con_Printf( "range > 75\n" ); //gflGeigerDelay = cl.time + GEIGERDELAY * 0.75; //rg[0] = 4; //rg[1] = 5; @@ -149,7 +149,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 50 ) { pct = 90; - flvol = 0.95; //Con_Printf( "range > 50\n" ); + flvol = 0.95f; //Con_Printf( "range > 50\n" ); //rg[0] = 5; //rg[1] = 6; i = 2; @@ -157,17 +157,17 @@ int CHudGeiger::Draw( float flTime ) else { pct = 95; - flvol = 1.0; //Con_Printf( "range < 50\n" ); + flvol = 1.0f; //Con_Printf( "range < 50\n" ); //rg[0] = 5; //rg[1] = 6; i = 2; } - flvol = ( flvol * ( ( rand() & 127 ) ) / 255 ) + 0.25; // UTIL_RandomFloat( 0.25, 0.5 ); + flvol = ( flvol * ( ( rand() & 127 ) ) / 255 ) + 0.25f; // UTIL_RandomFloat( 0.25f, 0.5f ); if( ( rand() & 127 ) < pct || ( rand() & 127 ) < pct ) { - //S_StartDynamicSound( -1, 0, rgsfx[rand() % i], r_origin, flvol, 1.0, 0, 100 ); + //S_StartDynamicSound( -1, 0, rgsfx[rand() % i], r_origin, flvol, 1.0f, 0, 100 ); char sz[256]; int j = rand() & 1; diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index bde24f96..10dc15af 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -270,27 +270,27 @@ void CHudHealth::CalcDamageDirection( vec3_t vecFrom ) } else { - if( side > 0 ) + if( side > 0.0f ) { - if( side > 0.3 ) + if( side > 0.3f ) m_fAttackFront = Q_max( m_fAttackFront, side ); } else { float f = fabs( side ); - if( f > 0.3 ) + if( f > 0.3f ) m_fAttackRear = Q_max( m_fAttackRear, f ); } - if( front > 0 ) + if( front > 0.0f ) { - if( front > 0.3 ) + if( front > 0.3f ) m_fAttackRight = Q_max( m_fAttackRight, front ); } else { float f = fabs( front ); - if( f > 0.3 ) + if( f > 0.3f ) m_fAttackLeft = Q_max( m_fAttackLeft, f ); } } @@ -310,10 +310,10 @@ int CHudHealth::DrawPain( float flTime ) float fFade = gHUD.m_flTimeDelta * 2; // SPR_Draw top - if( m_fAttackFront > 0.4 ) + if( m_fAttackFront > 0.4f ) { GetPainColor( r, g, b ); - shade = a * Q_max( m_fAttackFront, 0.5 ); + shade = a * Q_max( m_fAttackFront, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); @@ -324,10 +324,10 @@ int CHudHealth::DrawPain( float flTime ) } else m_fAttackFront = 0; - if( m_fAttackRight > 0.4 ) + if( m_fAttackRight > 0.4f ) { GetPainColor( r, g, b ); - shade = a * Q_max( m_fAttackRight, 0.5 ); + shade = a * Q_max( m_fAttackRight, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); @@ -339,10 +339,10 @@ int CHudHealth::DrawPain( float flTime ) else m_fAttackRight = 0; - if( m_fAttackRear > 0.4 ) + if( m_fAttackRear > 0.4f ) { GetPainColor( r, g, b ); - shade = a * Q_max( m_fAttackRear, 0.5 ); + shade = a * Q_max( m_fAttackRear, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); @@ -354,10 +354,10 @@ int CHudHealth::DrawPain( float flTime ) else m_fAttackRear = 0; - if( m_fAttackLeft > 0.4 ) + if( m_fAttackLeft > 0.4f ) { GetPainColor( r, g, b ); - shade = a * Q_max( m_fAttackLeft, 0.5 ); + shade = a * Q_max( m_fAttackLeft, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); @@ -382,7 +382,7 @@ int CHudHealth::DrawDamage( float flTime ) UnpackRGB( r, g, b, RGB_YELLOWISH ); - a = (int)( fabs( sin( flTime * 2 ) ) * 256.0 ); + a = (int)( fabs( sin( flTime * 2.0f ) ) * 256.0f ); ScaleColors( r, g, b, a ); diff --git a/cl_dll/hl/hl_objects.cpp b/cl_dll/hl/hl_objects.cpp index 55822dcb..788b09e3 100644 --- a/cl_dll/hl/hl_objects.cpp +++ b/cl_dll/hl/hl_objects.cpp @@ -68,25 +68,25 @@ void UpdateBeams( void ) if( pBeam ) { pBeam->target = tr.endpos; - pBeam->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pBeam->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. } if( pBeam2 ) { pBeam2->target = tr.endpos; - pBeam2->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pBeam2->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. } if( pFlare ) // Vit_amiN: beam flare { pFlare->entity.origin = tr.endpos; - pFlare->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pFlare->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. if( gEngfuncs.GetMaxClients() != 1 ) // Singleplayer always draws the egon's energy beam flare { pFlare->flags |= FTENT_NOMODEL; - if( !( tr.allsolid || tr.ent <= 0 || tr.fraction == 1.0 ) ) // Beam hit some non-world entity + if( !( tr.allsolid || tr.ent <= 0 || tr.fraction == 1.0f ) ) // Beam hit some non-world entity { physent_t *pEntity = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 75161a9e..8c1489fe 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -218,8 +218,8 @@ BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWe SendWeaponAnim( iAnim, skiplocal, body ); g_irunninggausspred = false; - m_pPlayer->m_flNextAttack = 0.5; - m_flTimeWeaponIdle = 1.0; + m_pPlayer->m_flNextAttack = 0.5f; + m_flTimeWeaponIdle = 1.0f; return TRUE; } @@ -233,7 +233,7 @@ BOOL CBasePlayerWeapon::PlayEmptySound( void ) { if( m_iPlayEmptySound ) { - HUD_PlaySound( "weapons/357_cock1.wav", 0.8 ); + HUD_PlaySound( "weapons/357_cock1.wav", 0.8f ); m_iPlayEmptySound = 0; return 0; } @@ -296,8 +296,8 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD { // get circular gaussian spread do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while( z > 1 ); } @@ -305,13 +305,13 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD { //Use player's random seed. // get circular gaussian spread - x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 ); - y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 ); + x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f ); + y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f ); z = x * x + y * y; } } - return Vector( x * vecSpread.x, y * vecSpread.y, 0.0 ); + return Vector( x * vecSpread.x, y * vecSpread.y, 0.0f ); } /* @@ -323,7 +323,7 @@ Handles weapon firing, reloading, etc. */ void CBasePlayerWeapon::ItemPostFrame( void ) { - if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0 ) ) + if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) ) { #if 0 // FIXME, need ammo on client to make this work right // complete the reload. @@ -338,7 +338,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fInReload = FALSE; } - if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && ( m_flNextSecondaryAttack <= 0.0 ) ) + if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && ( m_flNextSecondaryAttack <= 0.0f ) ) { if( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] ) { @@ -348,7 +348,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) SecondaryAttack(); m_pPlayer->pev->button &= ~IN_ATTACK2; } - else if( ( m_pPlayer->pev->button & IN_ATTACK ) && ( m_flNextPrimaryAttack <= 0.0 ) ) + else if( ( m_pPlayer->pev->button & IN_ATTACK ) && ( m_flNextPrimaryAttack <= 0.0f ) ) { if( ( m_iClip == 0 && pszAmmo1() ) || ( iMaxClip() == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) ) { @@ -368,7 +368,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fFireOnEmpty = FALSE; // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing - if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0 ) + if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0f ) { Reload(); return; @@ -483,7 +483,7 @@ Don't actually trace, but act like the trace didn't hit anything. void UTIL_TraceLine( const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr ) { memset( ptr, 0, sizeof(*ptr) ); - ptr->flFraction = 1.0; + ptr->flFraction = 1.0f; } /* @@ -956,61 +956,61 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm to->client.vuser4[1] = player.m_rgAmmo[pCurrent->m_iPrimaryAmmoType]; to->client.vuser4[2] = player.m_rgAmmo[pCurrent->m_iSecondaryAmmoType]; -/* if( pto->m_flPumpTime != -9999 ) +/* if( pto->m_flPumpTime != -9999.0f ) { - pto->m_flPumpTime -= cmd->msec / 1000.0; - if( pto->m_flPumpTime < -0.001 ) - pto->m_flPumpTime = -0.001; + pto->m_flPumpTime -= cmd->msec / 1000.0f; + if( pto->m_flPumpTime < -0.001f ) + pto->m_flPumpTime = -0.001f; }*/ - if( pto->m_fNextAimBonus < -1.0 ) + if( pto->m_fNextAimBonus < -1.0f ) { - pto->m_fNextAimBonus = -1.0; + pto->m_fNextAimBonus = -1.0f; } - if( pto->m_flNextPrimaryAttack < -1.0 ) + if( pto->m_flNextPrimaryAttack < -1.0f ) { - pto->m_flNextPrimaryAttack = -1.0; + pto->m_flNextPrimaryAttack = -1.0f; } - if( pto->m_flNextSecondaryAttack < -0.001 ) + if( pto->m_flNextSecondaryAttack < -0.001f ) { - pto->m_flNextSecondaryAttack = -0.001; + pto->m_flNextSecondaryAttack = -0.001f; } - if( pto->m_flTimeWeaponIdle < -0.001 ) + if( pto->m_flTimeWeaponIdle < -0.001f ) { - pto->m_flTimeWeaponIdle = -0.001; + pto->m_flTimeWeaponIdle = -0.001f; } - if( pto->m_flNextReload < -0.001 ) + if( pto->m_flNextReload < -0.001f ) { - pto->m_flNextReload = -0.001; + pto->m_flNextReload = -0.001f; } - if( pto->fuser1 < -0.001 ) + if( pto->fuser1 < -0.001f ) { - pto->fuser1 = -0.001; + pto->fuser1 = -0.001f; } } // m_flNextAttack is now part of the weapons, but is part of the player instead - to->client.m_flNextAttack -= cmd->msec / 1000.0; - if( to->client.m_flNextAttack < -0.001 ) + to->client.m_flNextAttack -= cmd->msec / 1000.0f; + if( to->client.m_flNextAttack < -0.001f ) { - to->client.m_flNextAttack = -0.001; + to->client.m_flNextAttack = -0.001f; } - to->client.fuser2 -= cmd->msec / 1000.0; - if( to->client.fuser2 < -0.001 ) + to->client.fuser2 -= cmd->msec / 1000.0f; + if( to->client.fuser2 < -0.001f ) { - to->client.fuser2 = -0.001; + to->client.fuser2 = -0.001f; } - to->client.fuser3 -= cmd->msec / 1000.0; - if( to->client.fuser3 < -0.001 ) + to->client.fuser3 -= cmd->msec / 1000.0f; + if( to->client.fuser3 < -0.001f ) { - to->client.fuser3 = -0.001; + to->client.fuser3 = -0.001f; } // Store off the last position from the predicted state. diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 000c0c1b..17f2d7dd 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -86,7 +86,7 @@ int CHud::Redraw( float flTime, int intermission ) { m_fOldTime = m_flTime; // save time of previous redraw m_flTime = flTime; - m_flTimeDelta = (double)m_flTime - m_fOldTime; + m_flTimeDelta = (double)( m_flTime - m_fOldTime ); static float m_flShotTime = 0; // Clock was reset, reset delta @@ -97,7 +97,7 @@ int CHud::Redraw( float flTime, int intermission ) { // Take a screenshot if the client's got the cvar set if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) - m_flShotTime = flTime + 1.0; // Take a screenshot in a second + m_flShotTime = flTime + 1.0f; // Take a screenshot in a second } if( m_flShotTime && m_flShotTime < flTime ) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index b86834af..f666b5e6 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -69,10 +69,10 @@ void SpectatorSpray( void ) VectorScale( forward, 128, forward ); VectorAdd( forward, v_origin, forward ); pmtrace_t * trace = gEngfuncs.PM_TraceLine( v_origin, forward, PM_TRACELINE_PHYSENTSONLY, 2, -1 ); - if( trace->fraction != 1.0 ) + if( trace->fraction != 1.0f ) { sprintf( string, "drc_spray %.2f %.2f %.2f %i", - trace->endpos[0], trace->endpos[1], trace->endpos[2], trace->ent ); + (double)trace->endpos[0], (double)trace->endpos[1], (double)trace->endpos[2], trace->ent ); gEngfuncs.pfnServerCmd( string ); } } @@ -355,7 +355,7 @@ int CHudSpectator::Draw( float flTime ) int lx; char string[256]; - float * color; + float *color; // draw only in spectator mode if( !g_iUser1 ) @@ -821,7 +821,7 @@ bool CHudSpectator::IsActivePlayer( cl_entity_t *ent ) bool CHudSpectator::ParseOverviewFile() { char filename[512] = { 0 }; - char levelname[255] = { 0 }; + char levelname[256] = { 0 }; char token[1024] = { 0 }; float height; @@ -987,15 +987,15 @@ void CHudSpectator::DrawOverviewLayer() float screenaspect, xs, ys, xStep, yStep, x, y, z; int ix, iy, i, xTiles, yTiles, frame; - qboolean hasMapImage = m_MapSprite?TRUE:FALSE; - model_t * dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap); + qboolean hasMapImage = m_MapSprite ? TRUE : FALSE; + model_t *dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap ); - if ( hasMapImage) + if( hasMapImage ) { - i = m_MapSprite->numframes / (4*3); - i = sqrt(float(i)); - xTiles = i*4; - yTiles = i*3; + i = m_MapSprite->numframes / ( 4 * 3 ); + i = sqrt( float( i ) ); + xTiles = i * 4; + yTiles = i * 3; } else { @@ -1014,7 +1014,7 @@ void CHudSpectator::DrawOverviewLayer() gEngfuncs.pTriAPI->RenderMode( kRenderTransTexture ); gEngfuncs.pTriAPI->CullFace( TRI_NONE ); - gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); + gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f ); frame = 0; @@ -1143,7 +1143,7 @@ void CHudSpectator::DrawOverviewEntities() gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); + gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f ); gEngfuncs.pTriAPI->TexCoord2f(1, 0); VectorMA( origin, 16.0f * sizeScale, up, point ); @@ -1183,28 +1183,28 @@ void CHudSpectator::DrawOverviewEntities() hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprBeam ); gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); - gEngfuncs.pTriAPI->Color4f( r, g, b, 0.3 ); + gEngfuncs.pTriAPI->Color4f( r, g, b, 0.3f ); gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] + 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] - 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] - 4, z ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] + 4, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] + 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] - 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] - 4.0f, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] + 4.0f, z ); gEngfuncs.pTriAPI->End(); gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] + 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] - 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] - 4, z ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] + 4, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] + 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] - 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] - 4.0f, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] + 4.0f, z ); gEngfuncs.pTriAPI->End(); // calculate screen position for name and infromation in hud::draw() @@ -1265,7 +1265,7 @@ void CHudSpectator::DrawOverviewEntities() gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); - gEngfuncs.pTriAPI->Color4f( r, g, b, 1.0 ); + gEngfuncs.pTriAPI->Color4f( r, g, b, 1.0f ); AngleVectors( angles, forward, NULL, NULL ); VectorScale( forward, 512.0f, forward ); @@ -1282,13 +1282,13 @@ void CHudSpectator::DrawOverviewEntities() VectorTransform( forward, rmatrix , left ); gEngfuncs.pTriAPI->Begin( TRI_TRIANGLES ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); gEngfuncs.pTriAPI->Vertex3f( x + right[0], y + right[1], ( z + right[2] ) * zScale); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); gEngfuncs.pTriAPI->Vertex3f( x, y, z * zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); gEngfuncs.pTriAPI->Vertex3f( x + left[0], y + left[1], ( z + left[2] ) * zScale ); gEngfuncs.pTriAPI->End (); } @@ -1329,7 +1329,7 @@ void CHudSpectator::CheckOverviewEntities() bool CHudSpectator::AddOverviewEntity( int type, struct cl_entity_s *ent, const char *modelname) { HSPRITE hSprite = 0; - double duration = -1.0f; // duration -1 means show it only this frame; + double duration = -1.0; // duration -1 means show it only this frame; if( !ent ) return false; diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index 12ad41f4..3b089577 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -28,16 +28,16 @@ extern cl_enginefunc_t gEngfuncs; //-------------------------------------------------- Constants -#define CAM_DIST_DELTA 1.0 -#define CAM_ANGLE_DELTA 2.5 -#define CAM_ANGLE_SPEED 2.5 -#define CAM_MIN_DIST 30.0 -#define CAM_ANGLE_MOVE .5 -#define MAX_ANGLE_DIFF 10.0 -#define PITCH_MAX 90.0 -#define PITCH_MIN 0 -#define YAW_MAX 135.0 -#define YAW_MIN -135.0 +#define CAM_DIST_DELTA 1.0f +#define CAM_ANGLE_DELTA 2.5f +#define CAM_ANGLE_SPEED 2.5f +#define CAM_MIN_DIST 30.0f +#define CAM_ANGLE_MOVE 0.5f +#define MAX_ANGLE_DIFF 10.0f +#define PITCH_MAX 90.0f +#define PITCH_MIN 0.0f +#define YAW_MAX 135.0f +#define YAW_MIN -135.0f enum ECAM_Command { @@ -91,35 +91,35 @@ float MoveToward( float cur, float goal, float maxspeed ) { if( cur != goal ) { - if( fabs( cur - goal ) > 180.0 ) + if( fabs( cur - goal ) > 180.0f ) { if( cur < goal ) - cur += 360.0; + cur += 360.0f; else - cur -= 360.0; + cur -= 360.0f; } if( cur < goal ) { - if( cur < goal - 1.0 ) - cur += ( goal - cur ) / 4.0; + if( cur < goal - 1.0f ) + cur += ( goal - cur ) * 0.25f; else cur = goal; } else { - if( cur > goal + 1.0 ) - cur -= ( cur - goal ) / 4.0; + if( cur > goal + 1.0f ) + cur -= ( cur - goal ) * 0.25f; else cur = goal; } } // bring cur back into range - if( cur < 0 ) - cur += 360.0; - else if( cur >= 360 ) - cur -= 360; + if( cur < 0.0f ) + cur += 360.0f; + else if( cur >= 360.0f ) + cur -= 360.0f; return cur; } @@ -172,7 +172,7 @@ void DLLEXPORT CAM_Think( void ) if( cam_contain->value ) { gEngfuncs.GetClientOrigin( origin ); - ext[0] = ext[1] = ext[2] = 0.0; + ext[0] = ext[1] = ext[2] = 0.0f; } #endif camAngles[PITCH] = cam_idealpitch->value; @@ -195,7 +195,7 @@ void DLLEXPORT CAM_Think( void ) //keep the camera within certain limits around the player (ie avoid certain bad viewing angles) if( cam_mouse.x>gEngfuncs.GetWindowCenterX() ) { - //if( ( camAngles[YAW] >= 225.0 ) || ( camAngles[YAW] < 135.0 ) ) + //if( ( camAngles[YAW] >= 225.0f ) || ( camAngles[YAW] < 135.0f ) ) if( camAngles[YAW] < c_maxyaw->value ) { camAngles[YAW] += CAM_ANGLE_MOVE * ( ( cam_mouse.x - gEngfuncs.GetWindowCenterX() ) / 2 ); @@ -207,7 +207,7 @@ void DLLEXPORT CAM_Think( void ) } else if( cam_mouse.x 225.0 ) ) + //if( ( camAngles[YAW] <= 135.0f ) || ( camAngles[YAW] > 225.0f ) ) if( camAngles[YAW] > c_minyaw->value ) { camAngles[YAW] -= CAM_ANGLE_MOVE * ( ( gEngfuncs.GetWindowCenterX() - cam_mouse.x ) / 2 ); @@ -363,10 +363,10 @@ void DLLEXPORT CAM_Think( void ) if( camAngles[PITCH] - viewangles[PITCH] != cam_idealpitch->value ) camAngles[PITCH] = MoveToward( camAngles[PITCH], cam_idealpitch->value + viewangles[PITCH], CAM_ANGLE_SPEED ); - if( fabs( camAngles[2] - cam_idealdist->value ) < 2.0 ) + if( fabs( camAngles[2] - cam_idealdist->value ) < 2.0f ) camAngles[2] = cam_idealdist->value; else - camAngles[2] += ( cam_idealdist->value - camAngles[2] ) / 4.0; + camAngles[2] += ( cam_idealdist->value - camAngles[2] ) * 0.25f; } #ifdef LATER if( cam_contain->value ) @@ -382,9 +382,9 @@ void DLLEXPORT CAM_Think( void ) // check line from r_refdef.vieworg to pnt memset( &clip, 0, sizeof(moveclip_t) ); - ext[0] = ext[1] = ext[2] = 0.0; + ext[0] = ext[1] = ext[2] = 0.0f; clip.trace = SV_ClipMoveToEntity( sv.edicts, r_refdef.vieworg, ext, ext, pnt ); - if( clip.trace.fraction != 1.0 ) + if( clip.trace.fraction != 1.0f ) return; } #endif diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index 628ff088..eab15acf 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -819,7 +819,7 @@ void DLLEXPORT CL_CreateMove( float frametime, struct usercmd_s *cmd, int active // clip to maxspeed spd = gEngfuncs.GetClientMaxspeed(); - if( spd != 0.0 ) + if( spd != 0.0f ) { // scale the 3 speeds so that the total velocity is not > cl.maxspeed float fmov = sqrt( ( cmd->forwardmove * cmd->forwardmove ) + ( cmd->sidemove * cmd->sidemove ) + ( cmd->upmove * cmd->upmove ) ); diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index 2ff572ee..2be1ffb3 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -82,42 +82,42 @@ void IN_ToggleButtons( float forwardmove, float sidemove ) } } - if( forwardmove > 0.7 && !( moveflags & F ) ) + if( forwardmove > 0.7f && !( moveflags & F ) ) { moveflags |= F; in_forward.state |= BUTTON_DOWN; } - if( forwardmove < 0.7 && ( moveflags & F ) ) + if( forwardmove < 0.7f && ( moveflags & F ) ) { moveflags &= ~F; in_forward.state &= ~BUTTON_DOWN; } - if( forwardmove < -0.7 && !( moveflags & B ) ) + if( forwardmove < -0.7f && !( moveflags & B ) ) { moveflags |= B; in_back.state |= BUTTON_DOWN; } - if( forwardmove > -0.7 && ( moveflags & B ) ) + if( forwardmove > -0.7f && ( moveflags & B ) ) { moveflags &= ~B; in_back.state &= ~BUTTON_DOWN; } - if( sidemove > 0.9 && !( moveflags & R ) ) + if( sidemove > 0.9f && !( moveflags & R ) ) { moveflags |= R; in_moveright.state |= BUTTON_DOWN; } - if( sidemove < 0.9 && ( moveflags & R ) ) + if( sidemove < 0.9f && ( moveflags & R ) ) { moveflags &= ~R; in_moveright.state &= ~BUTTON_DOWN; } - if( sidemove < -0.9 && !( moveflags & L ) ) + if( sidemove < -0.9f && !( moveflags & L ) ) { moveflags |= L; in_moveleft.state |= BUTTON_DOWN; } - if( sidemove > -0.9 && ( moveflags & L ) ) + if( sidemove > -0.9f && ( moveflags & L ) ) { moveflags &= ~L; in_moveleft.state &= ~BUTTON_DOWN; diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index bbd59d9a..15e62188 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -66,22 +66,22 @@ float CHudMessage::FadeBlend( float fadein, float fadeout, float hold, float loc float fadeTime = fadein + hold; float fadeBlend; - if( localTime < 0 ) + if( localTime < 0.0f ) return 0; if( localTime < fadein ) { - fadeBlend = 1 - ( ( fadein - localTime ) / fadein ); + fadeBlend = 1.0f - ( ( fadein - localTime ) / fadein ); } else if( localTime > fadeTime ) { - if( fadeout > 0 ) - fadeBlend = 1 - ( ( localTime - fadeTime ) / fadeout ); + if( fadeout > 0.0f ) + fadeBlend = 1.0f - ( ( localTime - fadeTime ) / fadeout ); else - fadeBlend = 0; + fadeBlend = 0.0f; } else - fadeBlend = 1; + fadeBlend = 1.0f; return fadeBlend; } @@ -91,14 +91,14 @@ int CHudMessage::XPosition( float x, int width, int totalWidth ) { int xPos; - if( x == -1 ) + if( x == -1.0f ) { xPos = ( ScreenWidth - width ) / 2; } else { - if( x < 0 ) - xPos = ( 1.0 + x ) * ScreenWidth - totalWidth; // Alight right + if( x < 0.0f ) + xPos = ( 1.0f + x ) * ScreenWidth - totalWidth; // Alight right else xPos = x * ScreenWidth; } @@ -116,12 +116,12 @@ int CHudMessage::YPosition( float y, int height ) int yPos; if( y == -1 ) // Centered? - yPos = ( ScreenHeight - height ) * 0.5; + yPos = ( ScreenHeight - height ) * 0.5f; else { // Alight bottom? if ( y < 0 ) - yPos = ( 1.0 + y ) * ScreenHeight - height; // Alight bottom + yPos = ( 1.0f + y ) * ScreenHeight - height; // Alight bottom else // align top yPos = y * ScreenHeight; } @@ -164,18 +164,20 @@ void CHudMessage::MessageScanNextChar( void ) float deltaTime = m_parms.time - m_parms.charTime; destRed = destGreen = destBlue = 0; - if ( m_parms.time > m_parms.fadeTime ) + if( m_parms.time > m_parms.fadeTime ) { blend = m_parms.fadeBlend; } - else if ( deltaTime > m_parms.pMessage->fxtime ) + else if( deltaTime > m_parms.pMessage->fxtime ) + { blend = 0; // pure dest + } else { destRed = m_parms.pMessage->r2; destGreen = m_parms.pMessage->g2; destBlue = m_parms.pMessage->b2; - blend = 255 - (deltaTime * (1.0/m_parms.pMessage->fxtime) * 255.0 + 0.5); + blend = 255 - ( deltaTime * ( 1.0f / m_parms.pMessage->fxtime) * 255.0f + 0.5f ); } } break; @@ -208,7 +210,7 @@ void CHudMessage::MessageScanStart( void ) if( m_parms.time < m_parms.pMessage->fadein ) { - m_parms.fadeBlend = ( ( m_parms.pMessage->fadein - m_parms.time ) * ( 1.0 / m_parms.pMessage->fadein ) * 255 ); + m_parms.fadeBlend = ( ( m_parms.pMessage->fadein - m_parms.time ) * ( 1.0f / m_parms.pMessage->fadein ) * 255 ); } else if( m_parms.time > m_parms.fadeTime ) { @@ -352,7 +354,7 @@ int CHudMessage::Draw( float fTime ) { pMessage = m_pMessages[i]; if( m_startTime[i] > gHUD.m_flTime ) - m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2; // Server takes 0.2 seconds to spawn, adjust for this + m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2f; // Server takes 0.2 seconds to spawn, adjust for this } } @@ -428,11 +430,11 @@ void CHudMessage::MessageAdd( const char *pName, float time ) g_pCustomMessage.g2 = 110; g_pCustomMessage.b2 = 0; g_pCustomMessage.a2 = 0; - g_pCustomMessage.x = -1; // Centered - g_pCustomMessage.y = 0.7; - g_pCustomMessage.fadein = 0.01; - g_pCustomMessage.fadeout = 1.5; - g_pCustomMessage.fxtime = 0.25; + g_pCustomMessage.x = -1.0f; // Centered + g_pCustomMessage.y = 0.7f; + g_pCustomMessage.fadein = 0.01f; + g_pCustomMessage.fadeout = 1.5f; + g_pCustomMessage.fxtime = 0.25f; g_pCustomMessage.holdtime = 5; g_pCustomMessage.pName = g_pCustomName; strcpy( g_pCustomText, pName ); @@ -452,9 +454,9 @@ void CHudMessage::MessageAdd( const char *pName, float time ) } // get rid of any other messages in same location (only one displays at a time) - if( fabs( tempMessage->y - m_pMessages[j]->y ) < 0.0001 ) + if( fabs( tempMessage->y - m_pMessages[j]->y ) < 0.0001f ) { - if ( fabs( tempMessage->x - m_pMessages[j]->x ) < 0.0001 ) + if( fabs( tempMessage->x - m_pMessages[j]->x ) < 0.0001f ) { m_pMessages[j] = NULL; } diff --git a/cl_dll/studio_util.cpp b/cl_dll/studio_util.cpp index 6e488dcb..7ac385fe 100644 --- a/cl_dll/studio_util.cpp +++ b/cl_dll/studio_util.cpp @@ -23,13 +23,13 @@ void AngleMatrix( const float *angles, float (*matrix)[4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI*2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI*2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI*2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -43,9 +43,9 @@ void AngleMatrix( const float *angles, float (*matrix)[4] ) matrix[0][2] = (cr * sp * cy + -sr * -sy); matrix[1][2] = (cr * sp * sy + -sr* cy); matrix[2][2] = cr * cp; - matrix[0][3] = 0.0; - matrix[1][3] = 0.0; - matrix[2][3] = 0.0; + matrix[0][3] = 0.0f; + matrix[1][3] = 0.0f; + matrix[2][3] = 0.0f; } /* @@ -73,9 +73,9 @@ CrossProduct */ void CrossProduct( const float *v1, const float *v2, float *cross ) { - cross[0] = v1[1]*v2[2] - v1[2]*v2[1]; - cross[1] = v1[2]*v2[0] - v1[0]*v2[2]; - cross[2] = v1[0]*v2[1] - v1[1]*v2[0]; + cross[0] = v1[1] * v2[2] - v1[2] * v2[1]; + cross[1] = v1[2] * v2[0] - v1[0] * v2[2]; + cross[2] = v1[0] * v2[1] - v1[1] * v2[0]; } /* @@ -139,13 +139,13 @@ void AngleQuaternion( float *angles, vec4_t quaternion ) float sr, sp, sy, cr, cp, cy; // FIXME: rescale the inputs to 1/2 angle - angle = angles[2] * 0.5; + angle = angles[2] * 0.5f; sy = sin( angle ); cy = cos( angle ); - angle = angles[1] * 0.5; + angle = angles[1] * 0.5f; sp = sin( angle ); cp = cos( angle ); - angle = angles[0] * 0.5; + angle = angles[0] * 0.5f; sr = sin( angle ); cr = cos( angle ); @@ -185,18 +185,18 @@ void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ) cosom = p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]; - if( ( 1.0 + cosom ) > 0.000001 ) + if( ( 1.0f + cosom ) > 0.000001f ) { - if( ( 1.0 - cosom ) > 0.000001 ) + if( ( 1.0f - cosom ) > 0.000001f ) { omega = acos( cosom ); sinom = sin( omega ); - sclp = sin( ( 1.0 - t ) * omega ) / sinom; + sclp = sin( ( 1.0f - t ) * omega ) / sinom; sclq = sin( t * omega ) / sinom; } else { - sclp = 1.0 - t; + sclp = 1.0f - t; sclq = t; } for( i = 0; i < 4; i++ ) @@ -210,8 +210,8 @@ void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ) qt[1] = q[0]; qt[2] = -q[3]; qt[3] = q[2]; - sclp = sin( ( 1.0 - t ) * ( 0.5 * M_PI ) ); - sclq = sin( t * ( 0.5 * M_PI ) ); + sclp = sin( ( 1.0f - t ) * ( 0.5f * M_PI_F ) ); + sclq = sin( t * ( 0.5f * M_PI_F ) ); for( i = 0; i < 3; i++ ) { qt[i] = sclp * p[i] + sclq * qt[i]; @@ -227,17 +227,17 @@ QuaternionMatrix */ void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] ) { - matrix[0][0] = 1.0 - 2.0 * quaternion[1] * quaternion[1] - 2.0 * quaternion[2] * quaternion[2]; - matrix[1][0] = 2.0 * quaternion[0] * quaternion[1] + 2.0 * quaternion[3] * quaternion[2]; - matrix[2][0] = 2.0 * quaternion[0] * quaternion[2] - 2.0 * quaternion[3] * quaternion[1]; + matrix[0][0] = 1.0f - 2.0f * quaternion[1] * quaternion[1] - 2.0f * quaternion[2] * quaternion[2]; + matrix[1][0] = 2.0f * quaternion[0] * quaternion[1] + 2.0f * quaternion[3] * quaternion[2]; + matrix[2][0] = 2.0f * quaternion[0] * quaternion[2] - 2.0f * quaternion[3] * quaternion[1]; - matrix[0][1] = 2.0 * quaternion[0] * quaternion[1] - 2.0 * quaternion[3] * quaternion[2]; - matrix[1][1] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[2] * quaternion[2]; - matrix[2][1] = 2.0 * quaternion[1] * quaternion[2] + 2.0 * quaternion[3] * quaternion[0]; + matrix[0][1] = 2.0f * quaternion[0] * quaternion[1] - 2.0f * quaternion[3] * quaternion[2]; + matrix[1][1] = 1.0f - 2.0f * quaternion[0] * quaternion[0] - 2.0f * quaternion[2] * quaternion[2]; + matrix[2][1] = 2.0f * quaternion[1] * quaternion[2] + 2.0f * quaternion[3] * quaternion[0]; - matrix[0][2] = 2.0 * quaternion[0] * quaternion[2] + 2.0 * quaternion[3] * quaternion[1]; - matrix[1][2] = 2.0 * quaternion[1] * quaternion[2] - 2.0 * quaternion[3] * quaternion[0]; - matrix[2][2] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[1] * quaternion[1]; + matrix[0][2] = 2.0f * quaternion[0] * quaternion[2] + 2.0f * quaternion[3] * quaternion[1]; + matrix[1][2] = 2.0f * quaternion[1] * quaternion[2] - 2.0f * quaternion[3] * quaternion[0]; + matrix[2][2] = 1.0f - 2.0f * quaternion[0] * quaternion[0] - 2.0f * quaternion[1] * quaternion[1]; } /* diff --git a/cl_dll/studio_util.h b/cl_dll/studio_util.h index 83de704c..12d165c5 100644 --- a/cl_dll/studio_util.h +++ b/cl_dll/studio_util.h @@ -13,6 +13,10 @@ #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + #ifndef PITCH // MOVEMENT INFO // up / down diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index 655bde64..fb03792c 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -30,6 +30,10 @@ #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + extern vec3_t vec3_origin; #ifdef _MSC_VER @@ -43,7 +47,7 @@ float Length( const float *v ) int i; float length; - length = 0; + length = 0.0f; for( i = 0; i < 3; i++ ) length += v[i] * v[i]; length = sqrt( length ); // FIXME @@ -55,29 +59,29 @@ void VectorAngles( const float *forward, float *angles ) { float tmp, yaw, pitch; - if( forward[1] == 0 && forward[0] == 0 ) + if( forward[1] == 0.0f && forward[0] == 0.0f ) { - yaw = 0; - if( forward[2] > 0 ) - pitch = 90; + yaw = 0.0f; + if( forward[2] > 0.0f ) + pitch = 90.0f; else - pitch = 270; + pitch = 270.0f; } else { - yaw = ( atan2( forward[1], forward[0]) * 180 / M_PI ); - if( yaw < 0 ) - yaw += 360; + yaw = ( atan2( forward[1], forward[0]) * 180.0f / M_PI_F ); + if( yaw < 0.0f ) + yaw += 360.0f; tmp = sqrt( forward[0] * forward[0] + forward[1] * forward[1] ); - pitch = ( atan2( forward[2], tmp ) * 180 / M_PI ); - if( pitch < 0 ) - pitch += 360; + pitch = ( atan2( forward[2], tmp ) * 180.0f / M_PI_F ); + if( pitch < 0.0f ) + pitch += 360.0f; } angles[0] = pitch; angles[1] = yaw; - angles[2] = 0; + angles[2] = 0.0f; } float VectorNormalize( float *v ) @@ -89,7 +93,7 @@ float VectorNormalize( float *v ) if( length ) { - ilength = 1 / length; + ilength = 1.0f / length; v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 2555d4a1..f67a994d 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -40,6 +40,10 @@ extern "C" #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + extern "C" { int CL_IsThirdPerson( void ); @@ -126,13 +130,13 @@ void V_NormalizeAngles( float *angles ) // Normalize angles for( i = 0; i < 3; i++ ) { - if( angles[i] > 180.0 ) + if( angles[i] > 180.0f ) { - angles[i] -= 360.0; + angles[i] -= 360.0f; } - else if( angles[i] < -180.0 ) + else if( angles[i] < -180.0f ) { - angles[i] += 360.0; + angles[i] += 360.0f; } } } @@ -160,13 +164,13 @@ void V_InterpolateAngles( float *start, float *end, float *output, float frac ) ang2 = end[i]; d = ang2 - ang1; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } output[i] = ang1 + d * frac; @@ -199,11 +203,11 @@ float V_CalcBob( struct ref_params_s *pparams ) if( cycle < cl_bobup->value ) { - cycle = M_PI * cycle / cl_bobup->value; + cycle = M_PI_F * cycle / cl_bobup->value; } else { - cycle = M_PI + M_PI * ( cycle - cl_bobup->value )/( 1.0 - cl_bobup->value ); + cycle = M_PI_F + M_PI_F * ( cycle - cl_bobup->value )/( 1.0f - cl_bobup->value ); } // bob is proportional to simulated velocity in the xy plane @@ -212,9 +216,9 @@ float V_CalcBob( struct ref_params_s *pparams ) vel[2] = 0; bob = sqrt( vel[0] * vel[0] + vel[1] * vel[1] ) * cl_bob->value; - bob = bob * 0.3 + bob * 0.7 * sin(cycle); - bob = Q_min( bob, 4 ); - bob = Q_max( bob, -7 ); + bob = bob * 0.3f + bob * 0.7f * sin(cycle); + bob = Q_min( bob, 4.0f ); + bob = Q_max( bob, -7.0f ); return bob; } @@ -234,7 +238,7 @@ float V_CalcRoll( vec3_t angles, vec3_t velocity, float rollangle, float rollspe AngleVectors( angles, forward, right, up ); side = DotProduct( velocity, right ); - sign = side < 0 ? -1 : 1; + sign = side < 0.0f ? -1.0f : 1.0f; side = fabs( side ); value = rollangle; @@ -290,11 +294,11 @@ void V_CalcGunAngle( struct ref_params_s *pparams ) return; viewent->angles[YAW] = pparams->viewangles[YAW] + pparams->crosshairangle[YAW]; - viewent->angles[PITCH] = -pparams->viewangles[PITCH] + pparams->crosshairangle[PITCH] * 0.25; + viewent->angles[PITCH] = -pparams->viewangles[PITCH] + pparams->crosshairangle[PITCH] * 0.25f; viewent->angles[ROLL] -= v_idlescale * sin( pparams->time * v_iroll_cycle.value ) * v_iroll_level.value; // don't apply all of the v_ipitch to prevent normally unseen parts of viewmodel from coming into view. - viewent->angles[PITCH] -= v_idlescale * sin( pparams->time * v_ipitch_cycle.value ) * ( v_ipitch_level.value * 0.5 ); + viewent->angles[PITCH] -= v_idlescale * sin( pparams->time * v_ipitch_cycle.value ) * ( v_ipitch_level.value * 0.5f ); viewent->angles[YAW] -= v_idlescale * sin( pparams->time * v_iyaw_cycle.value ) * v_iyaw_level.value; VectorCopy( viewent->angles, viewent->curstate.angles ); @@ -453,15 +457,15 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) } gEngfuncs.V_CalcShake(); - gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0 ); + gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0f ); // never let view origin sit exactly on a node line, because a water plane can // dissapear when viewed with the eye exactly on it. // FIXME, we send origin at 1/128 now, change this? // the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis - pparams->vieworg[0] += 1.0 / 32; - pparams->vieworg[1] += 1.0 / 32; - pparams->vieworg[2] += 1.0 / 32; + pparams->vieworg[0] += 1.0f / 32.0f; + pparams->vieworg[1] += 1.0f / 32.0f; + pparams->vieworg[2] += 1.0f / 32.0f; // Check for problems around water, move the viewer artificially if necessary // -- this prevents drawing errors in GL due to waves @@ -481,7 +485,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) pwater = gEngfuncs.GetEntityByIndex( waterEntity ); if( pwater && ( pwater->model != NULL ) ) { - waterDist += ( pwater->curstate.scale * 16 ); // Add in wave height + waterDist += ( pwater->curstate.scale * 16.0f ); // Add in wave height } } } @@ -553,7 +557,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) { vec3_t ofs; - ofs[0] = ofs[1] = ofs[2] = 0.0; + ofs[0] = ofs[1] = ofs[2] = 0.0f; CL_CameraOffset( (float *)&ofs ); @@ -586,18 +590,18 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) VectorAdd( view->origin, pparams->viewheight, view->origin ); // Let the viewmodel shake at about 10% of the amplitude - gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9 ); + gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9f ); for( i = 0; i < 3; i++ ) { - view->origin[i] += bob * 0.4 * pparams->forward[i]; + view->origin[i] += bob * 0.4f * pparams->forward[i]; } view->origin[2] += bob; // throw in a little tilt. - view->angles[YAW] -= bob * 0.5; - view->angles[ROLL] -= bob * 1; - view->angles[PITCH] -= bob * 0.3; + view->angles[YAW] -= bob * 0.5f; + view->angles[ROLL] -= bob * 1.0f; + view->angles[PITCH] -= bob * 0.3f; if( cl_viewbob && cl_viewbob->value ) VectorCopy( view->angles, view->curstate.angles ); @@ -605,25 +609,25 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // pushing the view origin down off of the same X/Z plane as the ent's origin will give the // gun a very nice 'shifting' effect when the player looks up/down. If there is a problem // with view model distortion, this may be a cause. (SJB). - view->origin[2] -= 1; + view->origin[2] -= 1.0f; // fudge position around to keep amount of weapon visible // roughly equal with different FOV - if( pparams->viewsize == 110 ) + if( pparams->viewsize == 110.0f ) { - view->origin[2] += 1; + view->origin[2] += 1.0f; } - else if( pparams->viewsize == 100 ) + else if( pparams->viewsize == 100.0f ) { - view->origin[2] += 2; + view->origin[2] += 2.0f; } - else if( pparams->viewsize == 90 ) + else if( pparams->viewsize == 90.0f ) { - view->origin[2] += 1; + view->origin[2] += 1.0f; } - else if( pparams->viewsize == 80 ) + else if( pparams->viewsize == 80.0f ) { - view->origin[2] += 0.5; + view->origin[2] += 0.5f; } // Add in the punchangle, if any @@ -636,7 +640,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // smooth out stair step ups #if 1 - if( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0 ) + if( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0.0f ) { float steptime; @@ -646,11 +650,11 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) //FIXME I_Error( "steptime < 0" ); steptime = 0; - oldz += steptime * 150; + oldz += steptime * 150.0f; if( oldz > pparams->simorg[2] ) oldz = pparams->simorg[2]; - if( pparams->simorg[2] - oldz > 18 ) - oldz = pparams->simorg[2]- 18; + if( pparams->simorg[2] - oldz > 18.0f ) + oldz = pparams->simorg[2]- 18.0f; pparams->vieworg[2] += oldz - pparams->simorg[2]; view->origin[2] += oldz - pparams->simorg[2]; } @@ -665,7 +669,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) VectorSubtract( pparams->simorg, lastorg, delta ); - if( Length( delta ) != 0.0 ) + if( Length( delta ) != 0.0f ) { VectorCopy( pparams->simorg, ViewInterp.Origins[ViewInterp.CurrentOrigin & ORIGIN_MASK] ); ViewInterp.OriginTime[ViewInterp.CurrentOrigin & ORIGIN_MASK] = pparams->time; @@ -682,9 +686,9 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) int foundidx; float t; - if( cl_vsmoothing->value < 0.0 ) + if( cl_vsmoothing->value < 0.0f ) { - gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); + gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0f ); } t = pparams->time - cl_vsmoothing->value; @@ -696,7 +700,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) break; } - if( i < ORIGIN_MASK && ViewInterp.OriginTime[foundidx & ORIGIN_MASK] != 0.0 ) + if( i < ORIGIN_MASK && ViewInterp.OriginTime[foundidx & ORIGIN_MASK] != 0.0f ) { // Interpolate vec3_t delta; @@ -713,7 +717,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) VectorMA( ViewInterp.Origins[foundidx & ORIGIN_MASK], frac, delta, neworg ); // Dont interpolate large changes - if( Length( delta ) < 64 ) + if( Length( delta ) < 64.0f ) { VectorSubtract( neworg, pparams->simorg, delta ); @@ -735,13 +739,13 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) float pitch = camAngles[0]; // Normalize angles - if( pitch > 180 ) - pitch -= 360.0; - else if( pitch < -180 ) - pitch += 360; + if( pitch > 180.0f ) + pitch -= 360.0f; + else if( pitch < -180.0f ) + pitch += 360.0f; // Player pitch is inverted - pitch /= -3.0; + pitch /= -3.0f; // Slam local player's pitch value ent->angles[0] = pitch; @@ -796,7 +800,7 @@ void V_SmoothInterpolateAngles( float * startAngle, float * endAngle, float * fi { frac = degreesPerSec * v_frametime; - threshhold= degreesPerSec / 4; + threshhold= degreesPerSec / 4.0f; if( absd < threshhold ) { @@ -811,7 +815,7 @@ void V_SmoothInterpolateAngles( float * startAngle, float * endAngle, float * fi } else { - if( d > 0 ) + if( d > 0.0f ) finalAngle[i] = startAngle[i] + frac; else finalAngle[i] = startAngle[i] - frac; @@ -907,7 +911,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player // get new angle towards second target if( ent2 ) @@ -921,7 +925,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r // if no second target is given, look down to dead player newAngle[0] = 90.0f; newAngle[1] = 0.0f; - newAngle[2] = 0; + newAngle[2] = 0.0f; } // and smooth view @@ -962,12 +966,12 @@ void V_GetSingleTargetCam( cl_entity_t * ent1, float * angle, float * origin ) if( ent1->player ) { if( deadPlayer ) - newOrigin[2] += 2; //laying on ground + newOrigin[2] += 2.0f; //laying on ground else - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player } else - newOrigin[2]+= 8; // object, tricky, must be above bomb in CS + newOrigin[2]+= 8.0f; // object, tricky, must be above bomb in CS // we have no second target, choose view direction based on // show front of primary target @@ -1005,13 +1009,13 @@ float MaxAngleBetweenAngles( float *a1, float *a2 ) for( int i = 0; i < 3; i++ ) { d = a2[i] - a1[i]; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } d = fabs( d ); @@ -1046,9 +1050,9 @@ void V_GetDoubleTargetsCam( cl_entity_t *ent1, cl_entity_t *ent2, float *angle, VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player else - newOrigin[2] += 8; // object, tricky, must be above bomb in CS + newOrigin[2] += 8.0f; // object, tricky, must be above bomb in CS // get new angle towards second target VectorSubtract( ent2->origin, ent1->origin, newAngle ); @@ -1151,9 +1155,9 @@ void V_GetDirectedChasePosition(cl_entity_t *ent1, cl_entity_t *ent2,float *angl VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player else - newOrigin[2] += 8; // object, tricky, must be above bomb in CS + newOrigin[2] += 8.0f; // object, tricky, must be above bomb in CS V_GetChaseOrigin( angle, newOrigin, distance, origin ); } @@ -1192,14 +1196,14 @@ void V_GetChasePos( int target, float *cl_angles, float *origin, float *angles ) if( cl_angles == NULL ) // no mouse angles given, use entity angles ( locked mode ) { VectorCopy( ent->angles, angles); - angles[0] *= -1; + angles[0] *= -1.0f; } else VectorCopy( cl_angles, angles ); VectorCopy( ent->origin, origin ); - origin[2] += 28; // DEFAULT_VIEWHEIGHT - some offset + origin[2] += 28.0f; // DEFAULT_VIEWHEIGHT - some offset V_GetChaseOrigin( angles, origin, cl_chasedist->value, origin ); } @@ -1234,15 +1238,15 @@ void V_GetInEyePos( int target, float *origin, float *angles ) if( ent->curstate.solid == SOLID_NOT ) { - angles[ROLL] = 80; // dead view angle - origin[2] += -8 ; // PM_DEAD_VIEWHEIGHT + angles[ROLL] = 80.0f; // dead view angle + origin[2] += -8.0f; // PM_DEAD_VIEWHEIGHT } else if( ent->curstate.usehull == 1 ) - origin[2] += 12; // VEC_DUCK_VIEW; + origin[2] += 12.0f; // VEC_DUCK_VIEW; else // exacty eye position can't be caluculated since it depends on // client values like cl_bobcycle, this offset matches the default values - origin[2] += 28; // DEFAULT_VIEWHEIGHT + origin[2] += 28.0f; // DEFAULT_VIEWHEIGHT } void V_GetMapFreePosition( float *cl_angles, float *origin, float *angles ) @@ -1306,7 +1310,7 @@ void V_GetMapChasePosition( int target, float *cl_angles, float *origin, float * VectorNormalize( forward ); - VectorMA( origin, -1536, forward, origin ); + VectorMA( origin, -1536.0f, forward, origin ); } int V_FindViewModelByWeaponModel( int weaponindex ) @@ -1565,8 +1569,8 @@ void V_DropPunchAngle( float frametime, float *ev_punchangle ) float len; len = VectorNormalize( ev_punchangle ); - len -= ( 10.0 + len * 0.5 ) * frametime; - len = Q_max( len, 0.0 ); + len -= ( 10.0f + len * 0.5f ) * (float)frametime; + len = Q_max( len, 0.0f ); VectorScale( ev_punchangle, len, ev_punchangle ); } @@ -1617,14 +1621,14 @@ float CalcFov( float fov_x, float width, float height ) float a; float x; - if( fov_x < 1 || fov_x > 179 ) - fov_x = 90; // error, set to 90 + if( fov_x < 1.0f || fov_x > 179.0f ) + fov_x = 90.0f; // error, set to 90 - x = width / tan( fov_x / 360 * M_PI ); + x = width / tan( fov_x / 360.0f * M_PI_F ); a = atan ( height / x ); - a = a * 360 / M_PI; + a = a * 360.0f / M_PI_F; return a; } @@ -1646,8 +1650,8 @@ void V_Move( int mx, int my ) fov = CalcFov( in_fov, (float)ScreenWidth, (float)ScreenHeight ); - c_x = (float)ScreenWidth / 2.0; - c_y = (float)ScreenHeight / 2.0; + c_x = (float)ScreenWidth / 2.0f; + c_y = (float)ScreenHeight / 2.0f; dx = (float)mx - c_x; dy = (float)my - c_y; @@ -1656,8 +1660,8 @@ void V_Move( int mx, int my ) fx = dx / c_x; fy = dy / c_y; - dX = fx * in_fov / 2.0 ; - dY = fy * fov / 2.0; + dX = fx * in_fov / 2.0f; + dY = fy * fov / 2.0f; newangles = v_angles; @@ -1672,10 +1676,10 @@ void V_Move( int mx, int my ) // Trace tr = *( gEngfuncs.PM_TraceLine( (float *)&v_origin, (float *)&farpoint, PM_TRACELINE_PHYSENTSONLY, 2 /*point sized hull*/, -1 ) ); - if( tr.fraction != 1.0 && tr.ent != 0 ) + if( tr.fraction != 1.0f && tr.ent != 0 ) { hitent = PM_GetPhysEntInfo( tr.ent ); - PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0 ); + PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0f, 0.0f ); } else { diff --git a/common/mathlib.h b/common/mathlib.h index 6bcf76eb..999efc35 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -32,6 +32,10 @@ typedef vec_t vec4_t[4]; // x,y,z,w #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + struct mplane_s; extern vec3_t vec3_origin; diff --git a/dlls/aflock.cpp b/dlls/aflock.cpp index d50a8165..f69a99a9 100644 --- a/dlls/aflock.cpp +++ b/dlls/aflock.cpp @@ -22,7 +22,7 @@ #include "squadmonster.h" #define AFLOCK_MAX_RECRUIT_RADIUS 1024 -#define AFLOCK_FLY_SPEED 125 +#define AFLOCK_FLY_SPEED 125.0f #define AFLOCK_TURN_RATE 75 #define AFLOCK_ACCELERATE 10 #define AFLOCK_CHECK_DIST 192 @@ -200,7 +200,7 @@ void CFlockingFlyerFlock::SpawnFlock( void ) vecSpot.x = RANDOM_FLOAT( -R, R ); vecSpot.y = RANDOM_FLOAT( -R, R ); - vecSpot.z = RANDOM_FLOAT( 0, 16 ); + vecSpot.z = RANDOM_FLOAT( 0.0f, 16.0f ); vecSpot = pev->origin + vecSpot; UTIL_SetOrigin( pBoid->pev, vecSpot ); @@ -211,7 +211,7 @@ void CFlockingFlyerFlock::SpawnFlock( void ) pBoid->pev->angles = pev->angles; pBoid->pev->frame = 0; - pBoid->pev->nextthink = gpGlobals->time + 0.2; + pBoid->pev->nextthink = gpGlobals->time + 0.2f; pBoid->SetThink( &CFlockingFlyer::IdleThink ); if( pBoid != pLeader ) @@ -229,7 +229,7 @@ void CFlockingFlyer::Spawn() SpawnCommonCode(); pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CFlockingFlyer::IdleThink ); } @@ -284,7 +284,7 @@ void CFlockingFlyer::Killed( entvars_t *pevAttacker, int iGib ) while( pSquad ) { - pSquad->m_flAlertTime = gpGlobals->time + 15; + pSquad->m_flAlertTime = gpGlobals->time + 15.0f; pSquad = (CFlockingFlyer *)pSquad->m_pSquadNext; } @@ -302,7 +302,7 @@ void CFlockingFlyer::Killed( entvars_t *pevAttacker, int iGib ) pev->movetype = MOVETYPE_TOSS; SetThink( &CFlockingFlyer::FallHack ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CFlockingFlyer::FallHack( void ) @@ -312,7 +312,7 @@ void CFlockingFlyer::FallHack( void ) if( !FClassnameIs ( pev->groundentity, "worldspawn" ) ) { pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -334,13 +334,13 @@ void CFlockingFlyer::SpawnCommonCode() pev->health = 1; m_fPathBlocked = FALSE;// obstacles will be detected - m_flFieldOfView = 0.2; + m_flFieldOfView = 0.2f; //SET_MODEL( ENT( pev ), "models/aflock.mdl" ); SET_MODEL( ENT( pev ), "models/boid.mdl" ); - //UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - UTIL_SetSize( pev, Vector( -5, -5, 0 ), Vector( 5, 5, 2 ) ); + //UTIL_SetSize( pev, Vector( 0.0f, 0.0f, 0.0f ), Vector( 0.0f, 0.0f, 0.0f ) ); + UTIL_SetSize( pev, Vector( -5.0f, -5.0f, 0.0f ), Vector( 5.0f, 5.0f, 2.0f ) ); } //========================================================= @@ -348,38 +348,38 @@ void CFlockingFlyer::SpawnCommonCode() void CFlockingFlyer::BoidAdvanceFrame() { float flapspeed = ( pev->speed - pev->armorvalue ) / AFLOCK_ACCELERATE; - pev->armorvalue = pev->armorvalue * .8 + pev->speed * .2; + pev->armorvalue = pev->armorvalue * 0.8f + pev->speed * 0.2f; - if( flapspeed < 0 ) + if( flapspeed < 0.0f ) flapspeed = -flapspeed; - if( flapspeed < 0.25 ) - flapspeed = 0.25; - if( flapspeed > 1.9 ) - flapspeed = 1.9; + if( flapspeed < 0.25f ) + flapspeed = 0.25f; + if( flapspeed > 1.9f ) + flapspeed = 1.9f; pev->framerate = flapspeed; // lean - pev->avelocity.x = -( pev->angles.x + flapspeed * 5 ); + pev->avelocity.x = -( pev->angles.x + flapspeed * 5.0f ); // bank pev->avelocity.z = -( pev->angles.z + pev->avelocity.y ); // pev->framerate = flapspeed; - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); } //========================================================= //========================================================= void CFlockingFlyer::IdleThink( void ) { - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; // see if there's a client in the same pvs as the monster if( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) { SetThink( &CFlockingFlyer::Start ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -388,7 +388,7 @@ void CFlockingFlyer::IdleThink( void ) //========================================================= void CFlockingFlyer::Start( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( IsLeader() ) { @@ -473,7 +473,7 @@ void CFlockingFlyer::SpreadFlock() // can average in a course that points away from the leader. flSpeed = pList->pev->velocity.Length(); pList->pev->velocity = pList->pev->velocity.Normalize(); - pList->pev->velocity = ( pList->pev->velocity + vecDir ) * 0.5; + pList->pev->velocity = ( pList->pev->velocity + vecDir ) * 0.5f; pList->pev->velocity = pList->pev->velocity * flSpeed; } @@ -529,28 +529,28 @@ BOOL CFlockingFlyer::FPathBlocked() // check for obstacle ahead UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } // extra wide checks - UTIL_TraceLine( pev->origin + gpGlobals->v_right * 12, pev->origin + gpGlobals->v_right * 12 + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin + gpGlobals->v_right * 12.0f, pev->origin + gpGlobals->v_right * 12.0f + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } - UTIL_TraceLine( pev->origin - gpGlobals->v_right * 12, pev->origin - gpGlobals->v_right * 12 + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin - gpGlobals->v_right * 12.0f, pev->origin - gpGlobals->v_right * 12.0f + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } - if( !fBlocked && gpGlobals->time - m_flLastBlockedTime > 6 ) + if( !fBlocked && gpGlobals->time - m_flLastBlockedTime > 6.0f ) { // not blocked, and it's been a few seconds since we've actually been blocked. m_flFakeBlockedTime = gpGlobals->time + RANDOM_LONG( 1, 3 ); @@ -570,7 +570,7 @@ void CFlockingFlyer::FlockLeaderThink( void ) float flLeftSide; float flRightSide; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; UTIL_MakeVectors( pev->angles ); @@ -587,7 +587,7 @@ void CFlockingFlyer::FlockLeaderThink( void ) m_fPathBlocked = FALSE; if( pev->speed <= AFLOCK_FLY_SPEED ) - pev->speed += 5; + pev->speed += 5.0f; pev->velocity = gpGlobals->v_forward * pev->speed; @@ -643,8 +643,8 @@ void CFlockingFlyer::FlockLeaderThink( void ) // check and make sure we aren't about to plow into the ground, don't let it happen UTIL_TraceLine( pev->origin, pev->origin - gpGlobals->v_up * 16, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 && pev->velocity.z < 0 ) - pev->velocity.z = 0; + if( tr.flFraction != 1.0f && pev->velocity.z < 0.0f ) + pev->velocity.z = 0.0f; // maybe it did, though. if( FBitSet( pev->flags, FL_ONGROUND ) ) @@ -675,7 +675,7 @@ void CFlockingFlyer::FlockFollowerThink( void ) Vector vecDirToLeader; float flDistToLeader; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( IsLeader() || !InSquad() ) { @@ -698,19 +698,19 @@ void CFlockingFlyer::FlockFollowerThink( void ) // if we're too far away, speed up if( flDistToLeader > AFLOCK_TOO_FAR ) { - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 1.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 1.5f; } // if we're too close, slow down else if( flDistToLeader < AFLOCK_TOO_CLOSE ) { - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5f; } } else { // wait up! the leader isn't out in front, so we slow down to let him pass - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5f; } SpreadFlock2(); @@ -722,13 +722,13 @@ void CFlockingFlyer::FlockFollowerThink( void ) if( flDistToLeader > AFLOCK_TOO_FAR ) { vecDirToLeader = vecDirToLeader.Normalize(); - pev->velocity = (pev->velocity + vecDirToLeader) * 0.5; + pev->velocity = (pev->velocity + vecDirToLeader) * 0.5f; } // clamp speeds and handle acceleration - if( m_flGoalSpeed > AFLOCK_FLY_SPEED * 2 ) + if( m_flGoalSpeed > AFLOCK_FLY_SPEED * 2.0f ) { - m_flGoalSpeed = AFLOCK_FLY_SPEED * 2; + m_flGoalSpeed = AFLOCK_FLY_SPEED * 2.0f; } if( pev->speed < m_flGoalSpeed ) @@ -783,7 +783,7 @@ void CFlockingFlyer::FlockFollowerThink( void ) // else slide left else { - m_vecAdjustedVelocity = gpGlobals->v_right * -1; + m_vecAdjustedVelocity = gpGlobals->v_right * -1.0f; } } return; diff --git a/dlls/agrunt.cpp b/dlls/agrunt.cpp index cb47ac65..28374a6b 100644 --- a/dlls/agrunt.cpp +++ b/dlls/agrunt.cpp @@ -64,7 +64,7 @@ int iAgruntMuzzleFlash; #define AGRUNT_AE_LEFT_PUNCH ( 12 ) #define AGRUNT_AE_RIGHT_PUNCH ( 13 ) -#define AGRUNT_MELEE_DIST 100 +#define AGRUNT_MELEE_DIST 100.0f class CAGrunt : public CSquadMonster { @@ -77,8 +77,8 @@ public: void HandleAnimEvent( MonsterEvent_t *pEvent ); void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -32, -32, 0 ); - pev->absmax = pev->origin + Vector( 32, 32, 85 ); + pev->absmin = pev->origin + Vector( -32.0f, -32.0f, 0.0f ); + pev->absmax = pev->origin + Vector( 32.0f, 32.0f, 85.0f ); } Schedule_t *GetSchedule( void ); @@ -219,7 +219,7 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir // hit armor if( pev->dmgtime != gpGlobals->time || ( RANDOM_LONG( 0, 10 ) < 1 ) ) { - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2 ) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1.0f, 2.0f ) ); pev->dmgtime = gpGlobals->time; } @@ -227,11 +227,11 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir { Vector vecTracerDir = vecDir; - vecTracerDir.x += RANDOM_FLOAT( -0.3, 0.3 ); - vecTracerDir.y += RANDOM_FLOAT( -0.3, 0.3 ); - vecTracerDir.z += RANDOM_FLOAT( -0.3, 0.3 ); + vecTracerDir.x += RANDOM_FLOAT( -0.3f, 0.3f ); + vecTracerDir.y += RANDOM_FLOAT( -0.3f, 0.3f ); + vecTracerDir.z += RANDOM_FLOAT( -0.3f, 0.3f ); - vecTracerDir = vecTracerDir * -512; + vecTracerDir = vecTracerDir * -512.0f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, ptr->vecEndPos ); WRITE_BYTE( TE_TRACER ); @@ -245,9 +245,9 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir MESSAGE_END(); } - flDamage -= 20; - if( flDamage <= 0 ) - flDamage = 0.1;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated + flDamage -= 20.0f; + if( flDamage <= 0.0f ) + flDamage = 0.1f;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated } else { @@ -263,7 +263,7 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir //========================================================= void CAGrunt::StopTalking( void ) { - m_flNextWordTime = m_flNextSpeakTime = gpGlobals->time + 10 + RANDOM_LONG( 0, 10 ); + m_flNextWordTime = m_flNextSpeakTime = gpGlobals->time + 10.0f + RANDOM_LONG( 0, 10 ); } //========================================================= @@ -285,7 +285,7 @@ BOOL CAGrunt::ShouldSpeak( void ) // if not going to talk because of this, put the talk time // into the future a bit, so we don't talk immediately after // going into combat - m_flNextSpeakTime = gpGlobals->time + 3; + m_flNextSpeakTime = gpGlobals->time + 3.0f; return FALSE; } } @@ -312,7 +312,7 @@ void CAGrunt::PrescheduleThink( void ) m_iLastWord = num; // play a new sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pIdleSounds[num], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pIdleSounds[num], 1.0f, ATTN_NORM ); // is this word our last? if( RANDOM_LONG( 1, 10 ) <= 1 ) @@ -322,7 +322,7 @@ void CAGrunt::PrescheduleThink( void ) } else { - m_flNextWordTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 1 ); + m_flNextWordTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 1.0f ); } } } @@ -335,7 +335,7 @@ void CAGrunt::DeathSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pDieSounds[RANDOM_LONG( 0, ARRAYSIZE( pDieSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pDieSounds[RANDOM_LONG( 0, ARRAYSIZE( pDieSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -345,7 +345,7 @@ void CAGrunt::AlertSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -355,7 +355,7 @@ void CAGrunt::AttackSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -368,11 +368,11 @@ void CAGrunt::PainSound( void ) return; } - m_flNextPainTime = gpGlobals->time + 0.6; + m_flNextPainTime = gpGlobals->time + 0.6f; StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -443,15 +443,15 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->effects = EF_MUZZLEFLASH; // make angles +-180 - if( angDir.x > 180 ) + if( angDir.x > 180.0f ) { - angDir.x = angDir.x - 360; + angDir.x = angDir.x - 360.0f; } SetBlending( 0, angDir.x ); GetAttachment( 0, vecArmPos, vecArmDir ); - vecArmPos = vecArmPos + vecDirToEnemy * 32; + vecArmPos = vecArmPos + vecDirToEnemy * 32.0f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecArmPos ); WRITE_BYTE( TE_SPRITE ); WRITE_COORD( vecArmPos.x ); // pos @@ -463,10 +463,10 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); CBaseEntity *pHornet = CBaseEntity::Create( "hornet", vecArmPos, UTIL_VecToAngles( vecDirToEnemy ), edict() ); - UTIL_MakeVectors ( pHornet->pev->angles ); - pHornet->pev->velocity = gpGlobals->v_forward * 300; + UTIL_MakeVectors( pHornet->pev->angles ); + pHornet->pev->velocity = gpGlobals->v_forward * 300.0f; - switch( RANDOM_LONG ( 0 , 2 ) ) + switch( RANDOM_LONG( 0, 2 ) ) { case 0: EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "agrunt/ag_fire1.wav", 1.0, ATTN_NORM, 0, 100 ); @@ -507,7 +507,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder1.wav", 1, ATTN_NORM, 0, 70 ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder3.wav", 1, ATTN_NORM, 0 ,70); + EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder3.wav", 1, ATTN_NORM, 0, 70 ); break; } break; @@ -518,17 +518,17 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.y = -25; - pHurt->pev->punchangle.x = 8; + pHurt->pev->punchangle.y = -25.0f; + pHurt->pev->punchangle.x = 8.0f; // OK to use gpGlobals without calling MakeVectors, cause CheckTraceHullAttack called it above. if( pHurt->IsPlayer() ) { // this is a player. Knock him around. - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 250; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -537,7 +537,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -547,17 +547,17 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.y = 25; - pHurt->pev->punchangle.x = 8; + pHurt->pev->punchangle.y = 25.0f; + pHurt->pev->punchangle.x = 8.0f; // OK to use gpGlobals without calling MakeVectors, cause CheckTraceHullAttack called it above. if( pHurt->IsPlayer() ) { // this is a player. Knock him around. - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * -250; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * -250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -566,7 +566,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -584,21 +584,21 @@ void CAGrunt::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/agrunt.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; pev->effects = 0; pev->health = gSkillData.agruntHealth; - m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.2f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; m_afCapability = 0; m_afCapability |= bits_CAP_SQUAD; - m_HackedGunPos = Vector( 24, 64, 48 ); + m_HackedGunPos = Vector( 24.0f, 64.0f, 48.0f ); - m_flNextSpeakTime = m_flNextWordTime = gpGlobals->time + 10 + RANDOM_LONG( 0, 10 ); + m_flNextSpeakTime = m_flNextWordTime = gpGlobals->time + 10.0f + RANDOM_LONG( 0, 10 ); MonsterInit(); } @@ -651,8 +651,8 @@ Task_t tlAGruntFail[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT, (float)2 }, - { TASK_WAIT_PVS, (float)0 }, + { TASK_WAIT, 2.0f }, + { TASK_WAIT_PVS, 0.0f }, }; Schedule_t slAGruntFail[] = @@ -674,8 +674,8 @@ Task_t tlAGruntCombatFail[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT_FACE_ENEMY, (float)2 }, - { TASK_WAIT_PVS, (float)0 }, + { TASK_WAIT_FACE_ENEMY, 2.0f }, + { TASK_WAIT_PVS, 0.0f }, }; Schedule_t slAGruntCombatFail[] = @@ -697,9 +697,9 @@ Schedule_t slAGruntCombatFail[] = //========================================================= Task_t tlAGruntStandoff[] = { - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT_FACE_ENEMY, (float)2 }, + { TASK_WAIT_FACE_ENEMY, 2.0f }, }; Schedule_t slAGruntStandoff[] = @@ -722,8 +722,8 @@ Schedule_t slAGruntStandoff[] = //========================================================= Task_t tlAGruntSuppressHornet[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, }; Schedule_t slAGruntSuppress[] = @@ -742,9 +742,9 @@ Schedule_t slAGruntSuppress[] = //========================================================= Task_t tlAGruntRangeAttack1[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, }; Schedule_t slAGruntRangeAttack1[] = @@ -788,13 +788,13 @@ Schedule_t slAGruntHiddenRangeAttack[] = //========================================================= Task_t tlAGruntTakeCoverFromEnemy[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_WAIT, (float)0.2 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_RUN_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_WAIT, 0.2f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_RUN_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_REMEMBER, (float)bits_MEMORY_INCOVER }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_FACE_ENEMY, 0.0f }, }; Schedule_t slAGruntTakeCoverFromEnemy[] = @@ -813,13 +813,13 @@ Schedule_t slAGruntTakeCoverFromEnemy[] = //========================================================= Task_t tlAGruntVictoryDance[] = { - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_SET_FAIL_SCHEDULE, (float)SCHED_AGRUNT_THREAT_DISPLAY }, - { TASK_WAIT, (float)0.2 }, - { TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_WAIT, 0.2f }, + { TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_CROUCH }, { TASK_PLAY_SEQUENCE, (float)ACT_VICTORY_DANCE }, { TASK_PLAY_SEQUENCE, (float)ACT_VICTORY_DANCE }, @@ -851,8 +851,8 @@ Schedule_t slAGruntVictoryDance[] = //========================================================= Task_t tlAGruntThreatDisplay[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_THREAT_DISPLAY }, }; @@ -909,7 +909,7 @@ BOOL CAGrunt::FCanCheckAttacks( void ) //========================================================= BOOL CAGrunt::CheckMeleeAttack1( float flDot, float flDist ) { - if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6 && m_hEnemy != 0 ) + if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6f && m_hEnemy != 0 ) { return TRUE; } @@ -930,7 +930,7 @@ BOOL CAGrunt::CheckRangeAttack1( float flDot, float flDist ) return m_fCanHornetAttack; } - if( HasConditions( bits_COND_SEE_ENEMY ) && flDist >= AGRUNT_MELEE_DIST && flDist <= 1024 && flDot >= 0.5 && NoFriendlyFire() ) + if( HasConditions( bits_COND_SEE_ENEMY ) && flDist >= AGRUNT_MELEE_DIST && flDist <= 1024.0f && flDot >= 0.5f && NoFriendlyFire() ) { TraceResult tr; Vector vecArmPos, vecArmDir; @@ -939,18 +939,18 @@ BOOL CAGrunt::CheckRangeAttack1( float flDot, float flDist ) // !!!LATER - we may wish to do something different for projectile weapons as opposed to instant-hit UTIL_MakeVectors( pev->angles ); GetAttachment( 0, vecArmPos, vecArmDir ); - //UTIL_TraceLine( vecArmPos, vecArmPos + gpGlobals->v_forward * 256, ignore_monsters, ENT( pev ), &tr ); + //UTIL_TraceLine( vecArmPos, vecArmPos + gpGlobals->v_forward * 256.0f, ignore_monsters, ENT( pev ), &tr ); UTIL_TraceLine( vecArmPos, m_hEnemy->BodyTarget( vecArmPos ), dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == m_hEnemy->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == m_hEnemy->edict() ) { - m_flNextHornetAttackCheck = gpGlobals->time + RANDOM_FLOAT( 2, 5 ); + m_flNextHornetAttackCheck = gpGlobals->time + RANDOM_FLOAT( 2.0f, 5.0f ); m_fCanHornetAttack = TRUE; return m_fCanHornetAttack; } } - m_flNextHornetAttackCheck = gpGlobals->time + 0.2;// don't check for half second if this check wasn't successful + m_flNextHornetAttackCheck = gpGlobals->time + 0.2f;// don't check for half second if this check wasn't successful m_fCanHornetAttack = FALSE; return m_fCanHornetAttack; } @@ -965,7 +965,7 @@ void CAGrunt::StartTask( Task_t *pTask ) case TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE: { UTIL_MakeVectors( pev->angles ); - if( BuildRoute( m_vecEnemyLKP - gpGlobals->v_forward * 50, bits_MF_TO_LOCATION, NULL ) ) + if( BuildRoute( m_vecEnemyLKP - gpGlobals->v_forward * 50.0f, bits_MF_TO_LOCATION, NULL ) ) { TaskComplete(); } @@ -995,20 +995,20 @@ void CAGrunt::StartTask( Task_t *pTask ) UTIL_VecToAngles( m_vecEnemyLKP - pev->origin ); - UTIL_TraceLine( Center() + gpGlobals->v_forward * 128, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() + gpGlobals->v_forward * 128.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin + gpGlobals->v_right * 128 ); + MakeIdealYaw( pev->origin + gpGlobals->v_right * 128.0f ); fSkip = TRUE; TaskComplete(); } if( !fSkip ) { - UTIL_TraceLine( Center() - gpGlobals->v_forward * 128, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() - gpGlobals->v_forward * 128.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin - gpGlobals->v_right * 128 ); + MakeIdealYaw( pev->origin - gpGlobals->v_right * 128.0f ); fSkip = TRUE; TaskComplete(); } @@ -1016,10 +1016,10 @@ void CAGrunt::StartTask( Task_t *pTask ) if( !fSkip ) { - UTIL_TraceLine( Center() + gpGlobals->v_forward * 256, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() + gpGlobals->v_forward * 256.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin + gpGlobals->v_right * 256 ); + MakeIdealYaw( pev->origin + gpGlobals->v_right * 256.0f ); fSkip = TRUE; TaskComplete(); } @@ -1027,10 +1027,10 @@ void CAGrunt::StartTask( Task_t *pTask ) if( !fSkip ) { - UTIL_TraceLine( Center() - gpGlobals->v_forward * 256, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() - gpGlobals->v_forward * 256.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin - gpGlobals->v_right * 256 ); + MakeIdealYaw( pev->origin - gpGlobals->v_right * 256.0f ); fSkip = TRUE; TaskComplete(); } diff --git a/dlls/animating.cpp b/dlls/animating.cpp index 95e8b86b..cab2c198 100644 --- a/dlls/animating.cpp +++ b/dlls/animating.cpp @@ -43,27 +43,27 @@ IMPLEMENT_SAVERESTORE( CBaseAnimating, CBaseDelay ) //========================================================= float CBaseAnimating::StudioFrameAdvance( float flInterval ) { - if( flInterval == 0.0 ) + if( flInterval == 0.0f ) { flInterval = gpGlobals->time - pev->animtime; - if( flInterval <= 0.001 ) + if( flInterval <= 0.001f ) { pev->animtime = gpGlobals->time; - return 0.0; + return 0.0f; } } if( !pev->animtime ) - flInterval = 0.0; + flInterval = 0.0f; pev->frame += flInterval * m_flFrameRate * pev->framerate; pev->animtime = gpGlobals->time; - if( pev->frame < 0.0 || pev->frame >= 256.0 ) + if( pev->frame < 0.0f || pev->frame >= 256.0f ) { if( m_fSequenceLoops ) - pev->frame -= (int)( pev->frame / 256.0 ) * 256.0; + pev->frame -= (int)( pev->frame / 256.0f ) * 256.0f; else - pev->frame = ( pev->frame < 0.0 ) ? 0 : 255; + pev->frame = ( pev->frame < 0.0f ) ? 0.0f : 255.0f; m_fSequenceFinished = TRUE; // just in case it wasn't caught in GetEvents } @@ -142,7 +142,7 @@ void CBaseAnimating::DispatchAnimEvents( float flInterval ) } // FIXME: I have to do this or some events get missed, and this is probably causing the problem below - flInterval = 0.1; + flInterval = 0.1f; // FIX: this still sometimes hits events twice float flStart = pev->frame + ( m_flLastEventCheck - pev->animtime ) * m_flFrameRate * pev->framerate; @@ -150,7 +150,7 @@ void CBaseAnimating::DispatchAnimEvents( float flInterval ) m_flLastEventCheck = pev->animtime + flInterval; m_fSequenceFinished = FALSE; - if( flEnd >= 256 || flEnd <= 0.0 ) + if( flEnd >= 256.0f || flEnd <= 0.0f ) m_fSequenceFinished = TRUE; int index = 0; @@ -258,7 +258,7 @@ void CBaseAnimating::SetSequenceBox( void ) { // expand box for rotation // find min / max for rotations - float yaw = pev->angles.y * ( M_PI / 180.0 ); + float yaw = pev->angles.y * ( M_PI_F / 180.0f ); Vector xvector, yvector; xvector.x = cos( yaw ); @@ -270,8 +270,8 @@ void CBaseAnimating::SetSequenceBox( void ) bounds[0] = mins; bounds[1] = maxs; - Vector rmin( 9999, 9999, 9999 ); - Vector rmax( -9999, -9999, -9999 ); + Vector rmin( 9999.0f, 9999.0f, 9999.0f ); + Vector rmax( -9999.0f, -9999.0f, -9999.0f ); Vector base, transformed; for( int i = 0; i <= 1; i++ ) @@ -304,8 +304,8 @@ void CBaseAnimating::SetSequenceBox( void ) } } } - rmin.z = 0; - rmax.z = rmin.z + 1; + rmin.z = 0.0f; + rmax.z = rmin.z + 1.0f; UTIL_SetSize( pev, rmin, rmax ); } } diff --git a/dlls/animation.cpp b/dlls/animation.cpp index 9f70f3d1..6ebddc01 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -226,8 +226,8 @@ void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float * if( pev->sequence >= pstudiohdr->numseq ) { - *pflFrameRate = 0.0; - *pflGroundSpeed = 0.0; + *pflFrameRate = 0.0f; + *pflGroundSpeed = 0.0f; return; } @@ -235,14 +235,14 @@ void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float * if( pseqdesc->numframes > 1 ) { - *pflFrameRate = 256 * pseqdesc->fps / ( pseqdesc->numframes - 1 ); + *pflFrameRate = 256.0f * pseqdesc->fps / ( pseqdesc->numframes - 1 ); *pflGroundSpeed = sqrt( pseqdesc->linearmovement[0] * pseqdesc->linearmovement[0] + pseqdesc->linearmovement[1] * pseqdesc->linearmovement[1] + pseqdesc->linearmovement[2] * pseqdesc->linearmovement[2] ); *pflGroundSpeed = *pflGroundSpeed * pseqdesc->fps / ( pseqdesc->numframes - 1 ); } else { - *pflFrameRate = 256.0; - *pflGroundSpeed = 0.0; + *pflFrameRate = 256.0f; + *pflGroundSpeed = 0.0f; } } @@ -279,13 +279,13 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve if( pseqdesc->numframes > 1 ) { - flStart *= ( pseqdesc->numframes - 1 ) / 256.0; - flEnd *= (pseqdesc->numframes - 1) / 256.0; + flStart *= ( pseqdesc->numframes - 1 ) / 256.0f; + flEnd *= (pseqdesc->numframes - 1) / 256.0f; } else { - flStart = 0; - flEnd = 1.0; + flStart = 0.0f; + flEnd = 1.0f; } for( ; index < pseqdesc->numevents; index++ ) @@ -333,19 +333,19 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu flValue = -flValue; // does the controller not wrap? - if( pbonecontroller->start + 359.0 >= pbonecontroller->end ) + if( pbonecontroller->start + 359.0f >= pbonecontroller->end ) { - if( flValue > ( ( pbonecontroller->start + pbonecontroller->end ) / 2.0 ) + 180 ) - flValue = flValue - 360; - if( flValue < ( ( pbonecontroller->start + pbonecontroller->end) / 2.0 ) - 180 ) - flValue = flValue + 360; + if( flValue > ( ( pbonecontroller->start + pbonecontroller->end ) * 0.5f ) + 180.0f ) + flValue = flValue - 360.0f; + if( flValue < ( ( pbonecontroller->start + pbonecontroller->end ) * 0.5f ) - 180.0f ) + flValue = flValue + 360.0f; } else { - if( flValue > 360 ) - flValue = flValue - (int)( flValue / 360.0 ) * 360.0; - else if( flValue < 0 ) - flValue = flValue + (int)( ( flValue / -360.0 ) + 1 ) * 360.0; + if( flValue > 360.0f ) + flValue = flValue - (int)( flValue / 360.0f ) * 360.0f; + else if( flValue < 0.0f ) + flValue = flValue + (int)( ( flValue / -360.0f ) + 1.0f ) * 360.0f; } } @@ -357,7 +357,7 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu setting = 255; pev->controller[iController] = setting; - return setting * ( 1.0 / 255.0 ) * (pbonecontroller->end - pbonecontroller->start ) + pbonecontroller->start; + return setting * ( 1.0f / 255.0f ) * (pbonecontroller->end - pbonecontroller->start ) + pbonecontroller->start; } float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) @@ -382,12 +382,12 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) flValue = -flValue; // does the controller not wrap? - if( pseqdesc->blendstart[iBlender] + 359.0 >= pseqdesc->blendend[iBlender] ) + if( pseqdesc->blendstart[iBlender] + 359.0f >= pseqdesc->blendend[iBlender] ) { - if( flValue > ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) / 2.0 ) + 180 ) - flValue = flValue - 360; - if( flValue < ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) / 2.0 ) - 180 ) - flValue = flValue + 360; + if( flValue > ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) * 0.5f ) + 180.0f ) + flValue = flValue - 360.0f; + if( flValue < ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) * 0.5f ) - 180.0f ) + flValue = flValue + 360.0f; } } @@ -400,7 +400,7 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) pev->blending[iBlender] = setting; - return setting * ( 1.0 / 255.0 ) * ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] ) + pseqdesc->blendstart[iBlender]; + return setting * ( 1.0f / 255.0f ) * ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] ) + pseqdesc->blendstart[iBlender]; } int FindTransition( void *pmodel, int iEndingAnim, int iGoalAnim, int *piDir ) diff --git a/dlls/apache.cpp b/dlls/apache.cpp index b3cfcf87..669724db 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -42,8 +42,8 @@ class CApache : public CBaseMonster void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -300, -300, -172 ); - pev->absmax = pev->origin + Vector( 300, 300, 8 ); + pev->absmin = pev->origin + Vector( -300.0f, -300.0f, -172.0f ); + pev->absmax = pev->origin + Vector( 300.0f, 300.0f, 8.0f ); } void EXPORT HuntThink( void ); @@ -123,14 +123,14 @@ void CApache::Spawn( void ) pev->solid = SOLID_BBOX; SET_MODEL( ENT( pev ), "models/apache.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, -64.0f ), Vector( 32.0f, 32.0f, 0.0f ) ); UTIL_SetOrigin( pev, pev->origin ); pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_AIM; pev->health = gSkillData.apacheHealth; - m_flFieldOfView = -0.707; // 270 degrees + m_flFieldOfView = -0.707f; // 270 degrees pev->sequence = 0; ResetSequenceInfo(); @@ -146,7 +146,7 @@ void CApache::Spawn( void ) { SetThink( &CApache::HuntThink ); SetTouch( &CApache::FlyTouch ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_iRockets = 10; @@ -178,47 +178,47 @@ void CApache::Precache( void ) void CApache::NullThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CApache::HuntThink ); SetTouch( &CApache::FlyTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( NULL ); } void CApache::Killed( entvars_t *pevAttacker, int iGib ) { pev->movetype = MOVETYPE_TOSS; - pev->gravity = 0.3; + pev->gravity = 0.3f; STOP_SOUND( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav" ); - UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, -64.0f ), Vector( 32.0f, 32.0f, 0.0f ) ); SetThink( &CApache::DyingThink ); SetTouch( &CApache::CrashTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->health = 0; pev->takedamage = DAMAGE_NO; if( pev->spawnflags & SF_NOWRECKAGE ) { - m_flNextRocket = gpGlobals->time + 4.0; + m_flNextRocket = gpGlobals->time + 4.0f; } else { - m_flNextRocket = gpGlobals->time + 15.0; + m_flNextRocket = gpGlobals->time + 15.0f; } } void CApache::DyingThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->avelocity = pev->avelocity * 1.02; + pev->avelocity = pev->avelocity * 1.02f; // still falling? if( m_flNextRocket > gpGlobals->time ) @@ -226,9 +226,9 @@ void CApache::DyingThink( void ) // random explosions MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_EXPLOSION ); // This just makes a dynamic light now - WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( RANDOM_LONG( 0, 29 ) + 30 ); // scale * 10 WRITE_BYTE( 12 ); // framerate @@ -238,15 +238,15 @@ void CApache::DyingThink( void ) // lots of smoke MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_SMOKE ); - WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 100 ); // scale * 10 WRITE_BYTE( 10 ); // framerate MESSAGE_END(); - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL ); @@ -283,19 +283,19 @@ void CApache::DyingThink( void ) // don't stop it we touch a entity pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } else { - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_EXPLOSION); // This just makes a dynamic light now WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 300 ); + WRITE_COORD( vecSpot.z + 300.0f ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( 250 ); // scale * 10 WRITE_BYTE( 8 ); // framerate @@ -307,7 +307,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( TE_SPRITE ); WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 256 ); + WRITE_COORD( vecSpot.z + 256.0f ); WRITE_SHORT( m_iExplode ); WRITE_BYTE( 120 ); // scale * 10 WRITE_BYTE( 255 ); // brightness @@ -318,7 +318,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( TE_SMOKE ); WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 512 ); + WRITE_COORD( vecSpot.z + 512.0f ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 250 ); // scale * 10 WRITE_BYTE( 5 ); // framerate @@ -346,7 +346,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( 0 ); // speed MESSAGE_END(); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0f, 0.3f ); RadiusDamage( pev->origin, pev, pev, 300, CLASS_NONE, DMG_BLAST ); @@ -354,22 +354,22 @@ void CApache::DyingThink( void ) { CBaseEntity *pWreckage = Create( "cycler_wreckage", pev->origin, pev->angles ); // SET_MODEL( ENT( pWreckage->pev ), STRING( pev->model ) ); - UTIL_SetSize( pWreckage->pev, Vector( -200, -200, -128 ), Vector( 200, 200, -32 ) ); + UTIL_SetSize( pWreckage->pev, Vector( -200.0f, -200.0f, -128.0f ), Vector( 200.0f, 200.0f, -32.0f ) ); pWreckage->pev->frame = pev->frame; pWreckage->pev->sequence = pev->sequence; pWreckage->pev->framerate = 0; - pWreckage->pev->dmgtime = gpGlobals->time + 5; + pWreckage->pev->dmgtime = gpGlobals->time + 5.0f; } // gibs - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); // position WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 64 ); + WRITE_COORD( vecSpot.z + 64.0f ); // size WRITE_COORD( 400 ); @@ -398,7 +398,7 @@ void CApache::DyingThink( void ) MESSAGE_END(); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -410,7 +410,7 @@ void CApache::FlyTouch( CBaseEntity *pOther ) TraceResult tr = UTIL_GetGlobalTrace(); // UNDONE, do a real bounce - pev->velocity = pev->velocity + tr.vecPlaneNormal * ( pev->velocity.Length() + 200 ); + pev->velocity = pev->velocity + tr.vecPlaneNormal * ( pev->velocity.Length() + 200.0f ); } } @@ -427,13 +427,13 @@ void CApache::CrashTouch( CBaseEntity *pOther ) void CApache::GibMonster( void ) { - // EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200 ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75f, ATTN_NORM, 0, 200 ); } void CApache::HuntThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; ShowDamage(); @@ -455,15 +455,15 @@ void CApache::HuntThink( void ) } // generic speed up - if( m_flGoalSpeed < 800 ) - m_flGoalSpeed += 5; + if( m_flGoalSpeed < 800.0f ) + m_flGoalSpeed += 5.0f; if( m_hEnemy != 0 ) { // ALERT( at_console, "%s\n", STRING( m_hEnemy->pev->classname ) ); if( FVisible( m_hEnemy ) ) { - if( m_flLastSeen < gpGlobals->time - 5 ) + if( m_flLastSeen < gpGlobals->time - 5.0f ) m_flPrevSeen = gpGlobals->time; m_flLastSeen = gpGlobals->time; m_posTarget = m_hEnemy->Center(); @@ -482,7 +482,7 @@ void CApache::HuntThink( void ) { // ALERT( at_console, "%.0f\n", flLength ); - if( flLength < 128 ) + if( flLength < 128.0f ) { m_pGoalEnt = UTIL_FindEntityByTargetname( NULL, STRING( m_pGoalEnt->pev->target ) ); if( m_pGoalEnt ) @@ -499,11 +499,11 @@ void CApache::HuntThink( void ) m_posDesired = pev->origin; } - if( flLength > 250 ) // 500 + if( flLength > 250.0f ) // 500 { - // float flLength2 = ( m_posTarget - pev->origin ).Length() * ( 1.5 - DotProduct( ( m_posTarget - pev->origin ).Normalize(), pev->velocity.Normalize() ) ); + // float flLength2 = ( m_posTarget - pev->origin ).Length() * ( 1.5f - DotProduct( ( m_posTarget - pev->origin ).Normalize(), pev->velocity.Normalize() ) ); // if( flLength2 < flLength ) - if( m_flLastSeen + 90 > gpGlobals->time && DotProduct( ( m_posTarget - pev->origin ).Normalize(), ( m_posDesired - pev->origin ).Normalize() ) > 0.25 ) + if( m_flLastSeen + 90.0f > gpGlobals->time && DotProduct( ( m_posTarget - pev->origin ).Normalize(), ( m_posDesired - pev->origin ).Normalize() ) > 0.25f ) { m_vecDesired = ( m_posTarget - pev->origin ).Normalize(); } @@ -520,47 +520,47 @@ void CApache::HuntThink( void ) Flight(); // ALERT( at_console, "%.0f %.0f %.0f\n", gpGlobals->time, m_flLastSeen, m_flPrevSeen ); - if( ( m_flLastSeen + 1 > gpGlobals->time ) && ( m_flPrevSeen + 2 < gpGlobals->time ) ) + if( ( m_flLastSeen + 1.0f > gpGlobals->time ) && ( m_flPrevSeen + 2.0f < gpGlobals->time ) ) { if( FireGun() ) { // slow down if we're fireing - if( m_flGoalSpeed > 400 ) - m_flGoalSpeed = 400; + if( m_flGoalSpeed > 400.0f ) + m_flGoalSpeed = 400.0f; } // don't fire rockets and gun on easy mode if( g_iSkillLevel == SKILL_EASY ) - m_flNextRocket = gpGlobals->time + 10.0; + m_flNextRocket = gpGlobals->time + 10.0f; } UTIL_MakeAimVectors( pev->angles ); - Vector vecEst = ( gpGlobals->v_forward * 800 + pev->velocity ).Normalize(); - // ALERT( at_console, "%d %d %d %4.2f\n", pev->angles.x < 0, DotProduct( pev->velocity, gpGlobals->v_forward ) > -100, m_flNextRocket < gpGlobals->time, DotProduct( m_vecTarget, vecEst ) ); + Vector vecEst = ( gpGlobals->v_forward * 800.0f + pev->velocity ).Normalize(); + // ALERT( at_console, "%d %d %d %4.2f\n", pev->angles.x < 0.0f, DotProduct( pev->velocity, gpGlobals->v_forward ) > -100.0f, m_flNextRocket < gpGlobals->time, DotProduct( m_vecTarget, vecEst ) ); if( ( m_iRockets % 2 ) == 1 ) { FireRocket(); - m_flNextRocket = gpGlobals->time + 0.5; + m_flNextRocket = gpGlobals->time + 0.5f; if( m_iRockets <= 0 ) { - m_flNextRocket = gpGlobals->time + 10; + m_flNextRocket = gpGlobals->time + 10.0f; m_iRockets = 10; } } - else if( pev->angles.x < 0 && DotProduct( pev->velocity, gpGlobals->v_forward ) > -100 && m_flNextRocket < gpGlobals->time ) + else if( pev->angles.x < 0.0f && DotProduct( pev->velocity, gpGlobals->v_forward ) > -100.0f && m_flNextRocket < gpGlobals->time ) { - if( m_flLastSeen + 60 > gpGlobals->time ) + if( m_flLastSeen + 60.0f > gpGlobals->time ) { if( m_hEnemy != 0 ) { // make sure it's a good shot - if( DotProduct( m_vecTarget, vecEst ) > .965 ) + if( DotProduct( m_vecTarget, vecEst ) > .965f ) { TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096, ignore_monsters, edict(), &tr ); - if( (tr.vecEndPos - m_posTarget ).Length() < 512 ) + UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096.0f, ignore_monsters, edict(), &tr ); + if( (tr.vecEndPos - m_posTarget ).Length() < 512.0f ) FireRocket(); } } @@ -568,9 +568,9 @@ void CApache::HuntThink( void ) { TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096, dont_ignore_monsters, edict(), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096.0f, dont_ignore_monsters, edict(), &tr ); // just fire when close - if( ( tr.vecEndPos - m_posTarget ).Length() < 512 ) + if( ( tr.vecEndPos - m_posTarget ).Length() < 512.0f ) FireRocket(); } } @@ -580,34 +580,34 @@ void CApache::HuntThink( void ) void CApache::Flight( void ) { // tilt model 5 degrees - Vector vecAdj = Vector( 5.0, 0, 0 ); + Vector vecAdj = Vector( 5.0f, 0.0f, 0.0f ); // estimate where I'll be facing in one seconds - UTIL_MakeAimVectors( pev->angles + pev->avelocity * 2 + vecAdj ); - // Vector vecEst1 = pev->origin + pev->velocity + gpGlobals->v_up * m_flForce - Vector( 0, 0, 384 ); + UTIL_MakeAimVectors( pev->angles + pev->avelocity * 2.0f + vecAdj ); + // Vector vecEst1 = pev->origin + pev->velocity + gpGlobals->v_up * m_flForce - Vector( 0.0f, 0.0f, 384.0f ); // float flSide = DotProduct( m_posDesired - vecEst1, gpGlobals->v_right ); float flSide = DotProduct( m_vecDesired, gpGlobals->v_right ); - if( flSide < 0 ) + if( flSide < 0.0f ) { - if( pev->avelocity.y < 60 ) + if( pev->avelocity.y < 60.0f ) { - pev->avelocity.y += 8; // 9 * ( 3.0 / 2.0 ); + pev->avelocity.y += 8.0f; // 9 * ( 3.0 / 2.0 ); } } else { - if( pev->avelocity.y > -60 ) + if( pev->avelocity.y > -60.0f ) { - pev->avelocity.y -= 8; // 9 * ( 3.0 / 2.0 ); + pev->avelocity.y -= 8.0f; // 9 * ( 3.0 / 2.0 ); } } - pev->avelocity.y *= 0.98; + pev->avelocity.y *= 0.98f; // estimate where I'll be in two seconds - UTIL_MakeAimVectors( pev->angles + pev->avelocity * 1 + vecAdj ); - Vector vecEst = pev->origin + pev->velocity * 2.0 + gpGlobals->v_up * m_flForce * 20 - Vector( 0, 0, 384 * 2 ); + UTIL_MakeAimVectors( pev->angles + pev->avelocity * 1.0f + vecAdj ); + Vector vecEst = pev->origin + pev->velocity * 2.0f + gpGlobals->v_up * m_flForce * 20.0f - Vector( 0.0f, 0.0f, 384.0f * 2.0f ); // add immediate force UTIL_MakeAimVectors( pev->angles + vecAdj ); @@ -615,11 +615,11 @@ void CApache::Flight( void ) pev->velocity.y += gpGlobals->v_up.y * m_flForce; pev->velocity.z += gpGlobals->v_up.z * m_flForce; // add gravity - pev->velocity.z -= 38.4; // 32ft/sec + pev->velocity.z -= 38.4f; // 32ft/sec float flSpeed = pev->velocity.Length(); - float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0 ), Vector( pev->velocity.x, pev->velocity.y, 0 ) ); + float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0.0f ), Vector( pev->velocity.x, pev->velocity.y, 0.0f ) ); if( flDir < 0 ) flSpeed = -flSpeed; @@ -629,62 +629,62 @@ void CApache::Flight( void ) float flSlip = -DotProduct( m_posDesired - vecEst, gpGlobals->v_right ); // fly sideways - if( flSlip > 0 ) + if( flSlip > 0.0f ) { - if( pev->angles.z > -30 && pev->avelocity.z > -15 ) - pev->avelocity.z -= 4; + if( pev->angles.z > -30.0f && pev->avelocity.z > -15.0f ) + pev->avelocity.z -= 4.0f; else - pev->avelocity.z += 2; + pev->avelocity.z += 2.0f; } else { - if( pev->angles.z < 30 && pev->avelocity.z < 15 ) - pev->avelocity.z += 4; + if( pev->angles.z < 30 && pev->avelocity.z < 15.0f ) + pev->avelocity.z += 4.0f; else - pev->avelocity.z -= 2; + pev->avelocity.z -= 2.0f; } // sideways drag - pev->velocity.x = pev->velocity.x * ( 1.0 - fabs( gpGlobals->v_right.x ) * 0.05 ); - pev->velocity.y = pev->velocity.y * ( 1.0 - fabs( gpGlobals->v_right.y ) * 0.05 ); - pev->velocity.z = pev->velocity.z * ( 1.0 - fabs( gpGlobals->v_right.z ) * 0.05 ); + pev->velocity.x = pev->velocity.x * ( 1.0f - fabs( gpGlobals->v_right.x ) * 0.05f ); + pev->velocity.y = pev->velocity.y * ( 1.0f - fabs( gpGlobals->v_right.y ) * 0.05f ); + pev->velocity.z = pev->velocity.z * ( 1.0f - fabs( gpGlobals->v_right.z ) * 0.05f ); // general drag - pev->velocity = pev->velocity * 0.995; + pev->velocity = pev->velocity * 0.995f; // apply power to stay correct height - if( m_flForce < 80 && vecEst.z < m_posDesired.z ) + if( m_flForce < 80.0f && vecEst.z < m_posDesired.z ) { - m_flForce += 12; + m_flForce += 12.0f; } - else if( m_flForce > 30 ) + else if( m_flForce > 30.0f ) { if( vecEst.z > m_posDesired.z ) - m_flForce -= 8; + m_flForce -= 8.0f; } // pitch forward or back to get to target - if( flDist > 0 && flSpeed < m_flGoalSpeed /* && flSpeed < flDist */ && pev->angles.x + pev->avelocity.x > -40 ) + if( flDist > 0.0f && flSpeed < m_flGoalSpeed /* && flSpeed < flDist */ && pev->angles.x + pev->avelocity.x > -40.0f ) { // ALERT( at_console, "F " ); // lean forward pev->avelocity.x -= 12.0; } - else if( flDist < 0 && flSpeed > -50 && pev->angles.x + pev->avelocity.x < 20 ) + else if( flDist < 0.0f && flSpeed > -50.0f && pev->angles.x + pev->avelocity.x < 20.0f ) { // ALERT( at_console, "B " ); // lean backward - pev->avelocity.x += 12.0; + pev->avelocity.x += 12.0f; } - else if( pev->angles.x + pev->avelocity.x > 0 ) + else if( pev->angles.x + pev->avelocity.x > 0.0f ) { // ALERT( at_console, "f " ); - pev->avelocity.x -= 4.0; + pev->avelocity.x -= 4.0f; } - else if( pev->angles.x + pev->avelocity.x < 0 ) + else if( pev->angles.x + pev->avelocity.x < 0.0f ) { // ALERT( at_console, "b " ); - pev->avelocity.x += 4.0; + pev->avelocity.x += 4.0f; } // ALERT( at_console, "%.0f %.0f : %.0f %.0f : %.0f %.0f : %.0f\n", pev->origin.x, pev->velocity.x, flDist, flSpeed, pev->angles.x, pev->avelocity.x, m_flForce ); @@ -693,8 +693,8 @@ void CApache::Flight( void ) // make rotor, engine sounds if( m_iSoundState == 0 ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0, 0.3, 0, 110 ); - // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", 0.5, 0.2, 0, 110 ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, 0, 110 ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", 0.5f, 0.2f, 0, 110 ); m_iSoundState = SND_CHANGE_PITCH; // hack for going through level transitions } @@ -708,22 +708,22 @@ void CApache::Flight( void ) { float pitch = DotProduct( pev->velocity - pPlayer->pev->velocity, ( pPlayer->pev->origin - pev->origin ).Normalize() ); - pitch = (int)( 100 + pitch / 50.0 ); + pitch = (int)( 100.0f + pitch / 50.0f ); - if( pitch > 250 ) - pitch = 250; - if( pitch < 50 ) - pitch = 50; - if( pitch == 100 ) - pitch = 101; + if( pitch > 250.0f ) + pitch = 250.0f; + if( pitch < 50.0f ) + pitch = 50.0f; + if( pitch == 100.0f ) + pitch = 101.0f; - float flVol = ( m_flForce / 100.0 ) + .1; - if( flVol > 1.0 ) - flVol = 1.0; + float flVol = ( m_flForce / 100.0f ) + 0.1f; + if( flVol > 1.0f ) + flVol = 1.0f; - EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0, 0.3, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); } - // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", flVol, 0.2, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", flVol, 0.2f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); // ALERT( at_console, "%.0f %.2f\n", pitch, flVol ); } @@ -731,27 +731,27 @@ void CApache::Flight( void ) void CApache::FireRocket( void ) { - static float side = 1.0; + static float side = 1.0f; if( m_iRockets <= 0 ) return; UTIL_MakeAimVectors( pev->angles ); - Vector vecSrc = pev->origin + 1.5 * ( gpGlobals->v_forward * 21 + gpGlobals->v_right * 70 * side + gpGlobals->v_up * -79 ); + Vector vecSrc = pev->origin + 1.5f * ( gpGlobals->v_forward * 21.0f + gpGlobals->v_right * 70.0f * side + gpGlobals->v_up * -79.0f ); switch( m_iRockets % 5 ) { case 0: - vecSrc = vecSrc + gpGlobals->v_right * 10; + vecSrc = vecSrc + gpGlobals->v_right * 10.0f; break; case 1: - vecSrc = vecSrc - gpGlobals->v_right * 10; + vecSrc = vecSrc - gpGlobals->v_right * 10.0f; break; case 2: - vecSrc = vecSrc + gpGlobals->v_up * 10; + vecSrc = vecSrc + gpGlobals->v_up * 10.0f; break; case 3: - vecSrc = vecSrc - gpGlobals->v_up * 10; + vecSrc = vecSrc - gpGlobals->v_up * 10.0f; break; case 4: break; @@ -769,7 +769,7 @@ void CApache::FireRocket( void ) CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() ); if( pRocket ) - pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100; + pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100.0f; m_iRockets--; @@ -794,23 +794,23 @@ BOOL CApache::FireGun() Vector angles = UTIL_VecToAngles( vecOut ); angles.x = -angles.x; - if( angles.y > 180 ) - angles.y = angles.y - 360; - if( angles.y < -180 ) - angles.y = angles.y + 360; - if( angles.x > 180 ) - angles.x = angles.x - 360; - if( angles.x < -180 ) - angles.x = angles.x + 360; + if( angles.y > 180.0f ) + angles.y = angles.y - 360.0f; + if( angles.y < -180.0f ) + angles.y = angles.y + 360.0f; + if( angles.x > 180.0f ) + angles.x = angles.x - 360.0f; + if( angles.x < -180.0f ) + angles.x = angles.x + 360.0f; if( angles.x > m_angGun.x ) - m_angGun.x = Q_min( angles.x, m_angGun.x + 12 ); + m_angGun.x = Q_min( angles.x, m_angGun.x + 12.0f ); if( angles.x < m_angGun.x ) - m_angGun.x = Q_max( angles.x, m_angGun.x - 12 ); + m_angGun.x = Q_max( angles.x, m_angGun.x - 12.0f ); if( angles.y > m_angGun.y ) - m_angGun.y = Q_min( angles.y, m_angGun.y + 12 ); + m_angGun.y = Q_min( angles.y, m_angGun.y + 12.0f ); if( angles.y < m_angGun.y ) - m_angGun.y = Q_max( angles.y, m_angGun.y - 12 ); + m_angGun.y = Q_max( angles.y, m_angGun.y - 12.0f ); m_angGun.y = SetBoneController( 0, m_angGun.y ); m_angGun.x = SetBoneController( 1, m_angGun.x ); @@ -819,11 +819,11 @@ BOOL CApache::FireGun() GetAttachment( 0, posBarrel, angBarrel ); Vector vecGun = ( posBarrel - posGun ).Normalize(); - if( DotProduct( vecGun, vecTarget ) > 0.98 ) + if( DotProduct( vecGun, vecTarget ) > 0.98f ) { #if 1 FireBullets( 1, posGun, vecGun, VECTOR_CONE_4DEGREES, 8192, BULLET_MONSTER_12MM, 1 ); - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3f ); #else static float flNext; TraceResult tr; @@ -840,7 +840,7 @@ BOOL CApache::FireGun() if( flNext < gpGlobals->time ) { - flNext = gpGlobals->time + 0.5; + flNext = gpGlobals->time + 0.5f; m_pBeam->SetStartPos( tr.vecEndPos ); } #endif @@ -882,14 +882,14 @@ int CApache::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float if( bitsDamageType & DMG_BLAST ) { - flDamage *= 2; + flDamage *= 2.0f; } /* - if( ( bitsDamageType & DMG_BULLET ) && flDamage > 50 ) + if( ( bitsDamageType & DMG_BULLET ) && flDamage > 50.0f ) { // clip bullet damage at 50 - flDamage = 50; + flDamage = 50.0f; } */ @@ -910,13 +910,13 @@ void CApache::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir { // ALERT( at_console, "%.0f\n", flDamage ); AddMultiDamage( pevAttacker, this, flDamage, bitsDamageType ); - m_iDoSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoSmokePuff = 3.0f + ( flDamage / 5.0f ); } else { // do half damage in the body - // AddMultiDamage( pevAttacker, this, flDamage / 2.0, bitsDamageType ); - UTIL_Ricochet( ptr->vecEndPos, 2.0 ); + // AddMultiDamage( pevAttacker, this, flDamage / 2.0f, bitsDamageType ); + UTIL_Ricochet( ptr->vecEndPos, 2.0f ); } } @@ -961,9 +961,9 @@ void CApacheHVR::Spawn( void ) UTIL_MakeAimVectors( pev->angles ); m_vecForward = gpGlobals->v_forward; - pev->gravity = 0.5; + pev->gravity = 0.5f; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->dmg = 150; } @@ -972,7 +972,7 @@ void CApacheHVR::Precache( void ) { PRECACHE_MODEL( "models/HVR.mdl" ); m_iTrail = PRECACHE_MODEL( "sprites/smoke.spr" ); - PRECACHE_SOUND("weapons/rocket1.wav"); + PRECACHE_SOUND( "weapons/rocket1.wav" ); } void CApacheHVR::IgniteThink( void ) @@ -983,7 +983,7 @@ void CApacheHVR::IgniteThink( void ) pev->effects |= EF_LIGHT; // make rocket sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5 ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5f ); // rocket trail MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1000,13 +1000,13 @@ void CApacheHVR::IgniteThink( void ) // set to accelerate SetThink( &CApacheHVR::AccelerateThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CApacheHVR::AccelerateThink( void ) { // check world boundaries - if( pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) + if( pev->origin.x < -4096.0f || pev->origin.x > 4096.0f || pev->origin.y < -4096.0f || pev->origin.y > 4096.0f || pev->origin.z < -4096.0f || pev->origin.z > 4096.0f ) { UTIL_Remove( this ); return; @@ -1014,14 +1014,14 @@ void CApacheHVR::AccelerateThink( void ) // accelerate float flSpeed = pev->velocity.Length(); - if( flSpeed < 1800 ) + if( flSpeed < 1800.0f ) { - pev->velocity = pev->velocity + m_vecForward * 200; + pev->velocity = pev->velocity + m_vecForward * 200.0f; } // re-aim pev->angles = UTIL_VecToAngles( pev->velocity ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } #endif diff --git a/dlls/barnacle.cpp b/dlls/barnacle.cpp index ecc1f5d4..8db34740 100644 --- a/dlls/barnacle.cpp +++ b/dlls/barnacle.cpp @@ -60,8 +60,8 @@ public: #ifdef BARNACLE_FIX_VISIBILITY void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -16, -16, -m_flCachedLength ); - pev->absmax = pev->origin + Vector( 16, 16, 0 ); + pev->absmin = pev->origin + Vector( -16.0f, -16.0f, -m_flCachedLength ); + pev->absmax = pev->origin + Vector( 16.0f, 16.0f, 0.0f ); } #endif }; @@ -117,7 +117,7 @@ void CBarnacle::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/barnacle.mdl" ); - UTIL_SetSize( pev, Vector( -16, -16, -32 ), Vector( 16, 16, 0 ) ); + UTIL_SetSize( pev, Vector( -16.0f, -16.0f, -32.0f ), Vector( 16.0f, 16.0f, 0.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_NONE; @@ -125,20 +125,20 @@ void CBarnacle::Spawn() m_bloodColor = BLOOD_COLOR_RED; pev->effects = EF_INVLIGHT; // take light from the ceiling pev->health = 25; - m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.5f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; - m_flKillVictimTime = 0; - m_flCachedLength = 32; // mins.z + m_flKillVictimTime = 0.0f; + m_flCachedLength = 32.0f; // mins.z m_cGibs = 0; m_fLiftingPrey = FALSE; - m_flTongueAdj = -100; + m_flTongueAdj = -100.0f; InitBoneControllers(); SetActivity( ACT_IDLE ); SetThink( &CBarnacle::BarnacleThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; UTIL_SetOrigin( pev, pev->origin ); } @@ -168,7 +168,7 @@ void CBarnacle::BarnacleThink( void ) UTIL_SetOrigin( pev, pev->origin ); } #endif - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_hEnemy != 0 ) { @@ -197,8 +197,8 @@ void CBarnacle::BarnacleThink( void ) vecNewEnemyOrigin.y = pev->origin.y; // guess as to where their neck is - vecNewEnemyOrigin.x -= 6 * cos( m_hEnemy->pev->angles.y * M_PI / 180.0 ); - vecNewEnemyOrigin.y -= 6 * sin( m_hEnemy->pev->angles.y * M_PI / 180.0 ); + vecNewEnemyOrigin.x -= 6.0f * cos( m_hEnemy->pev->angles.y * M_PI_F / 180.0f ); + vecNewEnemyOrigin.y -= 6.0f * sin( m_hEnemy->pev->angles.y * M_PI_F / 180.0f ); m_flAltitude -= BARNACLE_PULL_SPEED; vecNewEnemyOrigin.z += BARNACLE_PULL_SPEED; @@ -212,7 +212,7 @@ void CBarnacle::BarnacleThink( void ) pVictim = m_hEnemy->MyMonsterPointer(); - m_flKillVictimTime = gpGlobals->time + 10;// now that the victim is in place, the killing bite will be administered in 10 seconds. + m_flKillVictimTime = gpGlobals->time + 10.0f;// now that the victim is in place, the killing bite will be administered in 10 seconds. if( pVictim ) { @@ -228,7 +228,7 @@ void CBarnacle::BarnacleThink( void ) // prey is lifted fully into feeding position and is dangling there. pVictim = m_hEnemy->MyMonsterPointer(); - if( m_flKillVictimTime != -1 && gpGlobals->time > m_flKillVictimTime ) + if( m_flKillVictimTime != -1.0f && gpGlobals->time > m_flKillVictimTime ) { // kill! if( pVictim ) @@ -265,7 +265,7 @@ void CBarnacle::BarnacleThink( void ) // barnacle has no prey right now, so just idle and check to see if anything is touching the tongue. // If idle and no nearby client, don't think so often if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); // Stagger a bit to keep barnacles from thinking on the same frame + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1.0f, 1.5f ); // Stagger a bit to keep barnacles from thinking on the same frame if( m_fSequenceFinished ) { @@ -304,7 +304,7 @@ void CBarnacle::BarnacleThink( void ) EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "barnacle/bcl_alert2.wav", 1, ATTN_NORM ); SetSequenceByName( "attack1" ); - m_flTongueAdj = -20; + m_flTongueAdj = -20.0f; m_hEnemy = pTouchEnt; @@ -339,7 +339,7 @@ void CBarnacle::BarnacleThink( void ) // ALERT( at_console, "tounge %f\n", m_flAltitude + m_flTongueAdj ); SetBoneController( 0, -( m_flAltitude + m_flTongueAdj ) ); - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); } //========================================================= @@ -377,9 +377,9 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib ) SetActivity( ACT_DIESIMPLE ); SetBoneController( 0, 0 ); - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBarnacle::WaitTillDead ); } @@ -387,9 +387,9 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib ) //========================================================= void CBarnacle::WaitTillDead( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - float flInterval = StudioFrameAdvance( 0.1 ); + float flInterval = StudioFrameAdvance( 0.1f ); DispatchAnimEvents( flInterval ); if( m_fSequenceFinished ) @@ -421,21 +421,21 @@ void CBarnacle::Precache() // to see if any entity is touching it. Also stores the length // of the trace in the int pointer provided. //========================================================= -#define BARNACLE_CHECK_SPACING 8 +#define BARNACLE_CHECK_SPACING 8.0f CBaseEntity *CBarnacle::TongueTouchEnt( float *pflLength ) { TraceResult tr; float length; // trace once to hit architecture and see if the tongue needs to change position. - UTIL_TraceLine( pev->origin, pev->origin - Vector ( 0, 0, 2048 ), ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin - Vector ( 0.0f, 0.0f, 2048.0f ), ignore_monsters, ENT( pev ), &tr ); length = fabs( pev->origin.z - tr.vecEndPos.z ); if( pflLength ) { *pflLength = length; } - Vector delta = Vector( BARNACLE_CHECK_SPACING, BARNACLE_CHECK_SPACING, 0 ); + Vector delta = Vector( BARNACLE_CHECK_SPACING, BARNACLE_CHECK_SPACING, 0.0f ); Vector mins = pev->origin - delta; Vector maxs = pev->origin + delta; maxs.z = pev->origin.z; diff --git a/dlls/barney.cpp b/dlls/barney.cpp index 3fc5aef0..dd91de44 100644 --- a/dlls/barney.cpp +++ b/dlls/barney.cpp @@ -266,7 +266,7 @@ void CBarney::AlertSound( void ) { if( FOkToSpeak() ) { - PlaySentence( "BA_ATTACK", RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( "BA_ATTACK", RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); } } } @@ -305,22 +305,22 @@ void CBarney::SetYawSpeed( void ) //========================================================= BOOL CBarney::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist <= 1024 && flDot >= 0.5 ) + if( flDist <= 1024.0f && flDot >= 0.5f ) { if( gpGlobals->time > m_checkAttackTime ) { TraceResult tr; - Vector shootOrigin = pev->origin + Vector( 0, 0, 55 ); + Vector shootOrigin = pev->origin + Vector( 0.0f, 0.0f, 55.0f ); CBaseEntity *pEnemy = m_hEnemy; Vector shootTarget = ( ( pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin ) + m_vecEnemyLKP ); UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT( pev ), &tr ); - m_checkAttackTime = gpGlobals->time + 1; - if( tr.flFraction == 1.0 || ( tr.pHit != NULL && CBaseEntity::Instance( tr.pHit ) == pEnemy ) ) + m_checkAttackTime = gpGlobals->time + 1.0f; + if( tr.flFraction == 1.0f || ( tr.pHit != NULL && CBaseEntity::Instance( tr.pHit ) == pEnemy ) ) m_lastAttackCheck = TRUE; else m_lastAttackCheck = FALSE; - m_checkAttackTime = gpGlobals->time + 1.5; + m_checkAttackTime = gpGlobals->time + 1.5f; } return m_lastAttackCheck; } @@ -352,9 +352,9 @@ void CBarney::BarneyFirePistol( void ) pitchShift = 0; else pitchShift -= 5; - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "barney/ba_attack2.wav", 1, ATTN_NORM, 0, 100 + pitchShift ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "barney/ba_attack2.wav", 1.0f, ATTN_NORM, 0, 100 + pitchShift ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 384, 0.3 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 384, 0.3f ); // UNDONE: Reload? m_cAmmoLoaded--;// take away a bullet! @@ -402,7 +402,7 @@ void CBarney::Spawn() pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_RED; pev->health = gSkillData.barneyHealth; - pev->view_ofs = Vector ( 0, 0, 50 );// position of the eyes relative to monster's origin. + pev->view_ofs = Vector( 0.0f, 0.0f, 50.0f );// position of the eyes relative to monster's origin. m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so npc will notice player and say hello m_MonsterState = MONSTERSTATE_NONE; @@ -476,15 +476,15 @@ void CBarney::TalkInit() static BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) { Vector vecDir = reference - pevTest->origin; - vecDir.z = 0; + vecDir.z = 0.0f; vecDir = vecDir.Normalize(); Vector forward, angle; angle = pevTest->v_angle; - angle.x = 0; + angle.x = 0.0f; UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it - if( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so + if( DotProduct( forward, vecDir ) > 0.96f ) // +/- 15 degrees or so { return TRUE; } @@ -539,18 +539,18 @@ void CBarney::PainSound( void ) if( gpGlobals->time < m_painTime ) return; - m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 0.75 ); + m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 0.75f ); switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain1.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain1.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain2.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain2.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 2: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain3.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain3.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; } } @@ -563,10 +563,10 @@ void CBarney::DeathSound( void ) switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die1.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die1.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die2.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die2.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 2: EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die3.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); @@ -582,17 +582,17 @@ void CBarney::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir case HITGROUP_STOMACH: if (bitsDamageType & ( DMG_BULLET | DMG_SLASH | DMG_BLAST ) ) { - flDamage = flDamage / 2; + flDamage = flDamage * 0.5f; } break; case 10: if( bitsDamageType & ( DMG_BULLET | DMG_SLASH | DMG_CLUB ) ) { - flDamage -= 20; - if( flDamage <= 0 ) + flDamage -= 20.0f; + if( flDamage <= 0.0f ) { - UTIL_Ricochet( ptr->vecEndPos, 1.0 ); - flDamage = 0.01; + UTIL_Ricochet( ptr->vecEndPos, 1.0f ); + flDamage = 0.01f; } } diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 434d6134..d67d10f7 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -150,8 +150,8 @@ IMPLEMENT_SAVERESTORE( CBMortar, CBaseEntity ) #define bits_COND_NODE_SEQUENCE ( bits_COND_SPECIAL1 ) // pev->netname contains the name of a sequence to play // Attack distance constants -#define BIG_ATTACKDIST 170 -#define BIG_MORTARDIST 800 +#define BIG_ATTACKDIST 170.0f +#define BIG_MORTARDIST 800.0f #define BIG_MAXCHILDREN 20 // Max # of live headcrab children #define bits_MEMORY_CHILDPAIR ( bits_MEMORY_CUSTOM1 ) @@ -255,8 +255,8 @@ public: if( m_crabTime < gpGlobals->time && m_crabCount < BIG_MAXCHILDREN ) { // Don't spawn crabs inside each other - Vector mins = pev->origin - Vector( 32, 32, 0 ); - Vector maxs = pev->origin + Vector( 32, 32, 0 ); + Vector mins = pev->origin - Vector( 32.0f, 32.0f, 0.0f ); + Vector maxs = pev->origin + Vector( 32.0f, 32.0f, 0.0f ); CBaseEntity *pList[2]; int count = UTIL_EntitiesInBox( pList, 2, mins, maxs, FL_MONSTER ); @@ -275,8 +275,8 @@ public: void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -95, -95, 0 ); - pev->absmax = pev->origin + Vector( 95, 95, 190 ); + pev->absmin = pev->origin + Vector( -95.0f, -95.0f, 0.0f ); + pev->absmax = pev->origin + Vector( 95.0f, 95.0f, 190.0f ); } BOOL CheckMeleeAttack1( float flDot, float flDist ); // Slash @@ -418,6 +418,7 @@ void CBigMomma::SetYawSpeed( void ) break; default: ys = 90; + break; } pev->yaw_speed = ys; } @@ -440,9 +441,9 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) UTIL_MakeVectorsPrivate( pev->angles, forward, right, NULL ); - Vector center = pev->origin + forward * 128; - Vector mins = center - Vector( 64, 64, 0 ); - Vector maxs = center + Vector( 64, 64, 64 ); + Vector center = pev->origin + forward * 128.0f; + Vector mins = center - Vector( 64.0f, 64.0f, 0.0f ); + Vector maxs = center + Vector( 64.0f, 64.0f, 64.0f ); CBaseEntity *pList[8]; int count = UTIL_EntitiesInBox( pList, 8, mins, maxs, FL_MONSTER | FL_CLIENT ); @@ -460,22 +461,22 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { pHurt->TakeDamage( pev, pev, gSkillData.bigmommaDmgSlash, DMG_CRUSH | DMG_SLASH ); - pHurt->pev->punchangle.x = 15; + pHurt->pev->punchangle.x = 15.0f; switch( pEvent->event ) { case BIG_AE_MELEE_ATTACKBR: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150 ) + Vector( 0, 0, 250 ) - ( right * 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150.0f ) + Vector( 0.0f, 0.0f, 250.0f ) - ( right * 200.0f ); break; case BIG_AE_MELEE_ATTACKBL: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150 ) + Vector( 0, 0, 250 ) + ( right * 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150.0f ) + Vector( 0.0f, 0.0f, 250.0f ) + ( right * 200.0f ); break; case BIG_AE_MELEE_ATTACK1: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 220 ) + Vector( 0, 0, 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 220.0f ) + Vector( 0.0f, 0.0f, 200.0f ); break; } pHurt->pev->flags &= ~FL_ONGROUND; - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -515,10 +516,10 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) case BIG_AE_JUMP_FORWARD: ClearBits( pev->flags, FL_ONGROUND ); - UTIL_SetOrigin( pev, pev->origin + Vector( 0, 0, 1) );// take him off ground so engine doesn't instantly reset onground + UTIL_SetOrigin( pev, pev->origin + Vector( 0.0f, 0.0f, 1.0f ) );// take him off ground so engine doesn't instantly reset onground UTIL_MakeVectors( pev->angles ); - pev->velocity = gpGlobals->v_forward * 200 + gpGlobals->v_up * 500; + pev->velocity = gpGlobals->v_forward * 200.0f + gpGlobals->v_up * 500.0f; break; case BIG_AE_EARLY_TARGET: { @@ -541,11 +542,11 @@ void CBigMomma::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecD // didn't hit the sack? if( pev->dmgtime != gpGlobals->time || ( RANDOM_LONG( 0, 10 ) < 1 ) ) { - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1.0f, 2.0f ) ); pev->dmgtime = gpGlobals->time; } - flDamage = 0.1;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated + flDamage = 0.1f;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated } else if( gpGlobals->time > m_painSoundTime ) { @@ -560,7 +561,7 @@ int CBigMomma::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, floa { // Don't take any acid damage -- BigMomma's mortar is acid if( bitsDamageType & DMG_ACID ) - flDamage = 0; + flDamage = 0.0f; if( !HasMemory( bits_MEMORY_PATH_FINISHED ) ) { @@ -584,20 +585,20 @@ void CBigMomma::LayHeadcrab( void ) // Is this the second crab in a pair? if( HasMemory( bits_MEMORY_CHILDPAIR ) ) { - m_crabTime = gpGlobals->time + RANDOM_FLOAT( 5, 10 ); + m_crabTime = gpGlobals->time + RANDOM_FLOAT( 5.0f, 10.0f ); Forget( bits_MEMORY_CHILDPAIR ); } else { - m_crabTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 2.5 ); + m_crabTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 2.5f ); Remember( bits_MEMORY_CHILDPAIR ); } TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 100 ), ignore_monsters, edict(), &tr ); + UTIL_TraceLine( pev->origin, pev->origin - Vector( 0.0f, 0.0f, 100.0f ), ignore_monsters, edict(), &tr ); UTIL_DecalTrace( &tr, DECAL_MOMMABIRTH ); - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pBirthSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pBirthSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); m_crabCount++; } @@ -614,15 +615,15 @@ void CBigMomma::DeathNotice( entvars_t *pevChild ) void CBigMomma::LaunchMortar( void ) { - m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2, 15 ); + m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2.0f, 15.0f ); Vector startPos = pev->origin; - startPos.z += 180; + startPos.z += 180.0f; - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pSackSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pSackSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); CBMortar *pBomb = CBMortar::Shoot( edict(), startPos, pev->movedir ); - pBomb->pev->gravity = 1.0; - MortarSpray( startPos, Vector( 0, 0, 1 ), gSpitSprite, 24 ); + pBomb->pev->gravity = 1.0f; + MortarSpray( startPos, Vector( 0.0f, 0.0f, 1.0f ), gSpitSprite, 24 ); } //========================================================= @@ -633,14 +634,14 @@ void CBigMomma::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/big_mom.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; - pev->health = 150 * gSkillData.bigmommaHealthFactor; - pev->view_ofs = Vector( 0, 0, 128 );// position of the eyes relative to monster's origin. - m_flFieldOfView = 0.3;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + pev->health = 150.0f * gSkillData.bigmommaHealthFactor; + pev->view_ofs = Vector( 0.0f, 0.0f, 128.0f );// position of the eyes relative to monster's origin. + m_flFieldOfView = 0.3f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; MonsterInit(); @@ -732,7 +733,7 @@ void CBigMomma::NodeReach( void ) // Slash BOOL CBigMomma::CheckMeleeAttack1( float flDot, float flDist ) { - if( flDot >= 0.7 ) + if( flDot >= 0.7f ) { if( flDist <= BIG_ATTACKDIST ) return TRUE; @@ -756,8 +757,8 @@ BOOL CBigMomma::CheckRangeAttack1( float flDot, float flDist ) if( pEnemy ) { Vector startPos = pev->origin; - startPos.z += 180; - pev->movedir = VecCheckSplatToss( pev, startPos, pEnemy->BodyTarget( pev->origin ), RANDOM_FLOAT( 150, 500 ) ); + startPos.z += 180.0f; + pev->movedir = VecCheckSplatToss( pev, startPos, pEnemy->BodyTarget( pev->origin ), RANDOM_FLOAT( 150.0f, 500.0f ) ); if( pev->movedir != g_vecZero ) return TRUE; } @@ -893,7 +894,7 @@ void CBigMomma::StartTask( Task_t *pTask ) case TASK_NODE_DELAY: m_nodeTime = gpGlobals->time + pTask->flData; TaskComplete(); - ALERT( at_aiconsole, "BM: FAIL! Delay %.2f\n", pTask->flData ); + ALERT( at_aiconsole, "BM: FAIL! Delay %.2f\n", (double)pTask->flData ); break; case TASK_PROCESS_NODE: ALERT( at_aiconsole, "BM: Reached node %s\n", STRING( pev->netname ) ); @@ -934,7 +935,7 @@ void CBigMomma::StartTask( Task_t *pTask ) if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) ); else - ALERT( at_aiconsole, "BM: Wait at node %s for %.2f\n", STRING( pev->netname ), GetNodeDelay() ); + ALERT( at_aiconsole, "BM: Wait at node %s for %.2f\n", STRING( pev->netname ), (double)GetNodeDelay() ); break; @@ -1034,12 +1035,12 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot float flGravity = g_psv_gravity->value; // calculate the midpoint and apex of the 'triangle' - vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5; - UTIL_TraceLine( vecMidPoint, vecMidPoint + Vector( 0, 0, maxHeight ), ignore_monsters, ENT( pev ), &tr ); + vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f; + UTIL_TraceLine( vecMidPoint, vecMidPoint + Vector( 0.0f, 0.0f, maxHeight ), ignore_monsters, ENT( pev ), &tr ); vecApex = tr.vecEndPos; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -1048,17 +1049,17 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot // Don't worry about actually hitting the target, this won't hurt us! // How high should the grenade travel (subtract 15 so the grenade doesn't hit the ceiling)? - float height = vecApex.z - vecSpot1.z - 15; + float height = vecApex.z - vecSpot1.z - 15.0f; // How fast does the grenade need to travel to reach that height given gravity? - float speed = sqrt( 2 * flGravity * height ); + float speed = sqrt( 2.0f * flGravity * height ); // How much time does it take to get there? float time = speed / flGravity; vecGrenadeVel = vecSpot2 - vecSpot1; - vecGrenadeVel.z = 0; + vecGrenadeVel.z = 0.0f; // Travel half the distance to the target in that time (apex is at the midpoint) - vecGrenadeVel = vecGrenadeVel * ( 0.5 / time ); + vecGrenadeVel = vecGrenadeVel * ( 0.5f / time ); // Speed to offset gravity at the desired height vecGrenadeVel.z = speed; @@ -1099,26 +1100,26 @@ void CBMortar::Spawn( void ) SET_MODEL( ENT( pev ), "sprites/mommaspit.spr" ); pev->frame = 0; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; - pev->dmgtime = gpGlobals->time + 0.4; + pev->dmgtime = gpGlobals->time + 0.4f; } void CBMortar::Animate( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( gpGlobals->time > pev->dmgtime ) { - pev->dmgtime = gpGlobals->time + 0.2; + pev->dmgtime = gpGlobals->time + 0.2f; MortarSpray( pev->origin, -pev->velocity.Normalize(), gSpitSprite, 3 ); } if( pev->frame++ ) { - if ( pev->frame > m_maxFrame ) + if( pev->frame > m_maxFrame ) { pev->frame = 0; } @@ -1133,9 +1134,9 @@ CBMortar *CBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocity UTIL_SetOrigin( pSpit->pev, vecStart ); pSpit->pev->velocity = vecVelocity; pSpit->pev->owner = pOwner; - pSpit->pev->scale = 2.5; + pSpit->pev->scale = 2.5f; pSpit->SetThink( &CBMortar::Animate ); - pSpit->pev->nextthink = gpGlobals->time + 0.1; + pSpit->pev->nextthink = gpGlobals->time + 0.1f; return pSpit; } @@ -1164,13 +1165,13 @@ void CBMortar::Touch( CBaseEntity *pOther ) { // make a splat on the wall - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 10.0f, dont_ignore_monsters, ENT( pev ), &tr ); UTIL_DecalTrace( &tr, DECAL_MOMMASPLAT ); } else { tr.vecEndPos = pev->origin; - tr.vecPlaneNormal = -1 * pev->velocity.Normalize(); + tr.vecPlaneNormal = -1.0f * pev->velocity.Normalize(); } // make some flecks diff --git a/dlls/bmodels.cpp b/dlls/bmodels.cpp index b75a0fa8..a8b8f00f 100644 --- a/dlls/bmodels.cpp +++ b/dlls/bmodels.cpp @@ -42,7 +42,7 @@ extern DLL_GLOBAL Vector g_vecAttackDir; // Vector VecBModelOrigin( entvars_t* pevBModel ) { - return pevBModel->absmin + ( pevBModel->size * 0.5 ); + return pevBModel->absmin + ( pevBModel->size * 0.5f ); } // =================== FUNC_WALL ============================================== @@ -162,8 +162,8 @@ void CFuncConveyor::Spawn( void ) pev->skin = 0; // Don't want the engine thinking we've got special contents on this brush } - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; UpdateSpeed( pev->speed ); } @@ -172,7 +172,7 @@ void CFuncConveyor::Spawn( void ) void CFuncConveyor::UpdateSpeed( float speed ) { // Encode it as an integer with 4 fractional bits - int speedCode = (int)( fabs( speed ) * 16.0 ); + int speedCode = (int)( fabs( speed ) * 16.0f ); if( speed < 0 ) pev->rendercolor.x = 1; @@ -303,17 +303,17 @@ void CFuncRotating::KeyValue( KeyValueData* pkvd ) { if( FStrEq( pkvd->szKeyName, "fanfriction" ) ) { - m_flFanFriction = atof( pkvd->szValue ) / 100; + m_flFanFriction = atof( pkvd->szValue ) * 0.01f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "Volume" ) ) { - m_flVolume = atof( pkvd->szValue ) / 10.0; + m_flVolume = atof( pkvd->szValue ) * 0.1f; - if( m_flVolume > 1.0 ) - m_flVolume = 1.0; - if( m_flVolume < 0.0 ) - m_flVolume = 0.0; + if( m_flVolume > 1.0f ) + m_flVolume = 1.0f; + if( m_flVolume < 0.0f ) + m_flVolume = 0.0f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "spawnorigin" ) ) @@ -352,8 +352,8 @@ void CFuncRotating::Spawn() m_pitch = PITCH_NORM - 1; // maintain compatibility with previous maps - if( m_flVolume == 0.0 ) - m_flVolume = 1.0; + if( m_flVolume == 0.0f ) + m_flVolume = 1.0f; // if the designer didn't set a sound attenuation, default to one. m_flAttenuation = ATTN_NORM; @@ -372,21 +372,21 @@ void CFuncRotating::Spawn() } // prevent divide by zero if level designer forgets friction! - if( m_flFanFriction == 0 ) + if( m_flFanFriction == 0.0f ) { - m_flFanFriction = 1; + m_flFanFriction = 1.0f; } if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_Z_AXIS ) ) - pev->movedir = Vector( 0, 0, 1 ); + pev->movedir = Vector( 0.0f, 0.0f, 1.0f ); else if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_X_AXIS ) ) - pev->movedir = Vector( 1, 0, 0 ); + pev->movedir = Vector( 1.0f, 0.0f, 0.0f ); else - pev->movedir = Vector( 0, 1, 0 ); // y-axis + pev->movedir = Vector( 0.0f, 1.0f, 0.0f ); // y-axis // check for reverse rotation if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; // some rotating objects like fake volumetric lights will not be solid. if( FBitSet( pev->spawnflags, SF_ROTATING_NOT_SOLID ) ) @@ -406,8 +406,8 @@ void CFuncRotating::Spawn() SetUse( &CFuncRotating::RotatingUse ); // did level designer forget to assign speed? - if( pev->speed <= 0 ) - pev->speed = 0; + if( pev->speed <= 0.0f ) + pev->speed = 0.0f; // Removed this per level designers request. -- JAY // if( pev->dmg == 0 ) @@ -417,7 +417,7 @@ void CFuncRotating::Spawn() if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT ) ) { SetThink( &CBaseEntity::SUB_CallUseToggle ); - pev->nextthink = pev->ltime + 1.5; // leave a magic delay for client to start up + pev->nextthink = pev->ltime + 1.5f; // leave a magic delay for client to start up } // can this brush inflict pain? if( FBitSet( pev->spawnflags, SF_BRUSH_HURT ) ) @@ -476,7 +476,7 @@ void CFuncRotating::Precache( void ) // make sure we restart the sound. 1.5 sec delay is magic number. KDB SetThink( &CFuncRotating::SpinUp ); - pev->nextthink = pev->ltime + 1.5; + pev->nextthink = pev->ltime + 1.5f; } } @@ -527,7 +527,7 @@ void CFuncRotating::RampPitchVol( int fUp ) // calc volume and pitch as % of final vol and pitch fpct = vecCur / vecFinal; //if (fUp) - // fvol = m_flVolume * (0.5 + fpct/2.0); // spinup volume ramps up from 50% max vol + // fvol = m_flVolume * (0.5f + fpct/2.0f); // spinup volume ramps up from 50% max vol //else fvol = m_flVolume * fpct; // slowdown volume ramps down to 0 @@ -549,7 +549,7 @@ void CFuncRotating::SpinUp( void ) { Vector vecAVel;//rotational velocity - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; pev->avelocity = pev->avelocity + ( pev->movedir * ( pev->speed * m_flFanFriction ) ); vecAVel = pev->avelocity;// cache entity's rotational velocity @@ -580,23 +580,23 @@ void CFuncRotating::SpinDown( void ) Vector vecAVel;//rotational velocity vec_t vecdir; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; pev->avelocity = pev->avelocity - ( pev->movedir * ( pev->speed * m_flFanFriction ) );//spin down slower than spinup vecAVel = pev->avelocity;// cache entity's rotational velocity - if( pev->movedir.x != 0 ) + if( pev->movedir.x != 0.0f ) vecdir = pev->movedir.x; - else if( pev->movedir.y != 0 ) + else if( pev->movedir.y != 0.0f ) vecdir = pev->movedir.y; else vecdir = pev->movedir.z; // if we've met or exceeded target speed, set target speed and stop thinking // (note: must check for movedir > 0 or < 0) - if( ( ( vecdir > 0 ) && ( vecAVel.x <= 0 && vecAVel.y <= 0 && vecAVel.z <= 0 ) ) || - ( ( vecdir < 0 ) && ( vecAVel.x >= 0 && vecAVel.y >= 0 && vecAVel.z >= 0 ) ) ) + if( ( ( vecdir > 0.0f ) && ( vecAVel.x <= 0.0f && vecAVel.y <= 0.0f && vecAVel.z <= 0.0f ) ) || + ( ( vecdir < 0.0f ) && ( vecAVel.x >= 0.0f && vecAVel.y >= 0.0f && vecAVel.z >= 0.0f ) ) ) { pev->avelocity = g_vecZero;// set speed in case we overshot @@ -615,7 +615,7 @@ void CFuncRotating::SpinDown( void ) void CFuncRotating::Rotate( void ) { - pev->nextthink = pev->ltime + 10; + pev->nextthink = pev->ltime + 10.0f; } //========================================================= @@ -633,15 +633,15 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, //EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ), // m_flVolume, m_flAttenuation, 0, m_pitch ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } else// fan is not moving, so start it { SetThink( &CFuncRotating::SpinUp ); EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ), - 0.01, m_flAttenuation, 0, FANPITCHMIN ); + 0.01f, m_flAttenuation, 0, FANPITCHMIN ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } else if( !FBitSet( pev->spawnflags, SF_BRUSH_ACCDCC ) )//this is a normal start/stop brush. @@ -654,7 +654,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, // EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ), // m_flVolume, m_flAttenuation, 0, m_pitch ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; // pev->avelocity = g_vecZero; } else @@ -729,7 +729,7 @@ void CPendulum::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "damp" ) ) { - m_damp = atof( pkvd->szValue ) * 0.001; + m_damp = atof( pkvd->szValue ) * 0.001f; pkvd->fHandled = TRUE; } else @@ -752,18 +752,18 @@ void CPendulum::Spawn( void ) if( m_distance == 0 ) return; - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; - m_accel = ( pev->speed * pev->speed ) / ( 2 * fabs( m_distance ) ); // Calculate constant acceleration from speed and distance + m_accel = ( pev->speed * pev->speed ) / ( 2.0f * fabs( m_distance ) ); // Calculate constant acceleration from speed and distance m_maxSpeed = pev->speed; m_start = pev->angles; - m_center = pev->angles + ( m_distance * 0.5 ) * pev->movedir; + m_center = pev->angles + ( m_distance * 0.5f ) * pev->movedir; if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT ) ) { SetThink( &CBaseEntity::SUB_CallUseToggle ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } pev->speed = 0; SetUse( &CPendulum::PendulumUse ); @@ -790,14 +790,14 @@ void CPendulum::PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ } else { - pev->speed = 0; // Dead stop + pev->speed = 0.0f; // Dead stop SetThink( NULL ); pev->avelocity = g_vecZero; } } else { - pev->nextthink = pev->ltime + 0.1; // Start the pendulum moving + pev->nextthink = pev->ltime + 0.1f; // Start the pendulum moving m_time = gpGlobals->time; // Save time to calculate dt SetThink( &CPendulum::Swing ); m_dampSpeed = m_maxSpeed; @@ -807,7 +807,7 @@ void CPendulum::PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ void CPendulum::Stop( void ) { pev->angles = m_start; - pev->speed = 0; + pev->speed = 0.0f; SetThink( NULL ); pev->avelocity = g_vecZero; } @@ -825,7 +825,7 @@ void CPendulum::Swing( void ) dt = gpGlobals->time - m_time; // How much time has passed? m_time = gpGlobals->time; // Remember the last time called - if( delta > 0 && m_accel > 0 ) + if( delta > 0.0f && m_accel > 0.0f ) pev->speed -= m_accel * dt; // Integrate velocity else pev->speed += m_accel * dt; @@ -838,12 +838,12 @@ void CPendulum::Swing( void ) pev->avelocity = pev->speed * pev->movedir; // Call this again - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; if( m_damp ) { m_dampSpeed -= m_damp * m_dampSpeed * dt; - if( m_dampSpeed < 30.0 ) + if( m_dampSpeed < 30.0f ) { pev->angles = m_center; pev->speed = 0; @@ -869,7 +869,7 @@ void CPendulum::Touch( CBaseEntity *pOther ) return; // calculate damage based on rotation speed - float damage = pev->dmg * pev->speed * 0.01; + float damage = pev->dmg * pev->speed * 0.01f; if( damage < 0 ) damage = -damage; diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index 8db94c25..01c9e590 100644 --- a/dlls/bullsquid.cpp +++ b/dlls/bullsquid.cpp @@ -27,7 +27,7 @@ #include "soundent.h" #include "game.h" -#define SQUID_SPRINT_DIST 256 // how close the squid has to get before starting to sprint and refusing to swerve +#define SQUID_SPRINT_DIST 256.0f // how close the squid has to get before starting to sprint and refusing to swerve int iSquidSpitSprite; @@ -91,7 +91,7 @@ void CSquidSpit::Spawn( void ) SET_MODEL( ENT( pev ), "sprites/bigspit.spr" ); pev->frame = 0; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); @@ -100,7 +100,7 @@ void CSquidSpit::Spawn( void ) void CSquidSpit::Animate( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->frame++ ) { @@ -121,7 +121,7 @@ void CSquidSpit::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity pSpit->pev->owner = ENT( pevOwner ); pSpit->SetThink( &CSquidSpit::Animate ); - pSpit->pev->nextthink = gpGlobals->time + 0.1; + pSpit->pev->nextthink = gpGlobals->time + 0.1f; } void CSquidSpit::Touch( CBaseEntity *pOther ) @@ -130,7 +130,7 @@ void CSquidSpit::Touch( CBaseEntity *pOther ) int iPitch; // splat sound - iPitch = RANDOM_FLOAT( 90, 110 ); + iPitch = RANDOM_FLOAT( 90.0f, 110.0f ); EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_acid1.wav", 1, ATTN_NORM, 0, iPitch ); @@ -242,7 +242,7 @@ int CBullsquid::IgnoreConditions( void ) { int iIgnore = CBaseMonster::IgnoreConditions(); - if( gpGlobals->time - m_flLastHurtTime <= 20 ) + if( gpGlobals->time - m_flLastHurtTime <= 20.0f ) { // haven't been hurt in 20 seconds, so let the squid care about stink. iIgnore = bits_COND_SMELL | bits_COND_SMELL_FOOD; @@ -266,7 +266,7 @@ int CBullsquid::IgnoreConditions( void ) //========================================================= int CBullsquid::IRelationship( CBaseEntity *pTarget ) { - if( gpGlobals->time - m_flLastHurtTime < 5 && FClassnameIs( pTarget->pev, "monster_headcrab" ) ) + if( gpGlobals->time - m_flLastHurtTime < 5.0f && FClassnameIs( pTarget->pev, "monster_headcrab" ) ) { // if squid has been hurt in the last 5 seconds, and is getting relationship for a headcrab, // tell squid to disregard crab. @@ -287,7 +287,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // if the squid is running, has an enemy, was hurt by the enemy, hasn't been hurt in the last 3 seconds, and isn't too close to the enemy, // it will swerve. (whew). - if( m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3 ) + if( m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3.0f ) { flDist = ( pev->origin - m_hEnemy->pev->origin ).Length2D(); @@ -295,7 +295,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo { flDist = ( pev->origin - m_Route[m_iRouteIndex].vecLocation ).Length2D();// reusing flDist. - if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5, m_hEnemy, &vecApex ) ) + if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5f, m_hEnemy, &vecApex ) ) { InsertWaypoint( vecApex, bits_MF_TO_DETOUR | bits_MF_DONT_SIMPLIFY ); } @@ -316,17 +316,17 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo //========================================================= BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) { - if( IsMoving() && flDist >= 512 ) + if( IsMoving() && flDist >= 512.0f ) { // squid will far too far behind if he stops running to spit at this distance from the enemy. return FALSE; } - if( flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime ) + if( flDist > 64.0f && flDist <= 784.0f && flDot >= 0.5f && gpGlobals->time >= m_flNextSpitTime ) { if( m_hEnemy != 0 ) { - if( fabs( pev->origin.z - m_hEnemy->pev->origin.z ) > 256 ) + if( fabs( pev->origin.z - m_hEnemy->pev->origin.z ) > 256.0f ) { // don't try to spit at someone up really high or down really low. return FALSE; @@ -336,12 +336,12 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) if( IsMoving() ) { // don't spit again for a long time, resume chasing enemy. - m_flNextSpitTime = gpGlobals->time + 5; + m_flNextSpitTime = gpGlobals->time + 5.0f; } else { // not moving, so spit again pretty soon. - m_flNextSpitTime = gpGlobals->time + 0.5; + m_flNextSpitTime = gpGlobals->time + 0.5f; } return TRUE; @@ -356,7 +356,7 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) //========================================================= BOOL CBullsquid::CheckMeleeAttack1( float flDot, float flDist ) { - if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 85 && flDot >= 0.7 ) + if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 85.0f && flDot >= 0.7f ) { return TRUE; } @@ -371,7 +371,7 @@ BOOL CBullsquid::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CBullsquid::CheckMeleeAttack2( float flDot, float flDist ) { - if( flDist <= 85 && flDot >= 0.7 && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes + if( flDist <= 85.0f && flDot >= 0.7f && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes { // apart (48 * sqrt(3)) and he can still attack (85 is a little more than 48*sqrt(3)) return TRUE; } @@ -504,7 +504,7 @@ void CBullsquid::SetYawSpeed( void ) ys = 0; - switch ( m_Activity ) + switch( m_Activity ) { case ACT_WALK: ys = 90; @@ -543,13 +543,13 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) // !!!HACKHACK - the spot at which the spit originates (in front of the mouth) was measured in 3ds and hardcoded here. // we should be able to read the position of bones at runtime for this info. - vecSpitOffset = ( gpGlobals->v_right * 8 + gpGlobals->v_forward * 37 + gpGlobals->v_up * 23 ); + vecSpitOffset = ( gpGlobals->v_right * 8.0f + gpGlobals->v_forward * 37.0f + gpGlobals->v_up * 23.0f ); vecSpitOffset = ( pev->origin + vecSpitOffset ); vecSpitDir = ( ( m_hEnemy->pev->origin + m_hEnemy->pev->view_ofs ) - vecSpitOffset ).Normalize(); - vecSpitDir.x += RANDOM_FLOAT( -0.05, 0.05 ); - vecSpitDir.y += RANDOM_FLOAT( -0.05, 0.05 ); - vecSpitDir.z += RANDOM_FLOAT( -0.05, 0 ); + vecSpitDir.x += RANDOM_FLOAT( -0.05f, 0.05f ); + vecSpitDir.y += RANDOM_FLOAT( -0.05f, 0.05f ); + vecSpitDir.z += RANDOM_FLOAT( -0.05f, 0.0f ); // do stuff for this event. AttackSound(); @@ -569,7 +569,7 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) WRITE_BYTE( 25 ); // noise ( client will divide by 100 ) MESSAGE_END(); - CSquidSpit::Shoot( pev, vecSpitOffset, vecSpitDir * 900 ); + CSquidSpit::Shoot( pev, vecSpitOffset, vecSpitDir * 900.0f ); } break; case BSQUID_AE_BITE: @@ -579,10 +579,10 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - //pHurt->pev->punchangle.z = -15; - //pHurt->pev->punchangle.x = -45; - pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_forward * 100; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100; + //pHurt->pev->punchangle.z = -15.0f; + //pHurt->pev->punchangle.x = -45.0f; + pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_forward * 100.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100.0f; } } break; @@ -592,10 +592,10 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.z = -20; - pHurt->pev->punchangle.x = 20; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 200; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100; + pHurt->pev->punchangle.z = -20.0f; + pHurt->pev->punchangle.x = 20.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 200.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100.0f; } } break; @@ -616,8 +616,8 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) } // jump into air for 0.8 (24/30) seconds - //pev->velocity.z += ( 0.875 * flGravity ) * 0.5; - pev->velocity.z += ( 0.625 * flGravity ) * 0.5; + //pev->velocity.z += ( 0.875f * flGravity ) * 0.5f; + pev->velocity.z += ( 0.625f * flGravity ) * 0.5f; } break; case BSQUID_AE_THROW: @@ -630,14 +630,14 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { // croonchy bite sound - iPitch = RANDOM_FLOAT( 90, 110 ); + iPitch = RANDOM_FLOAT( 90.0f, 110.0f ); switch( RANDOM_LONG( 0, 1 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite2.wav", 1, ATTN_NORM, 0, iPitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite2.wav", 1.0f, ATTN_NORM, 0, iPitch ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite3.wav", 1, ATTN_NORM, 0, iPitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite3.wav", 1.0f, ATTN_NORM, 0, iPitch ); break; } @@ -646,12 +646,12 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) //pHurt->pev->punchangle.y = RANDOM_LONG( 0, 89 ) - 45; // screeshake transforms the viewmodel as well as the viewangle. No problems with seeing the ends of the viewmodels. - UTIL_ScreenShake( pHurt->pev->origin, 25.0, 1.5, 0.7, 2 ); + UTIL_ScreenShake( pHurt->pev->origin, 25.0f, 1.5f, 0.7f, 2.0f ); if( pHurt->IsPlayer() ) { UTIL_MakeVectors( pev->angles ); - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * 300 + gpGlobals->v_up * 300; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * 300.0f + gpGlobals->v_up * 300.0f; } } } @@ -669,14 +669,14 @@ void CBullsquid::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/bullsquid.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; pev->effects = 0; pev->health = gSkillData.bullsquidHealth; - m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.2f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; m_fCanThreatDisplay = TRUE; @@ -789,7 +789,7 @@ void CBullsquid::RunAI( void ) // chasing enemy. Sprint for last bit if( ( pev->origin - m_hEnemy->pev->origin).Length2D() < SQUID_SPRINT_DIST ) { - pev->framerate = 1.25; + pev->framerate = 1.25f; } } } @@ -802,8 +802,8 @@ void CBullsquid::RunAI( void ) Task_t tlSquidRangeAttack1[] = { { TASK_STOP_MOVING, 0 }, - { TASK_FACE_IDEAL, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_FACE_IDEAL, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, }; @@ -826,9 +826,9 @@ Schedule_t slSquidRangeAttack1[] = Task_t tlSquidChaseEnemy1[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_RANGE_ATTACK1 },// !!!OEM - this will stop nasty squid oscillation. - { TASK_GET_PATH_TO_ENEMY, (float)0 }, - { TASK_RUN_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_GET_PATH_TO_ENEMY, 0.0f }, + { TASK_RUN_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, }; Schedule_t slSquidChaseEnemy[] = @@ -852,10 +852,10 @@ Schedule_t slSquidChaseEnemy[] = Task_t tlSquidHurtHop[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_SOUND_WAKE, (float)0 }, - { TASK_SQUID_HOPTURN, (float)0 }, - { TASK_FACE_ENEMY, (float)0 },// in case squid didn't turn all the way in the air. + { TASK_STOP_MOVING, 0.0f }, + { TASK_SOUND_WAKE, 0.0f }, + { TASK_SQUID_HOPTURN, 0.0f }, + { TASK_FACE_ENEMY, 0.0f },// in case squid didn't turn all the way in the air. }; Schedule_t slSquidHurtHop[] = @@ -871,10 +871,10 @@ Schedule_t slSquidHurtHop[] = Task_t tlSquidSeeCrab[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_SOUND_WAKE, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_SOUND_WAKE, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EXCITED }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_FACE_ENEMY, 0.0f }, }; Schedule_t slSquidSeeCrab[] = @@ -892,20 +892,20 @@ Schedule_t slSquidSeeCrab[] = // squid walks to something tasty and eats it. Task_t tlSquidEat[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the food - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the food + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, - { TASK_EAT, (float)50 }, - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f }, + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidEat[] = @@ -928,21 +928,21 @@ Schedule_t slSquidEat[] = // the squid. This schedule plays a sniff animation before going to the source of food. Task_t tlSquidSniffAndEat[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the food + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the food { TASK_PLAY_SEQUENCE, (float)ACT_DETECT_SCENT }, - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, - { TASK_EAT, (float)50 }, - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f }, + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidSniffAndEat[] = @@ -964,18 +964,18 @@ Schedule_t slSquidSniffAndEat[] = // squid does this to stinky things. Task_t tlSquidWallow[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the stinkiness - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the stinkiness + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_INSPECT_FLOOR }, - { TASK_EAT, (float)50 },// keeps squid from eating or sniffing anything else for a while. - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f },// keeps squid from eating or sniffing anything else for a while. + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidWallow[] = diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index f7441b3f..8344c814 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -163,7 +163,7 @@ void CMultiSource::Spawn() pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->spawnflags |= SF_MULTI_INIT; // Until it's initialized SetThink( &CMultiSource::Register ); } @@ -476,7 +476,7 @@ void CBaseButton::Spawn() if( FBitSet( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.5;// no hurry, make sure everything else spawns + pev->nextthink = gpGlobals->time + 0.5f;// no hurry, make sure everything else spawns } SetMovedir( pev ); @@ -485,29 +485,29 @@ void CBaseButton::Spawn() pev->solid = SOLID_BSP; SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 40; + if( pev->speed == 0.0f ) + pev->speed = 40.0f; if( pev->health > 0 ) { pev->takedamage = DAMAGE_YES; } - if( m_flWait == 0 ) - m_flWait = 1; - if( m_flLip == 0 ) - m_flLip = 4; + if( m_flWait == 0.0f ) + m_flWait = 1.0f; + if( m_flLip == 0.0f ) + m_flLip = 4.0f; m_toggle_state = TS_AT_BOTTOM; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); // Is this a non-moving button? - if( ( ( m_vecPosition2 - m_vecPosition1 ).Length() < 1 ) || ( pev->spawnflags & SF_BUTTON_DONTMOVE ) ) + if( ( ( m_vecPosition2 - m_vecPosition1 ).Length() < 1.0f ) || ( pev->spawnflags & SF_BUTTON_DONTMOVE ) ) m_vecPosition2 = m_vecPosition1; - m_fStayPushed = m_flWait == -1 ? TRUE : FALSE; + m_fStayPushed = m_flWait == -1.0f ? TRUE : FALSE; m_fRotating = FALSE; // if the button is flagged for USE button activation only, take away it's touch function and add a use function @@ -607,11 +607,11 @@ const char *ButtonSound( int sound ) // void DoSpark( entvars_t *pev, const Vector &location ) { - Vector tmp = location + pev->size * 0.5; + Vector tmp = location + pev->size * 0.5f; UTIL_Sparks( tmp ); - float flVolume = RANDOM_FLOAT( 0.25 , 0.75 ) * 0.4;//random volume range - switch( (int)( RANDOM_FLOAT( 0, 1 ) * 6 ) ) + float flVolume = RANDOM_FLOAT( 0.25f, 0.75f ) * 0.4f;//random volume range + switch( (int)( RANDOM_FLOAT( 0.0f, 1.0f ) * 6.0f ) ) { case 0: EMIT_SOUND( ENT( pev ), CHAN_VOICE, "buttons/spark1.wav", flVolume, ATTN_NORM ); @@ -637,7 +637,7 @@ void DoSpark( entvars_t *pev, const Vector &location ) void CBaseButton::ButtonSpark( void ) { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, 1.5 );// spark again at random interval + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval DoSpark( pev, pev->mins ); } @@ -657,7 +657,7 @@ void CBaseButton::ButtonUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ { if( !m_fStayPushed && FBitSet( pev->spawnflags, SF_BUTTON_TOGGLE ) ) { - EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1.0f, ATTN_NORM ); //SUB_UseTargets( m_eoActivator ); ButtonReturn(); @@ -795,7 +795,7 @@ void CBaseButton::ButtonReturn( void ) { ASSERT( m_toggle_state == TS_AT_TOP ); m_toggle_state = TS_GOING_DOWN; - + SetMoveDone( &CBaseButton::ButtonBackHome ); if( !m_fRotating ) LinearMove( m_vecPosition1, pev->speed ); @@ -852,7 +852,7 @@ void CBaseButton::ButtonBackHome( void ) if( FBitSet( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) ) { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.5;// no hurry. + pev->nextthink = gpGlobals->time + 0.5f;// no hurry. } } @@ -883,7 +883,7 @@ void CRotButton::Spawn( void ) // check for clockwise rotation if( FBitSet( pev->spawnflags, SF_DOOR_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; pev->movetype = MOVETYPE_PUSH; @@ -894,8 +894,8 @@ void CRotButton::Spawn( void ) SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 40; + if( pev->speed == 0.0f ) + pev->speed = 40.0f; if( m_flWait == 0 ) m_flWait = 1; @@ -910,7 +910,7 @@ void CRotButton::Spawn( void ) m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance; ASSERTSZ( m_vecAngle1 != m_vecAngle2, "rotating button start/end positions are equal" ); - m_fStayPushed = m_flWait == -1 ? TRUE : FALSE; + m_fStayPushed = m_flWait == -1.0f ? TRUE : FALSE; m_fRotating = TRUE; // if the button is flagged for USE button activation only, take away it's touch function and add a use function @@ -984,10 +984,10 @@ void CMomentaryRotButton::Spawn( void ) { CBaseToggle::AxisDir( pev ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; - if( m_flMoveDistance < 0 ) + if( m_flMoveDistance < 0.0f ) { m_start = pev->angles + pev->movedir * m_flMoveDistance; m_end = pev->angles; @@ -1087,14 +1087,14 @@ void CMomentaryRotButton::UpdateSelf( float value ) } m_lastUsed = 1; - pev->nextthink = pev->ltime + 0.1; - if( m_direction > 0 && value >= 1.0 ) + pev->nextthink = pev->ltime + 0.1f; + if( m_direction > 0 && value >= 1.0f ) { pev->avelocity = g_vecZero; pev->angles = m_end; return; } - else if( m_direction < 0 && value <= 0 ) + else if( m_direction < 0 && value <= 0.0f ) { pev->avelocity = g_vecZero; pev->angles = m_start; @@ -1106,9 +1106,9 @@ void CMomentaryRotButton::UpdateSelf( float value ) // HACKHACK -- If we're going slow, we'll get multiple player packets per frame, bump nexthink on each one to avoid stalling if( pev->nextthink < pev->ltime ) - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; else - pev->nextthink += 0.1; + pev->nextthink += 0.1f; pev->avelocity = m_direction * pev->speed * pev->movedir; SetThink( &CMomentaryRotButton::Off ); @@ -1140,7 +1140,7 @@ void CMomentaryRotButton::Off( void ) if( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 ) { SetThink( &CMomentaryRotButton::Return ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; m_direction = -1; } else @@ -1152,23 +1152,23 @@ void CMomentaryRotButton::Return( void ) float value = CBaseToggle::AxisDelta( pev->spawnflags, pev->angles, m_start ) / m_flMoveDistance; UpdateAllButtons( value, 0 ); // This will end up calling UpdateSelfReturn() n times, but it still works right - if( value > 0 ) + if( value > 0.0f ) UpdateTarget( value ); } void CMomentaryRotButton::UpdateSelfReturn( float value ) { - if( value <= 0 ) + if( value <= 0.0f ) { pev->avelocity = g_vecZero; pev->angles = m_start; - pev->nextthink = -1; + pev->nextthink = -1.0f; SetThink( NULL ); } else { pev->avelocity = -m_returnSpeed * pev->movedir; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } @@ -1221,10 +1221,10 @@ void CEnvSpark::Spawn( void ) else SetThink( &CEnvSpark::SparkThink ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, 1.5 ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f ); - if( m_flDelay <= 0 ) - m_flDelay = 1.5; + if( m_flDelay <= 0.0f ) + m_flDelay = 1.5f; Precache(); } @@ -1259,7 +1259,7 @@ void CEnvSpark::KeyValue( KeyValueData *pkvd ) void EXPORT CEnvSpark::SparkThink( void ) { - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, m_flDelay ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, m_flDelay ); DoSpark( pev, pev->origin ); } @@ -1267,7 +1267,7 @@ void EXPORT CEnvSpark::SparkStart( CBaseEntity *pActivator, CBaseEntity *pCaller { SetUse( &CEnvSpark::SparkStop ); SetThink( &CEnvSpark::SparkThink ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, m_flDelay ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, m_flDelay ); } void EXPORT CEnvSpark::SparkStop( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) @@ -1305,7 +1305,7 @@ void CButtonTarget::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE { if( !ShouldToggle( useType, (int)pev->frame ) ) return; - pev->frame = 1-pev->frame; + pev->frame = 1 - pev->frame; if( pev->frame ) SUB_UseTargets( pActivator, USE_ON, 0 ); else diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index 8750bddf..4e6292ba 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -136,8 +136,8 @@ int DispatchSpawn( edict_t *pent ) if( pEntity ) { // Initialize these or entities who don't link to the world won't have anything in here - pEntity->pev->absmin = pEntity->pev->origin - Vector( 1, 1, 1 ); - pEntity->pev->absmax = pEntity->pev->origin + Vector( 1, 1, 1 ); + pEntity->pev->absmin = pEntity->pev->origin - Vector( 1.0f, 1.0f, 1.0f ); + pEntity->pev->absmax = pEntity->pev->origin + Vector( 1.0f, 1.0f, 1.0f ); pEntity->Spawn(); @@ -533,13 +533,13 @@ int CBaseEntity::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl // figure momentum add (don't let hurt brushes or other triggers move player) if( ( !FNullEnt( pevInflictor ) ) && (pev->movetype == MOVETYPE_WALK || pev->movetype == MOVETYPE_STEP ) && ( pevAttacker->solid != SOLID_TRIGGER ) ) { - Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5; + Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5f; vecDir = vecDir.Normalize(); - float flForce = flDamage * ( ( 32 * 32 * 72.0 ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5; + float flForce = flDamage * ( ( 32.0f * 32.0f * 72.0f ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5.0f; - if( flForce > 1000.0 ) - flForce = 1000.0; + if( flForce > 1000.0f ) + flForce = 1000.0f; pev->velocity = pev->velocity + vecDir * flForce; } @@ -681,7 +681,7 @@ void CBaseEntity::MakeDormant( void ) // Don't draw SetBits( pev->effects, EF_NODRAW ); // Don't think - pev->nextthink = 0; + pev->nextthink = 0.0f; // Relink UTIL_SetOrigin( pev, pev->origin ); } @@ -694,30 +694,30 @@ int CBaseEntity::IsDormant( void ) BOOL CBaseEntity::IsInWorld( void ) { // position - if( pev->origin.x >= 4096 ) + if( pev->origin.x >= 4096.0f ) return FALSE; - if( pev->origin.y >= 4096 ) + if( pev->origin.y >= 4096.0f ) return FALSE; - if( pev->origin.z >= 4096 ) + if( pev->origin.z >= 4096.0f ) return FALSE; - if( pev->origin.x <= -4096 ) + if( pev->origin.x <= -4096.0f ) return FALSE; - if( pev->origin.y <= -4096 ) + if( pev->origin.y <= -4096.0f ) return FALSE; - if( pev->origin.z <= -4096 ) + if( pev->origin.z <= -4096.0f ) return FALSE; // speed - if( pev->velocity.x >= 2000 ) + if( pev->velocity.x >= 2000.0f ) return FALSE; - if( pev->velocity.y >= 2000 ) + if( pev->velocity.y >= 2000.0f ) return FALSE; - if( pev->velocity.z >= 2000 ) + if( pev->velocity.z >= 2000.0f ) return FALSE; - if( pev->velocity.x <= -2000 ) + if( pev->velocity.x <= -2000.0f ) return FALSE; - if( pev->velocity.y <= -2000 ) + if( pev->velocity.y <= -2000.0f ) return FALSE; - if( pev->velocity.z <= -2000 ) + if( pev->velocity.z <= -2000.0f ) return FALSE; return TRUE; diff --git a/dlls/client.cpp b/dlls/client.cpp index f96302d0..32f97298 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -73,7 +73,7 @@ void set_suicide_frame( entvars_t *pev ) pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_TOSS; pev->deadflag = DEAD_DEAD; - pev->nextthink = -1; + pev->nextthink = -1.0f; } @@ -170,7 +170,7 @@ void ClientKill( edict_t *pEntity ) if( pl->m_fNextSuicideTime > gpGlobals->time ) return; // prevent suiciding too ofter - pl->m_fNextSuicideTime = gpGlobals->time + 1; // don't let them suicide for 5 seconds after suiciding + pl->m_fNextSuicideTime = gpGlobals->time + 1.0f; // don't let them suicide for 5 seconds after suiciding // have the player kill themself pev->health = 0; @@ -494,7 +494,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq(pcmd, "give" ) ) { - if( g_flWeaponCheat != 0.0 ) + if( g_flWeaponCheat != 0.0f ) { int iszItem = ALLOC_STRING( CMD_ARGV( 1 ) ); // Make a copy of the classname GetClassPtr( (CBasePlayer *)pev )->GiveNamedItem( STRING( iszItem ) ); @@ -502,7 +502,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fire" ) ) { - if( g_flWeaponCheat != 0.0 ) + if( g_flWeaponCheat != 0.0f ) { CBaseEntity *pPlayer = CBaseEntity::Instance( pEntity ); if( CMD_ARGC() > 1 ) @@ -1203,7 +1203,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h // // Round animtime to nearest millisecond - state->animtime = (int)( 1000.0 * ent->v.animtime ) / 1000.0; + state->animtime = (int)( 1000.0f * ent->v.animtime ) / 1000.0f; memcpy( state->origin, ent->v.origin, 3 * sizeof(float) ); memcpy( state->angles, ent->v.angles, 3 * sizeof(float) ); @@ -1661,12 +1661,12 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) item->m_iId = II.iId; item->m_iClip = gun->m_iClip; - item->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle, -0.001 ); - item->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack, -0.001 ); - item->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack, -0.001 ); + item->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle, -0.001f ); + item->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack, -0.001f ); + item->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack, -0.001f ); item->m_fInReload = gun->m_fInReload; item->m_fInSpecialReload = gun->m_fInSpecialReload; - item->fuser1 = Q_max( gun->pev->fuser1, -0.001 ); + item->fuser1 = Q_max( gun->pev->fuser1, -0.001f ); item->fuser2 = gun->m_flStartThrow; item->fuser3 = gun->m_flReleaseThrow; item->iuser1 = gun->m_chargeReady; @@ -1931,7 +1931,7 @@ One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check for the sp int InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message ) { // Server doesn't care? - if( CVAR_GET_FLOAT( "mp_consistency" ) != 1 ) + if( CVAR_GET_FLOAT( "mp_consistency" ) != 1.0f ) return 0; // Default behavior is to kick the player diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 9f221cc9..c6ab3efe 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -48,8 +48,8 @@ void CGib::LimitVelocity( void ) // ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it // in 3 separate places again, I'll just limit it here. - if( length > 1500.0 ) - pev->velocity = pev->velocity.Normalize() * 1500; // This should really be sv_maxvelocity * 0.75 or something + if( length > 1500.0f ) + pev->velocity = pev->velocity.Normalize() * 1500.0f; // This should really be sv_maxvelocity * 0.75 or something } @@ -72,9 +72,9 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ) if( pevVictim ) { - pGib->pev->origin.x = vecOrigin.x + RANDOM_FLOAT( -3, 3 ); - pGib->pev->origin.y = vecOrigin.y + RANDOM_FLOAT( -3, 3 ); - pGib->pev->origin.z = vecOrigin.z + RANDOM_FLOAT( -3, 3 ); + pGib->pev->origin.x = vecOrigin.x + RANDOM_FLOAT( -3.0f, 3.0f ); + pGib->pev->origin.y = vecOrigin.y + RANDOM_FLOAT( -3.0f, 3.0f ); + pGib->pev->origin.z = vecOrigin.z + RANDOM_FLOAT( -3.0f, 3.0f ); /* pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * ( RANDOM_FLOAT( 0, 1 ) ); @@ -83,32 +83,32 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ) */ // make the gib fly away from the attack vector - pGib->pev->velocity = g_vecAttackDir * -1; + pGib->pev->velocity = g_vecAttackDir * -1.0f; // mix in some noise - pGib->pev->velocity.x += RANDOM_FLOAT( -0.15, 0.15 ); - pGib->pev->velocity.y += RANDOM_FLOAT( -0.15, 0.15 ); - pGib->pev->velocity.z += RANDOM_FLOAT( -0.15, 0.15 ); + pGib->pev->velocity.x += RANDOM_FLOAT( -0.15f, 0.15f ); + pGib->pev->velocity.y += RANDOM_FLOAT( -0.15f, 0.15f ); + pGib->pev->velocity.z += RANDOM_FLOAT( -0.15f, 0.15f ); - pGib->pev->velocity = pGib->pev->velocity * 900; + pGib->pev->velocity = pGib->pev->velocity * 900.0f; - pGib->pev->avelocity.x = RANDOM_FLOAT( 250, 400 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 250, 400 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 250.0f, 400.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 250.0f, 400.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } pGib->pev->movetype = MOVETYPE_TOSS; @@ -148,31 +148,31 @@ void CGib::SpawnHeadGib( entvars_t *pevVictim ) entvars_t *pevPlayer; pevPlayer = VARS( pentPlayer ); - pGib->pev->velocity = ( ( pevPlayer->origin + pevPlayer->view_ofs ) - pGib->pev->origin ).Normalize() * 300; - pGib->pev->velocity.z += 100; + pGib->pev->velocity = ( ( pevPlayer->origin + pevPlayer->view_ofs ) - pGib->pev->origin ).Normalize() * 300.0f; + pGib->pev->velocity.z += 100.0f; } else { - pGib->pev->velocity = Vector( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) ); + pGib->pev->velocity = Vector( RANDOM_FLOAT( -100.0f, 100.0f ), RANDOM_FLOAT( -100.0f, 100.0f ), RANDOM_FLOAT( 200.0f, 300.0f ) ); } - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } } pGib->LimitVelocity(); @@ -210,37 +210,37 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) if( pevVictim ) { // spawn the gib somewhere in the monster's bounding volume - pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * (RANDOM_FLOAT ( 0 , 1 ) ); - pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * (RANDOM_FLOAT ( 0 , 1 ) ); - pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * (RANDOM_FLOAT ( 0 , 1 ) ) + 1; // absmin.z is in the floor because the engine subtracts 1 to enlarge the box + pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * ( RANDOM_FLOAT( 0.0f, 1.0f ) ); + pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * ( RANDOM_FLOAT( 0.0f, 1.0f ) ); + pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * ( RANDOM_FLOAT( 0.0f, 1.0f ) ) + 1.0f; // absmin.z is in the floor because the engine subtracts 1 to enlarge the box // make the gib fly away from the attack vector - pGib->pev->velocity = g_vecAttackDir * -1; + pGib->pev->velocity = g_vecAttackDir * -1.0f; // mix in some noise - pGib->pev->velocity.x += RANDOM_FLOAT( -0.25, 0.25 ); - pGib->pev->velocity.y += RANDOM_FLOAT( -0.25, 0.25 ); - pGib->pev->velocity.z += RANDOM_FLOAT( -0.25, 0.25 ); + pGib->pev->velocity.x += RANDOM_FLOAT( -0.25f, 0.25f ); + pGib->pev->velocity.y += RANDOM_FLOAT( -0.25f, 0.25f ); + pGib->pev->velocity.z += RANDOM_FLOAT( -0.25f, 0.25f ); - pGib->pev->velocity = pGib->pev->velocity * RANDOM_FLOAT( 300, 400 ); + pGib->pev->velocity = pGib->pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } pGib->pev->solid = SOLID_BBOX; @@ -360,7 +360,7 @@ Activity CBaseMonster::GetDeathActivity( void ) deathActivity = ACT_DIESIMPLE;// in case we can't find any special deaths to do. UTIL_MakeVectors( pev->angles ); - flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 ); + flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f ); switch( m_LastHitGroup ) { @@ -374,11 +374,11 @@ Activity CBaseMonster::GetDeathActivity( void ) case HITGROUP_GENERIC: // try to pick a death based on attack direction fTriedDirection = TRUE; - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -387,11 +387,11 @@ Activity CBaseMonster::GetDeathActivity( void ) // try to pick a death based on attack direction fTriedDirection = TRUE; - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -410,11 +410,11 @@ Activity CBaseMonster::GetDeathActivity( void ) else { // cannot perform the ideal region-specific death, so try a direction. - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -430,9 +430,9 @@ Activity CBaseMonster::GetDeathActivity( void ) if( deathActivity == ACT_DIEFORWARD ) { // make sure there's room to fall forward - UTIL_TraceHull( vecSrc, vecSrc + gpGlobals->v_forward * 64, dont_ignore_monsters, head_hull, edict(), &tr ); + UTIL_TraceHull( vecSrc, vecSrc + gpGlobals->v_forward * 64.0f, dont_ignore_monsters, head_hull, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { deathActivity = ACT_DIESIMPLE; } @@ -441,9 +441,9 @@ Activity CBaseMonster::GetDeathActivity( void ) if( deathActivity == ACT_DIEBACKWARD ) { // make sure there's room to fall backward - UTIL_TraceHull( vecSrc, vecSrc - gpGlobals->v_forward * 64, dont_ignore_monsters, head_hull, edict(), &tr ); + UTIL_TraceHull( vecSrc, vecSrc - gpGlobals->v_forward * 64.0f, dont_ignore_monsters, head_hull, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { deathActivity = ACT_DIESIMPLE; } @@ -464,7 +464,7 @@ Activity CBaseMonster::GetSmallFlinchActivity( void ) fTriedDirection = FALSE; UTIL_MakeVectors( pev->angles ); - //flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 ); + //flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f ); switch( m_LastHitGroup ) { @@ -515,9 +515,9 @@ void CBaseMonster::BecomeDead( void ) // make the corpse fly away from the attack vector pev->movetype = MOVETYPE_TOSS; //pev->flags &= ~FL_ONGROUND; - //pev->origin.z += 2; - //pev->velocity = g_vecAttackDir * -1; - //pev->velocity = pev->velocity * RANDOM_FLOAT( 300, 400 ); + //pev->origin.z += 2.0f; + //pev->velocity = g_vecAttackDir * -1.0f; + //pev->velocity = pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); } BOOL CBaseMonster::ShouldGibMonster( int iGib ) @@ -534,12 +534,12 @@ void CBaseMonster::CallGibMonster( void ) if( HasHumanGibs() ) { - if( CVAR_GET_FLOAT( "violence_hgibs" ) == 0 ) + if( CVAR_GET_FLOAT( "violence_hgibs" ) == 0.0f ) fade = TRUE; } else if( HasAlienGibs() ) { - if( CVAR_GET_FLOAT( "violence_agibs" ) == 0 ) + if( CVAR_GET_FLOAT( "violence_agibs" ) == 0.0f ) fade = TRUE; } @@ -639,7 +639,7 @@ void CBaseEntity::SUB_StartFadeOut( void ) pev->solid = SOLID_NOT; pev->avelocity = g_vecZero; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_FadeOut ); } @@ -648,12 +648,12 @@ void CBaseEntity::SUB_FadeOut( void ) if( pev->renderamt > 7 ) { pev->renderamt -= 7; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { pev->renderamt = 0; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; SetThink( &CBaseEntity::SUB_Remove ); } } @@ -687,7 +687,7 @@ void CGib::WaitTillLand( void ) else { // wait and check again in another half second. - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } } @@ -704,18 +704,18 @@ void CGib::BounceGibTouch( CBaseEntity *pOther ) if( pev->flags & FL_ONGROUND ) { - pev->velocity = pev->velocity * 0.9; - pev->angles.x = 0; - pev->angles.z = 0; - pev->avelocity.x = 0; - pev->avelocity.z = 0; + pev->velocity = pev->velocity * 0.9f; + pev->angles.x = 0.0f; + pev->angles.z = 0.0f; + pev->avelocity.x = 0.0f; + pev->avelocity.z = 0.0f; } else { if( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED ) { - vecSpot = pev->origin + Vector( 0, 0, 8 );//move up a bit, and trace down. - UTIL_TraceLine( vecSpot, vecSpot + Vector( 0, 0, -24 ), ignore_monsters, ENT( pev ), &tr ); + vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f );//move up a bit, and trace down. + UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -24.0f ), ignore_monsters, ENT( pev ), &tr ); UTIL_BloodDecalTrace( &tr, m_bloodColor ); @@ -727,7 +727,7 @@ void CGib::BounceGibTouch( CBaseEntity *pOther ) float volume; float zvel = fabs( pev->velocity.z ); - volume = 0.8 * Q_min( 1.0, ( (float)zvel ) / 450.0 ); + volume = 0.8f * Q_min( 1.0f, zvel / 450.0f ); CBreakable::MaterialSoundRandom( edict(), (Materials)m_material, volume ); } @@ -743,7 +743,7 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) TraceResult tr; SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 10; + pev->nextthink = gpGlobals->time + 10.0f; if( !FClassnameIs( pOther->pev, "worldspawn" ) ) { @@ -751,11 +751,11 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) return; } - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 32, ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 32.0f, ignore_monsters, ENT( pev ), &tr ); UTIL_BloodDecalTrace( &tr, m_bloodColor ); - pev->velocity = tr.vecPlaneNormal * -1; + pev->velocity = tr.vecPlaneNormal * -1.0f; pev->angles = UTIL_VecToAngles( pev->velocity ); pev->velocity = g_vecZero; pev->avelocity = g_vecZero; @@ -768,7 +768,7 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) void CGib::Spawn( const char *szGibModel ) { pev->movetype = MOVETYPE_BOUNCE; - pev->friction = 0.55; // deading the bounce a bit + pev->friction = 0.55f; // deading the bounce a bit // sometimes an entity inherits the edict from a former piece of glass, // and will spawn using the same render FX or rendermode! bad! @@ -781,7 +781,7 @@ void CGib::Spawn( const char *szGibModel ) SET_MODEL( ENT( pev ), szGibModel ); UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - pev->nextthink = gpGlobals->time + 4; + pev->nextthink = gpGlobals->time + 4.0f; m_lifeTime = 25; SetThink( &CGib::WaitTillLand ); SetTouch( &CGib::BounceGibTouch ); @@ -927,7 +927,7 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f } else { - m_vecEnemyLKP = pev->origin + ( g_vecAttackDir * 64 ); + m_vecEnemyLKP = pev->origin + ( g_vecAttackDir * 64.0f ); } MakeIdealYaw( m_vecEnemyLKP ); @@ -935,12 +935,12 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f // add pain to the conditions // !!!HACKHACK - fudged for now. Do we want to have a virtual function to determine what is light and // heavy damage per monster class? - if( flDamage > 0 ) + if( flDamage > 0.0f ) { SetConditions( bits_COND_LIGHT_DAMAGE ); } - if( flDamage >= 20 ) + if( flDamage >= 20.0f ) { SetConditions( bits_COND_HEAVY_DAMAGE ); } @@ -965,7 +965,7 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke CBaseEntity *pInflictor = CBaseEntity::Instance( pevInflictor ); if( pInflictor ) { - vecDir = ( pInflictor->Center() - Vector ( 0, 0, 10 ) - Center() ).Normalize(); + vecDir = ( pInflictor->Center() - Vector ( 0.0f, 0.0f, 10.0f ) - Center() ).Normalize(); vecDir = g_vecAttackDir = vecDir.Normalize(); } } @@ -973,8 +973,8 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke #if 0// turn this back on when the bounding box issues are resolved. pev->flags &= ~FL_ONGROUND; - pev->origin.z += 1; - + pev->origin.z += 1.0f; + // let the damage scoot the corpse around a bit. if( !FNullEnt( pevInflictor ) && ( pevAttacker->solid != SOLID_TRIGGER ) ) { @@ -991,7 +991,7 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke return 0; } // Accumulate corpse gibbing damage, so you can gib with multiple hits - pev->health -= flDamage * 0.1; + pev->health -= flDamage * 0.1f; } return 1; @@ -999,11 +999,11 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke float CBaseMonster::DamageForce( float damage ) { - float force = damage * ( ( 32 * 32 * 72.0 ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5; + float force = damage * ( ( 32.0f * 32.0f * 72.0f ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5.0f; - if( force > 1000.0 ) + if( force > 1000.0f ) { - force = 1000.0; + force = 1000.0f; } return force; @@ -1023,11 +1023,11 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke if( flRadius ) falloff = flDamage / flRadius; else - falloff = 1.0; + falloff = 1.0f; int bInWater = ( UTIL_PointContents( vecSrc ) == CONTENTS_WATER ); - vecSrc.z += 1;// in case grenade is lying on the ground + vecSrc.z += 1.0f;// in case grenade is lying on the ground if( !pevAttacker ) pevAttacker = pevInflictor; @@ -1054,27 +1054,27 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke UTIL_TraceLine( vecSrc, vecSpot, dont_ignore_monsters, ENT( pevInflictor ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { // the explosion can 'see' this entity, so hurt them! if( tr.fStartSolid ) { // if we're stuck inside them, fixup the position and distance tr.vecEndPos = vecSrc; - tr.flFraction = 0.0; + tr.flFraction = 0.0f; } // decrease damage for an ent that's farther from the bomb. flAdjustedDamage = ( vecSrc - tr.vecEndPos ).Length() * falloff; flAdjustedDamage = flDamage - flAdjustedDamage; - if( flAdjustedDamage < 0 ) + if( flAdjustedDamage < 0.0f ) { - flAdjustedDamage = 0; + flAdjustedDamage = 0.0f; } // ALERT( at_console, "hit %s\n", STRING( pEntity->pev->classname ) ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { ClearMultiDamage(); pEntity->TraceAttack( pevInflictor, flAdjustedDamage, ( tr.vecEndPos - vecSrc ).Normalize(), &tr, bitsDamageType ); @@ -1091,12 +1091,12 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke void CBaseMonster::RadiusDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { - ::RadiusDamage( pev->origin, pevInflictor, pevAttacker, flDamage, flDamage * 2.5, iClassIgnore, bitsDamageType ); + ::RadiusDamage( pev->origin, pevInflictor, pevAttacker, flDamage, flDamage * 2.5f, iClassIgnore, bitsDamageType ); } void CBaseMonster::RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { - ::RadiusDamage( vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * 2.5, iClassIgnore, bitsDamageType ); + ::RadiusDamage( vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * 2.5f, iClassIgnore, bitsDamageType ); } //========================================================= @@ -1117,7 +1117,7 @@ CBaseEntity* CBaseMonster::CheckTraceHullAttack( float flDist, int iDamage, int UTIL_MakeAimVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -1219,7 +1219,7 @@ BOOL CBaseEntity::FVisible( CBaseEntity *pEntity ) UTIL_TraceLine( vecLookerOrigin, vecTargetOrigin, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { return FALSE;// Line of sight is not established } @@ -1242,7 +1242,7 @@ BOOL CBaseEntity::FVisible( const Vector &vecOrigin ) UTIL_TraceLine( vecLookerOrigin, vecOrigin, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { return FALSE;// Line of sight is not established } @@ -1259,7 +1259,7 @@ TraceAttack */ void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { - Vector vecOrigin = ptr->vecEndPos - vecDir * 4; + Vector vecOrigin = ptr->vecEndPos - vecDir * 4.0f; if( pev->takedamage ) { @@ -1281,7 +1281,7 @@ void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vec //========================================================= void CBaseMonster::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ) { - Vector vecOrigin = ptr->vecEndPos - vecDir * 4; + Vector vecOrigin = ptr->vecEndPos - vecDir * 4.0f; ALERT( at_console, "%d\n", ptr->iHitgroup ); @@ -1367,8 +1367,8 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin // get circular gaussian spread float x, y, z; do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while (z > 1); @@ -1388,7 +1388,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin if( IsPlayer() ) { // adjust tracer position for player - vecTracerSrc = vecSrc + Vector( 0, 0, -4 ) + gpGlobals->v_right * 2 + gpGlobals->v_forward * 16; + vecTracerSrc = vecSrc + Vector( 0.0f, 0.0f, -4.0f ) + gpGlobals->v_right * 2.0f + gpGlobals->v_forward * 16.0f; } else { @@ -1416,7 +1416,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin } } // do damage, paint decals - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); @@ -1463,7 +1463,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin } } // make bullet trails - UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) ); + UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0f ) ); } ApplyMultiDamage( pev, pevAttacker ); } @@ -1496,8 +1496,8 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi { //Use player's random seed. // get circular gaussian spread - x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 ); - y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 ); + x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f ); + y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f ); //z = x * x + y * y; Vector vecDir = vecDirShooting + @@ -1509,7 +1509,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( pev )/*pentIgnore*/, &tr ); // do damage, paint decals - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); @@ -1549,7 +1549,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi } } // make bullet trails - UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) ); + UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0f ) ); } ApplyMultiDamage( pev, pevAttacker ); @@ -1589,33 +1589,33 @@ void CBaseEntity::TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, i } } */ - if( flDamage < 10 ) + if( flDamage < 10.0f ) { - flNoise = 0.1; + flNoise = 0.1f; cCount = 1; } - else if( flDamage < 25 ) + else if( flDamage < 25.0f ) { - flNoise = 0.2; + flNoise = 0.2f; cCount = 2; } else { - flNoise = 0.3; + flNoise = 0.3f; cCount = 4; } for( i = 0; i < cCount; i++ ) { - vecTraceDir = vecDir * -1;// trace in the opposite direction the shot came from (the direction the shot is going) + vecTraceDir = vecDir * -1.0f;// trace in the opposite direction the shot came from (the direction the shot is going) vecTraceDir.x += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.y += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.z += RANDOM_FLOAT( -flNoise, flNoise ); - UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * -172, ignore_monsters, ENT( pev ), &Bloodtr ); + UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * -172.0f, ignore_monsters, ENT( pev ), &Bloodtr ); - if( Bloodtr.flFraction != 1.0 ) + if( Bloodtr.flFraction != 1.0f ) { UTIL_BloodDecalTrace( &Bloodtr, BloodColor() ); } @@ -1653,7 +1653,7 @@ void CBaseMonster::MakeDamageBloodDecal( int cCount, float flNoise, TraceResult vecTraceDir.y += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.z += RANDOM_FLOAT( -flNoise, flNoise ); - UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * 172, ignore_monsters, ENT( pev ), &Bloodtr ); + UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * 172.0f, ignore_monsters, ENT( pev ), &Bloodtr ); /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1668,7 +1668,7 @@ void CBaseMonster::MakeDamageBloodDecal( int cCount, float flNoise, TraceResult MESSAGE_END(); */ - if( Bloodtr.flFraction != 1.0 ) + if( Bloodtr.flFraction != 1.0f ) { UTIL_BloodDecalTrace( &Bloodtr, BloodColor() ); } diff --git a/dlls/controller.cpp b/dlls/controller.cpp index e1d57517..1f851766 100644 --- a/dlls/controller.cpp +++ b/dlls/controller.cpp @@ -190,9 +190,9 @@ void CController::Killed( entvars_t *pevAttacker, int iGib ) // shut off balls /* m_iBall[0] = 0; - m_iBallTime[0] = gpGlobals->time + 4.0; + m_iBallTime[0] = gpGlobals->time + 4.0f; m_iBall[1] = 0; - m_iBallTime[1] = gpGlobals->time + 4.0; + m_iBallTime[1] = gpGlobals->time + 4.0f; */ // fade balls @@ -281,9 +281,9 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_iBall[0] = 192; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 255; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_BALL_SHOOT: @@ -308,7 +308,7 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) CBaseMonster *pBall = (CBaseMonster*)Create( "controller_head_ball", vecStart, pev->angles, edict() ); - pBall->pev->velocity = Vector( 0, 0, 32 ); + pBall->pev->velocity = Vector( 0.0f, 0.0f, 32.0f ); pBall->m_hEnemy = m_hEnemy; m_iBall[0] = 0; @@ -319,23 +319,23 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) { AttackSound(); m_flShootTime = gpGlobals->time; - m_flShootEnd = m_flShootTime + atoi( pEvent->options ) / 15.0; + m_flShootEnd = m_flShootTime + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_POWERUP_FULL: { m_iBall[0] = 255; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 255; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_POWERUP_HALF: { m_iBall[0] = 192; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 192; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; default: @@ -352,14 +352,14 @@ void CController::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/controller.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_FLY; pev->flags |= FL_FLY; m_bloodColor = BLOOD_COLOR_GREEN; pev->health = gSkillData.controllerHealth; - pev->view_ofs = Vector( 0, 0, -2 );// position of the eyes relative to monster's origin. + pev->view_ofs = Vector( 0.0f, 0.0f, -2.0f );// position of the eyes relative to monster's origin. m_flFieldOfView = VIEW_FIELD_FULL;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; @@ -409,8 +409,8 @@ void CController::UpdateOnRemove() // Chase enemy schedule Task_t tlControllerChaseEnemy[] = { - { TASK_GET_PATH_TO_ENEMY, (float)128 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_GET_PATH_TO_ENEMY, 128.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, }; Schedule_t slControllerChaseEnemy[] = @@ -427,10 +427,10 @@ Schedule_t slControllerChaseEnemy[] = Task_t tlControllerStrafe[] = { - { TASK_WAIT, (float)0.2 }, - { TASK_GET_PATH_TO_ENEMY, (float)128 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_WAIT, (float)1 }, + { TASK_WAIT, 0.2f }, + { TASK_GET_PATH_TO_ENEMY, 128.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_WAIT, 1.0f }, }; Schedule_t slControllerStrafe[] = @@ -446,10 +446,10 @@ Schedule_t slControllerStrafe[] = Task_t tlControllerTakeCover[] = { - { TASK_WAIT, (float)0.2 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_WAIT, (float)1 }, + { TASK_WAIT, 0.2f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_WAIT, 1.0f }, }; Schedule_t slControllerTakeCover[] = @@ -504,7 +504,7 @@ void CController::StartTask( Task_t *pTask ) break; case TASK_GET_PATH_TO_ENEMY_LKP: { - if( BuildNearestRoute( m_vecEnemyLKP, pev->view_ofs, pTask->flData, (m_vecEnemyLKP - pev->origin).Length() + 1024 ) ) + if( BuildNearestRoute( m_vecEnemyLKP, pev->view_ofs, pTask->flData, (m_vecEnemyLKP - pev->origin).Length() + 1024.0f ) ) { TaskComplete(); } @@ -526,7 +526,7 @@ void CController::StartTask( Task_t *pTask ) return; } - if( BuildNearestRoute( pEnemy->pev->origin, pEnemy->pev->view_ofs, pTask->flData, ( pEnemy->pev->origin - pev->origin).Length() + 1024 ) ) + if( BuildNearestRoute( pEnemy->pev->origin, pEnemy->pev->view_ofs, pTask->flData, ( pEnemy->pev->origin - pev->origin).Length() + 1024.0f ) ) { TaskComplete(); } @@ -559,8 +559,8 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) } else { - t = b * b - 4 * a * c; - t = sqrt( t ) / ( 2.0 * a ); + t = b * b - 4.0f * a * c; + t = sqrt( t ) / ( 2.0f * a ); float t1 = -b +t; float t2 = -b -t; @@ -572,10 +572,10 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) // ALERT( at_console, "Intersect %f\n", t ); - if( t < 0.1 ) - t = 0.1; - if( t > 10.0 ) - t = 10.0; + if( t < 0.1f ) + t = 0.1f; + if( t > 10.0f ) + t = 10.0f; Vector vecHit = vecTo + vecMove * t; return vecHit.Normalize() * flSpeed; @@ -583,7 +583,7 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) int CController::LookupFloat() { - if( m_velocity.Length() < 32.0 ) + if( m_velocity.Length() < 32.0f ) { return LookupSequence( "up" ); } @@ -636,21 +636,21 @@ void CController::RunTask( Task_t *pTask ) { if( HasConditions( bits_COND_SEE_ENEMY ) ) { - m_vecEstVelocity = m_vecEstVelocity * 0.5 + m_hEnemy->pev->velocity * 0.5; + m_vecEstVelocity = m_vecEstVelocity * 0.5f + m_hEnemy->pev->velocity * 0.5f; } else { - m_vecEstVelocity = m_vecEstVelocity * 0.8; + m_vecEstVelocity = m_vecEstVelocity * 0.8f; } vecDir = Intersect( vecSrc, m_hEnemy->BodyTarget( pev->origin ), m_vecEstVelocity, gSkillData.controllerSpeedBall ); - float delta = 0.03490; // +-2 degree + float delta = 0.03490f; // +-2 degree vecDir = vecDir + Vector( RANDOM_FLOAT( -delta, delta ), RANDOM_FLOAT( -delta, delta ), RANDOM_FLOAT( -delta, delta ) ) * gSkillData.controllerSpeedBall; vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); CBaseMonster *pBall = (CBaseMonster*)Create( "controller_energy_ball", vecSrc, pev->angles, edict() ); pBall->pev->velocity = vecDir; } - m_flShootTime += 0.2; + m_flShootTime += 0.2f; } if( m_flShootTime > m_flShootEnd ) @@ -725,7 +725,7 @@ Schedule_t *CController::GetSchedule( void ) { case MONSTERSTATE_COMBAT: { - // Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0 ); + // Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0f ); // dead enemy if( HasConditions( bits_COND_LIGHT_DAMAGE ) ) @@ -777,7 +777,7 @@ Schedule_t *CController::GetScheduleOfType( int Type ) //========================================================= BOOL CController::CheckRangeAttack1( float flDot, float flDist ) { - if( flDot > 0.5 && flDist > 256 && flDist <= 2048 ) + if( flDot > 0.5f && flDist > 256.0f && flDist <= 2048.0f ) { return TRUE; } @@ -786,7 +786,7 @@ BOOL CController::CheckRangeAttack1( float flDot, float flDist ) BOOL CController::CheckRangeAttack2( float flDot, float flDist ) { - if( flDot > 0.5 && flDist > 64 && flDist <= 2048 ) + if( flDot > 0.5f && flDist > 64.0f && flDist <= 2048.0f ) { return TRUE; } @@ -805,10 +805,10 @@ void CController::SetActivity( Activity NewActivity ) switch( m_Activity ) { case ACT_WALK: - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; break; default: - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; break; } } @@ -831,14 +831,14 @@ void CController::RunAI( void ) m_pBall[i] = CSprite::SpriteCreate( "sprites/xspark4.spr", pev->origin, TRUE ); m_pBall[i]->SetTransparency( kRenderGlow, 255, 255, 255, 255, kRenderFxNoDissipation ); m_pBall[i]->SetAttachment( edict(), ( i + 3 ) ); - m_pBall[i]->SetScale( 1.0 ); + m_pBall[i]->SetScale( 1.0f ); } float t = m_iBallTime[i] - gpGlobals->time; - if( t > 0.1 ) - t = 0.1 / t; + if( t > 0.1f ) + t = 0.1f / t; else - t = 1.0; + t = 1.0f; m_iBallCurrent[i] += ( m_iBall[i] - m_iBallCurrent[i] ) * t; @@ -912,9 +912,9 @@ void CController::Move( float flInterval ) // to that entity for the CheckLocalMove and Triangulate functions. pTargetEnt = NULL; - if( m_flGroundSpeed == 0 ) + if( m_flGroundSpeed == 0.0f ) { - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; // TaskFail(); // return; } @@ -966,7 +966,8 @@ void CController::Move( float flInterval ) { DispatchBlocked( edict(), pBlocker->edict() ); } - if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && (gpGlobals->time-m_flMoveWaitFinished) > 3.0 ) + + if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && (gpGlobals->time-m_flMoveWaitFinished) > 3.0f ) { // Can we still move toward our target? if( flDist < m_flGroundSpeed ) @@ -992,7 +993,7 @@ void CController::Move( float flInterval ) if( m_moveWaitTime > 0 ) { FRefreshRoute(); - m_flMoveWaitFinished = gpGlobals->time + m_moveWaitTime * 0.5; + m_flMoveWaitFinished = gpGlobals->time + m_moveWaitTime * 0.5f; } else { @@ -1030,10 +1031,10 @@ void CController::Move( float flInterval ) Stop(); RouteClear(); } - } while( flMoveDist > 0 && flCheckDist > 0 ); + } while( flMoveDist > 0.0f && flCheckDist > 0.0f ); // cut corner? - if( flWaypointDist < 128 ) + if( flWaypointDist < 128.0f ) { if( m_movementGoal == MOVEGOAL_ENEMY ) RouteSimplify( m_hEnemy ); @@ -1041,19 +1042,19 @@ void CController::Move( float flInterval ) RouteSimplify( m_hTargetEnt ); FRefreshRoute(); - if( m_flGroundSpeed > 100 ) - m_flGroundSpeed -= 40; + if( m_flGroundSpeed > 100.0f ) + m_flGroundSpeed -= 40.0f; } else { - if( m_flGroundSpeed < 400 ) - m_flGroundSpeed += 10; + if( m_flGroundSpeed < 400.0f ) + m_flGroundSpeed += 10.0f; } } BOOL CController::ShouldAdvanceRoute( float flWaypointDist ) { - if( flWaypointDist <= 32 ) + if( flWaypointDist <= 32.0f ) { return TRUE; } @@ -1076,7 +1077,7 @@ int CController::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd, C } // ALERT( at_console, "check %d %d %f\n", tr.fStartSolid, tr.fAllSolid, tr.flFraction ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { if( pTarget && pTarget->edict() == gpGlobals->trace_ent ) return LOCALMOVE_VALID; @@ -1096,7 +1097,7 @@ void CController::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, fl // float flTotal = m_flGroundSpeed * pev->framerate * flInterval; // UTIL_MoveToOrigin ( ENT( pev ), m_Route[m_iRouteIndex].vecLocation, flTotal, MOVE_STRAFE ); - m_velocity = m_velocity * 0.8 + m_flGroundSpeed * vecDir * 0.2; + m_velocity = m_velocity * 0.8f + m_flGroundSpeed * vecDir * 0.2f; UTIL_MoveToOrigin( ENT( pev ), pev->origin + m_velocity, m_velocity.Length() * flInterval, MOVE_STRAFE ); } @@ -1133,7 +1134,7 @@ void CControllerHeadBall::Spawn( void ) pev->rendercolor.y = 255; pev->rendercolor.z = 255; pev->renderamt = 255; - pev->scale = 2.0; + pev->scale = 2.0f; UTIL_SetSize(pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetOrigin( pev, pev->origin ); @@ -1143,7 +1144,7 @@ void CControllerHeadBall::Spawn( void ) m_vecIdeal = Vector( 0, 0, 0 ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_hOwner = Instance( pev->owner ); pev->dmgtime = gpGlobals->time; @@ -1158,7 +1159,7 @@ void CControllerHeadBall::Precache( void ) void CControllerHeadBall::HuntThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->renderamt -= 5; @@ -1219,12 +1220,12 @@ void CControllerHeadBall::HuntThink( void ) WRITE_BYTE( 10 ); // speed MESSAGE_END(); - UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.5, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) ); + UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.5f, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) ); - m_flNextAttack = gpGlobals->time + 3.0; + m_flNextAttack = gpGlobals->time + 3.0f; SetThink( &CControllerHeadBall::DieThink ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } //Crawl(); @@ -1239,31 +1240,31 @@ void CControllerHeadBall::MovetoTarget( Vector vecTarget ) { // accelerate float flSpeed = m_vecIdeal.Length(); - if( flSpeed == 0 ) + if( flSpeed == 0.0f ) { m_vecIdeal = pev->velocity; flSpeed = m_vecIdeal.Length(); } - if( flSpeed > 400 ) + if( flSpeed > 400.0f ) { - m_vecIdeal = m_vecIdeal.Normalize() * 400; + m_vecIdeal = m_vecIdeal.Normalize() * 400.0f; } - m_vecIdeal = m_vecIdeal + ( vecTarget - pev->origin ).Normalize() * 100; + m_vecIdeal = m_vecIdeal + ( vecTarget - pev->origin ).Normalize() * 100.0f; pev->velocity = m_vecIdeal; } void CControllerHeadBall::Crawl( void ) { - Vector vecAim = Vector( RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ) ).Normalize(); - Vector vecPnt = pev->origin + pev->velocity * 0.3 + vecAim * 64; + Vector vecAim = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ) ).Normalize(); + Vector vecPnt = pev->origin + pev->velocity * 0.3f + vecAim * 64.0f; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_BEAMENTPOINT ); WRITE_SHORT( entindex() ); - WRITE_COORD( vecPnt.x); - WRITE_COORD( vecPnt.y); - WRITE_COORD( vecPnt.z); + WRITE_COORD( vecPnt.x ); + WRITE_COORD( vecPnt.y ); + WRITE_COORD( vecPnt.z ); WRITE_SHORT( g_sModelIndexLaser ); WRITE_BYTE( 0 ); // frame start WRITE_BYTE( 10 ); // framerate @@ -1286,7 +1287,7 @@ void CControllerHeadBall::BounceTouch( CBaseEntity *pOther ) float n = -DotProduct( tr.vecPlaneNormal, vecDir ); - vecDir = 2.0 * tr.vecPlaneNormal * n + vecDir; + vecDir = 2.0f * tr.vecPlaneNormal * n + vecDir; m_vecIdeal = vecDir * m_vecIdeal.Length(); } @@ -1316,7 +1317,7 @@ void CControllerZapBall::Spawn( void ) pev->rendercolor.y = 255; pev->rendercolor.z = 255; pev->renderamt = 255; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetOrigin( pev, pev->origin ); @@ -1326,7 +1327,7 @@ void CControllerZapBall::Spawn( void ) m_hOwner = Instance( pev->owner ); pev->dmgtime = gpGlobals->time; // keep track of when ball spawned - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CControllerZapBall::Precache( void ) @@ -1338,11 +1339,11 @@ void CControllerZapBall::Precache( void ) void CControllerZapBall::AnimateThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = ( (int)pev->frame + 1 ) % 11; - if( gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10 ) + if( gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10.0f ) { SetTouch( NULL ); UTIL_Remove( this ); @@ -1367,10 +1368,10 @@ void CControllerZapBall::ExplodeTouch( CBaseEntity *pOther ) } ClearMultiDamage(); - pOther->TraceAttack(pevOwner, gSkillData.controllerDmgBall, pev->velocity.Normalize(), &tr, DMG_ENERGYBEAM ); + pOther->TraceAttack( pevOwner, gSkillData.controllerDmgBall, pev->velocity.Normalize(), &tr, DMG_ENERGYBEAM ); ApplyMultiDamage( pevOwner, pevOwner ); - UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.3, ATTN_NORM, 0, RANDOM_LONG( 90, 99 ) ); + UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.3f, ATTN_NORM, 0, RANDOM_LONG( 90, 99 ) ); } UTIL_Remove( this ); diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index c3f73f4f..f0526188 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -67,7 +67,7 @@ void CCrossbowBolt::Spawn() pev->movetype = MOVETYPE_FLY; pev->solid = SOLID_BBOX; - pev->gravity = 0.5; + pev->gravity = 0.5f; SET_MODEL( ENT( pev ), "models/crossbow_bolt.mdl" ); @@ -76,7 +76,7 @@ void CCrossbowBolt::Spawn() SetTouch( &CCrossbowBolt::BoltTouch ); SetThink( &CCrossbowBolt::BubbleThink ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; } void CCrossbowBolt::Precache() @@ -140,7 +140,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) } else { - EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT( 0.95, 1.0 ), ATTN_NORM, 0, 98 + RANDOM_LONG( 0, 7 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT( 0.95f, 1.0f ), ATTN_NORM, 0, 98 + RANDOM_LONG( 0, 7 ) ); SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time;// this will get changed below if the bolt is allowed to stick in what it hit. @@ -149,25 +149,25 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) { // if what we hit is static architecture, can stay around for a while. Vector vecDir = pev->velocity.Normalize(); - UTIL_SetOrigin( pev, pev->origin - vecDir * 12 ); + UTIL_SetOrigin( pev, pev->origin - vecDir * 12.0f ); pev->angles = UTIL_VecToAngles( vecDir ); pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_FLY; pev->velocity = Vector( 0, 0, 0 ); pev->avelocity.z = 0; pev->angles.z = RANDOM_LONG( 0, 360 ); - pev->nextthink = gpGlobals->time + 10.0; + pev->nextthink = gpGlobals->time + 10.0f; } else if( pOther->pev->movetype == MOVETYPE_PUSH || pOther->pev->movetype == MOVETYPE_PUSHSTEP ) { Vector vecDir = pev->velocity.Normalize(); - UTIL_SetOrigin( pev, pev->origin - vecDir * 12 ); + UTIL_SetOrigin( pev, pev->origin - vecDir * 12.0f ); pev->angles = UTIL_VecToAngles( vecDir ); pev->solid = SOLID_NOT; pev->velocity = Vector( 0, 0, 0 ); pev->avelocity.z = 0; pev->angles.z = RANDOM_LONG( 0, 360 ); - pev->nextthink = gpGlobals->time + 10.0; + pev->nextthink = gpGlobals->time + 10.0f; if (gPhysicsInterfaceInitialized) { // g-cont. Setup movewith feature @@ -185,18 +185,18 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) if( g_pGameRules->IsMultiplayer() ) { SetThink( &CCrossbowBolt::ExplodeThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } void CCrossbowBolt::BubbleThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->waterlevel == 0 ) return; - UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1, pev->origin, 1 ); + UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1f, pev->origin, 1 ); } void CCrossbowBolt::ExplodeThink( void ) @@ -328,7 +328,7 @@ void CCrossbow::Holster( int skiplocal /* = 0 */ ) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_iClip ) SendWeaponAnim( CROSSBOW_HOLSTER1 ); else @@ -353,7 +353,7 @@ void CCrossbow::PrimaryAttack( void ) // this function only gets called in multiplayer void CCrossbow::FireSniperBolt() { - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); if( m_iClip == 0 ) { @@ -373,14 +373,14 @@ void CCrossbow::FireSniperBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); Vector anglesAim = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle; UTIL_MakeVectors( anglesAim ); - Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2; + Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2.0f; Vector vecDir = gpGlobals->v_forward; UTIL_TraceLine( vecSrc, vecSrc + vecDir * 8192, dont_ignore_monsters, m_pPlayer->edict(), &tr ); @@ -416,7 +416,7 @@ void CCrossbow::FireBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -427,7 +427,7 @@ void CCrossbow::FireBolt() anglesAim.x = -anglesAim.x; #ifndef CLIENT_DLL - Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2; + Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2.0f; Vector vecDir = gpGlobals->v_forward; CCrossbowBolt *pBolt = CCrossbowBolt::BoltCreate(); @@ -445,21 +445,21 @@ void CCrossbow::FireBolt() pBolt->pev->velocity = vecDir * BOLT_AIR_VELOCITY; pBolt->pev->speed = BOLT_AIR_VELOCITY; } - pBolt->pev->avelocity.z = 10; + pBolt->pev->avelocity.z = 10.0f; #endif if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f; else - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; } void CCrossbow::SecondaryAttack() @@ -475,8 +475,8 @@ void CCrossbow::SecondaryAttack() m_fInZoom = 1; } - pev->nextthink = UTIL_WeaponTimeBase() + 0.1; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + pev->nextthink = UTIL_WeaponTimeBase() + 0.1f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; } void CCrossbow::Reload( void ) @@ -489,9 +489,9 @@ void CCrossbow::Reload( void ) SecondaryAttack(); } - if( DefaultReload( CROSSBOW_MAX_CLIP, CROSSBOW_RELOAD, 4.5 ) ) + if( DefaultReload( CROSSBOW_MAX_CLIP, CROSSBOW_RELOAD, 4.5f ) ) { - EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/xbow_reload1.wav", RANDOM_FLOAT( 0.95, 1.0 ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) ); + EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/xbow_reload1.wav", RANDOM_FLOAT( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) ); } } @@ -504,7 +504,7 @@ void CCrossbow::WeaponIdle( void ) if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) { float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + if( flRand <= 0.75f ) { if( m_iClip ) { @@ -521,12 +521,12 @@ void CCrossbow::WeaponIdle( void ) if( m_iClip ) { SendWeaponAnim( CROSSBOW_FIDGET1 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 30.0f; } else { SendWeaponAnim( CROSSBOW_FIDGET2 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 30.0f; } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); } diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 8a0ba9a3..f936bd2f 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -105,7 +105,7 @@ BOOL CCrowbar::Deploy() void CCrowbar::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( CROWBAR_HOLSTER ); } @@ -120,9 +120,9 @@ void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float *mins, f distance = 1e6f; - vecHullEnd = vecSrc + ( ( vecHullEnd - vecSrc ) * 2 ); + vecHullEnd = vecSrc + ( ( vecHullEnd - vecSrc ) * 2.0f ); UTIL_TraceLine( vecSrc, vecHullEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if( tmpTrace.flFraction < 1.0 ) + if( tmpTrace.flFraction < 1.0f ) { tr = tmpTrace; return; @@ -139,7 +139,7 @@ void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float *mins, f vecEnd.z = vecHullEnd.z + minmaxs[k][2]; UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if( tmpTrace.flFraction < 1.0 ) + if( tmpTrace.flFraction < 1.0f ) { float thisDistance = ( tmpTrace.vecEndPos - vecSrc ).Length(); if( thisDistance < distance ) @@ -159,7 +159,7 @@ void CCrowbar::PrimaryAttack() { #ifndef CLIENT_DLL SetThink( &CCrowbar::SwingAgain ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; #endif } } @@ -182,15 +182,15 @@ int CCrowbar::Swing( int fFirst ) UTIL_MakeVectors( m_pPlayer->pev->v_angle ); Vector vecSrc = m_pPlayer->GetGunPosition(); - Vector vecEnd = vecSrc + gpGlobals->v_forward * 32; + Vector vecEnd = vecSrc + gpGlobals->v_forward * 32.0f; UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); #ifndef CLIENT_DLL - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { // Calculate the point of intersection of the line (or hull) and the object we hit // This is and approximation of the "best" intersection @@ -204,11 +204,11 @@ int CCrowbar::Swing( int fFirst ) if( fFirst ) { PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usCrowbar, - 0.0, g_vecZero, g_vecZero, 0, 0, 0, + 0.0f, g_vecZero, g_vecZero, 0, 0, 0, 0, 0, 0 ); } - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { if( fFirst ) { @@ -245,7 +245,7 @@ int CCrowbar::Swing( int fFirst ) CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); // play thwack, smack, or dong sound - float flVol = 1.0; + float flVol = 1.0f; int fHitWorld = TRUE; if( pEntity ) @@ -255,9 +255,9 @@ int CCrowbar::Swing( int fFirst ) // 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( ( m_flNextPrimaryAttack + 1 == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) + if( ( m_flNextPrimaryAttack + 1.0f == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) #else - if( ( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) + if( ( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) #endif { // first swing does full damage @@ -266,7 +266,7 @@ int CCrowbar::Swing( int fFirst ) else { // subsequent swings do half - pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar / 2, gpGlobals->v_forward, &tr, DMG_CLUB ); + pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar * 0.5f, gpGlobals->v_forward, &tr, DMG_CLUB ); } ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); @@ -276,20 +276,22 @@ int CCrowbar::Swing( int fFirst ) switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod1.wav", 1.0f, ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod2.wav", 1.0f, ATTN_NORM ); break; case 2: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod3.wav", 1.0f, ATTN_NORM ); break; } + m_pPlayer->m_iWeaponVolume = CROWBAR_BODYHIT_VOLUME; + if( !pEntity->IsAlive() ) return TRUE; else - flVol = 0.1; + flVol = 0.1f; fHitWorld = FALSE; } @@ -300,14 +302,14 @@ int CCrowbar::Swing( int fFirst ) if( fHitWorld ) { - float fvolbar = TEXTURETYPE_PlaySound( &tr, vecSrc, vecSrc + ( vecEnd - vecSrc ) * 2, BULLET_PLAYER_CROWBAR ); + float fvolbar = TEXTURETYPE_PlaySound( &tr, vecSrc, vecSrc + ( vecEnd - vecSrc ) * 2.0f, BULLET_PLAYER_CROWBAR ); if( g_pGameRules->IsMultiplayer() ) { // override the volume here, cause we don't play texture sounds in multiplayer, // and fvolbar is going to be 0 from the above call. - fvolbar = 1; + fvolbar = 1.0f; } // also play crowbar strike @@ -328,9 +330,9 @@ int CCrowbar::Swing( int fFirst ) m_pPlayer->m_iWeaponVolume = (int)( flVol * CROWBAR_WALLHIT_VOLUME ); SetThink( &CCrowbar::Smack ); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; #endif - m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.25f ); } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -345,22 +347,22 @@ void CCrowbar::WeaponIdle( void ) { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand > 0.9 ) + if( flRand > 0.9f ) { iAnim = CROWBAR_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } else { - if( flRand > 0.5 ) + if( flRand > 0.5f ) { iAnim = CROWBAR_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; } else { iAnim = CROWBAR_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } } SendWeaponAnim( iAnim ); diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 9091d70a..235669af 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -89,9 +89,9 @@ TYPEDESCRIPTION CBaseDoor::m_SaveData[] = IMPLEMENT_SAVERESTORE( CBaseDoor, CBaseToggle ) -#define DOOR_SENTENCEWAIT 6 -#define DOOR_SOUNDWAIT 3 -#define BUTTON_SOUNDWAIT 0.5 +#define DOOR_SENTENCEWAIT 6.0f +#define DOOR_SOUNDWAIT 3.0f +#define BUTTON_SOUNDWAIT 0.5f // play door or button locked or unlocked sounds. // pass in pointer to valid locksound struct. @@ -119,9 +119,9 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton float fvol; if( fplaysound && fplaysentence ) - fvol = 0.25; + fvol = 0.25f; else - fvol = 1.0; + fvol = 1.0f; // if there is a locked sound, and we've debounced, play sound if( fplaysound ) @@ -138,7 +138,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton int iprev = pls->iLockedSentence; pls->iLockedSentence = SENTENCEG_PlaySequentialSz( ENT( pev ), STRING( pls->sLockedSentence ), - 0.85, ATTN_NORM, 0, 100, pls->iLockedSentence, FALSE ); + 0.85f, ATTN_NORM, 0, 100, pls->iLockedSentence, FALSE ); pls->iUnlockedSentence = 0; // make sure we don't keep calling last sentence in list @@ -157,9 +157,9 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton // if playing both sentence and sound, lower sound volume so we hear sentence if( fplaysound && fplaysentence ) - fvol = 0.25; + fvol = 0.25f; else - fvol = 1.0; + fvol = 1.0f; // play 'door unlocked' sound if set if( fplaysound ) @@ -174,7 +174,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton int iprev = pls->iUnlockedSentence; pls->iUnlockedSentence = SENTENCEG_PlaySequentialSz( ENT( pev ), STRING( pls->sUnlockedSentence ), - 0.85, ATTN_NORM, 0, 100, pls->iUnlockedSentence, FALSE ); + 0.85f, ATTN_NORM, 0, 100, pls->iUnlockedSentence, FALSE ); pls->iLockedSentence = 0; // make sure we don't keep calling last sentence in list @@ -231,7 +231,7 @@ void CBaseDoor::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "WaveHeight" ) ) { - pev->scale = atof( pkvd->szValue ) * ( 1.0 / 8.0 ); + pev->scale = atof( pkvd->szValue ) * ( 1.0f / 8.0f ); pkvd->fHandled = TRUE; } else @@ -293,13 +293,13 @@ void CBaseDoor::Spawn() UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); ASSERTSZ( m_vecPosition1 != m_vecPosition2, "door start/end positions are equal" ); if( FBitSet( pev->spawnflags, SF_DOOR_START_OPEN ) ) { @@ -611,7 +611,7 @@ void CBaseDoor::DoorGoUp( void ) SetMoveDone( &CBaseDoor::DoorHitTop ); if( FClassnameIs( pev, "func_door_rotating" ) ) // !!! BUGBUG Triggered doors don't work with this yet { - float sign = 1.0; + float sign = 1.0f; if( m_hActivator != 0 ) { @@ -621,14 +621,14 @@ void CBaseDoor::DoorGoUp( void ) { Vector vec = pevActivator->origin - pev->origin; Vector angles = pevActivator->angles; - angles.x = 0; - angles.z = 0; + angles.x = 0.0f; + angles.z = 0.0f; UTIL_MakeVectors( angles ); - //Vector vnext = ( pevToucher->origin + ( pevToucher->velocity * 10 ) ) - pev->origin; + //Vector vnext = ( pevToucher->origin + ( pevToucher->velocity * 10.f ) ) - pev->origin; UTIL_MakeVectors( pevActivator->angles ); - Vector vnext = ( pevActivator->origin + ( gpGlobals->v_forward * 10 ) ) - pev->origin; - if( ( vec.x * vnext.y - vec.y * vnext.x ) < 0 ) - sign = -1.0; + Vector vnext = ( pevActivator->origin + ( gpGlobals->v_forward * 10.f ) ) - pev->origin; + if( ( vec.x * vnext.y - vec.y * vnext.x ) < 0.0f ) + sign = -1.0f; } } AngularMove( m_vecAngle2*sign, pev->speed ); @@ -645,7 +645,7 @@ void CBaseDoor::DoorHitTop( void ) if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); } ASSERT( m_toggle_state == TS_GOING_UP ); @@ -664,9 +664,9 @@ void CBaseDoor::DoorHitTop( void ) pev->nextthink = pev->ltime + m_flWait; SetThink( &CBaseDoor::DoorGoDown ); - if( m_flWait == -1 ) + if( m_flWait == -1.0f ) { - pev->nextthink = -1; + pev->nextthink = -1.0f; } } @@ -684,7 +684,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, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1.0f, ATTN_NORM ); #ifdef DOOR_ASSERT ASSERT( m_toggle_state == TS_AT_TOP ); #endif // DOOR_ASSERT @@ -705,7 +705,7 @@ void CBaseDoor::DoorHitBottom( void ) if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); } ASSERT( m_toggle_state == TS_GOING_DOWN ); @@ -745,7 +745,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast - if( m_flWait >= 0 ) + if( m_flWait >= 0.0f ) { // BMod Start - Door sound fix. if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) @@ -778,7 +778,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) { pDoor = GetClassPtr( (CBaseDoor *)VARS( pentTarget ) ); - if( pDoor->m_flWait >= 0 ) + if( pDoor->m_flWait >= 0.0f ) { if( pDoor->pev->velocity == pev->velocity && pDoor->pev->avelocity == pev->velocity ) { @@ -866,8 +866,8 @@ void CRotDoor::Spawn( void ) // check for clockwise rotation if( FBitSet( pev->spawnflags, SF_DOOR_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; - + pev->movedir = pev->movedir * -1.0f; + //m_flWait = 2; who the hell did this? (sjb) m_vecAngle1 = pev->angles; m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance; @@ -883,8 +883,8 @@ void CRotDoor::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; // DOOR_START_OPEN is to allow an entity to be lighted in the closed position // but spawn in the open position @@ -895,7 +895,7 @@ void CRotDoor::Spawn( void ) Vector vecSav = m_vecAngle1; m_vecAngle2 = m_vecAngle1; m_vecAngle1 = vecSav; - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; } m_toggle_state = TS_AT_BOTTOM; @@ -958,14 +958,14 @@ void CMomentaryDoor::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; - if( pev->dmg == 0 ) - pev->dmg = 2; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; + if( pev->dmg == 0.0f ) + pev->dmg = 2.0f; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); ASSERTSZ( m_vecPosition1 != m_vecPosition2, "door start/end positions are equal" ); if( FBitSet( pev->spawnflags, SF_DOOR_START_OPEN ) ) @@ -1089,23 +1089,23 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( useType != USE_SET ) // Momentary buttons will pass down a float in here return; - if( value > 1.0 ) - value = 1.0; - if( value < 0.0 ) - value = 0.0; + if( value > 1.0f ) + value = 1.0f; + if( value < 0.0f ) + value = 0.0f; Vector move = m_vecPosition1 + ( value * ( m_vecPosition2 - m_vecPosition1 ) ); Vector delta = move - pev->origin; - //float speed = delta.Length() * 10; - float speed = delta.Length() / 0.1; // move there in 0.1 sec + //float speed = delta.Length() * 10.0f; + float speed = delta.Length() / 0.1f; // move there in 0.1 sec if( speed != 0 ) { // This entity only thinks when it moves, so if it's thinking, it's in the process of moving // play the sound when it starts moving(not yet thinking) - if( pev->nextthink < pev->ltime || pev->nextthink == 0 ) - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM ); + if( pev->nextthink < pev->ltime || pev->nextthink == 0.0f ) + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1.0f, ATTN_NORM ); // If we already moving to designated point, return else if( move == m_vecFinalDest ) return; @@ -1118,13 +1118,13 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP void CMomentaryDoor::MomentaryMoveDone( void ) { SetThink(&CMomentaryDoor::StopMoveSound); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } void CMomentaryDoor::StopMoveSound() { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); - pev->nextthink = -1; + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); + pev->nextthink = -1.0f; ResetThink(); } diff --git a/dlls/effects.cpp b/dlls/effects.cpp index bd12f8aa..e6ad257f 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -85,7 +85,7 @@ void CBubbling::Spawn( void ) if( !( pev->spawnflags & SF_BUBBLES_STARTOFF ) ) { SetThink( &CBubbling::FizzThink ); - pev->nextthink = gpGlobals->time + 2.0; + pev->nextthink = gpGlobals->time + 2.0f; m_state = 1; } else @@ -105,7 +105,7 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use if( m_state ) { SetThink( &CBubbling::FizzThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -145,9 +145,9 @@ void CBubbling::FizzThink( void ) MESSAGE_END(); if( m_frequency > 19 ) - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; else - pev->nextthink = gpGlobals->time + 2.5 - ( 0.1 * m_frequency ); + pev->nextthink = gpGlobals->time + 2.5f - ( 0.1f * m_frequency ); } // -------------------------------------------------- @@ -453,7 +453,7 @@ void CLightning::Spawn( void ) if( pev->dmg > 0 ) { SetThink( &CLightning::DamageThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } if( pev->targetname ) { @@ -479,7 +479,7 @@ void CLightning::Spawn( void ) if( FStringNull( pev->targetname ) || FBitSet( pev->spawnflags, SF_BEAM_STARTON ) ) { SetThink( &CLightning::StrikeThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } } } @@ -593,7 +593,7 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T else { SetThink( &CLightning::StrikeThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } if( !FBitSet( pev->spawnflags, SF_BEAM_TOGGLE ) ) @@ -615,7 +615,7 @@ void CLightning::StrikeThink( void ) if( m_life != 0 ) { if( pev->spawnflags & SF_BEAM_RANDOM ) - pev->nextthink = gpGlobals->time + m_life + RANDOM_FLOAT( 0, m_restrike ); + pev->nextthink = gpGlobals->time + m_life + RANDOM_FLOAT( 0.0f, m_restrike ); else pev->nextthink = gpGlobals->time + m_life + m_restrike; } @@ -695,7 +695,7 @@ void CLightning::StrikeThink( void ) WRITE_SHORT( m_spriteTexture ); WRITE_BYTE( m_frameStart ); // framestart WRITE_BYTE( (int)pev->framerate ); // framerate - WRITE_BYTE( (int)( m_life * 10.0 ) ); // life + WRITE_BYTE( (int)( m_life * 10.0f ) ); // life WRITE_BYTE( m_boltWidth ); // width WRITE_BYTE( m_noiseAmplitude ); // noise WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b @@ -717,7 +717,7 @@ void CLightning::StrikeThink( void ) void CBeam::BeamDamage( TraceResult *ptr ) { RelinkBeam(); - if( ptr->flFraction != 1.0 && ptr->pHit != NULL ) + if( ptr->flFraction != 1.0f && ptr->pHit != NULL ) { CBaseEntity *pHit = CBaseEntity::Instance( ptr->pHit ); if( pHit ) @@ -737,7 +737,7 @@ void CBeam::BeamDamage( TraceResult *ptr ) void CLightning::DamageThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; TraceResult tr; UTIL_TraceLine( GetStartPos(), GetEndPos(), dont_ignore_monsters, NULL, &tr ); BeamDamage( &tr ); @@ -757,7 +757,7 @@ void CLightning::Zap( const Vector &vecSrc, const Vector &vecDest ) WRITE_SHORT( m_spriteTexture ); WRITE_BYTE( m_frameStart ); // framestart WRITE_BYTE( (int)pev->framerate ); // framerate - WRITE_BYTE( (int)( m_life * 10.0) ); // life + WRITE_BYTE( (int)( m_life * 10.0f ) ); // life WRITE_BYTE( m_boltWidth ); // width WRITE_BYTE( m_noiseAmplitude ); // noise WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b @@ -792,32 +792,32 @@ void CLightning::RandomArea( void ) { Vector vecSrc = pev->origin; - Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir1 = vecDir1.Normalize(); TraceResult tr1; UTIL_TraceLine( vecSrc, vecSrc + vecDir1 * m_radius, ignore_monsters, ENT( pev ), &tr1 ); - if( tr1.flFraction == 1.0 ) + if( tr1.flFraction == 1.0f ) continue; Vector vecDir2; do { - vecDir2 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); - } while( DotProduct( vecDir1, vecDir2 ) > 0 ); + vecDir2 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); + } while( DotProduct( vecDir1, vecDir2 ) > 0.0f ); vecDir2 = vecDir2.Normalize(); TraceResult tr2; UTIL_TraceLine( vecSrc, vecSrc + vecDir2 * m_radius, ignore_monsters, ENT( pev ), &tr2 ); - if( tr2.flFraction == 1.0 ) + if( tr2.flFraction == 1.0f ) continue; - if( ( tr1.vecEndPos - tr2.vecEndPos ).Length() < m_radius * 0.1 ) + if( ( tr1.vecEndPos - tr2.vecEndPos ).Length() < m_radius * 0.1f ) continue; UTIL_TraceLine( tr1.vecEndPos, tr2.vecEndPos, ignore_monsters, ENT( pev ), &tr2 ); - if( tr2.flFraction != 1.0 ) + if( tr2.flFraction != 1.0f ) continue; Zap( tr1.vecEndPos, tr2.vecEndPos ); @@ -832,15 +832,15 @@ void CLightning::RandomPoint( Vector &vecSrc ) for( iLoops = 0; iLoops < 10; iLoops++ ) { - Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir1 = vecDir1.Normalize(); TraceResult tr1; UTIL_TraceLine( vecSrc, vecSrc + vecDir1 * m_radius, ignore_monsters, ENT( pev ), &tr1 ); - if( ( tr1.vecEndPos - vecSrc ).Length() < m_radius * 0.1 ) + if( ( tr1.vecEndPos - vecSrc ).Length() < m_radius * 0.1f ) continue; - if( tr1.flFraction == 1.0 ) + if( tr1.flFraction == 1.0f ) continue; Zap( vecSrc, tr1.vecEndPos ); @@ -1066,7 +1066,7 @@ void CLaser::StrikeThink( void ) UTIL_TraceLine( pev->origin, m_firePosition, dont_ignore_monsters, NULL, &tr ); FireAtPoint( tr ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } class CGlow : public CPointEntity @@ -1104,8 +1104,8 @@ void CGlow::Spawn( void ) SET_MODEL( ENT( pev ), STRING( pev->model ) ); m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; - if( m_maxFrame > 1.0 && pev->framerate != 0 ) - pev->nextthink = gpGlobals->time + 0.1; + if( m_maxFrame > 1.0f && pev->framerate != 0 ) + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1114,7 +1114,7 @@ void CGlow::Think( void ) { Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1197,7 +1197,7 @@ void CSprite::AnimateThink( void ) { Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1234,7 +1234,7 @@ void CSprite::ExpandThink( void ) } else { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } } @@ -1265,7 +1265,7 @@ void CSprite::TurnOff( void ) void CSprite::TurnOn( void ) { pev->effects = 0; - if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) + if( ( pev->framerate && m_maxFrame > 1.0f ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) { SetThink( &CSprite::AnimateThink ); pev->nextthink = gpGlobals->time; @@ -1422,9 +1422,9 @@ void CGibShooter::ShootThink( void ) vecShootDir = pev->movedir; - vecShootDir = vecShootDir + gpGlobals->v_right * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; - vecShootDir = vecShootDir + gpGlobals->v_forward * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; - vecShootDir = vecShootDir + gpGlobals->v_up * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_right * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_forward * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_up * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; vecShootDir = vecShootDir.Normalize(); CGib *pGib = CreateGib(); @@ -1434,12 +1434,12 @@ void CGibShooter::ShootThink( void ) pGib->pev->origin = pev->origin; pGib->pev->velocity = vecShootDir * m_flGibVelocity; - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); float thinkTime = pGib->pev->nextthink - gpGlobals->time; - pGib->m_lifeTime = ( m_flGibLife * RANDOM_FLOAT( 0.95, 1.05 ) ); // +/- 5% + pGib->m_lifeTime = ( m_flGibLife * RANDOM_FLOAT( 0.95f, 1.05f ) ); // +/- 5% if( pGib->m_lifeTime < thinkTime ) { pGib->pev->nextthink = gpGlobals->time + pGib->m_lifeTime; @@ -1584,7 +1584,7 @@ void CTestEffect::TestThink( void ) TraceResult tr; Vector vecSrc = pev->origin; - Vector vecDir = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir = vecDir.Normalize(); UTIL_TraceLine( vecSrc, vecSrc + vecDir * 128, ignore_monsters, ENT( pev ), &tr ); @@ -1598,7 +1598,7 @@ void CTestEffect::TestThink( void ) m_pBeam[m_iBeam] = pbeam; m_iBeam++; #if 0 - Vector vecMid = ( vecSrc + tr.vecEndPos ) * 0.5; + Vector vecMid = ( vecSrc + tr.vecEndPos ) * 0.5f; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_DLIGHT ); WRITE_COORD( vecMid.x ); // X @@ -1614,15 +1614,15 @@ void CTestEffect::TestThink( void ) #endif } - if( t < 3.0 ) + if( t < 3.0f ) { for( i = 0; i < m_iBeam; i++ ) { - t = ( gpGlobals->time - m_flBeamTime[i] ) / ( 3 + m_flStartTime - m_flBeamTime[i] ); - m_pBeam[i]->SetBrightness( (int)( 255 * t ) ); + t = ( gpGlobals->time - m_flBeamTime[i] ) / ( 3.0f + m_flStartTime - m_flBeamTime[i] ); + m_pBeam[i]->SetBrightness( (int)( 255.0f * t ) ); // m_pBeam[i]->SetScrollRate( 20 * t ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -1640,7 +1640,7 @@ void CTestEffect::TestThink( void ) void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CTestEffect::TestThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_flStartTime = gpGlobals->time; } @@ -1740,7 +1740,7 @@ Vector CBlood::BloodPosition( CBaseEntity *pActivator ) else pPlayer = g_engfuncs.pfnPEntityOfEntIndex( 1 ); if( pPlayer ) - return( pPlayer->v.origin + pPlayer->v.view_ofs ) + Vector( RANDOM_FLOAT( -10, 10 ), RANDOM_FLOAT( -10, 10 ), RANDOM_FLOAT( -10, 10 ) ); + return( pPlayer->v.origin + pPlayer->v.view_ofs ) + Vector( RANDOM_FLOAT( -10.0f, 10.0f ), RANDOM_FLOAT( -10.0f, 10.0f ), RANDOM_FLOAT( -10.0f, 10.0f ) ); } return pev->origin; @@ -1760,7 +1760,7 @@ void CBlood::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTyp TraceResult tr; UTIL_TraceLine( start, start + forward * BloodAmount() * 2, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) UTIL_BloodDecalTrace( &tr, Color() ); } } @@ -1998,8 +1998,8 @@ void CMessage::Spawn( void ) pev->impulse = 0; // No volume, use normal - if( pev->scale <= 0 ) - pev->scale = 1.0; + if( pev->scale <= 0.0f ) + pev->scale = 1.0f; } void CMessage::Precache( void ) @@ -2197,7 +2197,7 @@ void CItemSoda::Spawn( void ) UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); SetThink( &CItemSoda::CanThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CItemSoda::CanThink( void ) diff --git a/dlls/egon.cpp b/dlls/egon.cpp index 6f248309..a52e58ab 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -32,8 +32,8 @@ #define EGON_SOUND_RUN "weapons/egon_run3.wav" #define EGON_SOUND_STARTUP "weapons/egon_windup2.wav" -#define EGON_SWITCH_NARROW_TIME 0.75 // Time it takes to switch fire modes -#define EGON_SWITCH_WIDE_TIME 1.5 +#define EGON_SWITCH_NARROW_TIME 0.75f // Time it takes to switch fire modes +#define EGON_SWITCH_WIDE_TIME 1.5f enum egon_e { EGON_IDLE1 = 0, @@ -105,7 +105,7 @@ int CEgon::AddToPlayer( CBasePlayer *pPlayer ) void CEgon::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( EGON_HOLSTER ); EndAttack(); @@ -190,20 +190,20 @@ void CEgon::Attack( void ) { if( !HasAmmo() ) { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25f; PlayEmptySound( ); return; } m_flAmmoUseTime = gpGlobals->time;// start using ammo ASAP. - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, m_fireState, m_fireMode, 1, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 1, 0 ); m_shakeTime = 0; m_pPlayer->m_iWeaponVolume = EGON_PRIMARY_VOLUME; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; - pev->fuser1 = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1f; + pev->fuser1 = UTIL_WeaponTimeBase() + 2.0f; pev->dmgtime = gpGlobals->time + GetPulseInterval(); m_fireState = FIRE_CHARGE; @@ -216,14 +216,14 @@ void CEgon::Attack( void ) if( pev->fuser1 <= UTIL_WeaponTimeBase() ) { - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0, g_vecZero, g_vecZero, 0.0, 0.0, m_fireState, m_fireMode, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 0, 0 ); pev->fuser1 = 1000; } if( !HasAmmo() ) { EndAttack(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; } break; } @@ -238,12 +238,12 @@ void CEgon::PrimaryAttack( void ) void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) { - Vector vecDest = vecOrigSrc + vecDir * 2048; + Vector vecDest = vecOrigSrc + vecDir * 2048.0f; edict_t *pentIgnore; TraceResult tr; pentIgnore = m_pPlayer->edict(); - Vector tmpSrc = vecOrigSrc + gpGlobals->v_up * -8 + gpGlobals->v_right * 3; + Vector tmpSrc = vecOrigSrc + gpGlobals->v_up * -8.0f + gpGlobals->v_right * 3.0f; // ALERT( at_console, "." ); @@ -292,7 +292,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.1; + m_flAmmoUseTime = gpGlobals->time + 0.1f; } } else @@ -301,7 +301,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.166; + m_flAmmoUseTime = gpGlobals->time + 0.166f; } } @@ -325,7 +325,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( g_pGameRules->IsMultiplayer() ) { // radius damage a little more potent in multiplayer. - ::RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, gSkillData.plrDmgEgonWide/4, 128, CLASS_NONE, DMG_ENERGYBEAM | DMG_BLAST | DMG_ALWAYSGIB ); + ::RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, gSkillData.plrDmgEgonWide * 0.25f, 128, CLASS_NONE, DMG_ENERGYBEAM | DMG_BLAST | DMG_ALWAYSGIB ); } if( !m_pPlayer->IsAlive() ) @@ -337,7 +337,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.2; + m_flAmmoUseTime = gpGlobals->time + 0.2f; } } else @@ -346,15 +346,15 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.1; + m_flAmmoUseTime = gpGlobals->time + 0.1f; } } pev->dmgtime = gpGlobals->time + GetDischargeInterval(); if( m_shakeTime < gpGlobals->time ) { - UTIL_ScreenShake( tr.vecEndPos, 5.0, 150.0, 0.75, 250.0 ); - m_shakeTime = gpGlobals->time + 1.5; + UTIL_ScreenShake( tr.vecEndPos, 5.0f, 150.0f, 0.75f, 250.0f ); + m_shakeTime = gpGlobals->time + 1.5f; } } #endif @@ -384,12 +384,12 @@ void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, floa m_pBeam->SetWidth( (int)( 40 - ( timeBlend * 20 ) ) ); if( m_fireMode == FIRE_WIDE ) - m_pBeam->SetColor( (int)( 30 + ( 25 * timeBlend ) ), (int)( 30 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10 ) ) ) ); + m_pBeam->SetColor( (int)( 30 + ( 25 * timeBlend ) ), (int)( 30 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10.0f ) ) ) ); else - m_pBeam->SetColor( (int)( 60 + ( 25 * timeBlend ) ), (int)( 120 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time *10 ) ) ) ); + m_pBeam->SetColor( (int)( 60 + ( 25 * timeBlend ) ), (int)( 120 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10.0f ) ) ) ); UTIL_SetOrigin( m_pSprite->pev, endPoint ); - m_pSprite->pev->frame += 8 * gpGlobals->frametime; + m_pSprite->pev->frame += 8.0f * gpGlobals->frametime; if( m_pSprite->pev->frame > m_pSprite->Frames() ) m_pSprite->pev->frame = 0; @@ -480,17 +480,17 @@ void CEgon::WeaponIdle( void ) int iAnim; - float flRand = RANDOM_FLOAT( 0, 1 ); + float flRand = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRand <= 0.5 ) + if( flRand <= 0.5f ) { iAnim = EGON_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } else { iAnim = EGON_FIDGET1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } SendWeaponAnim( iAnim ); @@ -504,10 +504,10 @@ void CEgon::EndAttack( void ) if( m_fireState != FIRE_OFF ) //Checking the button just in case!. bMakeNoise = true; - PLAYBACK_EVENT_FULL( FEV_GLOBAL | FEV_RELIABLE, m_pPlayer->edict(), m_usEgonStop, 0, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, bMakeNoise, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_GLOBAL | FEV_RELIABLE, m_pPlayer->edict(), m_usEgonStop, 0.0f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0f, 0.0f, bMakeNoise, 0, 0, 0 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; m_fireState = FIRE_OFF; diff --git a/dlls/explode.cpp b/dlls/explode.cpp index f605dc02..a5815ddb 100644 --- a/dlls/explode.cpp +++ b/dlls/explode.cpp @@ -38,21 +38,21 @@ LINK_ENTITY_TO_CLASS( spark_shower, CShower ) void CShower::Spawn( void ) { - pev->velocity = RANDOM_FLOAT( 200, 300 ) * pev->angles; - pev->velocity.x += RANDOM_FLOAT( -100.f, 100.f ); - pev->velocity.y += RANDOM_FLOAT( -100.f, 100.f ); + pev->velocity = RANDOM_FLOAT( 200.0f, 300.0f ) * pev->angles; + pev->velocity.x += RANDOM_FLOAT( -100.0f, 100.0f ); + pev->velocity.y += RANDOM_FLOAT( -100.0f, 100.0f ); if( pev->velocity.z >= 0 ) - pev->velocity.z += 200; + pev->velocity.z += 200.0f; else - pev->velocity.z -= 200; + pev->velocity.z -= 200.0f; pev->movetype = MOVETYPE_BOUNCE; pev->gravity = 0.5; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->solid = SOLID_NOT; SET_MODEL( edict(), "models/grenade.mdl" ); // Need a model, just use the grenade, we don't draw it anyway UTIL_SetSize( pev, g_vecZero, g_vecZero ); pev->effects |= EF_NODRAW; - pev->speed = RANDOM_FLOAT( 0.5, 1.5 ); + pev->speed = RANDOM_FLOAT( 0.5f, 1.5f ); pev->angles = g_vecZero; } @@ -61,9 +61,9 @@ void CShower::Think( void ) { UTIL_Sparks( pev->origin ); - pev->speed -= 0.1; - if( pev->speed > 0 ) - pev->nextthink = gpGlobals->time + 0.1; + pev->speed -= 0.1f; + if( pev->speed > 0.0f ) + pev->nextthink = gpGlobals->time + 0.1f; else UTIL_Remove( this ); pev->flags &= ~FL_ONGROUND; @@ -72,12 +72,12 @@ void CShower::Think( void ) void CShower::Touch( CBaseEntity *pOther ) { if( pev->flags & FL_ONGROUND ) - pev->velocity = pev->velocity * 0.1; + pev->velocity = pev->velocity * 0.1f; else - pev->velocity = pev->velocity * 0.6; + pev->velocity = pev->velocity * 0.6f; - if( ( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ) < 10.0 ) - pev->speed = 0; + if( ( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ) < 10.0f ) + pev->speed = 0.0f; } class CEnvExplosion : public CBaseMonster @@ -130,17 +130,17 @@ void CEnvExplosion::Spawn( void ) */ float flSpriteScale; - flSpriteScale = ( m_iMagnitude - 50 ) * 0.6; + flSpriteScale = ( m_iMagnitude - 50 ) * 0.6f; /* - if( flSpriteScale > 50 ) + if( flSpriteScale > 50.0f ) { - flSpriteScale = 50; + flSpriteScale = 50.0f; } */ - if( flSpriteScale < 10 ) + if( flSpriteScale < 10.0f ) { - flSpriteScale = 10; + flSpriteScale = 10.0f; } m_spriteScale = (int)flSpriteScale; @@ -155,14 +155,14 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE Vector vecSpot;// trace starts here! - vecSpot = pev->origin + Vector( 0, 0, 8 ); + vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f ); - UTIL_TraceLine( vecSpot, vecSpot + Vector( 0, 0, -40 ), ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -40.0f ), ignore_monsters, ENT( pev ), &tr ); // Pull out of the wall a bit - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { - pev->origin = tr.vecEndPos + ( tr.vecPlaneNormal * ( m_iMagnitude - 24 ) * 0.6 ); + pev->origin = tr.vecEndPos + ( tr.vecPlaneNormal * ( m_iMagnitude - 24 ) * 0.6f ); } else { @@ -172,7 +172,7 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE // draw decal if( !( pev->spawnflags & SF_ENVEXPLOSION_NODECAL ) ) { - if( RANDOM_FLOAT( 0, 1 ) < 0.5 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) < 0.5f ) { UTIL_DecalTrace( &tr, DECAL_SCORCH1 ); } @@ -217,7 +217,7 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE } SetThink( &CEnvExplosion::Smoke ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; // draw sparks if( !( pev->spawnflags & SF_ENVEXPLOSION_NOSPARKS ) ) diff --git a/dlls/extdll.h b/dlls/extdll.h index 4610db5e..793c4a52 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -65,6 +65,10 @@ typedef int BOOL; #include "stddef.h" #include "math.h" +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + #if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) #define XASH_64BIT #endif diff --git a/dlls/flyingmonster.cpp b/dlls/flyingmonster.cpp index c9822898..424f1dec 100644 --- a/dlls/flyingmonster.cpp +++ b/dlls/flyingmonster.cpp @@ -36,18 +36,18 @@ int CFlyingMonster::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd TraceResult tr; - UTIL_TraceHull( vecStart + Vector( 0, 0, 32 ), vecEnd + Vector( 0, 0, 32 ), dont_ignore_monsters, large_hull, edict(), &tr ); + UTIL_TraceHull( vecStart + Vector( 0.0f, 0.0f, 32.0f ), vecEnd + Vector( 0.0f, 0.0f, 32.0f ), dont_ignore_monsters, large_hull, edict(), &tr ); // ALERT( at_console, "%.0f %.0f %.0f : ", vecStart.x, vecStart.y, vecStart.z ); // ALERT( at_console, "%.0f %.0f %.0f\n", vecEnd.x, vecEnd.y, vecEnd.z ); if( pflDist ) { - *pflDist = ( ( tr.vecEndPos - Vector( 0, 0, 32 ) ) - vecStart ).Length();// get the distance. + *pflDist = ( ( tr.vecEndPos - Vector( 0.0f, 0.0f, 32.0f ) ) - vecStart ).Length();// get the distance. } // ALERT( at_console, "check %d %d %f\n", tr.fStartSolid, tr.fAllSolid, tr.flFraction ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { if( pTarget && pTarget->edict() == gpGlobals->trace_ent ) return LOCALMOVE_VALID; @@ -78,8 +78,8 @@ void CFlyingMonster::Stop( void ) m_flightSpeed = 0; m_IdealActivity = stopped; } - pev->angles.z = 0; - pev->angles.x = 0; + pev->angles.z = 0.0f; + pev->angles.x = 0.0f; m_vecTravel = g_vecZero; } @@ -88,16 +88,16 @@ float CFlyingMonster::ChangeYaw( int speed ) if( pev->movetype == MOVETYPE_FLY ) { float diff = FlYawDiff(); - float target = 0; + float target = 0.0f; if( m_IdealActivity != GetStoppedActivity() ) { - if( diff < -20 ) - target = 90; - else if( diff > 20 ) - target = -90; + if( diff < -20.0f ) + target = 90.0f; + else if( diff > 20.0f ) + target = -90.0f; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0 * gpGlobals->frametime ); + pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * gpGlobals->frametime ); } return CBaseMonster::ChangeYaw( speed ); } @@ -141,7 +141,7 @@ BOOL CFlyingMonster::ShouldAdvanceRoute( float flWaypointDist ) if( m_Route[m_iRouteIndex].iType & bits_MF_IS_GOAL ) flWaypointDist = ( m_Route[m_iRouteIndex].vecLocation - pev->origin ).Length(); - if( flWaypointDist <= 64 + ( m_flGroundSpeed * gpGlobals->frametime ) ) + if( flWaypointDist <= 64.0f + ( m_flGroundSpeed * gpGlobals->frametime ) ) return TRUE; return FALSE; @@ -151,7 +151,7 @@ void CFlyingMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, { if( pev->movetype == MOVETYPE_FLY ) { - if( gpGlobals->time - m_stopTime > 1.0 ) + if( gpGlobals->time - m_stopTime > 1.0f ) { if( m_IdealActivity != m_movementActivity ) { @@ -163,12 +163,12 @@ void CFlyingMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, if( m_IdealActivity != m_movementActivity ) { - m_flightSpeed = UTIL_Approach( 100, m_flightSpeed, 75 * gpGlobals->frametime ); + m_flightSpeed = UTIL_Approach( 100, m_flightSpeed, 75.0f * gpGlobals->frametime ); if( m_flightSpeed < 100 ) m_stopTime = gpGlobals->time; } else - m_flightSpeed = UTIL_Approach( 20, m_flightSpeed, 300 * gpGlobals->frametime ); + m_flightSpeed = UTIL_Approach( 20, m_flightSpeed, 300.0f * gpGlobals->frametime ); if( CheckLocalMove( pev->origin, vecMove, pTargetEnt, NULL ) ) { @@ -193,10 +193,10 @@ float CFlyingMonster::CeilingZ( const Vector &position ) Vector minUp = position; Vector maxUp = position; - maxUp.z += 4096.0; + maxUp.z += 4096.0f; UTIL_TraceLine( position, maxUp, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) maxUp.z = tr.vecEndPos.z; if( ( pev->flags ) & FL_SWIM ) @@ -214,7 +214,7 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float // SWIMING & !WATER // or FLYING & WATER // - *pFraction = 0.0; + *pFraction = 0.0f; return TRUE; // We hit a water boundary because we are where we don't belong. } int conProbe = UTIL_PointContents( probe ); @@ -223,7 +223,7 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float // The probe is either entirely inside the water (for fish) or entirely // outside the water (for birds). // - *pFraction = 1.0; + *pFraction = 1.0f; return FALSE; } @@ -233,9 +233,9 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float float minProbeLength = 0; float diff = maxProbeLength - minProbeLength; - while( diff > 1.0 ) + while( diff > 1.0f ) { - float midProbeLength = minProbeLength + diff / 2.0; + float midProbeLength = minProbeLength + diff / 2.0f; Vector midProbeVec = midProbeLength * ProbeUnit; if( UTIL_PointContents( position + midProbeVec ) == conPosition ) { @@ -257,11 +257,11 @@ float CFlyingMonster::FloorZ( const Vector &position ) TraceResult tr; Vector down = position; - down.z -= 2048; + down.z -= 2048.0f; UTIL_TraceLine( position, down, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.vecEndPos.z; return down.z; diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 0cc3675f..27324260 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -271,7 +271,7 @@ void CBreakable::MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, pSoundList = MaterialSoundList( soundMaterial, soundCount ); if( soundCount ) - EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[RANDOM_LONG( 0, soundCount - 1 )], volume, 1.0 ); + EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[RANDOM_LONG( 0, soundCount - 1 )], volume, 1.0f ); } void CBreakable::Precache( void ) @@ -432,7 +432,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther ) if( FBitSet( pev->spawnflags, SF_BREAK_TOUCH ) ) { // can be broken when run into - flDamage = pevToucher->velocity.Length() * 0.01; + flDamage = pevToucher->velocity.Length() * 0.01f; if( flDamage >= pev->health ) { @@ -453,10 +453,10 @@ void CBreakable::BreakTouch( CBaseEntity *pOther ) SetThink( &CBreakable::Die ); SetTouch( NULL ); - if( m_flDelay == 0 ) + if( m_flDelay == 0.0f ) { // !!!BUGBUG - why doesn't zero delay work? - m_flDelay = 0.1; + m_flDelay = 0.1f; } pev->nextthink = pev->ltime + m_flDelay; @@ -491,7 +491,7 @@ void CBreakable::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec { UTIL_Sparks( ptr->vecEndPos ); - float flVolume = RANDOM_FLOAT( 0.7 , 1.0 );//random volume range + float flVolume = RANDOM_FLOAT( 0.7f, 1.0f );//random volume range switch( RANDOM_LONG( 0, 1 ) ) { case 0: @@ -504,7 +504,7 @@ void CBreakable::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec } break; case matUnbreakableGlass: - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 0.5, 1.5 ) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 0.5f, 1.5f ) ); break; default: break; @@ -527,7 +527,7 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // (that is, no actual entity projectile was involved in the attack so use the shooter's origin). if( pevAttacker == pevInflictor ) { - vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5 ) ); + vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5f ) ); // if a client hit the breakable with a crowbar, and breakable is crowbar-sensitive, break it now. if( FBitSet ( pevAttacker->flags, FL_CLIENT ) && @@ -537,7 +537,7 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo else // an actual missile was involved. { - vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5 ) ); + vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5f ) ); } if( !IsBreakable() ) @@ -545,11 +545,11 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // Breakables take double damage from the crowbar if( bitsDamageType & DMG_CLUB ) - flDamage *= 2; + flDamage *= 2.0f; // Boxes / glass / etc. don't take much poison damage, just the impact of the dart - consider that 10% if( bitsDamageType & DMG_POISON ) - flDamage *= 0.1; + flDamage *= 0.1f; // this global is still used for glass and other non-monster killables, along with decals. g_vecAttackDir = vecTemp.Normalize(); @@ -586,10 +586,10 @@ void CBreakable::Die( void ) // The more negative pev->health, the louder // the sound should be. - fvol = RANDOM_FLOAT( 0.85, 1.0 ) + ( fabs( pev->health ) / 100.0 ); + fvol = RANDOM_FLOAT( 0.85f, 1.0 ) + ( fabs( pev->health ) / 100.0f ); - if( fvol > 1.0 ) - fvol = 1.0; + if( fvol > 1.0f ) + fvol = 1.0f; switch( m_Material ) { @@ -667,7 +667,7 @@ void CBreakable::Die( void ) } if( m_Explosion == expDirected ) - vecVelocity = g_vecAttackDir * 200; + vecVelocity = g_vecAttackDir * 200.0f; else { vecVelocity.x = 0; @@ -675,7 +675,7 @@ void CBreakable::Die( void ) vecVelocity.z = 0; } - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL ); @@ -744,7 +744,7 @@ void CBreakable::Die( void ) SUB_UseTargets( NULL, USE_TOGGLE, 0 ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; if( m_iszSpawnObject ) CBaseEntity::Create( STRING( m_iszSpawnObject ), VecBModelOrigin( pev ), pev->angles, edict() ); @@ -838,7 +838,7 @@ void CPushable::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); // Multiply by area of the box's cross-section (assume 1000 units^3 standard volume) - pev->skin = (int)( ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005 ); + pev->skin = (int)( ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005f ); m_soundTime = 0; } @@ -862,11 +862,11 @@ void CPushable::KeyValue( KeyValueData *pkvd ) { case 0: // Point - UTIL_SetSize( pev, Vector( -8, -8, -8 ), Vector( 8, 8, 8 ) ); + UTIL_SetSize( pev, Vector( -8.0f, -8.0f, -8.0f ), Vector( 8.0f, 8.0f, 8.0f ) ); break; case 2: // Big Hull!?!? !!!BUGBUG Figure out what this hull really is - UTIL_SetSize( pev, VEC_DUCK_HULL_MIN*2, VEC_DUCK_HULL_MAX * 2 ); + UTIL_SetSize( pev, VEC_DUCK_HULL_MIN * 2.0f, VEC_DUCK_HULL_MAX * 2.0f ); break; case 3: // Player duck @@ -920,7 +920,7 @@ void CPushable::Move( CBaseEntity *pOther, int push ) { // Only push if floating if( pev->waterlevel > 0 ) - pev->velocity.z += pevToucher->velocity.z * 0.1; + pev->velocity.z += pevToucher->velocity.z * 0.1f; return; } @@ -943,13 +943,13 @@ void CPushable::Move( CBaseEntity *pOther, int push ) if( pev->waterlevel < 1 ) return; else - factor = 0.1; + factor = 0.1f; } else - factor = 1; + factor = 1.0f; } else - factor = 0.25; + factor = 0.25f; pev->velocity.x += pevToucher->velocity.x * factor; pev->velocity.y += pevToucher->velocity.y * factor; @@ -964,15 +964,15 @@ void CPushable::Move( CBaseEntity *pOther, int push ) { pevToucher->velocity.x = pev->velocity.x; pevToucher->velocity.y = pev->velocity.y; - if( ( gpGlobals->time - m_soundTime ) > 0.7 ) + if( ( gpGlobals->time - m_soundTime ) > 0.7f ) { m_soundTime = gpGlobals->time; if( length > 0 && FBitSet( pev->flags,FL_ONGROUND ) ) { m_lastSound = RANDOM_LONG( 0, 2 ); - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5f, ATTN_NORM ); //SetThink( &StopSound ); - //pev->nextthink = pev->ltime + 0.1; + //pev->nextthink = pev->ltime + 0.1f; } else STOP_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound] ); diff --git a/dlls/func_tank.cpp b/dlls/func_tank.cpp index a3dba841..fd6ff1e7 100644 --- a/dlls/func_tank.cpp +++ b/dlls/func_tank.cpp @@ -66,7 +66,7 @@ public: virtual int ObjectCaps( void ) { return CBaseEntity :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } inline BOOL IsActive( void ) { return (pev->spawnflags & SF_TANK_ACTIVE)?TRUE:FALSE; } - inline void TankActivate( void ) { pev->spawnflags |= SF_TANK_ACTIVE; pev->nextthink = pev->ltime + 0.1; m_fireLast = 0; } + inline void TankActivate( void ) { pev->spawnflags |= SF_TANK_ACTIVE; pev->nextthink = pev->ltime + 0.1f; m_fireLast = 0; } inline void TankDeactivate( void ) { pev->spawnflags &= ~SF_TANK_ACTIVE; m_fireLast = 0; StopRotSound(); } inline BOOL CanFire( void ) { return (gpGlobals->time - m_lastSightTime) < m_persist; } BOOL InRange( float range ); @@ -185,7 +185,7 @@ void CFuncTank::Spawn( void ) m_pitchCenter = pev->angles.x; if( IsActive() ) - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; m_sightOrigin = BarrelPosition(); // Point at the end of the barrel @@ -363,7 +363,7 @@ BOOL CFuncTank::StartControl( CBasePlayer *pController ) m_pController->m_iHideHUD |= HIDEHUD_WEAPONS; m_vecControllerUsePos = m_pController->pev->origin; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; return TRUE; } @@ -389,7 +389,7 @@ void CFuncTank::StopControl() m_pController = NULL; if( IsActive() ) - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; } // Called each frame by the player's ItemPostFrame @@ -405,7 +405,7 @@ void CFuncTank::ControllerPostFrame( void ) Vector vecForward; UTIL_MakeVectorsPrivate( pev->angles, vecForward, NULL, NULL ); - m_fireLast = gpGlobals->time - ( 1 / m_fireRate ) - 0.01; // to make sure the gun doesn't fire too many bullets + m_fireLast = gpGlobals->time - ( 1.0f / m_fireRate ) - 0.01f; // to make sure the gun doesn't fire too many bullets Fire( BarrelPosition(), vecForward, m_pController->pev ); @@ -413,7 +413,7 @@ void CFuncTank::ControllerPostFrame( void ) if( m_pController && m_pController->IsPlayer() ) ( (CBasePlayer *)m_pController )->m_iWeaponVolume = LOUD_GUN_VOLUME; - m_flNextAttack = gpGlobals->time + ( 1 / m_fireRate ); + m_flNextAttack = gpGlobals->time + ( 1.0f / m_fireRate ); } } ////////////// END NEW STUFF ////////////// @@ -491,19 +491,19 @@ void CFuncTank::TrackTarget( void ) // Tanks attempt to mirror the player's angles angles = m_pController->pev->v_angle; angles[0] = 0 - angles[0]; - pev->nextthink = pev->ltime + 0.05; + pev->nextthink = pev->ltime + 0.05f; } else { if( IsActive() ) - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; else return; if( FNullEnt( pPlayer ) ) { if( IsActive() ) - pev->nextthink = pev->ltime + 2; // Wait 2 secs + pev->nextthink = pev->ltime + 2.0f; // Wait 2 secs return; } pTarget = FindTarget( pPlayer ); @@ -520,7 +520,7 @@ void CFuncTank::TrackTarget( void ) UTIL_TraceLine( barrelEnd, targetPosition, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pTarget ) + if( tr.flFraction == 1.0f || tr.pHit == pTarget ) { CBaseEntity *pInstance = CBaseEntity::Instance(pTarget); if( InRange( range ) && pInstance && pInstance->IsAlive() ) @@ -626,12 +626,12 @@ void CFuncTank::AdjustAnglesForBarrel( Vector &angles, float distance ) if( m_barrelPos.y ) { r2 = m_barrelPos.y * m_barrelPos.y; - angles.y += ( 180.0 / M_PI ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); + angles.y += ( 180.0f / M_PI_F ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); } if( m_barrelPos.z ) { r2 = m_barrelPos.z * m_barrelPos.z; - angles.x += ( 180.0 / M_PI ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); + angles.x += ( 180.0f / M_PI_F ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); } } } @@ -644,9 +644,9 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t if( m_iszSpriteSmoke ) { CSprite *pSprite = CSprite::SpriteCreate( STRING( m_iszSpriteSmoke ), barrelEnd, TRUE ); - pSprite->AnimateAndDie( RANDOM_FLOAT( 15.0, 20.0 ) ); + pSprite->AnimateAndDie( RANDOM_FLOAT( 15.0f, 20.0f ) ); pSprite->SetTransparency( kRenderTransAlpha, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, 255, kRenderFxNone ); - pSprite->pev->velocity.z = RANDOM_FLOAT( 40, 80 ); + pSprite->pev->velocity.z = RANDOM_FLOAT( 40.0f, 80.0f ); pSprite->SetScale( m_spriteScale ); } if( m_iszSpriteFlash ) @@ -657,7 +657,7 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t pSprite->SetScale( m_spriteScale ); // Hack Hack, make it stick around for at least 100 ms. - pSprite->pev->nextthink += 0.1; + pSprite->pev->nextthink += 0.1f; } SUB_UseTargets( this, USE_TOGGLE, 0 ); } @@ -670,8 +670,8 @@ void CFuncTank::TankTrace( const Vector &vecStart, const Vector &vecForward, con float x, y, z; do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while( z > 1 ); Vector vecDir = vecForward + @@ -847,7 +847,7 @@ void CFuncTankLaser::Fire( const Vector &barrelEnd, const Vector &forward, entva m_laserTime = gpGlobals->time; m_pLaser->TurnOn(); - m_pLaser->pev->dmgtime = gpGlobals->time - 1.0; + m_pLaser->pev->dmgtime = gpGlobals->time - 1.0f; m_pLaser->FireAtPoint( tr ); m_pLaser->pev->nextthink = 0; } @@ -1014,7 +1014,7 @@ void CFuncTankControls::Spawn( void ) UTIL_SetSize( pev, pev->mins, pev->maxs ); UTIL_SetOrigin( pev, pev->origin ); - pev->nextthink = gpGlobals->time + 0.3; // After all the func_tank's have spawned + pev->nextthink = gpGlobals->time + 0.3f; // After all the func_tank's have spawned CBaseEntity::Spawn(); } diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index f3155d7f..b82bb02f 100644 --- a/dlls/gargantua.cpp +++ b/dlls/gargantua.cpp @@ -34,7 +34,7 @@ //========================================================= // Gargantua Monster //========================================================= -const float GARG_ATTACKDIST = 80.0; +const float GARG_ATTACKDIST = 80.0f; // Garg animation events #define GARG_AE_SLASH_LEFT 1 @@ -43,7 +43,7 @@ const float GARG_ATTACKDIST = 80.0; #define GARG_AE_RIGHT_FOOT 4 #define GARG_AE_STOMP 5 #define GARG_AE_BREATHE 6 -#define STOMP_FRAMETIME 0.015 // gpGlobals->frametime +#define STOMP_FRAMETIME 0.015f // gpGlobals->frametime // Gargantua is immune to any damage but this #define GARG_DAMAGE (DMG_ENERGYBEAM|DMG_CRUSH|DMG_MORTAR|DMG_BLAST) @@ -114,16 +114,16 @@ void CStomp::Spawn( void ) pev->model = MAKE_STRING( GARG_STOMP_SPRITE_NAME ); pev->rendermode = kRenderTransTexture; pev->renderamt = 0; - EMIT_SOUND_DYN( edict(), CHAN_BODY, GARG_STOMP_BUZZ_SOUND, 1, ATTN_NORM, 0, PITCH_NORM * 0.55 ); + EMIT_SOUND_DYN( edict(), CHAN_BODY, GARG_STOMP_BUZZ_SOUND, 1, ATTN_NORM, 0, PITCH_NORM * 0.55f ); } -#define STOMP_INTERVAL 0.025 +#define STOMP_INTERVAL 0.025f void CStomp::Think( void ) { TraceResult tr; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Do damage for this frame Vector vecStart = pev->origin; @@ -145,7 +145,7 @@ void CStomp::Think( void ) // Accelerate the effect pev->speed = pev->speed + ( STOMP_FRAMETIME ) * pev->framerate; - pev->framerate = pev->framerate + ( STOMP_FRAMETIME ) * 1500; + pev->framerate = pev->framerate + ( STOMP_FRAMETIME ) * 1500.0f; // Move and spawn trails while( gpGlobals->time - pev->dmgtime > STOMP_INTERVAL ) @@ -158,9 +158,9 @@ void CStomp::Think( void ) { UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 500 ), ignore_monsters, edict(), &tr ); pSprite->pev->origin = tr.vecEndPos; - pSprite->pev->velocity = Vector( RANDOM_FLOAT( -200, 200 ), RANDOM_FLOAT( -200, 200 ), 175 ); - // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) ); - pSprite->pev->nextthink = gpGlobals->time + 0.3; + pSprite->pev->velocity = Vector( RANDOM_FLOAT( -200.0f, 200.0f ), RANDOM_FLOAT( -200.0f, 200.0f ), 175 ); + // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0f, 12.0f ) ); + pSprite->pev->nextthink = gpGlobals->time + 0.3f; pSprite->SetThink( &CBaseEntity::SUB_Remove ); pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast ); } @@ -474,7 +474,7 @@ void CGargantua::StompAttack( void ) EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pStompSounds[RANDOM_LONG( 0, ARRAYSIZE( pStompSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace ); - if( trace.flFraction < 1.0 ) + if( trace.flFraction < 1.0f ) UTIL_DecalTrace( &trace, DECAL_GARGSTOMP1 ); } @@ -559,9 +559,9 @@ void CGargantua::FlameUpdate( void ) UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, edict(), &trace ); m_pFlame[i]->SetStartPos( trace.vecEndPos ); - m_pFlame[i+2]->SetStartPos( ( vecStart * 0.6 ) + ( trace.vecEndPos * 0.4 ) ); + m_pFlame[i+2]->SetStartPos( ( vecStart * 0.6f ) + ( trace.vecEndPos * 0.4f ) ); - if( trace.flFraction != 1.0 && gpGlobals->time > m_streakTime ) + if( trace.flFraction != 1.0f && gpGlobals->time > m_streakTime ) { StreakSplash( trace.vecEndPos, trace.vecPlaneNormal, 6, 20, 50, 400 ); streaks = TRUE; @@ -577,7 +577,7 @@ void CGargantua::FlameUpdate( void ) WRITE_COORD( vecStart.x ); // origin WRITE_COORD( vecStart.y ); WRITE_COORD( vecStart.z ); - WRITE_COORD( RANDOM_FLOAT( 32, 48 ) ); // radius + WRITE_COORD( RANDOM_FLOAT( 32.0f, 48.0f ) ); // radius WRITE_BYTE( 255 ); // R WRITE_BYTE( 255 ); // G WRITE_BYTE( 255 ); // B @@ -597,7 +597,7 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl float flAdjustedDamage; Vector vecSpot; - Vector vecMid = ( vecStart + vecEnd ) * 0.5; + Vector vecMid = ( vecStart + vecEnd ) * 0.5f; float searchRadius = ( vecStart - vecMid).Length(); @@ -627,15 +627,15 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl UTIL_TraceLine( vecSrc, vecSpot, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { // the explosion can 'see' this entity, so hurt them! // decrease damage for an ent that's farther from the flame. dist = ( vecSrc - tr.vecEndPos ).Length(); - if( dist > 64 ) + if( dist > 64.0f ) { - flAdjustedDamage = flDamage - ( dist - 64 ) * 0.4; + flAdjustedDamage = flDamage - ( dist - 64.0f ) * 0.4f; if( flAdjustedDamage <= 0 ) continue; } @@ -645,7 +645,7 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl } // ALERT( at_console, "hit %s\n", STRING( pEntity->pev->classname ) ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { ClearMultiDamage(); pEntity->TraceAttack( pevInflictor, flAdjustedDamage, ( tr.vecEndPos - vecSrc ).Normalize(), &tr, bitsDamageType ); @@ -679,7 +679,7 @@ void CGargantua::PrescheduleThink( void ) { if( !HasConditions( bits_COND_SEE_ENEMY ) ) { - m_seeTime = gpGlobals->time + 5; + m_seeTime = gpGlobals->time + 5.0f; EyeOff(); } else @@ -860,7 +860,7 @@ int CGargantua::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo if( IsAlive() ) { if( !( bitsDamageType & GARG_DAMAGE ) ) - flDamage *= 0.01; + flDamage *= 0.01f; if( bitsDamageType & DMG_BLAST ) SetConditions( bits_COND_LIGHT_DAMAGE ); } @@ -875,13 +875,13 @@ void CGargantua::DeathEffect( void ) Vector deathPos = pev->origin + gpGlobals->v_forward * 100; // Create a spiral of streaks - CSpiral::Create( deathPos, ( pev->absmax.z - pev->absmin.z ) * 0.6, 125, 1.5 ); + CSpiral::Create( deathPos, ( pev->absmax.z - pev->absmin.z ) * 0.6f, 125, 1.5 ); Vector position = pev->origin; position.z += 32; for( i = 0; i < 7; i+=2 ) { - SpawnExplosion( position, 70, ( i * 0.3 ), 60 + ( i * 20 ) ); + SpawnExplosion( position, 70, ( i * 0.3f ), 60 + ( i * 20 ) ); position.z += 15; } @@ -889,7 +889,7 @@ void CGargantua::DeathEffect( void ) pSmoker->pev->health = 1; // 1 smoke balls pSmoker->pev->scale = 46; // 4.6X normal size pSmoker->pev->dmg = 0; // 0 radial distribution - pSmoker->pev->nextthink = gpGlobals->time + 2.5; // Start in 2.5 seconds + pSmoker->pev->nextthink = gpGlobals->time + 2.5f; // Start in 2.5 seconds } void CGargantua::Killed( entvars_t *pevAttacker, int iGib ) @@ -909,7 +909,7 @@ BOOL CGargantua::CheckMeleeAttack1( float flDot, float flDist ) { //ALERT( at_aiconsole, "CheckMelee(%f, %f)\n", flDot, flDist ); - if( flDot >= 0.7 ) + if( flDot >= 0.7f ) { if( flDist <= GARG_ATTACKDIST ) return TRUE; @@ -924,7 +924,7 @@ BOOL CGargantua::CheckMeleeAttack2( float flDot, float flDist ) if( gpGlobals->time > m_flameTime ) { - if( flDot >= 0.8 && flDist > GARG_ATTACKDIST ) + if( flDot >= 0.8f && flDist > GARG_ATTACKDIST ) { if ( flDist <= GARG_FLAME_LENGTH ) return TRUE; @@ -946,7 +946,7 @@ BOOL CGargantua::CheckRangeAttack1( float flDot, float flDist ) { if( gpGlobals->time > m_seeTime ) { - if( flDot >= 0.7 && flDist > GARG_ATTACKDIST ) + if( flDot >= 0.7f && flDist > GARG_ATTACKDIST ) { return TRUE; } @@ -965,7 +965,7 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) case GARG_AE_SLASH_LEFT: { // HACKHACK!!! - CBaseEntity *pHurt = GargantuaCheckTraceHullAttack( GARG_ATTACKDIST + 10.0, gSkillData.gargantuaDmgSlash, DMG_SLASH ); + CBaseEntity *pHurt = GargantuaCheckTraceHullAttack( GARG_ATTACKDIST + 10.0f, gSkillData.gargantuaDmgSlash, DMG_SLASH ); if( pHurt ) { if( pHurt->pev->flags & ( FL_MONSTER | FL_CLIENT ) ) @@ -992,7 +992,7 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) break; case GARG_AE_STOMP: StompAttack(); - m_seeTime = gpGlobals->time + 12; + m_seeTime = gpGlobals->time + 12.0f; break; case GARG_AE_BREATHE: EMIT_SOUND_DYN( edict(), CHAN_VOICE, pBreatheSounds[RANDOM_LONG( 0, ARRAYSIZE( pBreatheSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); @@ -1021,7 +1021,7 @@ CBaseEntity* CGargantua::GargantuaCheckTraceHullAttack(float flDist, int iDamage UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; vecStart.z += 64; - Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ) - ( gpGlobals->v_up * flDist * 0.3 ); + Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ) - ( gpGlobals->v_up * flDist * 0.3f ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -1065,7 +1065,7 @@ void CGargantua::StartTask( Task_t *pTask ) case TASK_FLAME_SWEEP: FlameCreate(); m_flWaitFinished = gpGlobals->time + pTask->flData; - m_flameTime = gpGlobals->time + 6; + m_flameTime = gpGlobals->time + 6.0f; m_flameX = 0; m_flameY = 0; break; @@ -1075,7 +1075,7 @@ void CGargantua::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_DIE: - m_flWaitFinished = gpGlobals->time + 1.6; + m_flWaitFinished = gpGlobals->time + 1.6f; DeathEffect(); // FALL THROUGH default: @@ -1099,7 +1099,7 @@ void CGargantua::RunTask( Task_t *pTask ) pev->rendercolor.y = 0; pev->rendercolor.z = 0; StopAnimation(); - pev->nextthink = gpGlobals->time + 0.15; + pev->nextthink = gpGlobals->time + 0.15f; SetThink( &CBaseEntity::SUB_Remove ); int i; int parts = MODEL_FRAMES( gGargGibModel ); @@ -1118,7 +1118,7 @@ void CGargantua::RunTask( Task_t *pTask ) pGib->m_material = matNone; pGib->pev->origin = pev->origin; pGib->pev->velocity = UTIL_RandomBloodVector() * RANDOM_FLOAT( 300, 500 ); - pGib->pev->nextthink = gpGlobals->time + 1.25; + pGib->pev->nextthink = gpGlobals->time + 1.25f; pGib->SetThink( &CBaseEntity::SUB_FadeOut ); } MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); @@ -1194,10 +1194,10 @@ void CGargantua::RunTask( Task_t *pTask ) if( cancel ) { - m_flWaitFinished -= 0.5; - m_flameTime -= 0.5; + m_flWaitFinished -= 0.5f; + m_flameTime -= 0.5f; } - // FlameControls( angles.x + 2 * sin( gpGlobals->time * 8 ), angles.y + 28 * sin( gpGlobals->time * 8.5 ) ); + // FlameControls( angles.x + 2.0f * sin( gpGlobals->time * 8.0f ), angles.y + 28.0f * sin( gpGlobals->time * 8.5f ) ); FlameControls( angles.x, angles.y ); } break; @@ -1235,13 +1235,13 @@ void CSmoker::Think( void ) WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -pev->dmg, pev->dmg ) ); WRITE_COORD( pev->origin.z); WRITE_SHORT( g_sModelIndexSmoke ); - WRITE_BYTE( RANDOM_LONG(pev->scale, pev->scale * 1.1 ) ); + WRITE_BYTE( RANDOM_LONG(pev->scale, pev->scale * 1.1f ) ); WRITE_BYTE( RANDOM_LONG( 8, 14 ) ); // framerate MESSAGE_END(); pev->health--; if( pev->health > 0 ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.2 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.2f ); else UTIL_Remove( this ); } @@ -1274,7 +1274,7 @@ CSpiral *CSpiral::Create( const Vector &origin, float height, float radius, floa return pSpiral; } -#define SPIRAL_INTERVAL 0.1 //025 +#define SPIRAL_INTERVAL 0.1f //025 void CSpiral::Think( void ) { @@ -1285,7 +1285,7 @@ void CSpiral::Think( void ) Vector position = pev->origin; Vector direction = Vector(0,0,1); - float fraction = 1.0 / pev->speed; + float fraction = 1.0f / pev->speed; float radius = ( pev->scale * pev->health ) * fraction; diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 21377783..8bff79a1 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -52,10 +52,10 @@ float CGauss::GetFullChargeTime( void ) if( g_pGameRules->IsMultiplayer() ) #endif { - return 1.5; + return 1.5f; } - return 4; + return 4.0f; } #ifdef CLIENT_DLL @@ -138,9 +138,9 @@ BOOL CGauss::Deploy() void CGauss::Holster( int skiplocal /* = 0 */ ) { - PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); + PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( GAUSS_HOLSTER ); m_fInAttack = 0; @@ -152,14 +152,14 @@ void CGauss::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < 2 ) { PlayEmptySound(); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; return; } @@ -170,8 +170,8 @@ void CGauss::PrimaryAttack() StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.2f; } void CGauss::SecondaryAttack() @@ -190,7 +190,7 @@ void CGauss::SecondaryAttack() PlayEmptySound(); } - m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); + m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); return; } @@ -199,7 +199,7 @@ void CGauss::SecondaryAttack() if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) { EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_cock1.wav", 0.8, ATTN_NORM ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; return; } @@ -213,11 +213,11 @@ void CGauss::SecondaryAttack() SendWeaponAnim( GAUSS_SPINUP ); m_fInAttack = 1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; m_pPlayer->m_flStartCharge = gpGlobals->time; m_pPlayer->m_flAmmoStartCharge = UTIL_WeaponTimeBase() + GetFullChargeTime(); - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 110, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 110, 0, 0, 0 ); m_iSoundState = SND_CHANGE_PITCH; } @@ -242,7 +242,7 @@ void CGauss::SecondaryAttack() // out of ammo! force the gun to fire StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1; return; } @@ -257,12 +257,12 @@ void CGauss::SecondaryAttack() #endif { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.1; + m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.1f; } else { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.3; + m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.3f; } } @@ -281,25 +281,25 @@ void CGauss::SecondaryAttack() if( m_iSoundState == 0 ) ALERT( at_console, "sound state %d\n", m_iSoundState ); - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, pitch, 0, ( m_iSoundState == SND_CHANGE_PITCH ) ? 1 : 0, 0 ); + 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 ); m_iSoundState = SND_CHANGE_PITCH; // hack for going through level transitions m_pPlayer->m_iWeaponVolume = GAUSS_PRIMARY_CHARGE_VOLUME; - // m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; - if( m_pPlayer->m_flStartCharge < gpGlobals->time - 10 ) + // m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1f; + if( m_pPlayer->m_flStartCharge < gpGlobals->time - 10.0f ) { // Player charged up too long. Zap him. - EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", 1.0, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) ); - EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/electro6.wav", 1.0, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) ); + EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", 1.0f, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) ); + EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/electro6.wav", 1.0f, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) ); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; #ifndef CLIENT_DLL m_pPlayer->TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 50, DMG_SHOCK ); - UTIL_ScreenFade( m_pPlayer, Vector( 255, 128, 0 ), 2, 0.5, 128, FFADE_IN ); + UTIL_ScreenFade( m_pPlayer, Vector( 255, 128, 0 ), 2, 0.5f, 128, FFADE_IN ); #endif SendWeaponAnim( GAUSS_IDLE ); @@ -325,18 +325,18 @@ void CGauss::StartFire( void ) if( gpGlobals->time - m_pPlayer->m_flStartCharge > GetFullChargeTime() ) { - flDamage = 200; + flDamage = 200.0f; } else { - flDamage = 200 * ( ( gpGlobals->time - m_pPlayer->m_flStartCharge ) / GetFullChargeTime() ); + flDamage = 200.0f * ( ( gpGlobals->time - m_pPlayer->m_flStartCharge ) / GetFullChargeTime() ); } if( m_fPrimaryFire ) { // fixed damage on primary attack #ifdef CLIENT_DLL - flDamage = 20; + flDamage = 20.0f; #else flDamage = gSkillData.plrDmgGauss; #endif @@ -350,7 +350,7 @@ void CGauss::StartFire( void ) if( !m_fPrimaryFire ) { - m_pPlayer->pev->velocity = m_pPlayer->pev->velocity - gpGlobals->v_forward * flDamage * 5; + m_pPlayer->pev->velocity = m_pPlayer->pev->velocity - gpGlobals->v_forward * flDamage * 5.0f; } if( !g_pGameRules->IsMultiplayer() ) @@ -364,7 +364,7 @@ void CGauss::StartFire( void ) } // time until aftershock 'static discharge' sound - m_pPlayer->m_flPlayAftershock = gpGlobals->time + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.3, 0.8 ); + m_pPlayer->m_flPlayAftershock = gpGlobals->time + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.3f, 0.8f ); Fire( vecSrc, vecAiming, flDamage ); } @@ -375,9 +375,9 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) TraceResult tr, beam_tr; #ifndef CLIENT_DLL Vector vecSrc = vecOrigSrc; - Vector vecDest = vecSrc + vecDir * 8192; + Vector vecDest = vecSrc + vecDir * 8192.0f; edict_t *pentIgnore; - float flMaxFrac = 1.0; + float flMaxFrac = 1.0f; int nTotal = 0; int fHasPunched = 0; int fFirstBeam = 1; @@ -389,13 +389,13 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) g_irunninggausspred = true; #endif // The main firing event is sent unreliably so it won't be delayed. - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussFire, 0.0, m_pPlayer->pev->origin, m_pPlayer->pev->angles, flDamage, 0.0, 0, 0, m_fPrimaryFire ? 1 : 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussFire, 0.0f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, flDamage, 0.0, 0, 0, m_fPrimaryFire ? 1 : 0, 0 ); // This reliable event is used to stop the spinning sound // It's delayed by a fraction of second to make sure it is delayed by 1 frame on the client // It's sent reliably anyway, which could lead to other delays - PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_RELIABLE, m_pPlayer->edict(), m_usGaussFire, 0.01, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_RELIABLE, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); /*ALERT( at_console, "%f %f %f\n%f %f %f\n", vecSrc.x, vecSrc.y, vecSrc.z, @@ -442,7 +442,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) n = -DotProduct( tr.vecPlaneNormal, vecDir ); - if( n < 0.5 ) // 60 degrees + if( n < 0.5f ) // 60 degrees { // ALERT( at_console, "reflect %f\n", n ); // reflect @@ -451,8 +451,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) r = 2.0 * tr.vecPlaneNormal * n + vecDir; flMaxFrac = flMaxFrac - tr.flFraction; vecDir = r; - vecSrc = tr.vecEndPos + vecDir * 8; - vecDest = vecSrc + vecDir * 8192; + vecSrc = tr.vecEndPos + vecDir * 8.0f; + vecDest = vecSrc + vecDir * 8192.0f; // explode a bit m_pPlayer->RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, flDamage * n, CLASS_NONE, DMG_BLAST ); @@ -460,8 +460,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) nTotal += 34; // lose energy - if( n == 0 ) n = 0.1; - flDamage = flDamage * ( 1 - n ); + if( n == 0.0f ) n = 0.1f; + flDamage = flDamage * ( 1.0f - n ); } else { @@ -485,8 +485,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) if( n < flDamage ) { - if( n == 0 ) - n = 1; + if( n == 0.0f ) + n = 1.0f; flDamage -= n; // ALERT( at_console, "punch %f\n", n ); @@ -498,16 +498,16 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) if( g_pGameRules->IsMultiplayer() ) { - damage_radius = flDamage * 1.75; // Old code == 2.5 + damage_radius = flDamage * 1.75f; // Old code == 2.5 } else { - damage_radius = flDamage * 2.5; + damage_radius = flDamage * 2.5f; } ::RadiusDamage( beam_tr.vecEndPos + vecDir * 8, pev, m_pPlayer->pev, flDamage, damage_radius, CLASS_NONE, DMG_BLAST ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0f ); nTotal += 53; @@ -553,18 +553,18 @@ void CGauss::WeaponIdle( void ) switch( RANDOM_LONG( 0, 3 ) ) { case 0: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro5.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro5.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 2: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro6.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro6.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 3: break; // no sound } - m_pPlayer->m_flPlayAftershock = 0.0; + m_pPlayer->m_flPlayAftershock = 0.0f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -574,30 +574,30 @@ void CGauss::WeaponIdle( void ) { StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; // Need to set m_flNextPrimaryAttack so the weapon gets a chance to complete its secondary fire animation. - Solokiller if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; } else { int iAnim; - float flRand = RANDOM_FLOAT( 0, 1 ); - if( flRand <= 0.5 ) + float flRand = RANDOM_FLOAT( 0.0f, 1.0f ); + if( flRand <= 0.5f ) { iAnim = GAUSS_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } - else if( flRand <= 0.75 ) + else if( flRand <= 0.75f ) { iAnim = GAUSS_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } else { iAnim = GAUSS_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } #ifndef CLIENT_DLL SendWeaponAnim( iAnim ); diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index 0ca516c4..f50abe98 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -57,9 +57,9 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) pev->takedamage = DAMAGE_NO; // Pull out of the wall a bit - if( pTrace->flFraction != 1.0 ) + if( pTrace->flFraction != 1.0f ) { - pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6 ); + pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6f ); } int iContents = UTIL_PointContents( pev->origin ); @@ -77,7 +77,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) { WRITE_SHORT( g_sModelIndexWExplosion ); } - WRITE_BYTE( ( pev->dmg - 50 ) * .60 ); // scale * 10 + WRITE_BYTE( ( pev->dmg - 50 ) * 0.6f ); // scale * 10 WRITE_BYTE( 15 ); // framerate WRITE_BYTE( TE_EXPLFLAG_NONE ); MESSAGE_END(); @@ -93,7 +93,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) RadiusDamage( pev, pevOwner, pev->dmg, CLASS_NONE, bitsDamageType ); - if( RANDOM_FLOAT( 0, 1 ) < 0.5 ) + if( RANDOM_FLOAT( 0, 1 ) < 0.5f ) { UTIL_DecalTrace( pTrace, DECAL_SCORCH1 ); } @@ -120,7 +120,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) pev->effects |= EF_NODRAW; SetThink( &CGrenade::Smoke ); pev->velocity = g_vecZero; - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; if( iContents != CONTENTS_WATER ) { @@ -144,7 +144,7 @@ void CGrenade::Smoke( void ) WRITE_COORD( pev->origin.y ); WRITE_COORD( pev->origin.z ); WRITE_SHORT( g_sModelIndexSmoke ); - WRITE_BYTE( (int)( ( pev->dmg - 50 ) * 0.80 ) ); // scale * 10 + WRITE_BYTE( (int)( ( pev->dmg - 50 ) * 0.8f ) ); // scale * 10 WRITE_BYTE( 12 ); // framerate MESSAGE_END(); } @@ -207,12 +207,12 @@ void CGrenade::DangerSoundThink( void ) return; } - CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, (int)pev->velocity.Length(), 0.2 ); - pev->nextthink = gpGlobals->time + 0.2; + CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5f, (int)pev->velocity.Length(), 0.2 ); + pev->nextthink = gpGlobals->time + 0.2f; if( pev->waterlevel != 0 ) { - pev->velocity = pev->velocity * 0.5; + pev->velocity = pev->velocity * 0.5f; } } @@ -233,7 +233,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) pOther->TraceAttack( pevOwner, 1, gpGlobals->v_forward, &tr, DMG_CLUB ); ApplyMultiDamage( pev, pevOwner ); } - m_flNextAttack = gpGlobals->time + 1.0; // debounce + m_flNextAttack = gpGlobals->time + 1.0f; // debounce } Vector vecTestVelocity; @@ -253,14 +253,14 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // go ahead and emit the danger sound. // register a radius louder than the explosion, so we make sure everyone gets out of the way - CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, (int)( pev->dmg / 0.4 ), 0.3 ); + CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, (int)( pev->dmg / 0.4f ), 0.3f ); m_fRegisteredSound = TRUE; } if( pev->flags & FL_ONGROUND ) { // add a bit of static friction - pev->velocity = pev->velocity * 0.8; + pev->velocity = pev->velocity * 0.8f; pev->sequence = RANDOM_LONG( 1, 1 ); } @@ -269,11 +269,11 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // play bounce sound BounceSound(); } - pev->framerate = pev->velocity.Length() / 200.0; - if( pev->framerate > 1.0 ) - pev->framerate = 1; - else if( pev->framerate < 0.5 ) - pev->framerate = 0; + pev->framerate = pev->velocity.Length() / 200.0f; + if( pev->framerate > 1.0f ) + pev->framerate = 1.0f; + else if( pev->framerate < 0.5f ) + pev->framerate = 0.0f; } void CGrenade::SlideTouch( CBaseEntity *pOther ) @@ -286,7 +286,7 @@ void CGrenade::SlideTouch( CBaseEntity *pOther ) if( pev->flags & FL_ONGROUND ) { // add a bit of static friction - pev->velocity = pev->velocity * 0.95; + pev->velocity = pev->velocity * 0.95f; if( pev->velocity.x != 0 || pev->velocity.y != 0 ) { @@ -324,7 +324,7 @@ void CGrenade::TumbleThink( void ) } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->dmgtime - 1 < gpGlobals->time ) { @@ -337,8 +337,8 @@ void CGrenade::TumbleThink( void ) } if( pev->waterlevel != 0 ) { - pev->velocity = pev->velocity * 0.5; - pev->framerate = 0.2; + pev->velocity = pev->velocity * 0.5f; + pev->framerate = 0.2f; } } @@ -399,21 +399,21 @@ CGrenade *CGrenade::ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vec pGrenade->pev->dmgtime = gpGlobals->time + time; pGrenade->SetThink( &CGrenade::TumbleThink ); - pGrenade->pev->nextthink = gpGlobals->time + 0.1; - if( time < 0.1 ) + pGrenade->pev->nextthink = gpGlobals->time + 0.1f; + if( time < 0.1f ) { pGrenade->pev->nextthink = gpGlobals->time; pGrenade->pev->velocity = Vector( 0, 0, 0 ); } pGrenade->pev->sequence = RANDOM_LONG( 3, 6 ); - pGrenade->pev->framerate = 1.0; + pGrenade->pev->framerate = 1.0f; // Tumble through the air // pGrenade->pev->avelocity.x = -400; - pGrenade->pev->gravity = 0.5; - pGrenade->pev->friction = 0.8; + pGrenade->pev->gravity = 0.5f; + pGrenade->pev->friction = 0.8f; SET_MODEL( ENT( pGrenade->pev ), "models/w_grenade.mdl" ); pGrenade->pev->dmg = 100; @@ -445,7 +445,7 @@ CGrenade *CGrenade::ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, Ve pGrenade->SetTouch( &CGrenade::SlideTouch ); pGrenade->pev->spawnflags = SF_DETONATE; - pGrenade->pev->friction = 0.9; + pGrenade->pev->friction = 0.9f; return pGrenade; } diff --git a/dlls/glock.cpp b/dlls/glock.cpp index 89dd189e..db0cf082 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -106,12 +106,12 @@ BOOL CGlock::Deploy() void CGlock::SecondaryAttack( void ) { - GlockFire( 0.1, 0.2, FALSE ); + GlockFire( 0.1f, 0.2f, FALSE ); } void CGlock::PrimaryAttack( void ) { - GlockFire( 0.01, 0.3, TRUE ); + GlockFire( 0.01f, 0.3f, TRUE ); } void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) @@ -121,7 +121,7 @@ void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.2 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.2f ); } return; @@ -187,9 +187,9 @@ void CGlock::Reload( void ) int iResult; if( m_iClip == 0 ) - iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD, 1.5 ); + iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD, 1.5f ); else - iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD_NOT_EMPTY, 1.5 ); + iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD_NOT_EMPTY, 1.5f ); if( iResult ) { @@ -212,20 +212,20 @@ void CGlock::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 ); - if( flRand <= 0.3 + 0 * 0.75 ) + if( flRand <= 0.3f + 0 * 0.75f ) { iAnim = GLOCK_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0 / 16; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0f / 16.0f; } - else if( flRand <= 0.6 + 0 * 0.875 ) + else if( flRand <= 0.6f + 0 * 0.875f ) { iAnim = GLOCK_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 16.0f; } else { iAnim = GLOCK_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f; } SendWeaponAnim( iAnim, 1 ); } diff --git a/dlls/h_ai.cpp b/dlls/h_ai.cpp index d8a35547..0cc5d306 100644 --- a/dlls/h_ai.cpp +++ b/dlls/h_ai.cpp @@ -62,7 +62,7 @@ BOOL FBoxVisible( entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetO UTIL_TraceLine( vecLookerOrigin, vecTarget, ignore_monsters, ignore_glass, ENT( pevLooker )/*pentIgnore*/, &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { vecTargetOrigin = vecTarget; return TRUE;// line of sight is valid. @@ -120,10 +120,10 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl float distance2 = vecMidPoint.z - vecSpot2.z; // How long will it take for the grenade to travel this distance - float time1 = sqrt( distance1 / ( 0.5 * flGravity ) ); - float time2 = sqrt( distance2 / ( 0.5 * flGravity ) ); + float time1 = sqrt( distance1 / ( 0.5f * flGravity ) ); + float time2 = sqrt( distance2 / ( 0.5f * flGravity ) ); - if( time1 < 0.1 ) + if( time1 < 0.1f ) { // too close return g_vecZero; @@ -139,7 +139,7 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl vecApex.z = vecMidPoint.z; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -147,7 +147,7 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl // UNDONE: either ignore monsters or change it to not care if we hit our enemy UTIL_TraceLine( vecSpot2, vecApex, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -168,24 +168,24 @@ Vector VecCheckThrow( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, f // throw at a constant time float time = vecGrenadeVel.Length() / flSpeed; - vecGrenadeVel = vecGrenadeVel * ( 1.0 / time ); + vecGrenadeVel = vecGrenadeVel * ( 1.0f / time ); // adjust upward toss to compensate for gravity loss - vecGrenadeVel.z += flGravity * time * 0.5; + vecGrenadeVel.z += flGravity * time * 0.5f; - Vector vecApex = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5; - vecApex.z += 0.5 * flGravity * ( time * 0.5 ) * ( time * 0.5 ); + Vector vecApex = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f; + vecApex.z += 0.5f * flGravity * ( time * 0.5f ) * ( time * 0.5f ); TraceResult tr; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; } UTIL_TraceLine( vecSpot2, vecApex, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index 6c6b9869..f0cf612b 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -126,13 +126,13 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use { if( m_flSoundTime <= gpGlobals->time ) { - m_flSoundTime = gpGlobals->time + 0.62; + m_flSoundTime = gpGlobals->time + 0.62f; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeno1.wav", 0.85, ATTN_NORM ); } return; } - pev->nextthink = pev->ltime + 0.25; + pev->nextthink = pev->ltime + 0.25f; SetThink( &CRecharge::Off ); // Time to recharge yet? @@ -146,7 +146,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use { m_iOn++; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeok1.wav", 0.85, ATTN_NORM ); - m_flSoundTime = 0.56 + gpGlobals->time; + m_flSoundTime = 0.56f + gpGlobals->time; } if( ( m_iOn == 1 ) && ( m_flSoundTime <= gpGlobals->time ) ) @@ -166,7 +166,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use } // govern the rate of charge - m_flNextCharge = gpGlobals->time + 0.1; + m_flNextCharge = gpGlobals->time + 0.1f; } void CRecharge::Recharge( void ) diff --git a/dlls/h_cine.cpp b/dlls/h_cine.cpp index bb07e02c..55e7a631 100644 --- a/dlls/h_cine.cpp +++ b/dlls/h_cine.cpp @@ -126,7 +126,7 @@ void CLegacyCineMonster :: CineSpawn( const char *szModel ) if ( FStringNull(pev->targetname) ) { SetThink( &CLegacyCineMonster::CineThink ); - pev->nextthink += 1.0; + pev->nextthink += 1.0f; } } @@ -167,7 +167,7 @@ void CLegacyCineMonster :: CineThink( void ) if (!pev->animtime) ResetSequenceInfo( ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; if (pev->spawnflags != 0 && m_fSequenceFinished) { @@ -196,14 +196,14 @@ void CCineBlood :: BloodGush ( void ) { Vector vecSplatDir; TraceResult tr; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - UTIL_MakeVectors(pev->angles); - if ( pev->health-- < 0 ) - REMOVE_ENTITY(ENT(pev)); + UTIL_MakeVectors( pev->angles ); + if( pev->health-- < 0 ) + REMOVE_ENTITY( ENT( pev ) ); // CHANGE_METHOD ( ENT(pev), em_think, SUB_Remove ); - if ( RANDOM_FLOAT ( 0 , 1 ) < 0.7 )// larger chance of globs + if ( RANDOM_FLOAT ( 0.0f, 1.0f ) < 0.7f )// larger chance of globs { UTIL_BloodDrips( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, 10 ); } @@ -212,13 +212,13 @@ void CCineBlood :: BloodGush ( void ) UTIL_BloodStream( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, RANDOM_LONG(50, 150) ); } - if ( RANDOM_FLOAT ( 0, 1 ) < 0.75 ) + if ( RANDOM_FLOAT ( 0, 1 ) < 0.75f ) { // decals the floor with blood. vecSplatDir = Vector ( 0 , 0 , -1 ); - vecSplatDir = vecSplatDir + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_right) + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_forward);// randomize a bit + vecSplatDir = vecSplatDir + (RANDOM_FLOAT(-1,1) * 0.6f * gpGlobals->v_right) + (RANDOM_FLOAT(-1,1) * 0.6f * gpGlobals->v_forward);// randomize a bit UTIL_TraceLine( pev->origin + Vector ( 0, 0 , 64) , pev->origin + vecSplatDir * 256, ignore_monsters, ENT(pev), &tr); - if ( tr.flFraction != 1.0 ) + if ( tr.flFraction != 1.0f ) { // Decal with a bloodsplat UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index 5daad4a2..1c5a9150 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -96,7 +96,7 @@ void CCycler::GenericCyclerSpawn( const char *szModel, Vector vecMin, Vector vec { if( !szModel || !*szModel ) { - ALERT( at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z ); + ALERT( at_error, "cycler at %.0f %.0f %0.f missing modelname", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); REMOVE_ENTITY( ENT( pev ) ); return; } @@ -125,7 +125,7 @@ void CCycler::Spawn() m_flFrameRate = 75; m_flGroundSpeed = 0; - pev->nextthink += 1.0; + pev->nextthink += 1.0f; ResetSequenceInfo(); @@ -145,7 +145,7 @@ void CCycler::Spawn() // void CCycler::Think( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_animate ) { @@ -161,7 +161,7 @@ void CCycler::Think( void ) m_flLastEventCheck = gpGlobals->time; pev->frame = 0; if( !m_animate ) - pev->framerate = 0.0; // FIX: don't reset framerate + pev->framerate = 0.0f; // FIX: don't reset framerate } } @@ -172,9 +172,9 @@ void CCycler::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy { m_animate = !m_animate; if( m_animate ) - pev->framerate = 1.0; + pev->framerate = 1.0f; else - pev->framerate = 0.0; + pev->framerate = 0.0f; } // @@ -189,7 +189,7 @@ int CCycler::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float ResetSequenceInfo(); - if( m_flFrameRate == 0.0 ) + if( m_flFrameRate == 0.0f ) { pev->sequence = 0; ResetSequenceInfo(); @@ -198,10 +198,10 @@ int CCycler::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float } else { - pev->framerate = 1.0; - StudioFrameAdvance( 0.1 ); + pev->framerate = 1.0f; + StudioFrameAdvance( 0.1f ); pev->framerate = 0; - ALERT( at_console, "sequence: %d, frame %.0f\n", pev->sequence, pev->frame ); + ALERT( at_console, "sequence: %d, frame %.0f\n", pev->sequence, (double)pev->frame ); } return 0; @@ -224,7 +224,7 @@ public: inline int ShouldAnimate( void ) { - return m_animate && m_maxFrame > 1.0; + return m_animate && m_maxFrame > 1.0f; } int m_animate; @@ -251,7 +251,7 @@ void CCyclerSprite::Spawn( void ) pev->effects = 0; pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_animate = 1; m_lastTime = gpGlobals->time; @@ -266,7 +266,7 @@ void CCyclerSprite::Think( void ) if( ShouldAnimate() ) Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -278,9 +278,9 @@ void CCyclerSprite::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE int CCyclerSprite::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { - if( m_maxFrame > 1.0 ) + if( m_maxFrame > 1.0f ) { - Animate( 1.0 ); + Animate( 1.0f ); } return 1; } @@ -327,7 +327,7 @@ void CWeaponCycler::Spawn() BOOL CWeaponCycler::Deploy() { m_pPlayer->pev->viewmodel = m_iszModel; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; SendWeaponAnim( 0 ); m_iClip = 0; return TRUE; @@ -335,14 +335,14 @@ BOOL CWeaponCycler::Deploy() void CWeaponCycler::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } void CWeaponCycler::PrimaryAttack() { SendWeaponAnim( pev->sequence ); - m_flNextPrimaryAttack = gpGlobals->time + 0.3; + m_flNextPrimaryAttack = gpGlobals->time + 0.3f; } void CWeaponCycler::SecondaryAttack( void ) @@ -356,14 +356,14 @@ void CWeaponCycler::SecondaryAttack( void ) GetSequenceInfo( pmodel, pev, &flFrameRate, &flGroundSpeed ); pev->modelindex = 0; - if( flFrameRate == 0.0 ) + if( flFrameRate == 0.0f ) { pev->sequence = 0; } SendWeaponAnim( pev->sequence ); - m_flNextSecondaryAttack = gpGlobals->time + 0.3; + m_flNextSecondaryAttack = gpGlobals->time + 0.3f; } // Flaming Wreakage @@ -397,7 +397,7 @@ void CWreckage::Spawn( void ) pev->effects = 0; pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->model ) { @@ -418,7 +418,7 @@ void CWreckage::Precache() void CWreckage::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; if( pev->dmgtime ) { diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index c2bbd7f9..4d866708 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -89,7 +89,7 @@ BOOL CHandGrenade::CanHolster( void ) void CHandGrenade::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -104,11 +104,11 @@ void CHandGrenade::Holster( int skiplocal /* = 0 */ ) if( m_flStartThrow ) { - m_flStartThrow = 0; - m_flReleaseThrow = 0; + m_flStartThrow = 0.0f; + m_flReleaseThrow = 0.0f; } - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CHandGrenade::PrimaryAttack() @@ -116,16 +116,16 @@ void CHandGrenade::PrimaryAttack() if( !m_flStartThrow && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0 ) { m_flStartThrow = gpGlobals->time; - m_flReleaseThrow = 0; + m_flReleaseThrow = 0.0f; SendWeaponAnim( HANDGRENADE_PINPULL ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } } void CHandGrenade::WeaponIdle( void ) { - if( m_flReleaseThrow == 0 && m_flStartThrow ) + if( m_flReleaseThrow == 0.0f && m_flStartThrow ) m_flReleaseThrow = gpGlobals->time; if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -135,33 +135,33 @@ void CHandGrenade::WeaponIdle( void ) { Vector angThrow = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle; - if( angThrow.x < 0 ) - angThrow.x = -10 + angThrow.x * ( ( 90 - 10 ) / 90.0 ); + if( angThrow.x < 0.0f ) + angThrow.x = -10.0f + angThrow.x * ( ( 90.0f - 10.0f ) / 90.0f ); else - angThrow.x = -10 + angThrow.x * ( ( 90 + 10 ) / 90.0 ); + angThrow.x = -10.0f + angThrow.x * ( ( 90.0f + 10.0f ) / 90.0f ); - float flVel = ( 90 - angThrow.x ) * 4; - if( flVel > 500 ) - flVel = 500; + float flVel = ( 90.0f - angThrow.x ) * 4.0f; + if( flVel > 500.0f ) + flVel = 500.0f; UTIL_MakeVectors( angThrow ); - Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16; + Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16.0f; Vector vecThrow = gpGlobals->v_forward * flVel + m_pPlayer->pev->velocity; // alway explode 3 seconds after the pin was pulled - float time = m_flStartThrow - gpGlobals->time + 3.0; - if( time < 0 ) - time = 0; + float time = m_flStartThrow - gpGlobals->time + 3.0f; + if( time < 0.0f ) + time = 0.0f; CGrenade::ShootTimed( m_pPlayer->pev, vecSrc, vecThrow, time ); - if( flVel < 500 ) + if( flVel < 500.0f ) { SendWeaponAnim( HANDGRENADE_THROW1 ); } - else if( flVel < 1000 ) + else if( flVel < 1000.0f ) { SendWeaponAnim( HANDGRENADE_THROW2 ); } @@ -173,10 +173,10 @@ void CHandGrenade::WeaponIdle( void ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flReleaseThrow = 0; - m_flStartThrow = 0; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flReleaseThrow = 0.0f; + m_flStartThrow = 0.0f; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -185,14 +185,14 @@ void CHandGrenade::WeaponIdle( void ) // just threw last grenade // set attack times in the future, and weapon idle in the future so we can see the whole throw // animation, weapon idle will automatically retire the weapon for us. - m_flTimeWeaponIdle = m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );// ensure that the animation can finish playing + m_flTimeWeaponIdle = m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f );// ensure that the animation can finish playing } return; } - else if( m_flReleaseThrow > 0 ) + else if( m_flReleaseThrow > 0.0f ) { // we've finished the throw, restart. - m_flStartThrow = 0; + m_flStartThrow = 0.0f; if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -204,24 +204,24 @@ void CHandGrenade::WeaponIdle( void ) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); - m_flReleaseThrow = -1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); + m_flReleaseThrow = -1.0f; return; } if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f ) { iAnim = HANDGRENADE_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );// how long till we do this again. + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f );// how long till we do this again. } else { iAnim = HANDGRENADE_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0f / 30.0f; } SendWeaponAnim( iAnim ); diff --git a/dlls/hassassin.cpp b/dlls/hassassin.cpp index f51ed4cb..c98c940f 100644 --- a/dlls/hassassin.cpp +++ b/dlls/hassassin.cpp @@ -193,15 +193,15 @@ void CHAssassin::Shoot( void ) Vector vecShootOrigin = GetGunPosition(); Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); - if( m_flLastShot + 2 < gpGlobals->time ) + if( m_flLastShot + 2.0f < gpGlobals->time ) { - m_flDiviation = 0.10; + m_flDiviation = 0.10f; } else { - m_flDiviation -= 0.01; - if( m_flDiviation < 0.02 ) - m_flDiviation = 0.02; + m_flDiviation -= 0.01f; + if( m_flDiviation < 0.02f ) + m_flDiviation = 0.02f; } m_flLastShot = gpGlobals->time; @@ -214,10 +214,10 @@ void CHAssassin::Shoot( void ) switch( RANDOM_LONG( 0, 1 ) ) { case 0: - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun1.wav", RANDOM_FLOAT( 0.6, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun1.wav", RANDOM_FLOAT( 0.6f, 0.8f ), ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun2.wav", RANDOM_FLOAT( 0.6, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun2.wav", RANDOM_FLOAT( 0.6f, 0.8f ), ATTN_NORM ); break; } @@ -247,7 +247,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent ) UTIL_MakeVectors( pev->angles ); CGrenade::ShootTimed( pev, pev->origin + gpGlobals->v_forward * 34 + Vector( 0, 0, 32 ), m_vecTossVelocity, 2.0 ); - m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + m_flNextGrenadeCheck = gpGlobals->time + 6.0f;// wait six seconds before even looking again to see if a grenade can be thrown. m_fThrowGrenade = FALSE; // !!!LATER - when in a group, only try to throw grenade if ordered. } @@ -259,7 +259,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->movetype = MOVETYPE_TOSS; pev->flags &= ~FL_ONGROUND; pev->velocity = m_vecJumpVelocity; - m_flNextJump = gpGlobals->time + 3.0; + m_flNextJump = gpGlobals->time + 3.0f; } return; default: @@ -597,7 +597,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHAssassin, CBaseMonster ) //========================================================= BOOL CHAssassin::CheckMeleeAttack1( float flDot, float flDist ) { - if( m_flNextJump < gpGlobals->time && ( flDist <= 128 || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != 0 ) + if( m_flNextJump < gpGlobals->time && ( flDist <= 128.0f || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != 0 ) { TraceResult tr; @@ -605,15 +605,15 @@ BOOL CHAssassin::CheckMeleeAttack1( float flDot, float flDist ) UTIL_TraceHull( pev->origin + Vector( 0, 0, 36 ), vecDest + Vector( 0, 0, 36 ), dont_ignore_monsters, human_hull, ENT( pev ), &tr ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { return FALSE; } float flGravity = g_psv_gravity->value; - float time = sqrt( 160 / ( 0.5 * flGravity ) ); - float speed = flGravity * time / 160; + float time = sqrt( 160.0f / ( 0.5f * flGravity ) ); + float speed = flGravity * time / 160.0f; m_vecJumpVelocity = ( vecDest - pev->origin ) * speed; return TRUE; diff --git a/dlls/headcrab.cpp b/dlls/headcrab.cpp index 60e03c10..dea97ebe 100644 --- a/dlls/headcrab.cpp +++ b/dlls/headcrab.cpp @@ -170,7 +170,7 @@ int CHeadCrab::Classify( void ) //========================================================= Vector CHeadCrab::Center( void ) { - return Vector( pev->origin.x, pev->origin.y, pev->origin.z + 6 ); + return Vector( pev->origin.x, pev->origin.y, pev->origin.z + 6.0f ); } Vector CHeadCrab::BodyTarget( const Vector &posSrc ) @@ -241,7 +241,7 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent ) // Scale the sideways velocity to get there at the right time vecJumpDir = m_hEnemy->pev->origin + m_hEnemy->pev->view_ofs - pev->origin; - vecJumpDir = vecJumpDir * ( 1.0 / time ); + vecJumpDir = vecJumpDir * ( 1.0f / time ); // Speed to offset gravity at the desired height vecJumpDir.z = speed; @@ -249,23 +249,23 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent ) // Don't jump too far/fast float distance = vecJumpDir.Length(); - if( distance > 650 ) + if( distance > 650.0f ) { - vecJumpDir = vecJumpDir * ( 650.0 / distance ); + vecJumpDir = vecJumpDir * ( 650.0f / distance ); } } else { // jump hop, don't care where - vecJumpDir = Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, gpGlobals->v_up.z ) * 350; + vecJumpDir = Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, gpGlobals->v_up.z ) * 350.0f; } - int iSound = RANDOM_LONG(0,2); + int iSound = RANDOM_LONG( 0, 2 ); if( iSound != 0 ) EMIT_SOUND_DYN( edict(), CHAN_VOICE, pAttackSounds[iSound], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() ); pev->velocity = vecJumpDir; - m_flNextAttack = gpGlobals->time + 2; + m_flNextAttack = gpGlobals->time + 2.0f; } break; default: @@ -370,7 +370,7 @@ void CHeadCrab::LeapTouch( CBaseEntity *pOther ) void CHeadCrab::PrescheduleThink( void ) { // make the crab coo a little bit in combat state - if( m_MonsterState == MONSTERSTATE_COMBAT && RANDOM_FLOAT( 0, 5 ) < 0.1 ) + if( m_MonsterState == MONSTERSTATE_COMBAT && RANDOM_FLOAT( 0, 5 ) < 0.1f ) { IdleSound(); } @@ -401,7 +401,7 @@ void CHeadCrab::StartTask( Task_t *pTask ) //========================================================= BOOL CHeadCrab::CheckRangeAttack1( float flDot, float flDist ) { - if( FBitSet( pev->flags, FL_ONGROUND ) && flDist <= 256 && flDot >= 0.65 ) + if( FBitSet( pev->flags, FL_ONGROUND ) && flDist <= 256 && flDot >= 0.65f ) { return TRUE; } @@ -416,7 +416,7 @@ BOOL CHeadCrab::CheckRangeAttack2( float flDot, float flDist ) return FALSE; // BUGBUG: Why is this code here? There is no ACT_RANGE_ATTACK2 animation. I've disabled it for now. #if 0 - if( FBitSet( pev->flags, FL_ONGROUND ) && flDist > 64 && flDist <= 256 && flDot >= 0.5 ) + if( FBitSet( pev->flags, FL_ONGROUND ) && flDist > 64 && flDist <= 256 && flDot >= 0.5f ) { return TRUE; } @@ -487,11 +487,11 @@ public: void Spawn( void ); void Precache( void ); void SetYawSpeed( void ); - float GetDamageAmount( void ) { return gSkillData.headcrabDmgBite * 0.3; } + float GetDamageAmount( void ) { return gSkillData.headcrabDmgBite * 0.3f; } BOOL CheckRangeAttack1( float flDot, float flDist ); Schedule_t *GetScheduleOfType ( int Type ); virtual int GetVoicePitch( void ) { return PITCH_NORM + RANDOM_LONG( 40, 50 ); } - virtual float GetSoundVolue( void ) { return 0.8; } + virtual float GetSoundVolue( void ) { return 0.8f; } }; LINK_ENTITY_TO_CLASS( monster_babycrab, CBabyCrab ) @@ -504,7 +504,7 @@ void CBabyCrab::Spawn( void ) pev->renderamt = 192; UTIL_SetSize( pev, Vector( -12, -12, 0 ), Vector( 12, 12, 24 ) ); - pev->health = gSkillData.headcrabHealth * 0.25; // less health than full grown + pev->health = gSkillData.headcrabHealth * 0.25f; // less health than full grown } void CBabyCrab::Precache( void ) @@ -526,7 +526,7 @@ BOOL CBabyCrab::CheckRangeAttack1( float flDot, float flDist ) return TRUE; // A little less accurate, but jump from closer - if( flDist <= 180 && flDot >= 0.55 ) + if( flDist <= 180.0f && flDot >= 0.55f ) return TRUE; } diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index e1744479..9e111300 100644 --- a/dlls/healthkit.cpp +++ b/dlls/healthkit.cpp @@ -192,13 +192,13 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u { if( m_flSoundTime <= gpGlobals->time ) { - m_flSoundTime = gpGlobals->time + 0.62; + m_flSoundTime = gpGlobals->time + 0.62f; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshotno1.wav", 1.0, ATTN_NORM ); } return; } - pev->nextthink = pev->ltime + 0.25; + pev->nextthink = pev->ltime + 0.25f; SetThink( &CWallHealth::Off ); // Time to recharge yet? @@ -210,7 +210,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u { m_iOn++; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM ); - m_flSoundTime = 0.56 + gpGlobals->time; + m_flSoundTime = 0.56f + gpGlobals->time; } if( ( m_iOn == 1 ) && ( m_flSoundTime <= gpGlobals->time ) ) { @@ -225,7 +225,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u } // govern the rate of charge - m_flNextCharge = gpGlobals->time + 0.1; + m_flNextCharge = gpGlobals->time + 0.1f; } void CWallHealth::Recharge( void ) diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index 62c947f1..bcb71005 100644 --- a/dlls/hgrunt.cpp +++ b/dlls/hgrunt.cpp @@ -356,7 +356,7 @@ BOOL CHGrunt::FOkToSpeak( void ) //========================================================= void CHGrunt::JustSpoke( void ) { - CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 1.5, 2.0 ); + CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 1.5f, 2.0f ); m_iSentence = HGRUNT_SENT_NONE; } @@ -375,7 +375,7 @@ void CHGrunt::PrescheduleThink( void ) } else { - if( gpGlobals->time - MySquadLeader()->m_flLastEnemySightTime > 5 ) + if( gpGlobals->time - MySquadLeader()->m_flLastEnemySightTime > 5.0f ) { // been a while since we've seen the enemy MySquadLeader()->m_fEnemyEluded = TRUE; @@ -425,7 +425,7 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) } } - if( flDist <= 64 && flDot >= 0.7 && + if( flDist <= 64.0f && flDot >= 0.7f && pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) { @@ -444,7 +444,7 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CHGrunt::CheckRangeAttack1( float flDot, float flDist ) { - if( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() ) + if( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048.0f && flDot >= 0.5f && NoFriendlyFire() ) { TraceResult tr; @@ -459,7 +459,7 @@ BOOL CHGrunt::CheckRangeAttack1( float flDot, float flDist ) // verify that a bullet fired from the gun will hit the enemy before the world. UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget( vecSrc ), ignore_monsters, ignore_glass, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { return TRUE; } @@ -541,7 +541,7 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) } } - if( ( vecTarget - pev->origin ).Length2D() <= 256 ) + if( ( vecTarget - pev->origin ).Length2D() <= 256.0f ) { // crap, I don't want to blow myself up m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. @@ -567,7 +567,7 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) // don't throw m_fThrowGrenade = FALSE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. + m_flNextGrenadeCheck = gpGlobals->time + 1.0f; // one full second. } } else @@ -581,14 +581,14 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) // throw a hand grenade m_fThrowGrenade = TRUE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 0.3; // 1/3 second. + m_flNextGrenadeCheck = gpGlobals->time + 0.3f; // 1/3 second. } else { // don't throw m_fThrowGrenade = FALSE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. + m_flNextGrenadeCheck = gpGlobals->time + 1.0f; // one full second. } } @@ -611,7 +611,7 @@ void CHGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir if( flDamage <= 0 ) { UTIL_Ricochet( ptr->vecEndPos, 1.0 ); - flDamage = 0.01; + flDamage = 0.01f; } } // it's head shot anyways @@ -752,7 +752,7 @@ CBaseEntity *CHGrunt::Kick( void ) UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * 70 ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -895,9 +895,9 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) CGrenade::ShootContact( pev, GetGunPosition(), m_vecTossVelocity ); m_fThrowGrenade = FALSE; if( g_iSkillLevel == SKILL_HARD ) - m_flNextGrenadeCheck = gpGlobals->time + RANDOM_FLOAT( 2, 5 );// wait a random amount of time before shooting again + m_flNextGrenadeCheck = gpGlobals->time + RANDOM_FLOAT( 2.0f, 5.0f );// wait a random amount of time before shooting again else - m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + m_flNextGrenadeCheck = gpGlobals->time + 6.0f;// wait six seconds before even looking again to see if a grenade can be thrown. } break; case HGRUNT_AE_GREN_DROP: @@ -2392,7 +2392,7 @@ void CHGruntRepel::RepelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/hornet.cpp b/dlls/hornet.cpp index 758ba7e9..6fc79aa7 100644 --- a/dlls/hornet.cpp +++ b/dlls/hornet.cpp @@ -69,14 +69,14 @@ void CHornet::Spawn( void ) if( g_pGameRules->IsMultiplayer() ) { // hornets don't live as long in multiplayer - m_flStopAttack = gpGlobals->time + 3.5; + m_flStopAttack = gpGlobals->time + 3.5f; } else { - m_flStopAttack = gpGlobals->time + 5.0; + m_flStopAttack = gpGlobals->time + 5.0f; } - m_flFieldOfView = 0.9; // +- 25 degrees + m_flFieldOfView = 0.9f; // +- 25 degrees if( RANDOM_LONG( 1, 5 ) <= 2 ) { @@ -109,7 +109,7 @@ void CHornet::Spawn( void ) pev->dmg = gSkillData.monDmgHornet; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; ResetSequenceInfo(); } @@ -169,7 +169,7 @@ void CHornet::StartTrack( void ) SetTouch( &CHornet::TrackTouch ); SetThink( &CHornet::TrackTarget ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //========================================================= @@ -182,7 +182,7 @@ void CHornet::StartDart( void ) SetTouch( &CHornet::DartTouch ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 4; + pev->nextthink = gpGlobals->time + 4.0f; } void CHornet::IgniteTrail( void ) @@ -253,7 +253,7 @@ void CHornet::TrackTarget( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } @@ -271,12 +271,12 @@ void CHornet::TrackTarget( void ) } else { - m_vecEnemyLKP = m_vecEnemyLKP + pev->velocity * m_flFlySpeed * 0.1; + m_vecEnemyLKP = m_vecEnemyLKP + pev->velocity * m_flFlySpeed * 0.1f; } vecDirToEnemy = ( m_vecEnemyLKP - pev->origin ).Normalize(); - if( pev->velocity.Length() < 0.1 ) + if( pev->velocity.Length() < 0.1f ) vecFlightDir = vecDirToEnemy; else vecFlightDir = pev->velocity.Normalize(); @@ -284,7 +284,7 @@ void CHornet::TrackTarget( void ) // measure how far the turn is, the wider the turn, the slow we'll go this time. flDelta = DotProduct( vecFlightDir, vecDirToEnemy ); - if( flDelta < 0.5 ) + if( flDelta < 0.5f ) { // hafta turn wide again. play sound switch( RANDOM_LONG( 0, 2 ) ) @@ -304,7 +304,7 @@ void CHornet::TrackTarget( void ) if( flDelta <= 0 && m_iHornetType == HORNET_TYPE_RED ) { // no flying backwards, but we don't want to invert this, cause we'd go fast when we have to turn REAL far. - flDelta = 0.25; + flDelta = 0.25f; } pev->velocity = ( vecFlightDir + vecDirToEnemy ).Normalize(); @@ -312,20 +312,20 @@ void CHornet::TrackTarget( void ) if( pev->owner && ( pev->owner->v.flags & FL_MONSTER ) ) { // random pattern only applies to hornets fired by monsters, not players. - pev->velocity.x += RANDOM_FLOAT( -0.10, 0.10 );// scramble the flight dir a bit. - pev->velocity.y += RANDOM_FLOAT( -0.10, 0.10 ); - pev->velocity.z += RANDOM_FLOAT( -0.10, 0.10 ); + pev->velocity.x += RANDOM_FLOAT( -0.10f, 0.10f );// scramble the flight dir a bit. + pev->velocity.y += RANDOM_FLOAT( -0.10f, 0.10f ); + pev->velocity.z += RANDOM_FLOAT( -0.10f, 0.10f ); } switch( m_iHornetType ) { case HORNET_TYPE_RED: pev->velocity = pev->velocity * ( m_flFlySpeed * flDelta );// scale the dir by the ( speed * width of turn ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.3f ); break; case HORNET_TYPE_ORANGE: pev->velocity = pev->velocity * m_flFlySpeed;// do not have to slow down to turn. - pev->nextthink = gpGlobals->time + 0.1;// fixed think time + pev->nextthink = gpGlobals->time + 0.1f;// fixed think time break; } @@ -337,7 +337,7 @@ void CHornet::TrackTarget( void ) // (only in the single player game) if( m_hEnemy != 0 && !g_pGameRules->IsMultiplayer() ) { - if( flDelta >= 0.4 && ( pev->origin - m_vecEnemyLKP ).Length() <= 300 ) + if( flDelta >= 0.4f && ( pev->origin - m_vecEnemyLKP ).Length() <= 300 ) { MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_SPRITE ); @@ -362,8 +362,8 @@ void CHornet::TrackTarget( void ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "hornet/ag_buzz3.wav", HORNET_BUZZ_VOLUME, ATTN_NORM ); break; } - pev->velocity = pev->velocity * 2; - pev->nextthink = gpGlobals->time + 1.0; + pev->velocity = pev->velocity * 2.0f; + pev->nextthink = gpGlobals->time + 1.0f; // don't attack again m_flStopAttack = gpGlobals->time; } @@ -388,10 +388,10 @@ void CHornet::TrackTouch( CBaseEntity *pOther ) pev->velocity = pev->velocity.Normalize(); - pev->velocity.x *= -1; - pev->velocity.y *= -1; + pev->velocity.x *= -1.0f; + pev->velocity.y *= -1.0f; - pev->origin = pev->origin + pev->velocity * 4; // bounce the hornet off a bit. + pev->origin = pev->origin + pev->velocity * 4.0f; // bounce the hornet off a bit. pev->velocity = pev->velocity * m_flFlySpeed; return; @@ -431,5 +431,5 @@ void CHornet::DieTouch( CBaseEntity *pOther ) pev->solid = SOLID_NOT; SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish! + pev->nextthink = gpGlobals->time + 1.0f;// stick around long enough for the sound to finish! } diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index 909ba342..5e903b0d 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -113,7 +113,7 @@ BOOL CHgun::Deploy() void CHgun::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( HGUN_DOWN ); //!!!HACKHACK - can't select hornetgun if it's empty! no way to get ammo for it, either. @@ -127,17 +127,17 @@ void CHgun::PrimaryAttack() { Reload(); - if(m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) + if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) { return; } #ifndef CLIENT_DLL UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition( ) + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -12, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); - pHornet->pev->velocity = gpGlobals->v_forward * 300; + 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() ); + pHornet->pev->velocity = gpGlobals->v_forward * 300.0f; - m_flRechargeTime = gpGlobals->time + 0.5; + m_flRechargeTime = gpGlobals->time + 0.5f; #endif m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -150,16 +150,16 @@ void CHgun::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, FIREMODE_TRACK, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_TRACK, 0, 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25; + m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25f; if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() ) { - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -181,49 +181,49 @@ void CHgun::SecondaryAttack( void ) UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -12; + vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f; m_iFirePhase++; switch( m_iFirePhase ) { case 1: - vecSrc = vecSrc + gpGlobals->v_up * 8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; break; case 2: - vecSrc = vecSrc + gpGlobals->v_up * 8; - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 3: - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 4: - vecSrc = vecSrc + gpGlobals->v_up * -8; - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 5: - vecSrc = vecSrc + gpGlobals->v_up * -8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; break; case 6: - vecSrc = vecSrc + gpGlobals->v_up * -8; - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; break; case 7: - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; break; case 8: - vecSrc = vecSrc + gpGlobals->v_up * 8; - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; m_iFirePhase = 0; break; } pHornet = CBaseEntity::Create( "hornet", vecSrc, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); - pHornet->pev->velocity = gpGlobals->v_forward * 1200; + pHornet->pev->velocity = gpGlobals->v_forward * 1200.0f; pHornet->pev->angles = UTIL_VecToAngles( pHornet->pev->velocity ); pHornet->SetThink( &CHornet::StartDart ); - m_flRechargeTime = gpGlobals->time + 0.5; + m_flRechargeTime = gpGlobals->time + 0.5f; #endif int flags; #if defined( CLIENT_WEAPONS ) @@ -231,7 +231,7 @@ void CHgun::SecondaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, FIREMODE_FAST, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_FAST, 0, 0, 0 ); m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME; @@ -240,8 +240,8 @@ void CHgun::SecondaryAttack( void ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } void CHgun::Reload( void ) @@ -252,7 +252,7 @@ void CHgun::Reload( void ) while( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time ) { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++; - m_flRechargeTime += 0.5; + m_flRechargeTime += 0.5f; } } @@ -264,21 +264,21 @@ void CHgun::WeaponIdle( void ) return; int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f ) { iAnim = HGUN_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0 / 16 * ( 2 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f; } - else if( flRand <= 0.875 ) + else if( flRand <= 0.875f ) { iAnim = HGUN_FIDGETSWAY; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f; } else { iAnim = HGUN_FIDGETSHAKE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 35.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 35.0f / 16.0f; } SendWeaponAnim( iAnim ); } diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index 940b68ea..2b8cadb0 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -32,8 +32,8 @@ extern CGraph WorldGraph; // houndeye does 20 points of damage spread over a sphere 384 units in diameter, and each additional // squad member increases the BASE damage by 110%, per the spec. #define HOUNDEYE_MAX_SQUAD_SIZE 4 -#define HOUNDEYE_MAX_ATTACK_RADIUS 384 -#define HOUNDEYE_SQUAD_BONUS (float)1.1 +#define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f +#define HOUNDEYE_SQUAD_BONUS 1.1f #define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye @@ -192,7 +192,7 @@ BOOL CHoundeye::FCanActiveIdle( void ) //========================================================= BOOL CHoundeye::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist <= ( HOUNDEYE_MAX_ATTACK_RADIUS * 0.5 ) && flDot >= 0.3 ) + if( flDist <= ( HOUNDEYE_MAX_ATTACK_RADIUS * 0.5f ) && flDot >= 0.3f ) { return TRUE; } @@ -285,8 +285,8 @@ void CHoundeye::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->flags &= ~FL_ONGROUND; - pev->velocity = gpGlobals->v_forward * -200; - pev->velocity.z += ( 0.6 * flGravity ) * 0.5; + pev->velocity = gpGlobals->v_forward * -200.0f; + pev->velocity.z += ( 0.6f * flGravity ) * 0.5f; break; } case HOUND_AE_THUMP: @@ -565,10 +565,10 @@ void CHoundeye::SonicAttack( void ) WRITE_BYTE( TE_BEAMCYLINDER ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); + WRITE_COORD( pev->origin.z + 16.0f ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 + HOUNDEYE_MAX_ATTACK_RADIUS / .2 ); // reach damage radius over .3 seconds + WRITE_COORD( pev->origin.z + 16.0f + HOUNDEYE_MAX_ATTACK_RADIUS / 0.2f ); // reach damage radius over .3 seconds WRITE_SHORT( m_iSpriteTexture ); WRITE_BYTE( 0 ); // startframe WRITE_BYTE( 0 ); // framerate @@ -586,10 +586,10 @@ void CHoundeye::SonicAttack( void ) WRITE_BYTE( TE_BEAMCYLINDER ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); + WRITE_COORD( pev->origin.z + 16.0f ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 + ( HOUNDEYE_MAX_ATTACK_RADIUS / 2 ) / .2 ); // reach damage radius over .3 seconds + WRITE_COORD( pev->origin.z + 16.0f + ( HOUNDEYE_MAX_ATTACK_RADIUS / 2.0f ) / 0.2f ); // reach damage radius over .3 seconds WRITE_SHORT( m_iSpriteTexture ); WRITE_BYTE( 0 ); // startframe WRITE_BYTE( 0 ); // framerate @@ -638,7 +638,7 @@ void CHoundeye::SonicAttack( void ) // if this entity is a client, and is not in full view, inflict half damage. We do this so that players still // take the residual damage if they don't totally leave the houndeye's effective radius. We restrict it to clients // so that monsters in other parts of the level don't take the damage and get pissed. - flAdjustedDamage *= 0.5; + flAdjustedDamage *= 0.5f; } else if( !FClassnameIs( pEntity->pev, "func_breakable" ) && !FClassnameIs( pEntity->pev, "func_pushable" ) ) { @@ -802,17 +802,17 @@ void CHoundeye::RunTask( Task_t *pTask ) float life; life = ( ( 255 - pev->frame ) / ( pev->framerate * m_flFrameRate ) ); - if( life < 0.1 ) - life = 0.1; + if( life < 0.1f ) + life = 0.1f; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_IMPLOSION ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); - WRITE_BYTE( 50 * life + 100 ); // radius - WRITE_BYTE( pev->frame / 25.0 ); // count - WRITE_BYTE( life * 10 ); // life + WRITE_COORD( pev->origin.z + 16.0f ); + WRITE_BYTE( 50.0f * life + 100.0f ); // radius + WRITE_BYTE( pev->frame / 25.0f ); // count + WRITE_BYTE( life * 10.0f ); // life MESSAGE_END(); if( m_fSequenceFinished ) @@ -836,7 +836,7 @@ void CHoundeye::RunTask( Task_t *pTask ) void CHoundeye::PrescheduleThink( void ) { // if the hound is mad and is running, make hunt noises. - if( m_MonsterState == MONSTERSTATE_COMBAT && m_Activity == ACT_RUN && RANDOM_FLOAT( 0, 1 ) < 0.2 ) + if( m_MonsterState == MONSTERSTATE_COMBAT && m_Activity == ACT_RUN && RANDOM_FLOAT( 0, 1 ) < 0.2f ) { WarnSound(); } @@ -882,8 +882,8 @@ void CHoundeye::PrescheduleThink( void ) //========================================================= Task_t tlHoundGuardPack[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_GUARD, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_GUARD, 0.0f }, }; Schedule_t slHoundGuardPack[] = @@ -1079,14 +1079,14 @@ Task_t tlHoundCombatFailPVS[] = { { TASK_STOP_MOVING, 0 }, { TASK_HOUND_THREAT_DISPLAY, 0 }, - { TASK_WAIT_FACE_ENEMY, (float)1 }, + { TASK_WAIT_FACE_ENEMY, 1.0f }, }; Schedule_t slHoundCombatFailPVS[] = { { tlHoundCombatFailPVS, - ARRAYSIZE ( tlHoundCombatFailPVS ), + ARRAYSIZE( tlHoundCombatFailPVS ), bits_COND_NEW_ENEMY | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE, @@ -1260,13 +1260,13 @@ Schedule_t *CHoundeye::GetSchedule( void ) if( HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) { - if( RANDOM_FLOAT( 0, 1 ) <= 0.4 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.4f ) { TraceResult tr; UTIL_MakeVectors( pev->angles ); UTIL_TraceHull( pev->origin, pev->origin + gpGlobals->v_forward * -128, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // it's clear behind, so the hound will jump return GetScheduleOfType( SCHED_HOUND_HOP_RETREAT ); diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index 53f57a27..56ff96af 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -32,7 +32,7 @@ #define SEARCH_RETRY 16 -#define ICHTHYOSAUR_SPEED 150 +#define ICHTHYOSAUR_SPEED 150.0f extern CGraph WorldGraph; @@ -328,7 +328,7 @@ int CIchthyosaur::Classify( void ) //========================================================= BOOL CIchthyosaur::CheckMeleeAttack1( float flDot, float flDist ) { - if( flDot >= 0.7 && m_flEnemyTouched > gpGlobals->time - 0.2 ) + if( flDot >= 0.7f && m_flEnemyTouched > gpGlobals->time - 0.2f ) { return TRUE; } @@ -366,7 +366,7 @@ void CIchthyosaur::CombatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE //========================================================= BOOL CIchthyosaur::CheckRangeAttack1( float flDot, float flDist ) { - if( flDot > -0.7 && (m_bOnAttack || ( flDist <= 192 && m_idealDist <= 192 ) ) ) + if( flDot > -0.7f && (m_bOnAttack || ( flDist <= 192 && m_idealDist <= 192 ) ) ) { return TRUE; } @@ -420,22 +420,22 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent ) { CBaseEntity *pHurt = m_hEnemy; - if( m_flEnemyTouched < gpGlobals->time - 0.2 && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32 + 16 + 32 ) ) + if( m_flEnemyTouched < gpGlobals->time - 0.2f && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32.0f + 16.0f + 32.0f ) ) break; Vector vecShootDir = ShootAtEnemy( pev->origin ); UTIL_MakeAimVectors( pev->angles ); - if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707 ) + if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707f ) { m_bOnAttack = TRUE; pHurt->pev->punchangle.z = -18; pHurt->pev->punchangle.x = 5; - pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 300; + pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 300.0f; if( pHurt->IsPlayer() ) { - pHurt->pev->angles.x += RANDOM_FLOAT( -35, 35 ); - pHurt->pev->angles.y += RANDOM_FLOAT( -90, 90 ); + pHurt->pev->angles.x += RANDOM_FLOAT( -35.0f, 35.0f ); + pHurt->pev->angles.y += RANDOM_FLOAT( -90.0f, 90.0f ); pHurt->pev->angles.z = 0; pHurt->pev->fixangle = TRUE; } @@ -454,7 +454,7 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent ) if( bDidAttack ) { - Vector vecSrc = pev->origin + gpGlobals->v_forward * 32; + Vector vecSrc = pev->origin + gpGlobals->v_forward * 32.0f; UTIL_Bubbles( vecSrc - Vector( 8, 8, 8 ), vecSrc + Vector( 8, 8, 8 ), 16 ); } } @@ -478,7 +478,7 @@ void CIchthyosaur::Spawn() m_MonsterState = MONSTERSTATE_NONE; SetBits(pev->flags, FL_SWIM); SetFlyingSpeed( ICHTHYOSAUR_SPEED ); - SetFlyingMomentum( 2.5 ); // Set momentum constant + SetFlyingMomentum( 2.5f ); // Set momentum constant m_afCapability = bits_CAP_RANGE_ATTACK1 | bits_CAP_SWIM; @@ -634,9 +634,9 @@ void CIchthyosaur::RunTask( Task_t *pTask ) Vector vecSwim = CrossProduct( vecDelta, Vector( 0, 0, 1 ) ).Normalize(); if( DotProduct( vecSwim, m_SaveVelocity ) < 0 ) - vecSwim = vecSwim * -1.0; + vecSwim = vecSwim * -1.0f; - Vector vecPos = vecFrom + vecDelta * m_idealDist + vecSwim * 32; + Vector vecPos = vecFrom + vecDelta * m_idealDist + vecSwim * 32.0f; // ALERT( at_console, "vecPos %.0f %.0f %.0f\n", vecPos.x, vecPos.y, vecPos.z ); @@ -644,16 +644,16 @@ void CIchthyosaur::RunTask( Task_t *pTask ) UTIL_TraceHull( vecFrom, vecPos, ignore_monsters, large_hull, m_hEnemy->edict(), &tr ); - if( tr.flFraction > 0.5 ) + if( tr.flFraction > 0.5f ) vecPos = tr.vecEndPos; - m_SaveVelocity = m_SaveVelocity * 0.8 + 0.2 * ( vecPos - pev->origin ).Normalize() * m_flightSpeed; + m_SaveVelocity = m_SaveVelocity * 0.8f + 0.2f * ( vecPos - pev->origin ).Normalize() * m_flightSpeed; // ALERT( at_console, "m_SaveVelocity %.2f %.2f %.2f\n", m_SaveVelocity.x, m_SaveVelocity.y, m_SaveVelocity.z ); if( HasConditions( bits_COND_ENEMY_FACING_ME ) && m_hEnemy->FVisible( this ) ) { - m_flNextAlert -= 0.1; + m_flNextAlert -= 0.1f; if( m_idealDist < m_flMaxDist ) { @@ -670,12 +670,12 @@ void CIchthyosaur::RunTask( Task_t *pTask ) } if( m_flMinSpeed < m_flMaxSpeed ) { - m_flMinSpeed += 0.5; + m_flMinSpeed += 0.5f; } } else { - m_flNextAlert += 0.1; + m_flNextAlert += 0.1f; if( m_idealDist > 128 ) { @@ -690,7 +690,7 @@ void CIchthyosaur::RunTask( Task_t *pTask ) } else { - m_flNextAlert = gpGlobals->time + 0.2; + m_flNextAlert = gpGlobals->time + 0.2f; } if( m_flNextAlert < gpGlobals->time ) @@ -716,7 +716,7 @@ void CIchthyosaur::RunTask( Task_t *pTask ) break; case TASK_ICHTHYOSAUR_FLOAT: pev->angles.x = UTIL_ApproachAngle( 0, pev->angles.x, 20 ); - pev->velocity = pev->velocity * 0.8; + pev->velocity = pev->velocity * 0.8f; if( pev->waterlevel > 1 && pev->velocity.z < 64 ) { pev->velocity.z += 8; @@ -740,7 +740,7 @@ float CIchthyosaur::VectorToPitch( const Vector &vec ) pitch = 0; else { - pitch = (int) ( atan2( vec.z, sqrt( vec.x * vec.x + vec.y * vec.y ) ) * 180 / M_PI ); + pitch = (int) ( atan2( vec.z, sqrt( vec.x * vec.x + vec.y * vec.y ) ) * 180.0f / M_PI_F ); if( pitch < 0 ) pitch += 360; } @@ -793,7 +793,7 @@ float CIchthyosaur::ChangePitch( int speed ) else if( diff > 20 ) target = -45; } - pev->angles.x = UTIL_Approach(target, pev->angles.x, 220.0 * 0.1 ); + pev->angles.x = UTIL_Approach(target, pev->angles.x, 220.0f * 0.1f ); } return 0; } @@ -812,7 +812,7 @@ float CIchthyosaur::ChangeYaw( int speed ) else if( diff > 20 ) target = -20; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0 * 0.1 ); + pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * 0.1f ); } return CFlyingMonster::ChangeYaw( speed ); } @@ -843,9 +843,9 @@ void CIchthyosaur::MonsterThink( void ) if( m_flBlink < gpGlobals->time ) { pev->skin = EYE_CLOSED; - if( m_flBlink + 0.2 < gpGlobals->time ) + if( m_flBlink + 0.2f < gpGlobals->time ) { - m_flBlink = gpGlobals->time + RANDOM_FLOAT( 3, 4 ); + m_flBlink = gpGlobals->time + RANDOM_FLOAT( 3.0f, 4.0f ); if( m_bOnAttack ) pev->skin = EYE_MAD; else @@ -873,7 +873,7 @@ void CIchthyosaur::Swim() if( FBitSet( pev->flags, FL_ONGROUND ) ) { - pev->angles.x = 0; + pev->angles.x = 0.0f; pev->angles.y += RANDOM_FLOAT( -45, 45 ); ClearBits( pev->flags, FL_ONGROUND ); @@ -894,15 +894,15 @@ void CIchthyosaur::Swim() if( m_IdealActivity == ACT_RUN ) SetActivity( ACT_WALK ); if( m_IdealActivity == ACT_WALK ) - pev->framerate = m_flightSpeed / 150.0; + pev->framerate = m_flightSpeed / 150.0f; // ALERT( at_console, "walk %.2f\n", pev->framerate ); } else { if( m_IdealActivity == ACT_WALK ) SetActivity( ACT_RUN ); - if( m_IdealActivity == ACT_RUN) - pev->framerate = m_flightSpeed / 150.0; + if( m_IdealActivity == ACT_RUN ) + pev->framerate = m_flightSpeed / 150.0f; // ALERT( at_console, "run %.2f\n", pev->framerate ); } /* @@ -935,10 +935,10 @@ void CIchthyosaur::Swim() // ALERT( at_console, "%f : %f\n", Angles.x, Forward.z ); float flDot = DotProduct( Forward, m_SaveVelocity ); - if( flDot > 0.5 ) + if( flDot > 0.5f ) pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed; else if( flDot > 0 ) - pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5 ); + pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5f ); else pev->velocity = m_SaveVelocity = m_SaveVelocity * 80; @@ -957,7 +957,7 @@ void CIchthyosaur::Swim() // if( Angles.x > 180 ) Angles.x = Angles.x - 360; - pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1 ); + pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1f ); if( pev->angles.x < -80 ) pev->angles.x = -80; if( pev->angles.x > 80 ) @@ -981,12 +981,12 @@ void CIchthyosaur::Swim() turn = Angles.y - pev->angles.y - 360; } - float speed = m_flightSpeed * 0.1; + float speed = m_flightSpeed * 0.1f; // ALERT( at_console, "speed %.0f %f\n", turn, speed ); if( fabs( turn ) > speed ) { - if( turn < 0.0 ) + if( turn < 0.0f ) { turn = -speed; } @@ -997,15 +997,15 @@ void CIchthyosaur::Swim() } pev->angles.y += turn; pev->angles.z -= turn; - pev->angles.y = fmod( ( pev->angles.y + 360.0 ), 360.0 ); + pev->angles.y = fmod( ( pev->angles.y + 360.0f ), 360.0f ); static float yaw_adj; - yaw_adj = yaw_adj * 0.8 + turn; + yaw_adj = yaw_adj * 0.8f + turn; // ALERT( at_console, "yaw %f : %f\n", turn, yaw_adj ); - SetBoneController( 0, -yaw_adj / 4.0 ); + SetBoneController( 0, -yaw_adj * 0.25f ); // Roll Smoothing // @@ -1022,7 +1022,7 @@ void CIchthyosaur::Swim() { turn = Angles.z - pev->angles.z - 360; } - speed = m_flightSpeed / 2 * 0.1; + speed = m_flightSpeed / 2 * 0.1f; if( fabs( turn ) < speed ) { @@ -1030,7 +1030,7 @@ void CIchthyosaur::Swim() } else { - if( turn < 0.0 ) + if( turn < 0.0f ) { pev->angles.z -= speed; } @@ -1058,12 +1058,12 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe ) TraceResult tr; TRACE_MONSTER_HULL( edict(), pev->origin, Probe, dont_ignore_monsters, edict(), &tr ); - if( tr.fAllSolid || tr.flFraction < 0.99 ) + if( tr.fAllSolid || tr.flFraction < 0.99f ) { - if( tr.flFraction < 0.0 ) - tr.flFraction = 0.0; - if( tr.flFraction > 1.0 ) - tr.flFraction = 1.0; + if( tr.flFraction < 0.0f ) + tr.flFraction = 0.0f; + if( tr.flFraction > 1.0f ) + tr.flFraction = 1.0f; if( tr.flFraction < frac ) { frac = tr.flFraction; @@ -1080,7 +1080,7 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe ) Vector SteeringVector = CrossProduct( NormalToProbeAndWallNormal, ProbeDir ); float SteeringForce = m_flightSpeed * ( 1 -frac ) * ( DotProduct( WallNormal.Normalize(), m_SaveVelocity.Normalize() ) ); - if( SteeringForce < 0.0 ) + if( SteeringForce < 0.0f ) { SteeringForce = -SteeringForce; } diff --git a/dlls/islave.cpp b/dlls/islave.cpp index b516c09b..f66a57aa 100644 --- a/dlls/islave.cpp +++ b/dlls/islave.cpp @@ -467,7 +467,7 @@ BOOL CISlave::CheckRangeAttack2( float flDot, float flDist ) TraceResult tr; UTIL_TraceLine( EyePosition(), pEntity->EyePosition(), ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { if( pEntity->pev->deadflag == DEAD_DEAD ) { @@ -723,7 +723,7 @@ void CISlave::ArmBeam( int side ) } // Couldn't find anything close enough - if( flDist == 1.0 ) + if( flDist == 1.0f ) return; DecalGunshot( &tr, BULLET_PLAYER_CROWBAR ); diff --git a/dlls/items.cpp b/dlls/items.cpp index 45edeb5e..08a13711 100644 --- a/dlls/items.cpp +++ b/dlls/items.cpp @@ -96,7 +96,7 @@ void CItem::Spawn( void ) if( DROP_TO_FLOOR(ENT( pev ) ) == 0 ) { - ALERT(at_error, "Item %s fell out of level at %f,%f,%f\n", STRING( pev->classname ), pev->origin.x, pev->origin.y, pev->origin.z); + ALERT(at_error, "Item %s fell out of level at %f,%f,%f\n", STRING( pev->classname ), (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z); UTIL_Remove( this ); return; } @@ -237,7 +237,7 @@ class CItemBattery : public CItem // Suit reports new power level // For some reason this wasn't working in release build -- round it. - pct = (int)( (float)( pPlayer->pev->armorvalue * 100.0 ) * ( 1.0 / MAX_NORMAL_BATTERY ) + 0.5 ); + pct = (int)( (float)( pPlayer->pev->armorvalue * 100.0f ) * ( 1.0f / MAX_NORMAL_BATTERY ) + 0.5f ); pct = ( pct / 5 ); if( pct > 0 ) pct--; diff --git a/dlls/leech.cpp b/dlls/leech.cpp index 1d64eae1..092f338e 100644 --- a/dlls/leech.cpp +++ b/dlls/leech.cpp @@ -48,12 +48,12 @@ #define LEECH_ACCELERATE 10 #define LEECH_CHECK_DIST 45 -#define LEECH_SWIM_SPEED 50 -#define LEECH_SWIM_ACCEL 80 -#define LEECH_SWIM_DECEL 10 +#define LEECH_SWIM_SPEED 50.0f +#define LEECH_SWIM_ACCEL 80.0f +#define LEECH_SWIM_DECEL 10.0f #define LEECH_TURN_RATE 90 #define LEECH_SIZEX 10 -#define LEECH_FRAMETIME 0.1 +#define LEECH_FRAMETIME 0.1f #define DEBUG_BEAMS 0 @@ -209,16 +209,16 @@ void CLeech::RecalculateWaterlevel( void ) TraceResult tr; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) - m_bottom = tr.vecEndPos.z + 1; + if( tr.flFraction != 1.0f ) + m_bottom = tr.vecEndPos.z + 1.0f; else m_bottom = vecTest.z; m_top = UTIL_WaterLevel( pev->origin, pev->origin.z, pev->origin.z + 400 ) - 1; // Chop off 20% of the outside range - float newBottom = m_bottom * 0.8 + m_top * 0.2; - m_top = m_bottom * 0.2 + m_top * 0.8; + float newBottom = m_bottom * 0.8f + m_top * 0.2f; + m_top = m_bottom * 0.2f + m_top * 0.8f; m_bottom = newBottom; m_height = RANDOM_FLOAT( m_bottom, m_top ); m_waterTime = gpGlobals->time + RANDOM_FLOAT( 5, 7 ); @@ -259,14 +259,14 @@ void CLeech::AttackSound( void ) { if( gpGlobals->time > m_attackSoundTime ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, PITCH_NORM ); - m_attackSoundTime = gpGlobals->time + 0.5; + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM, 0, PITCH_NORM ); + m_attackSoundTime = gpGlobals->time + 0.5f; } } void CLeech::AlertSound( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM * 0.5, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM * 0.5f, 0, PITCH_NORM ); } void CLeech::Precache( void ) @@ -289,7 +289,7 @@ int CLeech::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float f // Nudge the leech away from the damage if( pevInflictor ) { - pev->velocity = ( pev->origin - pevInflictor->origin ).Normalize() * 25; + pev->velocity = ( pev->origin - pevInflictor->origin ).Normalize() * 25.0f; } return CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType ); @@ -315,7 +315,7 @@ void CLeech::HandleAnimEvent( MonsterEvent_t *pEvent ) dir = dir.Normalize(); face = face.Normalize(); - if( DotProduct( dir, face ) > 0.9 ) // Only take damage if the leech is facing the prey + if( DotProduct( dir, face ) > 0.9f ) // Only take damage if the leech is facing the prey pEnemy->TakeDamage( pev, pev, gSkillData.leechDmgBite, DMG_SLASH ); } m_stateTime -= 2; @@ -354,12 +354,12 @@ float CLeech::ObstacleDistance( CBaseEntity *pTarget ) if( tr.fStartSolid ) { - pev->speed = -LEECH_SWIM_SPEED * 0.5; + pev->speed = -LEECH_SWIM_SPEED * 0.5f; //ALERT( at_console, "Stuck from (%f %f %f) to (%f %f %f)\n", pev->oldorigin.x, pev->oldorigin.y, pev->oldorigin.z, pev->origin.x, pev->origin.y, pev->origin.z ); //UTIL_SetOrigin( pev, pev->oldorigin ); } - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( ( pTarget == NULL || tr.pHit != pTarget->edict() ) ) { @@ -377,16 +377,16 @@ float CLeech::ObstacleDistance( CBaseEntity *pTarget ) // extra wide checks vecTest = pev->origin + gpGlobals->v_right * LEECH_SIZEX * 2 + gpGlobals->v_forward * LEECH_CHECK_DIST; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.flFraction; vecTest = pev->origin - gpGlobals->v_right * LEECH_SIZEX * 2 + gpGlobals->v_forward * LEECH_CHECK_DIST; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.flFraction; // Didn't hit either side, so stop testing for another 0.5 - 1 seconds - m_sideTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 1 ); + m_sideTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 1.0f ); } return 1.0; } @@ -408,7 +408,7 @@ void CLeech::DeadThink( void ) } } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Apply damage velocity, but keep out of the walls if( pev->velocity.x != 0 || pev->velocity.y != 0 ) @@ -416,11 +416,11 @@ void CLeech::DeadThink( void ) TraceResult tr; // Look 0.5 seconds ahead - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 0.5, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 0.5f, missile, edict(), &tr ); + if( tr.flFraction != 1.0f ) { - pev->velocity.x = 0; - pev->velocity.y = 0; + pev->velocity.x = 0.0f; + pev->velocity.y = 0.0f; } } } @@ -428,15 +428,15 @@ void CLeech::DeadThink( void ) void CLeech::UpdateMotion( void ) { float flapspeed = ( pev->speed - m_flAccelerate ) / LEECH_ACCELERATE; - m_flAccelerate = m_flAccelerate * 0.8 + pev->speed * 0.2; + m_flAccelerate = m_flAccelerate * 0.8f + pev->speed * 0.2f; if( flapspeed < 0 ) flapspeed = -flapspeed; - flapspeed += 1.0; - if( flapspeed < 0.5 ) - flapspeed = 0.5; - if( flapspeed > 1.9 ) - flapspeed = 1.9; + flapspeed += 1.0f; + if( flapspeed < 0.5f ) + flapspeed = 0.5f; + if( flapspeed > 1.9f ) + flapspeed = 1.9f; pev->framerate = flapspeed; @@ -445,9 +445,9 @@ void CLeech::UpdateMotion( void ) else pev->avelocity.y = pev->ideal_yaw * m_obstacle; - if( pev->avelocity.y > 150 ) + if( pev->avelocity.y > 150.0f ) m_IdealActivity = ACT_TURN_LEFT; - else if( pev->avelocity.y < -150 ) + else if( pev->avelocity.y < -150.0f ) m_IdealActivity = ACT_TURN_RIGHT; else m_IdealActivity = ACT_SWIM; @@ -463,10 +463,10 @@ void CLeech::UpdateMotion( void ) else targetPitch = 0; - pev->angles.x = UTIL_Approach( targetPitch, pev->angles.x, 60 * LEECH_FRAMETIME ); + pev->angles.x = UTIL_Approach( targetPitch, pev->angles.x, 60.0f * LEECH_FRAMETIME ); // bank - pev->avelocity.z = -( pev->angles.z + ( pev->avelocity.y * 0.25 ) ); + pev->avelocity.z = -( pev->angles.z + ( pev->avelocity.y * 0.25f ) ); if( m_MonsterState == MONSTERSTATE_COMBAT && HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) m_IdealActivity = ACT_MELEE_ATTACK1; @@ -479,11 +479,11 @@ void CLeech::UpdateMotion( void ) pev->velocity = g_vecZero; // Animation will intersect the floor if either of these is non-zero - pev->angles.z = 0; - pev->angles.x = 0; + pev->angles.z = 0.0f; + pev->angles.x = 0.0f; - if( pev->framerate < 1.0 ) - pev->framerate = 1.0; + if( pev->framerate < 1.0f ) + pev->framerate = 1.0f; } else if( pev->movetype == MOVETYPE_TOSS ) { @@ -505,11 +505,11 @@ void CLeech::UpdateMotion( void ) if( !m_pt ) m_pt = CBeam::BeamCreate( "sprites/laserbeam.spr", 5 ); m_pb->PointsInit( pev->origin, pev->origin + gpGlobals->v_forward * LEECH_CHECK_DIST ); - m_pt->PointsInit( pev->origin, pev->origin - gpGlobals->v_right * ( pev->avelocity.y * 0.25 ) ); + m_pt->PointsInit( pev->origin, pev->origin - gpGlobals->v_right * ( pev->avelocity.y * 0.25f ) ); if( m_fPathBlocked ) { float color = m_obstacle * 30; - if( m_obstacle == 1.0 ) + if( m_obstacle == 1.0f ) color = 0; if( color > 255 ) color = 255; @@ -532,12 +532,12 @@ void CLeech::SwimThink( void ) if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) { - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1.0f, 1.5f ); pev->velocity = g_vecZero; return; } else - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; targetSpeed = LEECH_SWIM_SPEED; @@ -572,10 +572,10 @@ void CLeech::SwimThink( void ) targetYaw = UTIL_AngleDiff( targetYaw, UTIL_AngleMod( pev->angles.y ) ); - if( targetYaw < ( -LEECH_TURN_RATE * 0.75 ) ) - targetYaw = ( -LEECH_TURN_RATE * 0.75 ); - else if( targetYaw > ( LEECH_TURN_RATE * 0.75 ) ) - targetYaw = ( LEECH_TURN_RATE * 0.75 ); + if( targetYaw < ( -LEECH_TURN_RATE * 0.75f ) ) + targetYaw = ( -LEECH_TURN_RATE * 0.75f ); + else if( targetYaw > ( LEECH_TURN_RATE * 0.75f ) ) + targetYaw = ( LEECH_TURN_RATE * 0.75f ); else targetSpeed *= 2; } @@ -584,7 +584,7 @@ void CLeech::SwimThink( void ) if( m_zTime < gpGlobals->time ) { float newHeight = RANDOM_FLOAT( m_bottom, m_top ); - m_height = 0.5 * m_height + 0.5 * newHeight; + m_height = 0.5f * m_height + 0.5f * newHeight; m_zTime = gpGlobals->time + RANDOM_FLOAT( 1, 4 ); } if( RANDOM_LONG( 0, 100 ) < 10 ) @@ -602,11 +602,11 @@ void CLeech::SwimThink( void ) m_obstacle = ObstacleDistance( pTarget ); pev->oldorigin = pev->origin; - if( m_obstacle < 0.1 ) - m_obstacle = 0.1; + if( m_obstacle < 0.1f ) + m_obstacle = 0.1f; // is the way ahead clear? - if( m_obstacle == 1.0 ) + if( m_obstacle == 1.0f ) { // if the leech is turning, stop the trend. if( m_flTurning != 0 ) @@ -621,7 +621,7 @@ void CLeech::SwimThink( void ) } else { - m_obstacle = 1.0 / m_obstacle; + m_obstacle = 1.0f / m_obstacle; // IF we get this far in the function, the leader's path is blocked! m_fPathBlocked = TRUE; @@ -639,12 +639,12 @@ void CLeech::SwimThink( void ) // turn left, right or random depending on clearance ratio float delta = ( flRightSide - flLeftSide ); - if( delta > 0.1 || ( delta > -0.1 && RANDOM_LONG( 0, 100 ) < 50 ) ) + if( delta > 0.1f || ( delta > -0.1f && RANDOM_LONG( 0, 100 ) < 50 ) ) m_flTurning = -LEECH_TURN_RATE; else m_flTurning = LEECH_TURN_RATE; } - pev->speed = UTIL_Approach( -( LEECH_SWIM_SPEED * 0.5 ), pev->speed, LEECH_SWIM_DECEL * LEECH_FRAMETIME * m_obstacle ); + pev->speed = UTIL_Approach( -( LEECH_SWIM_SPEED * 0.5f ), pev->speed, LEECH_SWIM_DECEL * LEECH_FRAMETIME * m_obstacle ); pev->velocity = gpGlobals->v_forward * pev->speed; } pev->ideal_yaw = m_flTurning + targetYaw; diff --git a/dlls/lights.cpp b/dlls/lights.cpp index 13e6d3a9..9ff839c3 100644 --- a/dlls/lights.cpp +++ b/dlls/lights.cpp @@ -162,9 +162,9 @@ void CEnvLight::KeyValue( KeyValueData* pkvd ) } // simulate qrad direct, ambient,and gamma adjustments, as well as engine scaling - r = (int)( pow( r / 114.0, 0.6 ) * 264.0 ); - g = (int)( pow( g / 114.0, 0.6 ) * 264.0 ); - b = (int)( pow( b / 114.0, 0.6 ) * 264.0 ); + r = (int)( pow( r / 114.0f, 0.6f ) * 264.0f ); + g = (int)( pow( g / 114.0f, 0.6f ) * 264.0f ); + b = (int)( pow( b / 114.0f, 0.6f ) * 264.0f ); pkvd->fHandled = TRUE; sprintf( szColor, "%d", r ); @@ -185,11 +185,11 @@ void CEnvLight::Spawn( void ) char szVector[64]; UTIL_MakeAimVectors( pev->angles ); - sprintf( szVector, "%f", gpGlobals->v_forward.x ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.x ); CVAR_SET_STRING( "sv_skyvec_x", szVector ); - sprintf( szVector, "%f", gpGlobals->v_forward.y ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.y ); CVAR_SET_STRING( "sv_skyvec_y", szVector ); - sprintf( szVector, "%f", gpGlobals->v_forward.z ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.z ); CVAR_SET_STRING( "sv_skyvec_z", szVector ); CLight::Spawn(); diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 3ff235ee..72eb331d 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -513,7 +513,7 @@ CSound *CBaseMonster::PBestScent( void ) //========================================================= void CBaseMonster::MonsterThink( void ) { - pev->nextthink = gpGlobals->time + 0.1;// keep monster thinking. + pev->nextthink = gpGlobals->time + 0.1f;// keep monster thinking. RunAI(); @@ -850,10 +850,10 @@ void CBaseMonster::RouteSimplify( CBaseEntity *pTargetEnt ) Vector vecTest, vecSplit; // Halfway between this and next - vecTest = ( m_Route[m_iRouteIndex + i + 1].vecLocation + m_Route[m_iRouteIndex + i].vecLocation ) * 0.5; + vecTest = ( m_Route[m_iRouteIndex + i + 1].vecLocation + m_Route[m_iRouteIndex + i].vecLocation ) * 0.5f; // Halfway between this and previous - vecSplit = ( m_Route[m_iRouteIndex + i].vecLocation + vecStart ) * 0.5; + vecSplit = ( m_Route[m_iRouteIndex + i].vecLocation + vecStart ) * 0.5f; int iType = ( m_Route[m_iRouteIndex + i].iType | bits_MF_TO_DETOUR ) & ~bits_MF_NOT_TO_MASK; if( CheckLocalMove( vecStart, vecTest, pTargetEnt, NULL ) == LOCALMOVE_VALID ) @@ -927,7 +927,7 @@ BOOL CBaseMonster::FBecomeProne( void ) //========================================================= BOOL CBaseMonster::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist > 64 && flDist <= 784 && flDot >= 0.5 ) + if( flDist > 64.0f && flDist <= 784.0f && flDot >= 0.5f ) { return TRUE; } @@ -939,7 +939,7 @@ BOOL CBaseMonster::CheckRangeAttack1( float flDot, float flDist ) //========================================================= BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist ) { - if( flDist > 64 && flDist <= 512 && flDot >= 0.5 ) + if( flDist > 64.0f && flDist <= 512.0f && flDot >= 0.5f ) { return TRUE; } @@ -952,7 +952,7 @@ BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist ) BOOL CBaseMonster::CheckMeleeAttack1( float flDot, float flDist ) { // Decent fix to keep folks from kicking/punching hornets and snarks is to check the onground flag(sjb) - if( flDist <= 64 && flDot >= 0.7 && m_hEnemy != 0 && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) ) + if( flDist <= 64.0f && flDot >= 0.7f && m_hEnemy != 0 && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) ) { return TRUE; } @@ -964,7 +964,7 @@ BOOL CBaseMonster::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CBaseMonster::CheckMeleeAttack2( float flDot, float flDist ) { - if( flDist <= 64 && flDot >= 0.7 ) + if( flDist <= 64.0f && flDot >= 0.7f ) { return TRUE; } @@ -1062,7 +1062,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) // distance to enemy's origin flDistToEnemy = ( vecEnemyPos - pev->origin ).Length(); - vecEnemyPos.z += pEnemy->pev->size.z * 0.5; + vecEnemyPos.z += pEnemy->pev->size.z * 0.5f; // distance to enemy's head float flDistToEnemy2 = ( vecEnemyPos - pev->origin ).Length(); @@ -1099,7 +1099,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) if( pEnemy->pev->velocity != Vector( 0, 0, 0 ) ) { // trail the enemy a bit - m_vecEnemyLKP = m_vecEnemyLKP - pEnemy->pev->velocity * RANDOM_FLOAT( -0.05, 0 ); + m_vecEnemyLKP = m_vecEnemyLKP - pEnemy->pev->velocity * RANDOM_FLOAT( -0.05f, 0.0f ); } else { @@ -1135,7 +1135,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) if( m_Route[i].iType == ( bits_MF_IS_GOAL | bits_MF_TO_ENEMY ) ) { // UNDONE: Should we allow monsters to override this distance (80?) - if( ( m_Route[i].vecLocation - m_vecEnemyLKP ).Length() > 80 ) + if( ( m_Route[i].vecLocation - m_vecEnemyLKP ).Length() > 80.0f ) { // Refresh FRefreshRoute(); @@ -1357,7 +1357,7 @@ int CBaseMonster::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd, { // The monster can move to a spot UNDER the target, but not to it. Don't try to triangulate, go directly to the node graph. // UNDONE: Magic # 64 -- this used to be pev->size.z but that won't work for small creatures like the headcrab - if( fabs( vecEnd.z - pev->origin.z ) > 64 ) + if( fabs( vecEnd.z - pev->origin.z ) > 64.0f ) { iReturn = LOCALMOVE_INVALID_DONT_TRIANGULATE; } @@ -1478,7 +1478,7 @@ void CBaseMonster::AdvanceRoute( float distance ) } else // At goal!!! { - if( distance < m_flGroundSpeed * 0.2 /* FIX */ ) + if( distance < m_flGroundSpeed * 0.2f /* FIX */ ) { MovementComplete(); } @@ -1612,13 +1612,13 @@ BOOL CBaseMonster::FTriangulate( const Vector &vecStart, const Vector &vecEnd, f // If the hull width is less than 24, use 24 because CheckLocalMove uses a min of // 24. sizeX = pev->size.x; - if( sizeX < 24.0 ) - sizeX = 24.0; - else if( sizeX > 48.0 ) - sizeX = 48.0; + if( sizeX < 24.0f ) + sizeX = 24.0f; + else if( sizeX > 48.0f ) + sizeX = 48.0f; sizeZ = pev->size.z; - //if( sizeZ < 24.0 ) - // sizeZ = 24.0; + //if( sizeZ < 24.0f ) + // sizeZ = 24.0f; vecForward = ( vecEnd - vecStart ).Normalize(); @@ -1856,7 +1856,7 @@ void CBaseMonster::Move( float flInterval ) DispatchBlocked( edict(), pBlocker->edict() ); } - if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && ( gpGlobals->time-m_flMoveWaitFinished ) > 3.0 ) + if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && ( gpGlobals->time-m_flMoveWaitFinished ) > 3.0f ) { // Can we still move toward our target? if( flDist < m_flGroundSpeed ) @@ -1891,10 +1891,10 @@ void CBaseMonster::Move( float flInterval ) else { // Don't get stuck - if( ( gpGlobals->time - m_flMoveWaitFinished ) < 0.2 ) + if( ( gpGlobals->time - m_flMoveWaitFinished ) < 0.2f ) Remember( bits_MEMORY_MOVE_FAILED ); - m_flMoveWaitFinished = gpGlobals->time + 0.1; + m_flMoveWaitFinished = gpGlobals->time + 0.1f; } } else @@ -1957,10 +1957,10 @@ void CBaseMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, f float flTotal = m_flGroundSpeed * pev->framerate * flInterval; float flStep; - while( flTotal > 0.001 ) + while( flTotal > 0.001f ) { // don't walk more than 16 units or stairs stop working - flStep = Q_min( 16.0, flTotal ); + flStep = Q_min( 16.0f, flTotal ); UTIL_MoveToOrigin( ENT( pev ), m_Route[m_iRouteIndex].vecLocation, flStep, MOVE_NORMAL ); flTotal -= flStep; } @@ -2008,14 +2008,14 @@ void CBaseMonster::MonsterInit( void ) m_hEnemy = NULL; - m_flDistTooFar = 1024.0; - m_flDistLook = 2048.0; + m_flDistTooFar = 1024.0f; + m_flDistLook = 2048.0f; // set eye position SetEyePosition(); SetThink( &CBaseMonster::MonsterInitThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); } @@ -2117,7 +2117,7 @@ void CBaseMonster::StartMonster( void ) // Delay drop to floor to make sure each door in the level has had its chance to spawn // Spread think times so that they don't all happen at the same time (Carmack) SetThink( &CBaseMonster::CallMonsterThink ); - pev->nextthink += RANDOM_FLOAT( 0.1, 0.4 ); // spread think times. + pev->nextthink += RANDOM_FLOAT( 0.1f, 0.4f ); // spread think times. // Vit_amiN: fixed -- now it doesn't touch any scripted_sequence target if( !FStringNull( pev->targetname ) && !m_pCine )// wait until triggered @@ -2214,12 +2214,12 @@ BOOL CBaseMonster::FindCover( Vector vecThreat, Vector vecViewOffset, float flMi flMaxDist = 784; } - if( flMinDist > 0.5 * flMaxDist ) + if( flMinDist > 0.5f * flMaxDist ) { #if _DEBUG ALERT( at_console, "FindCover MinDist (%.0f) too close to MaxDist (%.0f)\n", flMinDist, flMaxDist ); #endif - flMinDist = 0.5 * flMaxDist; + flMinDist = 0.5f * flMaxDist; } if( !WorldGraph.m_fGraphPresent || !WorldGraph.m_fGraphPointersSet ) @@ -2264,7 +2264,7 @@ BOOL CBaseMonster::FindCover( Vector vecThreat, Vector vecViewOffset, float flMi UTIL_TraceLine( node.m_vecOrigin + vecViewOffset, vecLookersOffset, ignore_monsters, ignore_glass, ENT( pev ), &tr ); // if this node will block the threat's line of sight to me... - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // ..and is also closer to me than the threat, or the same distance from myself and the threat the node is good. if( ( iMyNode == iThreatNode ) || WorldGraph.PathLength( iMyNode, nodeNumber, iMyHullIndex, m_afCapability ) <= WorldGraph.PathLength( iThreatNode, nodeNumber, iMyHullIndex, m_afCapability ) ) @@ -2318,12 +2318,12 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl flMaxDist = 784; } - if( flMinDist > 0.5 * flMaxDist ) + if( flMinDist > 0.5f * flMaxDist ) { #if _DEBUG ALERT( at_console, "FindCover MinDist (%.0f) too close to MaxDist (%.0f)\n", flMinDist, flMaxDist ); #endif - flMinDist = 0.5 * flMaxDist; + flMinDist = 0.5f * flMaxDist; } if( !WorldGraph.m_fGraphPresent || !WorldGraph.m_fGraphPointersSet ) @@ -2362,7 +2362,7 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl // can I see where I want to be from there? UTIL_TraceLine( node.m_vecOrigin + pev->view_ofs, vecLookersOffset, ignore_monsters, edict(), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // try to actually get there if( BuildRoute( node.m_vecOrigin, bits_MF_TO_LOCATION, NULL ) ) @@ -2814,7 +2814,7 @@ int CBaseMonster::FindHintNode( void ) { UTIL_TraceLine( pev->origin + pev->view_ofs, node.m_vecOrigin + pev->view_ofs, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { WorldGraph.m_iLastActiveIdleSearch = nodeNumber + 1; // next monster that searches for hint nodes will start where we left off. return nodeNumber;// take it! @@ -2872,7 +2872,7 @@ void CBaseMonster::ReportAIState( void ) { ALERT( level, " Moving " ); if( m_flMoveWaitFinished > gpGlobals->time ) - ALERT( level, ": Stopped for %.2f. ", m_flMoveWaitFinished - gpGlobals->time ); + ALERT( level, ": Stopped for %.2f. ", (double)(m_flMoveWaitFinished - gpGlobals->time) ); else if( m_IdealActivity == GetStoppedActivity() ) ALERT( level, ": In stopped anim. " ); } @@ -2897,7 +2897,7 @@ void CBaseMonster::ReportAIState( void ) } ALERT( level, "\n" ); - ALERT( level, "Yaw speed:%3.1f,Health: %3.1f\n", pev->yaw_speed, pev->health ); + ALERT( level, "Yaw speed:%3.1f,Health: %3.1f\n", (double)pev->yaw_speed, (double)pev->health ); if( pev->spawnflags & SF_MONSTER_PRISONER ) ALERT( level, " PRISONER! " ); if( pev->spawnflags & SF_MONSTER_PREDISASTER ) @@ -3095,7 +3095,7 @@ BOOL CBaseMonster::FindLateralCover( const Vector &vecThreat, const Vector &vecV // it's faster to check the SightEnt's visibility to the potential spot than to check the local move, so we do that first. UTIL_TraceLine( vecThreat + vecViewOffset, vecLeftTest + pev->view_ofs, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( FValidateCover( vecLeftTest ) && CheckLocalMove( pev->origin, vecLeftTest, NULL, NULL ) == LOCALMOVE_VALID ) { @@ -3109,7 +3109,7 @@ BOOL CBaseMonster::FindLateralCover( const Vector &vecThreat, const Vector &vecV // it's faster to check the SightEnt's visibility to the potential spot than to check the local move, so we do that first. UTIL_TraceLine( vecThreat + vecViewOffset, vecRightTest + pev->view_ofs, ignore_monsters, ignore_glass, ENT(pev)/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( FValidateCover( vecRightTest ) && CheckLocalMove( pev->origin, vecRightTest, NULL, NULL ) == LOCALMOVE_VALID ) { @@ -3145,7 +3145,7 @@ Vector CBaseMonster::ShootAtEnemy( const Vector &shootOrigin ) //========================================================= BOOL CBaseMonster::FacingIdeal( void ) { - if( fabs( FlYawDiff() ) <= 0.006 )//!!!BUGBUG - no magic numbers!!! + if( fabs( FlYawDiff() ) <= 0.006f )//!!!BUGBUG - no magic numbers!!! { return TRUE; } @@ -3198,7 +3198,7 @@ void CBaseMonster::CorpseFallThink( void ) UTIL_SetOrigin( pev, pev->origin );// link into world. } else - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // Call after animation/pose is set up @@ -3223,7 +3223,7 @@ void CBaseMonster::MonsterInitDead( void ) // Setup health counters, etc. BecomeDead(); SetThink( &CBaseMonster::CorpseFallThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } //========================================================= diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 426f738a..ca741533 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -126,14 +126,14 @@ void CMP5::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } if( m_iClip <= 0 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -171,16 +171,16 @@ void CMP5::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usMP5, 0.0, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usMP5, 0.0f, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.1 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.1f ); if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); } @@ -191,7 +191,7 @@ void CMP5::SecondaryAttack( void ) if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound( ); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = 0.15f; return; } @@ -205,7 +205,7 @@ void CMP5::SecondaryAttack( void ) m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH; m_pPlayer->m_iExtraSoundTypes = bits_SOUND_DANGER; - m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2; + m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2f; m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]--; @@ -216,8 +216,8 @@ void CMP5::SecondaryAttack( void ) // we don't add in player velocity anymore. CGrenade::ShootContact( m_pPlayer->pev, - m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16, - gpGlobals->v_forward * 800 ); + m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16.0f, + gpGlobals->v_forward * 800.0f ); int flags; #if defined( CLIENT_WEAPONS ) @@ -227,9 +227,9 @@ void CMP5::SecondaryAttack( void ) #endif PLAYBACK_EVENT( flags, m_pPlayer->edict(), m_usMP52 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 1 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5;// idle pretty soon after shooting. + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f;// idle pretty soon after shooting. if( !m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] ) // HEV suit - indicate out of ammo condition @@ -241,7 +241,7 @@ void CMP5::Reload( void ) if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == MP5_MAX_CLIP ) return; - DefaultReload( MP5_MAX_CLIP, MP5_RELOAD, 1.5 ); + DefaultReload( MP5_MAX_CLIP, MP5_RELOAD, 1.5f ); } void CMP5::WeaponIdle( void ) diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index c9ed0742..5a789f2b 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -298,7 +298,7 @@ void CNihilanth::Spawn( void ) InitBoneControllers(); SetThink( &CNihilanth::StartupThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_vecDesired = Vector( 1, 0, 0 ); m_posDesired = Vector( pev->origin.x, pev->origin.y, 512 ); @@ -391,13 +391,13 @@ void CNihilanth::DeathSound( void ) void CNihilanth::NullThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CNihilanth::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CNihilanth::HuntThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CNihilanth::CommandUse ); } @@ -429,7 +429,7 @@ void CNihilanth::StartupThink( void ) SetThink( &CNihilanth::HuntThink ); SetUse( &CNihilanth::CommandUse ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CNihilanth::Killed( entvars_t *pevAttacker, int iGib ) @@ -439,7 +439,7 @@ void CNihilanth::Killed( entvars_t *pevAttacker, int iGib ) void CNihilanth::DyingThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -494,13 +494,13 @@ void CNihilanth::DyingThink( void ) do { vecDir = Vector( RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ) ); - } while( DotProduct( vecDir, vecDir ) > 1.0 ); + } while( DotProduct( vecDir, vecDir ) > 1.0f ); switch( RANDOM_LONG( 1, 4 ) ) { case 1: // head - vecDir.z = fabs( vecDir.z ) * 0.5; + vecDir.z = fabs( vecDir.z ) * 0.5f; vecDir = vecDir + 2 * gpGlobals->v_up; break; case 2: @@ -551,7 +551,7 @@ void CNihilanth::DyingThink( void ) GetAttachment( 0, vecSrc, vecAngles ); CNihilanthHVR *pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7, 0.7 ), RANDOM_FLOAT( -0.7, 0.7 ), 1.0 ) * 600.0; + pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7f, 0.7f ), RANDOM_FLOAT( -0.7f, 0.7f ), 1.0f ) * 600.0f; pEntity->GreenBallInit(); return; @@ -619,7 +619,7 @@ void CNihilanth::ShootBalls( void ) vecDir = ( m_posTarget - pev->origin ).Normalize(); vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = vecDir * 200.0; + pEntity->pev->velocity = vecDir * 200.0f; pEntity->ZapInit( m_hEnemy ); GetAttachment( 3, vecHand, vecAngle ); @@ -628,10 +628,10 @@ void CNihilanth::ShootBalls( void ) vecDir = ( m_posTarget - pev->origin ).Normalize(); vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = vecDir * 200.0; + pEntity->pev->velocity = vecDir * 200.0f; pEntity->ZapInit( m_hEnemy ); } - m_flShootTime += 0.2; + m_flShootTime += 0.2f; } } } @@ -698,8 +698,8 @@ void CNihilanth::NextActivity() { m_pBall->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNoDissipation ); m_pBall->SetAttachment( edict(), 1 ); - m_pBall->SetScale( 4.0 ); - m_pBall->pev->framerate = 10.0; + m_pBall->SetScale( 4.0f ); + m_pBall->pev->framerate = 10.0f; m_pBall->TurnOn(); } } @@ -766,7 +766,7 @@ void CNihilanth::NextActivity() if( m_hRecharger != 0 ) { // at we at power up yet? - if( flDist < 128.0 ) + if( flDist < 128.0f ) { int iseq = LookupSequence( "recharge" ); @@ -808,7 +808,7 @@ void CNihilanth::NextActivity() { if( m_flLastSeen + 5 > gpGlobals->time && flDist < 256 && flDot > 0 ) { - if( m_irritation >= 2 && pev->health < gSkillData.nihilanthHealth / 2.0 ) + if( m_irritation >= 2 && pev->health < gSkillData.nihilanthHealth / 2.0f ) { pev->sequence = LookupSequence( "attack1_open" ); } @@ -848,7 +848,7 @@ void CNihilanth::NextActivity() void CNihilanth::HuntThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -877,7 +877,7 @@ void CNihilanth::HuntThink( void ) pev->frame = 0; NextActivity(); ResetSequenceInfo(); - pev->framerate = 2.0 - 1.0 * ( pev->health / gSkillData.nihilanthHealth ); + pev->framerate = 2.0f - 1.0f * ( pev->health / gSkillData.nihilanthHealth ); } // look for current enemy @@ -885,7 +885,7 @@ void CNihilanth::HuntThink( void ) { if( FVisible( m_hEnemy ) ) { - if( m_flLastSeen < gpGlobals->time - 5 ) + if( m_flLastSeen < gpGlobals->time - 5.0f ) m_flPrevSeen = gpGlobals->time; m_flLastSeen = gpGlobals->time; m_posTarget = m_hEnemy->pev->origin; @@ -933,7 +933,7 @@ void CNihilanth::Flight( void ) m_avelocity.y -= 6; // 9 * ( 3.0 / 2.0 ); } } - m_avelocity.y *= 0.98; + m_avelocity.y *= 0.98f; // estimate where I'll be in two seconds Vector vecEst = pev->origin + m_velocity * 2.0 + gpGlobals->v_up * m_flForce * 20; @@ -952,12 +952,12 @@ void CNihilanth::Flight( void ) //float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward ); // sideways drag - m_velocity.x = m_velocity.x * ( 1.0 - fabs( gpGlobals->v_right.x ) * 0.05 ); - m_velocity.y = m_velocity.y * ( 1.0 - fabs( gpGlobals->v_right.y ) * 0.05 ); - m_velocity.z = m_velocity.z * ( 1.0 - fabs( gpGlobals->v_right.z ) * 0.05 ); + m_velocity.x = m_velocity.x * ( 1.0f - fabs( gpGlobals->v_right.x ) * 0.05f ); + m_velocity.y = m_velocity.y * ( 1.0f - fabs( gpGlobals->v_right.y ) * 0.05f ); + m_velocity.z = m_velocity.z * ( 1.0f - fabs( gpGlobals->v_right.z ) * 0.05f ); // general drag - m_velocity = m_velocity * 0.995; + m_velocity = m_velocity * 0.995f; // apply power to stay correct height if( m_flForce < 100 && vecEst.z < m_posDesired.z ) @@ -970,8 +970,8 @@ void CNihilanth::Flight( void ) m_flForce -= 10; } - UTIL_SetOrigin( pev, pev->origin + m_velocity * 0.1 ); - pev->angles = pev->angles + m_avelocity * 0.1; + UTIL_SetOrigin( pev, pev->origin + m_velocity * 0.1f ); + pev->angles = pev->angles + m_avelocity * 0.1f; // ALERT( at_console, "%5.0f %5.0f : %4.0f : %3.0f : %2.0f\n", m_posDesired.z, pev->origin.z, m_velocity.z, m_avelocity.y, m_flForce ); } @@ -1093,7 +1093,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_flShootTime = gpGlobals->time; - m_flShootEnd = gpGlobals->time + 1.0; + m_flShootEnd = gpGlobals->time + 1.0f; } break; case 3: @@ -1155,7 +1155,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_flShootTime = gpGlobals->time; - m_flShootEnd = gpGlobals->time + 1.0; + m_flShootEnd = gpGlobals->time + 1.0f; } } break; @@ -1192,7 +1192,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) Vector vecSrc, vecAngles; GetAttachment( 0, vecSrc, vecAngles ); CNihilanthHVR *pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7, 0.7 ), RANDOM_FLOAT( -0.7, 0.7 ), 1.0 ) * 600.0; + pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7f, 0.7f ), RANDOM_FLOAT( -0.7f, 0.7f ), 1.0f ) * 600.0f; pEntity->GreenBallInit(); */ break; @@ -1299,7 +1299,7 @@ void CNihilanthHVR::Spawn( void ) pev->rendermode = kRenderTransAdd; pev->renderamt = 255; - pev->scale = 3.0; + pev->scale = 3.0f; } void CNihilanthHVR::Precache( void ) @@ -1328,7 +1328,7 @@ void CNihilanthHVR::CircleInit( CBaseEntity *pTarget ) pev->rendercolor.x = 255; pev->rendercolor.y = 224; pev->rendercolor.z = 192; - pev->scale = 2.0; + pev->scale = 2.0f; m_nFrames = 1; pev->renderamt = 255; @@ -1337,7 +1337,7 @@ void CNihilanthHVR::CircleInit( CBaseEntity *pTarget ) SetThink( &CNihilanthHVR::HoverThink ); SetTouch( &CNihilanthHVR::BounceTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_hTargetEnt = pTarget; } @@ -1359,7 +1359,7 @@ CBaseEntity *CNihilanthHVR::RandomClassname( const char *szName ) void CNihilanthHVR::HoverThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_hTargetEnt != 0 ) { @@ -1428,21 +1428,21 @@ void CNihilanthHVR::ZapInit( CBaseEntity *pEnemy ) pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->scale = 2.0; + pev->scale = 2.0f; - pev->velocity = ( pEnemy->pev->origin - pev->origin ).Normalize() * 200; + pev->velocity = ( pEnemy->pev->origin - pev->origin ).Normalize() * 200.0f; m_hEnemy = pEnemy; SetThink( &CNihilanthHVR::ZapThink ); SetTouch( &CNihilanthHVR::ZapTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "debris/zap4.wav", 1, ATTN_NORM, 0, 100 ); } void CNihilanthHVR::ZapThink( void ) { - pev->nextthink = gpGlobals->time + 0.05; + pev->nextthink = gpGlobals->time + 0.05f; // check world boundaries if( m_hEnemy == 0 || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) @@ -1454,7 +1454,7 @@ void CNihilanthHVR::ZapThink( void ) if( pev->velocity.Length() < 2000 ) { - pev->velocity = pev->velocity * 1.2; + pev->velocity = pev->velocity * 1.2f; } // MovetoTarget( m_hEnemy->Center() ); @@ -1496,7 +1496,7 @@ void CNihilanthHVR::ZapThink( void ) SetTouch( NULL ); UTIL_Remove( this ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } @@ -1535,7 +1535,7 @@ void CNihilanthHVR::ZapTouch( CBaseEntity *pOther ) SetTouch( NULL ); UTIL_Remove( this ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; } void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBaseEntity *pTarget, CBaseEntity *pTouch ) @@ -1546,7 +1546,7 @@ void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBase pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->velocity.z *= 0.2; + pev->velocity.z *= 0.2f; SET_MODEL( edict(), "sprites/exit1.spr" ); @@ -1557,7 +1557,7 @@ void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBase SetThink( &CNihilanthHVR::TeleportThink ); SetTouch( &CNihilanthHVR::TeleportTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 ); } @@ -1570,7 +1570,7 @@ void CNihilanthHVR::GreenBallInit() pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->scale = 1.0; + pev->scale = 1.0f; SET_MODEL( edict(), "sprites/exit1.spr" ); @@ -1579,7 +1579,7 @@ void CNihilanthHVR::GreenBallInit() void CNihilanthHVR::TeleportThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // check world boundaries if( m_hEnemy == 0 || !m_hEnemy->IsAlive() || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) @@ -1669,13 +1669,13 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther ) void CNihilanthHVR::DissipateThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - if( pev->scale > 5.0 ) + if( pev->scale > 5.0f ) UTIL_Remove( this ); pev->renderamt -= 2; - pev->scale += 0.1; + pev->scale += 0.1f; if( m_hTargetEnt != 0 ) { @@ -1811,7 +1811,7 @@ void CNihilanthHVR::BounceTouch( CBaseEntity *pOther ) float n = -DotProduct( tr.vecPlaneNormal, vecDir ); - vecDir = 2.0 * tr.vecPlaneNormal * n + vecDir; + vecDir = 2.0f * tr.vecPlaneNormal * n + vecDir; m_vecIdeal = vecDir * m_vecIdeal.Length(); } diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index 6babe01d..c8d6296c 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -667,7 +667,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int // for ( i = 0; i < m_cNodes; i++) { - m_pNodes[i].m_flClosestSoFar = -1.0; + m_pNodes[i].m_flClosestSoFar = -1.0f; } m_pNodes[iStart].m_flClosestSoFar = 0.0; @@ -709,8 +709,8 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int } } float flOurDistance = flCurrentDistance + m_pLinkPool[m_pNodes[iCurrentNode].m_iFirstLink + i].m_flWeight; - if( m_pNodes[iVisitNode].m_flClosestSoFar < -0.5 - || flOurDistance < m_pNodes[iVisitNode].m_flClosestSoFar - 0.001 ) + if( m_pNodes[iVisitNode].m_flClosestSoFar < -0.5f + || flOurDistance < m_pNodes[iVisitNode].m_flClosestSoFar - 0.001f ) { m_pNodes[iVisitNode].m_flClosestSoFar = flOurDistance; m_pNodes[iVisitNode].m_iPreviousNode = iCurrentNode; @@ -719,7 +719,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int } } } - if( m_pNodes[iDest].m_flClosestSoFar < -0.5 ) + if( m_pNodes[iDest].m_flClosestSoFar < -0.5f ) { // Destination is unreachable, no path found. return 0; @@ -837,7 +837,7 @@ void CGraph::CheckNode( Vector vecOrigin, int iNode ) // make sure that vecOrigin can trace to this node! UTIL_TraceLine( vecOrigin, m_pNodes[iNode].m_vecOriginPeek, ignore_monsters, 0, &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { m_iNearest = iNode; m_flShortest = flDist; @@ -907,7 +907,7 @@ int CGraph::FindNearestNode( const Vector &vecOrigin, int afNodeTypes ) } m_iNearest = -1; - m_flShortest = 999999.0; // just a big number. + m_flShortest = 999999.0f; // just a big number. // If we can find a visible point, then let CalcBounds set the limits, but if // we have no visible point at all to start with, then don't restrict the limits. @@ -1276,7 +1276,7 @@ int CGraph::LinkVisibleNodes( CLink *pLinkPool, FILE *file, int *piBadNode ) if( tr.fStartSolid ) continue; - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // trace hit a brush ent, trace backwards to make sure that this ent is the only thing in the way. pTraceEnt = tr.pHit;// store the ent that the trace hit, for comparison @@ -1442,14 +1442,14 @@ int CGraph::RejectInlineLinks( CLink *pLinkPool, FILE *file ) flDistToTestNode = vec2DirToTestNode.Length(); vec2DirToTestNode = vec2DirToTestNode.Normalize(); - if( DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) >= 0.998 ) + if( DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) >= 0.998f ) { // there's a chance that TestNode intersects the line to CheckNode. If so, we should disconnect the link to CheckNode. if( flDistToTestNode < flDistToCheckNode ) { if( file ) { - fprintf( file, "REJECTED NODE %3d through Node %3d, Dot = %8f\n", pLinkPool[pSrcNode->m_iFirstLink + j].m_iDestNode, pLinkPool[pSrcNode->m_iFirstLink + k].m_iDestNode, DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) ); + fprintf( file, "REJECTED NODE %3d through Node %3d, Dot = %8f\n", pLinkPool[pSrcNode->m_iFirstLink + j].m_iDestNode, pLinkPool[pSrcNode->m_iFirstLink + k].m_iDestNode, (double)DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) ); } pLinkPool[pSrcNode->m_iFirstLink + j] = pLinkPool[pSrcNode->m_iFirstLink + ( pSrcNode->m_cNumLinks - 1 )]; @@ -1516,7 +1516,7 @@ void CTestHull::Spawn( entvars_t *pevMasterNode ) else { SetThink( &CTestHull::DropDelay ); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } // Make this invisible @@ -1537,7 +1537,7 @@ void CTestHull::DropDelay( void ) SetThink( &CTestHull::CallBuildNodeGraph ); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } //========================================================= @@ -1623,7 +1623,7 @@ void CTestHull::ShowBadNode( void ) UTIL_ParticleEffect( pev->origin + gpGlobals->v_right * 64, g_vecZero, 255, 25 ); UTIL_ParticleEffect( pev->origin - gpGlobals->v_right * 64, g_vecZero, 255, 25 ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } extern BOOL gTouchDisabled; @@ -1737,7 +1737,7 @@ void CTestHull::BuildNodeGraph( void ) fprintf( file, "Location %4d,%4d,%4d\n",(int)WorldGraph.m_pNodes[i].m_vecOrigin.x, (int)WorldGraph.m_pNodes[i].m_vecOrigin.y, (int)WorldGraph.m_pNodes[i].m_vecOrigin.z ); fprintf( file, "HintType: %4d\n", WorldGraph.m_pNodes[i].m_sHintType ); fprintf( file, "HintActivity: %4d\n", WorldGraph.m_pNodes[i].m_sHintActivity ); - fprintf( file, "HintYaw: %4f\n", WorldGraph.m_pNodes[i].m_flHintYaw ); + fprintf( file, "HintYaw: %4f\n", (double)WorldGraph.m_pNodes[i].m_flHintYaw ); fprintf( file, "-------------------------------------------------------------------------------\n" ); } fprintf( file, "\n\n" ); @@ -1959,7 +1959,7 @@ void CTestHull::BuildNodeGraph( void ) TraceResult tr; UTIL_TraceHull( pSrcNode->m_vecOrigin + Vector( 0, 0, 32 ), pDestNode->m_vecOriginPeek + Vector( 0, 0, 32 ), ignore_monsters, large_hull, ENT( pev ), &tr ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { pTempPool[pSrcNode->m_iFirstLink + j].m_afLinkInfo &= ~bits_LINK_FLY_HULL; } @@ -3517,7 +3517,7 @@ void CGraph::TestRoutingTables( void ) ALERT( at_aiconsole, "No link.\n" ); } } - if( fabs( flDistance1 - flDistance2 ) > 0.10 ) + if( fabs( flDistance1 - flDistance2 ) > 0.1f ) { #else if( cPathSize1 != cPathSize2 || memcmp( pMyPath, pMyPath2, sizeof(int) * cPathSize1 ) != 0 ) diff --git a/dlls/observer.cpp b/dlls/observer.cpp index 22fa3818..79e1c9c1 100644 --- a/dlls/observer.cpp +++ b/dlls/observer.cpp @@ -103,7 +103,7 @@ void CBasePlayer::Observer_HandleButtons() else Observer_SetMode( OBS_CHASE_FREE ); // don't use OBS_CHASE_LOCKED anymore - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } // Attack moves to the next player @@ -111,7 +111,7 @@ void CBasePlayer::Observer_HandleButtons() { Observer_FindNextPlayer( false ); - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } // Attack2 moves to the prev player @@ -119,7 +119,7 @@ void CBasePlayer::Observer_HandleButtons() { Observer_FindNextPlayer( true ); - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } } diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index 6a421645..8cd8ed1e 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -170,7 +170,7 @@ void COsprey::Spawn( void ) if( !( pev->spawnflags & SF_WAITFORTRIGGER ) ) { - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_pos2 = pev->origin; @@ -198,7 +198,7 @@ void COsprey::Precache( void ) void COsprey::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void COsprey::FindAllThink( void ) @@ -223,7 +223,7 @@ void COsprey::FindAllThink( void ) return; } SetThink( &COsprey::FlyThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_startTime = gpGlobals->time; } @@ -238,8 +238,8 @@ void COsprey::DeployThink( void ) Vector vecSrc; TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + Vector( 0, 0, -4096.0 ), ignore_monsters, ENT( pev ), &tr ); - CSoundEnt::InsertSound( bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3 ); + UTIL_TraceLine( pev->origin, pev->origin + Vector( 0.0f, 0.0f, -4096.0f ), ignore_monsters, ENT( pev ), &tr ); + CSoundEnt::InsertSound( bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3f ); vecSrc = pev->origin + vecForward * 32 + vecRight * 100 + vecUp * -96; m_hRepel[0] = MakeGrunt( vecSrc ); @@ -254,7 +254,7 @@ void COsprey::DeployThink( void ) m_hRepel[3] = MakeGrunt( vecSrc ); SetThink( &COsprey::HoverThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } BOOL COsprey::HasDead() @@ -279,7 +279,7 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc ) CBaseMonster *pGrunt; TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + Vector( 0, 0, -4096.0 ), dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + Vector( 0.0f, 0.0f, -4096.0f ), dont_ignore_monsters, ENT( pev ), &tr ); if( tr.pHit && Instance( tr.pHit )->pev->solid != SOLID_BSP ) return NULL; @@ -302,7 +302,7 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc ) pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; // ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z ); pGrunt->m_vecLastPosition = m_vecOrigin[i]; @@ -331,7 +331,7 @@ void COsprey::HoverThink( void ) SetThink( &COsprey::FlyThink ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; UTIL_MakeAimVectors( pev->angles ); ShowDamage(); } @@ -349,7 +349,7 @@ void COsprey::UpdateGoal() m_vel2 = gpGlobals->v_forward * m_pGoalEnt->pev->speed; m_startTime = m_startTime + m_dTime; - m_dTime = 2.0 * ( m_pos1 - m_pos2 ).Length() / ( m_vel1.Length() + m_pGoalEnt->pev->speed ); + m_dTime = 2.0f * ( m_pos1 - m_pos2 ).Length() / ( m_vel1.Length() + m_pGoalEnt->pev->speed ); if( m_ang1.y - m_ang2.y < -180 ) { @@ -374,7 +374,7 @@ void COsprey::UpdateGoal() void COsprey::FlyThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_pGoalEnt == NULL && !FStringNull( pev->target) )// this monster has a target { @@ -401,13 +401,13 @@ void COsprey::FlyThink( void ) void COsprey::Flight() { float t = ( gpGlobals->time - m_startTime ); - float scale = 1.0 / m_dTime; + float scale = 1.0f / m_dTime; - float f = UTIL_SplineFraction( t * scale, 1.0 ); + float f = UTIL_SplineFraction( t * scale, 1.0f ); - Vector pos = ( m_pos1 + m_vel1 * t ) * ( 1.0 - f ) + ( m_pos2 - m_vel2 * ( m_dTime - t ) ) * f; - Vector ang = ( m_ang1 ) * ( 1.0 - f ) + ( m_ang2 ) * f; - m_velocity = m_vel1 * ( 1.0 - f ) + m_vel2 * f; + Vector pos = ( m_pos1 + m_vel1 * t ) * ( 1.0f - f ) + ( m_pos2 - m_vel2 * ( m_dTime - t ) ) * f; + Vector ang = ( m_ang1 ) * ( 1.0f - f ) + ( m_ang2 ) * f; + m_velocity = m_vel1 * ( 1.0f - f ) + m_vel2 * f; UTIL_SetOrigin( pev, pos ); pev->angles = ang; @@ -416,18 +416,18 @@ void COsprey::Flight() // float flSpeed = DotProduct( gpGlobals->v_forward, pev->velocity ); - float m_flIdealtilt = ( 160 - flSpeed ) / 10.0; + float m_flIdealtilt = ( 160.0f - flSpeed ) / 10.0f; // ALERT( at_console, "%f %f\n", flSpeed, flIdealtilt ); if( m_flRotortilt < m_flIdealtilt ) { - m_flRotortilt += 0.5; + m_flRotortilt += 0.5f; if ( m_flRotortilt > 0 ) m_flRotortilt = 0; } if( m_flRotortilt > m_flIdealtilt ) { - m_flRotortilt -= 0.5; + m_flRotortilt -= 0.5f; if( m_flRotortilt < -90 ) m_flRotortilt = -90; } @@ -450,7 +450,7 @@ void COsprey::Flight() { float pitch = DotProduct( m_velocity - pPlayer->pev->velocity, ( pPlayer->pev->origin - pev->origin ).Normalize() ); - pitch = (int)( 100 + pitch / 75.0 ); + pitch = (int)( 100 + pitch / 75.0f ); if( pitch > 250 ) pitch = 250; @@ -474,7 +474,7 @@ void COsprey::Flight() void COsprey::HitTouch( CBaseEntity *pOther ) { - pev->nextthink = gpGlobals->time + 2.0; + pev->nextthink = gpGlobals->time + 2.0f; } /* @@ -496,7 +496,7 @@ int COsprey::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float void COsprey::Killed( entvars_t *pevAttacker, int iGib ) { pev->movetype = MOVETYPE_TOSS; - pev->gravity = 0.3; + pev->gravity = 0.3f; pev->velocity = m_velocity; pev->avelocity = Vector( RANDOM_FLOAT( -20, 20 ), 0, RANDOM_FLOAT( -50, 50 ) ); STOP_SOUND( ENT( pev ), CHAN_STATIC, "apache/ap_rotor4.wav" ); @@ -504,11 +504,11 @@ void COsprey::Killed( entvars_t *pevAttacker, int iGib ) UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); SetThink( &COsprey::DyingThink ); SetTouch( &COsprey::CrashTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->health = 0; pev->takedamage = DAMAGE_NO; - m_startTime = gpGlobals->time + 4.0; + m_startTime = gpGlobals->time + 4.0f; } void COsprey::CrashTouch( CBaseEntity *pOther ) @@ -526,9 +526,9 @@ void COsprey::CrashTouch( CBaseEntity *pOther ) void COsprey::DyingThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->avelocity = pev->avelocity * 1.02; + pev->avelocity = pev->avelocity * 1.02f; // still falling? if( m_startTime > gpGlobals->time ) @@ -536,14 +536,14 @@ void COsprey::DyingThink( void ) UTIL_MakeAimVectors( pev->angles ); ShowDamage(); - Vector vecSpot = pev->origin + pev->velocity * 0.2; + Vector vecSpot = pev->origin + pev->velocity * 0.2f; // random explosions MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_EXPLOSION ); // This just makes a dynamic light now - WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( RANDOM_LONG( 0, 29 ) + 30 ); // scale * 10 WRITE_BYTE( 12 ); // framerate @@ -553,15 +553,15 @@ void COsprey::DyingThink( void ) // lots of smoke MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_SMOKE ); - WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 100 ); // scale * 10 WRITE_BYTE( 10 ); // framerate MESSAGE_END(); - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); @@ -598,12 +598,12 @@ void COsprey::DyingThink( void ) // don't stop it we touch a entity pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } else { - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -662,12 +662,12 @@ void COsprey::DyingThink( void ) WRITE_BYTE( 0 ); // speed MESSAGE_END(); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3f ); RadiusDamage( pev->origin, pev, pev, 300, CLASS_NONE, DMG_BLAST ); // gibs - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); @@ -684,7 +684,7 @@ void COsprey::DyingThink( void ) // velocity WRITE_COORD( m_velocity.x ); WRITE_COORD( m_velocity.y ); - WRITE_COORD( fabs( m_velocity.z ) * 0.25 ); + WRITE_COORD( fabs( m_velocity.z ) * 0.25f ); // randomization WRITE_BYTE( 40 ); @@ -751,7 +751,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flRightHealth -= flDamage; - m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0f ); } if( ptr->iHitgroup == 2 ) @@ -760,7 +760,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flLeftHealth -= flDamage; - m_iDoRightSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoRightSmokePuff = 3 + ( flDamage / 5.0f ); } // hit hard, hits cockpit, hits engines diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 8356d55e..d74129e7 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -585,7 +585,7 @@ void CFuncPlatRot::RotMove( Vector &destAngle, float time ) Vector vecDestDelta = destAngle - pev->angles; // Travel time is so short, we're practically there already; so make it so. - if( time >= 0.1 ) + if( time >= 0.1f ) pev->avelocity = vecDestDelta / time; else { @@ -647,7 +647,7 @@ void CFuncTrain::Blocked( CBaseEntity *pOther ) if( gpGlobals->time < m_flActivateFinished ) return; - m_flActivateFinished = gpGlobals->time + 0.5; + m_flActivateFinished = gpGlobals->time + 0.5f; pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH ); } @@ -744,7 +744,7 @@ void CFuncTrain::Next( void ) { // don't copy speed from target if it is 0 (uninitialized) pev->speed = m_pevCurrentTarget->speed; - ALERT( at_aiconsole, "Train %s speed to %4.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "Train %s speed to %4.2f\n", STRING( pev->targetname ), (double)pev->speed ); } m_pevCurrentTarget = pTarg->pev;// keep track of this since path corners change our target for us. @@ -754,7 +754,7 @@ void CFuncTrain::Next( void ) { // Path corner has indicated a teleport to the next corner. SetBits( pev->effects, EF_NOINTERP ); - UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5 ); + UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f ); Wait(); // Get on with doing the next path corner. } else @@ -772,7 +772,7 @@ void CFuncTrain::Next( void ) ClearBits( pev->effects, EF_NOINTERP ); SetMoveDone( &CFuncTrain::Wait ); - LinearMove( pTarg->pev->origin - ( pev->mins + pev->maxs )* 0.5, pev->speed ); + LinearMove( pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f, pev->speed ); } } @@ -791,7 +791,7 @@ void CFuncTrain::Activate( void ) if( FStringNull( pev->targetname ) ) { // not triggered, so start immediately - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; SetThink( &CFuncTrain::Next ); } else @@ -835,7 +835,7 @@ void CFuncTrain::Spawn( void ) m_activated = FALSE; if( m_volume == 0 ) - m_volume = 0.85; + m_volume = 0.85f; } void CFuncTrain::Precache( void ) @@ -883,7 +883,7 @@ void CFuncTrain::OverrideReset( void ) else // Keep moving for 0.1 secs, then find path_corner again and restart { SetThink( &CFuncTrain::Next ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } } @@ -938,7 +938,7 @@ void CFuncTrackTrain::KeyValue( KeyValueData *pkvd ) else if( FStrEq( pkvd->szKeyName, "volume" ) ) { m_flVolume = (float)atoi( pkvd->szValue ); - m_flVolume *= 0.1; + m_flVolume *= 0.1f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "bank" ) ) @@ -977,7 +977,7 @@ void CFuncTrackTrain::Blocked( CBaseEntity *pOther ) else pevOther->velocity = ( pevOther->origin - pev->origin ).Normalize() * pev->dmg; - ALERT( at_aiconsole, "TRAIN(%s): Blocked by %s (dmg:%.2f)\n", STRING( pev->targetname ), STRING( pOther->pev->classname ), pev->dmg ); + ALERT( at_aiconsole, "TRAIN(%s): Blocked by %s (dmg:%.2f)\n", STRING( pev->targetname ), STRING( pOther->pev->classname ), (double)pev->dmg ); if( pev->dmg <= 0 ) return; // we can't hurt this thing, so we're not concerned with it @@ -1010,7 +1010,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY { float delta = value; - delta = ( (int)( pev->speed * 4 ) / (int)m_speed )*0.25 + 0.25 * delta; + delta = ( (int)( pev->speed * 4 ) / (int)m_speed ) * 0.25f + 0.25f * delta; if( delta > 1 ) delta = 1; else if ( delta < -1 ) @@ -1022,7 +1022,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY } pev->speed = m_speed * delta; Next(); - ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING( pev->targetname ), (double)pev->speed ); } } @@ -1100,13 +1100,13 @@ void CFuncTrackTrain::UpdateSound( void ) unsigned short us_encode; unsigned short us_sound = ( ( unsigned short )( m_sounds ) & 0x0007 ) << 12; - unsigned short us_pitch = ( ( unsigned short )( flpitch / 10.0 ) & 0x003f ) << 6; - unsigned short us_volume = ( ( unsigned short )( m_flVolume * 40.0 ) & 0x003f ); + unsigned short us_pitch = ( ( unsigned short )( flpitch / 10.0f ) & 0x003f ) << 6; + unsigned short us_volume = ( ( unsigned short )( m_flVolume * 40.0f ) & 0x003f ); us_encode = us_sound | us_pitch | us_volume; - PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, - g_vecZero, g_vecZero, 0.0, 0.0, us_encode, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0f, + g_vecZero, g_vecZero, 0.0f, 0.0f, us_encode, 0, 0, 0 ); } } @@ -1135,7 +1135,7 @@ void CFuncTrackTrain::Next( void ) Vector nextPos = pev->origin; nextPos.z -= m_height; - CPathTrack *pnext = m_ppath->LookAhead( &nextPos, pev->speed * 0.1, 1 ); + CPathTrack *pnext = m_ppath->LookAhead( &nextPos, pev->speed * 0.1f, 1 ); nextPos.z += m_height; pev->velocity = ( nextPos - pev->origin ) * 10; @@ -1209,7 +1209,7 @@ void CFuncTrackTrain::Next( void ) { // don't copy speed from target if it is 0 (uninitialized) pev->speed = pFire->pev->speed; - ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f\n", STRING( pev->targetname ), (double)pev->speed ); } } @@ -1348,7 +1348,7 @@ void CFuncTrackTrain::Find( void ) if( pev->spawnflags & SF_TRACKTRAIN_NOPITCH ) pev->angles.x = 0; UTIL_SetOrigin( pev, nextPos ); - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Next ); pev->speed = m_startSpeed; @@ -1397,14 +1397,14 @@ void CFuncTrackTrain::NearestPath( void ) if( pev->speed != 0 ) { - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Next ); } } void CFuncTrackTrain::OverrideReset( void ) { - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::NearestPath ); } @@ -1463,7 +1463,7 @@ void CFuncTrackTrain::Spawn( void ) // start trains on the next frame, to make sure their targets have had // a chance to spawn/activate - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Find ); Precache(); } @@ -1472,8 +1472,8 @@ void CFuncTrackTrain::Precache( void ) { const char *pszSound; - if( m_flVolume == 0.0 ) - m_flVolume = 1.0; + if( m_flVolume == 0.0f ) + m_flVolume = 1.0f; switch( m_sounds ) { @@ -1667,7 +1667,7 @@ void CFuncTrackChange::Spawn( void ) } EnableUse(); - pev->nextthink = pev->ltime + 2.0; + pev->nextthink = pev->ltime + 2.0f; SetThink( &CFuncTrackChange::Find ); Precache(); } @@ -1714,7 +1714,7 @@ void CFuncTrackChange::KeyValue( KeyValueData *pkvd ) void CFuncTrackChange::OverrideReset( void ) { - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; SetThink( &CFuncTrackChange::Find ); } @@ -1740,7 +1740,7 @@ void CFuncTrackChange::Find( void ) ALERT( at_error, "Can't find train for track change! %s\n", STRING( m_trainName ) ); return; } - Vector center = ( pev->absmin + pev->absmax ) * 0.5; + Vector center = ( pev->absmin + pev->absmax ) * 0.5f; m_trackBottom = m_trackBottom->Nearest( center ); m_trackTop = m_trackTop->Nearest( center ); UpdateAutoTargets( m_toggle_state ); @@ -1807,7 +1807,7 @@ void CFuncTrackChange::UpdateTrain( Vector &dest ) local.z = DotProduct( offset, gpGlobals->v_up ); local = local - offset; - m_train->pev->velocity = pev->velocity + ( local * ( 1.0 / time ) ); + m_train->pev->velocity = pev->velocity + ( local * ( 1.0f / time ) ); } void CFuncTrackChange::GoDown( void ) @@ -2108,7 +2108,7 @@ void CGunTarget::Spawn( void ) if( pev->spawnflags & FGUNTARGET_START_ON ) { SetThink( &CGunTarget::Start ); - pev->nextthink = pev->ltime + 0.3; + pev->nextthink = pev->ltime + 0.3f; } } @@ -2121,7 +2121,7 @@ void CGunTarget::Activate( void ) if( pTarg ) { m_hTargetEnt = pTarg; - UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5 ); + UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f ); } } @@ -2143,7 +2143,7 @@ void CGunTarget::Next( void ) return; } SetMoveDone( &CGunTarget::Wait ); - LinearMove( pTarget->pev->origin - ( pev->mins + pev->maxs ) * 0.5, pev->speed ); + LinearMove( pTarget->pev->origin - ( pev->mins + pev->maxs ) * 0.5f, pev->speed ); } void CGunTarget::Wait( void ) diff --git a/dlls/player.cpp b/dlls/player.cpp index 43d1d28e..336a8204 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -66,8 +66,8 @@ extern CGraph WorldGraph; #define TRAIN_FAST 0x04 #define TRAIN_BACK 0x05 -#define FLASH_DRAIN_TIME 1.2 //100 units/3 minutes -#define FLASH_CHARGE_TIME 0.2 // 100 units/20 seconds (seconds per unit) +#define FLASH_DRAIN_TIME 1.2f //100 units/3 minutes +#define FLASH_CHARGE_TIME 0.2f // 100 units/20 seconds (seconds per unit) // Global Savedata for player TYPEDESCRIPTION CBasePlayer::m_playerSaveData[] = @@ -242,11 +242,11 @@ void CBasePlayer::Pain( void ) { float flRndSound;//sound randomizer - flRndSound = RANDOM_FLOAT( 0, 1 ); + flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain5.wav", 1, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain6.wav", 1, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain7.wav", 1, ATTN_NORM ); @@ -257,7 +257,7 @@ Vector VecVelocityForDamage( float flDamage ) Vector vec( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) ); if( flDamage > -50 ) - vec = vec * 0.7; + vec = vec * 0.7f; else if( flDamage > -200 ) vec = vec * 2; else @@ -314,15 +314,15 @@ int TrainSpeed( int iSpeed, int iMax ) fMax = (float)iMax; fSpeed = iSpeed; - fSpeed = fSpeed/fMax; + fSpeed = fSpeed / fMax; if( iSpeed < 0 ) iRet = TRAIN_BACK; - else if( iSpeed == 0 ) + else if( iSpeed == 0.0f ) iRet = TRAIN_NEUTRAL; - else if( fSpeed < 0.33 ) + else if( fSpeed < 0.33f ) iRet = TRAIN_SLOW; - else if( fSpeed < 0.66 ) + else if( fSpeed < 0.66f ) iRet = TRAIN_MEDIUM; else iRet = TRAIN_FAST; @@ -921,7 +921,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) pev->angles.z = 0; SetThink( &CBasePlayer::PlayerDeathThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // Set the activity based on an event or current state @@ -1722,7 +1722,7 @@ void CBasePlayer::UpdateStatusBar() Vector vecEnd = vecSrc + ( gpGlobals->v_forward * MAX_ID_RANGE ); UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( !FNullEnt( tr.pHit ) ) { @@ -1740,7 +1740,7 @@ void CBasePlayer::UpdateStatusBar() newSBarState[SBAR_ID_TARGETARMOR] = (int)pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max. } - m_flStatusBarDisappearDelay = gpGlobals->time + 1.0; + m_flStatusBarDisappearDelay = gpGlobals->time + 1.0f; } } else if( m_flStatusBarDisappearDelay > gpGlobals->time ) @@ -1869,7 +1869,7 @@ void CBasePlayer::PreThink( void ) UTIL_TraceLine( pev->origin, pev->origin + Vector( 0, 0, -38 ), ignore_monsters, ENT( pev ), &trainTrace ); // HACKHACK - Just look for the func_tracktrain classname - if( trainTrace.flFraction != 1.0 && trainTrace.pHit ) + if( trainTrace.flFraction != 1.0f && trainTrace.pHit ) pTrain = CBaseEntity::Instance( trainTrace.pHit ); if( !pTrain || !( pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE ) || !pTrain->OnControls( pev ) ) @@ -2022,7 +2022,7 @@ void CBasePlayer::CheckTimeBasedDamage() return; // only check for time based damage approx. every 2 seconds - if( fabs( gpGlobals->time - m_tbdPrev ) < 2.0 ) + if( fabs( gpGlobals->time - m_tbdPrev ) < 2.0f ) return; m_tbdPrev = gpGlobals->time; @@ -2176,7 +2176,7 @@ Things powered by the battery // if in range of radiation source, ping geiger counter -#define GEIGERDELAY 0.25 +#define GEIGERDELAY 0.25f void CBasePlayer::UpdateGeigerCounter( void ) { @@ -2213,8 +2213,8 @@ Play suit update if it's time ================ */ -#define SUITUPDATETIME 3.5 -#define SUITFIRSTUPDATETIME 0.1 +#define SUITUPDATETIME 3.5f +#define SUITFIRSTUPDATETIME 0.1f void CBasePlayer::CheckSuitUpdate() { @@ -2617,23 +2617,23 @@ pt_end: if( gun && gun->UseDecrement() ) { - gun->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0 ); - gun->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001 ); + gun->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f ); + gun->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f ); - if( gun->m_flTimeWeaponIdle != 1000 ) + if( gun->m_flTimeWeaponIdle != 1000.0f ) { - gun->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001 ); + gun->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001f ); } - if( gun->pev->fuser1 != 1000 ) + if( gun->pev->fuser1 != 1000.0f ) { - gun->pev->fuser1 = Q_max( gun->pev->fuser1 - gpGlobals->frametime, -0.001 ); + gun->pev->fuser1 = Q_max( gun->pev->fuser1 - gpGlobals->frametime, -0.001f ); } // Only decrement if not flagged as NO_DECREMENT - /*if( gun->m_flPumpTime != 1000 ) + /*if( gun->m_flPumpTime != 1000.0f ) { - gun->m_flPumpTime = Q_max( gun->m_flPumpTime - gpGlobals->frametime, -0.001 ); + gun->m_flPumpTime = Q_max( gun->m_flPumpTime - gpGlobals->frametime, -0.001f ); }*/ } @@ -2643,23 +2643,23 @@ pt_end: } m_flNextAttack -= gpGlobals->frametime; - if( m_flNextAttack < -0.001 ) - m_flNextAttack = -0.001; + if( m_flNextAttack < -0.001f ) + m_flNextAttack = -0.001f; - if( m_flNextAmmoBurn != 1000 ) + if( m_flNextAmmoBurn != 1000.0f ) { m_flNextAmmoBurn -= gpGlobals->frametime; - if( m_flNextAmmoBurn < -0.001 ) - m_flNextAmmoBurn = -0.001; + if( m_flNextAmmoBurn < -0.001f ) + m_flNextAmmoBurn = -0.001f; } - if( m_flAmmoStartCharge != 1000 ) + if( m_flAmmoStartCharge != 1000.0f ) { m_flAmmoStartCharge -= gpGlobals->frametime; - if( m_flAmmoStartCharge < -0.001 ) - m_flAmmoStartCharge = -0.001; + if( m_flAmmoStartCharge < -0.001f ) + m_flAmmoStartCharge = -0.001f; } #else return; @@ -2803,8 +2803,8 @@ void CBasePlayer::Spawn( void ) pev->deadflag = DEAD_NO; pev->dmg_take = 0; pev->dmg_save = 0; - pev->friction = 1.0; - pev->gravity = 1.0; + pev->friction = 1.0f; + pev->gravity = 1.0f; m_bitsHUDDamage = -1; m_bitsDamageType = 0; m_afPhysicsFlags = 0; @@ -2818,12 +2818,12 @@ void CBasePlayer::Spawn( void ) m_flNextDecalTime = 0;// let this player decal as soon as he spawns. - m_flgeigerDelay = gpGlobals->time + 2.0; // wait a few seconds until user-defined message registrations + m_flgeigerDelay = gpGlobals->time + 2.0f; // wait a few seconds until user-defined message registrations // are recieved by all clients m_flTimeStepSound = 0; m_iStepLeft = 0; - m_flFieldOfView = 0.5;// some monsters use this to determine whether or not the player is looking at them. + m_flFieldOfView = 0.5f;// some monsters use this to determine whether or not the player is looking at them. m_bloodColor = BLOOD_COLOR_RED; m_flNextAttack = UTIL_WeaponTimeBase(); @@ -3173,7 +3173,7 @@ void CSprayCan::Spawn( entvars_t *pevOwner ) pev->owner = ENT( pevOwner ); pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/sprayer.wav", 1, ATTN_NORM ); } @@ -3212,7 +3212,7 @@ void CSprayCan::Think( void ) UTIL_Remove( this ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } class CBloodSplat : public CBaseEntity @@ -3229,7 +3229,7 @@ void CBloodSplat::Spawn( entvars_t *pevOwner ) pev->owner = ENT( pevOwner ); SetThink( &CBloodSplat::Spray ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBloodSplat::Spray( void ) @@ -3244,7 +3244,7 @@ void CBloodSplat::Spray( void ) UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); } SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //============================================== @@ -3273,7 +3273,7 @@ CBaseEntity *FindEntityForward( CBaseEntity *pMe ) UTIL_MakeVectors( pMe->pev->v_angle ); UTIL_TraceLine( pMe->pev->origin + pMe->pev->view_ofs,pMe->pev->origin + pMe->pev->view_ofs + gpGlobals->v_forward * 8192,dont_ignore_monsters, pMe->edict(), &tr ); - if( tr.flFraction != 1.0 && !FNullEnt( tr.pHit ) ) + if( tr.flFraction != 1.0f && !FNullEnt( tr.pHit ) ) { CBaseEntity *pHit = CBaseEntity::Instance( tr.pHit ); return pHit; @@ -3409,7 +3409,7 @@ void CBasePlayer::ImpulseCommands() UTIL_MakeVectors( pev->v_angle ); UTIL_TraceLine( pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // line hit something, so paint a decal m_flNextDecalTime = gpGlobals->time + decalfrequency.value; @@ -3431,7 +3431,7 @@ void CBasePlayer::ImpulseCommands() void CBasePlayer::CheatImpulseCommands( int iImpulse ) { #if !defined( HLDEMO_BUILD ) - if( g_flWeaponCheat == 0.0 ) + if( g_flWeaponCheat == 0.0f ) { return; } @@ -3580,7 +3580,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) UTIL_MakeVectors( pev->v_angle ); UTIL_TraceLine( pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // line hit something, so paint a decal CBloodSplat *pBlood = GetClassPtr( (CBloodSplat *)NULL ); @@ -4102,7 +4102,7 @@ void CBasePlayer::UpdateClientData( void ) if( m_flNextSBarUpdateTime < gpGlobals->time ) { UpdateStatusBar(); - m_flNextSBarUpdateTime = gpGlobals->time + 0.2; + m_flNextSBarUpdateTime = gpGlobals->time + 0.2f; } // Send the current bhopcap state. @@ -4193,7 +4193,7 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) } Vector vecSrc = GetGunPosition(); - float flDist = 8192; + float flDist = 8192.0f; // always use non-sticky autoaim // UNDONE: use sever variable to chose! @@ -4236,11 +4236,11 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) // UNDONE: use sever variable to chose! if( 0 || g_iSkillLevel == SKILL_EASY ) { - m_vecAutoAim = m_vecAutoAim * 0.67 + angles * 0.33; + m_vecAutoAim = m_vecAutoAim * 0.67f + angles * 0.33f; } else { - m_vecAutoAim = angles * 0.9; + m_vecAutoAim = angles * 0.9f; } // m_vecAutoAim = m_vecAutoAim * 0.99; @@ -4338,16 +4338,16 @@ Vector CBasePlayer::AutoaimDeflection( Vector &vecSrc, float flDist, float flDel if( DotProduct( dir, gpGlobals->v_forward ) < 0 ) continue; - dot = fabs( DotProduct( dir, gpGlobals->v_right ) ) + fabs( DotProduct( dir, gpGlobals->v_up ) ) * 0.5; + dot = fabs( DotProduct( dir, gpGlobals->v_right ) ) + fabs( DotProduct( dir, gpGlobals->v_up ) ) * 0.5f; // tweek for distance - dot *= 1.0 + 0.2 * ( ( center - vecSrc ).Length() / flDist ); + dot *= 1.0f + 0.2f * ( ( center - vecSrc ).Length() / flDist ); if( dot > bestdot ) continue; // to far to turn UTIL_TraceLine( vecSrc, center, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction != 1.0 && tr.pHit != pEdict ) + if( tr.flFraction != 1.0f && tr.pHit != pEdict ) { // ALERT( at_console, "hit %s, can't see %s\n", STRING( tr.pHit->v.classname ), STRING( pEdict->v.classname ) ); continue; @@ -4784,7 +4784,7 @@ void CInfoIntermission::Spawn( void ) pev->effects = EF_NODRAW; pev->v_angle = g_vecZero; - pev->nextthink = gpGlobals->time + 2;// let targets spawn! + pev->nextthink = gpGlobals->time + 2.0f;// let targets spawn! } void CInfoIntermission::Think( void ) diff --git a/dlls/python.cpp b/dlls/python.cpp index 88aa34b5..d8bfd35f 100644 --- a/dlls/python.cpp +++ b/dlls/python.cpp @@ -123,8 +123,8 @@ void CPython::Holster( int skiplocal /* = 0 */ ) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); SendWeaponAnim( PYTHON_HOLSTER ); } @@ -150,7 +150,7 @@ void CPython::SecondaryAttack( void ) m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 40; } - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; } void CPython::PrimaryAttack() @@ -159,7 +159,7 @@ void CPython::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -170,7 +170,7 @@ void CPython::PrimaryAttack() else { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; } return; @@ -206,8 +206,8 @@ void CPython::PrimaryAttack() // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = 0.75; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flNextPrimaryAttack = 0.75f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } void CPython::Reload( void ) @@ -227,9 +227,9 @@ void CPython::Reload( void ) #else bUseScope = g_pGameRules->IsMultiplayer(); #endif - if( DefaultReload( PYTHON_MAX_CLIP, PYTHON_RELOAD, 2.0, bUseScope ) ) + if( DefaultReload( PYTHON_MAX_CLIP, PYTHON_RELOAD, 2.0f, bUseScope ) ) { - m_flSoundDelay = 1.5; + m_flSoundDelay = 1.5f; } } @@ -242,8 +242,8 @@ void CPython::WeaponIdle( void ) // ALERT( at_console, "%.2f\n", gpGlobals->time - m_flSoundDelay ); if( m_flSoundDelay != 0 && m_flSoundDelay <= UTIL_WeaponTimeBase() ) { - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_reload1.wav", RANDOM_FLOAT( 0.8, 0.9 ), ATTN_NORM ); - m_flSoundDelay = 0; + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_reload1.wav", RANDOM_FLOAT( 0.8f, 0.9f ), ATTN_NORM ); + m_flSoundDelay = 0.0f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -251,25 +251,25 @@ void CPython::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); - if( flRand <= 0.5 ) + if( flRand <= 0.5f ) { iAnim = PYTHON_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 70.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 70.0f / 30.0f ); } - else if( flRand <= 0.7 ) + else if( flRand <= 0.7f ) { iAnim = PYTHON_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0f / 30.0f ); } - else if( flRand <= 0.9 ) + else if( flRand <= 0.9f ) { iAnim = PYTHON_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 88.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 88.0f / 30.0f ); } else { iAnim = PYTHON_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 170.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 170.0f / 30.0f ); } int bUseScope = FALSE; diff --git a/dlls/roach.cpp b/dlls/roach.cpp index 692b4beb..66e9702d 100644 --- a/dlls/roach.cpp +++ b/dlls/roach.cpp @@ -190,7 +190,7 @@ void CRoach::MonsterThink( void ) if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); else - pev->nextthink = gpGlobals->time + 0.1;// keep monster thinking + pev->nextthink = gpGlobals->time + 0.1f;// keep monster thinking float flInterval = StudioFrameAdvance(); // animate @@ -262,7 +262,7 @@ void CRoach::MonsterThink( void ) pSound = CSoundEnt::SoundPointerForIndex( m_iAudibleList ); // roach smells food and is just standing around. Go to food unless food isn't on same z-plane. - if( pSound && fabs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3.0 ) + if( pSound && fabs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3.0f ) { PickNewDest( ROACH_SMELL_FOOD ); SetActivity( ACT_WALK ); diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index fe1fd8a9..ecc62725 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -134,14 +134,14 @@ void CRpgRocket::Spawn( void ) SetThink( &CRpgRocket::IgniteThink ); SetTouch( &CGrenade::ExplodeTouch ); - pev->angles.x -= 30; + pev->angles.x -= 30.0f; UTIL_MakeVectors( pev->angles ); - pev->angles.x = -( pev->angles.x + 30 ); + pev->angles.x = -( pev->angles.x + 30.0f ); - pev->velocity = gpGlobals->v_forward * 250; - pev->gravity = 0.5; + pev->velocity = gpGlobals->v_forward * 250.0f; + pev->gravity = 0.5f; - pev->nextthink = gpGlobals->time + 0.4; + pev->nextthink = gpGlobals->time + 0.4f; pev->dmg = gSkillData.plrDmgRPG; } @@ -177,7 +177,7 @@ void CRpgRocket::IgniteThink( void ) pev->effects |= EF_LIGHT; // make rocket sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5 ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5f ); // rocket trail MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -196,7 +196,7 @@ void CRpgRocket::IgniteThink( void ) // set to follow laser spot SetThink( &CRpgRocket::FollowThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CRpgRocket::FollowThink( void ) @@ -217,7 +217,7 @@ void CRpgRocket::FollowThink( void ) { UTIL_TraceLine( pev->origin, pOther->pev->origin, dont_ignore_monsters, ENT( pev ), &tr ); // ALERT( at_console, "%f\n", tr.flFraction ); - if( tr.flFraction >= 0.90 ) + if( tr.flFraction >= 0.9f ) { vecDir = pOther->pev->origin - pev->origin; flDist = vecDir.Length(); @@ -235,23 +235,23 @@ void CRpgRocket::FollowThink( void ) // this acceleration and turning math is totally wrong, but it seems to respond well so don't change it. float flSpeed = pev->velocity.Length(); - if( gpGlobals->time - m_flIgniteTime < 1.0 ) + if( gpGlobals->time - m_flIgniteTime < 1.0f ) { - pev->velocity = pev->velocity * 0.2 + vecTarget * ( flSpeed * 0.8 + 400 ); + pev->velocity = pev->velocity * 0.2f + vecTarget * ( flSpeed * 0.8f + 400.0f ); if( pev->waterlevel == 3 ) { // go slow underwater - if( pev->velocity.Length() > 300 ) + if( pev->velocity.Length() > 300.0f ) { - pev->velocity = pev->velocity.Normalize() * 300; + pev->velocity = pev->velocity.Normalize() * 300.0f; } - UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1, pev->origin, 4 ); + UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1f, pev->origin, 4 ); } else { - if( pev->velocity.Length() > 2000 ) + if( pev->velocity.Length() > 2000.0f ) { - pev->velocity = pev->velocity.Normalize() * 2000; + pev->velocity = pev->velocity.Normalize() * 2000.0f; } } } @@ -262,8 +262,8 @@ void CRpgRocket::FollowThink( void ) pev->effects = 0; STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav" ); } - pev->velocity = pev->velocity * 0.2 + vecTarget * flSpeed * 0.798; - if( pev->waterlevel == 0 && pev->velocity.Length() < 1500 ) + pev->velocity = pev->velocity * 0.2f + vecTarget * flSpeed * 0.798f; + if( pev->waterlevel == 0 && pev->velocity.Length() < 1500.0f ) { if( CRpg *pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) ) { @@ -275,7 +275,7 @@ void CRpgRocket::FollowThink( void ) } // ALERT( at_console, "%.0f\n", flSpeed ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } #endif @@ -297,7 +297,7 @@ void CRpg::Reload( void ) // Set the next attack time into the future so that WeaponIdle will get called more often // than reload, allowing the RPG LTD to be updated - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); if( m_cActiveRockets && m_fSpotActive ) { @@ -309,8 +309,8 @@ void CRpg::Reload( void ) #ifndef CLIENT_DLL if( m_pSpot && m_fSpotActive ) { - m_pSpot->Suspend( 2.1 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.1; + m_pSpot->Suspend( 2.1f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.1f; } #endif @@ -417,7 +417,7 @@ void CRpg::Holster( int skiplocal /* = 0 */ ) { m_fInReload = FALSE;// cancel any reload in progress. - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( RPG_HOLSTER1 ); @@ -442,7 +442,7 @@ void CRpg::PrimaryAttack() m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - Vector vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -8; + Vector vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -8.0f; CRpgRocket *pRocket = CRpgRocket::CreateRpgRocket( vecSrc, m_pPlayer->pev->v_angle, m_pPlayer, this ); @@ -463,15 +463,15 @@ void CRpg::PrimaryAttack() m_iClip--; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.5 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.5f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; ResetEmptySound(); } else { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f; } UpdateSpot(); } @@ -487,7 +487,7 @@ void CRpg::SecondaryAttack() m_pSpot = NULL; } #endif - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; } void CRpg::WeaponIdle( void ) @@ -502,15 +502,15 @@ void CRpg::WeaponIdle( void ) ResetEmptySound(); int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 || m_fSpotActive ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f || m_fSpotActive ) { if( m_iClip == 0 ) iAnim = RPG_IDLE_UL; else iAnim = RPG_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 15.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 15.0f; } else { @@ -519,14 +519,14 @@ void CRpg::WeaponIdle( void ) else iAnim = RPG_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } SendWeaponAnim( iAnim ); } else { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; } } @@ -545,7 +545,7 @@ void CRpg::UpdateSpot( void ) Vector vecAiming = gpGlobals->v_forward; TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 8192, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 8192.0f, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); UTIL_SetOrigin( m_pSpot->pev, tr.vecEndPos ); } diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index dc8724bd..09e431c5 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -88,10 +88,10 @@ void CSatchelCharge::Spawn( void ) SetTouch( &CSatchelCharge::SatchelSlide ); SetUse( &CGrenade::DetonateUse ); SetThink( &CSatchelCharge::SatchelThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->gravity = 0.5; - pev->friction = 0.8; + pev->gravity = 0.5f; + pev->friction = 0.8f; pev->dmg = gSkillData.plrDmgSatchel; // ResetSequenceInfo(); @@ -113,14 +113,14 @@ void CSatchelCharge::SatchelSlide( CBaseEntity *pOther ) TraceResult tr; UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 10 ), ignore_monsters, edict(), &tr ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { // add a bit of static friction pev->velocity = pev->velocity * 0.95; pev->avelocity = pev->avelocity * 0.9; // play sliding sound, volume based on velocity } - if( !( pev->flags & FL_ONGROUND ) && pev->velocity.Length2D() > 10 ) + if( !( pev->flags & FL_ONGROUND ) && pev->velocity.Length2D() > 10.0f ) { // Fix for a bug in engine: when object isn't moving, but its speed isn't 0 and on ground isn't set if( pev->origin != m_lastBounceOrigin ) @@ -135,7 +135,7 @@ void CSatchelCharge::SatchelThink( void ) { // There is no model animation so commented this out to prevent net traffic // StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( !IsInWorld() ) { @@ -146,8 +146,8 @@ void CSatchelCharge::SatchelThink( void ) if( pev->waterlevel == 3 ) { pev->movetype = MOVETYPE_FLY; - pev->velocity = pev->velocity * 0.8; - pev->avelocity = pev->avelocity * 0.9; + pev->velocity = pev->velocity * 0.8f; + pev->avelocity = pev->avelocity * 0.9f; pev->velocity.z += 8; } else if( pev->waterlevel == 0 ) @@ -156,7 +156,7 @@ void CSatchelCharge::SatchelThink( void ) } else { - pev->velocity.z -= 8; + pev->velocity.z -= 8.0f; } } @@ -292,8 +292,8 @@ BOOL CSatchel::CanDeploy( void ) BOOL CSatchel::Deploy() { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); if( m_chargeReady ) return DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" ); @@ -305,7 +305,7 @@ BOOL CSatchel::Deploy() void CSatchel::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_chargeReady ) { @@ -315,7 +315,7 @@ void CSatchel::Holster( int skiplocal /* = 0 */ ) { SendWeaponAnim( SATCHEL_DROP ); } - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] && m_chargeReady != SATCHEL_READY ) { @@ -353,9 +353,9 @@ void CSatchel::PrimaryAttack() } m_chargeReady = SATCHEL_RELOAD; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; break; } case SATCHEL_RELOAD: @@ -400,8 +400,8 @@ void CSatchel::Throw( void ) m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.0 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; } } @@ -441,8 +441,8 @@ void CSatchel::WeaponIdle( void ) // use tripmine animations strcpy( m_pPlayer->m_szAnimExtention, "trip" ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; m_chargeReady = SATCHEL_IDLE; break; } diff --git a/dlls/schedule.cpp b/dlls/schedule.cpp index 4a5cefca..2a4cc311 100644 --- a/dlls/schedule.cpp +++ b/dlls/schedule.cpp @@ -414,7 +414,7 @@ void CBaseMonster::RunTask( Task_t *pTask ) distance = ( m_vecMoveGoal - pev->origin ).Length2D(); // Re-evaluate when you think your finished, or the target has moved too far - if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5 ) + if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5f ) { m_vecMoveGoal = m_hTargetEnt->pev->origin; distance = ( m_vecMoveGoal - pev->origin ).Length2D(); @@ -1378,7 +1378,7 @@ Schedule_t *CBaseMonster::GetSchedule( void ) if( HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) { - if( fabs( FlYawDiff() ) < ( 1.0 - m_flFieldOfView ) * 60 ) // roughly in the correct direction + if( fabs( FlYawDiff() ) < ( 1.0f - m_flFieldOfView ) * 60.0f ) // roughly in the correct direction { return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ORIGIN ); } diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index cc506b6f..e679770a 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -135,7 +135,7 @@ IMPLEMENT_SAVERESTORE( CScientist, CTalkMonster ) Task_t tlFollow[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_CANT_FOLLOW }, // If you fail, bail out of follow - { TASK_MOVE_TO_TARGET_RANGE, (float)128 }, // Move within 128 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE, 128.0f }, // Move within 128 of target ent (client) //{ TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE }, }; @@ -157,7 +157,7 @@ Schedule_t slFollow[] = Task_t tlFollowScared[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_TARGET_CHASE },// If you fail, follow normally - { TASK_MOVE_TO_TARGET_RANGE_SCARED, (float)128 }, // Move within 128 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE_SCARED, 128.0f }, // Move within 128 of target ent (client) //{ TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE_SCARED }, }; @@ -177,7 +177,7 @@ Schedule_t slFollowScared[] = Task_t tlFaceTargetScared[] = { - { TASK_FACE_TARGET, (float)0 }, + { TASK_FACE_TARGET, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_CROUCHIDLE }, { TASK_SET_SCHEDULE, (float)SCHED_TARGET_CHASE_SCARED }, }; @@ -196,7 +196,7 @@ Schedule_t slFaceTargetScared[] = Task_t tlStopFollowing[] = { - { TASK_CANT_FOLLOW, (float)0 }, + { TASK_CANT_FOLLOW, 0.0f }, }; Schedule_t slStopFollowing[] = @@ -212,12 +212,12 @@ Schedule_t slStopFollowing[] = Task_t tlHeal[] = { - { TASK_MOVE_TO_TARGET_RANGE, (float)50 }, // Move within 60 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE, 50.0f }, // Move within 60 of target ent (client) { TASK_SET_FAIL_SCHEDULE, (float)SCHED_TARGET_CHASE }, // If you fail, catch up with that guy! (change this to put syringe away and then chase) - { TASK_FACE_IDEAL, (float)0 }, - { TASK_SAY_HEAL, (float)0 }, + { TASK_FACE_IDEAL, 0.0f }, + { TASK_SAY_HEAL, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_TARGET, (float)ACT_ARM }, // Whip out the needle - { TASK_HEAL, (float)0 }, // Put it in the player + { TASK_HEAL, 0.0f }, // Put it in the player { TASK_PLAY_SEQUENCE_FACE_TARGET, (float)ACT_DISARM }, // Put away the needle }; @@ -234,8 +234,8 @@ Schedule_t slHeal[] = Task_t tlFaceTarget[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_TARGET, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_TARGET, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, { TASK_SET_SCHEDULE, (float)SCHED_TARGET_CHASE }, }; @@ -256,9 +256,9 @@ Schedule_t slFaceTarget[] = Task_t tlSciPanic[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_SCREAM, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_SCREAM, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_EXCITED }, // This is really fear-stricken excitement { TASK_SET_ACTIVITY, (float)ACT_IDLE }, }; @@ -278,7 +278,7 @@ Task_t tlIdleSciStand[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT, (float)2 }, // repick IDLESTAND every two seconds. + { TASK_WAIT, 2.0f }, // repick IDLESTAND every two seconds. { TASK_TLK_HEADRESET, (float)0 }, // reset head position }; @@ -309,10 +309,10 @@ Schedule_t slIdleSciStand[] = Task_t tlScientistCover[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_STOP_MOVING, (float)0 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_RUN_PATH_SCARED, (float)0 }, - { TASK_TURN_LEFT, (float)179 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_RUN_PATH_SCARED, 0.0f }, + { TASK_TURN_LEFT, 179.0f }, { TASK_SET_SCHEDULE, (float)SCHED_HIDE }, }; @@ -330,10 +330,10 @@ Schedule_t slScientistCover[] = Task_t tlScientistHide[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_CROUCH }, { TASK_SET_ACTIVITY, (float)ACT_CROUCHIDLE }, // FIXME: This looks lame - { TASK_WAIT_RANDOM, (float)10.0 }, + { TASK_WAIT_RANDOM, 10.0f }, }; Schedule_t slScientistHide[] = @@ -355,12 +355,12 @@ Schedule_t slScientistHide[] = Task_t tlScientistStartle[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_RANDOM_SCREAM, (float)0.3 }, // Scream 30% of the time - { TASK_STOP_MOVING, (float)0 }, + { TASK_RANDOM_SCREAM, 0.3f }, // Scream 30% of the time + { TASK_STOP_MOVING, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_CROUCH }, - { TASK_RANDOM_SCREAM, (float)0.1 }, // Scream again 10% of the time + { TASK_RANDOM_SCREAM, 0.1f }, // Scream again 10% of the time { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_CROUCHIDLE }, - { TASK_WAIT_RANDOM, (float)1.0 }, + { TASK_WAIT_RANDOM, 1.0f }, }; Schedule_t slScientistStartle[] = @@ -380,9 +380,9 @@ Schedule_t slScientistStartle[] = Task_t tlFear[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_SAY_FEAR, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_SAY_FEAR, 0.0f }, //{ TASK_PLAY_SEQUENCE, (float)ACT_FEAR_DISPLAY }, }; @@ -428,7 +428,7 @@ void CScientist::Scream( void ) { Talk( 10 ); m_hTalkTarget = m_hEnemy; - PlaySentence( "SC_SCREAM", RANDOM_FLOAT( 3, 6 ), VOL_NORM, ATTN_NORM ); + PlaySentence( "SC_SCREAM", RANDOM_FLOAT( 3.0f, 6.0f ), VOL_NORM, ATTN_NORM ); } } @@ -455,7 +455,7 @@ void CScientist::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_RANDOM_SCREAM: - if( RANDOM_FLOAT( 0, 1 ) < pTask->flData ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) < pTask->flData ) Scream(); TaskComplete(); break; @@ -482,8 +482,10 @@ void CScientist::StartTask( Task_t *pTask ) break; case TASK_MOVE_TO_TARGET_RANGE_SCARED: { - if( ( m_hTargetEnt->pev->origin - pev->origin).Length() < 1 ) + if( ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1.0f ) + { TaskComplete(); + } else { m_vecMoveGoal = m_hTargetEnt->pev->origin; @@ -523,7 +525,7 @@ void CScientist::RunTask( Task_t *pTask ) distance = ( m_vecMoveGoal - pev->origin ).Length2D(); // Re-evaluate when you think your finished, or the target has moved too far - if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5 ) + if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5f ) { m_vecMoveGoal = m_hTargetEnt->pev->origin; distance = ( m_vecMoveGoal - pev->origin ).Length2D(); @@ -771,7 +773,7 @@ void CScientist::PainSound( void ) if( gpGlobals->time < m_painTime ) return; - m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 0.75 ); + m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 0.75f ); switch( RANDOM_LONG( 0, 4 ) ) { @@ -1047,7 +1049,7 @@ MONSTERSTATE CScientist::GetIdealState( void ) BOOL CScientist::CanHeal( void ) { - if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) ) + if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5f ) ) ) return FALSE; return TRUE; @@ -1059,7 +1061,7 @@ void CScientist::Heal( void ) return; Vector target = m_hTargetEnt->pev->origin - pev->origin; - if( target.Length() > 100 ) + if( target.Length() > 100.0f ) return; m_hTargetEnt->TakeHealth( gSkillData.scientistHeal, DMG_GENERIC ); @@ -1238,7 +1240,7 @@ void CSittingScientist::Spawn() ResetSequenceInfo(); SetThink( &CSittingScientist::SittingThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DROP_TO_FLOOR( ENT( pev ) ); } @@ -1366,13 +1368,13 @@ void CSittingScientist::SittingThink( void ) pev->frame = 0; SetBoneController( 0, m_headTurn ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // prepare sitting scientist to answer a question void CSittingScientist::SetAnswerQuestion( CTalkMonster *pSpeaker ) { - m_flResponseDelay = gpGlobals->time + RANDOM_FLOAT( 3, 4 ); + m_flResponseDelay = gpGlobals->time + RANDOM_FLOAT( 3.0f, 4.0f ); m_hTalkTarget = (CBaseMonster *)pSpeaker; } diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 8e3a88ab..4c04a9f7 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -136,10 +136,10 @@ void CCineMonster::Spawn( void ) if( FStringNull( pev->targetname ) || !FStringNull( m_iszIdle ) ) { SetThink( &CCineMonster::CineThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; // Wait to be used? if( pev->targetname ) - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; } if( pev->spawnflags & SF_SCRIPT_NOINTERRUPT ) m_interruptable = FALSE; @@ -185,7 +185,7 @@ void CCineMonster::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE if( pTarget->m_scriptState == SCRIPT_PLAYING ) return; - m_startTime = gpGlobals->time + 0.05; + m_startTime = gpGlobals->time + 0.05f; } else { @@ -356,7 +356,7 @@ void CCineMonster::PossessEntity( void ) pTarget->pev->effects |= EF_NOINTERP; pTarget->pev->angles.y = pev->angles.y; pTarget->m_scriptState = SCRIPT_WAIT; - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; // UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters // pTarget->pev->flags &= ~FL_ONGROUND; break; @@ -424,7 +424,7 @@ void CCineAI::PossessEntity( void ) pTarget->pev->effects |= EF_NOINTERP; pTarget->pev->angles.y = pev->angles.y; pTarget->m_scriptState = SCRIPT_WAIT; - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; // UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters pTarget->pev->flags &= ~FL_ONGROUND; break; @@ -466,7 +466,7 @@ void CCineMonster::CineThink( void ) { CancelScript(); ALERT( at_aiconsole, "script \"%s\" can't find monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } } @@ -544,7 +544,7 @@ void CCineMonster::SequenceDone( CBaseMonster *pMonster ) if( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) ) { SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // This is done so that another sequence can take over the monster when triggered by the first @@ -713,7 +713,7 @@ void CCineMonster::DelayStart( int state ) { pTarget->m_iDelay--; if( pTarget->m_iDelay <= 0 ) - pTarget->m_startTime = gpGlobals->time + 0.05; + pTarget->m_startTime = gpGlobals->time + 0.05f; } } pentCine = FIND_ENTITY_BY_TARGETNAME( pentCine, STRING( pev->targetname ) ); @@ -836,7 +836,7 @@ BOOL CBaseMonster::CineCleanup() // UNDONE: ugly hack. Don't move monster if they don't "seem" to move // this really needs to be done with the AX,AY,etc. flags, but that aren't consistantly // being set, so animations that really do move won't be caught. - if( ( oldOrigin - new_origin).Length2D() < 8.0 ) + if( ( oldOrigin - new_origin).Length2D() < 8.0f ) new_origin = oldOrigin; pev->origin.x = new_origin.x; @@ -974,7 +974,7 @@ void CScriptedSentence::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "volume" ) ) { - m_flVolume = atof( pkvd->szValue ) * 0.1; + m_flVolume = atof( pkvd->szValue ) * 0.1f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "listener" ) ) @@ -1004,7 +1004,7 @@ void CScriptedSentence::Spawn( void ) if( !pev->targetname ) { SetThink( &CScriptedSentence::FindThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } switch( pev->impulse ) @@ -1030,8 +1030,8 @@ void CScriptedSentence::Spawn( void ) pev->impulse = 0; // No volume, use normal - if( m_flVolume <= 0 ) - m_flVolume = 1.0; + if( m_flVolume <= 0.0f ) + m_flVolume = 1.0f; } void CScriptedSentence::FindThink( void ) @@ -1050,7 +1050,7 @@ void CScriptedSentence::FindThink( void ) else { //ALERT( at_console, "%s: can't find monster %s\n", STRING( m_iszSentence ), STRING( m_iszEntity ) ); - pev->nextthink = gpGlobals->time + m_flRepeat + 0.5; + pev->nextthink = gpGlobals->time + m_flRepeat + 0.5f; } } @@ -1058,7 +1058,7 @@ void CScriptedSentence::DelayThink( void ) { m_active = TRUE; if( !pev->targetname ) - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CScriptedSentence::FindThink ); } @@ -1146,7 +1146,7 @@ BOOL CScriptedSentence::StartSentence( CBaseMonster *pTarget ) } pTarget->PlayScriptedSentence( STRING( m_iszSentence ), m_flDuration, m_flVolume, m_flAttenuation, bConcurrent, pListener ); - ALERT( at_aiconsole, "Playing sentence %s (%.1f)\n", STRING( m_iszSentence ), m_flDuration ); + ALERT( at_aiconsole, "Playing sentence %s (%.1f)\n", STRING( m_iszSentence ), (double)m_flDuration ); SUB_UseTargets( NULL, USE_TOGGLE, 0 ); return TRUE; } @@ -1192,7 +1192,7 @@ void CFurniture::Spawn() pev->sequence = 0; pev->frame = 0; - //pev->nextthink += 1.0; + //pev->nextthink += 1.0f; //SetThink( &WalkMonsterDelay ); ResetSequenceInfo(); diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index 03944087..90ec7e8c 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -119,7 +119,7 @@ void CShotgun::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } @@ -173,14 +173,14 @@ void CShotgun::PrimaryAttack() m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); //if( m_iClip != 0 ) - m_flPumpTime = gpGlobals->time + 0.5; + m_flPumpTime = gpGlobals->time + 0.5f; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f; else - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; m_fInSpecialReload = 0; } @@ -190,7 +190,7 @@ void CShotgun::SecondaryAttack( void ) if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } @@ -237,19 +237,19 @@ void CShotgun::SecondaryAttack( void ) vecDir = m_pPlayer->FireBulletsPlayer( 12, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); } - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usDoubleFire, 0.0, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usDoubleFire, 0.0f, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); //if( m_iClip != 0 ) - m_flPumpTime = gpGlobals->time + 0.95; + m_flPumpTime = gpGlobals->time + 0.95f; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.5f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0f; else m_flTimeWeaponIdle = 1.5; @@ -270,10 +270,10 @@ void CShotgun::Reload( void ) { SendWeaponAnim( SHOTGUN_START_RELOAD ); m_fInSpecialReload = 1; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.0 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; return; } else if( m_fInSpecialReload == 1 ) @@ -290,8 +290,8 @@ void CShotgun::Reload( void ) SendWeaponAnim( SHOTGUN_RELOAD ); - m_flNextReload = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flNextReload = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } else { @@ -338,27 +338,27 @@ void CShotgun::WeaponIdle( void ) // play cocking sound EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) ); m_fInSpecialReload = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; } } else { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.8 ) + if( flRand <= 0.8f ) { iAnim = SHOTGUN_IDLE_DEEP; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0 / 12.0 );// * RANDOM_LONG( 2, 5 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0f / 12.0f );// * RANDOM_LONG( 2, 5 ); } - else if( flRand <= 0.95 ) + else if( flRand <= 0.95f ) { iAnim = SHOTGUN_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0 / 9.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0f / 9.0f ); } else { iAnim = SHOTGUN_IDLE4; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0 / 9.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0f / 9.0f ); } SendWeaponAnim( iAnim ); } diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 8fc5cb89..51f37fbb 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -186,8 +186,8 @@ void CAmbientGeneric::Spawn( void ) if( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) { - ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); - pev->nextthink = gpGlobals->time + 0.1; + ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); return; } @@ -199,7 +199,7 @@ void CAmbientGeneric::Spawn( void ) // start thinking yet. SetThink( &CAmbientGeneric::RampThink ); - pev->nextthink = 0; + pev->nextthink = 0.0f; // allow on/off switching via 'use' function. @@ -236,9 +236,9 @@ void CAmbientGeneric::Precache( void ) if( m_fActive ) { UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, - ( m_dpv.vol * 0.01 ), m_flAttenuation, SND_SPAWNING, m_dpv.pitch ); + ( m_dpv.vol * 0.01f ), m_flAttenuation, SND_SPAWNING, m_dpv.pitch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -433,11 +433,11 @@ void CAmbientGeneric::RampThink( void ) pitch = PITCH_NORM + 1; // don't send 'no pitch' ! UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, - ( vol * 0.01 ), m_flAttenuation, flags, pitch ); + ( vol * 0.01f ), m_flAttenuation, flags, pitch ); } // update ramps at 5hz - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } @@ -548,12 +548,12 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, fraction = value; - if( fraction > 1.0 ) - fraction = 1.0; - if( fraction < 0.0 ) - fraction = 0.01; + if( fraction > 1.0f ) + fraction = 1.0f; + if( fraction < 0.0f ) + fraction = 0.01f; - m_dpv.pitch = (int)( fraction * 255 ); + m_dpv.pitch = (int)( fraction * 255.0f ); UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, 0, 0, SND_CHANGE_PITCH, m_dpv.pitch ); return; @@ -584,7 +584,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, if( m_dpv.pitchrun > 255 ) m_dpv.pitchrun = 255; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } else @@ -602,7 +602,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, m_dpv.fadeout = m_dpv.fadeoutsav; m_dpv.fadein = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, 0, 0, SND_STOP, 0 ); @@ -625,9 +625,9 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, // init all ramp params for startup InitModulationParms(); - UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, ( m_dpv.vol * 0.01 ), m_flAttenuation, 0, m_dpv.pitch ); + UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, ( m_dpv.vol * 0.01f ), m_flAttenuation, 0, m_dpv.pitch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -962,10 +962,10 @@ void CEnvSound::Think( void ) // not in range. do nothing, fall through to think_fast... env_sound_Think_fast: - pev->nextthink = gpGlobals->time + 0.25; + pev->nextthink = gpGlobals->time + 0.25f; return; env_sound_Think_slow: - pev->nextthink = gpGlobals->time + 0.75; + pev->nextthink = gpGlobals->time + 0.75f; return; } @@ -977,7 +977,7 @@ env_sound_Think_slow: void CEnvSound::Spawn() { // spread think times - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.0, 0.5 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.0f, 0.5f ); } // ==================== SENTENCE GROUPS, UTILITY FUNCTIONS ====================================== @@ -1400,7 +1400,7 @@ void EMIT_SOUND_SUIT( edict_t *entity, const char *sample ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) EMIT_SOUND_DYN( entity, CHAN_STATIC, sample, fvol, ATTN_NORM, 0, pitch ); } @@ -1415,7 +1415,7 @@ void EMIT_GROUPID_SUIT( edict_t *entity, int isentenceg ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) SENTENCEG_PlayRndI( entity, isentenceg, fvol, ATTN_NORM, 0, pitch ); } @@ -1430,7 +1430,7 @@ void EMIT_GROUPNAME_SUIT( edict_t *entity, const char *groupname ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) SENTENCEG_PlayRndSz( entity, groupname, fvol, ATTN_NORM, 0, pitch ); } @@ -1523,7 +1523,7 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in float fattn = ATTN_NORM; if( !g_pGameRules->PlayTextureSounds() ) - return 0.0; + return 0.0f; CBaseEntity *pEntity = CBaseEntity::Instance( ptr->pHit ); @@ -1572,44 +1572,44 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in { default: case CHAR_TEX_CONCRETE: - fvol = 0.9; - fvolbar = 0.6; + fvol = 0.9f; + fvolbar = 0.6f; rgsz[0] = "player/pl_step1.wav"; rgsz[1] = "player/pl_step2.wav"; cnt = 2; break; case CHAR_TEX_METAL: - fvol = 0.9; - fvolbar = 0.3; + fvol = 0.9f; + fvolbar = 0.3f; rgsz[0] = "player/pl_metal1.wav"; rgsz[1] = "player/pl_metal2.wav"; cnt = 2; break; case CHAR_TEX_DIRT: - fvol = 0.9; - fvolbar = 0.1; + fvol = 0.9f; + fvolbar = 0.1f; rgsz[0] = "player/pl_dirt1.wav"; rgsz[1] = "player/pl_dirt2.wav"; rgsz[2] = "player/pl_dirt3.wav"; cnt = 3; break; case CHAR_TEX_VENT: - fvol = 0.5; - fvolbar = 0.3; + fvol = 0.5f; + fvolbar = 0.3f; rgsz[0] = "player/pl_duct1.wav"; rgsz[1] = "player/pl_duct1.wav"; cnt = 2; break; case CHAR_TEX_GRATE: - fvol = 0.9; - fvolbar = 0.5; + fvol = 0.9f; + fvolbar = 0.5f; rgsz[0] = "player/pl_grate1.wav"; rgsz[1] = "player/pl_grate4.wav"; cnt = 2; break; case CHAR_TEX_TILE: - fvol = 0.8; - fvolbar = 0.2; + fvol = 0.8f; + fvolbar = 0.2f; rgsz[0] = "player/pl_tile1.wav"; rgsz[1] = "player/pl_tile3.wav"; rgsz[2] = "player/pl_tile2.wav"; @@ -1617,8 +1617,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in cnt = 4; break; case CHAR_TEX_SLOSH: - fvol = 0.9; - fvolbar = 0.0; + fvol = 0.9f; + fvolbar = 0.0f; rgsz[0] = "player/pl_slosh1.wav"; rgsz[1] = "player/pl_slosh3.wav"; rgsz[2] = "player/pl_slosh2.wav"; @@ -1626,8 +1626,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in cnt = 4; break; case CHAR_TEX_WOOD: - fvol = 0.9; - fvolbar = 0.2; + fvol = 0.9f; + fvolbar = 0.2f; rgsz[0] = "debris/wood1.wav"; rgsz[1] = "debris/wood2.wav"; rgsz[2] = "debris/wood3.wav"; @@ -1635,8 +1635,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in break; case CHAR_TEX_GLASS: case CHAR_TEX_COMPUTER: - fvol = 0.8; - fvolbar = 0.2; + fvol = 0.8f; + fvolbar = 0.2f; rgsz[0] = "debris/glass1.wav"; rgsz[1] = "debris/glass2.wav"; rgsz[2] = "debris/glass3.wav"; @@ -1644,12 +1644,12 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in break; case CHAR_TEX_FLESH: if( iBulletType == BULLET_PLAYER_CROWBAR ) - return 0.0; // crowbar already makes this sound - fvol = 1.0; - fvolbar = 0.2; + return 0.0f; // crowbar already makes this sound + fvol = 1.0f; + fvolbar = 0.2f; rgsz[0] = "weapons/bullet_hit1.wav"; rgsz[1] = "weapons/bullet_hit2.wav"; - fattn = 1.0; + fattn = 1.0f; cnt = 2; break; } @@ -1658,17 +1658,17 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in if( pEntity && FClassnameIs( pEntity->pev, "func_breakable" ) ) { // drop volumes, the object will already play a damaged sound - fvol /= 1.5; - fvolbar /= 2.0; + fvol /= 1.5f; + fvolbar /= 2.0f; } else if( chTextureType == CHAR_TEX_COMPUTER ) { // play random spark if computer - if( ptr->flFraction != 1.0 && RANDOM_LONG( 0, 1 ) ) + if( ptr->flFraction != 1.0f && RANDOM_LONG( 0, 1 ) ) { UTIL_Sparks( ptr->vecEndPos ); - float flVolume = RANDOM_FLOAT( 0.7, 1.0 );//random volume range + float flVolume = RANDOM_FLOAT( 0.7f, 1.0f );//random volume range switch( RANDOM_LONG( 0, 1 ) ) { case 0: @@ -1734,8 +1734,8 @@ void CSpeaker::Spawn( void ) if( !m_preset && ( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) ) { - ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); - pev->nextthink = gpGlobals->time + 0.1; + ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); return; } @@ -1743,7 +1743,7 @@ void CSpeaker::Spawn( void ) pev->movetype = MOVETYPE_NONE; SetThink( &CSpeaker::SpeakerThink ); - pev->nextthink = 0.0; + pev->nextthink = 0.0f; // allow on/off switching via 'use' function. SetUse( &CSpeaker::ToggleUse ); @@ -1751,27 +1751,27 @@ void CSpeaker::Spawn( void ) Precache(); } -#define ANNOUNCE_MINUTES_MIN 0.25 -#define ANNOUNCE_MINUTES_MAX 2.25 +#define ANNOUNCE_MINUTES_MIN 0.25f +#define ANNOUNCE_MINUTES_MAX 2.25f void CSpeaker::Precache( void ) { if( !FBitSet( pev->spawnflags, SPEAKER_START_SILENT ) ) // set first announcement time for random n second - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 5.0, 15.0 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 5.0f, 15.0f ); } void CSpeaker::SpeakerThink( void ) { const char* szSoundFile = NULL; - float flvolume = pev->health * 0.1; - float flattenuation = 0.3; + float flvolume = pev->health * 0.1f; + float flattenuation = 0.3f; int flags = 0; int pitch = 100; // Wait for the talkmonster to finish first. if( gpGlobals->time <= CTalkMonster::g_talkWaitTime ) { - pev->nextthink = CTalkMonster::g_talkWaitTime + RANDOM_FLOAT( 5, 10 ); + pev->nextthink = CTalkMonster::g_talkWaitTime + RANDOM_FLOAT( 5.0f, 10.0f ); return; } @@ -1828,7 +1828,7 @@ void CSpeaker::SpeakerThink( void ) flvolume, flattenuation, flags, pitch ); // shut off and reset - pev->nextthink = 0.0; + pev->nextthink = 0.0f; } else { @@ -1837,9 +1837,9 @@ void CSpeaker::SpeakerThink( void ) ALERT( at_console, "Level Design Error!\nSPEAKER has bad sentence group name: %s\n",szSoundFile ); // set next announcement time for random 5 to 10 minute delay - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( ANNOUNCE_MINUTES_MIN * 60.0, ANNOUNCE_MINUTES_MAX * 60.0 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( ANNOUNCE_MINUTES_MIN * 60.0f, ANNOUNCE_MINUTES_MAX * 60.0f ); - CTalkMonster::g_talkWaitTime = gpGlobals->time + 5; // time delay until it's ok to speak: used so that two NPCs don't talk at once + CTalkMonster::g_talkWaitTime = gpGlobals->time + 5.0f; // time delay until it's ok to speak: used so that two NPCs don't talk at once } return; @@ -1850,7 +1850,7 @@ void CSpeaker::SpeakerThink( void ) // void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - int fActive = ( pev->nextthink > 0.0 ); + int fActive = ( pev->nextthink > 0.0f ); // fActive is TRUE only if an announcement is pending @@ -1865,14 +1865,14 @@ void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( useType == USE_ON ) { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } if( useType == USE_OFF ) { // turn off announcements - pev->nextthink = 0.0; + pev->nextthink = 0.0f; return; } @@ -1880,12 +1880,12 @@ void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( fActive ) { // turn off announcements - pev->nextthink = 0.0; + pev->nextthink = 0.0f; } else { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } diff --git a/dlls/soundent.cpp b/dlls/soundent.cpp index 08000f28..7d9583f0 100644 --- a/dlls/soundent.cpp +++ b/dlls/soundent.cpp @@ -82,7 +82,7 @@ void CSoundEnt::Spawn( void ) pev->solid = SOLID_NOT; Initialize(); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } //========================================================= @@ -95,7 +95,7 @@ void CSoundEnt::Think( void ) int iSound; int iPreviousSound; - pev->nextthink = gpGlobals->time + 0.3;// how often to check the sound list. + pev->nextthink = gpGlobals->time + 0.3f;// how often to check the sound list. iPreviousSound = SOUNDLIST_EMPTY; iSound = m_iActiveSound; diff --git a/dlls/squadmonster.cpp b/dlls/squadmonster.cpp index 3d476b50..cbf3f19f 100644 --- a/dlls/squadmonster.cpp +++ b/dlls/squadmonster.cpp @@ -355,7 +355,7 @@ int CSquadMonster::SquadRecruit( int searchRadius, int maxMembers ) { TraceResult tr; UTIL_TraceLine( pev->origin + pev->view_ofs, pRecruit->pev->origin + pev->view_ofs, ignore_monsters, pRecruit->edict(), &tr );// try to hit recruit with a traceline. - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { if( !SquadAdd( pRecruit ) ) break; @@ -457,6 +457,7 @@ BOOL CSquadMonster::NoFriendlyFire( void ) Vector vecLeftSide; Vector vecRightSide; Vector v_left; + Vector v_dir; //!!!BUGBUG - to fix this, the planes must be aligned to where the monster will be firing its gun, not the direction it is facing!!! if( m_hEnemy != 0 ) @@ -471,9 +472,13 @@ BOOL CSquadMonster::NoFriendlyFire( void ) //UTIL_MakeVectors( pev->angles ); - vecLeftSide = pev->origin - ( gpGlobals->v_right * ( pev->size.x * 1.5 ) ); - vecRightSide = pev->origin + ( gpGlobals->v_right * ( pev->size.x * 1.5 ) ); - v_left = gpGlobals->v_right * -1; + // vecLeftSide = pev->origin - ( gpGlobals->v_right * ( pev->size.x * 1.5f ) ); + // vecRightSide = pev->origin + ( gpGlobals->v_right * ( pev->size.x * 1.5f ) ); + v_dir = gpGlobals->v_right * ( pev->size.x * 1.5f ); + vecLeftSide = pev->origin - v_dir; + vecRightSide = pev->origin + v_dir; + + v_left = gpGlobals->v_right * -1.0f; leftPlane.InitializePlane( gpGlobals->v_right, vecLeftSide ); rightPlane.InitializePlane( v_left, vecRightSide ); diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index a7295599..f6e2d636 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -87,7 +87,7 @@ TYPEDESCRIPTION CSqueakGrenade::m_SaveData[] = IMPLEMENT_SAVERESTORE( CSqueakGrenade, CGrenade ) -#define SQUEEK_DETONATE_DELAY 15.0 +#define SQUEEK_DETONATE_DELAY 15.0f int CSqueakGrenade::Classify( void ) { @@ -120,25 +120,25 @@ void CSqueakGrenade::Spawn( void ) pev->solid = SOLID_BBOX; SET_MODEL( ENT( pev ), "models/w_squeak.mdl" ); - UTIL_SetSize( pev, Vector( -4, -4, 0 ), Vector( 4, 4, 8 ) ); + UTIL_SetSize( pev, Vector( -4.0f, -4.0f, 0.0f ), Vector( 4.0f, 4.0f, 8.0f ) ); UTIL_SetOrigin( pev, pev->origin ); SetTouch( &CSqueakGrenade::SuperBounceTouch ); SetThink( &CSqueakGrenade::HuntThink ); - pev->nextthink = gpGlobals->time + 0.1; - m_flNextHunt = gpGlobals->time + 1E6; + pev->nextthink = gpGlobals->time + 0.1f; + m_flNextHunt = gpGlobals->time + (float)1E6; pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_AIM; pev->health = gSkillData.snarkHealth; - pev->gravity = 0.5; - pev->friction = 0.5; + pev->gravity = 0.5f; + pev->friction = 0.5f; pev->dmg = gSkillData.snarkDmgPop; m_flDie = gpGlobals->time + SQUEEK_DETONATE_DELAY; - m_flFieldOfView = 0; // 180 degrees + m_flFieldOfView = 0.0f; // 180 degrees if( pev->owner ) m_hOwner = Instance( pev->owner ); @@ -166,7 +166,7 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) pev->model = iStringNull;// make invisible SetThink( &CBaseEntity::SUB_Remove ); SetTouch( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // since squeak grenades never leave a body behind, clear out their takedamage now. // Squeaks do a bit of radius damage when they pop, and that radius damage will @@ -174,9 +174,9 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) pev->takedamage = DAMAGE_NO; // play squeek blast - EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5f, 0, PITCH_NORM ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0f ); UTIL_BloodDrips( pev->origin, g_vecZero, BloodColor(), 80 ); @@ -194,7 +194,7 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) void CSqueakGrenade::GibMonster( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200 ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75f, ATTN_NORM, 0, 200 ); } void CSqueakGrenade::HuntThink( void ) @@ -209,7 +209,7 @@ void CSqueakGrenade::HuntThink( void ) } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // explode when ready if( gpGlobals->time >= m_flDie ) @@ -227,8 +227,8 @@ void CSqueakGrenade::HuntThink( void ) { pev->movetype = MOVETYPE_FLY; } - pev->velocity = pev->velocity * 0.9; - pev->velocity.z += 8.0; + pev->velocity = pev->velocity * 0.9f; + pev->velocity.z += 8.0f; } else if( pev->movetype == MOVETYPE_FLY ) { @@ -239,7 +239,7 @@ void CSqueakGrenade::HuntThink( void ) if( m_flNextHunt > gpGlobals->time ) return; - m_flNextHunt = gpGlobals->time + 2.0; + m_flNextHunt = gpGlobals->time + 2.0f; //CBaseEntity *pOther = NULL; Vector vecDir; @@ -259,16 +259,16 @@ void CSqueakGrenade::HuntThink( void ) } // squeek if it's about time blow up - if( ( m_flDie - gpGlobals->time <= 0.5 ) && ( m_flDie - gpGlobals->time >= 0.3 ) ) + if( ( m_flDie - gpGlobals->time <= 0.5f ) && ( m_flDie - gpGlobals->time >= 0.3f ) ) { EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_die1.wav", 1, ATTN_NORM, 0, 100 + RANDOM_LONG( 0, 0x3F ) ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25f ); } // higher pitch as squeeker gets closer to detonation time - float flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); - if( flpitch < 80 ) - flpitch = 80; + float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + if( flpitch < 80.0f ) + flpitch = 80.0f; if( m_hEnemy != 0 ) { @@ -279,16 +279,16 @@ void CSqueakGrenade::HuntThink( void ) } float flVel = pev->velocity.Length(); - float flAdj = 50.0 / ( flVel + 10.0 ); + float flAdj = 50.0f / ( flVel + 10.0f ); - if( flAdj > 1.2 ) - flAdj = 1.2; + if( flAdj > 1.2f ) + flAdj = 1.2f; // ALERT( at_console, "think : enemy\n"); // ALERT( at_console, "%.0f %.2f %.2f %.2f\n", flVel, m_vecTarget.x, m_vecTarget.y, m_vecTarget.z ); - pev->velocity = pev->velocity * flAdj + m_vecTarget * 300; + pev->velocity = pev->velocity * flAdj + m_vecTarget * 300.0f; } if( pev->flags & FL_ONGROUND ) @@ -304,7 +304,7 @@ void CSqueakGrenade::HuntThink( void ) } } - if( ( pev->origin - m_posPrev ).Length() < 1.0 ) + if( ( pev->origin - m_posPrev ).Length() < 1.0f ) { pev->velocity.x = RANDOM_FLOAT( -100, 100 ); pev->velocity.y = RANDOM_FLOAT( -100, 100 ); @@ -329,15 +329,15 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) // at least until we've bounced once pev->owner = NULL; - pev->angles.x = 0; - pev->angles.z = 0; + pev->angles.x = 0.0f; + pev->angles.z = 0.0f; // avoid bouncing too much if( m_flNextHit > gpGlobals->time ) return; // higher pitch as squeeker gets closer to detonation time - flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); if( pOther->pev->takedamage && m_flNextAttack < gpGlobals->time ) { @@ -358,11 +358,11 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) ApplyMultiDamage( pev, pev ); pev->dmg += gSkillData.snarkDmgPop; // add more explosion damage - // m_flDie += 2.0; // add more life + // m_flDie += 2.0f; // add more life // make bite sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "squeek/sqk_deploy1.wav", 1.0, ATTN_NORM, 0, (int)flpitch ); - m_flNextAttack = gpGlobals->time + 0.5; + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "squeek/sqk_deploy1.wav", 1.0f, ATTN_NORM, 0, (int)flpitch ); + m_flNextAttack = gpGlobals->time + 0.5f; } } else @@ -371,7 +371,7 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) } } - m_flNextHit = gpGlobals->time + 0.1; + m_flNextHit = gpGlobals->time + 0.1f; m_flNextHunt = gpGlobals->time; if( g_pGameRules->IsMultiplayer() ) @@ -387,23 +387,23 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) if( !( pev->flags & FL_ONGROUND ) ) { // play bounce sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt1.wav", 1, ATTN_NORM, 0, (int)flpitch ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, (int)flpitch ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, (int)flpitch ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25f ); } else { // skittering sound - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 100, 0.1 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 100, 0.1f ); } - m_flNextBounceSoundTime = gpGlobals->time + 0.5;// half second. + m_flNextBounceSoundTime = gpGlobals->time + 0.5f;// half second. } #endif @@ -421,7 +421,7 @@ void CSqueak::Spawn() pev->sequence = 1; pev->animtime = gpGlobals->time; - pev->framerate = 1.0; + pev->framerate = 1.0f; } void CSqueak::Precache( void ) @@ -456,9 +456,9 @@ int CSqueak::GetItemInfo( ItemInfo *p ) BOOL CSqueak::Deploy() { // play hunt sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 100 ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 100 ); @@ -470,7 +470,7 @@ BOOL CSqueak::Deploy() void CSqueak::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -480,7 +480,7 @@ void CSqueak::Holster( int skiplocal /* = 0 */ ) } SendWeaponAnim( SQUEAK_DOWN ); - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CSqueak::PrimaryAttack() @@ -500,7 +500,7 @@ void CSqueak::PrimaryAttack() } // find place to toss monster - UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20, trace_origin + gpGlobals->v_forward * 64, dont_ignore_monsters, NULL, &tr ); + 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 @@ -508,20 +508,20 @@ void CSqueak::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); - if( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25 ) + if( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25f ) { // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); #ifndef 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 + m_pPlayer->pev->velocity; + pSqueak->pev->velocity = gpGlobals->v_forward * 200.0f + m_pPlayer->pev->velocity; #endif // play hunt sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 105 ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 105 ); @@ -532,8 +532,8 @@ void CSqueak::PrimaryAttack() m_fJustThrown = 1; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.3 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.3f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; } } } @@ -565,20 +565,20 @@ void CSqueak::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + if( flRand <= 0.75f ) { iAnim = SQUEAK_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0 / 16 * (2); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f; } - else if( flRand <= 0.875 ) + else if( flRand <= 0.875f ) { iAnim = SQUEAK_FIDGETFIT; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 16.0f; } else { iAnim = SQUEAK_FIDGETNIP; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f; } SendWeaponAnim( iAnim ); } diff --git a/dlls/subs.cpp b/dlls/subs.cpp index b57d7d23..400e05c8 100644 --- a/dlls/subs.cpp +++ b/dlls/subs.cpp @@ -230,7 +230,7 @@ void CBaseDelay::SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, floa // Save the useType pTemp->pev->button = (int)useType; pTemp->m_iszKillTarget = m_iszKillTarget; - pTemp->m_flDelay = 0; // prevent "recursion" + pTemp->m_flDelay = 0.0f; // prevent "recursion" pTemp->pev->target = pev->target; // HACKHACK @@ -400,7 +400,7 @@ void CBaseToggle::LinearMove( Vector vecDest, float flSpeed ) // divide vector length by speed to get time to reach dest float flTravelTime = vecDestDelta.Length() / flSpeed; - if( flTravelTime < 0.05 ) + if( flTravelTime < 0.05f ) { UTIL_SetOrigin( pev, m_vecFinalDest ); LinearMoveDone(); @@ -424,7 +424,7 @@ void CBaseToggle::LinearMoveDone( void ) { Vector delta = m_vecFinalDest - pev->origin; float error = delta.Length(); - if( error > 0.03125 ) + if( error > 0.03125f ) { LinearMove( m_vecFinalDest, 100 ); return; diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index 9180f037..295a3260 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -64,13 +64,13 @@ const char *CTalkMonster::m_szFriends[TLK_CFRIENDS] = Task_t tlIdleResponse[] = { { TASK_SET_ACTIVITY, (float)ACT_IDLE }, // Stop and listen - { TASK_WAIT, (float)0.5 }, // Wait until sure it's me they are talking to - { TASK_TLK_EYECONTACT, (float)0 }, // Wait until speaker is done - { TASK_TLK_RESPOND, (float)0 }, // Wait and then say my response - { TASK_TLK_IDEALYAW, (float)0 }, // look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_WAIT, 0.5f }, // Wait until sure it's me they are talking to + { TASK_TLK_EYECONTACT, 0.0f }, // Wait until speaker is done + { TASK_TLK_RESPOND, 0.0f }, // Wait and then say my response + { TASK_TLK_IDEALYAW, 0.0f }, // look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, // Wait until speaker is done + { TASK_TLK_EYECONTACT, 0.0f }, // Wait until speaker is done }; Schedule_t slIdleResponse[] = @@ -88,12 +88,12 @@ Schedule_t slIdleResponse[] = Task_t tlIdleSpeak[] = { - { TASK_TLK_SPEAK, (float)0 },// question or remark - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_SPEAK, 0.0f },// question or remark + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT_RANDOM, (float)0.5 }, + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT_RANDOM, 0.5f }, }; Schedule_t slIdleSpeak[] = @@ -113,9 +113,9 @@ Schedule_t slIdleSpeak[] = Task_t tlIdleSpeakWait[] = { { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 },// Stop and talk - { TASK_TLK_SPEAK, (float)0 },// question or remark - { TASK_TLK_EYECONTACT, (float)0 },// - { TASK_WAIT, (float)2 },// wait - used when sci is in 'use' mode to keep head turned + { TASK_TLK_SPEAK, 0.0f },// question or remark + { TASK_TLK_EYECONTACT, 0.0f },// + { TASK_WAIT, 2.0f },// wait - used when sci is in 'use' mode to keep head turned }; Schedule_t slIdleSpeakWait[] = @@ -135,18 +135,18 @@ Schedule_t slIdleSpeakWait[] = Task_t tlIdleHello[] = { { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 },// Stop and talk - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit }; Schedule_t slIdleHello[] = @@ -167,8 +167,8 @@ Schedule_t slIdleHello[] = Task_t tlIdleStopShooting[] = { - { TASK_TLK_STOPSHOOTING, (float)0 },// tell player to stop shooting friend - // { TASK_TLK_EYECONTACT, (float)0 },// look at the player + { TASK_TLK_STOPSHOOTING, 0.0f },// tell player to stop shooting friend + // { TASK_TLK_EYECONTACT, 0.0f },// look at the player }; Schedule_t slIdleStopShooting[] = @@ -188,11 +188,11 @@ Schedule_t slIdleStopShooting[] = Task_t tlMoveAway[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_MOVE_AWAY_FAIL }, - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_MOVE_AWAY_PATH, (float)100 }, - { TASK_WALK_PATH_FOR_UNITS, (float)100 }, - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_PLAYER, (float)0.5 }, + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_MOVE_AWAY_PATH, 100.0f }, + { TASK_WALK_PATH_FOR_UNITS, 100.0f }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_PLAYER, 0.5f }, }; Schedule_t slMoveAway[] = @@ -208,8 +208,8 @@ Schedule_t slMoveAway[] = Task_t tlMoveAwayFail[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_PLAYER, (float)0.5 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_PLAYER, 0.5f }, }; Schedule_t slMoveAwayFail[] = @@ -248,19 +248,19 @@ Task_t tlTlkIdleWatchClient[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_TLK_LOOK_AT_CLIENT, (float)6 }, + { TASK_TLK_LOOK_AT_CLIENT, 6.0f }, }; Task_t tlTlkIdleWatchClientStare[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_TLK_CLIENT_STARE, (float)6 }, - { TASK_TLK_STARE, (float)0 }, - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_CLIENT_STARE, 6.0f }, + { TASK_TLK_STARE, 0.0f }, + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, + { TASK_TLK_EYECONTACT, 0.0f }, }; Schedule_t slTlkIdleWatchClient[] = @@ -310,10 +310,10 @@ Schedule_t slTlkIdleWatchClient[] = Task_t tlTlkIdleEyecontact[] = { - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 },// Wait until speaker is done + { TASK_TLK_EYECONTACT, 0.0f },// Wait until speaker is done }; Schedule_t slTlkIdleEyecontact[] = @@ -445,7 +445,7 @@ void CTalkMonster::StartTask( Task_t *pTask ) else if( FindCover( pev->origin, pev->view_ofs, 0, CoverRadius() ) ) { // then try for plain ole cover - m_flMoveWaitFinished = gpGlobals->time + 2; + m_flMoveWaitFinished = gpGlobals->time + 2.0f; TaskComplete(); } else @@ -631,9 +631,9 @@ CBaseEntity *CTalkMonster::EnumFriends( CBaseEntity *pPrevious, int listNumber, UTIL_TraceLine( pev->origin, vecCheck, ignore_monsters, ENT( pev ), &tr ); } else - tr.flFraction = 1.0; + tr.flFraction = 1.0f; - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { return pFriend; } @@ -732,7 +732,7 @@ void CTalkMonster::HandleAnimEvent( MonsterEvent_t *pEvent ) // fall through... case SCRIPT_EVENT_SENTENCE: // Play a named sentence group ShutUpFriends(); - PlaySentence( pEvent->options, RANDOM_FLOAT( 2.8, 3.4 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( pEvent->options, RANDOM_FLOAT( 2.8f, 3.4f ), VOL_NORM, ATTN_IDLE ); //ALERT( at_console, "script event speak\n" ); break; default: @@ -806,7 +806,7 @@ CBaseEntity *CTalkMonster::FindNearestFriend( BOOL fPlayer ) { UTIL_TraceLine( vecStart, vecCheck, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // visible and in range, this is the new nearest scientist if( ( vecStart - vecCheck ).Length() < TALKRANGE_MIN ) @@ -841,7 +841,7 @@ void CTalkMonster::Touch( CBaseEntity *pOther ) // Heuristic for determining if the player is pushing me away float speed = fabs( pOther->pev->velocity.x ) + fabs( pOther->pev->velocity.y ); - if( speed > 50 ) + if( speed > 50.0f ) { SetConditions( bits_COND_CLIENT_PUSH ); MakeIdealYaw( pOther->pev->origin ); @@ -858,7 +858,7 @@ void CTalkMonster::IdleRespond( void ) //int pitch = GetVoicePitch(); // play response - PlaySentence( m_szGrp[TLK_ANSWER], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_ANSWER], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); } int CTalkMonster::FOkToSpeak( void ) @@ -939,9 +939,9 @@ int CTalkMonster::FIdleHello( void ) m_hTalkTarget = pPlayer; if( FBitSet(pev->spawnflags, SF_MONSTER_PREDISASTER ) ) - PlaySentence( m_szGrp[TLK_PHELLO], RANDOM_FLOAT( 3, 3.5 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_PHELLO], RANDOM_FLOAT( 3.0f, 3.5f ), VOL_NORM, ATTN_IDLE ); else - PlaySentence( m_szGrp[TLK_HELLO], RANDOM_FLOAT( 3, 3.5 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_HELLO], RANDOM_FLOAT( 3.0f, 3.5f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidHelloPlayer ); @@ -991,14 +991,14 @@ int CTalkMonster::FIdleSpeak( void ) szIdleGroup = m_szGrp[TLK_PIDLE]; szQuestionGroup = m_szGrp[TLK_PQUESTION]; // set global min delay for next conversation - duration = RANDOM_FLOAT( 4.8, 5.2 ); + duration = RANDOM_FLOAT( 4.8f, 5.2f ); } else { szIdleGroup = m_szGrp[TLK_IDLE]; szQuestionGroup = m_szGrp[TLK_QUESTION]; // set global min delay for next conversation - duration = RANDOM_FLOAT( 2.8, 3.2 ); + duration = RANDOM_FLOAT( 2.8f, 3.2f ); } //pitch = GetVoicePitch(); @@ -1105,7 +1105,7 @@ void CTalkMonster::PlaySentence( const char *pszSentence, float duration, float Talk( duration ); - CTalkMonster::g_talkWaitTime = gpGlobals->time + duration + 2.0; + CTalkMonster::g_talkWaitTime = gpGlobals->time + duration + 2.0f; if( pszSentence[0] == '!' ) EMIT_SOUND_DYN( edict(), CHAN_VOICE, pszSentence, volume, attenuation, 0, GetVoicePitch() ); else @@ -1124,7 +1124,7 @@ void CTalkMonster::Talk( float flDuration ) if( flDuration <= 0 ) { // no duration :( - m_flStopTalkTime = gpGlobals->time + 3; + m_flStopTalkTime = gpGlobals->time + 3.0f; } else { @@ -1186,20 +1186,20 @@ Schedule_t *CTalkMonster::GetScheduleOfType( int Type ) } // sustained light wounds? - if( !FBitSet( m_bitsSaid, bit_saidWoundLight ) && ( pev->health <= ( pev->max_health * 0.75 ) ) ) + if( !FBitSet( m_bitsSaid, bit_saidWoundLight ) && ( pev->health <= ( pev->max_health * 0.75f ) ) ) { //SENTENCEG_PlayRndSz( ENT( pev ), m_szGrp[TLK_WOUND], 1.0, ATTN_IDLE, 0, GetVoicePitch() ); - //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8, 3.2 ); - PlaySentence( m_szGrp[TLK_WOUND], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8f, 3.2f ); + PlaySentence( m_szGrp[TLK_WOUND], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidWoundLight ); return slIdleStand; } // sustained heavy wounds? - else if( !FBitSet( m_bitsSaid, bit_saidWoundHeavy ) && ( pev->health <= ( pev->max_health * 0.5 ) ) ) + else if( !FBitSet( m_bitsSaid, bit_saidWoundHeavy ) && ( pev->health <= ( pev->max_health * 0.5f ) ) ) { //SENTENCEG_PlayRndSz( ENT( pev ), m_szGrp[TLK_MORTAL], 1.0, ATTN_IDLE, 0, GetVoicePitch() ); - //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8, 3.2 ); - PlaySentence( m_szGrp[TLK_MORTAL], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8f, 3.2f ); + PlaySentence( m_szGrp[TLK_MORTAL], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidWoundHeavy ); return slIdleStand; } @@ -1289,8 +1289,8 @@ void CTalkMonster::TrySmellTalk( void ) // smelled something? if( !FBitSet( m_bitsSaid, bit_saidSmelled ) && HasConditions( bits_COND_SMELL ) ) { - PlaySentence( m_szGrp[TLK_SMELL], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); - m_flLastSaidSmelled = gpGlobals->time + 60;// don't talk about the stinky for a while. + PlaySentence( m_szGrp[TLK_SMELL], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); + m_flLastSaidSmelled = gpGlobals->time + 60.0f;// don't talk about the stinky for a while. SetBits( m_bitsSaid, bit_saidSmelled ); } } @@ -1309,7 +1309,7 @@ void CTalkMonster::StopFollowing( BOOL clearSchedule ) { if( !( m_afMemory & bits_MEMORY_PROVOKED ) ) { - PlaySentence( m_szGrp[TLK_UNUSE], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_UNUSE], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); m_hTalkTarget = m_hTargetEnt; } @@ -1332,7 +1332,7 @@ void CTalkMonster::StartFollowing( CBaseEntity *pLeader ) m_IdealMonsterState = MONSTERSTATE_ALERT; m_hTargetEnt = pLeader; - PlaySentence( m_szGrp[TLK_USE], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_USE], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); m_hTalkTarget = m_hTargetEnt; ClearConditions( bits_COND_CLIENT_PUSH ); ClearSchedule(); diff --git a/dlls/talkmonster.h b/dlls/talkmonster.h index 36ac21a6..befa4e4a 100644 --- a/dlls/talkmonster.h +++ b/dlls/talkmonster.h @@ -25,7 +25,7 @@ // Used for scientists and barneys //========================================================= -#define TALKRANGE_MIN 500.0 // don't talk to anyone farther away than this +#define TALKRANGE_MIN 500.0f // don't talk to anyone farther away than this #define TLK_STARE_DIST 128 // anyone closer than this and looking at me is probably staring at me. diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index 44b8b45b..c860fcb3 100644 --- a/dlls/tentacle.cpp +++ b/dlls/tentacle.cpp @@ -261,7 +261,7 @@ void CTentacle::Spawn() SetTouch( &CTentacle::HitTouch ); SetUse( &CTentacle::CommandUse ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; ResetSequenceInfo(); m_iDir = 1; @@ -323,7 +323,7 @@ void CTentacle::KeyValue( KeyValueData *pkvd ) { if( FStrEq( pkvd->szKeyName, "sweeparc" ) ) { - m_flMaxYaw = atof( pkvd->szValue ) / 2.0; + m_flMaxYaw = atof( pkvd->szValue ) * 0.5f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "sound" ) ) @@ -426,7 +426,7 @@ void CTentacle::Test( void ) pev->sequence = TENTACLE_ANIM_Floor_Strike; pev->framerate = 0; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // @@ -435,7 +435,7 @@ void CTentacle::Test( void ) void CTentacle::Cycle( void ) { // ALERT( at_console, "%s %.2f %d %d\n", STRING( pev->targetname ), pev->origin.z, m_MonsterState, m_IdealMonsterState ); - pev->nextthink = gpGlobals-> time + 0.1; + pev->nextthink = gpGlobals-> time + 0.1f; // ALERT( at_console, "%s %d %d %d %f %f\n", STRING( pev->targetname ), pev->sequence, m_iGoalAnim, m_iDir, pev->framerate, pev->health ); @@ -467,7 +467,7 @@ void CTentacle::Cycle( void ) if( pSound ) { Vector vecDir; - if( gpGlobals->time - m_flPrevSoundTime < 0.5 ) + if( gpGlobals->time - m_flPrevSoundTime < 0.5f ) { float dt = gpGlobals->time - m_flPrevSoundTime; vecDir = pSound->m_vecOrigin + ( pSound->m_vecOrigin - m_vecPrevSound ) / dt - pev->origin; @@ -506,7 +506,7 @@ void CTentacle::Cycle( void ) // UTIL_EmitAmbientSound( ENT( pev ), pev->origin + Vector( 0, 0, MyHeight() ), sound, 1.0, ATTN_NORM, 0, 100 ); } #endif - m_flSoundTime = gpGlobals->time + RANDOM_FLOAT( 5.0, 10.0 ); + m_flSoundTime = gpGlobals->time + RANDOM_FLOAT( 5.0f, 10.0f ); } // clip ideal_yaw @@ -644,8 +644,8 @@ void CTentacle::Cycle( void ) } ResetSequenceInfo(); - m_flFramerateAdj = RANDOM_FLOAT( -0.2, 0.2 ); - pev->framerate = m_iDir * 1.0 + m_flFramerateAdj; + m_flFramerateAdj = RANDOM_FLOAT( -0.2f, 0.2f ); + pev->framerate = m_iDir * 1.0f + m_flFramerateAdj; switch( pev->sequence ) { @@ -678,12 +678,12 @@ void CTentacle::Cycle( void ) // ALERT( at_console, "seq %d\n", pev->sequence ); } - if( m_flPrevSoundTime + 2.0 > gpGlobals->time ) + if( m_flPrevSoundTime + 2.0f > gpGlobals->time ) { // 1.5 normal speed if hears sounds - pev->framerate = m_iDir * 1.5 + m_flFramerateAdj; + pev->framerate = m_iDir * 1.5f + m_flFramerateAdj; } - else if( m_flPrevSoundTime + 5.0 > gpGlobals->time ) + else if( m_flPrevSoundTime + 5.0f > gpGlobals->time ) { // slowdown to normal pev->framerate = m_iDir + m_iDir * ( 5 - ( gpGlobals->time - m_flPrevSoundTime ) ) / 2 + m_flFramerateAdj; @@ -719,7 +719,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T void CTentacle::DieThink( void ) { - pev->nextthink = gpGlobals-> time + 0.1; + pev->nextthink = gpGlobals-> time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -778,7 +778,7 @@ void CTentacle::DieThink( void ) case TENTACLE_ANIM_Engine_Death1: case TENTACLE_ANIM_Engine_Death2: case TENTACLE_ANIM_Engine_Death3: - pev->framerate = RANDOM_FLOAT( m_iDir - 0.2, m_iDir + 0.2 ); + pev->framerate = RANDOM_FLOAT( m_iDir - 0.2f, m_iDir + 0.2f ); dy = 180; break; default: @@ -841,11 +841,11 @@ void CTentacle::HandleAnimEvent( MonsterEvent_t *pEvent ) case 6: // light tap { - Vector vecSrc = pev->origin + m_flTapRadius * Vector( cos( pev->angles.y * ( M_PI / 180.0 ) ), sin( pev->angles.y * ( M_PI / 180.0 ) ), 0.0 ); + Vector vecSrc = pev->origin + m_flTapRadius * Vector( cos( pev->angles.y * ( M_PI_F / 180.0f ) ), sin( pev->angles.y * ( M_PI_F / 180.0f ) ), 0.0f ); vecSrc.z += MyHeight(); - float flVol = RANDOM_FLOAT( 0.3, 0.5 ); + float flVol = RANDOM_FLOAT( 0.3f, 0.5f ); switch( m_iTapSound ) { @@ -929,7 +929,7 @@ void CTentacle::Start( void ) g_fSquirmSound = TRUE; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CTentacle::HitTouch( CBaseEntity *pOther ) @@ -961,7 +961,7 @@ void CTentacle::HitTouch( CBaseEntity *pOther ) return; // Huh? } - m_flHitTime = gpGlobals->time + 0.5; + m_flHitTime = gpGlobals->time + 0.5f; // ALERT( at_console, "%s : ", STRING( tr.pHit->v.classname ) ); diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index b7633498..2c0888c9 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -163,7 +163,7 @@ void CAutoTrigger::Spawn( void ) void CAutoTrigger::Precache( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CAutoTrigger::Think( void ) @@ -614,7 +614,7 @@ void CTriggerMonsterJump::Touch( CBaseEntity *pOther ) return; } - pevOther->origin.z += 1; + pevOther->origin.z += 1.0f; if( FBitSet( pevOther->flags, FL_ONGROUND ) ) { @@ -739,7 +739,7 @@ void CTargetCDAudio::Spawn( void ) pev->movetype = MOVETYPE_NONE; if( pev->scale > 0 ) - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } void CTargetCDAudio::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) @@ -759,7 +759,7 @@ void CTargetCDAudio::Think( void ) if( !pClient ) return; - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; if( ( pClient->v.origin - pev->origin ).Length() <= pev->scale ) Play(); @@ -825,8 +825,8 @@ void CTriggerHurt::RadiationThink( void ) origin = pev->origin; view_ofs = pev->view_ofs; - pev->origin = ( pev->absmin + pev->absmax ) * 0.5; - pev->view_ofs = pev->view_ofs * 0.0; + pev->origin = ( pev->absmin + pev->absmax ) * 0.5f; + pev->view_ofs = pev->view_ofs * 0.0f; pentPlayer = FIND_CLIENT_IN_PVS( edict() ); @@ -841,8 +841,8 @@ void CTriggerHurt::RadiationThink( void ) pevTarget = VARS( pentPlayer ); // get range to player; - vecSpot1 = ( pev->absmin + pev->absmax ) * 0.5; - vecSpot2 = ( pevTarget->absmin + pevTarget->absmax ) * 0.5; + vecSpot1 = ( pev->absmin + pev->absmax ) * 0.5f; + vecSpot2 = ( pevTarget->absmin + pevTarget->absmax ) * 0.5f; vecRange = vecSpot1 - vecSpot2; flRange = vecRange.Length(); @@ -855,7 +855,7 @@ void CTriggerHurt::RadiationThink( void ) pPlayer->m_flgeigerRange = flRange; } - pev->nextthink = gpGlobals->time + 0.25; + pev->nextthink = gpGlobals->time + 0.25f; } // @@ -952,7 +952,7 @@ void CBaseTrigger::HurtTouch( CBaseEntity *pOther ) // while touching the trigger. Player continues taking damage for a while after // leaving the trigger - fldmg = pev->dmg * 0.5; // 0.5 seconds worth of damage, pev->dmg is damage/second + fldmg = pev->dmg * 0.5f; // 0.5 seconds worth of damage, pev->dmg is damage/second // JAY: Cut this because it wasn't fully realized. Damage is simpler now. #if 0 @@ -992,7 +992,7 @@ void CBaseTrigger::HurtTouch( CBaseEntity *pOther ) pev->pain_finished = gpGlobals->time; // Apply damage every half second - pev->dmgtime = gpGlobals->time + 0.5;// half second delay until this trigger can hurt toucher again + pev->dmgtime = gpGlobals->time + 0.5f;// half second delay until this trigger can hurt toucher again if( pev->target ) { @@ -1038,7 +1038,7 @@ LINK_ENTITY_TO_CLASS( trigger_multiple, CTriggerMultiple ) void CTriggerMultiple::Spawn( void ) { if( m_flWait == 0 ) - m_flWait = 0.2; + m_flWait = 0.2f; InitTrigger(); @@ -1159,7 +1159,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator ) // we can't just remove (self) here, because this is a touch function // called while C code is looping through area links... SetTouch( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); } } @@ -1702,7 +1702,7 @@ void NextLevel( void ) if( pChange->pev->nextthink < gpGlobals->time ) { pChange->SetThink( &CChangeLevel::ExecuteChangeLevel ); - pChange->pev->nextthink = gpGlobals->time + 0.1; + pChange->pev->nextthink = gpGlobals->time + 0.1f; } } @@ -2323,8 +2323,8 @@ void CTriggerCamera::FollowTarget() if( !( FBitSet( pev->spawnflags, SF_CAMERA_PLAYER_TAKECONTROL ) ) ) { - pev->velocity = pev->velocity * 0.8; - if( pev->velocity.Length() < 10.0 ) + pev->velocity = pev->velocity * 0.8f; + if( pev->velocity.Length() < 10.0f ) pev->velocity = g_vecZero; } diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 6e8fc2fc..50ea8c37 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -105,22 +105,22 @@ void CTripmineGrenade::Spawn( void ) ResetSequenceInfo(); pev->framerate = 0; - UTIL_SetSize( pev, Vector( -8, -8, -8 ), Vector( 8, 8, 8 ) ); + UTIL_SetSize( pev, Vector( -8.0f, -8.0f, -8.0f ), Vector( 8.0f, 8.0f, 8.0f ) ); UTIL_SetOrigin( pev, pev->origin ); if( pev->spawnflags & 1 ) { // power up quickly - m_flPowerUp = gpGlobals->time + 1.0; + m_flPowerUp = gpGlobals->time + 1.0f; } else { // power up in 2.5 seconds - m_flPowerUp = gpGlobals->time + 2.5; + m_flPowerUp = gpGlobals->time + 2.5f; } SetThink( &CTripmineGrenade::PowerupThink ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; pev->takedamage = DAMAGE_YES; pev->dmg = gSkillData.plrDmgTripmine; @@ -138,7 +138,7 @@ void CTripmineGrenade::Spawn( void ) UTIL_MakeAimVectors( pev->angles ); m_vecDir = gpGlobals->v_forward; - m_vecEnd = pev->origin + m_vecDir * 2048; + m_vecEnd = pev->origin + m_vecDir * 2048.0f; } void CTripmineGrenade::Precache( void ) @@ -163,7 +163,7 @@ void CTripmineGrenade::WarningThink( void ) // set to power up SetThink( &CTripmineGrenade::PowerupThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } void CTripmineGrenade::PowerupThink( void ) @@ -175,15 +175,15 @@ void CTripmineGrenade::PowerupThink( void ) // find an owner edict_t *oldowner = pev->owner; pev->owner = NULL; - UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 32, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin + m_vecDir * 8.0f, pev->origin - m_vecDir * 32.0f, dont_ignore_monsters, ENT( pev ), &tr ); if( tr.fStartSolid || ( oldowner && tr.pHit == oldowner ) ) { pev->owner = oldowner; - m_flPowerUp += 0.1; - pev->nextthink = gpGlobals->time + 0.1; + m_flPowerUp += 0.1f; + pev->nextthink = gpGlobals->time + 0.1f; return; } - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { pev->owner = tr.pHit; m_hOwner = CBaseEntity::Instance( pev->owner ); @@ -195,8 +195,8 @@ void CTripmineGrenade::PowerupThink( void ) STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/mine_deploy.wav" ); STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; - ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", pev->origin.x, pev->origin.y, pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; + ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); KillBeam(); return; } @@ -206,12 +206,12 @@ void CTripmineGrenade::PowerupThink( void ) // disable STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/mine_deploy.wav" ); STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" ); - CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); + CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24.0f, pev->angles ); pMine->pev->spawnflags |= SF_NORESPAWN; SetThink( &CBaseEntity::SUB_Remove ); KillBeam(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } // ALERT( at_console, "%d %.0f %.0f %0.f\n", pev->owner, m_pOwner->pev->origin.x, m_pOwner->pev->origin.y, m_pOwner->pev->origin.z ); @@ -227,7 +227,7 @@ void CTripmineGrenade::PowerupThink( void ) // play enabled sound EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "weapons/mine_activate.wav", 0.5, ATTN_NORM, 1, 75 ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CTripmineGrenade::KillBeam( void ) @@ -251,9 +251,9 @@ void CTripmineGrenade::MakeBeam( void ) // set to follow laser spot SetThink( &CTripmineGrenade::BeamBreakThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - Vector vecTmpEnd = pev->origin + m_vecDir * 2048 * m_flBeamLength; + Vector vecTmpEnd = pev->origin + m_vecDir * 2048.0f * m_flBeamLength; m_pBeam = CBeam::BeamCreate( g_pModelNameLaser, 10 ); m_pBeam->PointEntInit( vecTmpEnd, entindex() ); @@ -282,7 +282,7 @@ void CTripmineGrenade::BeamBreakThink( void ) m_hOwner = CBaseEntity::Instance( tr.pHit ); // reset owner too } - if( fabs( m_flBeamLength - tr.flFraction ) > 0.001 ) + if( fabs( m_flBeamLength - tr.flFraction ) > 0.001f ) { bBlowup = 1; } @@ -308,7 +308,7 @@ void CTripmineGrenade::BeamBreakThink( void ) return; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } int CTripmineGrenade::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) @@ -316,9 +316,9 @@ int CTripmineGrenade::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke if( gpGlobals->time < m_flPowerUp && flDamage < pev->health ) { // disable - // Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); + // Create( "weapon_tripmine", pev->origin + m_vecDir * 24.0f, pev->angles ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; KillBeam(); return FALSE; } @@ -336,16 +336,16 @@ void CTripmineGrenade::Killed( entvars_t *pevAttacker, int iGib ) } SetThink( &CTripmineGrenade::DelayDeathThink ); - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.3f ); - EMIT_SOUND( ENT( pev ), CHAN_BODY, "common/null.wav", 0.5, ATTN_NORM ); // shut off chargeup + EMIT_SOUND( ENT( pev ), CHAN_BODY, "common/null.wav", 0.5f, ATTN_NORM ); // shut off chargeup } void CTripmineGrenade::DelayDeathThink( void ) { KillBeam(); TraceResult tr; - UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 64, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 64.0f, dont_ignore_monsters, ENT( pev ), &tr ); Explode( &tr, DMG_BLAST ); } @@ -374,7 +374,7 @@ void CTripmine::Spawn() if( !g_pGameRules->IsDeathmatch() ) #endif { - UTIL_SetSize( pev, Vector( -16, -16, 0 ), Vector( 16, 16, 28 ) ); + UTIL_SetSize( pev, Vector( -16.0f, -16.0f, 0.0f ), Vector( 16.0f, 16.0f, 28.0f ) ); } } @@ -412,7 +412,7 @@ BOOL CTripmine::Deploy() void CTripmine::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -422,7 +422,7 @@ void CTripmine::Holster( int skiplocal /* = 0 */ ) } SendWeaponAnim( TRIPMINE_HOLSTER ); - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CTripmine::PrimaryAttack( void ) @@ -436,7 +436,7 @@ void CTripmine::PrimaryAttack( void ) TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128.0f, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); int flags; #ifdef CLIENT_WEAPONS @@ -444,16 +444,16 @@ void CTripmine::PrimaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); if( pEntity && !( pEntity->pev->flags & FL_CONVEYOR ) ) { Vector angles = UTIL_VecToAngles( tr.vecPlaneNormal ); - CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8, angles, m_pPlayer->edict() ); + CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8.0f, angles, m_pPlayer->edict() ); m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -498,20 +498,20 @@ void CTripmine::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.25 ) + if( flRand <= 0.25f ) { iAnim = TRIPMINE_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 30.0f; } - else if( flRand <= 0.75 ) + else if( flRand <= 0.75f ) { iAnim = TRIPMINE_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 30.0f; } else { iAnim = TRIPMINE_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 100.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 100.0f / 30.0f; } SendWeaponAnim( iAnim ); diff --git a/dlls/turret.cpp b/dlls/turret.cpp index 093b2032..a5aa6d23 100644 --- a/dlls/turret.cpp +++ b/dlls/turret.cpp @@ -316,7 +316,7 @@ void CTurret::Spawn() m_pEyeGlow->SetAttachment( edict(), 2 ); m_eyeBrightness = 0; - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CTurret::Precache() @@ -331,9 +331,9 @@ void CMiniTurret::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/miniturret.mdl" ); pev->health = gSkillData.miniturretHealth; - m_HackedGunPos = Vector( 0, 0, 12.75 ); + m_HackedGunPos = Vector( 0.0f, 0.0f, 12.75f ); m_flMaxSpin = 0; - pev->view_ofs.z = 12.75; + pev->view_ofs.z = 12.75f; CBaseTurret::Spawn(); m_iRetractHeight = 16; @@ -342,7 +342,7 @@ void CMiniTurret::Spawn() UTIL_SetSize( pev, Vector( -16, -16, -m_iRetractHeight ), Vector( 16, 16, m_iRetractHeight ) ); SetThink( &CBaseTurret::Initialize ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CMiniTurret::Precache() @@ -385,7 +385,7 @@ void CBaseTurret::Initialize( void ) { m_flLastSight = gpGlobals->time + m_flMaxWait; SetThink( &CBaseTurret::AutoSearchThink ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } else SetThink( &CBaseEntity::SUB_DoNothing ); @@ -399,7 +399,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ if( m_iOn ) { m_hEnemy = NULL; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_iAutoStart = FALSE;// switching off a turret disables autostart //!!!! this should spin down first!!BUGBUG @@ -407,7 +407,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ } else { - pev->nextthink = gpGlobals->time + 0.1; // turn on delay + pev->nextthink = gpGlobals->time + 0.1f; // turn on delay // if the turret is flagged as an autoactivate turret, re-enable it's ability open self. if( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE ) @@ -465,7 +465,7 @@ void CBaseTurret::ActiveThink( void ) int fAttack = 0; Vector vecDirToEnemy; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); if( ( !m_iOn ) || ( m_hEnemy == 0 ) ) @@ -481,7 +481,7 @@ void CBaseTurret::ActiveThink( void ) { if( !m_flLastSight ) { - m_flLastSight = gpGlobals->time + 0.5; // continue-shooting timeout + m_flLastSight = gpGlobals->time + 0.5f; // continue-shooting timeout } else { @@ -510,7 +510,7 @@ void CBaseTurret::ActiveThink( void ) if( !fEnemyVisible || ( flDistToEnemy > TURRET_RANGE ) ) { if( !m_flLastSight ) - m_flLastSight = gpGlobals->time + 0.5; + m_flLastSight = gpGlobals->time + 0.5f; else { // Should we look for a new target? @@ -529,7 +529,7 @@ void CBaseTurret::ActiveThink( void ) m_vecLastSight = vecMidEnemy; } - UTIL_MakeAimVectors(m_vecCurAngles); + UTIL_MakeAimVectors( m_vecCurAngles ); /* ALERT( at_console, "%.0f %.0f : %.2f %.2f %.2f\n", @@ -541,7 +541,7 @@ void CBaseTurret::ActiveThink( void ) vecLOS = vecLOS.Normalize(); // Is the Gun looking at the target - if( DotProduct( vecLOS, gpGlobals->v_forward ) <= 0.866 ) // 30 degree slop + if( DotProduct( vecLOS, gpGlobals->v_forward ) <= 0.866f ) // 30 degree slop fAttack = FALSE; else fAttack = TRUE; @@ -642,7 +642,7 @@ void CMiniTurret::Shoot( Vector &vecSrc, Vector &vecDirToEnemy ) void CBaseTurret::Deploy( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); if( pev->sequence != TURRET_ANIM_DEPLOY ) @@ -684,7 +684,7 @@ void CBaseTurret::Retire( void ) m_vecGoalAngles.x = 0; m_vecGoalAngles.y = m_flStartYaw; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); @@ -713,7 +713,7 @@ void CBaseTurret::Retire( void ) if( m_iAutoStart ) { SetThink( &CBaseTurret::AutoSearchThink ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } else SetThink( &CBaseEntity::SUB_DoNothing ); @@ -728,7 +728,7 @@ void CBaseTurret::Retire( void ) void CTurret::SpinUpCall( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Are we already spun up? If not start the two stage process. if( !m_iSpin ) @@ -738,15 +738,15 @@ void CTurret::SpinUpCall( void ) // for the first pass, spin up the the barrel if( !m_iStartSpin ) { - pev->nextthink = gpGlobals->time + 1.0; // spinup delay + pev->nextthink = gpGlobals->time + 1.0f; // spinup delay EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_spinup.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); m_iStartSpin = 1; - pev->framerate = 0.1; + pev->framerate = 0.1f; } // after the barrel is spun up, turn on the hum - else if( pev->framerate >= 1.0 ) + else if( pev->framerate >= 1.0f ) { - pev->nextthink = gpGlobals->time + 0.1; // retarget delay + pev->nextthink = gpGlobals->time + 0.1f; // retarget delay EMIT_SOUND( ENT( pev ), CHAN_STATIC, "turret/tu_active2.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); SetThink( &CBaseTurret::ActiveThink ); m_iStartSpin = 0; @@ -754,7 +754,7 @@ void CTurret::SpinUpCall( void ) } else { - pev->framerate += 0.075; + pev->framerate += 0.075f; } } @@ -769,12 +769,12 @@ void CTurret::SpinDownCall( void ) if( m_iSpin ) { SetTurretAnim( TURRET_ANIM_SPIN ); - if( pev->framerate == 1.0 ) + if( pev->framerate == 1.0f ) { EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "turret/tu_active2.wav", 0, 0, SND_STOP, 100 ); EMIT_SOUND( ENT( pev ), CHAN_ITEM, "turret/tu_spindown.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); } - pev->framerate -= 0.02; + pev->framerate -= 0.02f; if( pev->framerate <= 0 ) { pev->framerate = 0; @@ -830,7 +830,7 @@ void CBaseTurret::SearchThink( void ) // ensure rethink SetTurretAnim( TURRET_ANIM_SPIN ); StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_flSpinUpTime == 0 && m_flMaxSpin ) m_flSpinUpTime = gpGlobals->time + m_flMaxSpin; @@ -875,7 +875,7 @@ void CBaseTurret::SearchThink( void ) } // generic hunt for new victims - m_vecGoalAngles.y = ( m_vecGoalAngles.y + 0.1 * m_fTurnRate ); + m_vecGoalAngles.y = ( m_vecGoalAngles.y + 0.1f * m_fTurnRate ); if( m_vecGoalAngles.y >= 360 ) m_vecGoalAngles.y -= 360; MoveTurret(); @@ -890,7 +890,7 @@ void CBaseTurret::AutoSearchThink( void ) { // ensure rethink StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; // If we have a target and we're still healthy if( m_hEnemy != 0 ) @@ -918,7 +918,7 @@ void CBaseTurret::TurretDeath( void ) //BOOL iActive = FALSE; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->deadflag != DEAD_DEAD ) { @@ -926,9 +926,9 @@ void CBaseTurret::TurretDeath( void ) float flRndSound = RANDOM_FLOAT( 0, 1 ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die.wav", 1.0, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die2.wav", 1.0, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die3.wav", 1.0, ATTN_NORM ); @@ -1006,7 +1006,7 @@ int CBaseTurret::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl return 0; if( !m_iOn ) - flDamage /= 10.0; + flDamage *= 0.1f; pev->health -= flDamage; if( pev->health <= 0 ) @@ -1020,7 +1020,7 @@ int CBaseTurret::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl SetUse( NULL ); SetThink( &CBaseTurret::TurretDeath ); SUB_UseTargets( this, USE_ON, 0 ); // wake up others - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return 0; } @@ -1046,7 +1046,7 @@ int CBaseTurret::MoveTurret( void ) { float flDir = m_vecGoalAngles.x > m_vecCurAngles.x ? 1 : -1 ; - m_vecCurAngles.x += 0.1 * m_fTurnRate * flDir; + m_vecCurAngles.x += 0.1f * m_fTurnRate * flDir; // if we started below the goal, and now we're past, peg to goal if( flDir == 1 ) @@ -1093,14 +1093,14 @@ int CBaseTurret::MoveTurret( void ) m_fTurnRate += m_iBaseTurnRate; } - m_vecCurAngles.y += 0.1 * m_fTurnRate * flDir; + m_vecCurAngles.y += 0.1f * m_fTurnRate * flDir; if( m_vecCurAngles.y < 0 ) m_vecCurAngles.y += 360; else if( m_vecCurAngles.y >= 360 ) m_vecCurAngles.y -= 360; - if( flDist < ( 0.05 * m_iBaseTurnRate ) ) + if( flDist < ( 0.05f * m_iBaseTurnRate ) ) m_vecCurAngles.y = m_vecGoalAngles.y; //ALERT( at_console, "%.2f -> %.2f\n", m_vecCurAngles.y, y ); @@ -1170,7 +1170,7 @@ void CSentry::Spawn() SetTouch( &CSentry::SentryTouch ); SetThink( &CBaseTurret::Initialize ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CSentry::Shoot( Vector &vecSrc, Vector &vecDirToEnemy ) @@ -1201,7 +1201,7 @@ int CSentry::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float { SetThink( &CBaseTurret::Deploy ); SetUse( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } pev->health -= flDamage; @@ -1216,7 +1216,7 @@ int CSentry::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float SetUse( NULL ); SetThink( &CSentry::SentryDeath ); SUB_UseTargets( this, USE_ON, 0 ); // wake up others - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return 0; } @@ -1237,7 +1237,7 @@ void CSentry::SentryDeath( void ) //BOOL iActive = FALSE; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->deadflag != DEAD_DEAD ) { @@ -1245,9 +1245,9 @@ void CSentry::SentryDeath( void ) float flRndSound = RANDOM_FLOAT( 0, 1 ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die.wav", 1.0, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die2.wav", 1.0, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die3.wav", 1.0, ATTN_NORM ); diff --git a/dlls/util.cpp b/dlls/util.cpp index a66b5fbc..018a2f8e 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -34,7 +34,7 @@ float UTIL_WeaponTimeBase( void ) { #if defined( CLIENT_WEAPONS ) - return 0.0; + return 0.0f; #else return gpGlobals->time; #endif @@ -130,7 +130,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) tensixrand = U_Random() & 65535; - offset = (float)tensixrand / 65536.0; + offset = (float)tensixrand / 65536.0f; return ( low + offset * range ); } @@ -147,8 +147,8 @@ void UTIL_ParametricRocket( entvars_t *pev, Vector vecOrigin, Vector vecAngles, // Now compute how long it will take based on current velocity Vector vecTravel = pev->endpos - pev->startpos; - float travelTime = 0.0; - if( pev->velocity.Length() > 0 ) + float travelTime = 0.0f; + if( pev->velocity.Length() > 0.0f ) { travelTime = vecTravel.Length() / pev->velocity.Length(); } @@ -458,7 +458,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e // Use origin for X & Y since they are centered for all monsters // Now X - delta = center.x - pEdict->v.origin.x;//( pEdict->v.absmin.x + pEdict->v.absmax.x ) * 0.5; + delta = center.x - pEdict->v.origin.x;//( pEdict->v.absmin.x + pEdict->v.absmax.x ) * 0.5f; delta *= delta; if( delta > radiusSquared ) @@ -466,7 +466,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e distance = delta; // Now Y - delta = center.y - pEdict->v.origin.y;//( pEdict->v.absmin.y + pEdict->v.absmax.y )*0.5; + delta = center.y - pEdict->v.origin.y;//( pEdict->v.absmin.y + pEdict->v.absmax.y ) * 0.5f; delta *= delta; distance += delta; @@ -474,7 +474,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e continue; // Now Z - delta = center.z - ( pEdict->v.absmin.z + pEdict->v.absmax.z ) * 0.5; + delta = center.z - ( pEdict->v.absmin.z + pEdict->v.absmax.z ) * 0.5f; delta *= delta; distance += delta; @@ -1184,7 +1184,7 @@ void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber ) if( index < 0 ) return; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; // Only decal BSP models @@ -1253,7 +1253,7 @@ void UTIL_PlayerDecalTrace( TraceResult *pTrace, int playernum, int decalNumber, else index = decalNumber; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1276,7 +1276,7 @@ void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber ) if( index < 0 ) return; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pTrace->vecEndPos ); @@ -1306,7 +1306,7 @@ void UTIL_Ricochet( const Vector &position, float scale ) WRITE_COORD( position.x ); WRITE_COORD( position.y ); WRITE_COORD( position.z ); - WRITE_BYTE( (int)( scale * 10 ) ); + WRITE_BYTE( (int)( scale * 10.0f ) ); MESSAGE_END(); } @@ -1423,9 +1423,9 @@ float UTIL_WaterLevel( const Vector &position, float minz, float maxz ) return maxz; float diff = maxz - minz; - while( diff > 1.0 ) + while( diff > 1.0f ) { - midUp.z = minz + diff / 2.0; + midUp.z = minz + diff / 2.0f; if( UTIL_PointContents( midUp ) == CONTENTS_WATER ) { minz = midUp.z; @@ -1444,7 +1444,7 @@ extern DLL_GLOBAL short g_sModelIndexBubbles;// holds the index for the bubbles void UTIL_Bubbles( Vector mins, Vector maxs, int count ) { - Vector mid = ( mins + maxs ) * 0.5; + Vector mid = ( mins + maxs ) * 0.5f; float flHeight = UTIL_WaterLevel( mid, mid.z, mid.z + 1024 ); flHeight = flHeight - mins.z; diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 5daf07f6..ec98e0ca 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -441,7 +441,7 @@ void CBasePlayerItem::FallInit( void ) SetTouch( &CBasePlayerItem::DefaultTouch ); SetThink( &CBasePlayerItem::FallThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //========================================================= @@ -453,7 +453,7 @@ void CBasePlayerItem::FallInit( void ) //========================================================= void CBasePlayerItem::FallThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->flags & FL_ONGROUND ) { @@ -596,7 +596,7 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted ) } else { - return ( attack_time <= 0.0 ) ? TRUE : FALSE; + return ( attack_time <= 0.0f ) ? TRUE : FALSE; } } @@ -654,19 +654,19 @@ void CBasePlayerWeapon::ItemPostFrame( void ) // no fire buttons down m_fFireOnEmpty = FALSE; - if( !IsUseable() && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) ) + if( !IsUseable() && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0f : gpGlobals->time ) ) { // weapon isn't useable, switch. if( !( iFlags() & ITEM_FLAG_NOAUTOSWITCHEMPTY ) && g_pGameRules->GetNextBestWeapon( m_pPlayer, this ) ) { - m_flNextPrimaryAttack = ( UseDecrement() ? 0.0 : gpGlobals->time ) + 0.3; + m_flNextPrimaryAttack = ( UseDecrement() ? 0.0f : gpGlobals->time ) + 0.3f; return; } } else { // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing - if( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) ) + if( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0f : gpGlobals->time ) ) { Reload(); return; @@ -706,14 +706,14 @@ void CBasePlayerItem::Drop( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBasePlayerItem::Kill( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBasePlayerItem::Holster( int skiplocal /* = 0 */ ) @@ -952,8 +952,8 @@ BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWe strcpy( m_pPlayer->m_szAnimExtention, szAnimExt ); SendWeaponAnim( iAnim, skiplocal, body ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_flLastFireTime = 0.0f; return TRUE; @@ -976,7 +976,7 @@ BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, i m_fInReload = TRUE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; return TRUE; } @@ -1071,7 +1071,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } } else if( gEvilImpulse101 ) @@ -1079,7 +1079,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther ) // evil impulse 101 hack, kill always SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -1158,7 +1158,7 @@ void CBasePlayerWeapon::RetireWeapon( void ) //========================================================================= float CBasePlayerWeapon::GetNextAttackDelay( float delay ) { - if( m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1 ) + if( m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1.0f ) { // At this point, we are assuming that the client has stopped firing // and we are going to reset our book keeping variables. @@ -1256,7 +1256,7 @@ void CWeaponBox::Kill( void ) while( pWeapon ) { pWeapon->SetThink( &CBaseEntity::SUB_Remove ); - pWeapon->pev->nextthink = gpGlobals->time + 0.1; + pWeapon->pev->nextthink = gpGlobals->time + 0.1f; pWeapon = pWeapon->m_pNext; } } @@ -1550,8 +1550,8 @@ void CWeaponBox::SetObjectCollisionBox( void ) void CBasePlayerWeapon::PrintState( void ) { - ALERT( at_console, "primary: %f\n", m_flNextPrimaryAttack ); - ALERT( at_console, "idle : %f\n", m_flTimeWeaponIdle ); + ALERT( at_console, "primary: %f\n", (double)m_flNextPrimaryAttack ); + ALERT( at_console, "idle : %f\n", (double)m_flTimeWeaponIdle ); //ALERT( at_console, "nextrl : %f\n", m_flNextReload ); //ALERT( at_console, "nextpum: %f\n", m_flPumpTime ); diff --git a/dlls/world.cpp b/dlls/world.cpp index ae5a41bc..0e0a0288 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -159,7 +159,7 @@ void CDecal::TriggerDecal( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY MESSAGE_END(); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CDecal::StaticDecal( void ) @@ -626,15 +626,15 @@ void CWorld::Precache( void ) pEntity->SetThink( &CBaseEntity::SUB_CallUseToggle ); pEntity->pev->message = pev->netname; pev->netname = 0; - pEntity->pev->nextthink = gpGlobals->time + 0.3; + pEntity->pev->nextthink = gpGlobals->time + 0.3f; pEntity->pev->spawnflags = SF_MESSAGE_ONCE; } } if( pev->spawnflags & SF_WORLD_DARK ) - CVAR_SET_FLOAT( "v_dark", 1.0 ); + CVAR_SET_FLOAT( "v_dark", 1.0f ); else - CVAR_SET_FLOAT( "v_dark", 0.0 ); + CVAR_SET_FLOAT( "v_dark", 0.0f ); pev->spawnflags &= ~SF_WORLD_DARK; // g-cont. don't apply fade after save\restore @@ -647,11 +647,11 @@ void CWorld::Precache( void ) if( pev->spawnflags & SF_WORLD_FORCETEAM ) { - CVAR_SET_FLOAT( "mp_defaultteam", 1 ); + CVAR_SET_FLOAT( "mp_defaultteam", 1.0f ); } else { - CVAR_SET_FLOAT( "mp_defaultteam", 0 ); + CVAR_SET_FLOAT( "mp_defaultteam", 0.0f ); } // g-cont. moved here so cheats will working on restore level @@ -677,7 +677,7 @@ void CWorld::KeyValue( KeyValueData *pkvd ) else if( FStrEq(pkvd->szKeyName, "WaveHeight" ) ) { // Sent over net now. - pev->scale = atof( pkvd->szValue ) * ( 1.0 / 8.0 ); + pev->scale = atof( pkvd->szValue ) * ( 1.0f / 8.0f ); pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "MaxRange" ) ) diff --git a/dlls/xen.cpp b/dlls/xen.cpp index 1d86beb3..847f26f7 100644 --- a/dlls/xen.cpp +++ b/dlls/xen.cpp @@ -94,10 +94,10 @@ void CXenPLight::Spawn( void ) UTIL_SetSize( pev, Vector( -80, -80, 0 ), Vector( 80, 80, 32 ) ); SetActivity( ACT_IDLE ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = RANDOM_FLOAT( 0, 255 ); - m_pGlow = CSprite::SpriteCreate( XEN_PLANT_GLOW_SPRITE, pev->origin + Vector(0,0,(pev->mins.z+pev->maxs.z)*0.5), FALSE ); + m_pGlow = CSprite::SpriteCreate( XEN_PLANT_GLOW_SPRITE, pev->origin + Vector( 0, 0, ( pev->mins.z + pev->maxs.z ) * 0.5f ), FALSE ); m_pGlow->SetTransparency( kRenderGlow, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, (int)pev->renderamt, (int)pev->renderfx ); m_pGlow->SetAttachment( edict(), 1 ); } @@ -111,7 +111,7 @@ void CXenPLight::Precache( void ) void CXenPLight::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; switch( GetActivity() ) { @@ -187,19 +187,19 @@ void CXenHair::Spawn( void ) if( !( pev->spawnflags & SF_HAIR_SYNC ) ) { pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); } ResetSequenceInfo(); pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.4 ); // Load balance these a bit + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.4f ); // Load balance these a bit } void CXenHair::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CXenHair::Precache( void ) @@ -283,9 +283,9 @@ void CXenTree::Spawn( void ) UTIL_SetSize( pev, Vector( -30, -30, 0 ), Vector( 30, 30, 188 ) ); SetActivity( ACT_IDLE ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); Vector triggerPosition; UTIL_MakeVectorsPrivate( pev->angles, triggerPosition, NULL, NULL ); @@ -329,7 +329,7 @@ void CXenTree::Attack( void ) if( GetActivity() == ACT_IDLE ) { SetActivity( ACT_MELEE_ATTACK1 ); - pev->framerate = RANDOM_FLOAT( 1.0, 1.4 ); + pev->framerate = RANDOM_FLOAT( 1.0f, 1.4f ); EMIT_SOUND_ARRAY_DYN( CHAN_WEAPON, pAttackMissSounds ); } } @@ -375,7 +375,7 @@ void CXenTree::HandleAnimEvent( MonsterEvent_t *pEvent ) void CXenTree::Think( void ) { float flInterval = StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents( flInterval ); switch( GetActivity() ) @@ -384,7 +384,7 @@ void CXenTree::Think( void ) if( m_fSequenceFinished ) { SetActivity( ACT_IDLE ); - pev->framerate = RANDOM_FLOAT( 0.6, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.6f, 1.4f ); } break; default: @@ -513,9 +513,9 @@ void CXenSpore :: Spawn( void ) //SetActivity( ACT_IDLE ); pev->sequence = 0; pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); ResetSequenceInfo(); - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.4 ); // Load balance these a bit + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.4f ); // Load balance these a bit } const char *CXenSpore::pModelNames[] = @@ -537,7 +537,7 @@ void CXenSpore::Touch( CBaseEntity *pOther ) void CXenSpore::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; #if 0 DispatchAnimEvents( flInterval ); diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index 3b0879c7..a0c9b948 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -76,7 +76,7 @@ void PM_ShowClipBox( void ) // Show our BBOX in particles. PM_DrawBBox( pmove->player_mins[pmove->usehull], pmove->player_maxs[pmove->usehull], org, pmove->server ? 132 : 0, 0.1 ); - PM_ParticleLine( org, org, pmove->server ? 132 : 0, 0.1, 5.0 ); + PM_ParticleLine( org, org, pmove->server ? 132 : 0, 0.1f, 5.0f ); /* { int i; @@ -179,13 +179,13 @@ void PM_DrawPhysEntBBox(int num, int pcolor, float life) { vec3_t forward, right, up; - AngleVectorsTranspose(pe->angles, forward, right, up); - for (j = 0; j < 8; j++) + AngleVectorsTranspose( pe->angles, forward, right, up); + for( j = 0; j < 8; j++ ) { VectorCopy(p[j], tmp); - p[j][0] = DotProduct ( tmp, forward ); - p[j][1] = DotProduct ( tmp, right ); - p[j][2] = DotProduct ( tmp, up ); + p[j][0] = DotProduct( tmp, forward ); + p[j][1] = DotProduct( tmp, right ); + p[j][2] = DotProduct( tmp, up ); } } @@ -296,7 +296,7 @@ void PM_ViewEntity( void ) VectorCopy( pmove->origin, origin); - fup = 0.5*( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); + fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); fup += pmove->view_ofs[2]; fup -= 4; diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index 4bb4b93f..d5eefd37 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -29,12 +29,12 @@ #pragma warning(disable : 4244) #endif -vec3_t vec3_origin = { 0,0,0 }; +vec3_t vec3_origin = { 0, 0, 0 }; int nanmask = 255 << 23; float anglemod( float a ) { - a = ( 360.0 / 65536 ) * ( (int)( a * ( 65536 / 360.0 ) ) & 65535 ); + a = ( 360.0f / 65536.0f ) * ( (int)( a * ( 65536.0f / 360.0f ) ) & 65535 ); return a; } @@ -43,13 +43,13 @@ void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI*2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI*2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -78,13 +78,13 @@ void AngleVectorsTranspose( const vec3_t angles, vec3_t forward, vec3_t right, v float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -113,13 +113,13 @@ void AngleMatrix( const vec3_t angles, float (*matrix)[4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -133,9 +133,9 @@ void AngleMatrix( const vec3_t angles, float (*matrix)[4] ) matrix[0][2] = ( cr * sp * cy + -sr * -sy ); matrix[1][2] = ( cr * sp * sy + -sr * cy ); matrix[2][2] = cr * cp; - matrix[0][3] = 0.0; - matrix[1][3] = 0.0; - matrix[2][3] = 0.0; + matrix[0][3] = 0.0f; + matrix[1][3] = 0.0f; + matrix[2][3] = 0.0f; } void AngleIMatrix( const vec3_t angles, float matrix[3][4] ) @@ -143,13 +143,13 @@ void AngleIMatrix( const vec3_t angles, float matrix[3][4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -174,13 +174,13 @@ void NormalizeAngles( float *angles ) // Normalize angles for( i = 0; i < 3; i++ ) { - if( angles[i] > 180.0 ) + if( angles[i] > 180.0f ) { - angles[i] -= 360.0; + angles[i] -= 360.0f; } - else if( angles[i] < -180.0 ) + else if( angles[i] < -180.0f ) { - angles[i] += 360.0; + angles[i] += 360.0f; } } } @@ -209,13 +209,13 @@ void InterpolateAngles( float *start, float *end, float *output, float frac ) ang2 = end[i]; d = ang2 - ang1; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } output[i] = ang1 + d * frac; @@ -240,7 +240,7 @@ float AngleBetweenVectors( const vec3_t v1, const vec3_t v2 ) return 0.0f; angle = acos( DotProduct( v1, v2 ) / ( l1 * l2 ) ); - angle = ( angle * 180.0f ) / M_PI; + angle = ( angle * 180.0f ) / M_PI_F; return angle; } @@ -333,7 +333,7 @@ float VectorNormalize( vec3_t v ) if( length ) { - ilength = 1 / length; + ilength = 1.0f / length; v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; @@ -368,18 +368,18 @@ void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up ) { vec3_t tmp; - if( forward[0] == 0 && forward[1] == 0 ) + if( forward[0] == 0.0f && forward[1] == 0.0f ) { - right[0] = 1; - right[1] = 0; - right[2] = 0; + right[0] = 1.0f; + right[1] = 0.0f; + right[2] = 0.0f; up[0] = -forward[2]; - up[1] = 0; - up[2] = 0; + up[1] = 0.0f; + up[2] = 0.0f; return; } - tmp[0] = 0; tmp[1] = 0; tmp[2] = 1.0; + tmp[0] = 0.0f; tmp[1] = 0.0f; tmp[2] = 1.0f; CrossProduct( forward, tmp, right ); VectorNormalize( right ); CrossProduct( right, forward, up ); @@ -390,27 +390,27 @@ void VectorAngles( const vec3_t forward, vec3_t angles ) { float tmp, yaw, pitch; - if( forward[1] == 0 && forward[0] == 0 ) + if( forward[1] == 0.0f && forward[0] == 0.0f ) { - yaw = 0; - if( forward[2] > 0 ) - pitch = 90; + yaw = 0.0f; + if( forward[2] > 0.0f ) + pitch = 90.0f; else - pitch = 270; + pitch = 270.0f; } else { - yaw = ( atan2( forward[1], forward[0] ) * 180 / M_PI ); - if( yaw < 0 ) - yaw += 360; + yaw = ( atan2( forward[1], forward[0] ) * 180.0f / M_PI_F ); + if( yaw < 0.0f ) + yaw += 360.0f; tmp = sqrt( forward[0] * forward[0] + forward[1] * forward[1] ); - pitch = ( atan2( forward[2], tmp ) * 180 / M_PI ); - if( pitch < 0 ) - pitch += 360; + pitch = ( atan2( forward[2], tmp ) * 180.0f / M_PI_F ); + if( pitch < 0.0f ) + pitch += 360.0f; } angles[0] = pitch; angles[1] = yaw; - angles[2] = 0; + angles[2] = 0.0f; } diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index ace56595..6c5aef43 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -45,7 +45,7 @@ static int pm_shared_initialized = 0; playermove_t *pmove = NULL; // Ducking time -#define TIME_TO_DUCK 0.4 +#define TIME_TO_DUCK 0.4f #define VEC_DUCK_HULL_MIN -18 #define VEC_DUCK_HULL_MAX 18 #define VEC_DUCK_VIEW 12 @@ -56,7 +56,7 @@ playermove_t *pmove = NULL; #define VEC_HULL_MIN -36 #define VEC_HULL_MAX 36 #define VEC_VIEW 28 -#define STOP_EPSILON 0.1 +#define STOP_EPSILON 0.1f #define CTEXTURESMAX 512 // max number of textures loaded #define CBTEXTURENAMEMAX 13 // only load first n chars of name @@ -91,7 +91,7 @@ playermove_t *pmove = NULL; #define PLAYER_LONGJUMP_SPEED 350 // how fast we longjump -#define PLAYER_DUCKING_MULTIPLIER 0.333 +#define PLAYER_DUCKING_MULTIPLIER 0.333f // double to float warning #ifdef _MSC_VER @@ -284,7 +284,7 @@ void PM_PlayStepSound( int step, float fvol ) return; VectorCopy( pmove->velocity, hvel ); - hvel[2] = 0.0; + hvel[2] = 0.0f; if( pmove->multiplayer && ( !g_onladder && Length( hvel ) <= 220 ) ) return; @@ -594,7 +594,7 @@ void PM_UpdateStepSound( void ) // If we're on a ladder or on the ground, and we're moving fast enough, // play step sound. Also, if pmove->flTimeStepSound is zero, get the new // sound right away - we just started moving in new level. - if( ( fLadder || ( pmove->onground != -1 ) ) && ( Length( pmove->velocity ) > 0.0 ) && ( speed >= velwalk || !pmove->flTimeStepSound ) ) + if( ( fLadder || ( pmove->onground != -1 ) ) && ( Length( pmove->velocity ) > 0.0f ) && ( speed >= velwalk || !pmove->flTimeStepSound ) ) { fWalking = speed < velrun; @@ -604,26 +604,26 @@ void PM_UpdateStepSound( void ) height = pmove->player_maxs[pmove->usehull][2] - pmove->player_mins[pmove->usehull][2]; - knee[2] = pmove->origin[2] - 0.3 * height; - feet[2] = pmove->origin[2] - 0.5 * height; + knee[2] = pmove->origin[2] - 0.3f * height; + feet[2] = pmove->origin[2] - 0.5f * height; // find out what we're stepping in or on... if( fLadder ) { step = STEP_LADDER; - fvol = 0.35; + fvol = 0.35f; pmove->flTimeStepSound = 350; } else if( pmove->PM_PointContents( knee, NULL ) == CONTENTS_WATER ) { step = STEP_WADE; - fvol = 0.65; + fvol = 0.65f; pmove->flTimeStepSound = 600; } else if( pmove->PM_PointContents( feet, NULL ) == CONTENTS_WATER ) { step = STEP_SLOSH; - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; } else @@ -636,31 +636,31 @@ void PM_UpdateStepSound( void ) { default: case CHAR_TEX_CONCRETE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_METAL: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_DIRT: - fvol = fWalking ? 0.25 : 0.55; + fvol = fWalking ? 0.25f : 0.55f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_VENT: - fvol = fWalking ? 0.4 : 0.7; + fvol = fWalking ? 0.4f : 0.7f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_GRATE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_TILE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_SLOSH: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; } @@ -672,7 +672,7 @@ void PM_UpdateStepSound( void ) // 35% volume if ducking if( pmove->flags & FL_DUCKING ) { - fvol *= 0.35; + fvol *= 0.35f; } PM_PlayStepSound( step, fvol ); @@ -801,11 +801,11 @@ void PM_AddCorrectGravity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Add gravity so they'll be in the correct position during movement // yes, this 0.5 looks wrong, but it's not. - pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * 0.5 * pmove->frametime ); + pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * 0.5f * pmove->frametime ); pmove->velocity[2] += pmove->basevelocity[2] * pmove->frametime; pmove->basevelocity[2] = 0; @@ -822,10 +822,10 @@ void PM_FixupGravityVelocity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Get the correct velocity for the end of the dt - pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime * 0.5 ); + pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime * 0.5f ); PM_CheckVelocity(); } @@ -911,7 +911,7 @@ int PM_FlyMove( void ) // If the plane we hit has a high z component in the normal, then // it's probably a floor - if( trace.plane.normal[2] > 0.7 ) + if( trace.plane.normal[2] > 0.7f ) { blocked |= 1; // floor } @@ -946,14 +946,14 @@ int PM_FlyMove( void ) { for( i = 0; i < numplanes; i++ ) { - if( planes[i][2] > 0.7 ) + if( planes[i][2] > 0.7f ) { // floor or slope PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1 ); VectorCopy( new_velocity, original_velocity ); } else - PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1.0 + pmove->movevars->bounce * ( 1 - pmove->friction ) ); + PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1.0f + pmove->movevars->bounce * ( 1 - pmove->friction ) ); } VectorCopy( new_velocity, pmove->velocity ); @@ -1202,8 +1202,9 @@ void PM_WalkMove() // If we are not on the ground any more then // use the original movement attempt - if( trace.plane.normal[2] < 0.7 ) + if( trace.plane.normal[2] < 0.7f ) goto usedown; + // If the trace ended up in empty space, copy the end // over to the origin. if( !trace.startsolid && !trace.allsolid ) @@ -1274,7 +1275,7 @@ void PM_Friction( void ) trace = pmove->PM_PlayerTrace( start, stop, PM_NORMAL, -1 ); - if( trace.fraction == 1.0 ) + if( trace.fraction == 1.0f ) friction = pmove->movevars->friction*pmove->movevars->edgefriction; else friction = pmove->movevars->friction; @@ -1388,7 +1389,7 @@ void PM_WaterMove( void ) wishspeed = pmove->maxspeed; } // Slow us down a bit. - wishspeed *= 0.8; + wishspeed *= 0.8f; VectorAdd( pmove->velocity, pmove->basevelocity, pmove->velocity ); @@ -1515,8 +1516,8 @@ qboolean PM_CheckWater() float heightover2; // Pick a spot just above the players feet. - point[0] = pmove->origin[0] + ( pmove->player_mins[pmove->usehull][0] + pmove->player_maxs[pmove->usehull][0] ) * 0.5; - point[1] = pmove->origin[1] + ( pmove->player_mins[pmove->usehull][1] + pmove->player_maxs[pmove->usehull][1] ) * 0.5; + point[0] = pmove->origin[0] + ( pmove->player_mins[pmove->usehull][0] + pmove->player_maxs[pmove->usehull][0] ) * 0.5f; + point[1] = pmove->origin[1] + ( pmove->player_mins[pmove->usehull][1] + pmove->player_maxs[pmove->usehull][1] ) * 0.5f; point[2] = pmove->origin[2] + pmove->player_mins[pmove->usehull][2] + 1; // Assume that we are not in water at all. @@ -1535,7 +1536,7 @@ qboolean PM_CheckWater() pmove->waterlevel = 1; height = ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); - heightover2 = height * 0.5; + heightover2 = height * 0.5f; // Now check a point that is at the player hull midpoint. point[2] = pmove->origin[2] + heightover2; @@ -1610,7 +1611,7 @@ void PM_CatagorizePosition( void ) // Try and move down. tr = pmove->PM_PlayerTrace( pmove->origin, point, PM_NORMAL, -1 ); // If we hit a steep plane, we are not on ground - if( tr.plane.normal[2] < 0.7 ) + if( tr.plane.normal[2] < 0.7f ) pmove->onground = -1; // too steep else pmove->onground = tr.ent; // Otherwise, point to index of ent under us. @@ -1666,7 +1667,7 @@ try nudging slightly on all axis to allow for the cut precision of the net coordinates ================= */ -#define PM_CHECKSTUCK_MINTIME 0.05 // Don't check again too quickly. +#define PM_CHECKSTUCK_MINTIME 0.05f // Don't check again too quickly. int PM_CheckStuck( void ) { @@ -1752,8 +1753,8 @@ int PM_CheckStuck( void ) if( pmove->cmd.buttons & ( IN_JUMP | IN_DUCK | IN_ATTACK ) && ( pmove->physents[hitent].player != 0 ) ) { float x, y, z; - float xystep = 8.0; - float zstep = 18.0; + float xystep = 8.0f; + float zstep = 18.0f; float xyminmax = xystep; float zminmax = 4 * zstep; @@ -1826,7 +1827,7 @@ void PM_SpectatorMove( void ) { drop = 0; - friction = pmove->movevars->friction * 1.5; // extra friction + friction = pmove->movevars->friction * 1.5f; // extra friction control = speed < pmove->movevars->stopspeed ? pmove->movevars->stopspeed : speed; drop += control * friction*pmove->frametime; @@ -2043,12 +2044,12 @@ void PM_Duck( void ) pmove->bInDuck = true; } - time = max( 0.0, ( 1.0 - (float)pmove->flDuckTime / 1000.0 ) ); + time = max( 0.0f, ( 1.0f - (float)pmove->flDuckTime / 1000.0f ) ); if( pmove->bInDuck ) { // Finish ducking immediately if duck time is over or not on ground - if( ( (float)pmove->flDuckTime / 1000.0 <= ( 1.0 - TIME_TO_DUCK ) ) || ( pmove->onground == -1 ) ) + if( ( (float)pmove->flDuckTime / 1000.0f <= ( 1.0f - TIME_TO_DUCK ) ) || ( pmove->onground == -1 ) ) { pmove->usehull = 1; pmove->view_ofs[2] = VEC_DUCK_VIEW; @@ -2074,7 +2075,7 @@ void PM_Duck( void ) float fMore = VEC_DUCK_HULL_MIN - VEC_HULL_MIN; // Calc parametric time - duckFraction = PM_SplineFraction( time, (1.0/TIME_TO_DUCK) ); + duckFraction = PM_SplineFraction( time, ( 1.0f / TIME_TO_DUCK ) ); pmove->view_ofs[2] = ( ( VEC_DUCK_VIEW - fMore ) * duckFraction ) + ( VEC_VIEW * ( 1 - duckFraction ) ); } } @@ -2116,7 +2117,7 @@ void PM_LadderMove( physent_t *pLadder ) pmove->gravity = 0; pmove->PM_TraceModel( pLadder, pmove->origin, ladderCenter, &trace ); - if( trace.fraction != 1.0 ) + if( trace.fraction != 1.0f ) { float forward = 0, right = 0; vec3_t vpn, v_right; @@ -2261,7 +2262,7 @@ void PM_AddGravity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Add gravity incorrectly pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime ); @@ -2289,7 +2290,7 @@ pmtrace_t PM_PushEntity( vec3_t push ) VectorCopy( trace.endpos, pmove->origin ); // So we can run impact function afterwards. - if( trace.fraction < 1.0 && !trace.allsolid ) + if( trace.fraction < 1.0f && !trace.allsolid ) { PM_AddToTouched( trace, pmove->velocity ); } @@ -2356,16 +2357,16 @@ void PM_Physics_Toss() } if( pmove->movetype == MOVETYPE_BOUNCE ) - backoff = 2.0 - pmove->friction; + backoff = 2.0f - pmove->friction; else if( pmove->movetype == MOVETYPE_BOUNCEMISSILE ) - backoff = 2.0; + backoff = 2.0f; else - backoff = 1; + backoff = 1.0f; PM_ClipVelocity( pmove->velocity, trace.plane.normal, pmove->velocity, backoff ); // stop if on ground - if( trace.plane.normal[2] > 0.7 ) + if( trace.plane.normal[2] > 0.7f ) { float vel; vec3_t base; @@ -2389,7 +2390,7 @@ void PM_Physics_Toss() } else { - VectorScale( pmove->velocity, ( 1.0 - trace.fraction) * pmove->frametime * 0.9, move ); + VectorScale( pmove->velocity, ( 1.0f - trace.fraction) * pmove->frametime * 0.9f, move ); trace = PM_PushEntity( move ); } VectorSubtract( pmove->velocity, base, pmove->velocity ) @@ -2461,7 +2462,7 @@ void PM_PreventMegaBunnyJumping( void ) if( spd <= maxscaledspeed ) return; - fraction = ( maxscaledspeed / spd ) * 0.65; //Returns the modifier for the velocity + fraction = ( maxscaledspeed / spd ) * 0.65f; //Returns the modifier for the velocity VectorScale( pmove->velocity, fraction, pmove->velocity ); //Crop it down!. } @@ -2566,7 +2567,7 @@ void PM_Jump( void ) } else { - PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 1.0 ); + PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 1.0f ); } // See if user can super long jump? @@ -2585,19 +2586,19 @@ void PM_Jump( void ) for( i = 0; i < 2; i++ ) { - pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6; + pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6f; } - pmove->velocity[2] = sqrt( 2 * 800 * 56.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 56.0f ); } else { - pmove->velocity[2] = sqrt( 2 * 800 * 45.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 45.0f ); } } else { - pmove->velocity[2] = sqrt( 2 * 800 * 45.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 45.0f ); } // Decay it for simulation @@ -2645,7 +2646,7 @@ void PM_CheckWaterJump( void ) VectorNormalize( flatforward ); // Are we backing into water from steps or something? If so, don't pop forward - if( curspeed != 0.0 && ( DotProduct( flatvelocity, flatforward ) < 0.0 ) ) + if( curspeed != 0.0f && ( DotProduct( flatvelocity, flatforward ) < 0.0f ) ) return; VectorCopy( pmove->origin, vecStart ); @@ -2657,14 +2658,14 @@ void PM_CheckWaterJump( void ) savehull = pmove->usehull; pmove->usehull = 2; tr = pmove->PM_PlayerTrace( vecStart, vecEnd, PM_NORMAL, -1 ); - if( tr.fraction < 1.0 && fabs( tr.plane.normal[2] ) < 0.1f ) // Facing a near vertical wall? + if( tr.fraction < 1.0f && fabs( tr.plane.normal[2] ) < 0.1f ) // Facing a near vertical wall? { vecStart[2] += pmove->player_maxs[savehull][2] - WJ_HEIGHT; VectorMA( vecStart, 24, flatforward, vecEnd ); VectorMA( vec3_origin, -50, tr.plane.normal, pmove->movedir ); tr = pmove->PM_PlayerTrace( vecStart, vecEnd, PM_NORMAL, -1 ); - if( tr.fraction == 1.0 ) + if( tr.fraction == 1.0f ) { pmove->waterjumptime = 2000; pmove->velocity[2] = 225; @@ -2681,7 +2682,7 @@ void PM_CheckFalling( void ) { if( pmove->onground != -1 && !pmove->dead && pmove->flFallVelocity >= PLAYER_FALL_PUNCH_THRESHHOLD ) { - float fvol = 0.5; + float fvol = 0.5f; if( pmove->waterlevel > 0 ) { @@ -2699,7 +2700,7 @@ void PM_CheckFalling( void ) pmove->PM_PlaySound( CHAN_VOICE, "player/pl_fallpain3.wav", 1, ATTN_NORM, 0, PITCH_NORM ); // break; //} - fvol = 1.0; + fvol = 1.0f; } else if( pmove->flFallVelocity > PLAYER_MAX_SAFE_FALL_SPEED / 2 ) { @@ -2718,7 +2719,7 @@ void PM_CheckFalling( void ) fvol = 0; } - if( fvol > 0.0 ) + if( fvol > 0.0f ) { // Play landing step right away pmove->flTimeStepSound = 0; @@ -2729,7 +2730,7 @@ void PM_CheckFalling( void ) PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), fvol ); // Knock the screen around a little bit, temporary effect - pmove->punchangle[2] = pmove->flFallVelocity * 0.013; // punch z axis + pmove->punchangle[2] = pmove->flFallVelocity * 0.013f; // punch z axis if( pmove->punchangle[0] > 8 ) { @@ -2819,8 +2820,8 @@ void PM_DropPunchAngle( vec3_t punchangle ) float len; len = VectorNormalize( punchangle ); - len -= ( 10.0 + len * 0.5 ) * pmove->frametime; - len = max( len, 0.0 ); + len -= ( 10.0f + len * 0.5f ) * pmove->frametime; + len = max( len, 0.0f ); VectorScale( punchangle, len, punchangle ); } @@ -2841,12 +2842,12 @@ void PM_CheckParamters( void ) spd = sqrt( spd ); maxspeed = pmove->clientmaxspeed; //atof( pmove->PM_Info_ValueForKey( pmove->physinfo, "maxspd" ) ); - if( maxspeed != 0.0 ) + if( maxspeed != 0.0f ) { pmove->maxspeed = min( maxspeed, pmove->maxspeed ); } - if( ( spd != 0.0 ) && ( spd > pmove->maxspeed ) ) + if( ( spd != 0.0f ) && ( spd > pmove->maxspeed ) ) { float fRatio = pmove->maxspeed / spd; pmove->cmd.forwardmove *= fRatio; @@ -2944,7 +2945,7 @@ void PM_PlayerMove( qboolean server ) pmove->numtouch = 0; // # of msec to apply movement - pmove->frametime = pmove->cmd.msec * 0.001; + pmove->frametime = pmove->cmd.msec * 0.001f; PM_ReduceTimers(); @@ -3126,7 +3127,7 @@ void PM_PlayerMove( qboolean server ) // we don't slow when standing still, relative to the conveyor. if( pmove->onground != -1 ) { - pmove->velocity[2] = 0.0; + pmove->velocity[2] = 0.0f; PM_Friction(); } @@ -3190,7 +3191,7 @@ void PM_CreateStuckTable( void ) // Little Moves. x = y = 0; // Z moves - for( z = -0.125; z <= 0.125; z += 0.125 ) + for( z = -0.125f; z <= 0.125f; z += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3199,7 +3200,7 @@ void PM_CreateStuckTable( void ) } x = z = 0; // Y moves - for( y = -0.125; y <= 0.125; y += 0.125 ) + for( y = -0.125f; y <= 0.125f; y += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3208,7 +3209,7 @@ void PM_CreateStuckTable( void ) } y = z = 0; // X moves - for( x = -0.125; x <= 0.125; x += 0.125 ) + for( x = -0.125f; x <= 0.125f; x += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3217,11 +3218,11 @@ void PM_CreateStuckTable( void ) } // Remaining multi axis nudges. - for( x = - 0.125; x <= 0.125; x += 0.250 ) + for( x = - 0.125f; x <= 0.125f; x += 0.250f ) { - for( y = - 0.125; y <= 0.125; y += 0.250 ) + for( y = - 0.125f; y <= 0.125f; y += 0.250f ) { - for( z = - 0.125; z <= 0.125; z += 0.250 ) + for( z = - 0.125f; z <= 0.125f; z += 0.250f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3250,7 +3251,7 @@ void PM_CreateStuckTable( void ) x = z = 0; // Y moves - for( y = -2.0f ; y <= 2.0f ; y += 2.0 ) + for( y = -2.0f; y <= 2.0f; y += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3259,7 +3260,7 @@ void PM_CreateStuckTable( void ) } y = z = 0; // X moves - for( x = -2.0f ; x <= 2.0f ; x += 2.0f ) + for( x = -2.0f; x <= 2.0f; x += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3274,7 +3275,7 @@ void PM_CreateStuckTable( void ) for( x = -2.0f; x <= 2.0f; x += 2.0f ) { - for( y = -2.0f; y <= 2.0f; y += 2.0 ) + for( y = -2.0f; y <= 2.0f; y += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; From 73397679c2be8794466d2396d6f53a1fd0d5609c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 17:12:41 +0500 Subject: [PATCH 028/298] More double promotion fixes. --- cl_dll/MOTD.cpp | 4 ++-- cl_dll/ammo.cpp | 2 +- cl_dll/ammo_secondary.cpp | 2 +- cl_dll/battery.cpp | 2 +- cl_dll/health.cpp | 2 +- cl_dll/hl/hl_weapons.cpp | 14 +++++++------- cl_dll/scoreboard.cpp | 6 +++--- dlls/apache.cpp | 2 +- dlls/ggrenade.cpp | 2 +- dlls/zombie.cpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index 439fb9c4..7059948a 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -80,9 +80,9 @@ int CHudMOTD::Draw( float fTime ) { ypos = ROW_RANGE_MIN + 7 + scroll; if( ypos > ROW_RANGE_MIN + 4 ) - scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0; + scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0f; if( ypos + height < ROW_RANGE_MAX ) - scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0; + scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0f; ypos_r = ROW_RANGE_MIN; height = ROW_RANGE_MAX; } diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index c6aabfba..7be34e23 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -864,7 +864,7 @@ int CHudAmmo::Draw( float flTime ) a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); UnpackRGB( r, g, b, RGB_YELLOWISH ); diff --git a/cl_dll/ammo_secondary.cpp b/cl_dll/ammo_secondary.cpp index 786f862d..4034c86f 100644 --- a/cl_dll/ammo_secondary.cpp +++ b/cl_dll/ammo_secondary.cpp @@ -63,7 +63,7 @@ int CHudAmmoSecondary::Draw( float flTime ) UnpackRGB( r, g, b, RGB_YELLOWISH ); a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); // slowly lower alpha to fade out icons ScaleColors( r, g, b, a ); AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index 7933dd6b..b6cd9e0b 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -91,7 +91,7 @@ int CHudBattery::Draw( float flTime ) if( m_fFade > FADE_TIME ) m_fFade = FADE_TIME; - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = 128; diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 10dc15af..998b4829 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -191,7 +191,7 @@ int CHudHealth::Draw( float flTime ) // Has health changed? Flash the health # if( m_fFade ) { - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = MIN_ALPHA; diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 8c1489fe..63e6f6d8 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -163,7 +163,7 @@ BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, i m_fInReload = TRUE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; return TRUE; } @@ -944,12 +944,12 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm pto->iuser3 = pCurrent->m_fireState; // Decrement weapon counters, server does this at same time ( during post think, after doing everything else ) - pto->m_flNextReload -= cmd->msec / 1000.0; - pto->m_fNextAimBonus -= cmd->msec / 1000.0; - pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0; - pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0; - pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0; - pto->fuser1 -= cmd->msec / 1000.0; + pto->m_flNextReload -= cmd->msec / 1000.0f; + pto->m_fNextAimBonus -= cmd->msec / 1000.0f; + pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0f; + pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0f; + pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0f; + pto->fuser1 -= cmd->msec / 1000.0f; to->client.vuser3[2] = pCurrent->m_iSecondaryAmmoType; to->client.vuser4[0] = pCurrent->m_iPrimaryAmmoType; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 3361aa0a..721980f3 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -171,12 +171,12 @@ int CHudScoreboard::Draw( float fTime ) DrawUtfString( PL_RANGE_MAX + xpos_rel - 35, ypos, ScreenWidth, "pkt loss", 255, 140, 0 ); } - list_slot += 1.2; + list_slot += 1.2f; ypos = ROW_RANGE_MIN + ( list_slot * ROW_GAP ); // xpos = NAME_RANGE_MIN + xpos_rel; FillRGBA( xpos - 4, ypos, FAR_RIGHT -2, 1, 255, 140, 0, 255 ); // draw the seperator line - list_slot += 0.8; + list_slot += 0.8f; if( !gHUD.m_Teamplay ) { @@ -328,7 +328,7 @@ int CHudScoreboard::Draw( float fTime ) } // draw all the players who are not in a team - list_slot += 0.5; + list_slot += 0.5f; DrawPlayers( xpos_rel, list_slot, 0, "" ); return 1; diff --git a/dlls/apache.cpp b/dlls/apache.cpp index 669724db..a863e3c2 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -668,7 +668,7 @@ void CApache::Flight( void ) { // ALERT( at_console, "F " ); // lean forward - pev->avelocity.x -= 12.0; + pev->avelocity.x -= 12.0f; } else if( flDist < 0.0f && flSpeed > -50.0f && pev->angles.x + pev->avelocity.x < 20.0f ) { diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index f50abe98..60b658b9 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -243,7 +243,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // or thrown very far tend to slow down too quickly for me to always catch just by testing velocity. // trimming the Z velocity a bit seems to help quite a bit. vecTestVelocity = pev->velocity; - vecTestVelocity.z *= 0.45; + vecTestVelocity.z *= 0.45f; if( !m_fRegisteredSound && vecTestVelocity.Length() <= 60 ) { diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 96f032e6..7f891a36 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -136,11 +136,11 @@ int CZombie::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float // Take 30% damage from bullets if( bitsDamageType == DMG_BULLET ) { - Vector vecDir = pev->origin - (pevInflictor->absmin + pevInflictor->absmax) * 0.5; + Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5f; vecDir = vecDir.Normalize(); float flForce = DamageForce( flDamage ); pev->velocity = pev->velocity + vecDir * flForce; - flDamage *= 0.3; + flDamage *= 0.3f; } // HACK HACK -- until we fix this. From a9f37f6d749709a54e763b34aaa14975af65ebd6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 18:37:32 +0500 Subject: [PATCH 029/298] Include tgmath.h and cmath headers. --- cl_dll/GameStudioModelRenderer.cpp | 2 +- cl_dll/GameStudioModelRenderer_Sample.cpp | 2 +- cl_dll/StudioModelRenderer.cpp | 2 +- cl_dll/health.cpp | 6 +++--- cl_dll/hud_redraw.cpp | 3 ++- cl_dll/hud_update.cpp | 2 +- cl_dll/util.cpp | 6 +++--- cl_dll/util_vector.h | 6 +++--- common/mathlib.h | 7 +++++++ dlls/extdll.h | 8 ++++---- pm_shared/pm_debug.c | 6 +++++- pm_shared/pm_math.c | 8 +++++--- pm_shared/pm_shared.c | 14 +++++++++----- 13 files changed, 45 insertions(+), 27 deletions(-) diff --git a/cl_dll/GameStudioModelRenderer.cpp b/cl_dll/GameStudioModelRenderer.cpp index 570b3375..f32def43 100644 --- a/cl_dll/GameStudioModelRenderer.cpp +++ b/cl_dll/GameStudioModelRenderer.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/GameStudioModelRenderer_Sample.cpp b/cl_dll/GameStudioModelRenderer_Sample.cpp index ee8e8f9c..8910d809 100644 --- a/cl_dll/GameStudioModelRenderer_Sample.cpp +++ b/cl_dll/GameStudioModelRenderer_Sample.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index 826ab9e7..5350ad10 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 998b4829..6540671e 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -18,9 +18,9 @@ // implementation of CHudHealth class // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 17f2d7dd..579c0897 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -15,7 +15,8 @@ // // hud_redraw.cpp // -#include +#include + #include "hud.h" #include "cl_util.h" //#include "triangleapi.h" diff --git a/cl_dll/hud_update.cpp b/cl_dll/hud_update.cpp index cecbb625..f431bbaf 100644 --- a/cl_dll/hud_update.cpp +++ b/cl_dll/hud_update.cpp @@ -16,7 +16,7 @@ // hud_update.cpp // -#include +#include #include "hud.h" #include "cl_util.h" #include diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index fb03792c..8d05e914 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -18,9 +18,9 @@ // implementation of class-less helper functions // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" diff --git a/cl_dll/util_vector.h b/cl_dll/util_vector.h index 477d97be..93166a6b 100644 --- a/cl_dll/util_vector.h +++ b/cl_dll/util_vector.h @@ -20,9 +20,9 @@ #define UTIL_VECTOR_H // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include // Header file containing definition of globalvars_t and entvars_t typedef unsigned int func_t; // diff --git a/common/mathlib.h b/common/mathlib.h index 999efc35..e5e413df 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -16,7 +16,14 @@ #pragma once #ifndef MATHLIB_H #define MATHLIB_H +#ifndef __cplusplus #include +#ifdef HAVE_TGMATH_H +#include +#endif // HAVE_TGMATH_H +#else // __cplusplus +#include +#endif // __cplusplus typedef float vec_t; typedef vec_t vec2_t[2]; diff --git a/dlls/extdll.h b/dlls/extdll.h index 793c4a52..22f5bfee 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -60,10 +60,10 @@ typedef int BOOL; #endif //_WIN32 // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "stddef.h" -#include "math.h" +#include +#include +#include +#include #ifndef M_PI_F #define M_PI_F (float)M_PI diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index a0c9b948..fbe1e288 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -12,8 +12,12 @@ * without written permission from Valve LLC. * ****/ - +#include #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index d5eefd37..634839c1 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -13,10 +13,12 @@ * ****/ // pm_math.c -- math primitives - -#include "mathlib.h" -#include "const.h" #include +#include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif +#include "const.h" // up / down #define PITCH 0 diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 6c5aef43..01825777 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -14,18 +14,22 @@ ****/ #include +//#include // NULL +#include // sqrt +#include // strcpy +#include // atoi +#include // isspace #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" #include "pm_shared.h" #include "pm_movevars.h" #include "pm_debug.h" -//#include // NULL -#include // sqrt -#include // strcpy -#include // atoi -#include // isspace int g_bhopcap = 1; From 11adcd5ac886660201928384ecf242eebb36467a Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 20:58:14 +0500 Subject: [PATCH 030/298] cmake: Add check for tgmath.h header. --- cl_dll/CMakeLists.txt | 5 +++++ dlls/CMakeLists.txt | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 1143eefe..3e5b7dbf 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -25,6 +25,11 @@ project (CLDLL) set (CLDLL_LIBRARY client) +include(CheckIncludeFile) +check_include_file("tgmath.h" HAVE_TGMATH_H) +if(HAVE_TGMATH_H) + add_definitions(-DHAVE_TGMATH_H) +endif() add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index ccaa0279..9baf9479 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -25,6 +25,12 @@ project (SVDLL) set (SVDLL_LIBRARY server) +include(CheckIncludeFile) +check_include_file("tgmath.h" HAVE_TGMATH_H) +if(HAVE_TGMATH_H) + add_definitions(-DHAVE_TGMATH_H) +endif() + add_definitions(-DCLIENT_WEAPONS) if(NOT MSVC) From 23a9ab7b4bfa54aafcf26a689b82caedf5f40700 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 21:00:38 +0500 Subject: [PATCH 031/298] wscript: add check for tgmath.h header. --- wscript | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wscript b/wscript index f3b268f0..cd8dbae7 100644 --- a/wscript +++ b/wscript @@ -198,6 +198,10 @@ def configure(conf): conf.env.append_unique('CXXFLAGS', cxxflags) conf.env.append_unique('LINKFLAGS', linkflags) + # check if we can use C99 tgmath + if conf.check_cc(header_name='tgmath.h', mandatory=False): + conf.env.define('HAVE_TGMATH_H', 1) + if conf.env.COMPILER_CC == 'msvc': conf.define('_CRT_SECURE_NO_WARNINGS', 1) conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) From e03f5e3c3e77227ef826e911bfdae9c8a2ab12a9 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 21:15:06 +0500 Subject: [PATCH 032/298] Remove useless prototypes. --- cl_dll/util.cpp | 2 -- pm_shared/pm_math.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index 8d05e914..cda9fdf4 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -40,8 +40,6 @@ extern vec3_t vec3_origin; vec3_t vec3_origin; #endif -double sqrt( double x ); - float Length( const float *v ) { int i; diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index 634839c1..87c65d9f 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -305,8 +305,6 @@ void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross ) cross[2] = v1[0] * v2[1] - v1[1] * v2[0]; } -double sqrt( double x ); - float Length( const vec3_t v ) { int i; From 5869d67d9948d83530bda68db12e5b69e080dbca Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 15 Oct 2019 07:58:33 +0300 Subject: [PATCH 033/298] Don't show rpg laser spot when player using func_tank --- dlls/rpg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index fe1fd8a9..f2a7b758 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -535,6 +535,9 @@ void CRpg::UpdateSpot( void ) #ifndef CLIENT_DLL if( m_fSpotActive ) { + if (m_pPlayer->pev->viewmodel == 0) + return; + if( !m_pSpot ) { m_pSpot = CLaserSpot::CreateSpot(); From ae6299f636c19660bb3eef96d539b3d3aef3180d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 15 Oct 2019 22:16:49 +0300 Subject: [PATCH 034/298] wscript: use taskgen counter to solve problem with compiling shared code instead of hardcoding indexes --- cl_dll/wscript | 2 +- dlls/wscript | 2 +- wscript | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 3ada920a..fb14661d 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -62,5 +62,5 @@ def build(bld): use = libs, install_path = install_path, subsystem = bld.env.MSVC_SUBSYSTEM, - idx = 1 + idx = bld.get_taskgen_count() ) diff --git a/dlls/wscript b/dlls/wscript index b1c8cffa..5fb8dc02 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -68,5 +68,5 @@ def build(bld): use = libs, install_path = install_path, subsystem = bld.env.MSVC_SUBSYSTEM, - idx = 2 + idx = bld.get_taskgen_count() ) diff --git a/wscript b/wscript index f3b268f0..937de04a 100644 --- a/wscript +++ b/wscript @@ -13,6 +13,12 @@ top = '.' Context.Context.line_just = 55 # should fit for everything on 80x26 +@Configure.conf +def get_taskgen_count(self): + try: idx = self.tg_idx_count + except: idx = 0 # don't set tg_idx_count to not increase counter + return idx + def options(opt): grp = opt.add_option_group('Common options') From 3fcc119275fc13037dcb9ce110192cac91f220b0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 16 Oct 2019 01:49:02 +0300 Subject: [PATCH 035/298] Place rapid crowbar fix under a macro --- dlls/crowbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index e08a64fb..2ff537fc 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -288,7 +288,9 @@ int CCrowbar::Swing( int fFirst ) m_pPlayer->m_iWeaponVolume = CROWBAR_BODYHIT_VOLUME; if( !pEntity->IsAlive() ) { +#ifdef CROWBAR_FIX_RAPID_CROWBAR m_flNextPrimaryAttack = GetNextAttackDelay(0.25); +#endif return TRUE; } else From c96794aa2dfd3120b8a133555c7192a9e527edc1 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 16 Oct 2019 01:51:48 +0300 Subject: [PATCH 036/298] Place crowbar delay fix under a macro --- dlls/crowbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 735b47ff..66d8266e 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -330,7 +330,11 @@ int CCrowbar::Swing( int fFirst ) SetThink( &CCrowbar::Smack ); pev->nextthink = UTIL_WeaponTimeBase() + 0.2; #endif +#if CROWBAR_DELAY_FIX m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; +#else + m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 ); +#endif } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); From b00170a0a26f86f8ac8e46cb0d8ebb8f2d26a2a1 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 26 Oct 2019 15:48:49 +0300 Subject: [PATCH 037/298] Support compiling with GCC 3.4.3 --- common/com_model.h | 4 ++-- common/mathlib.h | 4 +--- dlls/extdll.h | 7 +++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/common/com_model.h b/common/com_model.h index abc8e8e6..631373fc 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -173,7 +173,7 @@ typedef struct mleaf_s } mleaf_t; -typedef struct msurface_s +struct msurface_s { int visframe; // should be drawn when node is crossed @@ -205,7 +205,7 @@ typedef struct msurface_s color24 *samples; // note: this is the actual lightmap data for this surface decal_t *pdecals; -} msurface_t; +}; typedef struct msurfmesh_s { diff --git a/common/mathlib.h b/common/mathlib.h index 6bcf76eb..5a1cd0b0 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -19,14 +19,12 @@ #include typedef float vec_t; -typedef vec_t vec2_t[2]; -#ifndef DID_VEC3_T_DEFINE +#if !defined DID_VEC3_T_DEFINE #define DID_VEC3_T_DEFINE typedef vec_t vec3_t[3]; #endif -typedef vec_t vec4_t[4]; // x,y,z,w #ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h diff --git a/dlls/extdll.h b/dlls/extdll.h index 4610db5e..cded1754 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -51,12 +51,15 @@ #ifndef TRUE #define TRUE (!FALSE) #endif +#include +#include typedef unsigned int ULONG; typedef unsigned char BYTE; typedef int BOOL; #define MAX_PATH PATH_MAX -#include -#include +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #endif //_WIN32 // Misc C-runtime library headers From aa7b5dc5cab90ddbd10855e9038a0fda5b29d717 Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Wed, 30 Oct 2019 09:28:15 +0000 Subject: [PATCH 038/298] Build: Fixed issues on Windows in_camera.o wouldn't link because of unresolved symbols relating to getting/setting the cursor position, so user32.lib was added as a dependency. The gitignore was also missing ignore rules for different waf folder name variations, and the .vscode directory for people (like me) who use VS Code. --- .gitignore | 4 ++++ cl_dll/wscript | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index adcc4f7b..3d6ad540 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,9 @@ cmake_install.cmake *.vsproj *.sln .waf-* +waf-* +.waf3-* +waf3-* .lock* *.pyc +.vscode/ \ No newline at end of file diff --git a/cl_dll/wscript b/cl_dll/wscript index fb14661d..02a9d530 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -4,15 +4,17 @@ from waflib import Utils import os - + def options(opt): # stub return def configure(conf): - if conf.env.GOLDSRC: - if conf.env.DEST_OS != 'win32': - conf.check_cc(lib='dl') + 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' ) def build(bld): source = bld.path.parent.ant_glob([ @@ -45,9 +47,12 @@ def build(bld): defines += ['GOLDSOURCE_SUPPORT'] libs = [] - if bld.env.GOLDSRC: + if bld.env.GOLDSRC and bld.env.DEST_OS != 'win32': libs += ['DL'] + if bld.env.DEST_OS == 'win32': + libs += ["USER32"] + if bld.env.DEST_OS not in ['android']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) else: From 71afe6e2043929feb6fe66835d7ada932e0937da Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Wed, 30 Oct 2019 13:36:05 +0000 Subject: [PATCH 039/298] Build: Added user32.lib dependency to CMake Also had to add ResetThink to cbase.h, as it was missing in deug. --- cl_dll/CMakeLists.txt | 4 ++++ dlls/cbase.h | 1 + 2 files changed, 5 insertions(+) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 1143eefe..c660f203 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -125,6 +125,10 @@ if (GOLDSOURCE_SUPPORT) target_link_libraries( ${CLDLL_LIBRARY} ${CMAKE_DL_LIBS} ) endif() +if(WIN32) + target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) +endif() + set_target_properties (${CLDLL_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE 1) diff --git a/dlls/cbase.h b/dlls/cbase.h index e200d7b0..a15638ab 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -363,6 +363,7 @@ public: #define SetTouch( a ) TouchSet( static_cast (a), #a ) #define SetUse( a ) UseSet( static_cast (a), #a ) #define SetBlocked( a ) BlockedSet( static_cast (a), #a ) +#define ResetThink() SetThink(NULL) #else From 1bc65c15f55e0dda2a13b6b20f4d7fc309d97834 Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Thu, 31 Oct 2019 08:14:36 +0000 Subject: [PATCH 040/298] Build: Fixed GiveFnptrsToDll not being found on Windows Also fixed server DLL being named server.dll instead of hl.dll. --- dlls/wscript | 19 +++++++++++++------ wscript | 19 +++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dlls/wscript b/dlls/wscript index 5fb8dc02..7d21da55 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -4,21 +4,28 @@ from waflib import Utils import os - + def options(opt): # stub return def configure(conf): - # stub - return + if conf.env.DEST_OS == 'win32': + # hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows. + # Without this, the lookup for this function fails. + hlDefNode = conf.path.find_resource("./hl.def") + + if hlDefNode is not None: + conf.env.append_unique('LINKFLAGS', f'/def:{hlDefNode.abspath()}') + else: + conf.fatal("Could not find hl.def") def build(bld): defines = [] source = bld.path.parent.ant_glob([ 'pm_shared/*.c', ]) - + source += [ 'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp', 'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp', @@ -42,7 +49,7 @@ def build(bld): 'triggers.cpp', 'tripmine.cpp', 'turret.cpp', 'util.cpp', 'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp'] - + if bld.env.VOICEMGR: source += bld.path.parent.ant_glob([ 'game_shared/voice_gamemgr.cpp', @@ -61,7 +68,7 @@ def build(bld): bld.shlib( source = source, - target = 'server', + target = bld.env.SERVER_NAME, features = 'c cxx', includes = includes, defines = defines, diff --git a/wscript b/wscript index 937de04a..cfa11ec0 100644 --- a/wscript +++ b/wscript @@ -33,21 +33,20 @@ def options(opt): grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False, help = 'enable GoldSource engine support [default: %default]') - + grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, help = 'enable Link Time Optimization [default: %default]') grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, help = 'enable polyhedral optimization if possible [default: %default]') - - opt.recurse('cl_dll dlls') - opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install') + if sys.platform == 'win32': opt.load('msvc msdev msvs') - opt.load('reconfigure') + opt.load('reconfigure subproject') + opt.add_subproject(["cl_dll", "dlls"]) def configure(conf): # Configuration @@ -220,10 +219,10 @@ def configure(conf): conf.define('CLIENT_WEAPONS', '1') - conf.recurse('cl_dll dlls') + conf.add_subproject(["cl_dll", "dlls"]) def build(bld): - bld.recurse('cl_dll dlls') - - - + bld.add_subproject(["cl_dll", "dlls"]) + + + From a8669459b9ed88a09c99f0a4ba4fc08ed8a5208d Mon Sep 17 00:00:00 2001 From: Jonathan Poncelet Date: Thu, 31 Oct 2019 13:15:44 +0000 Subject: [PATCH 041/298] Build: Swapped Win32 check for MSVC check The linker flag is only relevant to MSVC. --- dlls/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wscript b/dlls/wscript index 7d21da55..250761e1 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -10,7 +10,7 @@ def options(opt): return def configure(conf): - if conf.env.DEST_OS == 'win32': + if conf.env.COMPILER_CC == 'msvc': # hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows. # Without this, the lookup for this function fails. hlDefNode = conf.path.find_resource("./hl.def") From 682c1c6da97da447f9807e90ab7d83f77bc59d4b Mon Sep 17 00:00:00 2001 From: Aimless-Wanderer <53096779+Aimless-Wanderer@users.noreply.github.com> Date: Thu, 31 Oct 2019 18:13:22 +0200 Subject: [PATCH 042/298] build: fix travis ci I think travis is still using Python 3.4.*, so f-strings are not supported yet and android engine doesn't build. --- dlls/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wscript b/dlls/wscript index 250761e1..b285efa3 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -16,7 +16,7 @@ def configure(conf): hlDefNode = conf.path.find_resource("./hl.def") if hlDefNode is not None: - conf.env.append_unique('LINKFLAGS', f'/def:{hlDefNode.abspath()}') + conf.env.append_unique('LINKFLAGS', '/def:{}'.format(hlDefNode.abspath())) else: conf.fatal("Could not find hl.def") From b604d86f04a78974c02d47049c80e1ccc784a58c Mon Sep 17 00:00:00 2001 From: Aimless-Wanderer <53096779+Aimless-Wanderer@users.noreply.github.com> Date: Fri, 1 Nov 2019 11:17:12 +0200 Subject: [PATCH 043/298] Update wscript --- dlls/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wscript b/dlls/wscript index b285efa3..e5268e05 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -16,7 +16,7 @@ def configure(conf): hlDefNode = conf.path.find_resource("./hl.def") if hlDefNode is not None: - conf.env.append_unique('LINKFLAGS', '/def:{}'.format(hlDefNode.abspath())) + conf.env.append_unique('LINKFLAGS', '/def:%s' % hlDefNode.abspath()) else: conf.fatal("Could not find hl.def") From 88161eac14e30a782a7819792269542e6eed87c1 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 3 Nov 2019 22:59:33 +0500 Subject: [PATCH 044/298] Add "cl_autowepswitch" cvar implementation. --- cl_dll/hud.cpp | 1 + dlls/client.cpp | 1 + dlls/gamerules.cpp | 5 +++++ dlls/gamerules.h | 2 +- dlls/multiplay_gamerules.cpp | 5 +++++ dlls/player.cpp | 14 ++++++++++++++ dlls/player.h | 6 +++++- dlls/singleplay_gamerules.cpp | 5 +++++ dlls/teamplay_gamerules.cpp | 2 ++ 9 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 62c32b41..d408c415 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -191,6 +191,7 @@ void CHud::Init( void ) m_iFOV = 0; CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); + CVAR_CREATE( "cl_autowepswitch", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); default_fov = CVAR_CREATE( "default_fov", "90", 0 ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); diff --git a/dlls/client.cpp b/dlls/client.cpp index f96302d0..a8031df0 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -196,6 +196,7 @@ void ClientPutInServer( edict_t *pEntity ) pPlayer = GetClassPtr( (CBasePlayer *)pev ); pPlayer->SetCustomDecalFrames( -1 ); // Assume none; + pPlayer->SetPrefsFromUserinfo( g_engfuncs.pfnGetInfoKeyBuffer( pEntity ) ); // Allocate a CBasePlayer for pev, and call spawn pPlayer->Spawn(); diff --git a/dlls/gamerules.cpp b/dlls/gamerules.cpp index f59788c4..bfbbf59e 100644 --- a/dlls/gamerules.cpp +++ b/dlls/gamerules.cpp @@ -303,6 +303,11 @@ void CGameRules::RefreshSkillData ( void ) gSkillData.plrArm = GetSkillCvar( "sk_player_arm" ); } +void CGameRules::ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ) +{ + pPlayer->SetPrefsFromUserinfo( infobuffer ); +} + //========================================================= // instantiate the proper game rules object //========================================================= diff --git a/dlls/gamerules.h b/dlls/gamerules.h index 04c6eea5..22c73a47 100644 --- a/dlls/gamerules.h +++ b/dlls/gamerules.h @@ -98,7 +98,7 @@ public: virtual BOOL AllowAutoTargetCrosshair( void ) { return TRUE; }; virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) { return FALSE; }; // handles the user commands; returns TRUE if command handled properly - virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ) {} // the player has changed userinfo; can change it now + virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ); // the player has changed userinfo; can change it now // Client kills/scoring virtual int IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKilled ) = 0;// how many points do I award whoever kills this player? diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 8305a07f..90dc4f3b 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -319,6 +319,11 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI return TRUE; } + if( !pPlayer->m_iAutoWepSwitch ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { // can't put away the active item. diff --git a/dlls/player.cpp b/dlls/player.cpp index 43d1d28e..a47fda24 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2876,6 +2876,8 @@ void CBasePlayer::Spawn( void ) m_flNextChatTime = gpGlobals->time; + m_iAutoWepSwitch = 1; + g_pGameRules->PlayerSpawn( this ); } @@ -4158,6 +4160,18 @@ int CBasePlayer::Illumination( void ) return iIllum; } +void CBasePlayer::SetPrefsFromUserinfo( char *infobuffer ) +{ + const char *pszKeyVal; + + pszKeyVal = g_engfuncs.pfnInfoKeyValue( infobuffer, "cl_autowepswitch" ); + + if( pszKeyVal[0] != '\0' ) + m_iAutoWepSwitch = atoi( pszKeyVal ); + else + m_iAutoWepSwitch = 1; +} + void CBasePlayer::EnableControl( BOOL fControl ) { if( !fControl ) diff --git a/dlls/player.h b/dlls/player.h index 15f1538a..571a025d 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -312,7 +312,7 @@ public: float m_flPlayAftershock; float m_flNextAmmoBurn;// while charging, when to absorb another unit of player's ammo? - //Player ID + // Player ID void InitStatusBar( void ); void UpdateStatusBar( void ); int m_izSBarState[SBAR_END]; @@ -321,8 +321,12 @@ public: char m_SbarString0[SBAR_STRING_SIZE]; char m_SbarString1[SBAR_STRING_SIZE]; + void SetPrefsFromUserinfo( char *infobuffer ); + float m_flNextChatTime; + int m_iAutoWepSwitch; + Vector m_vecLastViewAngles; bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message. diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 9a46e722..7f722e30 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -75,6 +75,11 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem return TRUE; } + if( !pPlayer->m_iAutoWepSwitch ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { return FALSE; diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index d3b5c5e3..ea733fa4 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -357,6 +357,8 @@ void CHalfLifeTeamplay::ClientUserInfoChanged( CBasePlayer *pPlayer, char *infob // recound stuff RecountTeams( TRUE ); + + pPlayer->SetPrefsFromUserinfo( infobuffer ); } extern int gmsgDeathMsg; From b8f2d8c972d3011c3d169bb4f819374ca1b29f09 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 4 Nov 2019 00:05:51 +0500 Subject: [PATCH 045/298] client: make some cvars archive. --- cl_dll/death.cpp | 2 +- cl_dll/hud.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index c6631f71..d2c41e38 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -71,7 +71,7 @@ int CHudDeathNotice::Init( void ) HOOK_MESSAGE( DeathMsg ); - CVAR_CREATE( "hud_deathnotice_time", "6", 0 ); + CVAR_CREATE( "hud_deathnotice_time", "6", FCVAR_ARCHIVE ); return 1; } diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index d408c415..9652770d 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -190,9 +190,9 @@ void CHud::Init( void ) m_iLogo = 0; m_iFOV = 0; - CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); + CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", FCVAR_ARCHIVE ); CVAR_CREATE( "cl_autowepswitch", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); - default_fov = CVAR_CREATE( "default_fov", "90", 0 ); + default_fov = CVAR_CREATE( "default_fov", "90", FCVAR_ARCHIVE ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); From 46f5f21392271081c714f5d10b2f6b4fc90cdce0 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 4 Nov 2019 00:31:52 +0500 Subject: [PATCH 046/298] Fix mp5's bullet spread. --- dlls/mp5.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 426f738a..e787b4e5 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -151,9 +151,9 @@ void CMP5::PrimaryAttack() Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES ); Vector vecDir; #ifdef CLIENT_DLL - if( !bIsMultiplayer() ) + if( bIsMultiplayer() ) #else - if( !g_pGameRules->IsMultiplayer() ) + if( g_pGameRules->IsMultiplayer() ) #endif { // optimized multiplayer. Widened to make it easier to hit a moving player From e976cf2de458b0d7e5d7c88e56642334411dbb4b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Tue, 5 Nov 2019 02:44:02 +0500 Subject: [PATCH 047/298] wscript: Use better check for tgmath.h. --- wscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index cd8dbae7..d7d84466 100644 --- a/wscript +++ b/wscript @@ -200,7 +200,12 @@ def configure(conf): # check if we can use C99 tgmath if conf.check_cc(header_name='tgmath.h', mandatory=False): - conf.env.define('HAVE_TGMATH_H', 1) + tgmath_usable = conf.check_cc(fragment='''#include + int main(void){ return (int)sin(2.0f); }''', + msg='Checking if tgmath.h is usable', mandatory=False): + conf.define_cond('HAVE_TGMATH_H', tgmath_usable) + else: + conf.undefine('HAVE_TGMATH_H') if conf.env.COMPILER_CC == 'msvc': conf.define('_CRT_SECURE_NO_WARNINGS', 1) From 6e8cb1db2ea607227a319148432a61734a698994 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2019 02:35:15 +0300 Subject: [PATCH 048/298] waf: update to latest waifu revision --- waf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/waf b/waf index 53213cb6..ee4820ed 100755 --- a/waf +++ b/waf @@ -33,12 +33,12 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect VERSION="2.0.18" -REVISION="ff338576c6abcf8ea755ffa7e678f790" -GIT="6539bd1ad3e285b124c02859ee5862dbd80704b7" +REVISION="b10d031bad536f1fd766be4ad9ee5a86" +GIT="00501901eb8ea3051ac023e804f9d572ddb61d89" INSTALL='' -C1='#[' -C2='#E' -C3='#2' +C1='#h' +C2='#_' +C3='#/' cwd = os.getcwd() join = os.path.join @@ -163,10 +163,13 @@ wafdir = find_lib() sys.path.insert(0, wafdir) if __name__ == '__main__': + from waflib import Context + Context.WAFNAME='waifu' + Context.WAIFUVERSION='1.1.0' sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', 'waifulib')) from waflib import Scripting Scripting.waf_entry_point(cwd, VERSION, wafdir) #==> -#BZh91AY&SY܋HP},Ƭ#200ebV{#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2#2׍Q{=hMOrw4fgTO/h]ZVO [X4>|lM<{T:of{]@b 7ozꮀg|9}9绽ës[Y#2}ww^n|G{ET}a{ok]ө{d3n&&ڷ4>Cvns.۷|#f6uѧ_ns;׫nNrvGu^7ιOlO{p4ne,=^^w6.wc)#2@&HQ#[!]`3n_E/sz)]75dvZ:uu]ΪlVix#2#2wQ#2*{sX{َ)آG9Ǜqb}g]Aڙnt5zz}y#2$zanfucjsvpz0:}=d6^}gO[ٞnv͆Cg|]9=s^y_dمl#E(V.Oz6[@8gK˦4*}ڸﻟ}#2;tݺZ#E*p6{]#[=m^3N7빰租UZrPzt==4't݈RvθwԞ 9]{|#2ac @DZ|4#2@ #2 #2#24D#2FOM@zCM4PjzS@ ! A2 CS&G&&1hh#2#2#2#2#2#2H 44ЙG钣4iiOQ#[im=h#2#2#2#2#2#2$JHjijOM50 SLSOP4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# 6Zv 䈙7J#X1Þ9:7 6@"1 b>T@(Ix4;>謹lɵ^^#_rØSPKJ?`ޝ-J#_#_ >/G*`: wܪlR3OR\>(@?~/473OdɑB`I``݇ǧ_솠Z#_ "(H? #<== From d3ad80a14cd07d606b485a3669911b4a54ed9f94 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2019 02:36:19 +0300 Subject: [PATCH 049/298] wscript: motomagx changes --- wscript | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index c93885e8..16ec63df 100644 --- a/wscript +++ b/wscript @@ -40,6 +40,9 @@ def options(opt): grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, help = 'enable polyhedral optimization if possible [default: %default]') + grp.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, + help = 'enable targetting for MotoMAGX phones [default: %default]') + opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install') if sys.platform == 'win32': @@ -58,13 +61,16 @@ def configure(conf): conf.load('fwgslib reconfigure') + enforce_pic = True # modern defaults + valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] + conf.load('fwgslib reconfigure') conf.start_msg('Build type') if conf.options.BUILD_TYPE == None: conf.end_msg('not set', color='RED') conf.fatal('Please set a build type, for example "-T release"') - elif not conf.options.BUILD_TYPE in ['fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none']: + elif not conf.options.BUILD_TYPE in valid_build_types: conf.end_msg(conf.options.BUILD_TYPE, color='RED') - conf.fatal('Invalid build type. Valid are "debug", "release" or "none"') + conf.fatal('Invalid build type. Valid are: %s' % valid_build_types.join(', ')) conf.end_msg(conf.options.BUILD_TYPE) # -march=native should not be used @@ -86,6 +92,21 @@ def configure(conf): if conf.env.DEST_OS == 'android': conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified + + 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') # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture # Because compatibility with original GoldSrc @@ -114,10 +135,19 @@ def configure(conf): # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'], - 'gcc': ['-g', '-fvisibility=hidden'] + 'gcc': ['-g'] }, 'fast': { - 'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG + 'msvc': ['/O2', '/Oy'], + 'gcc': { + '3': ['-O3', '-Os', '-funsafe-math-optimizations', '-fomit-frame-pointer'], + 'default': ['-Ofast', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'] + }, + 'clang': ['-Ofast'], + 'default': ['-O3'] + }, + 'fastnative': { + 'msvc': ['/O2', '/Oy'], 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], 'clang': ['-Ofast', '-march=native'], 'default': ['-O3'] From 76c2f902496914db96570b9296ec2a5cff19e142 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2019 04:51:16 +0300 Subject: [PATCH 050/298] wscript: workaround bug when CC_VERSION is not set for msvc --- wscript | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 16ec63df..04c2a6d8 100644 --- a/wscript +++ b/wscript @@ -89,6 +89,11 @@ def configure(conf): conf.load('msvc msdev') conf.load('xcompile compiler_c compiler_cxx strip_on_install') + try: + conf.env.CC_VERSION[0] + except IndexError: + conf.env.CC_VERSION = (0, ) + if conf.env.DEST_OS == 'android': conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified @@ -192,8 +197,8 @@ def configure(conf): '-Werror=declaration-after-statement' ] - linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC) - cflags = conf.get_flags_by_type(compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC) + linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + cflags = conf.get_flags_by_type(compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) # Here we don't differentiate C or C++ flags if conf.options.LTO: From e068ebf61079fdfcd4755b838d89c81b335a4488 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2019 05:00:43 +0300 Subject: [PATCH 051/298] wscript: fix typo --- wscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 04c2a6d8..af830e72 100644 --- a/wscript +++ b/wscript @@ -242,8 +242,8 @@ def configure(conf): if conf.check_cc(header_name='tgmath.h', mandatory=False): tgmath_usable = conf.check_cc(fragment='''#include int main(void){ return (int)sin(2.0f); }''', - msg='Checking if tgmath.h is usable', mandatory=False): - conf.define_cond('HAVE_TGMATH_H', tgmath_usable) + msg='Checking if tgmath.h is usable', mandatory=False) + conf.define_cond('HAVE_TGMATH_H', tgmath_usable) else: conf.undefine('HAVE_TGMATH_H') From f9b361c77e48c87ec4623d2dc4b9257e836a0627 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 7 Nov 2019 07:49:44 +0300 Subject: [PATCH 052/298] waifulib: xcompile: we need to disable builtins even on armeabi with host compiler and NDK r10e --- scripts/waifulib/xcompile.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index a7818911..2872306f 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -248,6 +248,19 @@ class Android: if cxx and not self.is_clang() and self.toolchain not in ['4.8','4.9']: cflags += ['-fno-sized-deallocation'] + def fixup_host_clang_with_old_ndk(): + cflags = [] + # Clang builtin redefine w/ different calling convention bug + # NOTE: I did not added complex.h functions here, despite + # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex + # math functions + # I personally don't need complex numbers support, but if you want it + # just run sed to patch header + for f in ['strtod', 'strtof', 'strtold']: + cflags += ['-fno-builtin-%s' % f] + return cflags + + if self.is_arm(): if self.arch == 'armeabi-v7a': # ARMv7 support @@ -256,21 +269,17 @@ class Android: if not self.is_clang() and not self.is_host(): cflags += [ '-mvectorize-with-neon-quad' ] + if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: + cflags += fixup_host_clang_with_old_ndk() + if self.is_hardfp(): cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] - - if self.is_host(): - # Clang builtin redefine w/ different calling convention bug - # NOTE: I did not added complex.h functions here, despite - # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex - # math functions - # I personally don't need complex numbers support, but if you want it - # just run sed to patch header - for f in ['strtod', 'strtof', 'strtold']: - cflags += ['-fno-builtin-%s' % f] else: cflags += ['-mfloat-abi=softfp'] else: + if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: + cflags += fixup_host_clang_with_old_ndk() + # ARMv5 support cflags += ['-march=armv5te', '-mtune=xscale', '-msoft-float'] elif self.is_x86(): From 446f608cf3eeea921e4f8bdb65ea6f49ea9b4afa Mon Sep 17 00:00:00 2001 From: tyabus Date: Fri, 8 Nov 2019 02:11:20 +0600 Subject: [PATCH 053/298] Remove outdated Makefiles (#110) * Remove outdated Makefiles * Update README.md --- README.md | 19 ++--- cl_dll/Makefile | 93 ------------------------ dlls/Makefile | 190 ------------------------------------------------ 3 files changed, 6 insertions(+), 296 deletions(-) delete mode 100644 cl_dll/Makefile delete mode 100644 dlls/Makefile diff --git a/README.md b/README.md index be0a5fa8..fe9e883f 100644 --- a/README.md +++ b/README.md @@ -43,19 +43,12 @@ There're dsp projects for Visual Studio 6 in `cl_dll` and `dlls` directories, bu TODO -### Linux +### Unix-like - (cd dlls && make) - (cd cl_dll && make) +To use waf, you need to install python (2.7 minimum) -### OS X - -Nothing here. - -### FreeBSD - - (cd dlls && gmake CXX=clang++ CC=clang) - (cd cl_dll && gmake CXX=clang++ CC=clang) + (./waf configure -T release) + (./waf) ### Android @@ -68,9 +61,9 @@ To enable building the goldsource compatible client library add GOLDSOURCE_SUPPO cmake .. -DGOLDSOURCE_SUPPORT=ON -or when using make without cmake: +or when using waf: - make GOLDSOURCE_SUPPORT=1 + ./waf configure -T release --enable-goldsrc-support Unlike original client by Valve the resulting client library will not depend on vgui or SDL2 just like the one that's used in FWGS Xash3d. diff --git a/cl_dll/Makefile b/cl_dll/Makefile deleted file mode 100644 index 0ff4dadf..00000000 --- a/cl_dll/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -CC?=gcc -CXX?=g++ -SRCS+=../dlls/crossbow.cpp -SRCS+=../dlls/crowbar.cpp -SRCS+=../dlls/egon.cpp -SRCS+=./ev_hldm.cpp -SRCS+=../dlls/gauss.cpp -SRCS+=../dlls/handgrenade.cpp -SRCS+=./hl/hl_baseentity.cpp -SRCS+=./hl/hl_events.cpp -SRCS+=./hl/hl_objects.cpp -SRCS+=./hl/hl_weapons.cpp -SRCS+=../dlls/glock.cpp -SRCS+=../dlls/hornetgun.cpp -#SRCS+=../common/interface.cpp -SRCS+=../dlls/mp5.cpp -SRCS+=../dlls/python.cpp -SRCS+=../dlls/rpg.cpp -SRCS+=../dlls/satchel.cpp -SRCS+=../dlls/shotgun.cpp -SRCS+=../dlls/squeakgrenade.cpp -SRCS+=../dlls/tripmine.cpp -#SRCS+=../game_shared/voice_banmgr.cpp -#SRCS+=../game_shared/voice_status.cpp -SRCS+=./ammo.cpp -SRCS+=./ammo_secondary.cpp -SRCS+=./ammohistory.cpp -SRCS+=./battery.cpp -SRCS+=./cdll_int.cpp -SRCS+=./com_weapons.cpp -SRCS+=./death.cpp -SRCS+=./demo.cpp -SRCS+=./entity.cpp -SRCS+=./ev_common.cpp -SRCS+=./events.cpp -SRCS+=./flashlight.cpp -SRCS+=./GameStudioModelRenderer.cpp -SRCS+=./geiger.cpp -SRCS+=./health.cpp -SRCS+=./hud.cpp -SRCS+=./hud_msg.cpp -SRCS+=./hud_redraw.cpp -#SRCS+=./hud_servers.cpp -SRCS+=./hud_spectator.cpp -SRCS+=./hud_update.cpp -SRCS+=./in_camera.cpp -SRCS+=./input.cpp -SRCS+=./input_mouse.cpp -SRCS+=./input_goldsource.cpp -SRCS+=./menu.cpp -SRCS+=./message.cpp -SRCS+=./overview.cpp -SRCS+=./parsemsg.cpp -SRCS_C+=../pm_shared/pm_debug.c -SRCS_C+=../pm_shared/pm_math.c -SRCS_C+=../pm_shared/pm_shared.c -SRCS+=./saytext.cpp -SRCS+=./status_icons.cpp -SRCS+=./statusbar.cpp -SRCS+=./studio_util.cpp -SRCS+=./StudioModelRenderer.cpp -SRCS+=./text_message.cpp -SRCS+=./train.cpp -SRCS+=./tri.cpp -SRCS+=./util.cpp -SRCS+=./view.cpp -SRCS+=./input_xash3d.cpp -SRCS+=./scoreboard.cpp -SRCS+=./MOTD.cpp -INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls -I../utils/false_vgui/include -DEFINES = -Wno-write-strings -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -CFLAGS = -m32 -OBJS = $(SRCS:.cpp=.o) $(SRCS_C:.c=.o) - -LIBS=-lm -ifeq ($(GOLDSOURCE_SUPPORT),1) - DEFINES += -DGOLDSOURCE_SUPPORT -endif - -ifeq ($(shell uname -s),Linux) - LIBS += -ldl -endif - -%.o : %.c - $(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@ - -%.o : %.cpp - $(CXX) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@ -client.so : $(OBJS) - $(CXX) $(CFLAGS) $(OBJS) -o client.so -shared -Wl,--no-undefined -fPIC $(LIBS) - -clean: - $(RM) $(OBJS) diff --git a/dlls/Makefile b/dlls/Makefile deleted file mode 100644 index 3599b9c7..00000000 --- a/dlls/Makefile +++ /dev/null @@ -1,190 +0,0 @@ -# -# Half-Life Full SDK 2.3 hl_i386.so Makefile for x86 Linux -# -# October 2002 by Leon Hartwig (hartwig@valvesoftware.com) -# - -DLLNAME=hl - -ARCH=i386 - -#make sure this is the correct compiler for your system -CC?=gcc -CXX?=g++ - -DLL_SRCDIR=. -ENGINE_SRCDIR=../engine -COMMON_SRCDIR=../common -WPN_SHARED_SRCDIR=./wpn_shared -PM_SHARED_SRCDIR=../pm_shared -GAME_SHARED_SRCDIR=../game_shared - -DLL_OBJDIR=$(DLL_SRCDIR)/obj -WPN_SHARED_OBJDIR=$(WPN_SHARED_SRCDIR)/obj -PM_SHARED_OBJDIR=$(PM_SHARED_SRCDIR)/obj -GAME_SHARED_OBJDIR=$(GAME_SHARED_SRCDIR)/obj - -BASE_CFLAGS= -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ - -DCLIENT_WEAPONS -DNO_VOICEGAMEMGR - -#safe optimization -CFLAGS=$(BASE_CFLAGS) -m32 -w -O1 - -#full optimization -#CFLAGS=$(BASE_CFLAGS) -w -O1 -m486 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations \ - -malign-loops=2 -malign-jumps=2 -malign-functions=2 - -#use these when debugging -#CFLAGS=$(BASE_CFLAGS) -g - -INCLUDEDIRS=-I. -I$(ENGINE_SRCDIR) -I$(COMMON_SRCDIR) -I$(PM_SHARED_SRCDIR) -I$(GAME_SHARED_SRCDIR) - -LDFLAGS= - -SHLIBEXT=so -SHLIBCFLAGS=-fPIC -SHLIBLDFLAGS=-shared - -DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $< -DO_CXX=$(CXX) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $< - -############################################################################# -# SETUP AND BUILD -# GAME -############################################################################# - -$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp - $(DO_CXX) - -$(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp - $(DO_CXX) - -$(GAME_SHARED_OBJDIR)/%.o: $(GAME_SHARED_SRCDIR)/%.cpp - $(DO_CXX) - -$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c - $(DO_CC) - -OBJ = \ - $(DLL_OBJDIR)/aflock.o \ - $(DLL_OBJDIR)/agrunt.o \ - $(DLL_OBJDIR)/airtank.o \ - $(DLL_OBJDIR)/animating.o \ - $(DLL_OBJDIR)/animation.o \ - $(DLL_OBJDIR)/apache.o \ - $(DLL_OBJDIR)/barnacle.o \ - $(DLL_OBJDIR)/barney.o \ - $(DLL_OBJDIR)/bigmomma.o \ - $(DLL_OBJDIR)/bloater.o \ - $(DLL_OBJDIR)/bmodels.o \ - $(DLL_OBJDIR)/bullsquid.o \ - $(DLL_OBJDIR)/buttons.o \ - $(DLL_OBJDIR)/cbase.o \ - $(DLL_OBJDIR)/client.o \ - $(DLL_OBJDIR)/combat.o \ - $(DLL_OBJDIR)/controller.o \ - $(DLL_OBJDIR)/crossbow.o \ - $(DLL_OBJDIR)/crowbar.o \ - $(DLL_OBJDIR)/defaultai.o \ - $(DLL_OBJDIR)/doors.o \ - $(DLL_OBJDIR)/effects.o \ - $(DLL_OBJDIR)/egon.o \ - $(DLL_OBJDIR)/explode.o \ - $(DLL_OBJDIR)/flyingmonster.o \ - $(DLL_OBJDIR)/func_break.o \ - $(DLL_OBJDIR)/func_tank.o \ - $(DLL_OBJDIR)/game.o \ - $(DLL_OBJDIR)/gamerules.o \ - $(DLL_OBJDIR)/gargantua.o \ - $(DLL_OBJDIR)/gauss.o \ - $(DLL_OBJDIR)/genericmonster.o \ - $(DLL_OBJDIR)/ggrenade.o \ - $(DLL_OBJDIR)/globals.o \ - $(DLL_OBJDIR)/gman.o \ - $(DLL_OBJDIR)/h_ai.o \ - $(DLL_OBJDIR)/h_battery.o \ - $(DLL_OBJDIR)/h_cine.o \ - $(DLL_OBJDIR)/h_cycler.o \ - $(DLL_OBJDIR)/h_export.o \ - $(DLL_OBJDIR)/handgrenade.o \ - $(DLL_OBJDIR)/hassassin.o \ - $(DLL_OBJDIR)/headcrab.o \ - $(DLL_OBJDIR)/healthkit.o \ - $(DLL_OBJDIR)/hgrunt.o \ - $(DLL_OBJDIR)/hornet.o \ - $(DLL_OBJDIR)/hornetgun.o \ - $(DLL_OBJDIR)/houndeye.o \ - $(DLL_OBJDIR)/ichthyosaur.o \ - $(DLL_OBJDIR)/islave.o \ - $(DLL_OBJDIR)/items.o \ - $(DLL_OBJDIR)/leech.o \ - $(DLL_OBJDIR)/lights.o \ - $(DLL_OBJDIR)/maprules.o \ - $(DLL_OBJDIR)/monstermaker.o \ - $(DLL_OBJDIR)/monsters.o \ - $(DLL_OBJDIR)/monsterstate.o \ - $(DLL_OBJDIR)/mortar.o \ - $(DLL_OBJDIR)/mp5.o \ - $(DLL_OBJDIR)/multiplay_gamerules.o \ - $(DLL_OBJDIR)/nihilanth.o \ - $(DLL_OBJDIR)/nodes.o \ - $(DLL_OBJDIR)/observer.o \ - $(DLL_OBJDIR)/osprey.o \ - $(DLL_OBJDIR)/pathcorner.o \ - $(DLL_OBJDIR)/plane.o \ - $(DLL_OBJDIR)/plats.o \ - $(DLL_OBJDIR)/player.o \ - $(DLL_OBJDIR)/playermonster.o \ - $(DLL_OBJDIR)/python.o \ - $(DLL_OBJDIR)/rat.o \ - $(DLL_OBJDIR)/roach.o \ - $(DLL_OBJDIR)/rpg.o \ - $(DLL_OBJDIR)/satchel.o \ - $(DLL_OBJDIR)/schedule.o \ - $(DLL_OBJDIR)/scientist.o \ - $(DLL_OBJDIR)/scripted.o \ - $(DLL_OBJDIR)/shotgun.o \ - $(DLL_OBJDIR)/singleplay_gamerules.o \ - $(DLL_OBJDIR)/skill.o \ - $(DLL_OBJDIR)/sound.o \ - $(DLL_OBJDIR)/soundent.o \ - $(DLL_OBJDIR)/spectator.o \ - $(DLL_OBJDIR)/squadmonster.o \ - $(DLL_OBJDIR)/squeakgrenade.o \ - $(DLL_OBJDIR)/subs.o \ - $(DLL_OBJDIR)/talkmonster.o \ - $(DLL_OBJDIR)/teamplay_gamerules.o \ - $(DLL_OBJDIR)/tempmonster.o \ - $(DLL_OBJDIR)/tentacle.o \ - $(DLL_OBJDIR)/triggers.o \ - $(DLL_OBJDIR)/tripmine.o \ - $(DLL_OBJDIR)/turret.o \ - $(DLL_OBJDIR)/util.o \ - $(DLL_OBJDIR)/weapons.o \ - $(DLL_OBJDIR)/world.o \ - $(DLL_OBJDIR)/xen.o \ - $(DLL_OBJDIR)/zombie.o \ - $(DLL_OBJDIR)/glock.o \ - $(PM_SHARED_OBJDIR)/pm_debug.o \ - $(PM_SHARED_OBJDIR)/pm_math.o \ - $(PM_SHARED_OBJDIR)/pm_shared.o -# $(GAME_SHARED_OBJDIR)/voice_gamemgr.o - -$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ) - $(CXX) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) - -neat: - -mkdir $(DLL_OBJDIR) - -mkdir $(WPN_SHARED_OBJDIR) - -mkdir $(GAME_SHARED_OBJDIR) - -mkdir $(PM_SHARED_OBJDIR) -clean: - -rm -f $(OBJ) - -rm -f $(DLLNAME)_$(ARCH).$(SHLIBEXT) -spotless: clean - -rm -r $(DLL_OBJDIR) - -rm -r $(WPN_SHARED_OBJDIR) - -rm -r $(GAME_SHARED_OBJDIR) - -rm -r $(PM_SHARED_OBJDIR) - From dfcf6bb3a2b4cd682ce50e0ab32992621f19fffe Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 00:51:25 +0300 Subject: [PATCH 054/298] public: move build.h from engine sources --- public/build.h | 205 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 public/build.h diff --git a/public/build.h b/public/build.h new file mode 100644 index 00000000..96145d2b --- /dev/null +++ b/public/build.h @@ -0,0 +1,205 @@ +/* +build.h - compile-time build information +Copyright (C) 2019 a1batross + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ +#pragma once +#ifndef BUILD_H +#define BUILD_H + +// All XASH_* macros set by this header are guaranteed to have positive value otherwise not defined + +// Any new define must be undefined at first +// You can generate #undef list below with this oneliner: +// $ cat build.h | sed 's/\t//g' | grep '^#define XASH' | awk '{ print $2 }' | sort | uniq | awk '{ print "#undef " $1 }' +// +// So in various buildscripts you can grep for ^#undef XASH and select only second word +// or in another oneliner: +// $ cat build.h | grep '^#undef XASH' | awk '{ print $2 }' + +#undef XASH_64BIT +#undef XASH_AMD64 +#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_BIG_ENDIAN +#undef XASH_BSD +#undef XASH_E2K +#undef XASH_EMSCRIPTEN +#undef XASH_FREEBSD +#undef XASH_IOS +#undef XASH_JS +#undef XASH_LINUX +#undef XASH_LITTLE_ENDIAN +#undef XASH_MINGW +#undef XASH_MIPS +#undef XASH_MOBILE_PLATFORM +#undef XASH_MSVC +#undef XASH_NETBSD +#undef XASH_OPENBSD +#undef XASH_WIN32 +#undef XASH_WIN64 +#undef XASH_X86 + +//================================================================ +// +// OPERATING SYSTEM DEFINES +// +//================================================================ +#if defined(_WIN32) + #define XASH_WIN32 1 + #if defined(__MINGW32__) + #define XASH_MINGW 1 + #elif defined(_MSC_VER) + #define XASH_MSVC 1 + #endif + + #if defined(_WIN64) + #define XASH_WIN64 1 + #endif +#elif defined(__linux__) + #define XASH_LINUX 1 + #if defined(__ANDROID__) + #define XASH_ANDROID 1 + #endif // defined(__ANDROID__) +#elif defined(__APPLE__) + #include + #define XASH_APPLE 1 + #if TARGET_OS_IOS + #define XASH_IOS 1 + #endif // TARGET_OS_IOS +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #define XASH_BSD 1 + #if defined(__FreeBSD__) + #define XASH_FREEBSD 1 + #elif defined(__NetBSD__) + #define XASH_NETBSD 1 + #elif defined(__OpenBSD__) + #define XASH_OPENBSD 1 + #endif +#elif defined __EMSCRIPTEN__ + #define XASH_EMSCRIPTEN 1 +#else +#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" +#endif + +#if defined XASH_ANDROID || defined XASH_IOS + #define XASH_MOBILE_PLATFORM 1 +#endif + +//================================================================ +// +// ENDIANNESS DEFINES +// +//================================================================ + +#if defined(XASH_LITTLE_ENDIAN) && defined(XASH_BIG_ENDIAN) + #error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined" +#endif + +#if !defined(XASH_LITTLE_ENDIAN) || !defined(XASH_BIG_ENDIAN) + #if defined XASH_MSVC || __LITTLE_ENDIAN__ + //!!! Probably all WinNT installations runs in little endian + #define XASH_LITTLE_ENDIAN 1 + #elif __BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && defined(__ORDER_LITTLE_ENDIAN__) // some compilers define this + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define XASH_LITTLE_ENDIAN 1 + #else + #error "Unknown endianness!" + #endif + #else + #include + #if __BYTE_ORDER == __BIG_ENDIAN + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER == __LITTLE_ENDIAN + #define XASH_LITTLE_ENDIAN 1 + #else + #error "Unknown endianness!" + #endif + #endif // !XASH_WIN32 +#endif + +//================================================================ +// +// CPU ARCHITECTURE DEFINES +// +//================================================================ +#if defined(__x86_64__) || defined(_M_X64) + #define XASH_64BIT 1 + #define XASH_AMD64 1 +#elif defined(__i386__) || defined(_X86_) || defined(_M_IX86) + #define XASH_X86 1 +#elif defined __aarch64__ + #define XASH_64BIT 1 + #define XASH_ARM64 1 +#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__ + #define XASH_ARM 7 + #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ + #define XASH_ARM 6 + #elif __ARM_ARCH == 5 || __ARM_ARCH_5__ + #define XASH_ARM 5 + #elif __ARM_ARCH == 4 || __ARM_ARCH_4__ + #define XASH_ARM 4 + #else + #error "Unknown ARM" + #endif + + #if defined _M_ARM + #error "No WinMobile port yet! Need to determine which ARM float ABI msvc uses if applicable" + #endif + + #if defined __SOFTFP__ || __ARM_PCS_VFP == 0 + #define XASH_ARM_SOFTFP 1 + #else // __SOFTFP__ + #define XASH_ARM_HARDFP 1 + #endif // __SOFTFP__ +#elif defined __mips__ + #define XASH_MIPS 1 +#elif defined __EMSCRIPTEN__ + #define XASH_JS 1 +#elif defined __e2k__ + #define XASH_64BIT 1 + #define XASH_E2K 1 +#else + #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" +#endif + +#if defined(XASH_WAF_DETECTED_64BIT) && !defined(XASH_64BIT) + #define XASH_64BIT 1 +#endif + +#if XASH_ARM == 7 + #define XASH_ARMv7 1 +#elif XASH_ARM == 6 + #define XASH_ARMv6 1 +#elif XASH_ARM == 5 + #define XASH_ARMv5 1 +#elif XASH_ARM == 4 + #define XASH_ARMv4 1 +#endif + +#endif // BUILD_H From c44d777016560ffe2165b573a279d438f8ee70b2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 01:04:03 +0300 Subject: [PATCH 055/298] public: build.h is under public domain now, so it can be added to any HLSDK --- public/build.h | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/public/build.h b/public/build.h index 96145d2b..6ace3e45 100644 --- a/public/build.h +++ b/public/build.h @@ -1,16 +1,33 @@ /* build.h - compile-time build information -Copyright (C) 2019 a1batross -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +This is free and unencumbered software released into the +public domain. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +Anyone is free to copy, modify, publish, use, compile, sell, +or distribute this software, either in source code form or as +a compiled binary, for any purpose, commercial or +non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or +authors of this software dedicate any and all copyright +interest in the software to the public domain. We make this +dedication for the benefit of the public at large and to the +detriment of our heirs and successors. We intend this +dedication to be an overtact of relinquishment in perpetuity of +all present and future rights to this software under copyright +law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +For more information, please refer to https://unlicense.org */ #pragma once #ifndef BUILD_H From 8622cc945d6df18b13a80b203668cf4683e58367 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 01:05:58 +0300 Subject: [PATCH 056/298] CMakeLists: remove legacy 64 postfix --- cl_dll/CMakeLists.txt | 4 ---- dlls/CMakeLists.txt | 3 --- 2 files changed, 7 deletions(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 57d52654..cde35d14 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -139,10 +139,6 @@ set_target_properties (${CLDLL_LIBRARY} PROPERTIES if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(CLDLL_NAME "client") - if(64BIT) - set(CLDLL_NAME "client64") - endif() - set_target_properties(${CLDLL_LIBRARY} PROPERTIES OUTPUT_NAME ${CLDLL_NAME} PREFIX "") diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 9baf9479..67a34e11 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -165,9 +165,6 @@ set_target_properties (${SVDLL_LIBRARY} PROPERTIES if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(SVDLL_NAME "${SERVER_LIBRARY_NAME}") - if(64BIT) - set(SVDLL_NAME "${SERVER_LIBRARY_NAME}64") - endif() set_target_properties(${SVDLL_LIBRARY} PROPERTIES OUTPUT_NAME ${SVDLL_NAME} From d59c169527433b5eb5b6fce3436479a0d1500833 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 01:06:52 +0300 Subject: [PATCH 057/298] cmake: implement library naming for CMake --- CMakeLists.txt | 7 ++- cmake/LibraryNaming.cmake | 103 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 cmake/LibraryNaming.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ffae124c..03d3a004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,10 @@ if(64BIT AND CMAKE_SIZEOF_VOID_P EQUAL 4) message(FATAL_ERROR "You enabled XASH_64BIT, but compiler can't create 64 bit code!") endif() +# Xash3D FWGS Library Naming Scheme compliance +# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/library-naming.md +include(LibraryNaming) + if(64BIT) message(STATUS "Building for 64 Bit") else() @@ -87,10 +91,11 @@ if(${CMAKE_VERSION} VERSION_LESS "3.0.2") endif() if(NOT MSVC) - add_compile_options(-Wempty-body) # GCC/Clang flag + #add_compile_options(-Wempty-body) # GCC/Clang flag add_compile_options(-Wreturn-type) # GCC/Clang flag endif() + if(BUILD_CLIENT) add_subdirectory(cl_dll) endif() diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake new file mode 100644 index 00000000..faa7c53f --- /dev/null +++ b/cmake/LibraryNaming.cmake @@ -0,0 +1,103 @@ +include(CheckSymbolExists) + +# generated(see comments in public/build.h) +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_SOURCE_DIR}/public/") +check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) +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_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) +check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN) +check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD) +check_symbol_exists(XASH_IOS "build.h" XASH_IOS) +check_symbol_exists(XASH_JS "build.h" XASH_JS) +check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX) +check_symbol_exists(XASH_LITTLE_ENDIAN "build.h" XASH_LITTLE_ENDIAN) +check_symbol_exists(XASH_MINGW "build.h" XASH_MINGW) +check_symbol_exists(XASH_MIPS "build.h" XASH_MIPS) +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_WIN32 "build.h" XASH_WIN32) +check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64) +check_symbol_exists(XASH_X86 "build.h" XASH_X86) +unset(CMAKE_REQUIRED_INCLUDES) + +# engine/common/build.c +if(XASH_ANDROID) + set(BUILDOS "android") +elseif(XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) + set(BUILDOS "") # no prefix for default OS +elseif(XASH_FREEBSD) + set(BUILDOS "freebsd") +elseif(XASH_NETBSD) + set(BUILDOS "netbsd") +elseif(XASH_OPENBSD) + set(BUILDOS "openbsd") +elseif(XASH_EMSCRIPTEN) + set(BUILDOS "emscripten") +else() + message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(XASH_AMD64) + set(BUILDARCH "amd64") +elseif(XASH_X86) + set(BUILDARCH "") +elseif(XASH_ARM64) + set(BUILDARCH "arm64") +elseif(XASH_ARM) + set(BUILDARCH "armv") + if(XASH_ARMv7) + set(BUILDARCH "${BUILDARCH}7") + elseif(XASH_ARMv6) + set(BUILDARCH "${BUILDARCH}6") + elseif(XASH_ARMv5) + set(BUILDARCH "${BUILDARCH}5") + elseif(XASH_ARMv4) + set(BUILDARCH "${BUILDARCH}4") + endif() + + if(XASH_ARM_HARDFP) + set(BUILDARCH "${BUILDARCH}hf") + else() + set(BUILDARCH "${BUILDARCH}l") + endif() +elseif(XASH_MIPS AND XASH_BIG_ENDIAN) + set(BUILDARCH "mips") +elseif(XASH_MIPS AND XASH_LITTLE_ENDIAN) + set(BUILDARCH "mipsel") +elseif(XASH_JS) + set(BUILDARCH "javascript") +elseif(XASH_E2K) + set(BUILDARCH "e2k") +else() + message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(BUILDOS AND BUILDARCH) + set(POSTFIX "_${BUILDOS}_${BUILDARCH}") +elseif(BUILDARCH) + set(POSTFIX "_${BUILDARCH}") +else() + set(POSTFIX "") +endif() + +message(STATUS "Library postfix: " ${POSTFIX}) + +set(CMAKE_RELEASE_POSTFIX ${POSTFIX}) +set(CMAKE_DEBUG_POSTFIX ${POSTFIX}) +set(CMAKE_RELWITHDEBINFO_POSTFIX ${POSTFIX}) +set(CMAKE_MINSIZEREL_POSTFIX ${POSTFIX}) +set(CMAKE_POSTFIX ${POSTFIX}) From 13e17024cc5a01f6966fc9e01cd7c94ec4ad009a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 01:12:16 +0300 Subject: [PATCH 058/298] public: use unlicense statetemt from their website :) --- public/build.h | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/public/build.h b/public/build.h index 6ace3e45..9cb7e25b 100644 --- a/public/build.h +++ b/public/build.h @@ -1,33 +1,30 @@ /* build.h - compile-time build information -This is free and unencumbered software released into the -public domain. +This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, -or distribute this software, either in source code form or as -a compiled binary, for any purpose, commercial or -non-commercial, and by any means. +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. -In jurisdictions that recognize copyright laws, the author or -authors of this software dedicate any and all copyright -interest in the software to the public domain. We make this -dedication for the benefit of the public at large and to the -detriment of our heirs and successors. We intend this -dedication to be an overtact of relinquishment in perpetuity of -all present and future rights to this software under copyright -law. +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. -For more information, please refer to https://unlicense.org +For more information, please refer to */ #pragma once #ifndef BUILD_H From 043e91866f3655755972712741b3bdb00b61fa96 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 04:02:59 +0300 Subject: [PATCH 059/298] cmake: throw an error if ARM isn't detected --- cmake/LibraryNaming.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index faa7c53f..22581078 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -67,6 +67,8 @@ elseif(XASH_ARM) set(BUILDARCH "${BUILDARCH}5") elseif(XASH_ARMv4) set(BUILDARCH "${BUILDARCH}4") + else() + message(SEND_ERROR "Unknown ARM") endif() if(XASH_ARM_HARDFP) @@ -86,7 +88,9 @@ else() message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") endif() -if(BUILDOS AND BUILDARCH) +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) set(POSTFIX "_${BUILDOS}_${BUILDARCH}") elseif(BUILDARCH) set(POSTFIX "_${BUILDARCH}") From 94d4c6a0e359e92f9d10208e219106ade1d4ea96 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 04:03:25 +0300 Subject: [PATCH 060/298] wscript: enable library naming for Waf --- scripts/waifulib/library_naming.py | 127 +++++++++++++++++++++++++++++ wscript | 2 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 scripts/waifulib/library_naming.py diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py new file mode 100644 index 00000000..77dfa6df --- /dev/null +++ b/scripts/waifulib/library_naming.py @@ -0,0 +1,127 @@ +#! /usr/bin/env python +# Copyright 2019 (C) a1batross + +from waflib import Configure, Errors, Utils + +# TODO: make generic +CHECK_SYMBOL_EXISTS_FRAGMENT = ''' +#include "build.h" + +int main(int argc, char** argv) +{ + (void)argv; +#ifndef %s + return ((int*)(&%s))[argc]; +#else + (void)argc; + return 0; +#endif +} +''' + +DEFINES = [ +'XASH_64BIT', +'XASH_AMD64', +'XASH_ANDROID', +'XASH_APPLE', +'XASH_ARM', +'XASH_ARM64', +'XASH_ARM_HARDFP', +'XASH_ARM_SOFTFP', +'XASH_ARMv4', +'XASH_ARMv5', +'XASH_ARMv6', +'XASH_ARMv7', +'XASH_BIG_ENDIAN', +'XASH_BSD', +'XASH_E2K', +'XASH_EMSCRIPTEN', +'XASH_FREEBSD', +'XASH_IOS', +'XASH_JS', +'XASH_LINUX', +'XASH_LITTLE_ENDIAN', +'XASH_MINGW', +'XASH_MIPS', +'XASH_MOBILE_PLATFORM', +'XASH_MSVC', +'XASH_NETBSD', +'XASH_OPENBSD', +'XASH_WIN32', +'XASH_WIN64', +'XASH_X86' +] + +def configure(conf): + conf.env.stash() + conf.start_msg('Determining library postfix') + tests = map(lambda x: { + '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" + elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: + buildos = "" # no prefix for default OS + elif conf.env.XASH_FREEBSD: + buildos = "freebsd" + elif conf.env.XASH_NETBSD: + buildos = "netbsd" + elif conf.env.XASH_OPENBSD: + buildos = "openbsd" + elif conf.env.XASH_EMSCRIPTEN: + buildos = "emscripten" + else: + conf.fatal("Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") + + if conf.env.XASH_AMD64: + buildarch = "amd64" + elif conf.env.XASH_X86: + buildarch = "" + elif conf.env.XASH_ARM64: + buildarch = "arm64" + elif conf.env.XASH_ARM: + buildarch = "armv" + if conf.env.XASH_ARMv7: + buildarch += "7" + elif conf.env.XASH_ARMv6: + buildarch += "6" + elif conf.env.XASH_ARMv5: + buildarch += "5" + elif conf.env.XASH_ARMv4: + buildarch += "4" + else: + raise conf.fatal('Unknown ARM') + + if conf.env.XASH_ARM_HARDFP: + buildarch += "hf" + else: + buildarch += "l" + elif conf.env.XASH_MIPS and conf.env.XASH_BIG_ENDIAN: + buildarch = "mips" + elif conf.env.XASH_MIPS and conf.env.XASH_LITTLE_ENDIAN: + buildarch = "mipsel" + elif conf.env.XASH_JS: + buildarch = "javascript" + elif conf.env.XASH_E2K: + buildarch = "e2k" + else: + raise conf.fatal("Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") + + conf.env.revert() + + if buildos == 'android': + # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming + conf.env.POSTFIX = '' + elif buildos != '' and buildarch != '': + conf.env.POSTFIX = '_%s_%s' % (buildos,buildarch) + elif buildarch != '': + conf.env.POSTFIX = '_%s' % buildarch + else: + conf.env.POSTFIX = '' + + conf.end_msg(conf.env.POSTFIX) diff --git a/wscript b/wscript index af830e72..3a885ac9 100644 --- a/wscript +++ b/wscript @@ -87,7 +87,7 @@ def configure(conf): 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.load('xcompile compiler_c compiler_cxx strip_on_install library_naming') try: conf.env.CC_VERSION[0] From b4d3b5d8beea2a48e97d993e852cfe2103a83b21 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 11 Nov 2019 04:07:51 +0300 Subject: [PATCH 061/298] wscript: enable library naming --- cl_dll/wscript | 2 +- dlls/wscript | 2 +- wscript | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 02a9d530..b45242d5 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -60,7 +60,7 @@ def build(bld): bld.shlib( source = source, - target = 'client', + target = 'client' + bld.env.POSTFIX, features = 'c cxx', includes = includes, defines = defines, diff --git a/dlls/wscript b/dlls/wscript index e5268e05..24e93e71 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -68,7 +68,7 @@ def build(bld): bld.shlib( source = source, - target = bld.env.SERVER_NAME, + target = bld.env.SERVER_NAME + bld.env.POSTFIX, features = 'c cxx', includes = includes, defines = defines, diff --git a/wscript b/wscript index 3a885ac9..15c4b175 100644 --- a/wscript +++ b/wscript @@ -87,7 +87,7 @@ def configure(conf): 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 library_naming') + conf.load('xcompile compiler_c compiler_cxx strip_on_install') try: conf.env.CC_VERSION[0] @@ -122,7 +122,7 @@ def configure(conf): else: conf.env.BIT32_ALLOW64 = True conf.env.BIT32_MANDATORY = not conf.env.BIT32_ALLOW64 - conf.load('force_32bit') + conf.load('force_32bit library_naming') linker_flags = { 'common': { From b8825c2039d91670abc7415733111e89e7ea2e4f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 16 Nov 2019 13:54:30 +0500 Subject: [PATCH 062/298] Fix some potential troubles. Comment some useless code. --- cl_dll/MOTD.cpp | 4 ++-- cl_dll/StudioModelRenderer.cpp | 4 ++-- cl_dll/cdll_int.cpp | 2 +- cl_dll/demo.cpp | 4 ++-- cl_dll/geiger.cpp | 2 +- cl_dll/health.cpp | 5 +++-- cl_dll/hl/hl_weapons.cpp | 2 +- cl_dll/message.cpp | 2 +- cl_dll/saytext.cpp | 2 +- cl_dll/view.cpp | 2 +- dlls/apache.cpp | 4 ++-- dlls/combat.cpp | 4 ++-- dlls/func_break.cpp | 4 ++-- dlls/hgrunt.cpp | 12 ++++++------ dlls/hornet.cpp | 4 ++-- dlls/islave.cpp | 11 +++++++---- dlls/monsters.cpp | 28 ++++++++++++++++------------ dlls/nihilanth.cpp | 4 ++-- dlls/nodes.cpp | 4 ++-- dlls/osprey.cpp | 15 ++++++++++----- dlls/plats.cpp | 2 +- dlls/sound.cpp | 4 ++-- dlls/squeakgrenade.cpp | 4 ++-- dlls/talkmonster.cpp | 23 +++++++++++++---------- pm_shared/pm_debug.c | 6 +++--- 25 files changed, 87 insertions(+), 71 deletions(-) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index 7059948a..7947a15f 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -86,7 +86,7 @@ int CHudMOTD::Draw( float fTime ) ypos_r = ROW_RANGE_MIN; height = ROW_RANGE_MAX; } - int ymax = ypos + height; + // int ymax = ypos + height; if( xmax > ScreenWidth - 30 ) xmax = ScreenWidth - 30; gHUD.DrawDarkRectangle( xpos - 5, ypos_r - 5, xmax - xpos + 10, height + 10 ); while( *ch ) @@ -157,7 +157,7 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) if( length > m_iMaxLength ) { m_iMaxLength = length; - length = 0; + // length = 0; } m_bShow = true; } diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index 5350ad10..1994c2a7 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -684,9 +684,9 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ else if( gEngfuncs.pfnRandomLong( 0, 49 ) == 0 ) { float offset; - int axis = gEngfuncs.pfnRandomLong(0,1); + /*int axis = gEngfuncs.pfnRandomLong(0,1); if( axis == 1 ) // Choose between x & z - axis = 2; + axis = 2;*/ offset = gEngfuncs.pfnRandomFloat( -10.0f, 10.0f ); transform[gEngfuncs.pfnRandomLong( 0, 2 )][3] += offset; } diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 45bbcd67..29edfbde 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -124,7 +124,7 @@ HUD_ConnectionlessPacket int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) { // Parse stuff from args - int max_buffer_size = *response_buffer_size; + // int max_buffer_size = *response_buffer_size; // Zero it out since we aren't going to respond. // If we wanted to response, we'd write data into response_buffer diff --git a/cl_dll/demo.cpp b/cl_dll/demo.cpp index f114ead0..63e333be 100644 --- a/cl_dll/demo.cpp +++ b/cl_dll/demo.cpp @@ -88,12 +88,12 @@ void DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer ) g_demosniperorg[1] = *(float *)&buffer[i]; i += sizeof(float); g_demosniperorg[2] = *(float *)&buffer[i]; - i += sizeof(float); + // i += sizeof(float); } break; case TYPE_ZOOM: g_demozoom = *(float *)&buffer[i]; - i += sizeof(float); + // i += sizeof(float); break; default: gEngfuncs.Con_DPrintf( "Unknown demo buffer type, skipping.\n" ); diff --git a/cl_dll/geiger.cpp b/cl_dll/geiger.cpp index 339c8ee1..89d2b951 100644 --- a/cl_dll/geiger.cpp +++ b/cl_dll/geiger.cpp @@ -66,7 +66,7 @@ int CHudGeiger::Draw( float flTime ) int pct; float flvol = 0.0f; //int rg[3]; - int i; + int i = 0; if( m_iGeigerRange < 1000 && m_iGeigerRange > 0 ) { diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 6540671e..e14182b8 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -152,13 +152,14 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ) // Green <-> Yellow <-> Red ramp void CHudHealth::GetPainColor( int &r, int &g, int &b ) { +#if 0 int iHealth = m_iHealth; if( iHealth > 25 ) iHealth -= 25; else if( iHealth < 0 ) iHealth = 0; -#if 0 + g = iHealth * 255 / 100; r = 255 - g; b = 0; @@ -461,7 +462,7 @@ void CHudHealth::UpdateTiles( float flTime, long bitsDamage ) if( pdmg->y ) pdmg->y -= giDmgHeight; } - pdmg = &m_dmg[i]; + // pdmg = &m_dmg[i]; } } diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 63e6f6d8..f305f321 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -307,7 +307,7 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD // get circular gaussian spread x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f ); y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f ); - z = x * x + y * y; + // z = x * x + y * y; } } diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index 15e62188..29834a13 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -352,7 +352,7 @@ int CHudMessage::Draw( float fTime ) // Assume m_parms.time contains last time if( m_pMessages[i] ) { - pMessage = m_pMessages[i]; + // pMessage = m_pMessages[i]; if( m_startTime[i] > gHUD.m_flTime ) m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2f; // Server takes 0.2 seconds to spawn, adjust for this } diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index b084f44b..bf8eca80 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -259,7 +259,7 @@ void CHudSayText::EnsureTextFitsInOneLineAndWrapIfHaveTo( int line ) if( !last_break ) last_break = x - 1; - x = last_break; + // x = last_break; // find an empty string slot int j; diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index f67a994d..9ce6208e 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -491,7 +491,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) } else { - waterEntity = 0; // Don't need this in software + // waterEntity = 0; // Don't need this in software } VectorCopy( pparams->vieworg, point ); diff --git a/dlls/apache.cpp b/dlls/apache.cpp index a863e3c2..e69d72e9 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -717,9 +717,9 @@ void CApache::Flight( void ) if( pitch == 100.0f ) pitch = 101.0f; - float flVol = ( m_flForce / 100.0f ) + 0.1f; + /*float flVol = ( m_flForce / 100.0f ) + 0.1f; if( flVol > 1.0f ) - flVol = 1.0f; + flVol = 1.0f;*/ EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); } diff --git a/dlls/combat.cpp b/dlls/combat.cpp index c6ab3efe..df079af7 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -459,10 +459,10 @@ Activity CBaseMonster::GetDeathActivity( void ) Activity CBaseMonster::GetSmallFlinchActivity( void ) { Activity flinchActivity; - BOOL fTriedDirection; + // BOOL fTriedDirection; //float flDot; - fTriedDirection = FALSE; + // fTriedDirection = FALSE; UTIL_MakeVectors( pev->angles ); //flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f ); diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 27324260..98432d06 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -710,11 +710,11 @@ void CBreakable::Die( void ) WRITE_BYTE( cFlag ); MESSAGE_END(); - float size = pev->size.x; + /*float size = pev->size.x; if( size < pev->size.y ) size = pev->size.y; if( size < pev->size.z ) - size = pev->size.z; + size = pev->size.z;*/ // !!! HACK This should work! // Build a box above the entity that looks like an 8 pixel high sheet diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index bcb71005..7f7e39e5 100644 --- a/dlls/hgrunt.cpp +++ b/dlls/hgrunt.cpp @@ -423,13 +423,13 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) { return FALSE; } - } - if( flDist <= 64.0f && flDot >= 0.7f && - pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && - pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) - { - return TRUE; + if( flDist <= 64.0f && flDot >= 0.7f && + pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && + pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) + { + return TRUE; + } } return FALSE; } diff --git a/dlls/hornet.cpp b/dlls/hornet.cpp index 6fc79aa7..782e1a27 100644 --- a/dlls/hornet.cpp +++ b/dlls/hornet.cpp @@ -95,9 +95,9 @@ void CHornet::Spawn( void ) SetTouch( &CHornet::DieTouch ); SetThink( &CHornet::StartTrack ); - edict_t *pSoundEnt = pev->owner; + /*edict_t *pSoundEnt = pev->owner; if( !pSoundEnt ) - pSoundEnt = edict(); + pSoundEnt = edict();*/ if( !FNullEnt( pev->owner ) && ( pev->owner->v.flags & FL_CLIENT ) ) { diff --git a/dlls/islave.cpp b/dlls/islave.cpp index f66a57aa..51883be3 100644 --- a/dlls/islave.cpp +++ b/dlls/islave.cpp @@ -639,10 +639,13 @@ Schedule_t *CISlave::GetSchedule( void ) ASSERT( pSound != NULL ); - if( pSound && ( pSound->m_iType & bits_SOUND_DANGER ) ) - return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND ); - if( pSound->m_iType & bits_SOUND_COMBAT ) - m_afMemory |= bits_MEMORY_PROVOKED; + if( pSound ) + { + if( pSound->m_iType & bits_SOUND_DANGER ) + return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND ); + if( pSound->m_iType & bits_SOUND_COMBAT ) + m_afMemory |= bits_MEMORY_PROVOKED; + } } switch( m_MonsterState ) diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 72eb331d..e14dbace 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -262,7 +262,8 @@ void CBaseMonster::Listen( void ) } //iSound = g_pSoundEnt->m_SoundPool[iSound].m_iNext; - iSound = pCurrentSound->m_iNext; + if( pCurrentSound ) + iSound = pCurrentSound->m_iNext; } } @@ -431,18 +432,21 @@ CSound *CBaseMonster::PBestSound( void ) { pSound = CSoundEnt::SoundPointerForIndex( iThisSound ); - if( pSound && pSound->FIsSound() ) + if( pSound ) { - flDist = ( pSound->m_vecOrigin - EarPosition() ).Length(); - - if( flDist < flBestDist ) + if( pSound->FIsSound() ) { - iBestSound = iThisSound; - flBestDist = flDist; - } - } + flDist = ( pSound->m_vecOrigin - EarPosition() ).Length(); - iThisSound = pSound->m_iNextAudible; + if( flDist < flBestDist ) + { + iBestSound = iThisSound; + flBestDist = flDist; + } + } + + iThisSound = pSound->m_iNextAudible; + } } if( iBestSound >= 0 ) { @@ -2367,7 +2371,7 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl // try to actually get there if( BuildRoute( node.m_vecOrigin, bits_MF_TO_LOCATION, NULL ) ) { - flMaxDist = flDist; + // flMaxDist = flDist; m_vecMoveGoal = node.m_vecOrigin; return TRUE; // UNDONE: keep looking for something closer! } @@ -3278,7 +3282,7 @@ BOOL CBaseMonster::BBoxFlat( void ) { return FALSE; } - flLength = flLength2; + // flLength = flLength2; return TRUE; } diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index 5a789f2b..29e1073e 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -944,10 +944,10 @@ void CNihilanth::Flight( void ) m_velocity.y += gpGlobals->v_up.y * m_flForce; m_velocity.z += gpGlobals->v_up.z * m_flForce; - float flSpeed = m_velocity.Length(); + /*float flSpeed = m_velocity.Length(); float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0 ), Vector( m_velocity.x, m_velocity.y, 0 ) ); if( flDir < 0 ) - flSpeed = -flSpeed; + flSpeed = -flSpeed;*/ //float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward ); diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index c8d6296c..c8e5649c 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -2533,7 +2533,7 @@ int CGraph::FLoadGraph( const char *szMapName ) if( length < 0 ) goto ShortFile; memcpy( m_pHashLinks, pMemFile, sizeof(short) * m_nHashLinks ); - pMemFile += sizeof(short) * m_nHashLinks; + // pMemFile += sizeof(short) * m_nHashLinks; // Set the graph present flag, clear the pointers set flag // @@ -3641,7 +3641,7 @@ void CNodeViewer::Spawn() int start = 0; int end; do{ - end = m_nVisited; + // end = m_nVisited; // ALERT( at_console, "%d :", m_nVisited ); for( end = m_nVisited; start < end; start++ ) { diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index 8cd8ed1e..670ad3b7 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -384,13 +384,18 @@ void COsprey::FlyThink( void ) if( gpGlobals->time > m_startTime + m_dTime ) { - if( m_pGoalEnt->pev->speed == 0 ) + if( m_pGoalEnt ) { - SetThink( &COsprey::DeployThink ); + if( m_pGoalEnt->pev->speed == 0 ) + { + SetThink( &COsprey::DeployThink ); + } + + do{ + m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_pGoalEnt->pev->target ) ) ); + } while( m_pGoalEnt && m_pGoalEnt->pev->speed < 400 && !HasDead() ); } - do{ - m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_pGoalEnt->pev->target ) ) ); - } while( m_pGoalEnt->pev->speed < 400 && !HasDead() ); + UpdateGoal(); } diff --git a/dlls/plats.cpp b/dlls/plats.cpp index d74129e7..0f2dbe70 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -1750,7 +1750,7 @@ void CFuncTrackChange::Find( void ) else { ALERT( at_error, "Can't find train for track change! %s\n", STRING( m_trainName ) ); - target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) ); + // target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) ); } } else diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 51f37fbb..c5061da9 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -280,7 +280,7 @@ void CAmbientGeneric::RampThink( void ) if( pitch < m_dpv.pitchstart ) { - pitch = m_dpv.pitchstart; + // pitch = m_dpv.pitchstart; m_dpv.spindown = 0; // done with ramp down // shut sound off @@ -324,7 +324,7 @@ void CAmbientGeneric::RampThink( void ) if( vol < m_dpv.volstart ) { - vol = m_dpv.volstart; + // vol = m_dpv.volstart; m_dpv.fadeout = 0; // done with ramp down // shut sound off diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index f6e2d636..7e8a9d92 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -266,9 +266,9 @@ void CSqueakGrenade::HuntThink( void ) } // higher pitch as squeeker gets closer to detonation time - float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + /*float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); if( flpitch < 80.0f ) - flpitch = 80.0f; + flpitch = 80.0f;*/ if( m_hEnemy != 0 ) { diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index 295a3260..581d87a9 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -494,18 +494,21 @@ void CTalkMonster::RunTask( Task_t *pTask ) if( pTask->iTask == TASK_TLK_CLIENT_STARE ) { - // fail out if the player looks away or moves away. - if( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST ) + if( pPlayer ) { - // player moved away. - TaskFail(); - } + // fail out if the player looks away or moves away. + if( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST ) + { + // player moved away. + TaskFail(); + } - UTIL_MakeVectors( pPlayer->v.angles ); - if( UTIL_DotPoints( pPlayer->v.origin, pev->origin, gpGlobals->v_forward ) < m_flFieldOfView ) - { - // player looked away - TaskFail(); + UTIL_MakeVectors( pPlayer->v.angles ); + if( UTIL_DotPoints( pPlayer->v.origin, pev->origin, gpGlobals->v_forward ) < m_flFieldOfView ) + { + // player looked away + TaskFail(); + } } } diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index fbe1e288..a11e0516 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -289,7 +289,7 @@ void PM_ViewEntity( void ) int i; pmtrace_t trace; int pcolor = 77; - float fup; + // float fup; #if 0 if ( !pm_showclip.value ) @@ -300,9 +300,9 @@ void PM_ViewEntity( void ) VectorCopy( pmove->origin, origin); - fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); + /*fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); fup += pmove->view_ofs[2]; - fup -= 4; + fup -= 4;*/ for (i = 0; i < 3; i++) { From 52b067fd4fda1288045ccecfd169e8cf81895830 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 16 Nov 2019 14:29:09 +0500 Subject: [PATCH 063/298] Fix possible null pointer dereference. --- dlls/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/sound.cpp b/dlls/sound.cpp index c5061da9..688b4016 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -1762,7 +1762,7 @@ void CSpeaker::Precache( void ) } void CSpeaker::SpeakerThink( void ) { - const char* szSoundFile = NULL; + const char* szSoundFile = ""; float flvolume = pev->health * 0.1f; float flattenuation = 0.3f; int flags = 0; From e53f15cabfb9f1141770b93378fe1a2acd316363 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 2 Dec 2019 02:28:51 +0300 Subject: [PATCH 064/298] wscript: add option to turn on simple mod hacks --- wscript | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 15c4b175..1dc0bb39 100644 --- a/wscript +++ b/wscript @@ -43,6 +43,9 @@ def options(opt): grp.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, help = 'enable targetting for MotoMAGX phones [default: %default]') + 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') if sys.platform == 'win32': @@ -180,8 +183,6 @@ def configure(conf): compiler_optional_flags = [ '-fdiagnostics-color=always', - '-Werror=implicit-function-declaration', - '-Werror=int-conversion', '-Werror=return-type', '-Werror=parentheses', '-Werror=vla', @@ -193,6 +194,8 @@ def configure(conf): ] c_compiler_optional_flags = [ + '-Werror=implicit-function-declaration', + '-Werror=int-conversion', '-Werror=implicit-int', '-Werror=declaration-after-statement' ] @@ -263,6 +266,9 @@ def configure(conf): conf.define('CLIENT_WEAPONS', '1') + if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: + conf.define('MOBILE_HACKS', '1') + conf.add_subproject(["cl_dll", "dlls"]) def build(bld): From 701d78dcecf27f9f463c44f39b163a9299b10f05 Mon Sep 17 00:00:00 2001 From: Aimless-Wanderer <53096779+Aimless-Wanderer@users.noreply.github.com> Date: Sun, 8 Dec 2019 14:20:24 +0200 Subject: [PATCH 065/298] wscript: fix join method usage --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index 1dc0bb39..0e98480f 100644 --- a/wscript +++ b/wscript @@ -73,7 +73,7 @@ def configure(conf): conf.fatal('Please set a build type, for example "-T release"') elif not conf.options.BUILD_TYPE in valid_build_types: conf.end_msg(conf.options.BUILD_TYPE, color='RED') - conf.fatal('Invalid build type. Valid are: %s' % valid_build_types.join(', ')) + conf.fatal('Invalid build type. Valid are: %s' % ', '.join(valid_build_types)) conf.end_msg(conf.options.BUILD_TYPE) # -march=native should not be used From 3a2d8ef5f9599564c3b6dea8e870200e07a3374e Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:28:50 +0700 Subject: [PATCH 066/298] client: remove useless defines --- cl_dll/GameStudioModelRenderer.cpp | 2 -- cl_dll/GameStudioModelRenderer_Sample.cpp | 2 -- cl_dll/StudioModelRenderer.cpp | 2 -- cl_dll/demo.cpp | 1 - cl_dll/entity.cpp | 2 -- cl_dll/hud_iface.h | 4 ++-- cl_dll/hud_update.cpp | 1 - cl_dll/studio_util.cpp | 1 - 8 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cl_dll/GameStudioModelRenderer.cpp b/cl_dll/GameStudioModelRenderer.cpp index f32def43..3a720ff3 100644 --- a/cl_dll/GameStudioModelRenderer.cpp +++ b/cl_dll/GameStudioModelRenderer.cpp @@ -18,8 +18,6 @@ #include #include -#include -#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/GameStudioModelRenderer_Sample.cpp b/cl_dll/GameStudioModelRenderer_Sample.cpp index 8910d809..a840f393 100644 --- a/cl_dll/GameStudioModelRenderer_Sample.cpp +++ b/cl_dll/GameStudioModelRenderer_Sample.cpp @@ -18,8 +18,6 @@ #include #include -#include -#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index 1994c2a7..fc168dfa 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -20,8 +20,6 @@ #include #include -#include -#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/demo.cpp b/cl_dll/demo.cpp index 63e333be..8f5fb0a8 100644 --- a/cl_dll/demo.cpp +++ b/cl_dll/demo.cpp @@ -17,7 +17,6 @@ #include "cl_util.h" #include "demo.h" #include "demo_api.h" -#include int g_demosniper = 0; int g_demosniperdamage = 0; diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index 6a7fdc79..287894b8 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -7,8 +7,6 @@ // Client side entity management functions -#include - #include "hud.h" #include "cl_util.h" #include "const.h" diff --git a/cl_dll/hud_iface.h b/cl_dll/hud_iface.h index 73464c83..be5e390b 100644 --- a/cl_dll/hud_iface.h +++ b/cl_dll/hud_iface.h @@ -10,8 +10,8 @@ #define HUD_IFACEH #include "exportdef.h" - -typedef int (*pfnUserMsgHook)( const char *pszName, int iSize, void *pbuf ); +// redefine +// typedef int (*pfnUserMsgHook)( const char *pszName, int iSize, void *pbuf ); #include "wrect.h" #include "../engine/cdll_int.h" extern cl_enginefunc_t gEngfuncs; diff --git a/cl_dll/hud_update.cpp b/cl_dll/hud_update.cpp index f431bbaf..8c807d1c 100644 --- a/cl_dll/hud_update.cpp +++ b/cl_dll/hud_update.cpp @@ -20,7 +20,6 @@ #include "hud.h" #include "cl_util.h" #include -#include int CL_ButtonBits( int ); void CL_ResetButtonBits( int bits ); diff --git a/cl_dll/studio_util.cpp b/cl_dll/studio_util.cpp index 7ac385fe..3e676654 100644 --- a/cl_dll/studio_util.cpp +++ b/cl_dll/studio_util.cpp @@ -5,7 +5,6 @@ // $NoKeywords: $ //============================================================================= -#include #include "hud.h" #include "cl_util.h" #include "const.h" From 8bf08e261ca52a5f8652bd1eb5043728de90bb53 Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:30:58 +0700 Subject: [PATCH 067/298] update build.h, add new defines to library_naming.py --- public/build.h | 12 +++++++++--- scripts/waifulib/library_naming.py | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/public/build.h b/public/build.h index 9cb7e25b..a087c22c 100644 --- a/public/build.h +++ b/public/build.h @@ -52,7 +52,7 @@ For more information, please refer to #undef XASH_ARMv5 #undef XASH_ARMv6 #undef XASH_ARMv7 -#undef XASH_BIG_ENDIAN +//#undef XASH_BIG_ENDIAN #undef XASH_BSD #undef XASH_E2K #undef XASH_EMSCRIPTEN @@ -60,7 +60,7 @@ For more information, please refer to #undef XASH_IOS #undef XASH_JS #undef XASH_LINUX -#undef XASH_LITTLE_ENDIAN +//#undef XASH_LITTLE_ENDIAN #undef XASH_MINGW #undef XASH_MIPS #undef XASH_MOBILE_PLATFORM @@ -92,12 +92,14 @@ For more information, please refer to #if defined(__ANDROID__) #define XASH_ANDROID 1 #endif // defined(__ANDROID__) + #define XASH_POSIX 1 #elif defined(__APPLE__) #include #define XASH_APPLE 1 #if TARGET_OS_IOS #define XASH_IOS 1 #endif // TARGET_OS_IOS + #define XASH_POSIX 1 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #define XASH_BSD 1 #if defined(__FreeBSD__) @@ -107,8 +109,12 @@ For more information, please refer to #elif defined(__OpenBSD__) #define XASH_OPENBSD 1 #endif + #define XASH_POSIX 1 #elif defined __EMSCRIPTEN__ #define XASH_EMSCRIPTEN 1 +#elif defined __WATCOMC__ && defined __DOS__ + #define XASH_DOS4GW 1 + #define XASH_LITTLE_ENDIAN #else #error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" #endif @@ -127,7 +133,7 @@ For more information, please refer to #error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined" #endif -#if !defined(XASH_LITTLE_ENDIAN) || !defined(XASH_BIG_ENDIAN) +#if !defined(XASH_LITTLE_ENDIAN) && !defined(XASH_BIG_ENDIAN) #if defined XASH_MSVC || __LITTLE_ENDIAN__ //!!! Probably all WinNT installations runs in little endian #define XASH_LITTLE_ENDIAN 1 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 77dfa6df..827ef76c 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -49,7 +49,9 @@ DEFINES = [ 'XASH_OPENBSD', 'XASH_WIN32', 'XASH_WIN64', -'XASH_X86' +'XASH_X86', +'XASH_DOS4GW', +'XASH_POSIX' ] def configure(conf): @@ -75,8 +77,11 @@ def configure(conf): buildos = "openbsd" elif conf.env.XASH_EMSCRIPTEN: buildos = "emscripten" + elif conf.env.XASH_DOS4GW: + buildos = "dos4gw" # unused, just in case else: - conf.fatal("Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") + 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") if conf.env.XASH_AMD64: buildarch = "amd64" @@ -110,7 +115,8 @@ def configure(conf): elif conf.env.XASH_E2K: buildarch = "e2k" else: - raise conf.fatal("Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") + raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n" + "If this is a mistake, try to fix conditions above and report a bug") conf.env.revert() From 2ba907179843350afd1e697b66db4562c1f5f95c Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:34:05 +0700 Subject: [PATCH 068/298] check if cmath useful, remove posix defines when using owcc --- cl_dll/cl_dll.h | 9 +++++++-- cl_dll/util_vector.h | 5 ++++- common/mathlib.h | 4 ++++ dlls/extdll.h | 4 ++++ wscript | 6 ++++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/cl_dll/cl_dll.h b/cl_dll/cl_dll.h index 6ba3db67..232df68e 100644 --- a/cl_dll/cl_dll.h +++ b/cl_dll/cl_dll.h @@ -31,7 +31,8 @@ typedef unsigned char byte; typedef unsigned short word; typedef float vec_t; -typedef int ( *pfnUserMsgHook )( const char *pszName, int iSize, void *pbuf ); +// redefine +//typedef int ( *pfnUserMsgHook )( const char *pszName, int iSize, void *pbuf ); #include "util_vector.h" @@ -43,7 +44,11 @@ typedef int ( *pfnUserMsgHook )( const char *pszName, int iSize, void *pbuf ); #endif #include "exportdef.h" #include - +#if HAVE_CMATH +#include +#else +#include +#endif #if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) #define XASH_64BIT #endif diff --git a/cl_dll/util_vector.h b/cl_dll/util_vector.h index 93166a6b..c83d347f 100644 --- a/cl_dll/util_vector.h +++ b/cl_dll/util_vector.h @@ -22,8 +22,11 @@ // Misc C-runtime library headers #include #include +#if HAVE_CMATH #include - +#else +#include +#endif // Header file containing definition of globalvars_t and entvars_t typedef unsigned int func_t; // typedef int string_t; // from engine's pr_comp.h; diff --git a/common/mathlib.h b/common/mathlib.h index afe44352..62f04d93 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -22,7 +22,11 @@ #include #endif // HAVE_TGMATH_H #else // __cplusplus +#if HAVE_CMATH #include +#else +#include +#endif #endif // __cplusplus typedef float vec_t; diff --git a/dlls/extdll.h b/dlls/extdll.h index eb8c37ec..1f932dc7 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -66,7 +66,11 @@ typedef int BOOL; #include #include #include +#if HAVE_CMATH #include +#else +#include +#endif #ifndef M_PI_F #define M_PI_F (float)M_PI diff --git a/wscript b/wscript index 0e98480f..b01647df 100644 --- a/wscript +++ b/wscript @@ -249,10 +249,16 @@ def configure(conf): conf.define_cond('HAVE_TGMATH_H', tgmath_usable) else: conf.undefine('HAVE_TGMATH_H') + cmath_usable = conf.check_cxx(fragment='''#include + int main(void){ return (int)sqrt(2.0f); }''', + msg='Checking if cmath is usable', mandatory = False) + 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) + elif conf.env.COMPILER_CC == 'owcc': + pass else: conf.env.append_unique('DEFINES', ['stricmp=strcasecmp', 'strnicmp=strncasecmp', '_snprintf=snprintf', '_vsnprintf=vsnprintf', '_LINUX', 'LINUX']) conf.env.append_unique('CXXFLAGS', ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) From 3ebf7f097bcf28c19c3cc76c6adfb571541f45a5 Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:35:25 +0700 Subject: [PATCH 069/298] server: fix include hell in animation.cpp --- dlls/animation.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/animation.cpp b/dlls/animation.cpp index 6ebddc01..0efada33 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -13,6 +13,10 @@ * ****/ +/* all this mess was here to use quake mathlib instead of hlsdk vectors +* it may break debug info or even build because global symbols types differ +* it's better to define VectorCopy macro for Vector class */ +#if 0 #include #include #include @@ -50,7 +54,17 @@ typedef unsigned char byte; #include "enginecallback.h" #endif -extern globalvars_t *gpGlobals; +//extern globalvars_t *gpGlobals; +#else +#include "extdll.h" +#include "util.h" +#include "activity.h" +#include "activitymap.h" +#include "animation.h" +#include "scriptevent.h" +#include "studio.h" +#define VectorCopy(x,y) (y = x) +#endif #pragma warning( disable : 4244 ) From 9a08968453412b7279498d813f7c0b94444e7fae Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:37:46 +0700 Subject: [PATCH 070/298] fix undefined symbols and conflicts on OpenWatcom --- cl_dll/hl/hl_baseentity.cpp | 1 + cl_dll/util.cpp | 4 ++-- dlls/nodes.cpp | 7 +++++-- dlls/util.cpp | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cl_dll/hl/hl_baseentity.cpp b/cl_dll/hl/hl_baseentity.cpp index 38978f6a..2e2ec2d6 100644 --- a/cl_dll/hl/hl_baseentity.cpp +++ b/cl_dll/hl/hl_baseentity.cpp @@ -347,3 +347,4 @@ int CBasePlayerWeapon::ExtractClipAmmo( CBasePlayerWeapon *pWeapon ) { return 0; void CBasePlayerWeapon::RetireWeapon( void ) { } void CSoundEnt::InsertSound( int iType, const Vector &vecOrigin, int iVolume, float flDuration ) {} void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType ){} +void CSprite::AnimateUntilDead( void ) {} diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index cda9fdf4..33e68070 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -33,10 +33,10 @@ #ifndef M_PI_F #define M_PI_F (float)M_PI #endif - extern vec3_t vec3_origin; -#ifdef _MSC_VER +// if C++ mangling differs from C symbol name +#if defined _MSC_VER || defined __WATCOMC__ vec3_t vec3_origin; #endif diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index c8e5649c..f5f399a0 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -42,10 +42,13 @@ CGraph WorldGraph; LINK_ENTITY_TO_CLASS( info_node, CNodeEnt ) LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ) -#if !defined _WIN32 +#ifdef __DOS__ +#include +#define CreateDirectoryA(p, n) mkdir(p) +#elif !defined _WIN32 #include #include -#define CreateDirectoryA(p, n) mkdir(p, 0777) +#define CreateDirectoryA(p, n) mkdir(p,777) #endif //========================================================= diff --git a/dlls/util.cpp b/dlls/util.cpp index 018a2f8e..e2e4292d 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1729,7 +1729,7 @@ void CSaveRestoreBuffer::BufferRewind( int size ) m_pdata->size -= size; } -#ifndef _WIN32 +#if !defined _WIN32 && !defined __WATCOMC__ extern "C" { unsigned _rotr( unsigned val, int shift ) { From c6d793231c4044eb1e57b227e44b200dc1858228 Mon Sep 17 00:00:00 2001 From: mittorn Date: Wed, 12 Feb 2020 15:40:06 +0700 Subject: [PATCH 071/298] wscript: do not set install_path on dos target, set build task names to "server" and "client" --- cl_dll/wscript | 3 ++- dlls/wscript | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index b45242d5..3bc40d56 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -53,7 +53,7 @@ def build(bld): if bld.env.DEST_OS == 'win32': libs += ["USER32"] - if bld.env.DEST_OS not in ['android']: + if bld.env.DEST_OS not in ['android', 'dos']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) else: install_path = bld.env.PREFIX @@ -61,6 +61,7 @@ def build(bld): bld.shlib( source = source, target = 'client' + bld.env.POSTFIX, + name = 'client', features = 'c cxx', includes = includes, defines = defines, diff --git a/dlls/wscript b/dlls/wscript index 24e93e71..2a469153 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -61,7 +61,7 @@ def build(bld): libs = [] - if bld.env.DEST_OS not in ['android']: + if bld.env.DEST_OS not in ['android', 'dos']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR) else: install_path = bld.env.PREFIX @@ -69,6 +69,7 @@ def build(bld): bld.shlib( source = source, target = bld.env.SERVER_NAME + bld.env.POSTFIX, + name = 'server', features = 'c cxx', includes = includes, defines = defines, From 18127ef8488e679bbc2e33140ae30a253c74f181 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 16 Feb 2020 11:19:30 +0300 Subject: [PATCH 072/298] Fix VectorCopy to work correctly with pointers again --- dlls/animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/animation.cpp b/dlls/animation.cpp index 0efada33..10a1241d 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -63,7 +63,7 @@ typedef unsigned char byte; #include "animation.h" #include "scriptevent.h" #include "studio.h" -#define VectorCopy(x,y) (y = x) +#define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} #endif #pragma warning( disable : 4244 ) From 9f93606b500d971e077663f2db62c71258a21a17 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 21 Mar 2020 18:45:13 +0500 Subject: [PATCH 073/298] Fix possible null pointer dereference. --- dlls/bullsquid.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index 01c9e590..e035b0c9 100644 --- a/dlls/bullsquid.cpp +++ b/dlls/bullsquid.cpp @@ -536,6 +536,9 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) { case BSQUID_AE_SPIT: { + if( m_hEnemy == 0 ) + return; + Vector vecSpitOffset; Vector vecSpitDir; From fa50aeeb0cacb313265632fad6a793e55eebfded Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 21 Mar 2020 18:51:14 +0500 Subject: [PATCH 074/298] Fix wrong quotes. --- dlls/extdll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/extdll.h b/dlls/extdll.h index 1f932dc7..d8fdb41f 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -42,7 +42,7 @@ #define NOMCX #define NOIME #define HSPRITE HSPRITE_win32 -#include "windows.h" +#include #undef HSPRITE #else // _WIN32 #ifndef FALSE From 3e1e8961bf3bfad660b15a30472b9c572c8b75a5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 30 Jul 2019 20:08:50 +0300 Subject: [PATCH 075/298] Stop gauss pulse sound on overcharge --- cl_dll/ev_hldm.cpp | 2 ++ dlls/gauss.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 9b100439..53c6cbcf 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -815,6 +815,7 @@ void EV_FirePython( event_args_t *args ) //====================== // GAUSS START //====================== +#define SND_STOP (1 << 5) #define SND_CHANGE_PITCH (1 << 7) // duplicated in protocol.h change sound pitch void EV_SpinGauss( event_args_t *args ) @@ -835,6 +836,7 @@ void EV_SpinGauss( event_args_t *args ) pitch = args->iparam1; iSoundState = args->bparam1 ? SND_CHANGE_PITCH : 0; + iSoundState = args->bparam2 ? SND_STOP : iSoundState; gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "ambience/pulsemachine.wav", 1.0, ATTN_NORM, iSoundState, pitch ); } diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 8bff79a1..96345ad2 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -278,19 +278,27 @@ void CGauss::SecondaryAttack() // ALERT( at_console, "%d %d %d\n", m_fInAttack, m_iSoundState, pitch ); + const bool overcharge = m_pPlayer->m_flStartCharge < gpGlobals->time - 10.0f; + if( m_iSoundState == 0 ) ALERT( at_console, "sound state %d\n", m_iSoundState ); - 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 ); +#ifdef 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 ); m_iSoundState = SND_CHANGE_PITCH; // hack for going through level transitions m_pPlayer->m_iWeaponVolume = GAUSS_PRIMARY_CHARGE_VOLUME; // m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1f; - if( m_pPlayer->m_flStartCharge < gpGlobals->time - 10.0f ) + if( overcharge ) { // Player charged up too long. Zap him. +#ifdef 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 ) ); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/electro6.wav", 1.0f, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) ); From 6af5c3f472f1efc6c65369689499b3431ce0650b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 1 Apr 2020 13:14:14 +0500 Subject: [PATCH 076/298] Safe _snprintf usage. --- cl_dll/text_message.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cl_dll/text_message.cpp b/cl_dll/text_message.cpp index 512623dd..daeacf3f 100644 --- a/cl_dll/text_message.cpp +++ b/cl_dll/text_message.cpp @@ -182,19 +182,23 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf { case HUD_PRINTCENTER: _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + psz[MSG_BUF_SIZE - 1] = '\0'; CenterPrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTNOTIFY: psz[0] = 1; // mark this message to go into the notify buffer _snprintf( psz + 1, MSG_BUF_SIZE - 1, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + psz[MSG_BUF_SIZE - 2] = '\0'; ConsolePrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTTALK: _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + psz[MSG_BUF_SIZE - 1] = '\0'; gHUD.m_SayText.SayTextPrint( ConvertCRtoNL( psz ), MSG_BUF_SIZE ); break; case HUD_PRINTCONSOLE: _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + psz[MSG_BUF_SIZE - 1] = '\0'; ConsolePrint( ConvertCRtoNL( psz ) ); break; } From 0aecf067419cb03d6dc76f413d23958d1cabd6b0 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 22 Apr 2020 13:12:23 +0500 Subject: [PATCH 077/298] Remove GPL-licensed headers. --- cl_dll/wrect.h | 16 ++ common/bspfile.h | 246 -------------------------- common/com_model.h | 423 +++++++++++++++++++------------------------- common/gameinfo.h | 49 ----- common/lightstyle.h | 29 --- common/render_api.h | 261 --------------------------- common/wrect.h | 24 --- engine/cdll_exp.h | 70 -------- engine/custom.h | 2 + engine/menu_int.h | 188 -------------------- engine/warpsin.h | 53 ------ 11 files changed, 198 insertions(+), 1163 deletions(-) create mode 100644 cl_dll/wrect.h delete mode 100644 common/bspfile.h delete mode 100644 common/gameinfo.h delete mode 100644 common/lightstyle.h delete mode 100644 common/render_api.h delete mode 100644 common/wrect.h delete mode 100644 engine/cdll_exp.h delete mode 100644 engine/menu_int.h delete mode 100644 engine/warpsin.h diff --git a/cl_dll/wrect.h b/cl_dll/wrect.h new file mode 100644 index 00000000..007f7dec --- /dev/null +++ b/cl_dll/wrect.h @@ -0,0 +1,16 @@ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= +#pragma once +#if !defined( WRECTH ) +#define WRECTH + +typedef struct rect_s +{ + int left, right, top, bottom; +} wrect_t; + +#endif diff --git a/common/bspfile.h b/common/bspfile.h deleted file mode 100644 index 079e1b21..00000000 --- a/common/bspfile.h +++ /dev/null @@ -1,246 +0,0 @@ -/* -bspfile.h - BSP format included q1, hl1 support -Copyright (C) 2010 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef BSPFILE_H -#define BSPFILE_H - -/* -============================================================================== - -BRUSH MODELS - -.bsp contain level static geometry with including PVS and lightning info -============================================================================== -*/ - -// header -#define Q1BSP_VERSION 29 // quake1 regular version (beta is 28) -#define HLBSP_VERSION 30 // half-life regular version -#define XTBSP_VERSION 31 // extended lightmaps and expanded clipnodes limit - -#define IDEXTRAHEADER (('H'<<24)+('S'<<16)+('A'<<8)+'X') // little-endian "XASH" -#define EXTRA_VERSION 2 // because version 1 was occupied by old versions of XashXT - -#define DELUXEMAP_VERSION 1 -#define IDDELUXEMAPHEADER (('T'<<24)+('I'<<16)+('L'<<8)+'Q') // little-endian "QLIT" - -// worldcraft predefined angles -#define ANGLE_UP -1 -#define ANGLE_DOWN -2 - -// bmodel limits -#define MAX_MAP_HULLS 4 // MAX_HULLS - -#define SURF_NOCULL BIT( 0 ) // two-sided polygon (e.g. 'water4b') -#define SURF_PLANEBACK BIT( 1 ) // plane should be negated -#define SURF_DRAWSKY BIT( 2 ) // sky surface -#define SURF_WATERCSG BIT( 3 ) // culled by csg (was SURF_DRAWSPRITE) -#define SURF_DRAWTURB BIT( 4 ) // warp surface -#define SURF_DRAWTILED BIT( 5 ) // face without lighmap -#define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND) -#define SURF_UNDERWATER BIT( 7 ) // caustics -#define SURF_TRANSPARENT BIT( 8 ) // it's a transparent texture (was SURF_DONTWARP) - -#define SURF_REFLECT BIT( 31 ) // reflect surface (mirror) - -// lightstyle management -#define LM_STYLES 4 // MAXLIGHTMAPS -#define LS_NORMAL 0x00 -#define LS_UNUSED 0xFE -#define LS_NONE 0xFF - -#define MAX_MAP_MODELS 1024 // can be increased up to 2048 if needed -#define MAX_MAP_BRUSHES 32768 // unsigned short limit -#define MAX_MAP_ENTITIES 8192 // can be increased up to 32768 if needed -#define MAX_MAP_ENTSTRING 0x80000 // 512 kB should be enough -#define MAX_MAP_PLANES 65536 // can be increased without problems -#define MAX_MAP_NODES 32767 // because negative shorts are leafs -#define MAX_MAP_CLIPNODES 32767 // because negative shorts are contents -#define MAX_MAP_LEAFS 32767 // signed short limit -#define MAX_MAP_VERTS 65535 // unsigned short limit -#define MAX_MAP_FACES 65535 // unsigned short limit -#define MAX_MAP_MARKSURFACES 65535 // unsigned short limit -#define MAX_MAP_TEXINFO MAX_MAP_FACES // in theory each face may have personal texinfo -#define MAX_MAP_EDGES 0x100000 // can be increased but not needed -#define MAX_MAP_SURFEDGES 0x200000 // can be increased but not needed -#define MAX_MAP_TEXTURES 2048 // can be increased but not needed -#define MAX_MAP_MIPTEX 0x2000000 // 32 Mb internal textures data -#define MAX_MAP_LIGHTING 0x2000000 // 32 Mb lightmap raw data (can contain deluxemaps) -#define MAX_MAP_VISIBILITY 0x800000 // 8 Mb visdata - -// quake lump ordering -#define LUMP_ENTITIES 0 -#define LUMP_PLANES 1 -#define LUMP_TEXTURES 2 // internal textures -#define LUMP_VERTEXES 3 -#define LUMP_VISIBILITY 4 -#define LUMP_NODES 5 -#define LUMP_TEXINFO 6 -#define LUMP_FACES 7 -#define LUMP_LIGHTING 8 -#define LUMP_CLIPNODES 9 -#define LUMP_LEAFS 10 -#define LUMP_MARKSURFACES 11 -#define LUMP_EDGES 12 -#define LUMP_SURFEDGES 13 -#define LUMP_MODELS 14 // internal submodels -#define HEADER_LUMPS 15 - -// version 31 -#define LUMP_CLIPNODES2 15 // hull0 goes into LUMP_NODES, hull1 goes into LUMP_CLIPNODES, -#define LUMP_CLIPNODES3 16 // hull2 goes into LUMP_CLIPNODES2, hull3 goes into LUMP_CLIPNODES3 -#define HEADER_LUMPS_31 17 - -#define LUMP_FACES_EXTRADATA 0 // extension of dface_t -#define LUMP_VERTS_EXTRADATA 1 // extension of dvertex_t -#define LUMP_CUBEMAPS 2 // cubemap description - -#define EXTRA_LUMPS 8 // g-cont. just for future expansions - -// texture flags -#define TEX_SPECIAL BIT( 0 ) // sky or slime, no lightmap or 256 subdivision - -// ambient sound types -enum -{ - AMBIENT_WATER = 0, // waterfall - AMBIENT_SKY, // wind - AMBIENT_SLIME, // never used in quake - AMBIENT_LAVA, // never used in quake - NUM_AMBIENTS // automatic ambient sounds -}; - -// -// BSP File Structures -// - -typedef struct -{ - int fileofs; - int filelen; -} dlump_t; - -typedef struct -{ - int version; - dlump_t lumps[HEADER_LUMPS]; -} dheader_t; - -typedef struct -{ - int version; - dlump_t lumps[HEADER_LUMPS_31]; -} dheader31_t; - -typedef struct -{ - int id; // must be little endian XASH - int version; - dlump_t lumps[EXTRA_LUMPS]; -} dextrahdr_t; - -typedef struct -{ - vec3_t mins; - vec3_t maxs; - vec3_t origin; // for sounds or lights - int headnode[MAX_MAP_HULLS]; - int visleafs; // not including the solid leaf 0 - int firstface; - int numfaces; -} dmodel_t; - -typedef struct -{ - int nummiptex; - int dataofs[4]; // [nummiptex] -} dmiptexlump_t; - -typedef struct -{ - vec3_t point; -} dvertex_t; - -typedef struct -{ - vec3_t normal; - float dist; - int type; // PLANE_X - PLANE_ANYZ ? -} dplane_t; - -typedef struct -{ - int planenum; - short children[2]; // negative numbers are -(leafs + 1), not nodes - short mins[3]; // for sphere culling - short maxs[3]; - word firstface; - word numfaces; // counting both sides -} dnode_t; - -// leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas -// all other leafs need visibility info -typedef struct -{ - int contents; - int visofs; // -1 = no visibility info - - short mins[3]; // for frustum culling - short maxs[3]; - word firstmarksurface; - word nummarksurfaces; - - // automatic ambient sounds - byte ambient_level[NUM_AMBIENTS]; // ambient sound level (0 - 255) -} dleaf_t; - -typedef struct -{ - int planenum; - short children[2]; // negative numbers are contents -} dclipnode_t; - -typedef struct -{ - float vecs[2][4]; // texmatrix [s/t][xyz offset] - int miptex; - int flags; -} dtexinfo_t; - -typedef word dmarkface_t; // leaf marksurfaces indexes -typedef int dsurfedge_t; // map surfedges - -// NOTE: that edge 0 is never used, because negative edge nums -// are used for counterclockwise use of the edge in a face -typedef struct -{ - word v[2]; // vertex numbers -} dedge_t; - -typedef struct -{ - word planenum; - short side; - - int firstedge; // we must support > 64k edges - short numedges; - short texinfo; - - // lighting info - byte styles[LM_STYLES]; - int lightofs; // start of [numstyles*surfsize] samples -} dface_t; - -#endif//BSPFILE_H diff --git a/common/com_model.h b/common/com_model.h index 631373fc..09b83936 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -1,59 +1,80 @@ -/* -com_model.h - cient model structures -Copyright (C) 2010 Uncle Mike +//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ +// com_model.h #pragma once -#ifndef COM_MODEL_H +#if !defined( COM_MODEL_H ) #define COM_MODEL_H -#include "bspfile.h" // we need some declarations from it +#define STUDIO_RENDER 1 +#define STUDIO_EVENTS 2 -typedef vec_t vec2_t[2]; -typedef vec_t vec4_t[4]; +#define MAX_CLIENTS 32 +#define MAX_EDICTS 900 -/* -============================================================================== +#define MAX_MODEL_NAME 64 +#define MAX_MAP_HULLS 4 +#define MIPLEVELS 4 +#define NUM_AMBIENTS 4 // automatic ambient sounds +#define MAXLIGHTMAPS 4 +#define PLANE_ANYZ 5 - ENGINE MODEL FORMAT -============================================================================== -*/ -#define STUDIO_RENDER 1 -#define STUDIO_EVENTS 2 +#define ALIAS_Z_CLIP_PLANE 5 -#define ZISCALE ((float)0x8000) +// flags in finalvert_t.flags +#define ALIAS_LEFT_CLIP 0x0001 +#define ALIAS_TOP_CLIP 0x0002 +#define ALIAS_RIGHT_CLIP 0x0004 +#define ALIAS_BOTTOM_CLIP 0x0008 +#define ALIAS_Z_CLIP 0x0010 +#define ALIAS_ONSEAM 0x0020 +#define ALIAS_XY_CLIP_MASK 0x000F -#define MIPLEVELS 4 -#define VERTEXSIZE 7 -#define MAXLIGHTMAPS 4 -#define NUM_AMBIENTS 4 // automatic ambient sounds +#define ZISCALE ((float)0x8000) + +#define CACHE_SIZE 32 // used to align key data structures -// model types typedef enum { - mod_bad = -1, mod_brush, mod_sprite, mod_alias, mod_studio } modtype_t; +// must match definition in modelgen.h +#ifndef SYNCTYPE_T +#define SYNCTYPE_T + +typedef enum +{ + ST_SYNC=0, + ST_RAND +} synctype_t; + +#endif + +typedef struct +{ + float mins[3], maxs[3]; + float origin[3]; + int headnode[MAX_MAP_HULLS]; + int visleafs; // not including the solid leaf 0 + int firstface, numfaces; +} dmodel_t; + +// plane_t structure typedef struct mplane_s { - vec3_t normal; - float dist; - byte type; // for fast side tests - byte signbits; // signx + (signy<<1) + (signz<<1) - byte pad[2]; + vec3_t normal; // surface normal + float dist; // closest appoach to origin + byte type; // for texture axis selection and fast side tests + byte signbits; // signx + signy<<1 + signz<<1 + byte pad[2]; } mplane_t; typedef struct @@ -70,292 +91,246 @@ typedef struct typedef struct texture_s { char name[16]; - unsigned int width, height; - int gl_texturenum; - struct msurface_s *texturechain; // for gl_texsort drawing - int anim_total; // total tenths in sequence ( 0 = no) - int anim_min, anim_max; // time for this frame min <=time< max - struct texture_s *anim_next; // in the animation sequence - struct texture_s *alternate_anims; // bmodels in frame 1 use these - unsigned short fb_texturenum; // auto-luma texturenum - unsigned short dt_texturenum; // detail-texture binding - unsigned int unused[3]; // reserved + unsigned width, height; + int anim_total; // total tenths in sequence ( 0 = no) + int anim_min, anim_max; // time for this frame min <=time< max + struct texture_s *anim_next; // in the animation sequence + struct texture_s *alternate_anims; // bmodels in frame 1 use these + unsigned offsets[MIPLEVELS]; // four mip maps stored + unsigned paloffset; } texture_t; typedef struct { - float vecs[2][4]; // [s/t] unit vectors in world space. - // [i][3] is the s/t offset relative to the origin. - // s or t = dot( 3Dpoint, vecs[i] ) + vecs[i][3] - float mipadjust; // mipmap limits for very small surfaces - texture_t *texture; - int flags; // sky or slime, no lightmap or 256 subdivision + float vecs[2][4]; // [s/t] unit vectors in world space. + // [i][3] is the s/t offset relative to the origin. + // s or t = dot(3Dpoint,vecs[i])+vecs[i][3] + float mipadjust; // ?? mipmap limits for very small surfaces + texture_t *texture; + int flags; // sky or slime, no lightmap or 256 subdivision } mtexinfo_t; -// 73 bytes per VBO vertex -// FIXME: align to 32 bytes -typedef struct glvert_s -{ - vec3_t vertex; // position - vec3_t normal; // normal - vec2_t stcoord; // ST texture coords - vec2_t lmcoord; // ST lightmap coords - vec2_t sccoord; // ST scissor coords (decals only) - for normalmap coords migration - vec3_t tangent; // tangent - vec3_t binormal; // binormal - byte color[4]; // colors per vertex -} glvert_t; - -typedef struct glpoly_s -{ - struct glpoly_s *next; - struct glpoly_s *chain; - int numverts; - int flags; // for SURF_UNDERWATER - float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2) -} glpoly_t; - typedef struct mnode_s { // common with leaf - int contents; // 0, to differentiate from leafs - int visframe; // node needs to be traversed if current + int contents; // 0, to differentiate from leafs + int visframe; // node needs to be traversed if current + + short minmaxs[6]; // for bounding box culling - float minmaxs[6]; // for bounding box culling struct mnode_s *parent; // node specific - mplane_t *plane; + mplane_t *plane; struct mnode_s *children[2]; - unsigned short firstsurface; - unsigned short numsurfaces; + unsigned short firstsurface; + unsigned short numsurfaces; } mnode_t; typedef struct msurface_s msurface_t; -typedef struct decal_s decal_t; +typedef struct decal_s decal_t; // JAY: Compress this as much as possible struct decal_s { - decal_t *pnext; // linked list for each surface - msurface_t *psurface; // Surface id for persistence / unlinking - float dx; // local texture coordinates - float dy; // - float scale; // Pixel scale + decal_t *pnext; // linked list for each surface + msurface_t *psurface; // Surface id for persistence / unlinking + short dx; // Offsets into surface texture (in texture coordinates, so we don't need floats) + short dy; short texture; // Decal texture - byte flags; // Decal flags FDECAL_* + byte scale; // Pixel scale + byte flags; // Decal flags + short entityIndex; // Entity this is attached to -// Xash3D added - vec3_t position; // location of the decal center in world space. - vec3_t saxis; // direction of the s axis in world space - struct msurfmesh_s *mesh; // decal mesh in local space - int reserved[4]; // for future expansions }; typedef struct mleaf_s { // common with node - int contents; - int visframe; // node needs to be traversed if current + int contents; // wil be a negative contents number + int visframe; // node needs to be traversed if current - float minmaxs[6]; // for bounding box culling + short minmaxs[6]; // for bounding box culling struct mnode_s *parent; + // leaf specific byte *compressed_vis; struct efrag_s *efrags; msurface_t **firstmarksurface; - int nummarksurfaces; - byte *compressed_pas; + int nummarksurfaces; + int key; // BSP sequence number for leaf's contents byte ambient_sound_level[NUM_AMBIENTS]; - } mleaf_t; struct msurface_s { - int visframe; // should be drawn when node is crossed + int visframe; // should be drawn when node is crossed - mplane_t *plane; // pointer to shared plane - int flags; // see SURF_ #defines + int dlightframe; // last frame the surface was checked by an animated light + int dlightbits; // dynamically generated. Indicates if the surface illumination + // is modified by an animated light. - int firstedge; // look up in model->surfedges[], negative numbers - int numedges; // are backwards edges + mplane_t *plane; // pointer to shared plane + int flags; // see SURF_ #defines - short texturemins[2]; - short extents[2]; + int firstedge; // look up in model->surfedges[], negative numbers + int numedges; // are backwards edges + +// surface generation data + struct surfcache_s *cachespots[MIPLEVELS]; - int light_s, light_t; // gl lightmap coordinates + short texturemins[2]; // smallest s/t position on the surface. + short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces - glpoly_t *polys; // multiple if warped - struct msurface_s *texturechain; - - mtexinfo_t *texinfo; - - // lighting info - int dlightframe; // last frame the surface was checked by an animated light - int dlightbits; // dynamically generated. Indicates if the surface illumination - // is modified by an animated light. - - int lightmaptexturenum; - byte styles[MAXLIGHTMAPS]; - int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap - struct msurface_s *lightmapchain; // for new dlights rendering (was cached_dlight) - - color24 *samples; // note: this is the actual lightmap data for this surface + mtexinfo_t *texinfo; + +// lighting info + byte styles[MAXLIGHTMAPS]; // index into d_lightstylevalue[] for animated lights + // no one surface can be effected by more than 4 + // animated lights. + color24 *samples; + decal_t *pdecals; }; -typedef struct msurfmesh_s +typedef struct { - unsigned short numVerts; - unsigned short numElems; // ~ 20 000 vertex per one surface. Should be enough - unsigned int startVert; // user-variable. may be used for construct world single-VBO - unsigned int startElem; // user-variable. may be used for construct world single-VBO - - glvert_t *verts; // vertexes array - unsigned short *elems; // indices - - struct msurface_s *surf; // pointer to parent surface. Just for consistency - struct msurfmesh_s *next; // temporary chain of subdivided surfaces -} msurfmesh_t; - -// surface extradata stored in cache.data for all brushmodels -typedef struct mextrasurf_s -{ - vec3_t mins, maxs; - vec3_t origin; // surface origin - msurfmesh_t *mesh; // VBO\VA ready surface mesh. Not used by engine but can be used by mod-makers - - int dlight_s, dlight_t; // gl lightmap coordinates for dynamic lightmaps - - int mirrortexturenum; // gl texnum - float mirrormatrix[4][4]; - struct mextrasurf_s *mirrorchain; // for gl_texsort drawing - struct mextrasurf_s *detailchain; // for detail textures drawing - color24 *deluxemap; // note: this is the actual deluxemap data for this surface - - int reserved[32]; // just for future expansions or mod-makers -} mextrasurf_t; + int planenum; + short children[2]; // negative numbers are contents +} dclipnode_t; typedef struct hull_s { dclipnode_t *clipnodes; - mplane_t *planes; - int firstclipnode; - int lastclipnode; + mplane_t *planes; + int firstclipnode; + int lastclipnode; vec3_t clip_mins; vec3_t clip_maxs; } hull_t; -#ifndef CACHE_USER +#if !defined( CACHE_USER ) && !defined( QUAKEDEF_H ) #define CACHE_USER typedef struct cache_user_s { - void *data; // extradata + void *data; } cache_user_t; #endif typedef struct model_s { - char name[64]; // model name - qboolean needload; // bmodels and sprites don't cache normally + char name[ MAX_MODEL_NAME ]; + qboolean needload; // bmodels and sprites don't cache normally - // shared modelinfo - modtype_t type; // model type - int numframes; // sprite's framecount - byte *mempool; // private mempool (was synctype) - int flags; // hl compatibility + modtype_t type; + int numframes; + synctype_t synctype; + + int flags; // // volume occupied by the model -// - vec3_t mins, maxs; // bounding box at angles '0 0 0' +// + vec3_t mins, maxs; float radius; - - // brush model - int firstmodelsurface; - int nummodelsurfaces; - int numsubmodels; - dmodel_t *submodels; // or studio animations +// +// brush model +// + int firstmodelsurface, nummodelsurfaces; - int numplanes; - mplane_t *planes; + int numsubmodels; + dmodel_t *submodels; - int numleafs; // number of visible leafs, not counting 0 - mleaf_t *leafs; + int numplanes; + mplane_t *planes; - int numvertexes; - mvertex_t *vertexes; + int numleafs; // number of visible leafs, not counting 0 + struct mleaf_s *leafs; - int numedges; + int numvertexes; + mvertex_t *vertexes; + + int numedges; medge_t *edges; - int numnodes; + int numnodes; mnode_t *nodes; - int numtexinfo; + int numtexinfo; mtexinfo_t *texinfo; - int numsurfaces; + int numsurfaces; msurface_t *surfaces; - int numsurfedges; - int *surfedges; + int numsurfedges; + int *surfedges; - int numclipnodes; + int numclipnodes; dclipnode_t *clipnodes; - int nummarksurfaces; + int nummarksurfaces; msurface_t **marksurfaces; hull_t hulls[MAX_MAP_HULLS]; - int numtextures; - texture_t **textures; + int numtextures; + texture_t **textures; byte *visdata; color24 *lightdata; + char *entities; + // // additional model data // cache_user_t cache; // only access through Mod_Extradata + } model_t; +typedef vec_t vec4_t[4]; + typedef struct alight_s { - int ambientlight; // clip at 128 - int shadelight; // clip at 192 - ambientlight + int ambientlight; // clip at 128 + int shadelight; // clip at 192 - ambientlight vec3_t color; float *plightvec; } alight_t; typedef struct auxvert_s { - float fv[3]; // viewspace x, y + float fv[3]; // viewspace x, y } auxvert_t; -#define MAX_SCOREBOARDNAME 32 -#define MAX_INFO_STRING 256 - #include "custom.h" +#define MAX_INFO_STRING 256 +#define MAX_SCOREBOARDNAME 32 typedef struct player_info_s { - int userid; // User id on server - char userinfo[MAX_INFO_STRING]; // User info string - char name[MAX_SCOREBOARDNAME]; // Name (extracted from userinfo) - int spectator; // Spectator or not, unused + // User id on server + int userid; + + // User info string + char userinfo[ MAX_INFO_STRING ]; + + // Name + char name[ MAX_SCOREBOARDNAME ]; + + // Spectator or not, unused + int spectator; int ping; int packet_loss; // skin information - char model[64]; + char model[MAX_QPATH]; int topcolor; int bottomcolor; @@ -364,50 +339,12 @@ typedef struct player_info_s // Gait frame estimation int gaitsequence; - float gaitframe; - float gaityaw; - vec3_t prevgaitorigin; + float gaitframe; + float gaityaw; + vec3_t prevgaitorigin; - customization_t customdata; + customization_t customdata; } player_info_t; -// -// sprite representation in memory -// -typedef enum { SPR_SINGLE = 0, SPR_GROUP, SPR_ANGLED } spriteframetype_t; +#endif // COM_MODEL_H -typedef struct mspriteframe_s -{ - int width; - int height; - float up, down, left, right; - int gl_texturenum; -} mspriteframe_t; - -typedef struct -{ - int numframes; - float *intervals; - mspriteframe_t *frames[1]; -} mspritegroup_t; - -typedef struct -{ - spriteframetype_t type; - mspriteframe_t *frameptr; -} mspriteframedesc_t; - -typedef struct -{ - short type; - short texFormat; - int maxwidth; - int maxheight; - int numframes; - int radius; - int facecull; - int synctype; - mspriteframedesc_t frames[1]; -} msprite_t; - -#endif//COM_MODEL_H diff --git a/common/gameinfo.h b/common/gameinfo.h deleted file mode 100644 index ab5f649c..00000000 --- a/common/gameinfo.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -gameinfo.h - current game info -Copyright (C) 2010 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef GAMEINFO_H -#define GAMEINFO_H - -#define GFL_NOMODELS (1<<0) - -/* -======================================================================== - -GAMEINFO stuff - -internal shared gameinfo structure (readonly for engine parts) -======================================================================== -*/ -typedef struct -{ - // filesystem info - char gamefolder[64]; // used for change game '-game x' - char startmap[64]; // map to start singleplayer game - char trainmap[64]; // map to start hazard course (if specified) - char title[64]; // Game Main Title - char version[14]; // game version (optional) - short flags; // game flags - - // about mod info - char game_url[256]; // link to a developer's site - char update_url[256]; // link to updates page - char type[64]; // single, toolkit, multiplayer etc - char date[64]; - char size[64]; // displayed mod size - - int gamemode; -} GAMEINFO; - -#endif//GAMEINFO_H diff --git a/common/lightstyle.h b/common/lightstyle.h deleted file mode 100644 index a12702f4..00000000 --- a/common/lightstyle.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -lightstyle.h - lighstyle description -Copyright (C) 2011 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef LIGHTSTYLE_H -#define LIGHTSTYLE_H - -typedef struct -{ - char pattern[256]; - float map[256]; - int length; - float value; - qboolean interp; // allow to interpolate this lightstyle - float time; // local time is gurantee what new style begins from the start, not mid or end of the sequence -} lightstyle_t; - -#endif//LIGHTSTYLE_H diff --git a/common/render_api.h b/common/render_api.h deleted file mode 100644 index 03973f27..00000000 --- a/common/render_api.h +++ /dev/null @@ -1,261 +0,0 @@ -/* -render_api.h - Xash3D extension for client interface -Copyright (C) 2011 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef RENDER_API_H -#define RENDER_API_H - -#include "lightstyle.h" -#include "dlight.h" - -// changes for version 28 -// replace decal_t from software declaration to hardware (matched to normal HL) -// mextrasurf_t->increased limit of reserved fields (up from 7 to 32) -// replace R_StoreEfrags with him extended version -// formed group for BSP decal manipulating -// move misc functions at end of the interface -// added new export for clearing studio decals - -#define CL_RENDER_INTERFACE_VERSION 35 -#define MAX_STUDIO_DECALS 4096 // + unused space of BSP decals - -#define SURF_INFO( surf, mod ) ((mextrasurf_t *)mod->cache.data + (surf - mod->surfaces)) -#define INFO_SURF( surf, mod ) (mod->surfaces + (surf - (mextrasurf_t *)mod->cache.data)) - -// render info parms -#define PARM_TEX_WIDTH 1 // all parms with prefix 'TEX_' receive arg as texnum -#define PARM_TEX_HEIGHT 2 // otherwise it's not used -#define PARM_TEX_SRC_WIDTH 3 -#define PARM_TEX_SRC_HEIGHT 4 -#define PARM_TEX_SKYBOX 5 // second arg as skybox ordering num -#define PARM_TEX_SKYTEXNUM 6 // skytexturenum for quake sky -#define PARM_TEX_LIGHTMAP 7 // second arg as number 0 - 128 -#define PARM_TEX_TARGET 8 -#define PARM_TEX_TEXNUM 9 -#define PARM_TEX_FLAGS 10 -#define PARM_TEX_TYPE 11 -#define PARM_TEX_CACHEFRAME 12 // compare with worldmodel->needload -#define PARM_TEX_GLFORMAT 13 // get a texture GL-format -// reserved -#define PARM_WORLD_VERSION 16 // return the version of bsp -#define PARM_SKY_SPHERE 17 // sky is quake sphere ? -#define PARM_MAP_HAS_MIRRORS 18 // current map has mirorrs -#define PARM_MAP_HAS_DELUXE 19 // map has deluxedata -#define PARM_MAX_ENTITIES 20 -#define PARM_WIDESCREEN 21 -#define PARM_FULLSCREEN 22 -#define PARM_SCREEN_WIDTH 23 -#define PARM_SCREEN_HEIGHT 24 -#define PARM_CLIENT_INGAME 25 -#define PARM_FEATURES 26 // same as movevars->features -#define PARM_ACTIVE_TMU 27 // for debug -#define PARM_CACHEFRAME 28 -#define PARM_MAX_IMAGE_UNITS 29 -#define PARM_CLIENT_ACTIVE 30 -#define PARM_REBUILD_GAMMA 31 // if true lightmaps rebuilding for gamma change - -enum -{ - // skybox ordering - SKYBOX_RIGHT = 0, - SKYBOX_BACK, - SKYBOX_LEFT, - SKYBOX_FORWARD, - SKYBOX_UP, - SKYBOX_DOWN, -}; - -typedef enum -{ - TEX_INVALID = 0, // free slot - TEX_SYSTEM, // generated by engine - TEX_NOMIP, // hud pics, menu etc - TEX_BRUSH, // a map texture - TEX_SPRITE, // sprite frames - TEX_STUDIO, // studio skins - TEX_LIGHTMAP, // lightmap textures - TEX_DECAL, // decals - TEX_VGUI, // vgui fonts or images - TEX_CUBEMAP, // cubemap textures (sky) - TEX_DETAIL, // detail textures - TEX_REMAP, // local copy of remap texture - TEX_SCREENCOPY, // keep screen copy e.g. for mirror - TEX_CUSTOM, // user created texture - TEX_DEPTHMAP // shadowmap texture -} texType_t; - -typedef enum -{ - TF_NEAREST = (1<<0), // disable texfilter - TF_KEEP_RGBDATA = (1<<1), // some images keep source - TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20 - TF_KEEP_8BIT = (1<<3), // keep original 8-bit image (if present) - TF_NOPICMIP = (1<<4), // ignore r_picmip resample rules - TF_UNCOMPRESSED = (1<<5), // don't compress texture in video memory - TF_CUBEMAP = (1<<6), // it's cubemap texture - TF_DEPTHMAP = (1<<7), // custom texture filter used - TF_INTENSITY = (1<<8), // monochrome intensity image - TF_LUMINANCE = (1<<9), // force image to grayscale - TF_SKYSIDE = (1<<10), // this is a part of skybox - TF_CLAMP = (1<<11), // clamp texcoords to [0..1] range - TF_NOMIPMAP = (1<<12), // don't build mips for this image - TF_HAS_LUMA = (1<<13), // sets by GL_UploadTexture - TF_MAKELUMA = (1<<14), // create luma from quake texture (only q1 textures contain luma-pixels) - TF_NORMALMAP = (1<<15), // is a normalmap - TF_HAS_ALPHA = (1<<16), // image has alpha (used only for GL_CreateTexture) - TF_FORCE_COLOR = (1<<17), // force upload monochrome textures as RGB (detail textures) - TF_TEXTURE_1D = (1<<18), // this is GL_TEXTURE_1D - TF_BORDER = (1<<19), // zero clamp for projected textures - TF_TEXTURE_3D = (1<<20), // this is GL_TEXTURE_3D - TF_STATIC = (1<<21), // a marker for purge mechanism (not used by engine) - TF_TEXTURE_RECTANGLE= (1<<22), // this is GL_TEXTURE_RECTANGLE - TF_ALPHA_BORDER = (1<<23), // clamp to (0,0,0,255) (probably no difference) - TF_IMAGE_PROGRAM = (1<<24), // enable image program support like in Doom3 - TF_ALPHACONTRAST = (1<<25), // special texture flags for internal usage - TF_FLOAT = (1<<26), // float textures - TF_NOCOMPARE = (1<<27), // disable comparing for depth textures - TF_FLOATDATA = (1<<28), // incoming dataType has type GL_FLOAT -} texFlags_t; - -typedef struct beam_s BEAM; -typedef struct particle_s particle_t; - -// 12 bytes here -typedef struct modelstate_s -{ - short sequence; - short frame; // 10 bits multiple by 4, should be enough - byte blending[2]; - byte controller[4]; - byte body; - byte skin; -} modelstate_t; - -typedef struct decallist_s -{ - vec3_t position; - char name[64]; - short entityIndex; - byte depth; - byte flags; - float scale; - - // this is the surface plane that we hit so that - // we can move certain decals across - // transitions if they hit similar geometry - vec3_t impactPlaneNormal; - - modelstate_t studio_state; // studio decals only -} decallist_t; - -typedef struct render_api_s -{ - // Get renderer info (doesn't changes engine state at all) - int (*RenderGetParm)( int parm, int arg ); // generic - void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale ); - void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha ); - lightstyle_t* (*GetLightStyle)( int number ); - dlight_t* (*GetDynamicLight)( int number ); - dlight_t* (*GetEntityLight)( int number ); - byte (*TextureToTexGamma)( byte color ); // software gamma support - void (*GetBeamChains)( BEAM ***active_beams, BEAM ***free_beams, particle_t ***free_trails ); - - // Set renderer info (tell engine about changes) - void (*R_SetCurrentEntity)( struct cl_entity_s *ent ); // tell engine about both currententity and currentmodel - void (*R_SetCurrentModel)( struct model_s *mod ); // change currentmodel but leave currententity unchanged - void (*GL_SetWorldviewProjectionMatrix)( const float *glmatrix ); // update viewprojection matrix (tracers uses it) - void (*R_StoreEfrags)( struct efrag_s **ppefrag, int framecount );// store efrags for static entities - - // Texture tools - int (*GL_FindTexture)( const char *name ); - const char* (*GL_TextureName)( unsigned int texnum ); - const byte* (*GL_TextureData)( unsigned int texnum ); // may be NULL - int (*GL_LoadTexture)( const char *name, const byte *buf, size_t size, int flags ); - int (*GL_CreateTexture)( const char *name, int width, int height, const void *buffer, int flags ); - void (*GL_SetTextureType)( unsigned int texnum, unsigned int type ); - void (*GL_TextureCacheFrame)( unsigned int texnum ); - void (*GL_FreeTexture)( unsigned int texnum ); - - // Decals manipulating (draw & remove) - void (*DrawSingleDecal)( struct decal_s *pDecal, struct msurface_s *fa ); - float *(*R_DecalSetupVerts)( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount ); - void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only) - - // AVIkit support - void *(*AVI_LoadVideo)( const char *filename, int ignore_hwgamma ); - int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration ); - long (*AVI_GetVideoFrameNumber)( void *Avi, float time ); - byte *(*AVI_GetVideoFrame)( void *Avi, long frame ); - void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data ); - void (*AVI_FreeVideo)( void *Avi ); - int (*AVI_IsActive)( void *Avi ); - - // glState related calls (must use this instead of normal gl-calls to prevent de-synchornize local states between engine and the client) - void (*GL_Bind)( int tmu, unsigned int texnum ); - void (*GL_SelectTexture)( int tmu ); - void (*GL_LoadTextureMatrix)( const float *glmatrix ); - void (*GL_TexMatrixIdentity)( void ); - void (*GL_CleanUpTextureUnits)( int last ); // pass 0 for clear all the texture units - void (*GL_TexGen)( unsigned int coord, unsigned int mode ); - void (*GL_TextureTarget)( unsigned int target ); // change texture unit mode without bind texture - void (*GL_TexCoordArrayMode)( unsigned int texmode ); - void (*GL_Reserved0)( void ); // for potential interface expansion without broken compatibility - void (*GL_Reserved1)( void ); - void (*GL_Reserved2)( void ); - void (*GL_Reserved3)( void ); - - // Misc renderer functions - void (*GL_DrawParticles)( const float *vieworg, const float *fwd, const float *rt, const float *up, unsigned int clipFlags ); - void (*EnvShot)( const float *vieworg, const char *name, qboolean skyshot, int shotsize ); // creates a cubemap or skybox into gfx\env folder - int (*COM_CompareFileTime)( const char *filename1, const char *filename2, int *iCompare ); - void (*Host_Error)( const char *error, ... ); // cause Host Error - int (*SPR_LoadExt)( const char *szPicName, unsigned int texFlags ); // extended version of SPR_Load - void (*TessPolygon)( struct msurface_s *surf, struct model_s *mod, float tessSize ); - struct mstudiotex_s *( *StudioGetTexture )( struct cl_entity_s *e ); - const struct ref_overview_s *( *GetOverviewParms )( void ); - void (*S_FadeMusicVolume)( float fadePercent ); // fade background track (0-100 percents) - void (*SetRandomSeed)( long lSeed ); // set custom seed for RANDOM_FLOAT\RANDOM_LONG for predictable random - // static allocations - void *(*pfnMemAlloc)( size_t cb, const char *filename, const int fileline ); - void (*pfnMemFree)( void *mem, const char *filename, const int fileline ); - // find in files - char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly ); - // ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 35 -} render_api_t; - -// render callbacks -typedef struct render_interface_s -{ - int version; - // passed through R_RenderFrame (0 - use engine renderer, 1 - use custom client renderer) - int (*GL_RenderFrame)( const struct ref_params_s *pparams, qboolean drawWorld ); - // build all the lightmaps on new level or when gamma is changed - void (*GL_BuildLightmaps)( void ); - // setup map bounds for ortho-projection when we in dev_overview mode - void (*GL_OrthoBounds)( const float *mins, const float *maxs ); - // handle decals which hit mod_studio or mod_sprite - void (*R_StudioDecalShoot)( int decalTexture, struct cl_entity_s *ent, const float *start, const float *pos, int flags, modelstate_t *state ); - // prepare studio decals for save - int (*R_CreateStudioDecalList)( decallist_t *pList, int count, qboolean changelevel ); - // clear decals by engine request (e.g. for demo recording or vid_restart) - void (*R_ClearStudioDecals)( void ); - // grab r_speeds message - qboolean (*R_SpeedsMessage)( char *out, size_t size ); - // replace with built-in R_DrawCubemapView for make skyshots or envshots - qboolean (*R_DrawCubemapView)( const float *origin, const float *angles, int size ); - // alloc or destroy studiomodel custom data - void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer ); -} render_interface_t; - -#endif//RENDER_API_H diff --git a/common/wrect.h b/common/wrect.h deleted file mode 100644 index 51e84d88..00000000 --- a/common/wrect.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -wrect.h - rectangle definition -Copyright (C) 2010 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef WRECT_H -#define WRECT_H - -typedef struct wrect_s -{ - int left, right, top, bottom; -} wrect_t; - -#endif//WRECT_H diff --git a/engine/cdll_exp.h b/engine/cdll_exp.h deleted file mode 100644 index e4c1f5d8..00000000 --- a/engine/cdll_exp.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -cdll_exp.h - exports for client -Copyright (C) 2013 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef CDLL_EXP_H -#define CDLL_EXP_H - -// NOTE: ordering is important! -typedef struct cldll_func_s -{ - int (*pfnInitialize)( cl_enginefunc_t *pEnginefuncs, int iVersion ); - void (*pfnInit)( void ); - int (*pfnVidInit)( void ); - int (*pfnRedraw)( float flTime, int intermission ); - int (*pfnUpdateClientData)( client_data_t *cdata, float flTime ); - void (*pfnReset)( void ); - void (*pfnPlayerMove)( struct playermove_s *ppmove, int server ); - void (*pfnPlayerMoveInit)( struct playermove_s *ppmove ); - char (*pfnPlayerMoveTexture)( char *name ); - void (*IN_ActivateMouse)( void ); - void (*IN_DeactivateMouse)( void ); - void (*IN_MouseEvent)( int mstate ); - void (*IN_ClearStates)( void ); - void (*IN_Accumulate)( void ); - void (*CL_CreateMove)( float frametime, struct usercmd_s *cmd, int active ); - int (*CL_IsThirdPerson)( void ); - void (*CL_CameraOffset)( float *ofs ); - void *(*KB_Find)( const char *name ); - void (*CAM_Think)( void ); // camera stuff - void (*pfnCalcRefdef)( ref_params_t *pparams ); - int (*pfnAddEntity)( int type, cl_entity_t *ent, const char *modelname ); - void (*pfnCreateEntities)( void ); - void (*pfnDrawNormalTriangles)( void ); - void (*pfnDrawTransparentTriangles)( void ); - void (*pfnStudioEvent)( const struct mstudioevent_s *event, const cl_entity_t *entity ); - void (*pfnPostRunCmd)( struct local_state_s *from, struct local_state_s *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed ); - void (*pfnShutdown)( void ); - void (*pfnTxferLocalOverrides)( entity_state_t *state, const clientdata_t *client ); - void (*pfnProcessPlayerState)( entity_state_t *dst, const entity_state_t *src ); - void (*pfnTxferPredictionData)( entity_state_t *ps, const entity_state_t *pps, clientdata_t *pcd, const clientdata_t *ppcd, weapon_data_t *wd, const weapon_data_t *pwd ); - void (*pfnDemo_ReadBuffer)( int size, byte *buffer ); - int (*pfnConnectionlessPacket)( const struct netadr_s *net_from, const char *args, char *buffer, int *size ); - int (*pfnGetHullBounds)( int hullnumber, float *mins, float *maxs ); - void (*pfnFrame)( double time ); - int (*pfnKey_Event)( int eventcode, int keynum, const char *pszCurrentBinding ); - void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp )); - cl_entity_t *(*pfnGetUserEntity)( int index ); - void (*pfnVoiceStatus)( int entindex, qboolean bTalking ); - void (*pfnDirectorMessage)( int iSize, void *pbuf ); - int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio ); - void (*pfnChatInputPosition)( int *x, int *y ); - int (*pfnGetPlayerTeam)( int playerIndex ); - void *(*pfnGetClientFactory)( void ); - // Xash3D extension - int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback ); - void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr ); -} cldll_func_t; - -#endif//CDLL_EXP_H diff --git a/engine/custom.h b/engine/custom.h index 02aa2089..4bff2632 100644 --- a/engine/custom.h +++ b/engine/custom.h @@ -18,6 +18,8 @@ #include "const.h" +#define MAX_QPATH 64 // Must match value in quakedefs.h + ///////////////// // Customization // passed to pfnPlayerCustomization diff --git a/engine/menu_int.h b/engine/menu_int.h deleted file mode 100644 index d907bd87..00000000 --- a/engine/menu_int.h +++ /dev/null @@ -1,188 +0,0 @@ -/* -menu_int.h - interface between engine and menu -Copyright (C) 2010 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef MENU_INT_H -#define MENU_INT_H - -#include "cvardef.h" -#include "gameinfo.h" -#include "wrect.h" - -typedef int HIMAGE; // handle to a graphic - -// flags for PIC_Load -#define PIC_NEAREST (1<<0) // disable texfilter -#define PIC_KEEP_RGBDATA (1<<1) // some images keep source -#define PIC_NOFLIP_TGA (1<<2) // Steam background completely ignore tga attribute 0x20 -#define PIC_KEEP_8BIT (1<<3) // keep original 8-bit image (if present) - -typedef struct ui_globalvars_s -{ - float time; // unclamped host.realtime - float frametime; - - int scrWidth; // actual values - int scrHeight; - - int maxClients; - int developer; - int demoplayback; - int demorecording; - char demoname[64]; // name of currently playing demo - char maptitle[64]; // title of active map -} ui_globalvars_t; - -typedef struct ui_enginefuncs_s -{ - // image handlers - HIMAGE (*pfnPIC_Load)( const char *szPicName, const byte *ucRawImage, long ulRawImageSize, long flags ); - void (*pfnPIC_Free)( const char *szPicName ); - int (*pfnPIC_Width)( HIMAGE hPic ); - int (*pfnPIC_Height)( HIMAGE hPic ); - void (*pfnPIC_Set)( HIMAGE hPic, int r, int g, int b, int a ); - void (*pfnPIC_Draw)( int x, int y, int width, int height, const wrect_t *prc ); - void (*pfnPIC_DrawHoles)( int x, int y, int width, int height, const wrect_t *prc ); - void (*pfnPIC_DrawTrans)( int x, int y, int width, int height, const wrect_t *prc ); - void (*pfnPIC_DrawAdditive)( int x, int y, int width, int height, const wrect_t *prc ); - void (*pfnPIC_EnableScissor)( int x, int y, int width, int height ); - void (*pfnPIC_DisableScissor)( void ); - - // screen handlers - void (*pfnFillRGBA)( int x, int y, int width, int height, int r, int g, int b, int a ); - - // cvar handlers - cvar_t* (*pfnRegisterVariable)( const char *szName, const char *szValue, int flags ); - float (*pfnGetCvarFloat)( const char *szName ); - char* (*pfnGetCvarString)( const char *szName ); - void (*pfnCvarSetString)( const char *szName, const char *szValue ); - void (*pfnCvarSetValue)( const char *szName, float flValue ); - - // command handlers - int (*pfnAddCommand)( const char *cmd_name, void (*function)(void) ); - void (*pfnClientCmd)( int execute_now, const char *szCmdString ); - void (*pfnDelCommand)( const char *cmd_name ); - int (*pfnCmdArgc)( void ); - char* (*pfnCmdArgv)( int argc ); - char* (*pfnCmd_Args)( void ); - - // debug messages (in-menu shows only notify) - void (*Con_Printf)( char *fmt, ... ); - void (*Con_DPrintf)( char *fmt, ... ); - void (*Con_NPrintf)( int pos, char *fmt, ... ); - void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... ); - - // sound handlers - void (*pfnPlayLocalSound)( const char *szSound ); - - // cinematic handlers - void (*pfnDrawLogo)( const char *filename, float x, float y, float width, float height ); - int (*pfnGetLogoWidth)( void ); - int (*pfnGetLogoHeight)( void ); - float (*pfnGetLogoLength)( void ); // cinematic duration in seconds - - // text message system - void (*pfnDrawCharacter)( int x, int y, int width, int height, int ch, int ulRGBA, HIMAGE hFont ); - int (*pfnDrawConsoleString)( int x, int y, const char *string ); - void (*pfnDrawSetTextColor)( int r, int g, int b, int alpha ); - void (*pfnDrawConsoleStringLen)( const char *string, int *length, int *height ); - void (*pfnSetConsoleDefaultColor)( int r, int g, int b ); // color must came from colors.lst - - // custom rendering (for playermodel preview) - struct cl_entity_s* (*pfnGetPlayerModel)( void ); // for drawing playermodel previews - void (*pfnSetModel)( struct cl_entity_s *ed, const char *path ); - void (*pfnClearScene)( void ); - void (*pfnRenderScene)( const struct ref_params_s *fd ); - int (*CL_CreateVisibleEntity)( int type, struct cl_entity_s *ent ); - - // misc handlers - void (*pfnHostError)( const char *szFmt, ... ); - int (*pfnFileExists)( const char *filename, int gamedironly ); - void (*pfnGetGameDir)( char *szGetGameDir ); - - // gameinfo handlers - int (*pfnCreateMapsList)( int fRefresh ); - int (*pfnClientInGame)( void ); - void (*pfnClientJoin)( const struct netadr_s adr ); - - // parse txt files - byte* (*COM_LoadFile)( const char *filename, int *pLength ); - char* (*COM_ParseFile)( char *data, char *token ); - void (*COM_FreeFile)( void *buffer ); - - // keyfuncs - void (*pfnKeyClearStates)( void ); // call when menu open or close - void (*pfnSetKeyDest)( int dest ); - const char *(*pfnKeynumToString)( int keynum ); - const char *(*pfnKeyGetBinding)( int keynum ); - void (*pfnKeySetBinding)( int keynum, const char *binding ); - int (*pfnKeyIsDown)( int keynum ); - int (*pfnKeyGetOverstrikeMode)( void ); - void (*pfnKeySetOverstrikeMode)( int fActive ); - void *(*pfnKeyGetState)( const char *name ); // for mlook, klook etc - - // engine memory manager - void* (*pfnMemAlloc)( size_t cb, const char *filename, const int fileline ); - void (*pfnMemFree)( void *mem, const char *filename, const int fileline ); - - // collect info from engine - int (*pfnGetGameInfo)( GAMEINFO *pgameinfo ); - GAMEINFO **(*pfnGetGamesList)( int *numGames ); // collect info about all mods - char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly ); // find in files - int (*pfnGetSaveComment)( const char *savename, char *comment ); - int (*pfnGetDemoComment)( const char *demoname, char *comment ); - int (*pfnCheckGameDll)( void ); // returns false if hl.dll is missed or invalid - char *(*pfnGetClipboardData)( void ); - - // engine launcher - void (*pfnShellExecute)( const char *name, const char *args, int closeEngine ); - void (*pfnWriteServerConfig)( const char *name ); - void (*pfnChangeInstance)( const char *newInstance, const char *szFinalMessage ); - void (*pfnPlayBackgroundTrack)( const char *introName, const char *loopName ); - void (*pfnHostEndGame)( const char *szFinalMessage ); - - // menu interface is freezed at version 0.75 - // new functions starts here - float (*pfnRandomFloat)( float flLow, float flHigh ); - int (*pfnRandomLong)( int lLow, int lHigh ); - - void (*pfnSetCursor)( void *hCursor ); // change cursor - int (*pfnIsMapValid)( char *filename ); - void (*pfnProcessImage)( int texnum, float gamma, int topColor, int bottomColor ); - int (*pfnCompareFileTime)( char *filename1, char *filename2, int *iCompare ); -} ui_enginefuncs_t; - -typedef struct -{ - int (*pfnVidInit)( void ); - void (*pfnInit)( void ); - void (*pfnShutdown)( void ); - void (*pfnRedraw)( float flTime ); - void (*pfnKeyEvent)( int key, int down ); - void (*pfnMouseMove)( int x, int y ); - void (*pfnSetActiveMenu)( int active ); - void (*pfnAddServerToList)( struct netadr_s adr, const char *info ); - void (*pfnGetCursorPos)( int *pos_x, int *pos_y ); - void (*pfnSetCursorPos)( int pos_x, int pos_y ); - void (*pfnShowCursor)( int show ); - void (*pfnCharEvent)( int key ); - int (*pfnMouseInRect)( void ); // mouse entering\leave game window - int (*pfnIsVisible)( void ); - int (*pfnCreditsActive)( void ); // unused - void (*pfnFinalCredits)( void ); // show credits + game end -} UI_FUNCTIONS; - -typedef int (*MENUAPI)( UI_FUNCTIONS *pFunctionTable, ui_enginefuncs_t* engfuncs, ui_globalvars_t *pGlobals ); - -#endif//MENU_INT_H diff --git a/engine/warpsin.h b/engine/warpsin.h deleted file mode 100644 index e46b44d7..00000000 --- a/engine/warpsin.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 1997-2001 Id Software, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - - -0.000000, 0.098165, 0.196270, 0.294259, 0.392069, 0.489643, 0.586920, 0.683850, -0.780360, 0.876405, 0.971920, 1.066850, 1.161140, 1.254725, 1.347560, 1.439580, -1.530735, 1.620965, 1.710220, 1.798445, 1.885585, 1.971595, 2.056410, 2.139990, -2.222280, 2.303235, 2.382795, 2.460925, 2.537575, 2.612690, 2.686235, 2.758160, -2.828425, 2.896990, 2.963805, 3.028835, 3.092040, 3.153385, 3.212830, 3.270340, -3.325880, 3.379415, 3.430915, 3.480350, 3.527685, 3.572895, 3.615955, 3.656840, -3.695520, 3.731970, 3.766175, 3.798115, 3.827760, 3.855105, 3.880125, 3.902810, -3.923140, 3.941110, 3.956705, 3.969920, 3.980740, 3.989160, 3.995180, 3.998795, -4.000000, 3.998795, 3.995180, 3.989160, 3.980740, 3.969920, 3.956705, 3.941110, -3.923140, 3.902810, 3.880125, 3.855105, 3.827760, 3.798115, 3.766175, 3.731970, -3.695520, 3.656840, 3.615955, 3.572895, 3.527685, 3.480350, 3.430915, 3.379415, -3.325880, 3.270340, 3.212830, 3.153385, 3.092040, 3.028835, 2.963805, 2.896990, -2.828425, 2.758160, 2.686235, 2.612690, 2.537575, 2.460925, 2.382795, 2.303235, -2.222280, 2.139990, 2.056410, 1.971595, 1.885585, 1.798445, 1.710220, 1.620965, -1.530735, 1.439580, 1.347560, 1.254725, 1.161140, 1.066850, 0.971920, 0.876405, -0.780360, 0.683850, 0.586920, 0.489643, 0.392069, 0.294259, 0.196270, 0.098165, -0.000000, -0.098165, -0.196270, -0.294259, -0.392069, -0.489643, -0.586920, -0.683850, --0.780360, -0.876405, -0.971920, -1.066850, -1.161140, -1.254725, -1.347560, -1.439580, --1.530735, -1.620965, -1.710220, -1.798445, -1.885585, -1.971595, -2.056410, -2.139990, --2.222280, -2.303235, -2.382795, -2.460925, -2.537575, -2.612690, -2.686235, -2.758160, --2.828425, -2.896990, -2.963805, -3.028835, -3.092040, -3.153385, -3.212830, -3.270340, --3.325880, -3.379415, -3.430915, -3.480350, -3.527685, -3.572895, -3.615955, -3.656840, --3.695520, -3.731970, -3.766175, -3.798115, -3.827760, -3.855105, -3.880125, -3.902810, --3.923140, -3.941110, -3.956705, -3.969920, -3.980740, -3.989160, -3.995180, -3.998795, --4.000000, -3.998795, -3.995180, -3.989160, -3.980740, -3.969920, -3.956705, -3.941110, --3.923140, -3.902810, -3.880125, -3.855105, -3.827760, -3.798115, -3.766175, -3.731970, --3.695520, -3.656840, -3.615955, -3.572895, -3.527685, -3.480350, -3.430915, -3.379415, --3.325880, -3.270340, -3.212830, -3.153385, -3.092040, -3.028835, -2.963805, -2.896990, --2.828425, -2.758160, -2.686235, -2.612690, -2.537575, -2.460925, -2.382795, -2.303235, --2.222280, -2.139990, -2.056410, -1.971595, -1.885585, -1.798445, -1.710220, -1.620965, --1.530735, -1.439580, -1.347560, -1.254725, -1.161140, -1.066850, -0.971920, -0.876405, --0.780360, -0.683850, -0.586920, -0.489643, -0.392069, -0.294259, -0.196270, -0.098165, From a758e80f71a3ce124b009ccc5fc8aca9cb66a57f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 22 Apr 2020 13:51:43 +0500 Subject: [PATCH 078/298] Remove physics interface. --- dlls/crossbow.cpp | 5 +- dlls/h_export.cpp | 9 ++-- dlls/physcallback.h | 33 ------------- dlls/util.h | 4 -- dlls/world.cpp | 110 ------------------------------------------ engine/physint.h | 114 -------------------------------------------- 6 files changed, 9 insertions(+), 266 deletions(-) delete mode 100644 dlls/physcallback.h delete mode 100644 engine/physint.h diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index f0526188..e6eea1c5 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -27,7 +27,7 @@ #define BOLT_AIR_VELOCITY 2000 #define BOLT_WATER_VELOCITY 1000 -extern BOOL gPhysicsInterfaceInitialized; +extern BOOL g_fIsXash3D; // UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS() // @@ -169,7 +169,8 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) pev->angles.z = RANDOM_LONG( 0, 360 ); pev->nextthink = gpGlobals->time + 10.0f; - if (gPhysicsInterfaceInitialized) { + if( g_fIsXash3D ) + { // g-cont. Setup movewith feature pev->movetype = MOVETYPE_COMPOUND; // set movewith type pev->aiment = ENT( pOther->pev ); // set parent diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index a3f4f35e..3e6883f3 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -26,9 +26,9 @@ #include "cbase.h" // Holds engine functionality callbacks -enginefuncs_t g_engfuncs; -globalvars_t *gpGlobals; -server_physics_api_t g_physfuncs; +enginefuncs_t g_engfuncs; +globalvars_t *gpGlobals; +BOOL g_fIsXash3D; #ifdef _WIN32 @@ -54,4 +54,7 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE { memcpy( &g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t) ); gpGlobals = pGlobals; + + if( CVAR_GET_POINTER( "build" ) ) + g_fIsXash3D = TRUE; } diff --git a/dlls/physcallback.h b/dlls/physcallback.h deleted file mode 100644 index fd68936c..00000000 --- a/dlls/physcallback.h +++ /dev/null @@ -1,33 +0,0 @@ -/*** -* -* Copyright (c) 1996-2002, Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -****/ -#pragma once -#ifndef PHYSCALLBACK_H -#define PHYSCALLBACK_H - -#include "physint.h" - -// Must be provided by user of this code -extern server_physics_api_t g_physfuncs; - -// The actual physic callbacks -#define LINK_ENTITY (*g_physfuncs.pfnLinkEdict) -#define PHYSICS_TIME (*g_physfuncs.pfnGetServerTime) -#define HOST_FRAMETIME (*g_physfuncs.pfnGetFrameTime) -#define MODEL_HANDLE (*g_physfuncs.pfnGetModel) -#define GET_AREANODE (*g_physfuncs.pfnGetHeadnode) -#define GET_SERVER_STATE (*g_physfuncs.pfnServerState) -#define HOST_ERROR (*g_physfuncs.pfnHost_Error) - -#endif //PHYSCALLBACK_H diff --git a/dlls/util.h b/dlls/util.h index 2bb8a5d4..08c5af05 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -26,10 +26,6 @@ #include "enginecallback.h" #endif -#ifndef PHYSCALLBACK_H -#include "physcallback.h" -#endif - #include #include inline void MESSAGE_BEGIN( int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent ); // implementation later in this file diff --git a/dlls/world.cpp b/dlls/world.cpp index 0e0a0288..5adbdf9d 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -33,7 +33,6 @@ #include "weapons.h" #include "gamerules.h" #include "teamplay_gamerules.h" -#include "physcallback.h" extern CGraph WorldGraph; extern CSoundEnt *pSoundEnt; @@ -730,112 +729,3 @@ void CWorld::KeyValue( KeyValueData *pkvd ) CBaseEntity::KeyValue( pkvd ); } -// -// Xash3D physics interface -// - -typedef void (*LINK_ENTITY_FN)( entvars_t *pev ); - -// -// attempt to create custom entity when default method is failed -// 0 - attempt to create, -1 - reject to create -// -int DispatchCreateEntity( edict_t *pent, const char *szName ) -{ -/* -#ifdef CREATE_ENTITY_TEST - // quake armor entities. we just replaced it with item_battery... - if( !strcmp( szName, "item_armor1" ) || !strcmp( szName, "item_armor2" ) ) - { - LINK_ENTITY_FN SpawnEdict; - - // ugly method to get acess with himself exports - SpawnEdict = (LINK_ENTITY_FN)GetProcAddress( GetModuleHandle( "hl" ), "item_battery" ); - - if( SpawnEdict != NULL ) // found the valid spawn - { - // BUGBUG: old classname hanging in memory - pent->v.classname = ALLOC_STRING( "item_battery" ); - - //ALERT( at_console, "DispatchCreateEntity: replace %s with %s\n", szName, STRING( pent->v.classname ) ); - - SpawnEdict( &pent->v ); - return 0; // handled - } - } -#endif -*/ - return -1; -} - -// -// run custom physics for each entity -// return 0 to use built-in engine physic -// -int DispatchPhysicsEntity( edict_t *pEdict ) -{ - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE( pEdict ); - - if( !pEntity ) - { - //ALERT( at_console, "skip %s [%i] without private data\n", STRING( pEdict->v.classname ), ENTINDEX( pEdict ) ); - return 0; // not initialized - } - - // NOTE: at this point pEntity assume to be valid -/* -#ifdef CUSTOM_PHYSICS_TEST - // test alien controller without physics, thinking only - if( FClassnameIs( pEntity->pev, "monster_alien_controller" ) ) - { - float thinktime; - - thinktime = pEntity->pev->nextthink; - if( thinktime <= 0.0f || thinktime > PHYSICS_TIME() + gpGlobals->frametime ) - return 1; - - if( thinktime < PHYSICS_TIME() ) - thinktime = PHYSICS_TIME(); // don't let things stay in the past. - // it is possible to start that way - // by a trigger with a local time. - pEntity->pev->nextthink = 0.0f; - gpGlobals->time = thinktime; - - DispatchThink( pEdict ); - -#ifdef GRAVITY_TEST - // stupid fake gravity test - pEntity->pev->origin.z -= 1; - LINK_ENTITY( pEdict, true ); -#endif - return 1; // handled - } -#endif -*/ - return 0; -} - -static physics_interface_t gPhysicsInterface = -{ - SV_PHYSICS_INTERFACE_VERSION, - DispatchCreateEntity, - DispatchPhysicsEntity, -}; - -BOOL gPhysicsInterfaceInitialized = FALSE; - -int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable ) -{ - if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION ) - { - return FALSE; - } - - // copy new physics interface - memcpy( &g_physfuncs, pfuncsFromEngine, sizeof(server_physics_api_t) ); - - // fill engine callbacks - memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) ); - gPhysicsInterfaceInitialized = TRUE; - return TRUE; -} diff --git a/engine/physint.h b/engine/physint.h deleted file mode 100644 index 2b4ac8f7..00000000 --- a/engine/physint.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -physint.h - Server Physics Interface -Copyright (C) 2011 Uncle Mike - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -*/ -#pragma once -#ifndef PHYSINT_H -#define PHYSINT_H - -#define SV_PHYSICS_INTERFACE_VERSION 6 - -#define STRUCT_FROM_LINK( l, t, m ) ((t *)((byte *)l - (int)&(((t *)0)->m))) -#define EDICT_FROM_AREA( l ) STRUCT_FROM_LINK( l, edict_t, area ) - -// values that can be returned with pfnServerState -#define SERVER_DEAD 0 -#define SERVER_LOADING 1 -#define SERVER_ACTIVE 2 - -typedef struct areanode_s -{ - int axis; // -1 = leaf node - float dist; - struct areanode_s *children[2]; - link_t trigger_edicts; - link_t solid_edicts; - link_t water_edicts; // func water -} areanode_t; - -typedef struct server_physics_api_s -{ - // unlink edict from old position and link onto new - void ( *pfnLinkEdict) ( edict_t *ent, qboolean touch_triggers ); - double ( *pfnGetServerTime )( void ); // unclamped - double ( *pfnGetFrameTime )( void ); // unclamped - void* ( *pfnGetModel )( int modelindex ); - areanode_t* ( *pfnGetHeadnode )( void ); // BSP tree for all physic entities - int ( *pfnServerState )( void ); - void ( *pfnHost_Error )( const char *error, ... ); // cause Host Error -// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 6 - struct triangleapi_s *pTriAPI; // draw coliisions etc. Only for local system - - // draw debug messages (must be called from DrawOrthoTriangles). Only for local system - int ( *pfnDrawConsoleString )( int x, int y, char *string ); - void ( *pfnDrawSetTextColor )( float r, float g, float b ); - void ( *pfnDrawConsoleStringLen )( const char *string, int *length, int *height ); - void ( *Con_NPrintf )( int pos, char *fmt, ... ); - void ( *Con_NXPrintf )( struct con_nprint_s *info, char *fmt, ... ); - const char *( *pfnGetLightStyle )( int style ); // read custom appreance for selected lightstyle - void ( *pfnUpdateFogSettings )( unsigned int packed_fog ); - char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly ); - struct msurface_s *(*pfnTraceSurface)( edict_t *pTextureEntity, const float *v1, const float *v2 ); - const byte *(*pfnGetTextureData)( unsigned int texnum ); - - // static allocations - void *(*pfnMemAlloc)( size_t cb, const char *filename, const int fileline ); - void (*pfnMemFree)( void *mem, const char *filename, const int fileline ); -} server_physics_api_t; - -// physic callbacks -typedef struct physics_interface_s -{ - int version; - // passed through pfnCreate (0 is attempt to create, -1 is reject) - int ( *SV_CreateEntity )( edict_t *pent, const char *szName ); - // run custom physics for each entity (return 0 to use built-in engine physic) - int ( *SV_PhysicsEntity )( edict_t *pEntity ); - // spawn entities with internal mod function e.g. for re-arrange spawn order (0 - use engine parser, 1 - use mod parser) - int ( *SV_LoadEntities )( const char *mapname, char *entities ); - // update conveyor belt for clients - void ( *SV_UpdatePlayerBaseVelocity )( edict_t *ent ); - // The game .dll should return 1 if save game should be allowed - int ( *SV_AllowSaveGame )( void ); -// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 6 - // override trigger area checking and touching - int ( *SV_TriggerTouch )( edict_t *pent, edict_t *trigger ); - // some engine features can be enabled only through this function - unsigned int ( *SV_CheckFeatures )( void ); - // used for draw debug collisions for custom physic engine etc - void ( *DrawDebugTriangles )( void ); - // used for draw debug overlay (textured) - void ( *DrawNormalTriangles )( void ); - // used for draw debug messages (2d mode) - void ( *DrawOrthoTriangles )( void ); - // tracing entities with SOLID_CUSTOM mode on a server (not used by pmove code) - void ( *ClipMoveToEntity)( edict_t *ent, const float *start, float *mins, float *maxs, const float *end, trace_t *trace ); - // tracing entities with SOLID_CUSTOM mode on a server (only used by pmove code) - void ( *ClipPMoveToEntity)( struct physent_s *pe, const float *start, float *mins, float *maxs, const float *end, struct pmtrace_s *tr ); - // called at end the frame of SV_Physics call - void ( *SV_EndFrame )( void ); - // called through save\restore process - void (*pfnCreateEntitiesInTransitionList)( SAVERESTOREDATA*, int levelMask ); - // called through save\restore process - void (*pfnCreateEntitiesInRestoreList)( SAVERESTOREDATA*, int createPlayers ); - // allocate custom string (e.g. using user implementation of stringtable, not engine strings) - string_t (*pfnAllocString)( const char *szValue ); - // make custom string (e.g. using user implementation of stringtable, not engine strings) - string_t (*pfnMakeString)( const char *szValue ); - // read custom string (e.g. using user implementation of stringtable, not engine strings) - const char* (*pfnGetString)( string_t iString ); - // helper for restore custom decals that have custom message (e.g. Paranoia) - int (*pfnRestoreDecal)( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent ); -} physics_interface_t; - -#endif//PHYSINT_H From 6cc78b593d5519582aecadecb5325ab61e049e86 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 22 Apr 2020 14:07:48 +0500 Subject: [PATCH 079/298] Fix compilation. --- dlls/cbase.h | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/cbase.h b/dlls/cbase.h index a15638ab..a09b0a61 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -58,7 +58,6 @@ CBaseEntity extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ); extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ); -extern "C" EXPORT int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable ); extern int DispatchSpawn( edict_t *pent ); extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ); From 895e7b75032195c1c6413d25496e6ca4ed1988a4 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 22 Apr 2020 14:11:03 +0500 Subject: [PATCH 080/298] Move "build" cvar pointer check to GameDLLInit function. --- dlls/game.cpp | 4 ++++ dlls/h_export.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 03ee0dca..5e2701d3 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -17,6 +17,8 @@ #include "util.h" #include "game.h" +BOOL g_fIsXash3D; + cvar_t displaysoundlist = {"displaysoundlist","0"}; // multiplayer server rules @@ -453,6 +455,8 @@ cvar_t sk_player_leg3 = { "sk_player_leg3","1" }; void GameDLLInit( void ) { // Register cvars here: + if( CVAR_GET_POINTER( "build" ) ) + g_fIsXash3D = TRUE; g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" ); g_psv_aim = CVAR_GET_POINTER( "sv_aim" ); diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index 3e6883f3..d36bd5be 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -28,7 +28,6 @@ // Holds engine functionality callbacks enginefuncs_t g_engfuncs; globalvars_t *gpGlobals; -BOOL g_fIsXash3D; #ifdef _WIN32 @@ -54,7 +53,4 @@ extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromE { memcpy( &g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t) ); gpGlobals = pGlobals; - - if( CVAR_GET_POINTER( "build" ) ) - g_fIsXash3D = TRUE; } From a091e8ce55ea0953854a8bf8b4301ad7bdd0bf8e Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Thu, 23 Apr 2020 12:09:56 +0500 Subject: [PATCH 081/298] Remove duplicated cache size definition. --- common/com_model.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/com_model.h b/common/com_model.h index 09b83936..7f8244ad 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -36,8 +36,6 @@ #define ZISCALE ((float)0x8000) -#define CACHE_SIZE 32 // used to align key data structures - typedef enum { mod_brush, From 54181adc8e401e3e3aba58d876639faa85fd19b0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 28 Apr 2020 23:37:07 +0300 Subject: [PATCH 082/298] Fix bigmomma node wait --- dlls/bigmomma.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index d67d10f7..7e893e28 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -931,7 +931,7 @@ void CBigMomma::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_WAIT_NODE: - m_flWait = gpGlobals->time + GetNodeDelay(); + m_flWaitFinished = gpGlobals->time + GetNodeDelay(); if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) ); else @@ -1007,8 +1007,10 @@ void CBigMomma::RunTask( Task_t *pTask ) return; if( gpGlobals->time > m_flWaitFinished ) + { TaskComplete(); - ALERT( at_aiconsole, "BM: The WAIT is over!\n" ); + ALERT( at_aiconsole, "BM: The WAIT is over!\n" ); + } break; case TASK_PLAY_NODE_PRESEQUENCE: case TASK_PLAY_NODE_SEQUENCE: From c2064d88ed8237bc9dc907e28d1f21e75750561f Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 10 May 2020 21:57:11 +0300 Subject: [PATCH 083/298] Remove redundant casts to float when retrieving model frames --- dlls/bigmomma.cpp | 2 +- dlls/bullsquid.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 7e893e28..a73334ff 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -1106,7 +1106,7 @@ void CBMortar::Spawn( void ) UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; + m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1; pev->dmgtime = gpGlobals->time + 0.4f; } diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index e035b0c9..5be5135a 100644 --- a/dlls/bullsquid.cpp +++ b/dlls/bullsquid.cpp @@ -95,7 +95,7 @@ void CSquidSpit::Spawn( void ) UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - m_maxFrame = (float)MODEL_FRAMES( pev->modelindex ) - 1; + m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1; } void CSquidSpit::Animate( void ) From 0324eb0431d6f6e5c0352e01c3486fe84ff55b4f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 25 Jul 2020 09:28:02 +0500 Subject: [PATCH 084/298] Fix possible memory leak. --- cl_dll/hud_spectator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index f666b5e6..ce32e4e2 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -825,7 +825,7 @@ bool CHudSpectator::ParseOverviewFile() char token[1024] = { 0 }; float height; - char *pfile = NULL; + char *afile = NULL, *pfile = NULL; memset( &m_OverviewData, 0, sizeof(m_OverviewData) ); @@ -850,7 +850,7 @@ bool CHudSpectator::ParseOverviewFile() sprintf( filename, "overviews/%s.txt", levelname ); - pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL ); + afile = pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL ); if( !pfile ) { @@ -963,7 +963,7 @@ bool CHudSpectator::ParseOverviewFile() } } - gEngfuncs.COM_FreeFile( pfile ); + gEngfuncs.COM_FreeFile( afile ); m_mapZoom = m_OverviewData.zoom; m_mapOrigin = m_OverviewData.origin; From 1d1c99af9fd4655546a786ccc73c3dab8efc9f09 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 25 Jul 2020 13:29:14 +0500 Subject: [PATCH 085/298] Merge https://github.com/ValveSoftware/halflife/pull/2898/commits/e98a18a980eb4d850bd1a8d4458f2475c8c2ee0f --- dlls/houndeye.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index 2b8cadb0..ba388b63 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -35,7 +35,7 @@ extern CGraph WorldGraph; #define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f #define HOUNDEYE_SQUAD_BONUS 1.1f -#define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye +#define HOUNDEYE_EYE_FRAMES 3 // how many different switchable maps for the eye #define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye @@ -783,6 +783,11 @@ void CHoundeye::RunTask( Task_t *pTask ) { pev->skin++; } + + if( pev->skin == HOUNDEYE_EYE_FRAMES - 1 ) + { + TaskComplete(); + } break; } case TASK_HOUND_HOP_BACK: @@ -952,6 +957,7 @@ Task_t tlHoundSleep[] = { TASK_HOUND_FALL_ASLEEP, (float)0 }, { TASK_WAIT_RANDOM, (float)25 }, { TASK_HOUND_CLOSE_EYE, (float)0 }, + { TASK_WAIT_INDEFINITE, (float)0 }, //{ TASK_WAIT, (float)10 }, //{ TASK_WAIT_RANDOM, (float)10 }, }; From e239f3e1a51eaef117437f1ee2445e8acba7475b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 1 Aug 2020 19:27:51 +0500 Subject: [PATCH 086/298] Set EF_BRIGHTFIELD flag for monsters which stuck in the wall only in developer mode. --- dlls/game.cpp | 4 ++++ dlls/game.h | 2 ++ dlls/monsters.cpp | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 5e2701d3..c48b44b3 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -55,6 +55,8 @@ cvar_t *g_psv_gravity = NULL; cvar_t *g_psv_aim = NULL; cvar_t *g_footsteps = NULL; +cvar_t *g_psv_developer; + //CVARS FOR SKILL LEVEL SETTINGS // Agrunt cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"}; @@ -462,6 +464,8 @@ void GameDLLInit( void ) g_psv_aim = CVAR_GET_POINTER( "sv_aim" ); g_footsteps = CVAR_GET_POINTER( "mp_footsteps" ); + g_psv_developer = CVAR_GET_POINTER( "developer" ); + CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &allow_spectators ); diff --git a/dlls/game.h b/dlls/game.h index 7eb665c6..026070ff 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -43,4 +43,6 @@ extern cvar_t allowmonsters; extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_aim; extern cvar_t *g_footsteps; + +extern cvar_t *g_psv_developer; #endif // GAME_H diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index e14dbace..57de767d 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -33,6 +33,7 @@ #include "decals.h" #include "soundent.h" #include "gamerules.h" +#include "game.h" #define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC @@ -2066,7 +2067,9 @@ void CBaseMonster::StartMonster( void ) if( !WALK_MOVE( ENT( pev ), 0, 0, WALKMOVE_NORMAL ) ) { ALERT( at_error, "Monster %s stuck in wall--level design error\n", STRING( pev->classname ) ); - pev->effects = EF_BRIGHTFIELD; + + if( g_psv_developer && g_psv_developer->value ) + pev->effects = EF_BRIGHTFIELD; } } else From f20b7259f3687cf01a4e6dd4944214ac44e6b2ff Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 1 Aug 2020 20:26:28 +0500 Subject: [PATCH 087/298] wscript: reorder sources list. --- cl_dll/wscript | 95 ++++++++++++++++++++++++++++-------- dlls/wscript | 130 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 183 insertions(+), 42 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 3bc40d56..9b8c0acc 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -14,33 +14,88 @@ def configure(conf): conf.check_cc(lib='dl') if conf.env.DEST_OS == 'win32': - conf.check_cxx( lib='user32' ) + conf.check_cxx(lib='user32') def build(bld): source = bld.path.parent.ant_glob([ - 'pm_shared/*.c', - 'dlls/crossbow.cpp', 'dlls/crowbar.cpp', 'dlls/egon.cpp', 'dlls/gauss.cpp', 'dlls/handgrenade.cpp', - 'dlls/hornetgun.cpp', 'dlls/mp5.cpp', 'dlls/python.cpp', 'dlls/rpg.cpp', 'dlls/satchel.cpp', - 'dlls/shotgun.cpp', 'dlls/squeakgrenade.cpp', 'dlls/tripmine.cpp', 'dlls/glock.cpp' + 'pm_shared/*.c' + ]) + source += bld.path.ant_glob([ + 'hl/*.cpp' + ]) + source += bld.path.ant_glob([ + 'dlls/crossbow.cpp', + 'dlls/crowbar.cpp', + 'dlls/egon.cpp', + 'dlls/gauss.cpp', + 'dlls/glock.cpp', + 'dlls/handgrenade.cpp', + 'dlls/hornetgun.cpp', + 'dlls/mp5.cpp', + 'dlls/python.cpp', + 'dlls/rpg.cpp', + 'dlls/satchel.cpp', + 'dlls/shotgun.cpp', + 'dlls/squeakgrenade.cpp', + 'dlls/tripmine.cpp' ]) - - source += bld.path.ant_glob(['hl/*.cpp']) source += [ - 'ev_hldm.cpp', 'ammo.cpp', 'ammo_secondary.cpp', 'ammohistory.cpp', - 'battery.cpp', 'cdll_int.cpp', 'com_weapons.cpp', 'death.cpp', - 'demo.cpp', 'entity.cpp', 'ev_common.cpp', 'events.cpp', - 'flashlight.cpp', 'GameStudioModelRenderer.cpp', 'geiger.cpp', - 'health.cpp', 'hud.cpp', 'hud_msg.cpp', 'hud_redraw.cpp', - 'hud_spectator.cpp', 'hud_update.cpp', 'in_camera.cpp', - 'input.cpp', 'input_goldsource.cpp', 'input_mouse.cpp', - 'input_xash3d.cpp', 'menu.cpp', 'message.cpp', - 'overview.cpp', 'parsemsg.cpp', 'saytext.cpp', - 'status_icons.cpp', 'statusbar.cpp', 'studio_util.cpp', - 'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp', - 'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp' + 'GameStudioModelRenderer.cpp', + 'MOTD.cpp', + 'StudioModelRenderer.cpp', + 'ammo.cpp', + 'ammo_secondary.cpp', + 'ammohistory.cpp', + 'battery.cpp', + 'cdll_int.cpp', + 'com_weapons.cpp', + 'death.cpp', + 'demo.cpp', + 'entity.cpp', + 'ev_hldm.cpp', + 'ev_common.cpp', + 'events.cpp', + 'flashlight.cpp', + 'geiger.cpp', + 'health.cpp', + 'hud.cpp', + 'hud_msg.cpp', + 'hud_redraw.cpp', + 'hud_spectator.cpp', + 'hud_update.cpp', + 'in_camera.cpp', + 'input.cpp', + 'input_goldsource.cpp', + 'input_mouse.cpp', + 'input_xash3d.cpp', + 'menu.cpp', + 'message.cpp', + 'overview.cpp', + 'parsemsg.cpp', + 'saytext.cpp', + 'scoreboard.cpp', + 'status_icons.cpp', + 'statusbar.cpp', + 'studio_util.cpp', + 'text_message.cpp', + 'train.cpp', + 'tri.cpp', + 'util.cpp', + 'view.cpp' ] - includes = Utils.to_list('. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include') + includes = [ + '.', + 'hl/', + '../dlls', + '../dlls/wpn_shared', + '../common', + '../engine', + '../pm_shared', + '../game_shared', + '../public', + '../utils/false_vgui/include' + ] defines = ['CLIENT_DLL'] if bld.env.GOLDSRC: diff --git a/dlls/wscript b/dlls/wscript index 2a469153..5f17aefc 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -27,28 +27,106 @@ def build(bld): ]) source += [ - 'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp', - 'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp', - 'cbase.cpp', 'client.cpp', 'combat.cpp', 'controller.cpp', 'crossbow.cpp', 'crowbar.cpp', - 'defaultai.cpp', 'doors.cpp', - 'effects.cpp', 'egon.cpp', 'explode.cpp', - 'flyingmonster.cpp', 'func_break.cpp', 'func_tank.cpp', - 'game.cpp', 'gamerules.cpp', 'gargantua.cpp', 'gauss.cpp', 'genericmonster.cpp', 'ggrenade.cpp', 'globals.cpp', 'glock.cpp', 'gman.cpp', - 'h_ai.cpp', 'h_battery.cpp', 'h_cine.cpp', 'h_cycler.cpp', 'h_export.cpp', 'handgrenade.cpp', 'hassassin.cpp', 'headcrab.cpp', - 'healthkit.cpp', 'hgrunt.cpp', 'hornet.cpp', 'hornetgun.cpp', 'houndeye.cpp', - 'ichthyosaur.cpp', 'islave.cpp', 'items.cpp', - 'leech.cpp', 'lights.cpp', - 'maprules.cpp', 'monstermaker.cpp', 'monsters.cpp', 'monsterstate.cpp', 'mortar.cpp', 'mp5.cpp', 'multiplay_gamerules.cpp', - 'nihilanth.cpp', 'nodes.cpp', - 'observer.cpp', 'osprey.cpp', - 'pathcorner.cpp', 'plane.cpp', 'plats.cpp', 'player.cpp', 'playermonster.cpp', 'python.cpp', - 'rat.cpp', 'roach.cpp', 'rpg.cpp', - 'satchel.cpp', 'schedule.cpp', 'scientist.cpp', 'scripted.cpp', 'shotgun.cpp', 'singleplay_gamerules.cpp', 'skill.cpp', - 'sound.cpp', 'soundent.cpp', 'spectator.cpp', 'squadmonster.cpp', 'squeakgrenade.cpp', 'subs.cpp', - 'talkmonster.cpp', 'teamplay_gamerules.cpp', 'tempmonster.cpp', 'tentacle.cpp', - 'triggers.cpp', 'tripmine.cpp', 'turret.cpp', + 'agrunt.cpp', + 'airtank.cpp', + 'aflock.cpp', + 'animating.cpp', + 'animation.cpp', + 'apache.cpp', + 'barnacle.cpp', + 'barney.cpp', + 'bigmomma.cpp', + 'bloater.cpp', + 'bmodels.cpp', + 'bullsquid.cpp', + 'buttons.cpp', + 'cbase.cpp', + 'client.cpp', + 'combat.cpp', + 'controller.cpp', + 'crossbow.cpp', + 'crowbar.cpp', + 'defaultai.cpp', + 'doors.cpp', + 'effects.cpp', + 'egon.cpp', + 'explode.cpp', + 'flyingmonster.cpp', + 'func_break.cpp', + 'func_tank.cpp', + 'game.cpp', + 'gamerules.cpp', + 'gargantua.cpp', + 'gauss.cpp', + 'genericmonster.cpp', + 'ggrenade.cpp', + 'globals.cpp', + 'glock.cpp', + 'gman.cpp', + 'h_ai.cpp', + 'h_battery.cpp', + 'h_cine.cpp', + 'h_cycler.cpp', + 'h_export.cpp', + 'handgrenade.cpp', + 'hassassin.cpp', + 'headcrab.cpp', + 'healthkit.cpp', + 'hgrunt.cpp', + 'hornet.cpp', + 'hornetgun.cpp', + 'houndeye.cpp', + 'ichthyosaur.cpp', + 'islave.cpp', + 'items.cpp', + 'leech.cpp', + 'lights.cpp', + 'maprules.cpp', + 'monstermaker.cpp', + 'monsters.cpp', + 'monsterstate.cpp', + 'mortar.cpp', + 'mp5.cpp', + 'multiplay_gamerules.cpp', + 'nihilanth.cpp', + 'nodes.cpp', + 'observer.cpp', + 'osprey.cpp', + 'pathcorner.cpp', + 'plane.cpp', + 'plats.cpp', + 'player.cpp', + 'playermonster.cpp', + 'python.cpp', + 'rat.cpp', + 'roach.cpp', + 'rpg.cpp', + 'satchel.cpp', + 'schedule.cpp', + 'scientist.cpp', + 'scripted.cpp', + 'shotgun.cpp', + 'singleplay_gamerules.cpp', + 'skill.cpp', + 'sound.cpp', + 'soundent.cpp', + 'spectator.cpp', + 'squadmonster.cpp', + 'squeakgrenade.cpp', + 'subs.cpp', + 'talkmonster.cpp', + 'teamplay_gamerules.cpp', + 'tempmonster.cpp', + 'tentacle.cpp', + 'triggers.cpp', + 'tripmine.cpp', + 'turret.cpp', 'util.cpp', - 'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp'] + 'weapons.cpp', + 'world.cpp', + 'xen.cpp', + 'zombie.cpp' + ] if bld.env.VOICEMGR: source += bld.path.parent.ant_glob([ @@ -57,7 +135,15 @@ def build(bld): else: defines += ['NO_VOICEGAMEMGR'] - includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public') + includes = [ + '.', + 'wpn_shared', + '../common', + '../engine', + '../pm_shared', + '../game_shared', + '../public' + ] libs = [] From 2254a16b7bfb2cf5e030887a8a296d6234f6e970 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 2 Aug 2020 20:23:29 +0500 Subject: [PATCH 088/298] client: wscript: update. --- cl_dll/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 9b8c0acc..b7bf76e9 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -23,7 +23,7 @@ def build(bld): source += bld.path.ant_glob([ 'hl/*.cpp' ]) - source += bld.path.ant_glob([ + source += bld.path.parent.ant_glob([ 'dlls/crossbow.cpp', 'dlls/crowbar.cpp', 'dlls/egon.cpp', From 8e4ded4017827a60a49885c98f43cda06bc61ab3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 9 Aug 2020 03:29:46 +0500 Subject: [PATCH 089/298] wscript: update yet again. --- cl_dll/wscript | 2 +- dlls/wscript | 19 ++++++++++--------- wscript | 4 ++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index b7bf76e9..f02742b7 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -88,7 +88,6 @@ def build(bld): '.', 'hl/', '../dlls', - '../dlls/wpn_shared', '../common', '../engine', '../pm_shared', @@ -125,3 +124,4 @@ def build(bld): subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) + diff --git a/dlls/wscript b/dlls/wscript index 5f17aefc..33d37185 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -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): '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): '../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): subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) + diff --git a/wscript b/wscript index b01647df..3e892ff1 100644 --- a/wscript +++ b/wscript @@ -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', '0') + conf.define('CROWBAR_DELAY_FIX', '0') + conf.define('CROWBAR_FIX_RAPID_CROWBAR', '0') + conf.define('GAUSS_OVERCHARGE_FIX', '0') if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From d7509365f007490a64fe3c7329123d1364e4d083 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 9 Aug 2020 22:23:16 +0500 Subject: [PATCH 090/298] wscript: Fix compilation. --- wscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index 3e892ff1..b08bd906 100644 --- a/wscript +++ b/wscript @@ -271,10 +271,10 @@ def configure(conf): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] conf.define('CLIENT_WEAPONS', '1') - conf.define('CROWBAR_IDLE_ANIM', '0') - conf.define('CROWBAR_DELAY_FIX', '0') - conf.define('CROWBAR_FIX_RAPID_CROWBAR', '0') - conf.define('GAUSS_OVERCHARGE_FIX', '0') + 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') From efe13c3d0419db6427c31a07164c8541cfe77c08 Mon Sep 17 00:00:00 2001 From: Agent Agrimar Date: Sun, 13 Sep 2020 05:58:45 -0400 Subject: [PATCH 091/298] client: wscript: add winmm.lib dependency This fixes a linker error when compiling for win32 with Goldsrc Support enabled. --- cl_dll/wscript | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index f02742b7..07dabf08 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -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' @@ -101,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: From a39583f1ef2c435aa598fb5ce30c4571e1340e20 Mon Sep 17 00:00:00 2001 From: Agent Agrimar Date: Sun, 13 Sep 2020 08:01:53 -0400 Subject: [PATCH 092/298] client: cmake: add winmm.lib dependency This fixes a linker error when compiling for win32 with Goldsrc Support enabled. --- cl_dll/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index cde35d14..b7c98330 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -132,6 +132,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 From dbd9b1c698f00bf132d8ddbf51c06a64970eb55c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 28 Sep 2020 16:21:15 +0300 Subject: [PATCH 093/298] public: build: add ARMv8 32-bit support, in case of someone actually uses it --- cmake/LibraryNaming.cmake | 8 +++++--- public/build.h | 17 +++++++++-------- scripts/waifulib/library_naming.py | 12 +++++++----- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 22581078..f4e3d4b0 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -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) 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") diff --git a/public/build.h b/public/build.h index a087c22c..043a11cd 100644 --- a/public/build.h +++ b/public/build.h @@ -45,13 +45,13 @@ For more information, please refer to #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 #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 #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 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 827ef76c..6ee9a725 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -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): '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): 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" From 4be53d8527eee1d3b56e7f505faba7cefbcb5dac Mon Sep 17 00:00:00 2001 From: Logan Date: Sat, 10 Oct 2020 13:06:04 -0400 Subject: [PATCH 094/298] server: fix monster yaw speed (#137) This makes the yaw speed for all monsters (scientists, headcrabs, etc.) framerate independent. Fix by Solokiller with mikela-valve's adjustments: https://github.com/ValveSoftware/halflife/issues/2458 --- dlls/basemonster.h | 4 ++++ dlls/monsters.cpp | 16 ++++++++++++++++ wscript | 1 + 3 files changed, 21 insertions(+) diff --git a/dlls/basemonster.h b/dlls/basemonster.h index 2234aaf9..48ac9fc9 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -328,5 +328,9 @@ public: BOOL CineCleanup(); CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item. + +#ifdef MONSTER_YAWSPEED_FIX + float m_flLastYawTime; +#endif }; #endif // BASEMONSTER_H diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 57de767d..1192b8ca 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2022,6 +2022,10 @@ void CBaseMonster::MonsterInit( void ) SetThink( &CBaseMonster::MonsterInitThink ); pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); + +#ifdef MONSTER_YAWSPEED_FIX + m_flLastYawTime = gpGlobals->time; +#endif } //========================================================= @@ -2504,7 +2508,15 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) ideal = pev->ideal_yaw; if( current != ideal ) { +#ifdef MONSTER_YAWSPEED_FIX + float delta = gpGlobals->time - m_flLastYawTime; + if( delta > 0.25 ) + delta = 0.25; + + speed = (float)yawSpeed * delta * 2; +#else speed = (float)yawSpeed * gpGlobals->frametime * 10; +#endif move = ideal - current; if( ideal > current ) @@ -2548,6 +2560,10 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) else move = 0; +#ifdef MONSTER_YAWSPEED_FIX + m_flLastYawTime = gpGlobals->time; +#endif + return move; } diff --git a/wscript b/wscript index b08bd906..9c0aba5f 100644 --- a/wscript +++ b/wscript @@ -275,6 +275,7 @@ def configure(conf): conf.define('CROWBAR_DELAY_FIX', False) conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) + conf.define('MONSTER_YAWSPEED_FIX', False) if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From 47c13ef87305d53600af75aa3c7d4d4ffe192641 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 10 Oct 2020 22:43:04 +0500 Subject: [PATCH 095/298] server: Use separate cvar instead of macro for monster yaw speed fix. --- dlls/basemonster.h | 2 -- dlls/game.cpp | 2 ++ dlls/game.h | 1 + dlls/monsters.cpp | 22 ++++++++++------------ wscript | 1 - 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/basemonster.h b/dlls/basemonster.h index 48ac9fc9..a5f7f459 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -329,8 +329,6 @@ public: CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item. -#ifdef MONSTER_YAWSPEED_FIX float m_flLastYawTime; -#endif }; #endif // BASEMONSTER_H diff --git a/dlls/game.cpp b/dlls/game.cpp index c48b44b3..99a959f0 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -35,6 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; +cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; @@ -482,6 +483,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &chargerfix ); CVAR_REGISTER( &satchelfix ); + CVAR_REGISTER( &monsteryawspeedfix ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &aimcrosshair ); diff --git a/dlls/game.h b/dlls/game.h index 026070ff..e60cb4da 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -30,6 +30,7 @@ extern cvar_t weaponstay; extern cvar_t selfgauss; extern cvar_t chargerfix; extern cvar_t satchelfix; +extern cvar_t monsteryawspeedfix; extern cvar_t forcerespawn; extern cvar_t flashlight; extern cvar_t aimcrosshair; diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 1192b8ca..ab82cca5 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2023,9 +2023,7 @@ void CBaseMonster::MonsterInit( void ) pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); -#ifdef MONSTER_YAWSPEED_FIX m_flLastYawTime = gpGlobals->time; -#endif } //========================================================= @@ -2508,15 +2506,17 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) ideal = pev->ideal_yaw; if( current != ideal ) { -#ifdef MONSTER_YAWSPEED_FIX - float delta = gpGlobals->time - m_flLastYawTime; - if( delta > 0.25 ) - delta = 0.25; + if( monsteryawspeedfix.value ) + { + float delta; + + delta = Q_min( gpGlobals->time - m_flLastYawTime, 0.25f ); + + speed = (float)yawSpeed * delta * 2; + } + else + speed = (float)yawSpeed * gpGlobals->frametime * 10; - speed = (float)yawSpeed * delta * 2; -#else - speed = (float)yawSpeed * gpGlobals->frametime * 10; -#endif move = ideal - current; if( ideal > current ) @@ -2560,9 +2560,7 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) else move = 0; -#ifdef MONSTER_YAWSPEED_FIX m_flLastYawTime = gpGlobals->time; -#endif return move; } diff --git a/wscript b/wscript index 9c0aba5f..b08bd906 100644 --- a/wscript +++ b/wscript @@ -275,7 +275,6 @@ def configure(conf): conf.define('CROWBAR_DELAY_FIX', False) conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) - conf.define('MONSTER_YAWSPEED_FIX', False) if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From 2de25090948b64d2ebbe9d2ae7d5a1b90f60b182 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 10 Oct 2020 22:45:28 +0500 Subject: [PATCH 096/298] server: remove "mp_" prefix for non-multiplayer cvars. --- dlls/game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 99a959f0..72d0b75f 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -32,9 +32,9 @@ cvar_t timelimit = { "mp_timelimit","0", FCVAR_SERVER }; cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; -cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; -cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; -cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; +cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; +cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER }; +cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; From 2a264d2c9a33ebbe122364b4faaf2bbac31e5fab Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 11 Oct 2020 00:08:47 +0500 Subject: [PATCH 097/298] Add the latest steam changes for cl_autowepswitch cvar. --- dlls/multiplay_gamerules.cpp | 12 ++++++++++++ dlls/player.cpp | 2 -- dlls/singleplay_gamerules.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 90dc4f3b..5a4b14e0 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -324,6 +324,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. @@ -573,7 +579,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 << WEAPON_SUIT ); addDefault = TRUE; @@ -590,6 +600,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) pPlayer->GiveNamedItem( "weapon_9mmhandgun" ); pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads } + + pPlayer->m_iAutoWepSwitch = iOldAutoWepSwitch; } //========================================================= diff --git a/dlls/player.cpp b/dlls/player.cpp index 6b741778..fc264cc9 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2876,8 +2876,6 @@ void CBasePlayer::Spawn( void ) m_flNextChatTime = gpGlobals->time; - m_iAutoWepSwitch = 1; - g_pGameRules->PlayerSpawn( this ); } diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 7f722e30..ba73747b 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -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; From 9fc712da019a1ca646171e912209a993e7c43976 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 25 Dec 2020 09:14:22 +0300 Subject: [PATCH 098/298] Fix checking for gag spawnflag (#143) --- dlls/monsterstate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/monsterstate.cpp b/dlls/monsterstate.cpp index cec29b79..a642873b 100644 --- a/dlls/monsterstate.cpp +++ b/dlls/monsterstate.cpp @@ -66,7 +66,7 @@ void CBaseMonster::RunAI( void ) // IDLE sound permitted in ALERT state is because monsters were silent in ALERT state. Only play IDLE sound in IDLE state // once we have sounds for that state. - if( ( m_MonsterState == MONSTERSTATE_IDLE || m_MonsterState == MONSTERSTATE_ALERT ) && RANDOM_LONG( 0, 99 ) == 0 && !( pev->flags & SF_MONSTER_GAG ) ) + if( ( m_MonsterState == MONSTERSTATE_IDLE || m_MonsterState == MONSTERSTATE_ALERT ) && RANDOM_LONG( 0, 99 ) == 0 && !( pev->spawnflags & SF_MONSTER_GAG ) ) { IdleSound(); } From 0e251e6f095514b3b27a0d99b2217dab09d6b612 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 10 Feb 2021 20:21:45 +0300 Subject: [PATCH 099/298] Fix attack times --- dlls/weapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index ec98e0ca..1795c191 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -596,7 +596,7 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted ) } else { - return ( attack_time <= 0.0f ) ? TRUE : FALSE; + return ( (static_cast(::floor(attack_time * 1000.0f)) * 1000.0f) <= 0.0f) ? TRUE : FALSE; } } From 0a29ec49c8183ebb8da22a6d2ef395eae9c3dffe Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 10 Feb 2021 20:25:30 +0300 Subject: [PATCH 100/298] Gauss color depends on its charge --- cl_dll/ev_hldm.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 53c6cbcf..f5e512ea 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -948,13 +948,13 @@ void EV_FireGauss( event_args_t *args ) 0.1f, m_fPrimaryFire ? 1.0f : 2.5f, 0.0f, - m_fPrimaryFire ? 128.0f : flDamage, + (m_fPrimaryFire ? 128.0f : flDamage) / 255.0f, 0, 0, 0, - m_fPrimaryFire ? 255 : 255, - m_fPrimaryFire ? 128 : 255, - m_fPrimaryFire ? 0 : 255 + (m_fPrimaryFire ? 255 : 255) / 255.0f, + (m_fPrimaryFire ? 128 : 255) / 255.0f, + (m_fPrimaryFire ? 0 : 255) / 255.0f ); } else @@ -965,13 +965,13 @@ void EV_FireGauss( event_args_t *args ) 0.1f, m_fPrimaryFire ? 1.0f : 2.5f, 0.0f, - m_fPrimaryFire ? 128.0f : flDamage, + (m_fPrimaryFire ? 128.0f : flDamage) / 255.0f, 0, 0, 0, - m_fPrimaryFire ? 255 : 255, - m_fPrimaryFire ? 128 : 255, - m_fPrimaryFire ? 0 : 255 + (m_fPrimaryFire ? 255 : 255) / 255.0f, + (m_fPrimaryFire ? 128 : 255) / 255.0f, + (m_fPrimaryFire ? 0 : 255) / 255.0f ); } From 06f046430defa219eae8c6c7b096276195056850 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 10 Feb 2021 20:30:01 +0300 Subject: [PATCH 101/298] Fix occasional double playing of reload animations --- cl_dll/hl/hl_weapons.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index f305f321..754fd594 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -325,9 +325,13 @@ void CBasePlayerWeapon::ItemPostFrame( void ) { if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) ) { -#if 0 // FIXME, need ammo on client to make this work right +#if 1 // complete the reload. - int j = min( iMaxClip() - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ); + ItemInfo itemInfo; + memset( &itemInfo, 0, sizeof( itemInfo ) ); + GetItemInfo( &itemInfo ); + + int j = Q_min( itemInfo.iMaxClip - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ); // Add them to the clip m_iClip += j; From c7109785490cf46bd72418317ca7aab5c546bd13 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 11 Feb 2021 23:01:32 +0300 Subject: [PATCH 102/298] Fix a bug with extracting ammo from mp5 when argrenades are full --- dlls/weapons.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 1795c191..a69ba196 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1099,13 +1099,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; From 715620135a2fc88eff59937d5f1d2443ba864d34 Mon Sep 17 00:00:00 2001 From: Ivan 'provod' Avdeev Date: Sun, 21 Feb 2021 22:25:52 -0800 Subject: [PATCH 103/298] Make it possible to complie 64-bit binary on windows The change is to supply `x64` to MSVC_TARGETS if `-8` is specified. Note that it will set DEST_CPU to `amd64` instead of expected `x86_64` on Windows. This is known to break things for xash3d-fwgs repo. But for this one it seems just fine? I haven't investigated it further. --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index b08bd906..9f945cea 100644 --- a/wscript +++ b/wscript @@ -87,7 +87,7 @@ 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 + conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64'] if sys.platform == 'win32': conf.load('msvc msdev') conf.load('xcompile compiler_c compiler_cxx strip_on_install') From 2a1867bedf0a348c6153802265064b2028a87e07 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 27 Feb 2021 14:37:12 +0300 Subject: [PATCH 104/298] Fix crowbar smack think time --- dlls/crowbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index ddcb15d8..df702f76 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -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 #if CROWBAR_DELAY_FIX m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; From dc774318b2b276ba45c1dc31ec35e3743ab8b3af Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 28 Feb 2021 13:30:09 +0300 Subject: [PATCH 105/298] wscript: add DEST_CPU msvc hack to HLSDK too, reorganize loading tools --- wscript | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/wscript b/wscript index 9f945cea..3a5081cc 100644 --- a/wscript +++ b/wscript @@ -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') + 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 msdev msvs') - - opt.load('reconfigure subproject') - opt.add_subproject(["cl_dll", "dlls"]) + opt.load('msvc') + opt.load('reconfigure') def configure(conf): # Configuration @@ -88,9 +89,18 @@ def configure(conf): # TODO: wrapper around bld.stlib, bld.shlib and so on? conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01' conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64'] - if sys.platform == 'win32': - conf.load('msvc msdev') - conf.load('xcompile compiler_c compiler_cxx strip_on_install') + + # 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] From a7103c1c142b5417604e1bd5383a4f40a9765e2a Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 28 Feb 2021 15:38:09 +0300 Subject: [PATCH 106/298] waf: upgrade to waifu 1.1.0 --- waf | 12 ++++++------ wscript | 15 +++------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/waf b/waf index ee4820ed..919420c6 100755 --- a/waf +++ b/waf @@ -32,12 +32,12 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect -VERSION="2.0.18" -REVISION="b10d031bad536f1fd766be4ad9ee5a86" -GIT="00501901eb8ea3051ac023e804f9d572ddb61d89" +VERSION="2.0.22" +REVISION="9848c8ac89183c48b69d47e767462720" +GIT="3f8bb163290eb8fbfc3b26d61dd04aa5a6a29d4a" INSTALL='' -C1='#h' -C2='#_' +C1='#=' +C2='#4' C3='#/' cwd = os.getcwd() join = os.path.join @@ -171,5 +171,5 @@ if __name__ == '__main__': Scripting.waf_entry_point(cwd, VERSION, wafdir) #==> -#BZh91AY&SY~7=h&_Z$e~Pc^zf#/#/#/#/#/#/#/#/#/#/#/#/P@#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/ 罹#_>}xFϽѳ#h>5nw[=={=*f%'m7]zhX^_{כcaݛw[s:][G6;n{l_{si}͝oOC<qْjڭMmwO ;m,h`QKݻhPP $κݞ_Ao[6.}#/#/_fuṥ`D)J&= 7.(P$SJE6k\۪ϼ@SH+u*cBo3սym1{׻—6BZ׾{^}N@#/vyw@!T)UÕ>Uxֵ^x $|{J館#ht#/MԝwN)RJ9,m{#hїYU>}}Pa|W#/#/#/#/`h4}4ˀs!U#/#hJmjPh7΍#/#hz:ٮ0J7e: #/P#/<@#/ZTuUlm}燝ۼxwq=#hJِ.Ol/[m۷ZRJ=}vﲟOۙ.{y};{{|Wkw7{}zV]uËJ{eF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ɒ"QHS#=֪O#4I:i39C;LS#/)*`0yofwuI<,|=gKMOZXSJI|IݟCE[&QфAGNKbIC:~ݓRtm%G^1!l_.V1нcfٙHPwAGTjqGE#/ڥTDbj&BVX `u~MzE'w5ӈ '$Y7z=x1h#xG~YοPm4^l8{7v|l d`@B)0AO6@tww\@L4E1#4AUL)!@CT#/$USCQTL @B 2@ 4J!Ae *'yP5!d#/d?,Hu!с W죨,11P_+q x[&#/F Hɠk?kW!D,zR3Y#=6<\N7SS>h&T557EHSf#=1Ah ʹ|[Og~ǪaμC_3#4acz?+w6`k|'^!t2#4I0Ze&kAhm4܌Zp`LisT8v,9k]!㸎u5dcu牜m_a:#=;"3 vx;r+61SޛtL ̞i˓ ȸׄ]<z1#fM&]l̨dhjK2JW:lڝt94OHZJ8dx8'21 zX#4^% )F$f É$P;[G82P| یx:Yɡy|XC#={Y:F~dM]Jaa#/19RaHKe:N̛Z0$.JUhKjBo,ݱ"!hHNv|l#4*bF+mz60RE%S b8"cc#="l>]mF9μSi E 2MЩ%'$~4r@Э#׼k7nlxCX>_yQ$=5#4:܀v\@%{pi` (@M&C>ZqY89j0x '˲vBtHBkʂ#=jrfr#4?WU۔h$xD=` @ Bu=x#= P!JC (Pa9Nҕm+PILÚD3/E)%$W}d/Ϥ/SDu42DDQ#4!Q!CQ!_*4PDMl}n?t#4UzOq6!|Akmӏ_O^QgLs#=#4ּo=#5|3! L>NN1p:Ru8|FV9J;#/!-M-6t_):mKWF.7h8P^agTP 3hkʗ$DmGG⨊gU,#4L;qD 3BJ3% X5YB*9(:Y7#4C<9Uy_~ӫNqA܈zBAQM ĭʠ2:ݕ6O*@?HN?u(/!Q fBLL ,A;7ޗ_vCPO3CN#=EܑN$#^ #<== diff --git a/wscript b/wscript index 3a5081cc..62279ae8 100644 --- a/wscript +++ b/wscript @@ -63,7 +63,7 @@ def configure(conf): conf.env.SERVER_NAME = 'hl' 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'] @@ -114,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 From 5dd184da23abe1a9d8378a61fe13547d703cc9c9 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Fri, 26 Mar 2021 04:08:05 +0500 Subject: [PATCH 107/298] Fix memory leaks when parsing files. --- cl_dll/hud_spectator.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index ce32e4e2..7cb8e1fe 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -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() 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() 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() 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() 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() 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() 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() 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() } } - 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() From c0720d3cfc06720c88594f4c5ece4b6db2e4abce Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 07:07:54 +0500 Subject: [PATCH 108/298] Precache missing sounds for sentry gun. --- dlls/turret.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/turret.cpp b/dlls/turret.cpp index a5aa6d23..556d7ede 100644 --- a/dlls/turret.cpp +++ b/dlls/turret.cpp @@ -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() From 17ab9975010d44779b57bdc3af9b971ee8735a80 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 07:18:32 +0500 Subject: [PATCH 109/298] Remove duplicated macros. --- pm_shared/pm_shared.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 01825777..2352b51f 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -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 From 08f5c265cefebf665eda88d93770ee543a9c4c4f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 07:32:25 +0500 Subject: [PATCH 110/298] Clamp gravity. --- dlls/bigmomma.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index a73334ff..584a6737 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -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 // 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? From 4ba54bdcdc6b3e8b1a022d98c3fe131cd812c31d Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 22:10:51 +0500 Subject: [PATCH 111/298] Fix target check. Same as https://github.com/ValveSoftware/halflife/issues/3083. --- dlls/cbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/cbase.h b/dlls/cbase.h index a09b0a61..ba1c0464 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -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; } From a07acb3d14ec42d6630e5ad7055f790f84a0b6a8 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 22:26:27 +0500 Subject: [PATCH 112/298] Restore global time on Save/Restore. Same as https://github.com/ValveSoftware/halflife/issues/3065. --- dlls/cbase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index 4e6292ba..7f1f204a 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -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 Vector oldOffset; CRestore restoreHelper( pSaveData ); + + gpGlobals->time = pSaveData->time; + if( globalEntity ) { CRestore tmpRestore( pSaveData ); From 93630eae2375bcc25e5596c777a42cc68686ac27 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 22:30:44 +0500 Subject: [PATCH 113/298] Fix player model angles. Same as https://github.com/ValveSoftware/halflife/issues/3075. --- cl_dll/view.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 9ce6208e..01139689 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -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 From 9a6ef538b6be879b9f6e396fb4614da9205f615d Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 12 Apr 2021 09:57:56 +0500 Subject: [PATCH 114/298] Do not precache sounds for xash3d-only builds. --- dlls/enginecallback.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/enginecallback.h b/dlls/enginecallback.h index a9e37c26..19e9b33d 100644 --- a/dlls/enginecallback.h +++ b/dlls/enginecallback.h @@ -28,7 +28,11 @@ extern enginefuncs_t g_engfuncs; // The actual engine callbacks #define GETPLAYERUSERID (*g_engfuncs.pfnGetPlayerUserId) #define PRECACHE_MODEL (*g_engfuncs.pfnPrecacheModel) +#ifdef GOLDSOURCE_SUPPORT #define PRECACHE_SOUND (*g_engfuncs.pfnPrecacheSound) +#else +#define PRECACHE_SOUND(x) +#endif #define PRECACHE_GENERIC (*g_engfuncs.pfnPrecacheGeneric) #define SET_MODEL (*g_engfuncs.pfnSetModel) #define MODEL_INDEX (*g_engfuncs.pfnModelIndex) From 936a303813d441bd718195184bde013aac9e4f16 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 19 Apr 2021 03:11:56 +0500 Subject: [PATCH 115/298] Revert "Do not precache sounds for xash3d-only builds." This reverts commit 9a6ef538b6be879b9f6e396fb4614da9205f615d. --- dlls/enginecallback.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/enginecallback.h b/dlls/enginecallback.h index 19e9b33d..a9e37c26 100644 --- a/dlls/enginecallback.h +++ b/dlls/enginecallback.h @@ -28,11 +28,7 @@ extern enginefuncs_t g_engfuncs; // The actual engine callbacks #define GETPLAYERUSERID (*g_engfuncs.pfnGetPlayerUserId) #define PRECACHE_MODEL (*g_engfuncs.pfnPrecacheModel) -#ifdef GOLDSOURCE_SUPPORT #define PRECACHE_SOUND (*g_engfuncs.pfnPrecacheSound) -#else -#define PRECACHE_SOUND(x) -#endif #define PRECACHE_GENERIC (*g_engfuncs.pfnPrecacheGeneric) #define SET_MODEL (*g_engfuncs.pfnSetModel) #define MODEL_INDEX (*g_engfuncs.pfnModelIndex) From b16001bc1a5aee5e548b9d4e701e4c3296fa6604 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Mon, 10 May 2021 06:10:35 +0300 Subject: [PATCH 116/298] possible crash fix for DeathNotice --- dlls/multiplay_gamerules.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 5a4b14e0..137b3eeb 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -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, 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 From de65256d866bb58459681c7e8425db07bbef870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Wed, 26 May 2021 23:13:43 +0600 Subject: [PATCH 117/298] cmake: fix build Fix the error: Unknown CMake command "elif" --- cmake/LibraryNaming.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index f4e3d4b0..26866447 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -92,7 +92,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}") From e4dd9192cc9cdbc3737c46b11c3fac42dda5ffee Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 1 Jun 2021 17:38:24 +0300 Subject: [PATCH 118/298] client: fix scoreboard not setting IN_SCORE bit in usercmd --- cl_dll/input.cpp | 6 ++++++ cl_dll/scoreboard.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index eab15acf..76659a94 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -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 ) 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 ); diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 721980f3..b5b2ae31 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -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 ); From 7fdc58743d1c3a4de6489232a233cf6f3a1b7a28 Mon Sep 17 00:00:00 2001 From: exstrim401 Date: Sat, 5 Jun 2021 12:48:51 +0500 Subject: [PATCH 119/298] Haiku OS support (#170) * Haiku OS support * Add Haiku OS to CMake LibraryNaming --- cmake/LibraryNaming.cmake | 3 +++ public/build.h | 4 ++++ scripts/waifulib/library_naming.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 26866447..db50422e 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -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) set(BUILDOS "netbsd") elseif(XASH_OPENBSD) set(BUILDOS "openbsd") +elseif(XASH_HAIKU) + set(BUILDOS "haiku") elseif(XASH_EMSCRIPTEN) set(BUILDOS "emscripten") else() diff --git a/public/build.h b/public/build.h index 043a11cd..e23265ce 100644 --- a/public/build.h +++ b/public/build.h @@ -67,6 +67,7 @@ For more information, please refer to #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 #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 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 6ee9a725..baf2ee71 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -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): 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") From 2de4e7ab003d5b1674d12525f5aefb1e57a49fa3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 5 Jun 2021 19:18:33 +0500 Subject: [PATCH 120/298] Fix scientist's sound mask. Same as https://github.com/ValveSoftware/halflife/issues/2982. --- dlls/scientist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index e679770a..e04fabea 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -761,6 +761,9 @@ int CScientist::ISoundMask( void ) { return bits_SOUND_WORLD | bits_SOUND_COMBAT | + bits_SOUND_CARCASS | + bits_SOUND_MEAT | + bits_SOUND_GARBAGE | bits_SOUND_DANGER | bits_SOUND_PLAYER; } From 8c45ae9bb2eb5efd4999e1e39f6b34daeefa9ae7 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 5 Jun 2021 20:02:32 +0500 Subject: [PATCH 121/298] Fix underwater breathing sounds when player not fully in the water. Same as https://github.com/ValveSoftware/halflife/issues/3110. --- dlls/player.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index fc264cc9..6f5f2541 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -1198,23 +1198,26 @@ void CBasePlayer::WaterMove() } // make bubbles - air = (int)( pev->air_finished - gpGlobals->time ); - if( !RANDOM_LONG( 0, 0x1f ) && RANDOM_LONG( 0, AIRTIME - 1 ) >= air ) + if( pev->waterlevel == 3 ) { - switch( RANDOM_LONG( 0, 3 ) ) + air = (int)( pev->air_finished - gpGlobals->time ); + if( !RANDOM_LONG( 0, 0x1f ) && RANDOM_LONG( 0, AIRTIME - 1 ) >= air ) { - case 0: - EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim1.wav", 0.8, ATTN_NORM ); - break; - case 1: - EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim2.wav", 0.8, ATTN_NORM ); - break; - case 2: - EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim3.wav", 0.8, ATTN_NORM ); - break; - case 3: - EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim4.wav", 0.8, ATTN_NORM ); - break; + switch( RANDOM_LONG( 0, 3 ) ) + { + case 0: + EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim1.wav", 0.8, ATTN_NORM ); + break; + case 1: + EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim2.wav", 0.8, ATTN_NORM ); + break; + case 2: + EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim3.wav", 0.8, ATTN_NORM ); + break; + case 3: + EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim4.wav", 0.8, ATTN_NORM ); + break; + } } } From 2c7e07ef490a7ba5d466a299ac77a04ce623e6da Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 5 Jun 2021 20:13:07 +0500 Subject: [PATCH 122/298] Fix egon beam color. Same as https://github.com/ValveSoftware/halflife/issues/3033. --- cl_dll/ev_hldm.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index f5e512ea..0db780f7 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1373,7 +1373,7 @@ void EV_FireRpg( event_args_t *args ) //====================== //====================== -// EGON END +// EGON START //====================== enum egon_e { @@ -1502,10 +1502,11 @@ void EV_EgonFire( event_args_t *args ) float g = 50.0f; float b = 125.0f; - if( IEngineStudio.IsHardware() ) + // if( IEngineStudio.IsHardware() ) { - r /= 100.0f; - g /= 100.0f; + r /= 255.0f; + g /= 255.0f; + b /= 255.0f; } pBeam = gEngfuncs.pEfxAPI->R_BeamEntPoint( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 3.5, 0.2, 0.7, 55, 0, 0, r, g, b ); From 6274c601febb5cacf82500a4aa4dae926debda47 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 5 Jun 2021 20:20:22 +0500 Subject: [PATCH 123/298] Fix trigger_camera fps dependency. Same as https://github.com/ValveSoftware/halflife/issues/2924. --- dlls/triggers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 2c0888c9..a4bcbbc7 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -2318,8 +2318,8 @@ void CTriggerCamera::FollowTarget() if( dy > 180 ) dy = dy - 360; - pev->avelocity.x = dx * 40 * gpGlobals->frametime; - pev->avelocity.y = dy * 40 * gpGlobals->frametime; + pev->avelocity.x = dx * 40 * 0.01f; + pev->avelocity.y = dy * 40 * 0.01f; if( !( FBitSet( pev->spawnflags, SF_CAMERA_PLAYER_TAKECONTROL ) ) ) { From ea9eb82646957a892f10796c13efac73f8687a5e Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 5 Jun 2021 20:56:57 +0500 Subject: [PATCH 124/298] Set monsteryawspeedfix cvar to 1 by default. --- dlls/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 72d0b75f..1207a089 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -35,7 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; -cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER }; +cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; From 9fecfb50f352764f13266117b5882e2d33a996c8 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 16 Mar 2021 18:53:50 +0300 Subject: [PATCH 125/298] Merge https://github.com/Solokiller/halflife-updated/commit/2ca64e11b05b1f3f62af9640636f891b7c38cc8c --- dlls/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 8344c814..87e08ce7 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -637,7 +637,7 @@ void DoSpark( entvars_t *pev, const Vector &location ) void CBaseButton::ButtonSpark( void ) { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval + pev->nextthink = pev->ltime + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval DoSpark( pev, pev->mins ); } From 397286021c1e1c6c67dca45f3420c0fb8c8d28fb Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 11 Feb 2021 02:34:07 +0300 Subject: [PATCH 126/298] Try fixing occasional bug with missing mp5 reload animation when holding primary attack after clip was depleted --- cl_dll/hl/hl_weapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 754fd594..43485100 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -372,7 +372,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fFireOnEmpty = FALSE; // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing - if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0f ) + if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack <= 0.0f ) { Reload(); return; From 464a678b3311b18d31c8d628ac53c930f819e46c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 6 Jun 2021 02:40:52 +0500 Subject: [PATCH 127/298] Remove WeaponTick and override ItemPostFrame instead. --- dlls/shotgun.cpp | 4 +++- dlls/weapons.cpp | 2 -- dlls/weapons.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index 90ec7e8c..9c84c5c2 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -302,7 +302,7 @@ void CShotgun::Reload( void ) } } -void CShotgun::WeaponTick() +void CShotgun::ItemPostFrame( void ) { if( m_flPumpTime && m_flPumpTime < gpGlobals->time ) { @@ -310,6 +310,8 @@ void CShotgun::WeaponTick() EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) ); m_flPumpTime = 0; } + + CBasePlayerWeapon::ItemPostFrame(); } void CShotgun::WeaponIdle( void ) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index a69ba196..42e1f6ce 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -602,8 +602,6 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted ) void CBasePlayerWeapon::ItemPostFrame( void ) { - WeaponTick(); - if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= UTIL_WeaponTimeBase() ) ) { // complete the reload. diff --git a/dlls/weapons.h b/dlls/weapons.h index 312f5531..d1051883 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -319,7 +319,6 @@ public: virtual void PrimaryAttack( void ) { return; } // do "+ATTACK" virtual void SecondaryAttack( void ) { return; } // do "+ATTACK2" virtual void Reload( void ) { return; } // do "+RELOAD" - virtual void WeaponTick() {} // Always called at beginning of ItemPostFrame. - Solokiller virtual void WeaponIdle( void ) { return; } // called when no buttons pressed virtual int UpdateClientData( CBasePlayer *pPlayer ); // sends hud info to client dll, if things have changed virtual void RetireWeapon( void ); @@ -639,8 +638,8 @@ public: void SecondaryAttack( void ); BOOL Deploy( ); void Reload( void ); - void WeaponTick(); void WeaponIdle( void ); + void ItemPostFrame( void ); int m_fInReload; float m_flNextReload; int m_iShell; From 593c9185aa2d43d56bacd67599a0843342bea02d Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 6 Jun 2021 02:48:22 +0500 Subject: [PATCH 128/298] Do not override IsUseable for mp5. Merge https://github.com/Solokiller/halflife-updated/commit/a9b1d9cda8e063258fc9291ada671c09ef71472b. --- dlls/mp5.cpp | 6 ------ dlls/weapons.cpp | 32 +++++++++++++++++++++++++++----- dlls/weapons.h | 1 - 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index fcfbd179..47d0a24d 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -270,12 +270,6 @@ void CMP5::WeaponIdle( void ) m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // how long till we do this again. } -BOOL CMP5::IsUseable() -{ - //Can be used if the player has AR grenades. - Solokiller - return CBasePlayerWeapon::IsUseable() || m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] > 0; -} - class CMP5AmmoClip : public CBasePlayerAmmo { void Spawn( void ) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 42e1f6ce..88c91a36 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -897,16 +897,38 @@ BOOL CBasePlayerWeapon::AddSecondaryAmmo( int iCount, char *szName, int iMax ) //========================================================= BOOL CBasePlayerWeapon::IsUseable( void ) { - if( m_iClip <= 0 ) + if( m_iClip > 0 ) { - if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] <= 0 && iMaxAmmo1() != -1 ) + return TRUE; + } + + // Player has unlimited ammo for this weapon or does not use magazines + if( iMaxAmmo1() == WEAPON_NOCLIP ) + { + return TRUE; + } + + if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] > 0 ) + { + return TRUE; + } + + if( pszAmmo2() ) + { + // Player has unlimited ammo for this weapon or does not use magazines + if( iMaxAmmo2() == WEAPON_NOCLIP ) { - // clip is empty (or nonexistant) and the player has no more ammo of this type. - return FALSE; + return TRUE; + } + + if( m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] > 0 ) + { + return TRUE; } } - return TRUE; + // clip is empty (or nonexistant) and the player has no more ammo of this type. + return FALSE; } BOOL CBasePlayerWeapon::CanDeploy( void ) diff --git a/dlls/weapons.h b/dlls/weapons.h index d1051883..a3870299 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -568,7 +568,6 @@ public: BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); - BOOL IsUseable(); float m_flNextAnimTime; int m_iShell; From 2c9cb0c645b8e8b4014760063406e8c447929d91 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 6 Jun 2021 03:48:55 +0500 Subject: [PATCH 129/298] Revert "Merge https://github.com/SamVanheer/HLEnhanced/commit/33413807d0ca23f3d9121e45f5584cb5be98751b" This reverts commit 19bdc1d01b7287cd61b58fb7b7bdb6953caa50a8. --- dlls/gauss.cpp | 36 ++++++++++-------------------------- dlls/weapons.h | 2 +- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 96345ad2..50707dfe 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -124,12 +124,6 @@ int CGauss::GetItemInfo( ItemInfo *p ) return 1; } -BOOL CGauss::IsUseable() -{ - // Currently charging, allow the player to fire it first. - Solokiller - return CBasePlayerWeapon::IsUseable() || m_fInAttack != 0; -} - BOOL CGauss::Deploy() { m_pPlayer->m_flPlayAftershock = 0.0; @@ -231,22 +225,6 @@ void CGauss::SecondaryAttack() } else { - // Moved to before the ammo burn. - // Because we drained 1 when m_InAttack == 0, then 1 again now before checking if we're out of ammo, - // this resuled in the player having -1 ammo, which in turn caused CanDeploy to think it could be deployed. - // This will need to be fixed further down the line by preventing negative ammo unless explicitly required (infinite ammo?), - // But this check will prevent the problem for now. - Solokiller - // TODO: investigate further. - if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) - { - // out of ammo! force the gun to fire - StartFire(); - m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1; - return; - } - // 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 ) { @@ -266,6 +244,16 @@ void CGauss::SecondaryAttack() } } + if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) + { + // out of ammo! force the gun to fire + StartFire(); + m_fInAttack = 0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1; + return; + } + if( UTIL_WeaponTimeBase() >= m_pPlayer->m_flAmmoStartCharge ) { // don't eat any more ammo after gun is fully charged. @@ -583,10 +571,6 @@ void CGauss::WeaponIdle( void ) StartFire(); m_fInAttack = 0; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; - - // Need to set m_flNextPrimaryAttack so the weapon gets a chance to complete its secondary fire animation. - Solokiller - if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; } else { diff --git a/dlls/weapons.h b/dlls/weapons.h index a3870299..ad8f2fe4 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -745,7 +745,7 @@ public: int iItemSlot( void ) { return 4; } int GetItemInfo(ItemInfo *p); int AddToPlayer( CBasePlayer *pPlayer ); - BOOL IsUseable(); + BOOL Deploy( void ); void Holster( int skiplocal = 0 ); From 7a999bf987becaa268e50c6e40a609c949fff699 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 2 Jun 2021 02:10:30 +0300 Subject: [PATCH 130/298] Check before SetEnemy in squad monster --- dlls/squadmonster.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/squadmonster.cpp b/dlls/squadmonster.cpp index cbf3f19f..60479878 100644 --- a/dlls/squadmonster.cpp +++ b/dlls/squadmonster.cpp @@ -256,7 +256,10 @@ void CSquadMonster::SquadMakeEnemy( CBaseEntity *pEnemy ) if( pMember ) { // reset members who aren't activly engaged in fighting - if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) ) + if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) + && ( pMember->m_pSchedule && (pMember->m_pSchedule->iInterruptMask & bits_COND_NEW_ENEMY) ) + // My enemy might be not an enemy for member of my squad, e.g. if I was provoked by player. + && pMember->IRelationship(pEnemy) >= R_DL ) { if( pMember->m_hEnemy != 0 ) { From 59508d66da0ce01f596d43573dbf46a4c43c8111 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 13 May 2021 01:27:10 +0300 Subject: [PATCH 131/298] Allow special beam color for houndeye squad of size 5 --- dlls/houndeye.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index ba388b63..0333ca21 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -514,6 +514,7 @@ void CHoundeye::WriteBeamColor( void ) bBlue = 255; break; case 4: + case 5: bRed = 62; bGreen = 33; bBlue = 211; From b4502f71336a08f3f2c72b7b061b2838a149a11b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 9 May 2021 04:36:02 +0300 Subject: [PATCH 132/298] Fix removing squad member --- dlls/squadmonster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/squadmonster.cpp b/dlls/squadmonster.cpp index 60479878..d168d732 100644 --- a/dlls/squadmonster.cpp +++ b/dlls/squadmonster.cpp @@ -167,7 +167,7 @@ void CSquadMonster::SquadRemove( CSquadMonster *pRemove ) { for( int i = 0; i < MAX_SQUAD_MEMBERS - 1; i++ ) { - if( pSquadLeader->m_hSquadMember[i] == this ) + if( pSquadLeader->m_hSquadMember[i] == pRemove ) { pSquadLeader->m_hSquadMember[i] = NULL; break; From 06dd8a63cd2999e401fe03ce00dcfcabad3820a1 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 6 Jun 2021 04:11:36 +0500 Subject: [PATCH 133/298] Double promotion fix. --- dlls/gauss.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 50707dfe..c9352e8e 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -249,7 +249,7 @@ void CGauss::SecondaryAttack() // out of ammo! force the gun to fire StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1; return; } From 27ebf408495a422c3e8db07ff52cf908bd4deb93 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 6 Jun 2021 22:15:36 +0300 Subject: [PATCH 134/298] 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 135/298] #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 136/298] 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 137/298] 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 138/298] 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 139/298] 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 140/298] 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 141/298] 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; From 6055d3d3eb97cc107372e76e373eb6d6f79c28c8 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 14 Jun 2021 01:35:35 +0500 Subject: [PATCH 142/298] Avoid .def-file usage. --- dlls/compile.bat | 2 +- dlls/h_export.cpp | 4 ++-- dlls/wscript | 11 ++--------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/dlls/compile.bat b/dlls/compile.bat index f97806a5..0106f56d 100644 --- a/dlls/compile.bat +++ b/dlls/compile.bat @@ -113,7 +113,7 @@ set LIBS=user32.lib set OUTNAME=hl.dll set DEBUG=/debug -cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% /def:".\hl.def" +cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% echo -- Compile done. Cleaning... diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index 11884f9c..88353c7c 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -43,8 +43,8 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) return TRUE; } -// stdcall for win32 -#define EXPORT2 WINAPI +// cdecl for win32 +#define EXPORT2 WINAPIV #else #define EXPORT2 #endif diff --git a/dlls/wscript b/dlls/wscript index 33d37185..854bbb73 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -10,15 +10,8 @@ def options(opt): return def configure(conf): - if conf.env.COMPILER_CC == 'msvc': - # hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows. - # Without this, the lookup for this function fails. - hlDefNode = conf.path.find_resource("./hl.def") - - if hlDefNode is not None: - conf.env.append_unique('LINKFLAGS', '/def:%s' % hlDefNode.abspath()) - else: - conf.fatal("Could not find hl.def") + # stub + return def build(bld): source = bld.path.parent.ant_glob([ From 72b7471b89502ff8202e6d07768f3d24227f0d78 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 14 Jun 2021 01:36:51 +0500 Subject: [PATCH 143/298] Get rid of hl.def. --- dlls/hl.def | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 dlls/hl.def diff --git a/dlls/hl.def b/dlls/hl.def deleted file mode 100644 index c009191a..00000000 --- a/dlls/hl.def +++ /dev/null @@ -1,5 +0,0 @@ -LIBRARY hl -EXPORTS - GiveFnptrsToDll @1 -SECTIONS - .data READ WRITE From da5efc7146dd7dd07e248f948b172b38366c1597 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 14 Jun 2021 01:39:55 +0500 Subject: [PATCH 144/298] Get rid of project files for MSVC 98. --- cl_dll/cl_dll.dsp | 636 --------------------------------------- dlls/hl.dsp | 747 ---------------------------------------------- 2 files changed, 1383 deletions(-) delete mode 100644 cl_dll/cl_dll.dsp delete mode 100644 dlls/hl.dsp diff --git a/cl_dll/cl_dll.dsp b/cl_dll/cl_dll.dsp deleted file mode 100644 index 17beb9ae..00000000 --- a/cl_dll/cl_dll.dsp +++ /dev/null @@ -1,636 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cl_dll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=cl_dll - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cl_dll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cl_dll.mak" CFG="cl_dll - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cl_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "cl_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "cl_dll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\temp\cl_dll\!release" -# PROP Intermediate_Dir "..\temp\cl_dll\!release" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\utils\false_vgui\include" /I "..\engine" /I "..\common" /I "..\pm_shared" /I "..\dlls" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "CLIENT_DLL" /D "CLIENT_WEAPONS" /YX /FD /c -# SUBTRACT CPP /Z -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib winmm.lib ../utils/vgui/lib/win32_vc6/vgui.lib wsock32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\temp\cl_dll\!release/client.dll" -# SUBTRACT LINK32 /map -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\cl_dll\!release -InputPath=\Xash3D\src_main\temp\cl_dll\!release\client.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\valve\cl_dlls\client.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\client.dll "D:\Xash3D\valve\cl_dlls\client.dll" - -# End Custom Build - -!ELSEIF "$(CFG)" == "cl_dll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\Debug" -# PROP BASE Intermediate_Dir ".\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\temp\cl_dll\!debug" -# PROP Intermediate_Dir "..\temp\cl_dll\!debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /GR /GX /ZI /Od /I "..\dlls" /I "..\common" /I "..\pm_shared" /I "..\engine" /I "..\utils\false_vgui\include" /I "..\game_shared" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "CLIENT_DLL" /D "CLIENT_WEAPONS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib winmm.lib ../utils/vgui/lib/win32_vc6/vgui.lib wsock32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"..\temp\cl_dll\!debug/client.dll" -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\cl_dll\!debug -InputPath=\Xash3D\src_main\temp\cl_dll\!debug\client.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\valve\cl_dlls\client.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\client.dll "D:\Xash3D\valve\cl_dlls\client.dll" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "cl_dll - Win32 Release" -# Name "cl_dll - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" -# Begin Group "hl" - -# PROP Default_Filter "*.CPP" -# Begin Source File - -SOURCE=..\dlls\crossbow.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\crowbar.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\egon.cpp -# End Source File -# Begin Source File - -SOURCE=.\ev_hldm.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\gauss.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\handgrenade.cpp -# End Source File -# Begin Source File - -SOURCE=.\hl\hl_baseentity.cpp -# End Source File -# Begin Source File - -SOURCE=.\hl\hl_events.cpp -# End Source File -# Begin Source File - -SOURCE=.\hl\hl_objects.cpp -# End Source File -# Begin Source File - -SOURCE=.\hl\hl_weapons.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\glock.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\hornetgun.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\mp5.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\python.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\rpg.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\satchel.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\shotgun.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\squeakgrenade.cpp -# End Source File -# Begin Source File - -SOURCE=..\dlls\tripmine.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_scrollbar2.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_slider2.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_banmgr.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_status.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=.\ammo.cpp -# End Source File -# Begin Source File - -SOURCE=.\ammo_secondary.cpp -# End Source File -# Begin Source File - -SOURCE=.\ammohistory.cpp -# End Source File -# Begin Source File - -SOURCE=.\battery.cpp -# End Source File -# Begin Source File - -SOURCE=.\cdll_int.cpp -# End Source File -# Begin Source File - -SOURCE=.\com_weapons.cpp -# End Source File -# Begin Source File - -SOURCE=.\death.cpp -# End Source File -# Begin Source File - -SOURCE=.\demo.cpp -# End Source File -# Begin Source File - -SOURCE=.\entity.cpp -# End Source File -# Begin Source File - -SOURCE=.\ev_common.cpp -# End Source File -# Begin Source File - -SOURCE=.\events.cpp -# End Source File -# Begin Source File - -SOURCE=.\flashlight.cpp -# End Source File -# Begin Source File - -SOURCE=.\GameStudioModelRenderer.cpp -# End Source File -# Begin Source File - -SOURCE=.\geiger.cpp -# End Source File -# Begin Source File - -SOURCE=.\health.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud_msg.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud_redraw.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud_servers.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud_spectator.cpp -# End Source File -# Begin Source File - -SOURCE=.\hud_update.cpp -# End Source File -# Begin Source File - -SOURCE=.\in_camera.cpp -# End Source File -# Begin Source File - -SOURCE=.\input.cpp -# End Source File -# Begin Source File - -SOURCE=.\input_goldsource.cpp -# End Source File -# Begin Source File - -SOURCE=.\input_mouse.cpp -# End Source File -# Begin Source File - -SOURCE=.\input_xash3d.cpp -# End Source File -# Begin Source File - -SOURCE=.\menu.cpp -# End Source File -# Begin Source File - -SOURCE=.\message.cpp -# End Source File -# Begin Source File - -SOURCE=.\overview.cpp -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\parsemsg.cpp -# End Source File -# Begin Source File - -SOURCE=.\parsemsg.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_debug.c -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_math.c -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_shared.c -# End Source File -# Begin Source File - -SOURCE=.\saytext.cpp -# End Source File -# Begin Source File - -SOURCE=.\status_icons.cpp -# End Source File -# Begin Source File - -SOURCE=.\statusbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\studio_util.cpp -# End Source File -# Begin Source File - -SOURCE=.\StudioModelRenderer.cpp -# End Source File -# Begin Source File - -SOURCE=.\text_message.cpp -# End Source File -# Begin Source File - -SOURCE=.\train.cpp -# End Source File -# Begin Source File - -SOURCE=.\tri.cpp -# End Source File -# Begin Source File - -SOURCE=.\util.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_checkbutton2.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_ClassMenu.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_ConsolePanel.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_ControlConfigPanel.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_CustomObjects.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_grid.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_helpers.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_int.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_listbox.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\vgui_loadtga.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_MOTDWindow.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_SchemeManager.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_ScorePanel.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_ServerBrowser.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_SpectatorPanel.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_TeamFortressViewport.cpp -# End Source File -# Begin Source File - -SOURCE=.\vgui_teammenu.cpp -# End Source File -# Begin Source File - -SOURCE=.\view.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\ammo.h -# End Source File -# Begin Source File - -SOURCE=.\ammohistory.h -# End Source File -# Begin Source File - -SOURCE=.\camera.h -# End Source File -# Begin Source File - -SOURCE=.\cl_dll.h -# End Source File -# Begin Source File - -SOURCE=.\com_weapons.h -# End Source File -# Begin Source File - -SOURCE=.\demo.h -# End Source File -# Begin Source File - -SOURCE=.\ev_hldm.h -# End Source File -# Begin Source File - -SOURCE=.\eventscripts.h -# End Source File -# Begin Source File - -SOURCE=.\GameStudioModelRenderer.h -# End Source File -# Begin Source File - -SOURCE=.\health.h -# End Source File -# Begin Source File - -SOURCE=.\hud.h -# End Source File -# Begin Source File - -SOURCE=.\hud_iface.h -# End Source File -# Begin Source File - -SOURCE=.\hud_servers.h -# End Source File -# Begin Source File - -SOURCE=.\hud_servers_priv.h -# End Source File -# Begin Source File - -SOURCE=.\hud_spectator.h -# End Source File -# Begin Source File - -SOURCE=.\in_defs.h -# End Source File -# Begin Source File - -SOURCE=.\input_mouse.h -# End Source File -# Begin Source File - -SOURCE=..\common\itrackeruser.h -# End Source File -# Begin Source File - -SOURCE=.\kbutton.h -# End Source File -# Begin Source File - -SOURCE=.\overview.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_debug.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_defs.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_info.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_materials.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_movevars.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_shared.h -# End Source File -# Begin Source File - -SOURCE=.\studio_util.h -# End Source File -# Begin Source File - -SOURCE=.\StudioModelRenderer.h -# End Source File -# Begin Source File - -SOURCE=.\util.h -# End Source File -# Begin Source File - -SOURCE=.\util_vector.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_ConsolePanel.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_ControlConfigPanel.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_int.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_SchemeManager.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_ScorePanel.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_ServerBrowser.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_SpectatorPanel.h -# End Source File -# Begin Source File - -SOURCE=.\vgui_TeamFortressViewport.h -# End Source File -# Begin Source File - -SOURCE=.\view.h -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_banmgr.h -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_status.h -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_vgui_tweakdlg.h -# End Source File -# Begin Source File - -SOURCE=.\wrect.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/dlls/hl.dsp b/dlls/hl.dsp deleted file mode 100644 index 7985e2e6..00000000 --- a/dlls/hl.dsp +++ /dev/null @@ -1,747 +0,0 @@ -# Microsoft Developer Studio Project File - Name="hl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=hl - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "hl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "hl.mak" CFG="hl - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "hl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "hl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "hl - Win32 Profile" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "hl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\temp\dlls\!release" -# PROP Intermediate_Dir "..\temp\dlls\!release" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MT /W3 /O2 /I "..\dlls" /I "..\engine" /I "..\common" /I "..\pm_shared" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "QUIVER" /D "VOXEL" /D "QUAKE2" /D "VALVE_DLL" /D "CLIENT_WEAPONS" /Fr /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\hl.def" -# SUBTRACT LINK32 /profile /map -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\dlls\!release -InputPath=\Xash3D\src_main\temp\dlls\!release\hl.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\valve\dlls\hl.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\hl.dll "D:\Xash3D\valve\dlls\hl.dll" - -# End Custom Build - -!ELSEIF "$(CFG)" == "hl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\hl___Win" -# PROP BASE Intermediate_Dir ".\hl___Win" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\temp\dlls\!debug" -# PROP Intermediate_Dir "..\temp\dlls\!debug" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /G5 /MTd /W3 /Gm /ZI /Od /I "..\dlls" /I "..\engine" /I "..\common" /I "..\game_shared" /I "..\pm_shared" /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "QUIVER" /D "VOXEL" /D "QUAKE2" /D "VALVE_DLL" /D "CLIENT_WEAPONS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\engine" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 user32.lib advapi32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\hl.def" -# SUBTRACT LINK32 /profile -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\dlls\!debug -InputPath=\Xash3D\src_main\temp\dlls\!debug\hl.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\valve\dlls\hl.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\hl.dll "D:\Xash3D\valve\dlls\hl.dll" - -# End Custom Build - -!ELSEIF "$(CFG)" == "hl - Win32 Profile" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\hl___Win" -# PROP BASE Intermediate_Dir ".\hl___Win" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\temp\dlls\!profile" -# PROP Intermediate_Dir "..\temp\dlls\!profile" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G5 /MT /W3 /GX /Zi /O2 /I "..\engine" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "QUIVER" /D "VOXEL" /D "QUAKE2" /D "VALVE_DLL" /YX /c -# SUBTRACT BASE CPP /Fr -# ADD CPP /nologo /G5 /MT /W3 /Zi /O2 /I "..\dlls" /I "..\engine" /I "..\common" /I "..\pm_shared" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "QUIVER" /D "VOXEL" /D "QUAKE2" /D "VALVE_DLL" /D "CLIENT_WEAPONS" /YX /FD /c -# SUBTRACT CPP /Fr -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\hl.def" -# SUBTRACT BASE LINK32 /profile -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /profile /debug /machine:I386 /def:".\hl.def" -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\dlls\!profile -InputPath=\Xash3D\src_main\temp\dlls\!profile\hl.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\valve\dlls\hl.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\hl.dll "D:\Xash3D\valve\dlls\hl.dll" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "hl - Win32 Release" -# Name "hl - Win32 Debug" -# Name "hl - Win32 Profile" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=.\aflock.cpp -# End Source File -# Begin Source File - -SOURCE=.\agrunt.cpp -# End Source File -# Begin Source File - -SOURCE=.\airtank.cpp -# End Source File -# Begin Source File - -SOURCE=.\animating.cpp -# End Source File -# Begin Source File - -SOURCE=.\animation.cpp -# End Source File -# Begin Source File - -SOURCE=.\apache.cpp -# End Source File -# Begin Source File - -SOURCE=.\barnacle.cpp -# End Source File -# Begin Source File - -SOURCE=.\barney.cpp -# End Source File -# Begin Source File - -SOURCE=.\bigmomma.cpp -# End Source File -# Begin Source File - -SOURCE=.\bloater.cpp -# End Source File -# Begin Source File - -SOURCE=.\bmodels.cpp -# End Source File -# Begin Source File - -SOURCE=.\bullsquid.cpp -# End Source File -# Begin Source File - -SOURCE=.\buttons.cpp -# End Source File -# Begin Source File - -SOURCE=.\cbase.cpp -# End Source File -# Begin Source File - -SOURCE=.\client.cpp -# End Source File -# Begin Source File - -SOURCE=.\combat.cpp -# End Source File -# Begin Source File - -SOURCE=.\controller.cpp -# End Source File -# Begin Source File - -SOURCE=.\crossbow.cpp -# End Source File -# Begin Source File - -SOURCE=.\crowbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\defaultai.cpp -# End Source File -# Begin Source File - -SOURCE=.\doors.cpp -# End Source File -# Begin Source File - -SOURCE=.\effects.cpp -# End Source File -# Begin Source File - -SOURCE=.\egon.cpp -# End Source File -# Begin Source File - -SOURCE=.\explode.cpp -# End Source File -# Begin Source File - -SOURCE=.\flyingmonster.cpp -# End Source File -# Begin Source File - -SOURCE=.\func_break.cpp -# End Source File -# Begin Source File - -SOURCE=.\func_tank.cpp -# End Source File -# Begin Source File - -SOURCE=.\game.cpp -# End Source File -# Begin Source File - -SOURCE=.\gamerules.cpp -# End Source File -# Begin Source File - -SOURCE=.\gargantua.cpp -# End Source File -# Begin Source File - -SOURCE=.\gauss.cpp -# End Source File -# Begin Source File - -SOURCE=.\genericmonster.cpp -# End Source File -# Begin Source File - -SOURCE=.\ggrenade.cpp -# End Source File -# Begin Source File - -SOURCE=.\globals.cpp -# End Source File -# Begin Source File - -SOURCE=.\glock.cpp -# End Source File -# Begin Source File - -SOURCE=.\gman.cpp -# End Source File -# Begin Source File - -SOURCE=.\h_ai.cpp -# End Source File -# Begin Source File - -SOURCE=.\h_battery.cpp -# End Source File -# Begin Source File - -SOURCE=.\h_cine.cpp -# End Source File -# Begin Source File - -SOURCE=.\h_cycler.cpp -# End Source File -# Begin Source File - -SOURCE=.\h_export.cpp -# End Source File -# Begin Source File - -SOURCE=.\handgrenade.cpp -# End Source File -# Begin Source File - -SOURCE=.\hassassin.cpp -# End Source File -# Begin Source File - -SOURCE=.\headcrab.cpp -# End Source File -# Begin Source File - -SOURCE=.\healthkit.cpp -# End Source File -# Begin Source File - -SOURCE=.\hgrunt.cpp -# End Source File -# Begin Source File - -SOURCE=.\hornet.cpp -# End Source File -# Begin Source File - -SOURCE=.\hornetgun.cpp -# End Source File -# Begin Source File - -SOURCE=.\houndeye.cpp -# End Source File -# Begin Source File - -SOURCE=.\ichthyosaur.cpp -# End Source File -# Begin Source File - -SOURCE=.\islave.cpp -# End Source File -# Begin Source File - -SOURCE=.\items.cpp -# End Source File -# Begin Source File - -SOURCE=.\leech.cpp -# End Source File -# Begin Source File - -SOURCE=.\lights.cpp -# End Source File -# Begin Source File - -SOURCE=.\maprules.cpp -# End Source File -# Begin Source File - -SOURCE=.\monstermaker.cpp -# End Source File -# Begin Source File - -SOURCE=.\monsters.cpp -# End Source File -# Begin Source File - -SOURCE=.\monsterstate.cpp -# End Source File -# Begin Source File - -SOURCE=.\mortar.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp5.cpp -# End Source File -# Begin Source File - -SOURCE=.\multiplay_gamerules.cpp -# End Source File -# Begin Source File - -SOURCE=.\nihilanth.cpp -# End Source File -# Begin Source File - -SOURCE=.\nodes.cpp -# End Source File -# Begin Source File - -SOURCE=.\osprey.cpp -# End Source File -# Begin Source File - -SOURCE=.\pathcorner.cpp -# End Source File -# Begin Source File - -SOURCE=.\plane.cpp -# End Source File -# Begin Source File - -SOURCE=.\plats.cpp -# End Source File -# Begin Source File - -SOURCE=.\player.cpp -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_debug.c -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_math.c -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_shared.c -# End Source File -# Begin Source File - -SOURCE=.\python.cpp -# End Source File -# Begin Source File - -SOURCE=.\rat.cpp -# End Source File -# Begin Source File - -SOURCE=.\roach.cpp -# End Source File -# Begin Source File - -SOURCE=.\rpg.cpp -# End Source File -# Begin Source File - -SOURCE=.\satchel.cpp -# End Source File -# Begin Source File - -SOURCE=.\schedule.cpp -# End Source File -# Begin Source File - -SOURCE=.\scientist.cpp -# End Source File -# Begin Source File - -SOURCE=.\scripted.cpp -# End Source File -# Begin Source File - -SOURCE=.\shotgun.cpp -# End Source File -# Begin Source File - -SOURCE=.\singleplay_gamerules.cpp -# End Source File -# Begin Source File - -SOURCE=.\skill.cpp -# End Source File -# Begin Source File - -SOURCE=.\sound.cpp -# End Source File -# Begin Source File - -SOURCE=.\soundent.cpp -# End Source File -# Begin Source File - -SOURCE=.\spectator.cpp -# End Source File -# Begin Source File - -SOURCE=.\squadmonster.cpp -# End Source File -# Begin Source File - -SOURCE=.\squeakgrenade.cpp -# End Source File -# Begin Source File - -SOURCE=.\subs.cpp -# End Source File -# Begin Source File - -SOURCE=.\talkmonster.cpp -# End Source File -# Begin Source File - -SOURCE=.\teamplay_gamerules.cpp -# End Source File -# Begin Source File - -SOURCE=.\tempmonster.cpp -# End Source File -# Begin Source File - -SOURCE=.\tentacle.cpp -# End Source File -# Begin Source File - -SOURCE=.\triggers.cpp -# End Source File -# Begin Source File - -SOURCE=.\tripmine.cpp -# End Source File -# Begin Source File - -SOURCE=.\turret.cpp -# End Source File -# Begin Source File - -SOURCE=.\util.cpp -# End Source File -# Begin Source File - -SOURCE=..\game_shared\voice_gamemgr.cpp -# End Source File -# Begin Source File - -SOURCE=.\weapons.cpp -# End Source File -# Begin Source File - -SOURCE=.\world.cpp -# End Source File -# Begin Source File - -SOURCE=.\xen.cpp -# End Source File -# Begin Source File - -SOURCE=.\zombie.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\activity.h -# End Source File -# Begin Source File - -SOURCE=.\activitymap.h -# End Source File -# Begin Source File - -SOURCE=.\animation.h -# End Source File -# Begin Source File - -SOURCE=.\basemonster.h -# End Source File -# Begin Source File - -SOURCE=.\cbase.h -# End Source File -# Begin Source File - -SOURCE=.\cdll_dll.h -# End Source File -# Begin Source File - -SOURCE=.\client.h -# End Source File -# Begin Source File - -SOURCE=.\decals.h -# End Source File -# Begin Source File - -SOURCE=.\defaultai.h -# End Source File -# Begin Source File - -SOURCE=.\doors.h -# End Source File -# Begin Source File - -SOURCE=.\effects.h -# End Source File -# Begin Source File - -SOURCE=..\engine\eiface.h -# End Source File -# Begin Source File - -SOURCE=.\enginecallback.h -# End Source File -# Begin Source File - -SOURCE=.\explode.h -# End Source File -# Begin Source File - -SOURCE=.\extdll.h -# End Source File -# Begin Source File - -SOURCE=.\flyingmonster.h -# End Source File -# Begin Source File - -SOURCE=.\func_break.h -# End Source File -# Begin Source File - -SOURCE=.\gamerules.h -# End Source File -# Begin Source File - -SOURCE=.\hornet.h -# End Source File -# Begin Source File - -SOURCE=.\items.h -# End Source File -# Begin Source File - -SOURCE=.\monsterevent.h -# End Source File -# Begin Source File - -SOURCE=.\monsters.h -# End Source File -# Begin Source File - -SOURCE=.\nodes.h -# End Source File -# Begin Source File - -SOURCE=.\plane.h -# End Source File -# Begin Source File - -SOURCE=.\player.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_debug.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_defs.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_info.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_materials.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_movevars.h -# End Source File -# Begin Source File - -SOURCE=..\pm_shared\pm_shared.h -# End Source File -# Begin Source File - -SOURCE=.\saverestore.h -# End Source File -# Begin Source File - -SOURCE=.\schedule.h -# End Source File -# Begin Source File - -SOURCE=.\scripted.h -# End Source File -# Begin Source File - -SOURCE=.\scriptevent.h -# End Source File -# Begin Source File - -SOURCE=.\skill.h -# End Source File -# Begin Source File - -SOURCE=.\soundent.h -# End Source File -# Begin Source File - -SOURCE=.\spectator.h -# End Source File -# Begin Source File - -SOURCE=.\squadmonster.h -# End Source File -# Begin Source File - -SOURCE=.\talkmonster.h -# End Source File -# Begin Source File - -SOURCE=.\teamplay_gamerules.h -# End Source File -# Begin Source File - -SOURCE=.\trains.h -# End Source File -# Begin Source File - -SOURCE=.\util.h -# End Source File -# Begin Source File - -SOURCE=.\vector.h -# End Source File -# Begin Source File - -SOURCE=.\weapons.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project From d5d8895b8cee074de2d710d0479ed3ccf812ae96 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 15 Jun 2021 22:08:11 +0300 Subject: [PATCH 145/298] Add mingw workflow (#177) --- .github/workflows/.github.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 87f8bcb2..af198d7f 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -43,3 +43,10 @@ jobs: run: | cmake -B build-gs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON && cmake --build build-gs --target all + - name: Build with mingw + if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') + run: | + sudo apt-get install -y mingw-w64-i686-dev binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 + cmake -B build-mingw -S . -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ + cmake --build build-mingw --target all + From 5e06370a95c9f24bf23487913eeed04a4d6949ff Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Thu, 17 Jun 2021 22:31:25 +0500 Subject: [PATCH 146/298] Revert breaking changes. --- dlls/compile.bat | 2 +- dlls/h_export.cpp | 4 ++-- dlls/hl.def | 5 +++++ dlls/wscript | 11 +++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 dlls/hl.def diff --git a/dlls/compile.bat b/dlls/compile.bat index 0106f56d..f97806a5 100644 --- a/dlls/compile.bat +++ b/dlls/compile.bat @@ -113,7 +113,7 @@ set LIBS=user32.lib set OUTNAME=hl.dll set DEBUG=/debug -cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% +cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% /def:".\hl.def" echo -- Compile done. Cleaning... diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index 88353c7c..11884f9c 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -43,8 +43,8 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) return TRUE; } -// cdecl for win32 -#define EXPORT2 WINAPIV +// stdcall for win32 +#define EXPORT2 WINAPI #else #define EXPORT2 #endif diff --git a/dlls/hl.def b/dlls/hl.def new file mode 100644 index 00000000..c009191a --- /dev/null +++ b/dlls/hl.def @@ -0,0 +1,5 @@ +LIBRARY hl +EXPORTS + GiveFnptrsToDll @1 +SECTIONS + .data READ WRITE diff --git a/dlls/wscript b/dlls/wscript index 854bbb73..33d37185 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -10,8 +10,15 @@ def options(opt): return def configure(conf): - # stub - return + if conf.env.COMPILER_CC == 'msvc': + # hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows. + # Without this, the lookup for this function fails. + hlDefNode = conf.path.find_resource("./hl.def") + + if hlDefNode is not None: + conf.env.append_unique('LINKFLAGS', '/def:%s' % hlDefNode.abspath()) + else: + conf.fatal("Could not find hl.def") def build(bld): source = bld.path.parent.ant_glob([ From b34b6a0778299201f34358afff33190acd16eca2 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 17 Jun 2021 21:33:55 +0300 Subject: [PATCH 147/298] Fix windows build (#179) * Add hl.def to cmakelists.txt * Add appveyor artifact --- appveyor.yml | 15 +++++++-------- dlls/CMakeLists.txt | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index eb39ee2d..bb4ba61d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,13 +1,7 @@ version: 1.0.{build} -branches: - only: - - master - environment: matrix: - - os: Visual Studio 2013 - GENERATOR_NAME: "Visual Studio 12 2013" - os: Visual Studio 2015 GENERATOR_NAME: "Visual Studio 14 2015" # TODO: Uncomment when AppVeyor will provide XP toolchain for VS2017 @@ -17,7 +11,7 @@ environment: clone_folder: c:\projects\xash\hlsdk-xash3d build: - project: INSTALL.vcxproj + project: build/INSTALL.vcxproj verbosity: normal configuration: @@ -25,4 +19,9 @@ configuration: before_build: - git submodule update --init --recursive - - cmake -G "%GENERATOR_NAME%" + - cmake -G "%GENERATOR_NAME%" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + +artifacts: + - path: dist + name: hlsdk-msvc + type: zip diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 67a34e11..497c02cd 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -150,6 +150,12 @@ set (SVDLL_SOURCES include_directories (. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public) +if(MSVC) + set(SVDLL_SOURCES + ${SVDLL_SOURCES} + hl.def) +endif() + if(USE_VOICEMGR) set(SVDLL_SOURCES ${SVDLL_SOURCES} From 5f56ed6816bc73d0ee2b9e69b66e3653c9b183a5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 18 Jun 2021 05:39:58 +0300 Subject: [PATCH 148/298] Build linux version in Steam runtime. Add building with msvc into workflow and upload artifacts. (#181) * Run linux builds in steam-runtime * Add msvc to CI * Add artifacts --- .github/workflows/.github.yml | 69 +++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index af198d7f..26151361 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -14,6 +14,9 @@ jobs: - os: ubuntu-latest cc: clang cxx: clang++ + - os: windows-2016 + cc: cl + cxx: cl env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} @@ -21,27 +24,39 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Get SDL2 headers + - name: Checkout steam-runtime + if: startsWith(matrix.os, 'ubuntu') 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 + repository: ValveSoftware/steam-runtime + path: steam-runtime + - name: Cache steam-runtime + if: startsWith(matrix.os, 'ubuntu') + id: cache-steam-runtime + uses: actions/cache@v2 + with: + path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + key: ${{ runner.os }}-steam-runtime + - name: Download steam-runtime + if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true' + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: | - sudo apt-get -y install gcc-multilib g++-multilib + ./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf - name: Build with xash3d-fwgs input + if: startsWith(matrix.os, 'ubuntu') run: | - cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" && cmake --build build --target all + schroot --chroot steamrt_scout_i386 -- cmake -B build-fwgs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" + schroot --chroot steamrt_scout_i386 -- cmake --build build-fwgs --target all - name: Build with goldsource input + if: startsWith(matrix.os, 'ubuntu') run: | - cmake -B build-gs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON && cmake --build build-gs --target all + schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake --build build --target all + schroot --chroot steamrt_scout_i386 -- cmake --build build --target install - name: Build with mingw if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') @@ -50,3 +65,33 @@ jobs: cmake -B build-mingw -S . -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ cmake --build build-mingw --target all + - name: Add msbuild to PATH + if: startsWith(matrix.os, 'windows') + uses: microsoft/setup-msbuild@v1.0.2 + - name: Build with msvc + if: startsWith(matrix.os, 'windows') + run: | + cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + msbuild build/INSTALL.vcxproj + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" + id: extract_branch + - name: Extract gamedir + shell: bash + run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" + id: extract_gamedir + - name: Upload linux artifact + if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux + path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + - name: Upload windows artifact + if: startsWith(matrix.os, 'windows') + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows + path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + From d95080281f22918bb681328b669eacb003e043fb Mon Sep 17 00:00:00 2001 From: Bohdan Shulyar Date: Fri, 18 Jun 2021 05:40:38 +0300 Subject: [PATCH 149/298] Fix implicit conversion (#180) --- cl_dll/cl_util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 7ba3bc7e..c4be7849 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -108,7 +108,8 @@ inline int TextMessageDrawChar( int x, int y, int number, int r, int g, int b ) inline int DrawConsoleString( int x, int y, const char *string ) { if( hud_textmode->value == 1 ) - return gHUD.DrawHudString( x, y, 9999, (char*)string, 255 * g_hud_text_color[0], 255 * g_hud_text_color[1], 255 * g_hud_text_color[2] ); + return gHUD.DrawHudString( x, y, 9999, (char*)string, (int)( (float)g_hud_text_color[0] * 255.0f ), + (int)( (float)g_hud_text_color[1] * 255.0f ), (int)( (float)g_hud_text_color[2] * 255.0f ) ); return gEngfuncs.pfnDrawConsoleString( x, y, (char*) string ); } From 662af50306b6cf85046ece0538b3d3460f38bbfa Mon Sep 17 00:00:00 2001 From: Bohdan Shulyar Date: Fri, 18 Jun 2021 05:41:38 +0300 Subject: [PATCH 150/298] Bump minimum CMake version (lower versions are deprecated) (#182) --- .gitignore | 4 +++- CMakeLists.txt | 2 +- cl_dll/CMakeLists.txt | 2 +- dlls/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3d6ad540..3e46defd 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ waf-* waf3-* .lock* *.pyc -.vscode/ \ No newline at end of file +.vscode/ +.vs/ +CMakeSettings.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d3a004..07c0f174 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ # SOFTWARE. # -cmake_minimum_required(VERSION 2.6.0) +cmake_minimum_required(VERSION 2.8.12) # Install custom module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index b7c98330..11cf81cd 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -20,7 +20,7 @@ # SOFTWARE. # -cmake_minimum_required(VERSION 2.6.0) +cmake_minimum_required(VERSION 2.8.12) project (CLDLL) set (CLDLL_LIBRARY client) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 497c02cd..053bc26b 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -20,7 +20,7 @@ # SOFTWARE. # -cmake_minimum_required(VERSION 2.6.0) +cmake_minimum_required(VERSION 2.8.12) project (SVDLL) set (SVDLL_LIBRARY server) From 7552c1df5e8520a4599ea85e87635492fa00b6a8 Mon Sep 17 00:00:00 2001 From: Bohdan Shulyar Date: Fri, 18 Jun 2021 05:42:43 +0300 Subject: [PATCH 151/298] Silence useless warning on Windows (#183) --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07c0f174..868c5e7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,8 @@ endif() if(NOT MSVC) #add_compile_options(-Wempty-body) # GCC/Clang flag add_compile_options(-Wreturn-type) # GCC/Clang flag +else() + add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H) endif() From fd6f48175fead8d7d6db15b8b06ab1f7acb78f05 Mon Sep 17 00:00:00 2001 From: Bohdan Shulyar Date: Fri, 18 Jun 2021 11:00:09 +0300 Subject: [PATCH 152/298] Comment unused variables (#184) * Comment unused variables * Comment out dead code --- cl_dll/MOTD.cpp | 2 +- dlls/client.cpp | 5 +++-- dlls/combat.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index 7947a15f..e186134f 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -66,7 +66,7 @@ int CHudMOTD::Draw( float fTime ) if( !m_bShow ) return 1; gHUD.m_iNoConsolePrint |= 1 << 1; - bool bScroll; + //bool bScroll; // find the top of where the MOTD should be drawn, so the whole thing is centered in the screen int ypos = ( ScreenHeight - LINE_HEIGHT * m_iLines ) / 2; // shift it up slightly char *ch = m_szMOTD; diff --git a/dlls/client.cpp b/dlls/client.cpp index 52c9644d..142b5de8 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -270,7 +270,7 @@ decodeError: uValueOut = '?'; bErrorOut = true; return nBytes; - +#if 0 decodeFinishedMaybeCESU8: // Do we have a full UTF-16 surrogate pair that's been UTF-8 encoded afterwards? // That is, do we have 0xD800-0xDBFF followed by 0xDC00-0xDFFF? If so, decode it all. @@ -281,6 +281,7 @@ decodeFinishedMaybeCESU8: uMinValue = 0x10000; } goto decodeFinished; +#endif } //----------------------------------------------------------------------------- @@ -317,7 +318,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) { CBasePlayer *client; int j; - char *p, *pc; + char *p; //, *pc; char text[128]; char szTemp[256]; const char *cpSay = "say"; diff --git a/dlls/combat.cpp b/dlls/combat.cpp index df079af7..1bd5a5bf 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -1484,7 +1484,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi Vector vecRight = gpGlobals->v_right; Vector vecUp = gpGlobals->v_up; float x = 0.0f, y = 0.0f; - float z; + //float z; if( pevAttacker == NULL ) pevAttacker = pev; // the default attacker is ourselves From a541a9699cadf964838fa5ca4c61c318362db888 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 20 Jun 2021 03:53:07 +0500 Subject: [PATCH 153/298] #ifdef->#if. --- cl_dll/ammo.h | 2 +- cl_dll/ammohistory.h | 2 +- cl_dll/camera.h | 2 +- cl_dll/cdll_int.cpp | 10 +++--- cl_dll/cl_dll.h | 8 ++--- cl_dll/cl_util.h | 4 +-- cl_dll/entity.cpp | 18 +++++----- cl_dll/health.h | 2 +- cl_dll/hl/hl_weapons.cpp | 2 +- cl_dll/hud.h | 2 +- cl_dll/hud_spectator.h | 2 +- cl_dll/in_camera.cpp | 2 +- cl_dll/input_goldsource.cpp | 52 +++++++++++++-------------- cl_dll/input_mouse.cpp | 4 +-- cl_dll/input_mouse.h | 6 ++-- cl_dll/overview.h | 3 +- cl_dll/parsemsg.h | 2 +- cl_dll/studio_util.h | 9 +++-- cl_dll/tf_defs.h | 5 ++- cl_dll/tri.cpp | 8 ++--- cl_dll/util.cpp | 6 ++-- cl_dll/util_vector.h | 2 +- cl_dll/view.cpp | 12 +++---- common/beamdef.h | 2 +- common/cl_entity.h | 2 +- common/com_model.h | 3 +- common/con_nprint.h | 2 +- common/const.h | 4 +-- common/cvardef.h | 2 +- common/demo_api.h | 2 +- common/dlight.h | 2 +- common/entity_state.h | 2 +- common/entity_types.h | 2 +- common/event_api.h | 2 +- common/event_args.h | 2 +- common/event_flags.h | 2 +- common/hltv.h | 2 +- common/ivoicetweak.h | 2 +- common/mathlib.h | 14 ++++---- common/net_api.h | 2 +- common/netadr.h | 2 +- common/particledef.h | 2 +- common/pmtrace.h | 2 +- common/qfont.h | 2 +- common/r_efx.h | 2 +- common/r_studioint.h | 2 +- common/ref_params.h | 2 +- common/screenfade.h | 2 +- common/studio_event.h | 2 +- common/triangleapi.h | 2 +- common/usercmd.h | 2 +- common/wadfile.h | 2 +- common/weaponinfo.h | 2 +- dlls/activity.h | 2 +- dlls/activitymap.h | 2 +- dlls/animation.cpp | 8 ++--- dlls/animation.h | 4 +-- dlls/basemonster.h | 2 +- dlls/cbase.h | 4 +-- dlls/cdll_dll.h | 2 +- dlls/client.h | 2 +- dlls/decals.h | 2 +- dlls/defaultai.h | 2 +- dlls/doors.h | 2 +- dlls/effects.h | 2 +- dlls/enginecallback.h | 5 ++- dlls/explode.h | 2 +- dlls/exportdef.h | 4 +-- dlls/extdll.h | 18 +++++----- dlls/flyingmonster.h | 2 +- dlls/func_break.h | 2 +- dlls/game.h | 2 +- dlls/gamerules.h | 2 +- dlls/h_cycler.cpp | 4 +-- dlls/hornet.h | 2 +- dlls/items.h | 2 +- dlls/maprules.h | 4 +-- dlls/monsterevent.h | 4 +-- dlls/monsters.h | 2 +- dlls/nodes.cpp | 2 +- dlls/nodes.h | 6 ++-- dlls/nodes_compat.h | 2 +- dlls/plane.h | 2 +- dlls/player.h | 2 +- dlls/saverestore.h | 2 +- dlls/schedule.h | 2 +- dlls/scripted.cpp | 4 +-- dlls/scripted.h | 4 +-- dlls/scriptevent.h | 2 +- dlls/skill.h | 2 +- dlls/soundent.h | 2 +- dlls/spectator.h | 2 +- dlls/squad.h | 2 +- dlls/squadmonster.h | 2 +- dlls/talkmonster.h | 4 +-- dlls/teamplay_gamerules.h | 2 +- dlls/trains.h | 2 +- dlls/util.cpp | 2 +- dlls/util.h | 10 +++--- dlls/vector.h | 2 +- dlls/weapons.h | 2 +- engine/cdll_int.h | 6 ++-- engine/custom.h | 2 +- engine/customentity.h | 2 +- engine/edict.h | 2 +- engine/eiface.h | 8 ++--- engine/keydefs.h | 2 +- engine/mobility_int.h | 7 ++-- engine/progdefs.h | 2 +- engine/shake.h | 2 +- engine/sprite.h | 2 +- engine/studio.h | 4 +-- game_shared/bitvec.h | 7 ++-- game_shared/vgui_checkbutton2.h | 8 ++--- game_shared/vgui_defaultinputsignal.h | 11 ++---- game_shared/vgui_grid.h | 10 ++---- game_shared/vgui_helpers.h | 9 ++--- game_shared/vgui_listbox.h | 10 ++---- game_shared/vgui_loadtga.h | 10 ++---- game_shared/vgui_scrollbar2.h | 8 ++--- game_shared/vgui_slider2.h | 8 ++--- game_shared/voice_banmgr.h | 10 ++---- game_shared/voice_common.h | 10 ++---- game_shared/voice_gamemgr.h | 5 ++- game_shared/voice_status.h | 8 ++--- game_shared/voice_vgui_tweakdlg.h | 8 ++--- pm_shared/pm_debug.c | 2 +- pm_shared/pm_debug.h | 2 +- pm_shared/pm_defs.h | 2 +- pm_shared/pm_info.h | 2 +- pm_shared/pm_materials.h | 2 +- pm_shared/pm_shared.h | 2 +- public/build.h | 2 +- 133 files changed, 247 insertions(+), 319 deletions(-) diff --git a/cl_dll/ammo.h b/cl_dll/ammo.h index 57c08805..bb2a7325 100644 --- a/cl_dll/ammo.h +++ b/cl_dll/ammo.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef __AMMO_H__ +#if !defined(__AMMO_H__) #define __AMMO_H__ #define MAX_WEAPON_NAME 128 diff --git a/cl_dll/ammohistory.h b/cl_dll/ammohistory.h index 44edc916..c896941a 100644 --- a/cl_dll/ammohistory.h +++ b/cl_dll/ammohistory.h @@ -16,7 +16,7 @@ // ammohistory.h // #pragma once -#ifndef AMMOHISTORY_H +#if !defined(AMMOHISTORY_H) #define AMMOHISTORY_H // this is the max number of items in each bucket diff --git a/cl_dll/camera.h b/cl_dll/camera.h index 1ecb9563..1c196c51 100644 --- a/cl_dll/camera.h +++ b/cl_dll/camera.h @@ -8,7 +8,7 @@ // Camera.h -- defines and such for a 3rd person camera // NOTE: must include quakedef.h first #pragma once -#ifndef _CAMERA_H_ +#if !defined(_CAMERA_H_) #define _CAMERA_H_ // pitch, yaw, dist diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 29edfbde..d2be3eea 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -23,8 +23,8 @@ #include "netadr.h" #include "parsemsg.h" -#if defined(GOLDSOURCE_SUPPORT) && (defined(_WIN32) || defined(__linux__) || defined(__APPLE__)) && (defined(__i386) || defined(_M_IX86)) -#define USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) +#define USE_VGUI_FOR_GOLDSOURCE_SUPPORT 1 #include "VGUI_Panel.h" #include "VGUI_App.h" #endif @@ -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/cl_dll.h b/cl_dll/cl_dll.h index 232df68e..5e5fe905 100644 --- a/cl_dll/cl_dll.h +++ b/cl_dll/cl_dll.h @@ -26,7 +26,7 @@ // - Handling the custum HUD-update packets // #pragma once -#ifndef CL_DLL_H +#if !defined(CL_DLL_H) #define CL_DLL_H typedef unsigned char byte; typedef unsigned short word; @@ -39,7 +39,7 @@ typedef float vec_t; #include "../engine/cdll_int.h" #include "../dlls/cdll_dll.h" -#if !defined(_WIN32) +#if !_WIN32 #define _cdecl #endif #include "exportdef.h" @@ -49,8 +49,8 @@ typedef float vec_t; #else #include #endif -#if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) - #define XASH_64BIT +#if __LP64__ || __LLP64__ || _WIN64 || (__x86_64__ && !__ILP32__) || _M_X64 || __ia64 || _M_IA64 || __aarch64__ || __powerpc64__ + #define XASH_64BIT 1 #endif extern cl_enginefunc_t gEngfuncs; diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index c4be7849..91615660 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -15,12 +15,12 @@ // // cl_util.h // -#ifndef CL_UTIL_H +#if !defined(CL_UTIL_H) #define CL_UTIL_H #include "exportdef.h" #include "cvardef.h" -#ifndef TRUE +#if !defined(TRUE) #define TRUE 1 #define FALSE 0 #endif diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index 287894b8..e9b3d0f4 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -224,8 +224,8 @@ void DLLEXPORT HUD_TxferPredictionData( struct entity_state_s *ps, const struct } /* -//#define TEST_IT -#if defined( TEST_IT ) +//#define TEST_IT 1 +#if TEST_IT cl_entity_t mymodel[9]; @@ -267,8 +267,8 @@ void MoveModel( void ) } #endif -//#define TRACE_TEST -#if defined( TRACE_TEST ) +//#define TRACE_TEST 1 +#if TRACE_TEST extern int hitent; @@ -424,7 +424,7 @@ void TempEnts( void ) } */ -#if defined( BEAM_TEST ) +#if BEAM_TEST // Note can't index beam[0] in Beam callback, so don't use that index // Room for 1 beam ( 0 can't be used ) static cl_entity_t beams[2]; @@ -508,10 +508,10 @@ void DLLEXPORT HUD_CreateEntities( void ) // Load an appropriate model into it ( gEngfuncs.CL_LoadModel ) // Call gEngfuncs.CL_CreateVisibleEntity to add it to the visedicts list /* -#if defined( TEST_IT ) +#if TEST_IT MoveModel(); #endif -#if defined( TRACE_TEST ) +#if TRACE_TEST TraceModel(); #endif */ @@ -521,7 +521,7 @@ void DLLEXPORT HUD_CreateEntities( void ) /* TempEnts(); */ -#if defined( BEAM_TEST ) +#if BEAM_TEST Beams(); #endif // Add in any game specific objects @@ -940,7 +940,7 @@ Indices must start at 1, not zero. */ cl_entity_t DLLEXPORT *HUD_GetUserEntity( int index ) { -#if defined( BEAM_TEST ) +#if BEAM_TEST // None by default, you would return a valic pointer if you create a client side // beam and attach it to a client side entity. if( index > 0 && index <= 1 ) diff --git a/cl_dll/health.h b/cl_dll/health.h index 62d7e0bc..41375a69 100644 --- a/cl_dll/health.h +++ b/cl_dll/health.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef HEALTH_H +#if !defined(HEALTH_H) #define HEALTH_H #define DMG_IMAGE_LIFE 2 // seconds that image is up diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 43485100..536392e3 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -1039,7 +1039,7 @@ void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s { g_runfuncs = runfuncs; -#if defined( CLIENT_WEAPONS ) +#if CLIENT_WEAPONS if( cl_lw && cl_lw->value ) { HUD_WeaponsPostThink( from, to, cmd, time, random_seed ); diff --git a/cl_dll/hud.h b/cl_dll/hud.h index f3e1ed85..7c5eee0e 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -20,7 +20,7 @@ // CHud handles the message, calculation, and drawing the HUD // #pragma once -#ifndef HUD_H +#if !defined(HUD_H) #define HUD_H #define RGB_YELLOWISH 0x00FFA000 //255,160,0 #define RGB_REDISH 0x00FF1010 //255,160,0 diff --git a/cl_dll/hud_spectator.h b/cl_dll/hud_spectator.h index 9b3391e2..d7187d49 100644 --- a/cl_dll/hud_spectator.h +++ b/cl_dll/hud_spectator.h @@ -6,7 +6,7 @@ //============================================================================= #pragma once -#ifndef HUD_SPECTATOR_H +#if !defined(HUD_SPECTATOR_H) #define HUD_SPECTATOR_H #include "cl_entity.h" diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index ad5ec8bf..5e499ef4 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -459,7 +459,7 @@ void CAM_OutUp( void ) void CAM_ToThirdPerson( void ) { vec3_t viewangles; -#if !defined( _DEBUG ) +#if !_DEBUG if( gEngfuncs.GetMaxClients() > 1 ) { // no thirdperson in multiplayer. diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index 8698a5d3..bf029639 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" @@ -24,10 +24,10 @@ #include "view.h" #if !_WIN32 -#define USE_SDL2 +#define USE_SDL2 1 #endif -#ifdef USE_SDL2 +#if USE_SDL2 #define ARRAYSIZE(p) ( sizeof(p) /sizeof(p[0]) ) #include #include @@ -218,7 +218,7 @@ enum _ControlList AxisTurn }; -#if !defined(USE_SDL2) && defined(_WIN32) +#if !USE_SDL2 && _WIN32 DWORD dwAxisFlags[JOY_MAX_AXES] = { JOY_RETURNX, @@ -232,9 +232,9 @@ DWORD dwAxisFlags[JOY_MAX_AXES] = DWORD dwAxisMap[ JOY_MAX_AXES ]; DWORD dwControlMap[ JOY_MAX_AXES ]; -#if defined(USE_SDL2) +#if USE_SDL2 int pdwRawValue[ JOY_MAX_AXES ]; -#elif defined(_WIN32) +#elif _WIN32 PDWORD pdwRawValue[ JOY_MAX_AXES ]; #endif DWORD joy_oldbuttonstate, joy_oldpovstate; @@ -242,9 +242,9 @@ 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) +#elif _WIN32 DWORD joy_flags; static JOYINFOEX ji; #endif @@ -566,7 +566,7 @@ void GoldSourceInput::IN_Shutdown (void) } #endif -#ifdef USE_SDL2 +#if USE_SDL2 for (int j=0; j 0 ) { @@ -1029,7 +1029,7 @@ void IN_StartupJoystick (void) { gEngfuncs.Con_DPrintf ("joystick not found -- driver not present\n\n"); } -#elif defined(_WIN32) +#elif _WIN32 int numdevs; JOYCAPS jc; MMRESULT mmr; @@ -1084,7 +1084,7 @@ void IN_StartupJoystick (void) #endif } -#ifdef USE_SDL2 +#if USE_SDL2 int RawValuePointer (int axis) { switch (axis) @@ -1101,7 +1101,7 @@ int RawValuePointer (int axis) } } -#elif defined(_WIN32) +#elif _WIN32 PDWORD RawValuePointer (int axis) { switch (axis) @@ -1184,7 +1184,7 @@ void Joy_AdvancedUpdate_f (void) dwControlMap[JOY_AXIS_V] = dwTemp & JOY_RELATIVE_AXIS; } -#if !defined(USE_SDL2) && defined(_WIN32) +#if !USE_SDL2 && _WIN32 // compute the axes to collect from DirectInput joy_flags = JOY_RETURNCENTERED | JOY_RETURNBUTTONS | JOY_RETURNPOV; for (i = 0; i < JOY_MAX_AXES; i++) @@ -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++ ) { @@ -1230,7 +1230,7 @@ void GoldSourceInput::IN_Commands (void) { pdwRawValue[i] = RawValuePointer(i); } -#elif defined(_WIN32) +#elif _WIN32 buttonstate = ji.dwButtons; #endif @@ -1256,7 +1256,7 @@ void GoldSourceInput::IN_Commands (void) // this avoids any potential problems related to moving from one // direction to another without going through the center position povstate = 0; -#if !defined(USE_SDL2) && defined(_WIN32) +#if !USE_SDL2 && _WIN32 if(ji.dwPOV != JOY_POVCENTERED) { if (ji.dwPOV == JOY_POVFORWARD) @@ -1294,10 +1294,10 @@ IN_ReadJoystick */ int IN_ReadJoystick (void) { -#ifdef USE_SDL2 +#if USE_SDL2 safe_pfnSDL_JoystickUpdate(); return 1; -#elif defined(_WIN32) +#elif _WIN32 memset (&ji, 0, sizeof(ji)); ji.dwSize = sizeof(ji); ji.dwFlags = joy_flags; @@ -1374,9 +1374,9 @@ 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) +#elif _WIN32 fAxisValue = (float) *pdwRawValue[i]; fAxisValue -= 32768.0; #endif @@ -1600,7 +1600,7 @@ void GoldSourceInput::IN_Init (void) } #endif -#ifdef USE_SDL2 +#if 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 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/input_mouse.h b/cl_dll/input_mouse.h index c13b7fa2..f8e2c631 100644 --- a/cl_dll/input_mouse.h +++ b/cl_dll/input_mouse.h @@ -1,5 +1,5 @@ #pragma once -#ifndef INPUT_MOUSE_H +#if !defined(INPUT_MOUSE_H) #define INPUT_MOUSE_H #include "cl_dll.h" #include "usercmd.h" @@ -45,8 +45,8 @@ protected: }; // No need for goldsource input support on the platforms that are not supported by GoldSource. -#if defined(GOLDSOURCE_SUPPORT) && (defined(_WIN32) || defined(__linux__) || defined(__APPLE__)) && (defined(__i386) || defined(_M_IX86)) -#define SUPPORT_GOLDSOURCE_INPUT +#if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) +#define SUPPORT_GOLDSOURCE_INPUT 1 class GoldSourceInput : public AbstractInput { public: diff --git a/cl_dll/overview.h b/cl_dll/overview.h index c1675e98..4c1dc4d8 100644 --- a/cl_dll/overview.h +++ b/cl_dll/overview.h @@ -4,9 +4,8 @@ // // $NoKeywords: $ //============================================================================= - #pragma once -#ifndef OVERVIEW_H +#if !defined(OVERVIEW_H) #define OVERVIEW_H //----------------------------------------------------------------------------- diff --git a/cl_dll/parsemsg.h b/cl_dll/parsemsg.h index 05efefc3..a37a100a 100644 --- a/cl_dll/parsemsg.h +++ b/cl_dll/parsemsg.h @@ -16,7 +16,7 @@ // parsemsg.h // #pragma once -#ifndef PARSEMSG_H +#if !defined(PARSEMSG_H) #define PARSEMSG_H #define ASSERT( x ) diff --git a/cl_dll/studio_util.h b/cl_dll/studio_util.h index 12d165c5..de54d440 100644 --- a/cl_dll/studio_util.h +++ b/cl_dll/studio_util.h @@ -4,20 +4,19 @@ // // $NoKeywords: $ //============================================================================= - #pragma once -#if !defined( STUDIO_UTIL_H ) +#if !defined(STUDIO_UTIL_H) #define STUDIO_UTIL_H -#ifndef M_PI +#if !defined(M_PI) #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#ifndef M_PI_F +#if !defined(M_PI_F) #define M_PI_F (float)M_PI #endif -#ifndef PITCH +#if !defined(PITCH) // MOVEMENT INFO // up / down #define PITCH 0 diff --git a/cl_dll/tf_defs.h b/cl_dll/tf_defs.h index ba7ae0f9..e445f2fc 100644 --- a/cl_dll/tf_defs.h +++ b/cl_dll/tf_defs.h @@ -7,8 +7,7 @@ * All Rights Reserved. * ****/ - -#ifndef __TF_DEFS_H +#if !defined(__TF_DEFS_H) #define __TF_DEFS_H //=========================================================================== @@ -1155,7 +1154,7 @@ float already_chosen_map; #define TS_PRINT_LONG 2 #define TS_PRINT_LONG_TO_ALL 3 -#ifndef TF_DEFS_ONLY +#if !defined(TF_DEFS_ONLY) typedef struct { diff --git a/cl_dll/tri.cpp b/cl_dll/tri.cpp index ab8f3730..0c45307c 100644 --- a/cl_dll/tri.cpp +++ b/cl_dll/tri.cpp @@ -23,8 +23,8 @@ extern "C" void DLLEXPORT HUD_DrawTransparentTriangles( void ); } -//#define TEST_IT -#if defined( TEST_IT ) +//#define TEST_IT 1 +#if TEST_IT /* ================= @@ -98,7 +98,7 @@ Non-transparent triangles-- add them here void DLLEXPORT HUD_DrawNormalTriangles( void ) { gHUD.m_Spectator.DrawOverview(); -#if defined( TEST_IT ) +#if TEST_IT // Draw_Triangles(); #endif } @@ -112,7 +112,7 @@ Render any triangles with transparent rendermode needs here */ void DLLEXPORT HUD_DrawTransparentTriangles( void ) { -#if defined( TEST_IT ) +#if TEST_IT // Draw_Triangles(); #endif } diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index 33e68070..7d6b6669 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -26,17 +26,17 @@ #include "cl_util.h" #include -#ifndef M_PI +#if !defined(M_PI) #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#ifndef M_PI_F +#if !defined(M_PI_F) #define M_PI_F (float)M_PI #endif extern vec3_t vec3_origin; // if C++ mangling differs from C symbol name -#if defined _MSC_VER || defined __WATCOMC__ +#if _MSC_VER || __WATCOMC__ vec3_t vec3_origin; #endif diff --git a/cl_dll/util_vector.h b/cl_dll/util_vector.h index c83d347f..6d900446 100644 --- a/cl_dll/util_vector.h +++ b/cl_dll/util_vector.h @@ -16,7 +16,7 @@ // A subset of the extdll.h in the project HL Entity DLL // #pragma once -#ifndef UTIL_VECTOR_H +#if !defined(UTIL_VECTOR_H) #define UTIL_VECTOR_H // Misc C-runtime library headers diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 01139689..0c3d3ef6 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -36,11 +36,11 @@ extern "C" int iIsSpectator; } -#ifndef M_PI +#if !defined(M_PI) #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#ifndef M_PI_F +#if !defined(M_PI_F) #define M_PI_F (float)M_PI #endif @@ -1544,8 +1544,8 @@ void DLLEXPORT V_CalcRefdef( struct ref_params_s *pparams ) } /* // Example of how to overlay the whole screen with red at 50 % alpha -#define SF_TEST -#if defined SF_TEST +#define SF_TEST 1 +#if SF_TEST { screenfade_t sf; gEngfuncs.pfnGetScreenFade( &sf ); @@ -1611,8 +1611,8 @@ void V_Init( void ) cl_chasedist = gEngfuncs.pfnRegisterVariable( "cl_chasedist","112", 0 ); } -//#define TRACE_TEST -#if defined( TRACE_TEST ) +//#define TRACE_TEST 1 +#if TRACE_TEST extern float in_fov; /* diff --git a/common/beamdef.h b/common/beamdef.h index f254428c..c578dded 100644 --- a/common/beamdef.h +++ b/common/beamdef.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef BEAMDEF_H +#if !defined(BEAMDEF_H) #define BEAMDEF_H #define FBEAM_STARTENTITY 0x00000001 diff --git a/common/cl_entity.h b/common/cl_entity.h index c003ce30..d5323aa1 100644 --- a/common/cl_entity.h +++ b/common/cl_entity.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CL_ENTITY_H +#if !defined(CL_ENTITY_H) #define CL_ENTITY_H typedef struct efrag_s diff --git a/common/com_model.h b/common/com_model.h index 7f8244ad..61c0434a 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -4,7 +4,6 @@ // // $NoKeywords: $ //============================================================================= - // com_model.h #pragma once #if !defined( COM_MODEL_H ) @@ -45,7 +44,7 @@ typedef enum } modtype_t; // must match definition in modelgen.h -#ifndef SYNCTYPE_T +#if !defined(SYNCTYPE_T) #define SYNCTYPE_T typedef enum diff --git a/common/con_nprint.h b/common/con_nprint.h index 615a1850..438e047f 100644 --- a/common/con_nprint.h +++ b/common/con_nprint.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CON_NPRINT_H +#if !defined(CON_NPRINT_H) #define CON_NPRINT_H typedef struct con_nprint_s diff --git a/common/const.h b/common/const.h index fa0f33e6..3708371b 100644 --- a/common/const.h +++ b/common/const.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CONST_H +#if !defined(CONST_H) #define CONST_H // // Constants shared by the engine and dlls @@ -742,7 +742,7 @@ typedef unsigned short word; #undef true #undef false -#ifndef __cplusplus +#if !__cplusplus typedef enum { false, true } qboolean; #else typedef int qboolean; diff --git a/common/cvardef.h b/common/cvardef.h index f461c329..1d55f7ca 100644 --- a/common/cvardef.h +++ b/common/cvardef.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CVARDEF_H +#if !defined(CVARDEF_H) #define CVARDEF_H #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc diff --git a/common/demo_api.h b/common/demo_api.h index 1a678b60..09ab0511 100644 --- a/common/demo_api.h +++ b/common/demo_api.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef DEMO_API_H +#if !defined(DEMO_API_H) #define DEMO_API_H typedef struct demo_api_s diff --git a/common/dlight.h b/common/dlight.h index ecb01445..6cfab021 100644 --- a/common/dlight.h +++ b/common/dlight.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef DLIGHT_H +#if !defined(DLIGHT_H) #define DLIGHT_H typedef struct dlight_s diff --git a/common/entity_state.h b/common/entity_state.h index 2ffd70dc..51a807e9 100644 --- a/common/entity_state.h +++ b/common/entity_state.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef ENTITY_STATE_H +#if !defined(ENTITY_STATE_H) #define ENTITY_STATE_H // For entityType below diff --git a/common/entity_types.h b/common/entity_types.h index f5754fea..ec54ba26 100644 --- a/common/entity_types.h +++ b/common/entity_types.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef ENTITY_TYPES_H +#if !defined(ENTITY_TYPES_H) #define ENTITY_TYPES_H #define ET_NORMAL 0 diff --git a/common/event_api.h b/common/event_api.h index 86c5fbe9..43cb3b62 100644 --- a/common/event_api.h +++ b/common/event_api.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EVENT_API_H +#if !defined(EVENT_API_H) #define EVENT_API_H #define EVENT_API_VERSION 1 diff --git a/common/event_args.h b/common/event_args.h index 4cf63741..07cd39cd 100644 --- a/common/event_args.h +++ b/common/event_args.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EVENT_ARGS_H +#if !defined(EVENT_ARGS_H) #define EVENT_ARGS_H // Event was invoked with stated origin diff --git a/common/event_flags.h b/common/event_flags.h index a2d5f3b7..c3f1789f 100644 --- a/common/event_flags.h +++ b/common/event_flags.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EVENT_FLAGS_H +#if !defined(EVENT_FLAGS_H) #define EVENT_FLAGS_H // Skip local host for event send. diff --git a/common/hltv.h b/common/hltv.h index e64dd30b..970c4861 100644 --- a/common/hltv.h +++ b/common/hltv.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef HLTV_H +#if !defined(HLTV_H) #define HLTV_H #define TYPE_CLIENT 0 // client is a normal HL client (default) diff --git a/common/ivoicetweak.h b/common/ivoicetweak.h index 96879beb..d3fd7ed4 100644 --- a/common/ivoicetweak.h +++ b/common/ivoicetweak.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef IVOICETWEAK_H +#if !defined(IVOICETWEAK_H) #define IVOICETWEAK_H // These provide access to the voice controls. diff --git a/common/mathlib.h b/common/mathlib.h index 62f04d93..427d896f 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -14,11 +14,11 @@ ****/ // mathlib.h #pragma once -#ifndef MATHLIB_H +#if !defined(MATHLIB_H) #define MATHLIB_H -#ifndef __cplusplus +#if !__cplusplus #include -#ifdef HAVE_TGMATH_H +#if HAVE_TGMATH_H #include #endif // HAVE_TGMATH_H #else // __cplusplus @@ -31,17 +31,17 @@ typedef float vec_t; -#if !defined DID_VEC3_T_DEFINE +#if !defined(DID_VEC3_T_DEFINE) #define DID_VEC3_T_DEFINE typedef vec_t vec3_t[3]; #endif -#ifndef M_PI +#if !defined(M_PI) #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#ifndef M_PI_F +#if !defined(M_PI_F) #define M_PI_F (float)M_PI #endif @@ -52,7 +52,7 @@ extern int nanmask; #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) -#ifndef VECTOR_H +#if !defined(VECTOR_H) #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) #endif diff --git a/common/net_api.h b/common/net_api.h index da18fc30..eccfc86b 100644 --- a/common/net_api.h +++ b/common/net_api.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef NET_API_H +#if !defined(NET_API_H) #define NET_API_H #include "netadr.h" diff --git a/common/netadr.h b/common/netadr.h index 0d70a22b..9f72921d 100644 --- a/common/netadr.h +++ b/common/netadr.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef NETADR_H +#if !defined(NETADR_H) #define NETADR_H typedef enum diff --git a/common/particledef.h b/common/particledef.h index 15c95feb..c8b972e7 100644 --- a/common/particledef.h +++ b/common/particledef.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PARTICLEDEF_H +#if !defined(PARTICLEDEF_H) #define PARTICLEDEF_H typedef enum diff --git a/common/pmtrace.h b/common/pmtrace.h index d5dd1453..dbf59026 100644 --- a/common/pmtrace.h +++ b/common/pmtrace.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_TRACE_H +#if !defined(PM_TRACE_H) #define PM_TRACE_H typedef struct diff --git a/common/qfont.h b/common/qfont.h index beb36ff9..589a9398 100644 --- a/common/qfont.h +++ b/common/qfont.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef QFONT_H +#if !defined(QFONT_H) #define QFONT_H // Font stuff diff --git a/common/r_efx.h b/common/r_efx.h index 1a55aa0b..0ed52ad3 100644 --- a/common/r_efx.h +++ b/common/r_efx.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef R_EFX_H +#if !defined(R_EFX_H) #define R_EFX_H // particle_t diff --git a/common/r_studioint.h b/common/r_studioint.h index b17e826f..d3cb82f5 100644 --- a/common/r_studioint.h +++ b/common/r_studioint.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef R_STUDIOINT_H +#if !defined(R_STUDIOINT_H) #define R_STUDIOINT_H #define STUDIO_INTERFACE_VERSION 1 diff --git a/common/ref_params.h b/common/ref_params.h index 61527eca..d804f8b8 100644 --- a/common/ref_params.h +++ b/common/ref_params.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef REF_PARAMS_H +#if !defined(REF_PARAMS_H) #define REF_PARAMS_H typedef struct ref_params_s diff --git a/common/screenfade.h b/common/screenfade.h index 1611f914..8555e812 100644 --- a/common/screenfade.h +++ b/common/screenfade.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef SCREENFADE_H +#if !defined(SCREENFADE_H) #define SCREENFADE_H typedef struct screenfade_s diff --git a/common/studio_event.h b/common/studio_event.h index cf21e82a..33878a69 100644 --- a/common/studio_event.h +++ b/common/studio_event.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef STUDIO_EVENT_H +#if !defined(STUDIO_EVENT_H) #define STUDIO_EVENT_H typedef struct mstudioevent_s diff --git a/common/triangleapi.h b/common/triangleapi.h index 49dc919f..801154e3 100644 --- a/common/triangleapi.h +++ b/common/triangleapi.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef TRIANGLEAPI_H +#if !defined(TRIANGLEAPI_H) #define TRIANGLEAPI_H typedef enum diff --git a/common/usercmd.h b/common/usercmd.h index 538c60a6..581662b7 100644 --- a/common/usercmd.h +++ b/common/usercmd.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef USERCMD_H +#if !defined(USERCMD_H) #define USERCMD_H typedef struct usercmd_s diff --git a/common/wadfile.h b/common/wadfile.h index 84ffbb2d..a3b8efeb 100644 --- a/common/wadfile.h +++ b/common/wadfile.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef WADFILE_H +#if !defined(WADFILE_H) #define WADFILE_H /* diff --git a/common/weaponinfo.h b/common/weaponinfo.h index b94857b6..8625103a 100644 --- a/common/weaponinfo.h +++ b/common/weaponinfo.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef WEAPONINFO_H +#if !defined(WEAPONINFO_H) #define WEAPONINFO_H // Info about weapons player might have in his/her possession diff --git a/dlls/activity.h b/dlls/activity.h index 90d85a08..b13cf522 100644 --- a/dlls/activity.h +++ b/dlls/activity.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef ACTIVITY_H +#if !defined(ACTIVITY_H) #define ACTIVITY_H typedef enum { diff --git a/dlls/activitymap.h b/dlls/activitymap.h index b5f789f9..8255edf0 100644 --- a/dlls/activitymap.h +++ b/dlls/activitymap.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef ACTIVITYMAP_H +#if !defined(ACTIVITYMAP_H) #define ACTIVITYMAP_H #define _A( a ) { a, #a } diff --git a/dlls/animation.cpp b/dlls/animation.cpp index 10a1241d..c7d38e71 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -36,21 +36,21 @@ typedef unsigned char byte; #include "studio.h" -#ifndef ACTIVITY_H +#if !defined(ACTIVITY_H) #include "activity.h" #endif #include "activitymap.h" -#ifndef ANIMATION_H +#if !defined(ANIMATION_H) #include "animation.h" #endif -#ifndef SCRIPTEVENT_H +#if !defined(SCRIPTEVENT_H) #include "scriptevent.h" #endif -#ifndef ENGINECALLBACK_H +#if !defined(ENGINECALLBACK_H) #include "enginecallback.h" #endif diff --git a/dlls/animation.h b/dlls/animation.h index 6def910c..41e09ce6 100644 --- a/dlls/animation.h +++ b/dlls/animation.h @@ -13,12 +13,12 @@ * ****/ #pragma once -#ifndef ANIMATION_H +#if !defined(ANIMATION_H) #define ANIMATION_H #define ACTIVITY_NOT_AVAILABLE -1 -#ifndef MONSTEREVENT_H +#if !defined(MONSTEREVENT_H) #include "monsterevent.h" #endif diff --git a/dlls/basemonster.h b/dlls/basemonster.h index a5f7f459..ea145a93 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef BASEMONSTER_H +#if !defined(BASEMONSTER_H) #define BASEMONSTER_H // diff --git a/dlls/cbase.h b/dlls/cbase.h index 71f0fc26..d64c0f5c 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CBASE_H +#if !defined(CBASE_H) #define CBASE_H /* @@ -48,7 +48,7 @@ CBaseEntity #include "saverestore.h" #include "schedule.h" -#ifndef MONSTEREVENT_H +#if !defined(MONSTEREVENT_H) #include "monsterevent.h" #endif diff --git a/dlls/cdll_dll.h b/dlls/cdll_dll.h index 0aafafbd..4fe9e35a 100644 --- a/dlls/cdll_dll.h +++ b/dlls/cdll_dll.h @@ -17,7 +17,7 @@ // this file is included by both the game-dll and the client-dll, #pragma once -#ifndef CDLL_DLL_H +#if !defined(CDLL_DLL_H) #define CDLL_DLL_H #define MAX_WEAPONS 32 // ??? diff --git a/dlls/client.h b/dlls/client.h index 6feaac1a..73bc0dc5 100644 --- a/dlls/client.h +++ b/dlls/client.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CLIENT_H +#if !defined(CLIENT_H) #define CLIENT_H extern void respawn( entvars_t *pev, BOOL fCopyCorpse ); diff --git a/dlls/decals.h b/dlls/decals.h index 5de54421..c5e67356 100644 --- a/dlls/decals.h +++ b/dlls/decals.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef DECALS_H +#if !defined(DECALS_H) #define DECALS_H // diff --git a/dlls/defaultai.h b/dlls/defaultai.h index 652d1085..9696169b 100644 --- a/dlls/defaultai.h +++ b/dlls/defaultai.h @@ -12,7 +12,7 @@ * use or distribution of this code by or to any unlicensed person is illegal. * ****/ -#ifndef DEFAULTAI_H +#if !defined(DEFAULTAI_H) #define DEFAULTAI_H //========================================================= diff --git a/dlls/doors.h b/dlls/doors.h index fe2b5a85..35999886 100644 --- a/dlls/doors.h +++ b/dlls/doors.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef DOORS_H +#if !defined(DOORS_H) #define DOORS_H // doors diff --git a/dlls/effects.h b/dlls/effects.h index 5dd55209..60e13952 100644 --- a/dlls/effects.h +++ b/dlls/effects.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EFFECTS_H +#if !defined(EFFECTS_H) #define EFFECTS_H #define SF_BEAM_STARTON 0x0001 diff --git a/dlls/enginecallback.h b/dlls/enginecallback.h index a9e37c26..d9d709d7 100644 --- a/dlls/enginecallback.h +++ b/dlls/enginecallback.h @@ -12,10 +12,9 @@ * without written permission from Valve LLC. * ****/ -#ifndef ENGINECALLBACK_H -#define ENGINECALLBACK_H - #pragma once +#if !defined(ENGINECALLBACK_H) +#define ENGINECALLBACK_H #include "event_flags.h" diff --git a/dlls/explode.h b/dlls/explode.h index 001d93ca..60638e63 100644 --- a/dlls/explode.h +++ b/dlls/explode.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EXPLODE_H +#if !defined(EXPLODE_H) #define EXPLODE_H #define SF_ENVEXPLOSION_NODAMAGE ( 1 << 0 ) // when set, ENV_EXPLOSION will not actually inflict damage diff --git a/dlls/exportdef.h b/dlls/exportdef.h index bc3c6371..6de40543 100644 --- a/dlls/exportdef.h +++ b/dlls/exportdef.h @@ -1,7 +1,7 @@ #pragma once -#ifndef EXPORTDEF_H +#if !defined(EXPORTDEF_H) #define EXPORTDEF_H -#if defined _WIN32 || defined __CYGWIN__ +#if _WIN32 || __CYGWIN__ #if __GNUC__ #define EXPORT __attribute__ ((dllexport)) #else diff --git a/dlls/extdll.h b/dlls/extdll.h index 0c35fe3a..2b592763 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EXTDLL_H +#if !defined(EXTDLL_H) #define EXTDLL_H // @@ -45,10 +45,10 @@ #include #undef HSPRITE #else // _WIN32 -#ifndef FALSE +#if !defined(FALSE) #define FALSE 0 #endif -#ifndef TRUE +#if !defined(TRUE) #define TRUE (!FALSE) #endif #include @@ -57,7 +57,7 @@ typedef unsigned int ULONG; typedef unsigned char BYTE; typedef int BOOL; #define MAX_PATH PATH_MAX -#ifndef PATH_MAX +#if !defined(PATH_MAX) #define PATH_MAX 4096 #endif #endif //_WIN32 @@ -72,12 +72,12 @@ typedef int BOOL; #include #endif -#ifndef M_PI_F +#if !defined(M_PI_F) #define M_PI_F (float)M_PI #endif -#if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) - #define XASH_64BIT +#if __LP64__ || __LLP64__ || _WIN64 || (__x86_64__ && !__ILP32__) || _M_X64 || __ia64 || _M_IA64 || __aarch64__ || __powerpc64__ + #define XASH_64BIT 1 #endif // Header file containing definition of globalvars_t and entvars_t @@ -101,10 +101,10 @@ typedef float vec_t; // needed before including progdefs.h // Shared header between the client DLL and the game DLLs #include "cdll_dll.h" -#ifndef Q_min +#if !defined(Q_min) #define Q_min(a,b) (((a) < (b)) ? (a) : (b)) #endif -#ifndef Q_max +#if !defined(Q_max) #define Q_max(a,b) (((a) > (b)) ? (a) : (b)) #endif diff --git a/dlls/flyingmonster.h b/dlls/flyingmonster.h index 31ff4e33..d043fa22 100644 --- a/dlls/flyingmonster.h +++ b/dlls/flyingmonster.h @@ -14,7 +14,7 @@ ****/ // Base class for flying monsters. This overrides the movement test & execution code from CBaseMonster #pragma once -#ifndef FLYINGMONSTER_H +#if !defined(FLYINGMONSTER_H) #define FLYINGMONSTER_H class CFlyingMonster : public CBaseMonster diff --git a/dlls/func_break.h b/dlls/func_break.h index 89c9f54e..3e65b73a 100644 --- a/dlls/func_break.h +++ b/dlls/func_break.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef FUNC_BREAK_H +#if !defined(FUNC_BREAK_H) #define FUNC_BREAK_H typedef enum diff --git a/dlls/game.h b/dlls/game.h index e60cb4da..77502e76 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef GAME_H +#if !defined(GAME_H) #define GAME_H extern void GameDLLInit( void ); diff --git a/dlls/gamerules.h b/dlls/gamerules.h index 22c73a47..781ef447 100644 --- a/dlls/gamerules.h +++ b/dlls/gamerules.h @@ -16,7 +16,7 @@ // GameRules //========================================================= #pragma once -#ifndef GAMERULES_H +#if !defined(GAMERULES_H) #define GAMERULES_H //#include "weapons.h" //#include "items.h" diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index ef356e8a..49eff1d8 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -28,8 +28,8 @@ #include "weapons.h" #include "player.h" -#define TEMP_FOR_SCREEN_SHOTS -#if defined(TEMP_FOR_SCREEN_SHOTS) //=================================================== +#define TEMP_FOR_SCREEN_SHOTS 1 +#if TEMP_FOR_SCREEN_SHOTS //=================================================== class CCycler : public CBaseMonster { diff --git a/dlls/hornet.h b/dlls/hornet.h index f0f0d366..b7be52c5 100644 --- a/dlls/hornet.h +++ b/dlls/hornet.h @@ -16,7 +16,7 @@ // Hornets //========================================================= #pragma once -#ifndef HORNET_H +#if !defined(HORNET_H) #define HORNET_H //========================================================= // Hornet Defines diff --git a/dlls/items.h b/dlls/items.h index 060678c8..3c5ba6eb 100644 --- a/dlls/items.h +++ b/dlls/items.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef ITEMS_H +#if !defined(ITEMS_H) #define ITEMS_H class CItem : public CBaseEntity diff --git a/dlls/maprules.h b/dlls/maprules.h index 70a88fb5..4990b0cf 100644 --- a/dlls/maprules.h +++ b/dlls/maprules.h @@ -12,8 +12,8 @@ * without written permission from Valve LLC. * ****/ - -#ifndef MAPRULES_H +#pragma once +#if !defined(MAPRULES_H) #define MAPRULES_H #endif //MAPRULES_H diff --git a/dlls/monsterevent.h b/dlls/monsterevent.h index ab54b687..b3ca4e87 100644 --- a/dlls/monsterevent.h +++ b/dlls/monsterevent.h @@ -12,8 +12,8 @@ * without written permission from Valve LLC. * ****/ - -#ifndef MONSTEREVENT_H +#pragma once +#if !defined(MONSTEREVENT_H) #define MONSTEREVENT_H typedef struct diff --git a/dlls/monsters.h b/dlls/monsters.h index 4aeca3a9..f625ca7c 100644 --- a/dlls/monsters.h +++ b/dlls/monsters.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef MONSTERS_H +#if !defined(MONSTERS_H) #include "skill.h" #define MONSTERS_H diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index e74e3cc8..07c58826 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -45,7 +45,7 @@ LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ) #if __DOS__ #include #define CreateDirectoryA(p, n) mkdir(p) -#elif !defined _WIN32 +#elif !_WIN32 #include #include #define CreateDirectoryA(p, n) mkdir(p,777) diff --git a/dlls/nodes.h b/dlls/nodes.h index d6b36928..cb19aeb8 100644 --- a/dlls/nodes.h +++ b/dlls/nodes.h @@ -16,8 +16,8 @@ // nodes.h //========================================================= #pragma once -#ifndef NODES_H -#define NODES_H +#if !defined(NODES_H) +#define NODES_H //========================================================= // DEFINE //========================================================= @@ -106,7 +106,7 @@ typedef struct // CGraph //========================================================= #define _GRAPH_VERSION_RETAIL 16 // Retail Half-Life graph version. Don't increment this -#if defined(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. diff --git a/dlls/nodes_compat.h b/dlls/nodes_compat.h index d73567e9..c190f11f 100644 --- a/dlls/nodes_compat.h +++ b/dlls/nodes_compat.h @@ -1,6 +1,6 @@ #pragma once -#ifndef NODES_32BIT_COMPAT +#if !defined(NODES_32BIT_COMPAT) #define NODES_32BIT_COMPAT //#include "nodes.h" diff --git a/dlls/plane.h b/dlls/plane.h index 912062f6..25d35d44 100644 --- a/dlls/plane.h +++ b/dlls/plane.h @@ -15,7 +15,7 @@ //========================================================= // Plane //========================================================= -#ifndef PLANE_H +#if !defined(PLANE_H) #define PLANE_H class CPlane diff --git a/dlls/player.h b/dlls/player.h index 571a025d..d2f5d945 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PLAYER_H +#if !defined(PLAYER_H) #define PLAYER_H #include "pm_materials.h" diff --git a/dlls/saverestore.h b/dlls/saverestore.h index 5eec01e2..993deade 100644 --- a/dlls/saverestore.h +++ b/dlls/saverestore.h @@ -14,7 +14,7 @@ ****/ // Implementation in UTIL.CPP #pragma once -#ifndef SAVERESTORE_H +#if !defined(SAVERESTORE_H) #define SAVERESTORE_H class CBaseEntity; diff --git a/dlls/schedule.h b/dlls/schedule.h index 6414ff15..f3b3101b 100644 --- a/dlls/schedule.h +++ b/dlls/schedule.h @@ -16,7 +16,7 @@ // Scheduling //========================================================= #pragma once -#ifndef SCHEDULE_H +#if !defined(SCHEDULE_H) #define SCHEDULE_H #define TASKSTATUS_NEW 0 // Just started diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 4c04a9f7..c62ce846 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -24,11 +24,11 @@ #include "cbase.h" #include "monsters.h" -#ifndef ANIMATION_H +#if !defined(ANIMATION_H) #include "animation.h" #endif -#ifndef SAVERESTORE_H +#if !defined(SAVERESTORE_H) #include "saverestore.h" #endif diff --git a/dlls/scripted.h b/dlls/scripted.h index 59b696f7..5666a082 100644 --- a/dlls/scripted.h +++ b/dlls/scripted.h @@ -13,10 +13,10 @@ * ****/ #pragma once -#ifndef SCRIPTED_H +#if !defined(SCRIPTED_H) #define SCRIPTED_H -#ifndef SCRIPTEVENT_H +#if !defined(SCRIPTEVENT_H) #include "scriptevent.h" #endif diff --git a/dlls/scriptevent.h b/dlls/scriptevent.h index 18436a26..179503d7 100644 --- a/dlls/scriptevent.h +++ b/dlls/scriptevent.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef SCRIPTEVENT_H +#if !defined(SCRIPTEVENT_H) #define SCRIPTEVENT_H #define SCRIPT_EVENT_DEAD 1000 // character is now dead diff --git a/dlls/skill.h b/dlls/skill.h index 5244c923..1cb5b0c1 100644 --- a/dlls/skill.h +++ b/dlls/skill.h @@ -16,7 +16,7 @@ // skill.h - skill level concerns //========================================================= #pragma once -#ifndef SKILL_H +#if !defined(SKILL_H) #define SKILL_H struct skilldata_t diff --git a/dlls/soundent.h b/dlls/soundent.h index 88def506..9053e1fb 100644 --- a/dlls/soundent.h +++ b/dlls/soundent.h @@ -18,7 +18,7 @@ // lists. //========================================================= #pragma once -#ifndef SOUNDENT_H +#if !defined(SOUNDENT_H) #define SOUNDENT_H #define MAX_WORLD_SOUNDS 64 // maximum number of sounds handled by the world at one time. diff --git a/dlls/spectator.h b/dlls/spectator.h index c4e895c0..cf48c703 100644 --- a/dlls/spectator.h +++ b/dlls/spectator.h @@ -14,7 +14,7 @@ ****/ // Spectator.h #pragma once -#ifndef SPECTATOR_H +#if !defined(SPECTATOR_H) #define SPECTATOR_H class CBaseSpectator : public CBaseEntity diff --git a/dlls/squad.h b/dlls/squad.h index 2c79ee90..b6418cc1 100644 --- a/dlls/squad.h +++ b/dlls/squad.h @@ -8,7 +8,7 @@ // squad.h //========================================================= #pragma once -#ifndef SQUAD_H +#if !defined(SQUAD_H) #define SQUAD_H // these are special group roles that are assigned to members when the group is formed. diff --git a/dlls/squadmonster.h b/dlls/squadmonster.h index e2c8a5b9..f6d3ed84 100644 --- a/dlls/squadmonster.h +++ b/dlls/squadmonster.h @@ -17,7 +17,7 @@ // form squads. //========================================================= #pragma once -#ifndef SQUADMONSTER_H +#if !defined(SQUADMONSTER_H) #define SQUADMONSTER_H #define SF_SQUADMONSTER_LEADER 32 diff --git a/dlls/talkmonster.h b/dlls/talkmonster.h index befa4e4a..6a6e31ac 100644 --- a/dlls/talkmonster.h +++ b/dlls/talkmonster.h @@ -13,10 +13,10 @@ * ****/ #pragma once -#ifndef TALKMONSTER_H +#if !defined(TALKMONSTER_H) #define TALKMONSTER_H -#ifndef MONSTERS_H +#if !defined(MONSTERS_H) #include "monsters.h" #endif diff --git a/dlls/teamplay_gamerules.h b/dlls/teamplay_gamerules.h index 12ed038f..f7c91de8 100644 --- a/dlls/teamplay_gamerules.h +++ b/dlls/teamplay_gamerules.h @@ -16,7 +16,7 @@ // teamplay_gamerules.h // #pragma once -#ifndef TEAMPLAY_GAMERULES_H +#if !defined(TEAMPLAY_GAMERULES_H) #define TEAMPLAY_GAMERULES_H #define MAX_TEAMNAME_LENGTH 16 diff --git a/dlls/trains.h b/dlls/trains.h index f740e2ea..046dbc24 100644 --- a/dlls/trains.h +++ b/dlls/trains.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef TRAINS_H +#if !defined(TRAINS_H) #define TRAINS_H // Tracktrain spawn flags diff --git a/dlls/util.cpp b/dlls/util.cpp index 483d6748..a7ab3ca4 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1729,7 +1729,7 @@ void CSaveRestoreBuffer::BufferRewind( int size ) m_pdata->size -= size; } -#if !defined _WIN32 && !defined __WATCOMC__ +#if !_WIN32 && !__WATCOMC__ extern "C" { unsigned _rotr( unsigned val, int shift ) { diff --git a/dlls/util.h b/dlls/util.h index ad7981ad..6e3b2cca 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -13,16 +13,16 @@ * ****/ #pragma once -#ifndef UTIL_H +#if !defined(UTIL_H) #define UTIL_H // // Misc utility code // -#ifndef ACTIVITY_H +#if !defined(ACTIVITY_H) #include "activity.h" #endif -#ifndef ENGINECALLBACK_H +#if !defined(ENGINECALLBACK_H) #include "enginecallback.h" #endif @@ -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) || CLIENT_DLL +#if !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) @@ -93,7 +93,7 @@ typedef int EOFFSET; typedef int BOOL; // In case this ever changes -#ifndef M_PI +#if !defined(M_PI) #define M_PI 3.14159265358979323846 #endif // Keeps clutter down a bit, when declaring external entity/global method prototypes diff --git a/dlls/vector.h b/dlls/vector.h index 48c707b4..524cdfcf 100644 --- a/dlls/vector.h +++ b/dlls/vector.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef VECTOR_H +#if !defined(VECTOR_H) #define VECTOR_H //========================================================= diff --git a/dlls/weapons.h b/dlls/weapons.h index 86e4cec9..7e33de78 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef WEAPONS_H +#if !defined(WEAPONS_H) #define WEAPONS_H #include "effects.h" diff --git a/engine/cdll_int.h b/engine/cdll_int.h index 8ab903b0..02d277dd 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -19,10 +19,10 @@ // JOHN: client dll interface declarations // #pragma once -#ifndef CDLL_INT_H +#if !defined(CDLL_INT_H) #define CDLL_INT_H -#ifdef __cplusplus +#if __cplusplus extern "C" { #endif @@ -307,7 +307,7 @@ typedef struct cl_enginefuncs_s #define CLDLL_INTERFACE_VERSION 7 -#ifdef __cplusplus +#if __cplusplus } #endif diff --git a/engine/custom.h b/engine/custom.h index 4bff2632..6bfd27c7 100644 --- a/engine/custom.h +++ b/engine/custom.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CUSTOM_H +#if !defined(CUSTOM_H) #define CUSTOM_H #include "const.h" diff --git a/engine/customentity.h b/engine/customentity.h index f524ae79..fb4c1055 100644 --- a/engine/customentity.h +++ b/engine/customentity.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef CUSTOMENTITY_H +#if !defined(CUSTOMENTITY_H) #define CUSTOMENTITY_H // Custom Entities diff --git a/engine/edict.h b/engine/edict.h index 8584a0d9..beae7d7b 100644 --- a/engine/edict.h +++ b/engine/edict.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef EDICT_H +#if !defined(EDICT_H) #define EDICT_H #define MAX_ENT_LEAFS 48 diff --git a/engine/eiface.h b/engine/eiface.h index 6a5f86fc..f7cdb095 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -13,10 +13,10 @@ * ****/ #pragma once -#ifndef EIFACE_H +#if !defined(EIFACE_H) #define EIFACE_H -#ifdef HLDEMO_BUILD +#if HLDEMO_BUILD #define INTERFACE_VERSION 001 #else // !HLDEMO_BUILD, i.e., regular version of HL #define INTERFACE_VERSION 140 @@ -355,7 +355,7 @@ typedef enum _fieldtypes FIELD_TYPECOUNT // MUST BE LAST } FIELDTYPE; -#if !defined(offsetof) && !defined(__GNUC__) +#if !defined(offsetof) && !__GNUC__ #define offsetof(s,m) (size_t)&(((s *)0)->m) #endif @@ -380,7 +380,7 @@ typedef struct short flags; } TYPEDESCRIPTION; -#ifndef ARRAYSIZE +#if !defined(ARRAYSIZE) #define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) #endif diff --git a/engine/keydefs.h b/engine/keydefs.h index 5593d75a..82b799a8 100644 --- a/engine/keydefs.h +++ b/engine/keydefs.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef KEYDEFS_H +#if !defined(KEYDEFS_H) #define KEYDEFS_H // diff --git a/engine/mobility_int.h b/engine/mobility_int.h index d8b6120a..ef94f769 100644 --- a/engine/mobility_int.h +++ b/engine/mobility_int.h @@ -12,11 +12,10 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ - #pragma once -#ifndef MOBILITY_INT_H +#if !defined(MOBILITY_INT_H) #define MOBILITY_INT_H -#ifdef __cplusplus +#if __cplusplus extern "C" { #endif @@ -84,7 +83,7 @@ typedef struct mobile_engfuncs_s // returns 0 on no error otherwise error typedef int (*pfnMobilityInterface)( mobile_engfuncs_t *gMobileEngfuncs ); -#ifdef __cplusplus +#if __cplusplus } #endif #endif diff --git a/engine/progdefs.h b/engine/progdefs.h index 31cfb3cb..d8dd62e6 100644 --- a/engine/progdefs.h +++ b/engine/progdefs.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PROGDEFS_H +#if !defined(PROGDEFS_H) #define PROGDEFS_H typedef struct diff --git a/engine/shake.h b/engine/shake.h index a3e49324..8d4bbde5 100644 --- a/engine/shake.h +++ b/engine/shake.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef SHAKE_H +#if !defined(SHAKE_H) #define SHAKE_H // Screen / View effects diff --git a/engine/sprite.h b/engine/sprite.h index 4368c1ac..ee0c317b 100644 --- a/engine/sprite.h +++ b/engine/sprite.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef SPRITE_H +#if !defined(SPRITE_H) #define SPRITE_H /* diff --git a/engine/studio.h b/engine/studio.h index 88254c96..48be9d0a 100644 --- a/engine/studio.h +++ b/engine/studio.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef STUDIO_H +#if !defined(STUDIO_H) #define STUDIO_H /* @@ -201,7 +201,7 @@ typedef struct vec3_t bbmax; } mstudiobbox_t; -#ifndef CACHE_USER +#if !defined(CACHE_USER) #define CACHE_USER typedef struct cache_user_s { diff --git a/game_shared/bitvec.h b/game_shared/bitvec.h index b7f5343a..bb6d8fb7 100644 --- a/game_shared/bitvec.h +++ b/game_shared/bitvec.h @@ -4,12 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef BITVEC_H -#define BITVEC_H -#ifdef _WIN32 #pragma once -#endif +#if !defined(BITVEC_H) +#define BITVEC_H #include #include diff --git a/game_shared/vgui_checkbutton2.h b/game_shared/vgui_checkbutton2.h index ef8f82ae..7267abe2 100644 --- a/game_shared/vgui_checkbutton2.h +++ b/game_shared/vgui_checkbutton2.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_CHECKBUTTON2_H -#define VGUI_CHECKBUTTON2_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VGUI_CHECKBUTTON2_H) +#define VGUI_CHECKBUTTON2_H #include "vgui_label.h" #include "vgui_imagepanel.h" diff --git a/game_shared/vgui_defaultinputsignal.h b/game_shared/vgui_defaultinputsignal.h index 835d92b0..25d89d70 100644 --- a/game_shared/vgui_defaultinputsignal.h +++ b/game_shared/vgui_defaultinputsignal.h @@ -4,17 +4,12 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_DEFAULTINPUTSIGNAL_H -#define VGUI_DEFAULTINPUTSIGNAL_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VGUI_DEFAULTINPUTSIGNAL_H) +#define VGUI_DEFAULTINPUTSIGNAL_H #include "vgui_inputsignal.h" - namespace vgui { // This class derives from vgui::InputSignal and implements empty defaults for all of its functions. @@ -34,6 +29,4 @@ namespace vgui virtual void keyFocusTicked(Panel* panel) {} }; } - - #endif // VGUI_DEFAULTINPUTSIGNAL_H diff --git a/game_shared/vgui_grid.h b/game_shared/vgui_grid.h index eaf8e1d7..739834e5 100644 --- a/game_shared/vgui_grid.h +++ b/game_shared/vgui_grid.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_GRID_H -#define VGUI_GRID_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VGUI_GRID_H) +#define VGUI_GRID_H #include "vgui_panel.h" @@ -117,6 +113,4 @@ protected: }; }; - - #endif // VGUI_GRID_H diff --git a/game_shared/vgui_helpers.h b/game_shared/vgui_helpers.h index 09e82667..fb150eb5 100644 --- a/game_shared/vgui_helpers.h +++ b/game_shared/vgui_helpers.h @@ -4,12 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_HELPERS_H -#define VGUI_HELPERS_H -#ifdef _WIN32 #pragma once -#endif +#if !defined(VGUI_HELPERS_H) +#define VGUI_HELPERS_H #include "vgui_panel.h" @@ -25,7 +22,5 @@ inline int PanelHeight(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y, // Places child at the requested position inside pParent. iAlignment is from Label::Alignment. void AlignPanel(vgui::Panel *pChild, vgui::Panel *pParent, int alignment); - - #endif // VGUI_HELPERS_H diff --git a/game_shared/vgui_listbox.h b/game_shared/vgui_listbox.h index 7191f827..9b245b4c 100644 --- a/game_shared/vgui_listbox.h +++ b/game_shared/vgui_listbox.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_LISTBOX_H -#define VOICE_LISTBOX_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VOICE_LISTBOX_H) +#define VOICE_LISTBOX_H #include "VGUI_Panel.h" #include "VGUI_IntChangeSignal.h" @@ -110,6 +106,4 @@ protected: }; } - - #endif // VOICE_LISTBOX_H diff --git a/game_shared/vgui_loadtga.h b/game_shared/vgui_loadtga.h index 053d23ff..ea0ecac2 100644 --- a/game_shared/vgui_loadtga.h +++ b/game_shared/vgui_loadtga.h @@ -4,19 +4,13 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_LOADTGA_H -#define VGUI_LOADTGA_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VGUI_LOADTGA_H) +#define VGUI_LOADTGA_H #include "vgui_bitmaptga.h" vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename); vgui::BitmapTGA* vgui_LoadTGANoInvertAlpha(char const *pFilename); - - #endif // VGUI_LOADTGA_H diff --git a/game_shared/vgui_scrollbar2.h b/game_shared/vgui_scrollbar2.h index ad2d2d05..16fe8a46 100644 --- a/game_shared/vgui_scrollbar2.h +++ b/game_shared/vgui_scrollbar2.h @@ -4,12 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_SCROLLBAR2_H -#define VGUI_SCROLLBAR2_H -#ifdef _WIN32 #pragma once -#endif +#if !defined(VGUI_SCROLLBAR2_H) +#define VGUI_SCROLLBAR2_H #include #include @@ -58,5 +55,4 @@ protected: }; } - #endif // VGUI_SCROLLBAR2_H diff --git a/game_shared/vgui_slider2.h b/game_shared/vgui_slider2.h index 4edb87f2..e421bba5 100644 --- a/game_shared/vgui_slider2.h +++ b/game_shared/vgui_slider2.h @@ -4,12 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VGUI_SLIDER2_H -#define VGUI_SLIDER2_H -#ifdef _WIN32 #pragma once -#endif +#if !defined(VGUI_SLIDER2_H) +#define VGUI_SLIDER2_H #include #include @@ -63,5 +60,4 @@ protected: }; } - #endif // VGUI_SLIDER2_H diff --git a/game_shared/voice_banmgr.h b/game_shared/voice_banmgr.h index 610ad6cf..4c4f7b63 100644 --- a/game_shared/voice_banmgr.h +++ b/game_shared/voice_banmgr.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_BANMGR_H -#define VOICE_BANMGR_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VOICE_BANMGR_H) +#define VOICE_BANMGR_H // This class manages the (persistent) list of squelched players. class CVoiceBanMgr @@ -52,6 +48,4 @@ protected: BannedPlayer m_PlayerHash[256]; }; - - #endif // VOICE_BANMGR_H diff --git a/game_shared/voice_common.h b/game_shared/voice_common.h index 5517d8ee..58225955 100644 --- a/game_shared/voice_common.h +++ b/game_shared/voice_common.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_COMMON_H -#define VOICE_COMMON_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VOICE_COMMON_H) +#define VOICE_COMMON_H #include "bitvec.h" @@ -19,6 +15,4 @@ #define VOICE_MAX_PLAYERS_DW ((VOICE_MAX_PLAYERS / 32) + !!(VOICE_MAX_PLAYERS & 31)) typedef CBitVec CPlayerBitVec; - - #endif // VOICE_COMMON_H diff --git a/game_shared/voice_gamemgr.h b/game_shared/voice_gamemgr.h index bc2d26a8..f6e9d92c 100644 --- a/game_shared/voice_gamemgr.h +++ b/game_shared/voice_gamemgr.h @@ -4,10 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_GAMEMGR_H -#define VOICE_GAMEMGR_H #pragma once +#if !defined(VOICE_GAMEMGR_H) +#define VOICE_GAMEMGR_H #include "voice_common.h" diff --git a/game_shared/voice_status.h b/game_shared/voice_status.h index 509902e5..efc5e5c5 100644 --- a/game_shared/voice_status.h +++ b/game_shared/voice_status.h @@ -4,11 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_STATUS_H -#define VOICE_STATUS_H #pragma once - +#if !defined(VOICE_STATUS_H) +#define VOICE_STATUS_H #include "VGUI_Label.h" #include "VGUI_LineBorder.h" @@ -223,6 +221,4 @@ public: // Get the (global) voice manager. CVoiceStatus* GetClientVoiceMgr(); - - #endif // VOICE_STATUS_H diff --git a/game_shared/voice_vgui_tweakdlg.h b/game_shared/voice_vgui_tweakdlg.h index deb83dc2..960a8d85 100644 --- a/game_shared/voice_vgui_tweakdlg.h +++ b/game_shared/voice_vgui_tweakdlg.h @@ -4,13 +4,9 @@ // // $NoKeywords: $ //============================================================================= - -#ifndef VOICE_VGUI_TWEAKDLG_H -#define VOICE_VGUI_TWEAKDLG_H -#ifdef _WIN32 #pragma once -#endif - +#if !defined(VOICE_VGUI_TWEAKDLG_H) +#define VOICE_VGUI_TWEAKDLG_H class CMenuPanel; diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index ce904760..d726e19a 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -49,7 +49,7 @@ static int PM_boxpnt[6][4] = void PM_ShowClipBox( void ) { -#if defined( _DEBUG ) +#if _DEBUG vec3_t org; vec3_t offset = { 0, 0, 0 }; diff --git a/pm_shared/pm_debug.h b/pm_shared/pm_debug.h index 6c91d62e..2d7ba059 100644 --- a/pm_shared/pm_debug.h +++ b/pm_shared/pm_debug.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_DEBUG_H +#if !defined(PM_DEBUG_H) #define PM_DEBUG_H void PM_ViewEntity( void ); diff --git a/pm_shared/pm_defs.h b/pm_shared/pm_defs.h index 7da29755..5ef8c356 100644 --- a/pm_shared/pm_defs.h +++ b/pm_shared/pm_defs.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_DEFS_H +#if !defined(PM_DEFS_H) #define PM_DEFS_H #define MAX_PHYSENTS 600 // Must have room for all entities in the world. diff --git a/pm_shared/pm_info.h b/pm_shared/pm_info.h index 9a971d53..2a13c14c 100644 --- a/pm_shared/pm_info.h +++ b/pm_shared/pm_info.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_INFO_H +#if !defined(PM_INFO_H) #define PM_INFO_H #define MAX_PHYSINFO_STRING 256 diff --git a/pm_shared/pm_materials.h b/pm_shared/pm_materials.h index 9bc71b72..ad61e946 100644 --- a/pm_shared/pm_materials.h +++ b/pm_shared/pm_materials.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_MATERIALS_H +#if !defined(PM_MATERIALS_H) #define PM_MATERIALS_H #define CBTEXTURENAMEMAX 13 // only load first n chars of name diff --git a/pm_shared/pm_shared.h b/pm_shared/pm_shared.h index c315353b..7e64421f 100644 --- a/pm_shared/pm_shared.h +++ b/pm_shared/pm_shared.h @@ -13,7 +13,7 @@ * ****/ #pragma once -#ifndef PM_SHARED_H +#if !defined(PM_SHARED_H) #define PM_SHARED_H void PM_Init( struct playermove_s *ppmove ); diff --git a/public/build.h b/public/build.h index e23265ce..abfe1902 100644 --- a/public/build.h +++ b/public/build.h @@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to */ #pragma once -#ifndef BUILD_H +#if !defined(BUILD_H) #define BUILD_H // All XASH_* macros set by this header are guaranteed to have positive value otherwise not defined From 6e7653eec14c80cc9f21b91c455981f4853f4ec6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 20 Jun 2021 13:49:04 +0500 Subject: [PATCH 154/298] Move M_PI definition to header. --- cl_dll/view.cpp | 9 +-------- cl_dll/view.h | 8 ++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 0c3d3ef6..fdbee778 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -25,6 +25,7 @@ #include "screenfade.h" #include "shake.h" #include "hltv.h" +#include "view.h" // Spectator Mode extern "C" @@ -36,14 +37,6 @@ extern "C" int iIsSpectator; } -#if !defined(M_PI) -#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h -#endif - -#if !defined(M_PI_F) -#define M_PI_F (float)M_PI -#endif - extern "C" { int CL_IsThirdPerson( void ); diff --git a/cl_dll/view.h b/cl_dll/view.h index 6ca818d5..80a2f065 100644 --- a/cl_dll/view.h +++ b/cl_dll/view.h @@ -9,6 +9,14 @@ #define VIEWH #pragma once +#if !defined(M_PI) +#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +#if !defined(M_PI_F) +#define M_PI_F (float)M_PI +#endif + void V_StartPitchDrift( void ); void V_StopPitchDrift( void ); #endif // !VIEWH From dd470d67009ea96358bd629f9d1143c2fe6a4335 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 3 Jul 2021 19:21:13 +0300 Subject: [PATCH 155/298] waifulib: xcompile: upgrade tool --- scripts/waifulib/xcompile.py | 39 ++++++++++++++++++++++++++++++++---- wscript | 6 +----- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 2872306f..5d111d7c 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -152,6 +152,8 @@ class Android: def gen_host_toolchain(self): # With host toolchain we don't care about OS # so just download NDK for Linux x86_64 + if 'HOST_TOOLCHAIN' in self.ctx.environ: + return self.ctx.environ['HOST_TOOLCHAIN'] if self.is_host(): return 'linux-x86_64' @@ -198,16 +200,32 @@ class Android: def cc(self): if self.is_host(): - return 'clang --target=%s%d' % (self.ndk_triplet(), self.api) + s = 'clang' + environ = getattr(self.ctx, 'environ', os.environ) + + if 'CC' in environ: + s = environ['CC'] + + return '%s --target=%s%d' % (s, self.ndk_triplet(), self.api) return self.gen_toolchain_path() + ('clang' if self.is_clang() else 'gcc') def cxx(self): if self.is_host(): - return 'clang++ --target=%s%d' % (self.ndk_triplet(), self.api) + s = 'clang++' + environ = getattr(self.ctx, 'environ', os.environ) + + if 'CXX' in environ: + s = environ['CXX'] + + return '%s --target=%s%d' % (s, self.ndk_triplet(), self.api) return self.gen_toolchain_path() + ('clang++' if self.is_clang() else 'g++') def strip(self): if self.is_host(): + environ = getattr(self.ctx, 'environ', os.environ) + + if 'STRIP' in environ: + return environ['STRIP'] return 'llvm-strip' return os.path.join(self.gen_binutils_path(), 'strip') @@ -281,7 +299,7 @@ class Android: cflags += fixup_host_clang_with_old_ndk() # ARMv5 support - cflags += ['-march=armv5te', '-mtune=xscale', '-msoft-float'] + cflags += ['-march=armv5te', '-msoft-float'] elif self.is_x86(): cflags += ['-mtune=atom', '-march=atom', '-mssse3', '-mfpmath=sse', '-DVECTORIZE_SINCOS', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS'] return cflags @@ -300,7 +318,7 @@ class Android: if self.is_clang() or self.is_host(): linkflags += ['-fuse-ld=lld'] - linkflags += ['-Wl,--hash-style=both','-Wl,--no-undefined'] + linkflags += ['-Wl,--hash-style=sysv', '-Wl,--no-undefined', '-no-canonical-prefixes'] return linkflags def ldflags(self): @@ -325,6 +343,10 @@ def options(opt): android.add_option('--android', action='store', dest='ANDROID_OPTS', default=None, help='enable building for android, format: --android=,,, example: --android=armeabi-v7a-hard,4.9,9') + magx = opt.add_option_group('MotoMAGX options') + magx.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, + help = 'enable targetting for MotoMAGX phones [default: %default]') + def configure(conf): if conf.options.ANDROID_OPTS: values = conf.options.ANDROID_OPTS.split(',') @@ -360,7 +382,16 @@ def configure(conf): # conf.env.ANDROID_OPTS = android conf.env.DEST_OS2 = 'android' + elif conf.options.MAGX: + # useless to change toolchain path, as toolchain meant to be placed in this path + toolchain_path = '/opt/toolchains/motomagx/arm-eabi2/lib/' + conf.env.INCLUDES_MAGX = [toolchain_path + i for i in ['ezx-z6/include', 'qt-2.3.8/include']] + conf.env.LIBPATH_MAGX = [toolchain_path + i for i in ['ezx-z6/lib', 'qt-2.3.8/lib']] + conf.env.LINKFLAGS_MAGX = ['-Wl,-rpath-link=' + i for i in conf.env.LIBPATH_MAGX] + for lib in ['qte-mt', 'ezxappbase', 'ezxpm', 'log_util']: + conf.check_cc(lib=lib, use='MAGX', uselib_store='MAGX') + conf.env.MAGX = conf.options.MAGX MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android' }) for k in c_config.MACRO_TO_DESTOS: MACRO_TO_DESTOS[k] = c_config.MACRO_TO_DESTOS[k] # ordering is important diff --git a/wscript b/wscript index ded363dd..4fcaef4c 100644 --- a/wscript +++ b/wscript @@ -40,9 +40,6 @@ def options(opt): grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, help = 'enable polyhedral optimization if possible [default: %default]') - grp.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, - help = 'enable targetting for MotoMAGX phones [default: %default]') - 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]') @@ -111,8 +108,7 @@ def configure(conf): conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified - conf.env.MAGX = conf.options.MAGX - if conf.options.MAGX: + if conf.env.MAGX: enforce_pic = False conf.check_pic(enforce_pic) From f0d53af66d2f169d2fbca28a220fb1a892ef39c0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 3 Jul 2021 19:35:19 +0300 Subject: [PATCH 156/298] waifulib: xcompile: upgrade again from engine tree, fix motomagx build --- scripts/waifulib/xcompile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 5d111d7c..752a0794 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -388,8 +388,6 @@ def configure(conf): conf.env.INCLUDES_MAGX = [toolchain_path + i for i in ['ezx-z6/include', 'qt-2.3.8/include']] conf.env.LIBPATH_MAGX = [toolchain_path + i for i in ['ezx-z6/lib', 'qt-2.3.8/lib']] conf.env.LINKFLAGS_MAGX = ['-Wl,-rpath-link=' + i for i in conf.env.LIBPATH_MAGX] - for lib in ['qte-mt', 'ezxappbase', 'ezxpm', 'log_util']: - conf.check_cc(lib=lib, use='MAGX', uselib_store='MAGX') conf.env.MAGX = conf.options.MAGX MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android' }) @@ -406,6 +404,10 @@ def post_compiler_cxx_configure(conf): if conf.android.ndk_rev == 19: conf.env.CXXFLAGS_cxxshlib += ['-static-libstdc++'] conf.env.LDFLAGS_cxxshlib += ['-static-libstdc++'] + elif conf.options.MAGX: + for lib in ['qte-mt', 'ezxappbase', 'ezxpm', 'log_util']: + conf.check_cc(lib=lib, use='MAGX', uselib_store='MAGX') + return def post_compiler_c_configure(conf): From cc4aebd61a9c31d61239c83077dc6124dc1cd80d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 3 Jul 2021 19:53:46 +0300 Subject: [PATCH 157/298] wscript: remove dead option --- wscript | 3 --- 1 file changed, 3 deletions(-) diff --git a/wscript b/wscript index 4fcaef4c..200b1e82 100644 --- a/wscript +++ b/wscript @@ -40,9 +40,6 @@ def options(opt): grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, help = 'enable polyhedral optimization if possible [default: %default]') - 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('subproject') opt.add_subproject(['cl_dll', 'dlls']) From 201206ccfdc1bdeb7ccf7172b5468f3798356324 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 5 Jul 2021 21:08:34 +0300 Subject: [PATCH 158/298] Fix potential conflict of monster states in scripted_sequence --- dlls/scripted.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index c62ce846..da495f98 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -664,7 +664,7 @@ void ScriptEntityCancel( edict_t *pentCine ) if( pTarget ) { // make sure their monster is actually playing a script - if( pTarget->m_MonsterState == MONSTERSTATE_SCRIPT ) + if( pTarget->m_MonsterState == MONSTERSTATE_SCRIPT || pTarget->m_IdealMonsterState == MONSTERSTATE_SCRIPT ) { // tell them do die pTarget->m_scriptState = CCineMonster::SCRIPT_CLEANUP; From d86b0bf480f886ec40c93d2cf84e47ba5fd292de Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 27 Feb 2021 13:36:23 +0300 Subject: [PATCH 159/298] Change ideal monster state in MonsterUse only if monster is idle --- dlls/monsters.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 9f1f57f2..8b8643a6 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -571,7 +571,8 @@ void CBaseMonster::MonsterThink( void ) //========================================================= void CBaseMonster::MonsterUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - m_IdealMonsterState = MONSTERSTATE_ALERT; + if (m_MonsterState == MONSTERSTATE_IDLE) + m_IdealMonsterState = MONSTERSTATE_ALERT; } //========================================================= From 3503619bdd24e6acf013a2749bbebc33b2edf6ca Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Wed, 7 Jul 2021 00:41:17 +0500 Subject: [PATCH 160/298] Merge https://github.com/ValveSoftware/halflife/pull/3099. --- cl_dll/in_camera.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index 5e499ef4..881f0c3c 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -153,6 +153,9 @@ void DLLEXPORT CAM_Think( void ) #endif vec3_t viewangles; + if( gEngfuncs.GetMaxClients() > 1 && CL_IsThirdPerson() ) + CAM_ToFirstPerson(); + switch( (int)cam_command->value ) { case CAM_COMMAND_TOTHIRDPERSON: From 136ee78cfd497c0defa47d667ba0e2bf3bf612ef Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 27 Aug 2021 11:04:15 +0300 Subject: [PATCH 161/298] Make msvc builds in release mode with static runtime (#185) --- .github/workflows/.github.yml | 2 +- CMakeLists.txt | 4 ++++ appveyor.yml | 1 + cl_dll/CMakeLists.txt | 4 ++++ dlls/CMakeLists.txt | 4 ++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 26151361..8b5b6ecf 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -72,7 +72,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" - msbuild build/INSTALL.vcxproj + msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index 868c5e7f..35b4fad5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ cmake_minimum_required(VERSION 2.8.12) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0") + cmake_policy(SET CMP0091 NEW) +endif() + # Install custom module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") diff --git a/appveyor.yml b/appveyor.yml index bb4ba61d..6616ee57 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,7 @@ build: configuration: - Debug + - Release before_build: - git submodule update --init --recursive diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 11cf81cd..07d6b0d0 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -147,6 +147,10 @@ if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") PREFIX "") endif() +if(MSVC) + set_property(TARGET ${CLDLL_LIBRARY} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() + install( TARGETS ${CLDLL_LIBRARY} DESTINATION "${GAMEDIR}/${CLIENT_INSTALL_DIR}/" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 053bc26b..4f8e60ac 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -177,6 +177,10 @@ if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") PREFIX "") endif() +if(MSVC) + set_property(TARGET ${SVDLL_LIBRARY} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() + install( TARGETS ${SVDLL_LIBRARY} DESTINATION "${GAMEDIR}/${SERVER_INSTALL_DIR}/" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE From 060a6c3269ced26c3c5f8eae8490b9ac5800a514 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Mon, 13 Sep 2021 01:13:23 +0500 Subject: [PATCH 162/298] Update README.md. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 86c9c9c0..32d4fc05 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ These scripts also can be ran via wine: The libraries built this way are always GoldSource compatible. -There're dsp projects for Visual Studio 6 in `cl_dll` and `dlls` directories, but we don't keep them up-to-date. You're free to adapt them for yourself and try to import into the newer Visual Studio versions. - #### Using mingw TODO From 219fb37f4409cb90d4f83efa7d09d44e2254405a Mon Sep 17 00:00:00 2001 From: Velaron Date: Tue, 12 Oct 2021 14:26:22 +0300 Subject: [PATCH 163/298] Fix CMake build when included from other project --- CMakeLists.txt | 4 +--- cmake/LibraryNaming.cmake | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35b4fad5..cc8fdd20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0") endif() # Install custom module path -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") include(VSForceXPToolchain) # Force XP toolchain for Visual Studio @@ -52,8 +52,6 @@ set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for Linux/MacOS/Windows" # MAIN BUILD CODE \ ###################\ -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") - if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT) if(MSVC) error("UNDONE: set 32 build flags") diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index db50422e..cbea3f72 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -1,7 +1,7 @@ include(CheckSymbolExists) # generated(see comments in public/build.h) -set(CMAKE_REQUIRED_INCLUDES "${CMAKE_SOURCE_DIR}/public/") +set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/") check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID) From 9e93646e06ed354eb0889cb5b67e7ab7ebcc61f7 Mon Sep 17 00:00:00 2001 From: Aydar Zarifullin Date: Mon, 18 Oct 2021 14:47:53 +0400 Subject: [PATCH 164/298] add premake5 build script (#192) --- contrib/iZarif/premake5.lua | 254 ++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 contrib/iZarif/premake5.lua diff --git a/contrib/iZarif/premake5.lua b/contrib/iZarif/premake5.lua new file mode 100644 index 00000000..97d3e7dd --- /dev/null +++ b/contrib/iZarif/premake5.lua @@ -0,0 +1,254 @@ +workspace("hlsdk-xash3d") +configurations{"Debug", "Release"} +language("C++") +kind("SharedLib") +rtti("Off") +exceptionhandling("Off") +pic("On") +targetprefix("") + +files{"pm_shared/pm_debug.c", +"pm_shared/pm_math.c", +"pm_shared/pm_shared.c", +"dlls/crossbow.cpp", +"dlls/crowbar.cpp", +"dlls/egon.cpp", +"dlls/gauss.cpp", +"dlls/glock.cpp", +"dlls/handgrenade.cpp", +"dlls/hornetgun.cpp", +"dlls/mp5.cpp", +"dlls/python.cpp", +"dlls/rpg.cpp", +"dlls/satchel.cpp", +"dlls/shotgun.cpp", +"dlls/squeakgrenade.cpp", +"dlls/tripmine.cpp"} + +includedirs{"dlls", +"common", +"engine", +"pm_shared", +"game_shared"} + +defines{"BARNACLE_FIX_VISIBILITY=0", +"CLIENT_WEAPONS=1", +"CROWBAR_IDLE_ANIM=0", +"CROWBAR_DELAY_FIX=0", +"CROWBAR_FIX_RAPID_CROWBAR=0", +"GAUSS_OVERCHARGE_FIX=0", +"OEM_BUILD=0", +"HLDEMO_BUILD=0"} + +newoption{trigger = "64bits", description = "Allow targetting 64-bit engine", default = false} +newoption{trigger = "voicemgr", description = "Eable voice manager", default = false} +newoption{trigger = "goldsrc", description = "Enable GoldSource engine support", default = false} +newoption{trigger = "lto", description = "Enable Link Time Optimization", default = false} + +if _OPTIONS["64bits"] then + architecture("x86_64") +else + architecture("x86") +end + +if _OPTIONS["lto"] then + flags{"LinkTimeOptimization"} +end + +if os.findheader("tgmath.h") then + defines{"HAVE_TGMATH_H"} +end + +if os.findheader("cmath") then + defines{"HAVE_CMATH"} +end + +filter("configurations:Release") +optimize("Full") +symbols("Off") +omitframepointer("On") + +filter("configurations:Debug") +optimize("Off") +symbols("On") +omitframepointer("Off") + +filter("toolset:msc") +buildoptions{"/D_USING_V110_SDK71_", "/Zc:threadSafeInit-"} +defines{"_CRT_SECURE_NO_WARNINGS=1", "_CRT_NONSTDC_NO_DEPRECATE=1"} + +filter("toolset:gcc or clang") +visibility("Hidden") +defines{"stricmp=strcasecmp", +"strnicmp=strncasecmp", +"_snprintf=snprintf", +"_vsnprintf=vsnprintf", +"_LINUX", +"LINUX"} + +project("dlls") +targetname("hl") + +files{"dlls/agrunt.cpp", +"dlls/airtank.cpp", +"dlls/aflock.cpp", +"dlls/animating.cpp", +"dlls/animation.cpp", +"dlls/apache.cpp", +"dlls/barnacle.cpp", +"dlls/barney.cpp", +"dlls/bigmomma.cpp", +"dlls/bloater.cpp", +"dlls/bmodels.cpp", +"dlls/bullsquid.cpp", +"dlls/buttons.cpp", +"dlls/cbase.cpp", +"dlls/client.cpp", +"dlls/combat.cpp", +"dlls/controller.cpp", +"dlls/defaultai.cpp", +"dlls/doors.cpp", +"dlls/effects.cpp", +"dlls/explode.cpp", +"dlls/flyingmonster.cpp", +"dlls/func_break.cpp", +"dlls/func_tank.cpp", +"dlls/game.cpp", +"dlls/gamerules.cpp", +"dlls/gargantua.cpp", +"dlls/genericmonster.cpp", +"dlls/ggrenade.cpp", +"dlls/globals.cpp", +"dlls/gman.cpp", +"dlls/h_ai.cpp", +"dlls/h_battery.cpp", +"dlls/h_cine.cpp", +"dlls/h_cycler.cpp", +"dlls/h_export.cpp", +"dlls/hassassin.cpp", +"dlls/headcrab.cpp", +"dlls/healthkit.cpp", +"dlls/hgrunt.cpp", +"dlls/hornet.cpp", +"dlls/houndeye.cpp", +"dlls/ichthyosaur.cpp", +"dlls/islave.cpp", +"dlls/items.cpp", +"dlls/leech.cpp", +"dlls/lights.cpp", +"dlls/maprules.cpp", +"dlls/monstermaker.cpp", +"dlls/monsters.cpp", +"dlls/monsterstate.cpp", +"dlls/mortar.cpp", +"dlls/multiplay_gamerules.cpp", +"dlls/nihilanth.cpp", +"dlls/nodes.cpp", +"dlls/observer.cpp", +"dlls/osprey.cpp", +"dlls/pathcorner.cpp", +"dlls/plane.cpp", +"dlls/plats.cpp", +"dlls/player.cpp", +"dlls/playermonster.cpp", +"dlls/rat.cpp", +"dlls/roach.cpp", +"dlls/schedule.cpp", +"dlls/scientist.cpp", +"dlls/scripted.cpp", +"dlls/singleplay_gamerules.cpp", +"dlls/skill.cpp", +"dlls/sound.cpp", +"dlls/soundent.cpp", +"dlls/spectator.cpp", +"dlls/squadmonster.cpp", +"dlls/subs.cpp", +"dlls/talkmonster.cpp", +"dlls/teamplay_gamerules.cpp", +"dlls/tempmonster.cpp", +"dlls/tentacle.cpp", +"dlls/triggers.cpp", +"dlls/turret.cpp", +"dlls/util.cpp", +"dlls/weapons.cpp", +"dlls/world.cpp", +"dlls/xen.cpp", +"dlls/zombie.cpp"} + +includedirs{"public"} + +if _OPTIONS["voicemgr"] then + files{"game_shared/voice_gamemgr.cpp"} +else + defines{"NO_VOICEGAMEMGR"} +end + +filter("toolset:msc") +buildoptions{"/def:" .. path.getabsolute("dlls/hl.def")} + +project("cl_dll") +targetname("client") + +files{"cl_dll/hl/hl_baseentity.cpp", +"cl_dll/hl/hl_events.cpp", +"cl_dll/hl/hl_objects.cpp", +"cl_dll/hl/hl_weapons.cpp", +"cl_dll/GameStudioModelRenderer.cpp", +"cl_dll/MOTD.cpp", +"cl_dll/StudioModelRenderer.cpp", +"cl_dll/ammo.cpp", +"cl_dll/ammo_secondary.cpp", +"cl_dll/ammohistory.cpp", +"cl_dll/battery.cpp", +"cl_dll/cdll_int.cpp", +"cl_dll/com_weapons.cpp", +"cl_dll/death.cpp", +"cl_dll/demo.cpp", +"cl_dll/entity.cpp", +"cl_dll/ev_hldm.cpp", +"cl_dll/ev_common.cpp", +"cl_dll/events.cpp", +"cl_dll/flashlight.cpp", +"cl_dll/geiger.cpp", +"cl_dll/health.cpp", +"cl_dll/hud.cpp", +"cl_dll/hud_msg.cpp", +"cl_dll/hud_redraw.cpp", +"cl_dll/hud_spectator.cpp", +"cl_dll/hud_update.cpp", +"cl_dll/in_camera.cpp", +"cl_dll/input.cpp", +"cl_dll/input_goldsource.cpp", +"cl_dll/input_mouse.cpp", +"cl_dll/input_xash3d.cpp", +"cl_dll/menu.cpp", +"cl_dll/message.cpp", +"cl_dll/overview.cpp", +"cl_dll/parsemsg.cpp", +"cl_dll/saytext.cpp", +"cl_dll/scoreboard.cpp", +"cl_dll/status_icons.cpp", +"cl_dll/statusbar.cpp", +"cl_dll/studio_util.cpp", +"cl_dll/text_message.cpp", +"cl_dll/train.cpp", +"cl_dll/tri.cpp", +"cl_dll/util.cpp", +"cl_dll/view.cpp"} + +includedirs{"cl_dll", +"cl_dll/hl", +"utils/false_vgui/include"} + +defines{"CLIENT_DLL"} + +if _OPTIONS["goldsrc"] then + defines{"GOLDSOURCE_SUPPORT"} +end + +filter("system:Windows") +links{"user32", "winmm"} + +filter("system:not windows") +links{"dl"} + From 1737b8a8787f531d1063cbcdc7480d428c5b3b07 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Oct 2021 19:55:42 +0300 Subject: [PATCH 165/298] Add apt update to github workflow (#193) --- .github/workflows/.github.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 8b5b6ecf..49264af4 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -43,6 +43,7 @@ jobs: - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: | + sudo apt update ./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf From 302e2d7a2a5d74831abd7e28c389045413c259ce Mon Sep 17 00:00:00 2001 From: Vale the Violet Mote Date: Tue, 26 Oct 2021 17:52:17 -0400 Subject: [PATCH 166/298] Realtime cheats (#197) * have cheats auto-update (send notif to client, use updated value in server) * cheats did not need to be registered here as it's registered by the engine * also not needed. --- dlls/client.cpp | 8 ++++---- dlls/game.cpp | 5 +++++ dlls/game.h | 1 + dlls/player.cpp | 4 ++-- dlls/world.cpp | 4 ---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dlls/client.cpp b/dlls/client.cpp index 142b5de8..82b8e7e7 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -468,7 +468,7 @@ ClientCommand called each time a player uses a "cmd" command ============ */ -extern float g_flWeaponCheat; +extern cvar_t *g_enable_cheats; // Use CMD_ARGV, CMD_ARGV, and CMD_ARGC to get pointers the character string command. void ClientCommand( edict_t *pEntity ) @@ -496,7 +496,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq(pcmd, "give" ) ) { - if( g_flWeaponCheat != 0.0f ) + if( g_enable_cheats->value != 0 ) { int iszItem = ALLOC_STRING( CMD_ARGV( 1 ) ); // Make a copy of the classname GetClassPtr( (CBasePlayer *)pev )->GiveNamedItem( STRING( iszItem ) ); @@ -504,7 +504,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fire" ) ) { - if( g_flWeaponCheat != 0.0f ) + if( g_enable_cheats->value != 0 ) { CBaseEntity *pPlayer = CBaseEntity::Instance( pEntity ); if( CMD_ARGC() > 1 ) @@ -540,7 +540,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fov" ) ) { - if( g_flWeaponCheat && CMD_ARGC() > 1 ) + if( g_enable_cheats->value != 0 && CMD_ARGC() > 1 ) { GetClassPtr( (CBasePlayer *)pev )->m_iFOV = atoi( CMD_ARGV( 1 ) ); } diff --git a/dlls/game.cpp b/dlls/game.cpp index 1207a089..eb4ae16b 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -55,6 +55,7 @@ cvar_t mp_chattime = { "mp_chattime","10", FCVAR_SERVER }; cvar_t *g_psv_gravity = NULL; cvar_t *g_psv_aim = NULL; cvar_t *g_footsteps = NULL; +cvar_t *g_enable_cheats = NULL; cvar_t *g_psv_developer; @@ -467,6 +468,8 @@ void GameDLLInit( void ) g_psv_developer = CVAR_GET_POINTER( "developer" ); + g_enable_cheats = CVAR_GET_POINTER( "sv_cheats" ); + CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &allow_spectators ); @@ -497,6 +500,8 @@ void GameDLLInit( void ) CVAR_REGISTER( &mp_chattime ); + + // REGISTER CVARS FOR SKILL LEVEL STUFF // Agrunt CVAR_REGISTER( &sk_agrunt_health1 );// {"sk_agrunt_health1","0"}; diff --git a/dlls/game.h b/dlls/game.h index 77502e76..3119351a 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -44,6 +44,7 @@ extern cvar_t allowmonsters; extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_aim; extern cvar_t *g_footsteps; +extern cvar_t *g_enable_cheats; extern cvar_t *g_psv_developer; #endif // GAME_H diff --git a/dlls/player.cpp b/dlls/player.cpp index 002635c0..cce57d02 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3355,7 +3355,7 @@ void CBasePlayer::ForceClientDllUpdate( void ) ImpulseCommands ============ */ -extern float g_flWeaponCheat; +extern cvar_t *g_enable_cheats; void CBasePlayer::ImpulseCommands() { @@ -3434,7 +3434,7 @@ void CBasePlayer::ImpulseCommands() void CBasePlayer::CheatImpulseCommands( int iImpulse ) { #if !HLDEMO_BUILD - if( g_flWeaponCheat == 0.0f ) + if( g_enable_cheats->value == 0 ) { return; } diff --git a/dlls/world.cpp b/dlls/world.cpp index 0d7db511..3f4bda0b 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -449,7 +449,6 @@ LINK_ENTITY_TO_CLASS( worldspawn, CWorld ) #define SF_WORLD_FORCETEAM 0x0004 // Force teams extern DLL_GLOBAL BOOL g_fGameOver; -float g_flWeaponCheat; void CWorld::Spawn( void ) { @@ -652,9 +651,6 @@ void CWorld::Precache( void ) { CVAR_SET_FLOAT( "mp_defaultteam", 0.0f ); } - - // g-cont. moved here so cheats will working on restore level - g_flWeaponCheat = CVAR_GET_FLOAT( "sv_cheats" ); // Is the impulse 101 command allowed? } // From ba2cab60df2a512eba0dfb7eda597eb405abbce9 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 27 Oct 2021 04:35:11 +0300 Subject: [PATCH 167/298] Get VGUI back (optionally) (#194) * Get VGUI back (optionally) * Add some missing VGUI invocations * Update CMakeLists.txt to build with vgui for Windows * Move windows.h inclusions only to those places where it's really needed * Try fix mingw build * Update hud_spectator * Merge nekonomicon's vgui branch * Don't include vgui panel and app in cdll_int.cpp if vgui is real * Deduplicate scoreboard global variables * Add options to prefer non-vgui motd and scoreboard when vgui is enabled * Add vgui-dev as a submodule. Add building vith vgui to CI * Fix artifact uploading * Don't use global variable when not necessary * char* to const char* in CMenuHandler_StringCommand constructor * Fix 'format string is not a literal string' warnings * Fix 'always evaluate to true' warnings * Team Fortress classes to const char* * CreateCommandMenu accepts const char* * Fix printf formats. Turn some unsigned longs into unsigned ints since they use only 32 bits anyway * Explicit assignment result as condition * Prevent memory leak on menu reading * Localize button text * Create FileInputStream on stack avoiding the leak * Remove Servers Browser code * Arrow file names to const char* * Fix assignment to the wrong variable --- .github/workflows/.github.yml | 26 + .gitmodules | 3 + CMakeLists.txt | 4 +- cl_dll/CMakeLists.txt | 73 +- cl_dll/MOTD.cpp | 4 + cl_dll/ammo.cpp | 10 +- cl_dll/cdll_int.cpp | 29 +- cl_dll/death.cpp | 17 +- cl_dll/entity.cpp | 6 + cl_dll/hud.cpp | 234 ++- cl_dll/hud.h | 56 +- cl_dll/hud_redraw.cpp | 38 +- cl_dll/hud_servers.cpp | 1226 ------------ cl_dll/hud_servers.h | 40 - cl_dll/hud_spectator.cpp | 139 +- cl_dll/hud_spectator.h | 1 + cl_dll/in_camera.cpp | 16 + cl_dll/in_defs.h | 13 - cl_dll/input.cpp | 26 + cl_dll/input_mouse.h | 15 + cl_dll/input_xash3d.cpp | 2 + cl_dll/menu.cpp | 9 + cl_dll/saytext.cpp | 21 +- cl_dll/scoreboard.cpp | 21 +- cl_dll/text_message.cpp | 9 + cl_dll/vgui_ClassMenu.cpp | 436 ++++ cl_dll/vgui_ConsolePanel.cpp | 97 + cl_dll/vgui_ConsolePanel.h | 37 + cl_dll/vgui_ControlConfigPanel.cpp | 216 ++ cl_dll/vgui_ControlConfigPanel.h | 43 + cl_dll/vgui_CustomObjects.cpp | 551 ++++++ cl_dll/vgui_MOTDWindow.cpp | 151 ++ cl_dll/vgui_SchemeManager.cpp | 556 ++++++ cl_dll/vgui_SchemeManager.h | 50 + cl_dll/vgui_ScorePanel.cpp | 1147 +++++++++++ cl_dll/vgui_ScorePanel.h | 311 +++ cl_dll/vgui_SpectatorPanel.cpp | 420 ++++ cl_dll/vgui_SpectatorPanel.h | 111 ++ cl_dll/vgui_TeamFortressViewport.cpp | 2633 +++++++++++++++++++++++++ cl_dll/vgui_TeamFortressViewport.h | 1816 +++++++++++++++++ cl_dll/vgui_int.cpp | 127 ++ cl_dll/vgui_int.h | 21 + cl_dll/vgui_teammenu.cpp | 394 ++++ cl_dll/voice_status.cpp | 884 +++++++++ cl_dll/voice_status.h | 228 +++ common/winsani_in.h | 7 + common/winsani_out.h | 4 + game_shared/bitvec.h | 4 +- game_shared/vgui_checkbutton2.cpp | 116 +- game_shared/vgui_checkbutton2.h | 61 +- game_shared/vgui_defaultinputsignal.h | 19 +- game_shared/vgui_grid.cpp | 195 +- game_shared/vgui_grid.h | 24 +- game_shared/vgui_helpers.cpp | 49 +- game_shared/vgui_helpers.h | 66 +- game_shared/vgui_listbox.cpp | 107 +- game_shared/vgui_listbox.h | 69 +- game_shared/vgui_loadtga.cpp | 95 +- game_shared/vgui_loadtga.h | 10 +- game_shared/vgui_scrollbar2.cpp | 229 ++- game_shared/vgui_scrollbar2.h | 65 +- game_shared/vgui_slider2.cpp | 371 ++-- game_shared/vgui_slider2.h | 44 +- game_shared/voice_banmgr.cpp | 117 +- game_shared/voice_banmgr.h | 31 +- game_shared/voice_common.h | 6 +- game_shared/voice_gamemgr.cpp | 131 +- game_shared/voice_gamemgr.h | 54 +- game_shared/voice_status.cpp | 478 +++-- game_shared/voice_status.h | 161 +- game_shared/voice_vgui_tweakdlg.cpp | 213 +- game_shared/voice_vgui_tweakdlg.h | 7 +- vgui-dev | 1 + 73 files changed, 12239 insertions(+), 2762 deletions(-) create mode 100644 .gitmodules delete mode 100644 cl_dll/hud_servers.cpp delete mode 100644 cl_dll/hud_servers.h create mode 100644 cl_dll/vgui_ClassMenu.cpp create mode 100644 cl_dll/vgui_ConsolePanel.cpp create mode 100644 cl_dll/vgui_ConsolePanel.h create mode 100644 cl_dll/vgui_ControlConfigPanel.cpp create mode 100644 cl_dll/vgui_ControlConfigPanel.h create mode 100644 cl_dll/vgui_CustomObjects.cpp create mode 100644 cl_dll/vgui_MOTDWindow.cpp create mode 100644 cl_dll/vgui_SchemeManager.cpp create mode 100644 cl_dll/vgui_SchemeManager.h create mode 100644 cl_dll/vgui_ScorePanel.cpp create mode 100644 cl_dll/vgui_ScorePanel.h create mode 100644 cl_dll/vgui_SpectatorPanel.cpp create mode 100644 cl_dll/vgui_SpectatorPanel.h create mode 100644 cl_dll/vgui_TeamFortressViewport.cpp create mode 100644 cl_dll/vgui_TeamFortressViewport.h create mode 100644 cl_dll/vgui_int.cpp create mode 100644 cl_dll/vgui_int.h create mode 100644 cl_dll/vgui_teammenu.cpp create mode 100644 cl_dll/voice_status.cpp create mode 100644 cl_dll/voice_status.h create mode 100644 common/winsani_in.h create mode 100644 common/winsani_out.h create mode 160000 vgui-dev diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 49264af4..34c449d1 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Checkout steam-runtime if: startsWith(matrix.os, 'ubuntu') @@ -58,6 +60,13 @@ jobs: schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist" schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install + - name: Build with goldsource input and vgui + if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') + run: | + schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" + cp vgui-dev/lib/vgui.so build-vgui/cl_dll + schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all + schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install - name: Build with mingw if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') @@ -74,6 +83,11 @@ jobs: run: | cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj + - name: Build with msvc and vgui + if: startsWith(matrix.os, 'windows') + run: | + cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" + msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name shell: bash @@ -89,10 +103,22 @@ jobs: with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + - name: Upload linux artifact with vgui + if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui + path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }} - name: Upload windows artifact if: startsWith(matrix.os, 'windows') uses: actions/upload-artifact@v2 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + - name: Upload windows artifact with vgui + if: startsWith(matrix.os, 'windows') + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui + path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..25dfc145 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vgui-dev"] + path = vgui-dev + url = https://github.com/FWGS/vgui-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index cc8fdd20..7321d4c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,10 @@ project (HLSDK-XASH3D) #-------------- # USER DEFINES \ ################\ -option(USE_VGUI "Enable VGUI1. UNDONE" OFF) +option(USE_VGUI "Enable VGUI1." OFF) option(USE_VGUI2 "Enable VGUI2. UNDONE" OFF) +option(USE_NOVGUI_MOTD "Prefer non-VGUI MOTD when USE_VGUI is enabled" OFF) +option(USE_NOVGUI_SCOREBOARD "Prefer non-VGUI Scoreboard when USE_VGUI is enabled" OFF) option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 07d6b0d0..8e8e3fb2 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -50,6 +50,15 @@ if (GOLDSOURCE_SUPPORT) add_definitions(-DGOLDSOURCE_SUPPORT) endif() +if (USE_VGUI) + add_definitions(-DUSE_VGUI) + if (USE_NOVGUI_MOTD) + add_definitions(-DUSE_NOVGUI_MOTD) + endif() + if (USE_NOVGUI_SCOREBOARD) + add_definitions(-DUSE_NOVGUI_SCOREBOARD) + endif() +endif() set (CLDLL_SOURCES ../dlls/crossbow.cpp @@ -112,11 +121,52 @@ set (CLDLL_SOURCES train.cpp tri.cpp util.cpp - view.cpp - scoreboard.cpp - MOTD.cpp) + view.cpp) -include_directories (. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include) +if (USE_VGUI) + list(APPEND CLDLL_SOURCES + vgui_int.cpp + vgui_ClassMenu.cpp + vgui_ConsolePanel.cpp + vgui_ControlConfigPanel.cpp + vgui_CustomObjects.cpp + vgui_MOTDWindow.cpp + vgui_SchemeManager.cpp + vgui_ScorePanel.cpp + vgui_TeamFortressViewport.cpp + vgui_SpectatorPanel.cpp + vgui_teammenu.cpp + voice_status.cpp + ../game_shared/vgui_checkbutton2.cpp + ../game_shared/vgui_grid.cpp + ../game_shared/vgui_helpers.cpp + ../game_shared/vgui_listbox.cpp + ../game_shared/vgui_loadtga.cpp + ../game_shared/vgui_scrollbar2.cpp + ../game_shared/vgui_slider2.cpp + ../game_shared/voice_banmgr.cpp + ) + if (USE_NOVGUI_MOTD) + list(APPEND CLDLL_SOURCES MOTD.cpp) + endif() + if (USE_NOVGUI_SCOREBOARD) + list(APPEND CLDLL_SOURCES scoreboard.cpp) + endif() +else() + list(APPEND CLDLL_SOURCES + MOTD.cpp + scoreboard.cpp) +endif() + +include_directories (. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public) + +if (USE_VGUI) + SET(CMAKE_SKIP_RPATH TRUE) + link_directories(${CMAKE_SOURCE_DIR}/vgui-dev/lib) + include_directories(../vgui-dev/include) +else() + include_directories(../utils/false_vgui/include) +endif() if(USE_VOICEMGR) #set(CLDLL_SOURCES @@ -126,10 +176,25 @@ if(USE_VOICEMGR) endif() add_library (${CLDLL_LIBRARY} SHARED ${CLDLL_SOURCES}) + if (GOLDSOURCE_SUPPORT) target_link_libraries( ${CLDLL_LIBRARY} ${CMAKE_DL_LIBS} ) endif() +if (USE_VGUI) + if (WIN32) + add_library(vgui SHARED IMPORTED) + set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.dll") + set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.lib") + target_link_libraries(${CLDLL_LIBRARY} vgui) + target_link_libraries(${CLDLL_LIBRARY} ws2_32) + elseif(APPLE) + target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui-dev/lib vgui.dylib") + else() + target_link_libraries(${CLDLL_LIBRARY} :vgui.so) + endif() +endif() + if(WIN32) target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) if (GOLDSOURCE_SUPPORT) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index e186134f..c48a9af1 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -26,13 +26,17 @@ #include #include +#if !USE_VGUI || USE_NOVGUI_MOTD DECLARE_MESSAGE( m_MOTD, MOTD ) +#endif int CHudMOTD::Init( void ) { gHUD.AddHudElem( this ); +#if !USE_VGUI || USE_NOVGUI_MOTD HOOK_MESSAGE( MOTD ); +#endif m_bShow = false; diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 7be34e23..94952df7 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -27,6 +27,9 @@ #include #include "ammohistory.h" +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif WEAPON *gpActiveSel; // NULL means off, 1 means just the menu bar, otherwise // this points to the active weapon menu item @@ -673,10 +676,11 @@ int CHudAmmo::MsgFunc_WeaponList( const char *pszName, int iSize, void *pbuf ) // Slot button pressed void CHudAmmo::SlotInput( int iSlot ) { +#if USE_VGUI // Let the Viewport use it first, for menus -// if( gViewPort && gViewPort->SlotInput( iSlot ) ) -// return; - + if( gViewPort && gViewPort->SlotInput( iSlot ) ) + return; +#endif gWR.SelectSlot(iSlot, FALSE, 1); } diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index d2be3eea..23da5ae7 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -23,11 +23,18 @@ #include "netadr.h" #include "parsemsg.h" +#if USE_VGUI +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#endif + #if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) -#define USE_VGUI_FOR_GOLDSOURCE_SUPPORT 1 +#define USE_FAKE_VGUI !USE_VGUI +#if USE_FAKE_VGUI #include "VGUI_Panel.h" #include "VGUI_App.h" #endif +#endif extern "C" { @@ -38,6 +45,9 @@ extern "C" cl_enginefunc_t gEngfuncs; CHud gHUD; +#if USE_VGUI +TeamFortressViewport *gViewPort = NULL; +#endif mobile_engfuncs_t *gMobileEngfuncs = NULL; extern "C" int g_bhopcap; @@ -183,7 +193,7 @@ int *HUD_GetRect( void ) return extent; } -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_FAKE_VGUI class TeamFortressViewport : public vgui::Panel { public: @@ -238,7 +248,7 @@ so the HUD can reinitialize itself. int DLLEXPORT HUD_VidInit( void ) { gHUD.VidInit(); -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_FAKE_VGUI vgui::Panel* root=(vgui::Panel*)gEngfuncs.VGui_GetPanel(); if (root) { gEngfuncs.Con_Printf( "Root VGUI panel exists\n" ); @@ -256,6 +266,8 @@ int DLLEXPORT HUD_VidInit( void ) } else { gEngfuncs.Con_Printf( "Root VGUI panel does not exist\n" ); } +#elif USE_VGUI + VGui_Startup(); #endif return 1; } @@ -274,6 +286,9 @@ void DLLEXPORT HUD_Init( void ) { InitInput(); gHUD.Init(); +#if USE_VGUI + Scheme_Init(); +#endif gEngfuncs.pfnHookUserMsg( "Bhopcap", __MsgFunc_Bhopcap ); } @@ -337,7 +352,9 @@ Called by engine every frame that client .dll is loaded void DLLEXPORT HUD_Frame( double time ) { -#if USE_VGUI_FOR_GOLDSOURCE_SUPPORT +#if USE_VGUI + GetClientVoiceMgr()->Frame(time); +#elif USE_FAKE_VGUI if (!gViewPort) gEngfuncs.VGui_ViewportPaintBackground(HUD_GetRect()); #else @@ -355,7 +372,9 @@ Called when a player starts or stops talking. void DLLEXPORT HUD_VoiceStatus( int entindex, qboolean bTalking ) { - +#if USE_VGUI + GetClientVoiceMgr()->UpdateSpeakerStatus(entindex, bTalking); +#endif } /* diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index d2c41e38..1dbb0b39 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -23,6 +23,10 @@ #include #include +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + DECLARE_MESSAGE( m_DeathNotice, DeathMsg ) struct DeathNoticeItem { @@ -110,7 +114,9 @@ int CHudDeathNotice::Draw( float flTime ) // Only draw if the viewport will let me // vgui dropped out - //if( gViewPort && gViewPort->AllowedToPrintText() ) +#if USE_VGUI + if( gViewPort && gViewPort->AllowedToPrintText() ) +#endif { // Draw the death notice y = YRES( DEATHNOTICE_TOP ) + 2 + ( 20 * i ); //!!! @@ -168,6 +174,11 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu strcpy( killedwith, "d_" ); strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 ); +#if USE_VGUI + if (gViewPort) + gViewPort->DeathMsg( killer, victim ); +#endif + gHUD.m_Spectator.DeathMessage( victim ); for( i = 0; i < MAX_DEATHNOTICES; i++ ) @@ -182,9 +193,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu i = MAX_DEATHNOTICES - 1; } - //if(gViewPort) - // gViewPort->GetAllPlayersInfo(); - gHUD.m_Scoreboard.GetAllPlayersInfo(); + gHUD.GetAllPlayersInfo(); // Get the Killer's name const char *killer_name = ""; diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index e9b3d0f4..ba524f6a 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -7,6 +7,8 @@ // Client side entity management functions +#include + #include "hud.h" #include "cl_util.h" #include "const.h" @@ -526,6 +528,10 @@ void DLLEXPORT HUD_CreateEntities( void ) #endif // Add in any game specific objects Game_AddObjects(); + +#if USE_VGUI + GetClientVoiceMgr()->CreateEntities(); +#endif } /* diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 9652770d..eae37b7a 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -23,11 +23,72 @@ #include #include #include "parsemsg.h" -#include "hud_servers.h" +#if USE_VGUI +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#endif #include "demo.h" #include "demo_api.h" +hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine +extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll +team_info_t g_TeamInfo[MAX_TEAMS + 1]; +int g_IsSpectator[MAX_PLAYERS+1]; +int g_iPlayerClass; +int g_iTeamNumber; +int g_iUser1 = 0; +int g_iUser2 = 0; +int g_iUser3 = 0; + +#if USE_VGUI +#include "vgui_ScorePanel.h" + +class CHLVoiceStatusHelper : public IVoiceStatusHelper +{ +public: + virtual void GetPlayerTextColor(int entindex, int color[3]) + { + color[0] = color[1] = color[2] = 255; + + if( entindex >= 0 && entindex < sizeof(g_PlayerExtraInfo)/sizeof(g_PlayerExtraInfo[0]) ) + { + int iTeam = g_PlayerExtraInfo[entindex].teamnumber; + + if ( iTeam < 0 ) + { + iTeam = 0; + } + + iTeam = iTeam % iNumberOfTeamColors; + + color[0] = iTeamColors[iTeam][0]; + color[1] = iTeamColors[iTeam][1]; + color[2] = iTeamColors[iTeam][2]; + } + } + + virtual void UpdateCursorState() + { + gViewPort->UpdateCursorState(); + } + + virtual int GetAckIconHeight() + { + return ScreenHeight - gHUD.m_iFontHeight*3 - 6; + } + + virtual bool CanShowSpeakerLabels() + { + if( gViewPort && gViewPort->m_pScoreBoard ) + return !gViewPort->m_pScoreBoard->isVisible(); + else + return false; + } +}; +static CHLVoiceStatusHelper g_VoiceStatusHelper; +#endif + cvar_t *hud_textmode; float g_hud_text_color[3]; @@ -81,73 +142,182 @@ int __MsgFunc_GameMode( const char *pszName, int iSize, void *pbuf ) // TFFree Command Menu void __CmdFunc_OpenCommandMenu( void ) { +#if USE_VGUI + if ( gViewPort ) + { + gViewPort->ShowCommandMenu( gViewPort->m_StandardMenu ); + } +#endif } // TFC "special" command void __CmdFunc_InputPlayerSpecial( void ) { +#if USE_VGUI + if ( gViewPort ) + { + gViewPort->InputPlayerSpecial(); + } +#endif } void __CmdFunc_CloseCommandMenu( void ) { +#if USE_VGUI + if ( gViewPort ) + { + gViewPort->InputSignalHideCommandMenu(); + } +#endif } void __CmdFunc_ForceCloseCommandMenu( void ) { -} - -void __CmdFunc_ToggleServerBrowser( void ) -{ +#if USE_VGUI + if ( gViewPort ) + { + gViewPort->HideCommandMenu(); + } +#endif } // TFFree Command Menu Message Handlers int __MsgFunc_ValClass( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_ValClass( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_TeamNames( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_TeamNames( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_Feign( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_Feign( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_Detpack( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_Detpack( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_VGUIMenu( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_VGUIMenu( pszName, iSize, pbuf ); +#endif return 0; } +#if USE_VGUI && !USE_NOVGUI_MOTD +int __MsgFunc_MOTD(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_MOTD( pszName, iSize, pbuf ); + return 0; +} +#endif + int __MsgFunc_BuildSt( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_BuildSt( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_RandomPC( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_RandomPC( pszName, iSize, pbuf ); +#endif return 0; } int __MsgFunc_ServerName( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_ServerName( pszName, iSize, pbuf ); +#endif return 0; } +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD +int __MsgFunc_ScoreInfo(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_ScoreInfo( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_TeamScore(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_TeamScore( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_TeamInfo(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_TeamInfo( pszName, iSize, pbuf ); + return 0; +} +#endif + int __MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_Spectator( pszName, iSize, pbuf ); +#endif return 0; } +#if USE_VGUI +int __MsgFunc_SpecFade(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_SpecFade( pszName, iSize, pbuf ); + return 0; +} + +int __MsgFunc_ResetFade(const char *pszName, int iSize, void *pbuf) +{ + if (gViewPort) + return gViewPort->MsgFunc_ResetFade( pszName, iSize, pbuf ); + return 0; + +} +#endif + int __MsgFunc_AllowSpec( const char *pszName, int iSize, void *pbuf ) { +#if USE_VGUI + if (gViewPort) + return gViewPort->MsgFunc_AllowSpec( pszName, iSize, pbuf ); +#endif return 0; } @@ -167,7 +337,6 @@ void CHud::Init( void ) HOOK_COMMAND( "-commandmenu", CloseCommandMenu ); HOOK_COMMAND( "ForceCloseCommandMenu", ForceCloseCommandMenu ); HOOK_COMMAND( "special", InputPlayerSpecial ); - HOOK_COMMAND( "togglebrowser", ToggleServerBrowser ); HOOK_MESSAGE( ValClass ); HOOK_MESSAGE( TeamNames ); @@ -177,9 +346,24 @@ void CHud::Init( void ) HOOK_MESSAGE( RandomPC ); HOOK_MESSAGE( ServerName ); +#if USE_VGUI && !USE_NOVGUI_MOTD + HOOK_MESSAGE( MOTD ); +#endif + +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD + HOOK_MESSAGE( ScoreInfo ); + HOOK_MESSAGE( TeamScore ); + HOOK_MESSAGE( TeamInfo ); +#endif + HOOK_MESSAGE( Spectator ); HOOK_MESSAGE( AllowSpec ); +#if USE_VGUI + HOOK_MESSAGE( SpecFade ); + HOOK_MESSAGE( ResetFade ); +#endif + // VGUI Menus HOOK_MESSAGE( VGUIMenu ); @@ -230,11 +414,19 @@ void CHud::Init( void ) m_AmmoSecondary.Init(); m_TextMessage.Init(); m_StatusIcons.Init(); +#if USE_VGUI + GetClientVoiceMgr()->Init(&g_VoiceStatusHelper, (vgui::Panel**)&gViewPort); +#endif + +#if !USE_VGUI || USE_NOVGUI_MOTD m_MOTD.Init(); +#endif +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD m_Scoreboard.Init(); +#endif m_Menu.Init(); - + MsgFunc_ResetHUD( 0, 0, NULL ); } @@ -411,8 +603,15 @@ void CHud::VidInit( void ) m_AmmoSecondary.VidInit(); m_TextMessage.VidInit(); m_StatusIcons.VidInit(); - m_Scoreboard.VidInit(); +#if USE_VGUI + GetClientVoiceMgr()->VidInit(); +#endif +#if !USE_VGUI || USE_NOVGUI_MOTD m_MOTD.VidInit(); +#endif +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD + m_Scoreboard.VidInit(); +#endif } int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf ) @@ -588,3 +787,22 @@ float CHud::GetSensitivity( void ) { return m_flMouseSensitivity; } + +void CHud::GetAllPlayersInfo() +{ + for( int i = 1; i < MAX_PLAYERS; i++ ) + { + GetPlayerInfo( i, &g_PlayerInfoList[i] ); + + if( g_PlayerInfoList[i].thisplayer ) + { +#if USE_VGUI + if(gViewPort) + gViewPort->m_pScoreBoard->m_iPlayerNum = i; +#endif +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD + m_Scoreboard.m_iPlayerNum = i; // !!!HACK: this should be initialized elsewhere... maybe gotten from the engine +#endif + } + } +} diff --git a/cl_dll/hud.h b/cl_dll/hud.h index 7c5eee0e..69c6646f 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -63,6 +63,9 @@ typedef struct cvar_s cvar_t; #define MAX_MOTD_LENGTH 1536 +#define MAX_SERVERNAME_LENGTH 64 +#define MAX_TEAMNAME_SIZE 32 + // //----------------------------------------------------- // @@ -89,6 +92,9 @@ struct HUDLIST // //----------------------------------------------------- +#if USE_VGUI +#include "voice_status.h" // base voice handling class +#endif #include "hud_spectator.h" // @@ -196,11 +202,7 @@ private: int m_iPos; }; -// -//----------------------------------------------------- -// -// REMOVED: Vgui has replaced this. -// +#if !USE_VGUI || USE_NOVGUI_MOTD class CHudMOTD : public CHudBase { public: @@ -222,7 +224,9 @@ protected: int m_iLines; int m_iMaxLength; }; +#endif +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD class CHudScoreboard : public CHudBase { public: @@ -249,6 +253,7 @@ public: void GetAllPlayersInfo( void ); }; +#endif // //----------------------------------------------------- @@ -283,41 +288,6 @@ protected: float *m_pflNameColors[MAX_STATUSBAR_LINES]; }; -// -//----------------------------------------------------- -// -// REMOVED: Vgui has replaced this. -// -/* -class CHudScoreboard : public CHudBase -{ -public: - int Init( void ); - void InitHUDData( void ); - int VidInit( void ); - int Draw( float flTime ); - int DrawPlayers( int xoffset, float listslot, int nameoffset = 0, char *team = NULL ); // returns the ypos where it finishes drawing - void UserCmd_ShowScores( void ); - void UserCmd_HideScores( void ); - int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ); - int MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ); - int MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ); - void DeathMsg( int killer, int victim ); - - int m_iNumTeams; - - int m_iLastKilledBy; - int m_fLastKillTime; - int m_iPlayerNum; - int m_iShowscoresHeld; - - void GetAllPlayersInfo( void ); - -private: - struct cvar_s *cl_showpacketloss; -}; -*/ - struct extra_player_info_t { short frags; @@ -633,8 +603,12 @@ public: CHudAmmoSecondary m_AmmoSecondary; CHudTextMessage m_TextMessage; CHudStatusIcons m_StatusIcons; +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD CHudScoreboard m_Scoreboard; +#endif +#if !USE_VGUI || USE_NOVGUI_MOTD CHudMOTD m_MOTD; +#endif void Init( void ); void VidInit( void ); @@ -670,6 +644,8 @@ public: void AddHudElem( CHudBase *p ); float GetSensitivity(); + + void GetAllPlayersInfo( void ); }; extern CHud gHUD; diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 579c0897..300c228f 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -21,6 +21,10 @@ #include "cl_util.h" //#include "triangleapi.h" +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + #define MAX_LOGO_FRAMES 56 int grgLogoFrame[MAX_LOGO_FRAMES] = @@ -39,6 +43,11 @@ extern cvar_t *sensitivity; // Think void CHud::Think( void ) { +#if USE_VGUI + m_scrinfo.iSize = sizeof(m_scrinfo); + GetScreenInfo(&m_scrinfo); +#endif + int newfov; HUDLIST *pList = m_pHudList; @@ -94,13 +103,40 @@ int CHud::Redraw( float flTime, int intermission ) if( m_flTimeDelta < 0 ) m_flTimeDelta = 0; +#if USE_VGUI + // Bring up the scoreboard during intermission + if (gViewPort) + { + if( m_iIntermission && !intermission ) + { + // Have to do this here so the scoreboard goes away + m_iIntermission = intermission; + gViewPort->HideCommandMenu(); + gViewPort->HideScoreBoard(); + gViewPort->UpdateSpectatorPanel(); + } + else if( !m_iIntermission && intermission ) + { + m_iIntermission = intermission; + gViewPort->HideCommandMenu(); + gViewPort->HideVGUIMenu(); +#if !USE_NOVGUI_SCOREBOARD + gViewPort->ShowScoreBoard(); +#endif + gViewPort->UpdateSpectatorPanel(); + // Take a screenshot if the client's got the cvar set + if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) + m_flShotTime = flTime + 1.0; // Take a screenshot in a second + } + } +#else if( !m_iIntermission && intermission ) { // Take a screenshot if the client's got the cvar set if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) m_flShotTime = flTime + 1.0f; // Take a screenshot in a second } - +#endif if( m_flShotTime && m_flShotTime < flTime ) { gEngfuncs.pfnClientCmd( "snapshot\n" ); diff --git a/cl_dll/hud_servers.cpp b/cl_dll/hud_servers.cpp deleted file mode 100644 index fa6d5585..00000000 --- a/cl_dll/hud_servers.cpp +++ /dev/null @@ -1,1226 +0,0 @@ -//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -// hud_servers.cpp -#include "hud.h" -#include "cl_util.h" -#include "hud_servers_priv.h" -#include "hud_servers.h" -#include "net_api.h" -#include -#include - -static int context_id; - -// Default master server address in case we can't read any from woncomm.lst file -#define VALVE_MASTER_ADDRESS "half-life.east.won.net" -#define PORT_MASTER 27010 -#define PORT_SERVER 27015 - -// File where we really should look for master servers -#define MASTER_PARSE_FILE "woncomm.lst" - -#define MAX_QUERIES 20 - -#define NET_API gEngfuncs.pNetAPI - -static CHudServers *g_pServers = NULL; - -/* -=================== -ListResponse - -Callback from engine -=================== -*/ -void NET_CALLBACK ListResponse( struct net_response_s *response ) -{ - if( g_pServers ) - { - g_pServers->ListResponse( response ); - } -} - -/* -=================== -ServerResponse - -Callback from engine -=================== -*/ -void NET_CALLBACK ServerResponse( struct net_response_s *response ) -{ - if( g_pServers ) - { - g_pServers->ServerResponse( response ); - } -} - -/* -=================== -PingResponse - -Callback from engine -=================== -*/ -void NET_CALLBACK PingResponse( struct net_response_s *response ) -{ - if( g_pServers ) - { - g_pServers->PingResponse( response ); - } -} - -/* -=================== -RulesResponse - -Callback from engine -=================== -*/ -void NET_CALLBACK RulesResponse( struct net_response_s *response ) -{ - if( g_pServers ) - { - g_pServers->RulesResponse( response ); - } -} - -/* -=================== -PlayersResponse - -Callback from engine -=================== -*/ -void NET_CALLBACK PlayersResponse( struct net_response_s *response ) -{ - if( g_pServers ) - { - g_pServers->PlayersResponse( response ); - } -} - -/* -=================== -ListResponse - -=================== -*/ -void CHudServers::ListResponse( struct net_response_s *response ) -{ - request_t *list; - request_t *p; - int c = 0; - - if( !( response->error == NET_SUCCESS ) ) - return; - - if( response->type != NETAPI_REQUEST_SERVERLIST ) - return; - - if( response->response ) - { - list = ( request_t * ) response->response; - while ( list ) - { - c++; - - //if( c < 40 ) - { - // Copy from parsed stuff - p = new request_t; - p->context = -1; - p->remote_address = list->remote_address; - p->next = m_pServerList; - m_pServerList = p; - } - - // Move on - list = list->next; - } - } - - gEngfuncs.Con_Printf( "got list\n" ); - - m_nQuerying = 1; - m_nActiveQueries = 0; -} - -/* -=================== -ServerResponse - -=================== -*/ -void CHudServers::ServerResponse( struct net_response_s *response ) -{ - char *szresponse; - request_t *p; - server_t *browser; - int len; - char sz[32]; - - // Remove from active list - p = FindRequest( response->context, m_pActiveList ); - if( p ) - { - RemoveServerFromList( &m_pActiveList, p ); - m_nActiveQueries--; - } - - if( response->error != NET_SUCCESS ) - return; - - switch ( response->type ) - { - case NETAPI_REQUEST_DETAILS: - if( response->response ) - { - szresponse = (char *)response->response; - len = strlen( szresponse ) + 100 + 1; - sprintf( sz, "%i", (int)( 1000.0 * response->ping ) ); - - browser = new server_t; - browser->remote_address = response->remote_address; - browser->info = new char[len]; - browser->ping = (int)( 1000.0 * response->ping ); - strcpy( browser->info, szresponse ); - - NET_API->SetValueForKey( browser->info, "address", gEngfuncs.pNetAPI->AdrToString( &response->remote_address ), len ); - NET_API->SetValueForKey( browser->info, "ping", sz, len ); - - AddServer( &m_pServers, browser ); - } - break; - default: - break; - } -} - -/* -=================== -PingResponse - -=================== -*/ -void CHudServers::PingResponse( struct net_response_s *response ) -{ - char sz[32]; - - if( response->error != NET_SUCCESS ) - return; - - switch( response->type ) - { - case NETAPI_REQUEST_PING: - sprintf( sz, "%.2f", 1000.0 * response->ping ); - - gEngfuncs.Con_Printf( "ping == %s\n", sz ); - break; - default: - break; - } -} - -/* -=================== -RulesResponse - -=================== -*/ -void CHudServers::RulesResponse( struct net_response_s *response ) -{ - char *szresponse; - - if( response->error != NET_SUCCESS ) - return; - - switch( response->type ) - { - case NETAPI_REQUEST_RULES: - if( response->response ) - { - szresponse = (char *)response->response; - - gEngfuncs.Con_Printf( "rules %s\n", szresponse ); - } - break; - default: - break; - } -} - -/* -=================== -PlayersResponse - -=================== -*/ -void CHudServers::PlayersResponse( struct net_response_s *response ) -{ - char *szresponse; - - if( response->error != NET_SUCCESS ) - return; - - switch( response->type ) - { - case NETAPI_REQUEST_PLAYERS: - if( response->response ) - { - szresponse = (char *)response->response; - - gEngfuncs.Con_Printf( "players %s\n", szresponse ); - } - break; - default: - break; - } -} - -/* -=================== -CompareServers - -Return 1 if p1 is "less than" p2, 0 otherwise -=================== -*/ -int CHudServers::CompareServers( server_t *p1, server_t *p2 ) -{ - const char *n1, *n2; - - if( p1->ping < p2->ping ) - return 1; - - if( p1->ping == p2->ping ) - { - // Pings equal, sort by second key: hostname - if( p1->info && p2->info ) - { - n1 = NET_API->ValueForKey( p1->info, "hostname" ); - n2 = NET_API->ValueForKey( p2->info, "hostname" ); - - if( n1 && n2 ) - { - if( stricmp( n1, n2 ) < 0 ) - return 1; - } - } - } - - return 0; -} - -/* -=================== -AddServer - -=================== -*/ -void CHudServers::AddServer( server_t **ppList, server_t *p ) -{ - server_t *list; - - if( !ppList || ! p ) - return; - - m_nServerCount++; - - // What sort key? Ping? - list = *ppList; - - // Head of list? - if( !list ) - { - p->next = NULL; - *ppList = p; - return; - } - - // Put on head of list - if( CompareServers( p, list ) ) - { - p->next = *ppList; - *ppList = p; - } - else - { - while( list->next ) - { - // Insert before list next - if( CompareServers( p, list->next ) ) - { - p->next = list->next->next; - list->next = p; - return; - } - - list = list->next; - } - - // Just add at end - p->next = NULL; - list->next = p; - } -} - -/* -=================== -Think - -=================== -*/ -void CHudServers::Think( double time ) -{ - m_fElapsed += time; - - if( !m_nRequesting ) - return; - - if( !m_nQuerying ) - return; - - QueryThink(); - - if( ServerListSize() > 0 ) - return; - - m_dStarted = 0.0; - m_nRequesting = 0; - m_nDone = 0; - m_nQuerying = 0; - m_nActiveQueries = 0; -} - -/* -=================== -QueryThink - -=================== -*/ -void CHudServers::QueryThink( void ) -{ - request_t *p; - - if( !m_nRequesting || m_nDone ) - return; - - if( !m_nQuerying ) - return; - - if( m_nActiveQueries > MAX_QUERIES ) - return; - - // Nothing left - if( !m_pServerList ) - return; - - while( 1 ) - { - p = m_pServerList; - - // No more in list? - if( !p ) - break; - - // Move to next - m_pServerList = m_pServerList->next; - - // Setup context_id - p->context = context_id; - - // Start up query on this one - NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, 0, 2.0, &p->remote_address, ::ServerResponse ); - - // Increment active list - m_nActiveQueries++; - - // Add to active list - p->next = m_pActiveList; - m_pActiveList = p; - - // Too many active? - if( m_nActiveQueries > MAX_QUERIES ) - break; - } -} - -/* -================== -ServerListSize - -# of servers in active query and in pending to be queried lists -================== -*/ -int CHudServers::ServerListSize( void ) -{ - int c = 0; - request_t *p; - - p = m_pServerList; - while( p ) - { - c++; - p = p->next; - } - - p = m_pActiveList; - while( p ) - { - c++; - p = p->next; - } - - return c; -} - -/* -=================== -FindRequest - -Look up a request by context id -=================== -*/ -CHudServers::request_t *CHudServers::FindRequest( int context, request_t *pList ) -{ - request_t *p; - p = pList; - while( p ) - { - if( context == p->context ) - return p; - - p = p->next; - } - return NULL; -} - -/* -=================== -RemoveServerFromList - -Remote, but don't delete, item from *ppList -=================== -*/ -void CHudServers::RemoveServerFromList( request_t **ppList, request_t *item ) -{ - request_t *p, *n; - request_t *newlist = NULL; - - if( !ppList ) - return; - - p = *ppList; - while( p ) - { - n = p->next; - if( p != item ) - { - p->next = newlist; - newlist = p; - } - p = n; - } - *ppList = newlist; -} - -/* -=================== -ClearRequestList - -=================== -*/ -void CHudServers::ClearRequestList( request_t **ppList ) -{ - request_t *p, *n; - - if( !ppList ) - return; - - p = *ppList; - while( p ) - { - n = p->next; - delete p; - p = n; - } - *ppList = NULL; -} - -/* -=================== -ClearServerList - -=================== -*/ -void CHudServers::ClearServerList( server_t **ppList ) -{ - server_t *p, *n; - - if( !ppList ) - return; - - p = *ppList; - while( p ) - { - n = p->next; - delete[] p->info; - delete p; - p = n; - } - *ppList = NULL; -} - -int CompareField( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname, int iSortOrder ) -{ - const char *sz1, *sz2; - float fv1, fv2; - - sz1 = NET_API->ValueForKey( p1->info, fieldname ); - sz2 = NET_API->ValueForKey( p2->info, fieldname ); - - fv1 = atof( sz1 ); - fv2 = atof( sz2 ); - - if( fv1 && fv2 ) - { - if( fv1 > fv2 ) - return iSortOrder; - else if( fv1 < fv2 ) - return -iSortOrder; - else - return 0; - } - - // String compare - return stricmp( sz1, sz2 ); -} - -int CALLBACK ServerListCompareFunc( CHudServers::server_t *p1, CHudServers::server_t *p2, const char *fieldname ) -{ - if(!p1 || !p2) // No meaningful comparison - return 0; - - int iSortOrder = 1; - - int retval = 0; - - retval = CompareField( p1, p2, fieldname, iSortOrder ); - - return retval; -} - -static char g_fieldname[256]; -int __cdecl FnServerCompare( const void *elem1, const void *elem2 ) -{ - CHudServers::server_t *list1, *list2; - - list1 = *(CHudServers::server_t **)elem1; - list2 = *(CHudServers::server_t **)elem2; - - return ServerListCompareFunc( list1, list2, g_fieldname ); -} - -void CHudServers::SortServers( const char *fieldname ) -{ - server_t *p; - // Create a list - if( !m_pServers ) - return; - - strcpy( g_fieldname, fieldname ); - - int i; - int c = 0; - - p = m_pServers; - while( p ) - { - c++; - p = p->next; - } - - server_t **pSortArray; - - pSortArray = new server_t *[c]; - memset( pSortArray, 0, c * sizeof(server_t*) ); - - // Now copy the list into the pSortArray: - p = m_pServers; - i = 0; - while( p ) - { - pSortArray[i++] = p; - p = p->next; - } - - // Now do that actual sorting. - size_t nCount = c; - size_t nSize = sizeof(server_t*); - - qsort( - pSortArray, - (size_t)nCount, - (size_t)nSize, - FnServerCompare - ); - - // Now rebuild the list. - m_pServers = pSortArray[0]; - for( i = 0; i < c - 1; i++ ) - { - pSortArray[i]->next = pSortArray[i + 1]; - } - pSortArray[c - 1]->next = NULL; - - // Clean Up. - delete[] pSortArray; -} - -/* -=================== -GetServer - -Return particular server -=================== -*/ -CHudServers::server_t *CHudServers::GetServer( int server ) -{ - int c = 0; - server_t *p; - - p = m_pServers; - while( p ) - { - if( c == server ) - return p; - - c++; - p = p->next; - } - return NULL; -} - -/* -=================== -GetServerInfo - -Return info ( key/value ) string for particular server -=================== -*/ -char *CHudServers::GetServerInfo( int server ) -{ - server_t *p = GetServer( server ); - if( p ) - { - return p->info; - } - return NULL; -} - -/* -=================== -CancelRequest - -Kill all pending requests in engine -=================== -*/ -void CHudServers::CancelRequest( void ) -{ - m_nRequesting = 0; - m_nQuerying = 0; - m_nDone = 1; - - NET_API->CancelAllRequests(); -} - -/* -================== -LoadMasterAddresses - -Loads the master server addresses from file and into the passed in array -================== -*/ -int CHudServers::LoadMasterAddresses( int maxservers, int *count, netadr_t *padr ) -{ - int i; - char szMaster[256]; - char szMasterFile[256]; - char *pbuffer = NULL; - char *pstart = NULL ; - netadr_t adr; - char szAdr[64]; - int nPort; - int nCount = 0; - bool bIgnore; - int nDefaultPort; - - // Assume default master and master file - strcpy( szMaster, VALVE_MASTER_ADDRESS ); // IP:PORT string - strcpy( szMasterFile, MASTER_PARSE_FILE ); - - // See if there is a command line override - i = gEngfuncs.CheckParm( "-comm", &pstart ); - if( i && pstart ) - { - strcpy( szMasterFile, pstart ); - } - - // Read them in from proper file - pbuffer = (char *)gEngfuncs.COM_LoadFile( szMasterFile, 5, NULL ); // Use malloc - if( !pbuffer ) - { - goto finish_master; - } - - pstart = pbuffer; - - while( nCount < maxservers ) - { - pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); - - if( strlen( m_szToken ) <= 0) - break; - - bIgnore = true; - - if( !stricmp( m_szToken, "Master" ) ) - { - nDefaultPort = PORT_MASTER; - bIgnore = FALSE; - } - - // Now parse all addresses between { } - pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); - if( strlen( m_szToken ) <= 0 ) - break; - - if( stricmp( m_szToken, "{" ) ) - break; - - // Parse addresses until we get to "}" - while( nCount < maxservers ) - { - char base[256]; - - // Now parse all addresses between { } - pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); - - if( strlen( m_szToken ) <= 0 ) - break; - - if( !stricmp ( m_szToken, "}" ) ) - break; - - sprintf( base, "%s", m_szToken ); - - pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); - - if( strlen( m_szToken ) <= 0 ) - break; - - if( stricmp( m_szToken, ":" ) ) - break; - - pstart = gEngfuncs.COM_ParseFile( pstart, m_szToken ); - - if( strlen( m_szToken ) <= 0 ) - break; - - nPort = atoi( m_szToken ); - if( !nPort ) - nPort = nDefaultPort; - - sprintf( szAdr, "%s:%i", base, nPort ); - - // Can we resolve it any better - if( !NET_API->StringToAdr( szAdr, &adr ) ) - bIgnore = true; - - if( !bIgnore ) - { - padr[nCount++] = adr; - } - } - } -finish_master: - if( !nCount ) - { - sprintf( szMaster, VALVE_MASTER_ADDRESS ); // IP:PORT string - - // Convert to netadr_t - if( NET_API->StringToAdr( szMaster, &adr ) ) - { - padr[nCount++] = adr; - } - } - - *count = nCount; - - if( pbuffer ) - { - gEngfuncs.COM_FreeFile( pbuffer ); - } - - return ( nCount > 0 ) ? 1 : 0; -} - -/* -=================== -RequestList - -Request list of game servers from master -=================== -*/ -void CHudServers::RequestList( void ) -{ - m_nRequesting = 1; - m_nDone = 0; - m_dStarted = m_fElapsed; - - int count = 0; - netadr_t adr; - - if( !LoadMasterAddresses( 1, &count, &adr ) ) - { - gEngfuncs.Con_DPrintf( "SendRequest: Unable to read master server addresses\n" ); - return; - } - - ClearRequestList( &m_pActiveList ); - ClearRequestList( &m_pServerList ); - ClearServerList( &m_pServers ); - - m_nServerCount = 0; - - // Make sure networking system has started. - NET_API->InitNetworking(); - - // Kill off left overs if any - NET_API->CancelAllRequests(); - - // Request Server List from master - NET_API->SendRequest( context_id++, NETAPI_REQUEST_SERVERLIST, 0, 5.0, &adr, ::ListResponse ); -} - -void CHudServers::RequestBroadcastList( int clearpending ) -{ - m_nRequesting = 1; - m_nDone = 0; - m_dStarted = m_fElapsed; - - netadr_t adr = {0}; - - if( clearpending ) - { - ClearRequestList( &m_pActiveList ); - ClearRequestList( &m_pServerList ); - ClearServerList( &m_pServers ); - - m_nServerCount = 0; - } - - // Make sure to byte swap server if necessary ( using "host" to "net" conversion - adr.port = htons( PORT_SERVER ); - - // Make sure networking system has started. - NET_API->InitNetworking(); - - if( clearpending ) - { - // Kill off left overs if any - NET_API->CancelAllRequests(); - } - - adr.type = NA_BROADCAST; - - // Request Servers from LAN via IP - NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse ); - - adr.type = NA_BROADCAST_IPX; - - // Request Servers from LAN via IPX ( if supported ) - NET_API->SendRequest( context_id++, NETAPI_REQUEST_DETAILS, FNETAPI_MULTIPLE_RESPONSE, 5.0, &adr, ::ServerResponse ); -} - -void CHudServers::ServerPing( int server ) -{ - server_t *p; - - p = GetServer( server ); - if( !p ) - return; - - // Make sure networking system has started. - NET_API->InitNetworking(); - - // Request Server List from master - NET_API->SendRequest( context_id++, NETAPI_REQUEST_PING, 0, 5.0, &p->remote_address, ::PingResponse ); -} - -void CHudServers::ServerRules( int server ) -{ - server_t *p; - - p = GetServer( server ); - if( !p ) - return; - - // Make sure networking system has started. - NET_API->InitNetworking(); - - // Request Server List from master - NET_API->SendRequest( context_id++, NETAPI_REQUEST_RULES, 0, 5.0, &p->remote_address, ::RulesResponse ); -} - -void CHudServers::ServerPlayers( int server ) -{ - server_t *p; - - p = GetServer( server ); - if( !p ) - return; - - // Make sure networking system has started. - NET_API->InitNetworking(); - - // Request Server List from master - NET_API->SendRequest( context_id++, NETAPI_REQUEST_PLAYERS, 0, 5.0, &p->remote_address, ::PlayersResponse ); -} - -int CHudServers::isQuerying() -{ - return m_nRequesting ? 1 : 0; -} - -/* -=================== -GetServerCount - -Return number of servers in browser list -=================== -*/ -int CHudServers::GetServerCount( void ) -{ - return m_nServerCount; -} - -/* -=================== -CHudServers - -=================== -*/ -CHudServers::CHudServers( void ) -{ - m_nRequesting = 0; - m_dStarted = 0.0; - m_nDone = 0; - m_pServerList = NULL; - m_pServers = NULL; - m_pActiveList = NULL; - m_nQuerying = 0; - m_nActiveQueries = 0; - - m_fElapsed = 0.0; - - m_pPingRequest = NULL; - m_pRulesRequest = NULL; - m_pPlayersRequest = NULL; -} - -/* -=================== -~CHudServers - -=================== -*/ -CHudServers::~CHudServers( void ) -{ - ClearRequestList( &m_pActiveList ); - ClearRequestList( &m_pServerList ); - ClearServerList( &m_pServers ); - - m_nServerCount = 0; - - if( m_pPingRequest ) - { - delete m_pPingRequest; - m_pPingRequest = NULL; - } - - if( m_pRulesRequest ) - { - delete m_pRulesRequest; - m_pRulesRequest = NULL; - } - - if( m_pPlayersRequest ) - { - delete m_pPlayersRequest; - m_pPlayersRequest = NULL; - } -} - -/////////////////////////////// -// -// PUBLIC APIs -// -/////////////////////////////// - -/* -=================== -ServersGetCount - -=================== -*/ -int ServersGetCount( void ) -{ - if( g_pServers ) - { - return g_pServers->GetServerCount(); - } - return 0; -} - -int ServersIsQuerying( void ) -{ - if( g_pServers ) - { - return g_pServers->isQuerying(); - } - return 0; -} - -/* -=================== -ServersGetInfo - -=================== -*/ -const char *ServersGetInfo( int server ) -{ - if( g_pServers ) - { - return g_pServers->GetServerInfo( server ); - } - - return NULL; -} - -void SortServers( const char *fieldname ) -{ - if( g_pServers ) - { - g_pServers->SortServers( fieldname ); - } -} - -/* -=================== -ServersShutdown - -=================== -*/ -void ServersShutdown( void ) -{ - if( g_pServers ) - { - delete g_pServers; - g_pServers = NULL; - } -} - -/* -=================== -ServersInit - -=================== -*/ -void ServersInit( void ) -{ - // Kill any previous instance - ServersShutdown(); - - g_pServers = new CHudServers(); -} - -/* -=================== -ServersThink - -=================== -*/ -void ServersThink( double time ) -{ - if( g_pServers ) - { - g_pServers->Think( time ); - } -} - -/* -=================== -ServersCancel - -=================== -*/ -void ServersCancel( void ) -{ - if( g_pServers ) - { - g_pServers->CancelRequest(); - } -} - -// Requests -/* -=================== -ServersList - -=================== -*/ -void ServersList( void ) -{ - if( g_pServers ) - { - g_pServers->RequestList(); - } -} - -void BroadcastServersList( int clearpending ) -{ - if( g_pServers ) - { - g_pServers->RequestBroadcastList( clearpending ); - } -} - -void ServerPing( int server ) -{ - if( g_pServers ) - { - g_pServers->ServerPing( server ); - } -} - -void ServerRules( int server ) -{ - if( g_pServers ) - { - g_pServers->ServerRules( server ); - } -} - -void ServerPlayers( int server ) -{ - if( g_pServers ) - { - g_pServers->ServerPlayers( server ); - } -} diff --git a/cl_dll/hud_servers.h b/cl_dll/hud_servers.h deleted file mode 100644 index 5e886560..00000000 --- a/cl_dll/hud_servers.h +++ /dev/null @@ -1,40 +0,0 @@ -//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#if !defined( HUD_SERVERSH ) -#define HUD_SERVERSH -#pragma once - -#define NET_CALLBACK /* */ - -// Dispatchers -void NET_CALLBACK ListResponse( struct net_response_s *response ); -void NET_CALLBACK ServerResponse( struct net_response_s *response ); -void NET_CALLBACK PingResponse( struct net_response_s *response ); -void NET_CALLBACK RulesResponse( struct net_response_s *response ); -void NET_CALLBACK PlayersResponse( struct net_response_s *response ); - -void ServersInit( void ); -void ServersShutdown( void ); -void ServersThink( double time ); -void ServersCancel( void ); - -// Get list and get server info from each -void ServersList( void ); - -// Query for IP / IPX LAN servers -void BroadcastServersList( int clearpending ); - -void ServerPing( int server ); -void ServerRules( int server ); -void ServerPlayers( int server ); - -int ServersGetCount( void ); -const char *ServersGetInfo( int server ); -int ServersIsQuerying( void ); -void SortServers( const char *fieldname ); -#endif // HUD_SERVERSH diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 7cb8e1fe..bfd8112b 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -9,6 +9,10 @@ #include "cl_util.h" #include "cl_entity.h" #include "triangleapi.h" +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#include "vgui_SpectatorPanel.h" +#endif #include "hltv.h" #include "pm_shared.h" @@ -76,8 +80,16 @@ void SpectatorSpray( void ) gEngfuncs.pfnServerCmd( string ); } } + void SpectatorHelp( void ) { +#if USE_VGUI + if( gViewPort ) + { + gViewPort->ShowVGUIMenu( MENU_SPECHELP ); + } + else +#endif { char *text = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" ); @@ -100,10 +112,33 @@ void SpectatorMenu( void ) gEngfuncs.Con_Printf( "usage: spec_menu <0|1>\n" ); return; } + +#if USE_VGUI + gViewPort->m_pSpectatorPanel->ShowMenu( atoi( gEngfuncs.Cmd_Argv( 1 ) ) != 0 ); +#endif } void ToggleScores( void ) { +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD + if( gViewPort ) + { + if( gViewPort->IsScoreBoardVisible() ) + { + gViewPort->HideScoreBoard(); + } + else + { + gViewPort->ShowScoreBoard(); + } + } +#else + if (gHUD.m_Scoreboard.m_iShowscoresHeld) { + gHUD.m_Scoreboard.UserCmd_HideScores(); + } else { + gHUD.m_Scoreboard.UserCmd_ShowScores(); + } +#endif } //----------------------------------------------------------------------------- @@ -392,8 +427,7 @@ int CHudSpectator::Draw( float flTime ) return 1; // make sure we have player info - //gViewPort->GetAllPlayersInfo(); - gHUD.m_Scoreboard.GetAllPlayersInfo(); + gHUD.GetAllPlayersInfo(); // loop through all the players and draw additional infos to their sprites on the map for( int i = 0; i < MAX_PLAYERS; i++ ) @@ -529,9 +563,16 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) READ_LONG(); // total number of spectator slots m_iSpectatorNumber = READ_LONG(); // total number of spectator READ_WORD(); // total number of relay proxies +#if USE_VGUI + gViewPort->UpdateSpectatorPanel(); +#endif break; case DRC_CMD_BANNER: // gEngfuncs.Con_DPrintf( "GUI: Banner %s\n",READ_STRING() ); // name of banner tga eg gfx/temp/7454562234563475.tga +#if USE_VGUI + gViewPort->m_pSpectatorPanel->m_TopBanner->LoadImage( READ_STRING() ); + gViewPort->UpdateSpectatorPanel(); +#endif break; case DRC_CMD_FADE: break; @@ -573,8 +614,7 @@ void CHudSpectator::FindNextPlayer( bool bReverse ) int iDir = bReverse ? -1 : 1; // make sure we have player info - //gViewPort->GetAllPlayersInfo(); - gHUD.m_Scoreboard.GetAllPlayersInfo(); + gHUD.GetAllPlayersInfo(); do { @@ -611,6 +651,68 @@ void CHudSpectator::FindNextPlayer( bool bReverse ) VectorCopy( pEnt->angles, vJumpAngles ); } iJumpSpectator = 1; +#if USE_VGUI + gViewPort->MsgFunc_ResetFade( NULL, 0, NULL ); +#endif +} + +void CHudSpectator::FindPlayer(const char *name) +{ + // MOD AUTHORS: Modify the logic of this function if you want to restrict the observer to watching + // only a subset of the players. e.g. Make it check the target's team. + + // if we are NOT in HLTV mode, spectator targets are set on server + if ( !gEngfuncs.IsSpectateOnly() ) + { + char cmdstring[32]; + // forward command to server + sprintf(cmdstring,"follow %s",name); + gEngfuncs.pfnServerCmd(cmdstring); + return; + } + + g_iUser2 = 0; + + // make sure we have player info + gHUD.GetAllPlayersInfo(); + + cl_entity_t * pEnt = NULL; + + for (int i = 1; i < MAX_PLAYERS; i++ ) + { + + pEnt = gEngfuncs.GetEntityByIndex( i ); + + if ( !IsActivePlayer( pEnt ) ) + continue; + + if(!stricmp(g_PlayerInfoList[pEnt->index].name,name)) + { + g_iUser2 = i; + break; + } + + } + + // Did we find a target? + if ( !g_iUser2 ) + { + gEngfuncs.Con_DPrintf( "No observer targets.\n" ); + // take save camera position + VectorCopy(m_cameraOrigin, vJumpOrigin); + VectorCopy(m_cameraAngles, vJumpAngles); + } + else + { + // use new entity position for roaming + VectorCopy ( pEnt->origin, vJumpOrigin ); + VectorCopy ( pEnt->angles, vJumpAngles ); + } + + iJumpSpectator = 1; +#if USE_VGUI + gViewPort->MsgFunc_ResetFade( NULL, 0, NULL ); +#endif } void CHudSpectator::HandleButtonsDown( int ButtonPressed ) @@ -622,6 +724,11 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed ) // gEngfuncs.Con_Printf( " HandleButtons:%i\n", ButtonPressed ); +#if USE_VGUI + if( !gViewPort ) + return; +#endif + //Not in intermission. if( gHUD.m_iIntermission ) return; @@ -637,8 +744,10 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed ) return; // enable spectator screen - //if( ButtonPressed & IN_DUCK ) - // gViewPort->m_pSpectatorPanel->ShowMenu( !gViewPort->m_pSpectatorPanel->m_menuVisible ); +#if USE_VGUI + if( ButtonPressed & IN_DUCK ) + gViewPort->m_pSpectatorPanel->ShowMenu( !gViewPort->m_pSpectatorPanel->m_menuVisible ); +#endif // 'Use' changes inset window mode if( ButtonPressed & IN_USE ) @@ -705,6 +814,14 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed ) void CHudSpectator::HandleButtonsUp( int ButtonPressed ) { +#if USE_VGUI + if( !gViewPort ) + return; + + if( !gViewPort->m_pSpectatorPanel->isVisible() ) + return; // dont do anything if not in spectator mode +#endif + if( ButtonPressed & ( IN_FORWARD | IN_BACK ) ) m_zoomDelta = 0.0f; @@ -800,12 +917,19 @@ void CHudSpectator::SetModes( int iNewMainMode, int iNewInsetMode ) SetCrosshair( 0, m_crosshairRect, 0, 0, 0 ); } +#if USE_VGUI + gViewPort->MsgFunc_ResetFade( NULL, 0, NULL ); +#endif + char string[128]; sprintf( string, "#Spec_Mode%d", g_iUser1 ); sprintf( string, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( string ) ); gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( string ) + 1, string ); } +#if USE_VGUI + gViewPort->UpdateSpectatorPanel(); +#endif } bool CHudSpectator::IsActivePlayer( cl_entity_t *ent ) @@ -1454,6 +1578,9 @@ void CHudSpectator::CheckSettings() m_pip->value = INSET_OFF; // draw small border around inset view, adjust upper black bar +#if USE_VGUI + gViewPort->m_pSpectatorPanel->EnableInsetView( m_pip->value != INSET_OFF ); +#endif } int CHudSpectator::ToggleInset( bool allowOff ) diff --git a/cl_dll/hud_spectator.h b/cl_dll/hud_spectator.h index d7187d49..800928e0 100644 --- a/cl_dll/hud_spectator.h +++ b/cl_dll/hud_spectator.h @@ -73,6 +73,7 @@ public: void HandleButtonsDown( int ButtonPressed ); void HandleButtonsUp( int ButtonPressed ); void FindNextPlayer( bool bReverse ); + void FindPlayer(const char *name); void DirectorMessage( int iSize, void *pbuf ); void SetSpectatorStartPosition(); int Init(); diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index 881f0c3c..ac68be5e 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -15,6 +15,22 @@ #include "camera.h" #include "in_defs.h" +#if _WIN32 +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define WIN32_EXTRA_LEAN +#define HSPRITE WINDOWS_HSPRITE +#include +#undef HSPRITE +#else +typedef struct point_s +{ + int x; + int y; +} POINT; +#define GetCursorPos(x) +#define SetCursorPos(x,y) +#endif + float CL_KeyState( kbutton_t *key ); extern "C" diff --git a/cl_dll/in_defs.h b/cl_dll/in_defs.h index 7221c356..0b6cca8b 100644 --- a/cl_dll/in_defs.h +++ b/cl_dll/in_defs.h @@ -16,17 +16,4 @@ // fall over #define ROLL 2 -#if _WIN32 -#define HSPRITE HSPRITE_win32 -#include -#undef HSPRITE -#else -typedef struct point_s -{ - int x; - int y; -} POINT; -#define GetCursorPos(x) -#define SetCursorPos(x,y) -#endif #endif diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index 76659a94..d0267f9b 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -28,6 +28,10 @@ extern "C" #include #include +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + extern "C" { struct kbutton_s DLLEXPORT *KB_Find( const char *name ); @@ -645,13 +649,27 @@ void IN_Impulse( void ) void IN_ScoreDown( void ) { KeyDown( &in_score ); +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD + if ( gViewPort ) + { + gViewPort->ShowScoreBoard(); + } +#else gHUD.m_Scoreboard.UserCmd_ShowScores(); +#endif } void IN_ScoreUp( void ) { KeyUp( &in_score ); +#if USE_VGUI && !USE_NOVGUI_SCOREBOARD + if ( gViewPort ) + { + gViewPort->HideScoreBoard(); + } +#else gHUD.m_Scoreboard.UserCmd_HideScores(); +#endif } void IN_MLookUp( void ) @@ -849,6 +867,12 @@ void DLLEXPORT CL_CreateMove( float frametime, struct usercmd_s *cmd, int active // cmd->buttons = CL_ButtonBits( 1 ); +#if USE_VGUI + // If they're in a modal dialog, ignore the attack button. + if(GetClientVoiceMgr()->IsInSquelchMode()) + cmd->buttons &= ~IN_ATTACK; +#endif + // Using joystick? if( in_joystick->value ) { @@ -903,9 +927,11 @@ int CL_ButtonBits( int bResetState ) if( in_attack.state & 3 ) { +#if !USE_VGUI || USE_NOVGUI_MOTD if( gHUD.m_MOTD.m_bShow ) gHUD.m_MOTD.Reset(); else +#endif bits |= IN_ATTACK; } diff --git a/cl_dll/input_mouse.h b/cl_dll/input_mouse.h index f8e2c631..0ecd8147 100644 --- a/cl_dll/input_mouse.h +++ b/cl_dll/input_mouse.h @@ -47,6 +47,21 @@ protected: // No need for goldsource input support on the platforms that are not supported by GoldSource. #if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) #define SUPPORT_GOLDSOURCE_INPUT 1 + +#if _WIN32 +#define HSPRITE WINDOWS_HSPRITE +#include +#undef HSPRITE +#else +typedef struct point_s +{ + int x; + int y; +} POINT; +#define GetCursorPos(x) +#define SetCursorPos(x,y) +#endif + class GoldSourceInput : public AbstractInput { public: diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index 2be1ffb3..ba5b14fd 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -187,9 +187,11 @@ void FWGSInput::IN_Move( float frametime, usercmd_t *cmd ) viewangles[YAW] -= ac_sidemove * 5; ac_sidemove = 0; } +#if !USE_VGUI || USE_NOVGUI_MOTD if( gHUD.m_MOTD.m_bShow ) gHUD.m_MOTD.scroll += rel_pitch; else +#endif viewangles[PITCH] += rel_pitch; if( viewangles[PITCH] > cl_pitchdown->value ) diff --git a/cl_dll/menu.cpp b/cl_dll/menu.cpp index fc24b917..e9166979 100644 --- a/cl_dll/menu.cpp +++ b/cl_dll/menu.cpp @@ -24,6 +24,10 @@ #include #include +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + #define MAX_MENU_STRING 512 char g_szMenuString[MAX_MENU_STRING]; char g_szPrelocalisedMenuString[MAX_MENU_STRING]; @@ -78,6 +82,11 @@ int CHudMenu::Draw( float flTime ) } // don't draw the menu if the scoreboard is being shown +#if USE_VGUI + if( gViewPort && gViewPort->IsScoreBoardVisible() ) + return 1; +#endif + // draw the menu, along the left-hand side of the screen // count the number of newlines int nlc = 0; diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index bf8eca80..d7a7dd98 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -25,6 +25,10 @@ #include #include +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + extern float *GetClientColor( int clientIndex ); #define MAX_LINES 5 @@ -95,6 +99,12 @@ int CHudSayText::Draw( float flTime ) { int y = Y_START; +#if USE_VGUI + if( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) || !m_HUD_saytext->value ) + return 1; +#endif + + // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset flScrollTime = Q_min( flScrollTime, flTime + m_HUD_saytext_time->value ); @@ -156,9 +166,18 @@ int CHudSayText::MsgFunc_SayText( const char *pszName, int iSize, void *pbuf ) void CHudSayText::SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex ) { - int i; +#if USE_VGUI + if( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) + { + // Print it straight to the console + ConsolePrint( pszBuf ); + return; + } +#else ConsolePrint( pszBuf ); +#endif + int i; // find an empty string slot for( i = 0; i < MAX_LINES; i++ ) { diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index b5b2ae31..2b8d7d20 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -28,23 +28,20 @@ cvar_t *cl_scoreboard_bg; cvar_t *cl_showpacketloss; -hud_player_info_t g_PlayerInfoList[MAX_PLAYERS + 1]; // player info from the engine -extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS + 1]; // additional player info sent directly to the client dll -team_info_t g_TeamInfo[MAX_TEAMS + 1]; -int g_iUser1; -int g_iUser2; -int g_iUser3; -int g_iTeamNumber; -int g_iPlayerClass; -//#include "vgui_TeamFortressViewport.h" + +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif DECLARE_COMMAND( m_Scoreboard, ShowScores ) DECLARE_COMMAND( m_Scoreboard, HideScores ) +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD DECLARE_MESSAGE( m_Scoreboard, ScoreInfo ) DECLARE_MESSAGE( m_Scoreboard, TeamInfo ) DECLARE_MESSAGE( m_Scoreboard, TeamScore ) +#endif int CHudScoreboard::Init( void ) { @@ -54,9 +51,11 @@ int CHudScoreboard::Init( void ) // HOOK_COMMAND( "+showscores", ShowScores ); // HOOK_COMMAND( "-showscores", HideScores ); +#if !USE_VGUI || USE_NOVGUI_SCOREBOARD HOOK_MESSAGE( ScoreInfo ); HOOK_MESSAGE( TeamScore ); HOOK_MESSAGE( TeamInfo ); +#endif InitHUDData(); @@ -502,7 +501,9 @@ int CHudScoreboard::MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbu g_PlayerExtraInfo[cl].playerclass = playerclass; g_PlayerExtraInfo[cl].teamnumber = teamnumber; - //gViewPort->UpdateOnPlayerInfo(); +#if USE_VGUI + gViewPort->UpdateOnPlayerInfo(); +#endif } return 1; diff --git a/cl_dll/text_message.cpp b/cl_dll/text_message.cpp index daeacf3f..9f1a55ad 100644 --- a/cl_dll/text_message.cpp +++ b/cl_dll/text_message.cpp @@ -26,6 +26,10 @@ #include #include "parsemsg.h" +#if USE_VGUI +#include "vgui_TeamFortressViewport.h" +#endif + DECLARE_MESSAGE( m_TextMessage, TextMsg ) int CHudTextMessage::Init( void ) @@ -178,6 +182,11 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf char *psz = szBuf[5]; +#if USE_VGUI + if( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) + return 1; +#endif + switch( msg_dest ) { case HUD_PRINTCENTER: diff --git a/cl_dll/vgui_ClassMenu.cpp b/cl_dll/vgui_ClassMenu.cpp new file mode 100644 index 00000000..568ed98c --- /dev/null +++ b/cl_dll/vgui_ClassMenu.cpp @@ -0,0 +1,436 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: TFC Class Menu +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" + +// Class Menu Dimensions +#define CLASSMENU_TITLE_X XRES(40) +#define CLASSMENU_TITLE_Y YRES(32) +#define CLASSMENU_TOPLEFT_BUTTON_X XRES(40) +#define CLASSMENU_TOPLEFT_BUTTON_Y YRES(80) +#define CLASSMENU_BUTTON_SIZE_X XRES(124) +#define CLASSMENU_BUTTON_SIZE_Y YRES(24) +#define CLASSMENU_BUTTON_SPACER_Y YRES(8) +#define CLASSMENU_WINDOW_X XRES(176) +#define CLASSMENU_WINDOW_Y YRES(80) +#define CLASSMENU_WINDOW_SIZE_X XRES(424) +#define CLASSMENU_WINDOW_SIZE_Y YRES(312) +#define CLASSMENU_WINDOW_TEXT_X XRES(150) +#define CLASSMENU_WINDOW_TEXT_Y YRES(80) +#define CLASSMENU_WINDOW_NAME_X XRES(150) +#define CLASSMENU_WINDOW_NAME_Y YRES(8) +#define CLASSMENU_WINDOW_PLAYERS_Y YRES(42) + +// Creation +CClassMenuPanel::CClassMenuPanel( int iTrans, int iRemoveMe, int x, int y, int wide, int tall ) : CMenuPanel( iTrans, iRemoveMe, x, y, wide, tall ) +{ + // don't show class graphics at below 640x480 resolution + bool bShowClassGraphic = true; + if( ScreenWidth < 640 ) + { + bShowClassGraphic = false; + } + + memset( m_pClassImages, 0, sizeof(m_pClassImages) ); + + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hClassWindowText = pSchemes->getSchemeHandle( "Briefing Text" ); + + // color schemes + int r, g, b, a; + + // Create the title + Label *pLabel = new Label( "", CLASSMENU_TITLE_X, CLASSMENU_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pSchemes->getFont( hTitleScheme ) ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText(gHUD.m_TextMessage.BufferedLocaliseTextString( "#Title_SelectYourClass" ) ); + + // Create the Scroll panel + m_pScrollPanel = new CTFScrollPanel( CLASSMENU_WINDOW_X, CLASSMENU_WINDOW_Y, CLASSMENU_WINDOW_SIZE_X, CLASSMENU_WINDOW_SIZE_Y ); + m_pScrollPanel->setParent( this ); + //force the scrollbars on, so after the validate clientClip will be smaller + m_pScrollPanel->setScrollBarAutoVisible( false, false ); + m_pScrollPanel->setScrollBarVisible( true, true ); + m_pScrollPanel->setBorder( new LineBorder( Color( 255 * 0.7, 170 * 0.7, 0, 0 ) ) ); + m_pScrollPanel->validate(); + + int clientWide=m_pScrollPanel->getClient()->getWide(); + + //turn scrollpanel back into auto show scrollbar mode and validate + m_pScrollPanel->setScrollBarAutoVisible( false, true ); + m_pScrollPanel->setScrollBarVisible( false, false ); + m_pScrollPanel->validate(); + + // Create the Class buttons +#ifdef _TFC + for( int i = 0; i <= PC_RANDOM; i++ ) + { + char sz[256]; + int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y + ( ( CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y ) * i ); + + ActionSignal *pASignal = new CMenuHandler_StringCommandClassSelect( sTFClassSelection[i], true ); + + // Class button + sprintf( sz, "%s", CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ) ); + m_pButtons[i] = new ClassButton( i, sz, CLASSMENU_TOPLEFT_BUTTON_X, iYPos, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y, true ); + + // RandomPC uses '0' + if( i >= 1 && i <= 9 ) + { + sprintf( sz, "%d", i ); + } + else + { + strcpy( sz, "0" ); + } + m_pButtons[i]->setBoundKey( sz[0] ); + m_pButtons[i]->setContentAlignment( vgui::Label::a_west ); + m_pButtons[i]->addActionSignal( pASignal ); + m_pButtons[i]->addInputSignal( new CHandler_MenuButtonOver(this, i) ); + m_pButtons[i]->setParent( this ); + + // Create the Class Info Window + // m_pClassInfoPanel[i] = new CTransparentPanel( 255, CLASSMENU_WINDOW_X, CLASSMENU_WINDOW_Y, CLASSMENU_WINDOW_SIZE_X, CLASSMENU_WINDOW_SIZE_Y ); + m_pClassInfoPanel[i] = new CTransparentPanel( 255, 0, 0, clientWide, CLASSMENU_WINDOW_SIZE_Y ); + m_pClassInfoPanel[i]->setParent( m_pScrollPanel->getClient() ); + // m_pClassInfoPanel[i]->setVisible( false ); + + // don't show class pic in lower resolutions + int textOffs = XRES( 8 ); + + if( bShowClassGraphic ) + { + textOffs = CLASSMENU_WINDOW_NAME_X; + } + + // Create the Class Name Label + sprintf( sz, "#Title_%s", sTFClassSelection[i] ); + char *localName=CHudTextMessage::BufferedLocaliseTextString( sz ); + Label *pNameLabel = new Label( "", textOffs, CLASSMENU_WINDOW_NAME_Y ); + pNameLabel->setFont( pSchemes->getFont( hTitleScheme ) ); + pNameLabel->setParent( m_pClassInfoPanel[i] ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pNameLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pNameLabel->setBgColor( r, g, b, a ); + pNameLabel->setContentAlignment( vgui::Label::a_west ); + // pNameLabel->setBorder( new LineBorder() ); + pNameLabel->setText( "%s", localName); + + // Create the Class Image + if( bShowClassGraphic ) + { + for( int team = 0; team < 2; team++ ) + { + if( team == 1 ) + { + sprintf( sz, "%sred", sTFClassSelection[i] ); + } + else + { + sprintf( sz, "%sblue", sTFClassSelection[i] ); + } + + m_pClassImages[team][i] = new CImageLabel( sz, 0, 0, CLASSMENU_WINDOW_TEXT_X, CLASSMENU_WINDOW_TEXT_Y ); + + CImageLabel *pLabel = m_pClassImages[team][i]; + pLabel->setParent( m_pClassInfoPanel[i] ); + // pLabel->setBorder( new LineBorder() ); + + if( team != 1 ) + { + pLabel->setVisible( false ); + } + + // Reposition it based upon it's size + int xOut, yOut; + pNameLabel->getTextSize( xOut, yOut ); + pLabel->setPos( ( CLASSMENU_WINDOW_TEXT_X - pLabel->getWide() ) / 2, yOut / 2 ); + } + } + + // Create the Player count string + gHUD.m_TextMessage.LocaliseTextString( "#Title_CurrentlyOnYourTeam", m_sPlayersOnTeamString, STRLENMAX_PLAYERSONTEAM ); + m_pPlayers[i] = new Label( "", textOffs, CLASSMENU_WINDOW_PLAYERS_Y ); + m_pPlayers[i]->setParent( m_pClassInfoPanel[i] ); + m_pPlayers[i]->setBgColor( 0, 0, 0, 255 ); + m_pPlayers[i]->setContentAlignment( vgui::Label::a_west ); + m_pPlayers[i]->setFont( pSchemes->getFont( hClassWindowText ) ); + + // Open up the Class Briefing File + sprintf(sz, "classes/short_%s.txt", sTFClassSelection[i]); + char *cText = "Class Description not available."; + char *pfile = (char *)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if( pfile ) + { + cText = pfile; + } + + // Create the Text info window + TextPanel *pTextWindow = new TextPanel( cText, textOffs, CLASSMENU_WINDOW_TEXT_Y, ( CLASSMENU_WINDOW_SIZE_X - textOffs ) - 5, CLASSMENU_WINDOW_SIZE_Y - CLASSMENU_WINDOW_TEXT_Y ); + pTextWindow->setParent( m_pClassInfoPanel[i] ); + pTextWindow->setFont( pSchemes->getFont( hClassWindowText ) ); + pSchemes->getFgColor( hClassWindowText, r, g, b, a ); + pTextWindow->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hClassWindowText, r, g, b, a ); + pTextWindow->setBgColor( r, g, b, a ); + + // Resize the Info panel to fit it all + int wide,tall; + pTextWindow->getTextImage()->getTextSizeWrapped( wide, tall ); + pTextWindow->setSize( wide, tall ); + + int xx, yy; + pTextWindow->getPos( xx, yy ); + int maxX = xx + wide; + int maxY = yy + tall; + + //check to see if the image goes lower than the text + //just use the red teams [0] images + if( m_pClassImages[0][i] != null ) + { + m_pClassImages[0][i]->getPos( xx, yy ); + if( ( yy + m_pClassImages[0][i]->getTall() ) > maxY ) + { + maxY = yy + m_pClassImages[0][i]->getTall(); + } + } + + m_pClassInfoPanel[i]->setSize( maxX , maxY ); + if( pfile ) + gEngfuncs.COM_FreeFile( pfile ); + // m_pClassInfoPanel[i]->setBorder( new LineBorder() ); + } +#endif + // Create the Cancel button + m_pCancelButton = new CommandButton( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Menu_Cancel" ), CLASSMENU_TOPLEFT_BUTTON_X, 0, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y ); + m_pCancelButton->setParent( this ); + m_pCancelButton->addActionSignal( new CMenuHandler_TextWindow( HIDE_TEXTWINDOW ) ); + + m_iCurrentInfo = 0; +} + +// Update +void CClassMenuPanel::Update() +{ + // Don't allow the player to join a team if they're not in a team + if( !g_iTeamNumber ) + return; + + int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y; + + // Cycle through the rest of the buttons +#ifdef _TFC + for( int i = 0; i <= PC_RANDOM; i++ ) + { + bool bCivilian = ( gViewPort->GetValidClasses( g_iTeamNumber ) == -1 ); + + if( bCivilian ) + { + // If this team can only be civilians, only the civilian button's visible + if( i == 0 ) + { + m_pButtons[0]->setVisible( true ); + SetActiveInfo( 0 ); + iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; + } + else + { + m_pButtons[i]->setVisible( false ); + } + } + else + { + if( m_pButtons[i]->IsNotValid() || i == 0 ) + { + m_pButtons[i]->setVisible( false ); + } + else + { + m_pButtons[i]->setVisible( true ); + m_pButtons[i]->setPos( CLASSMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; + + // Start with the first option up + if( !m_iCurrentInfo ) + SetActiveInfo( i ); + } + } + + // Now count the number of teammembers of this class + int iTotal = 0; + for( int j = 1; j < MAX_PLAYERS; j++ ) + { + if( g_PlayerInfoList[j].name == 0 ) + continue; // empty player slot, skip + if( g_PlayerExtraInfo[j].teamname[0] == 0 ) + continue; // skip over players who are not in a team + if( g_PlayerInfoList[j].thisplayer ) + continue; // skip this player + if( g_PlayerExtraInfo[j].teamnumber != g_iTeamNumber ) + continue; // skip over players in other teams + + // If this team is forced to be civilians, just count the number of teammates + if( g_PlayerExtraInfo[j].playerclass != i && !bCivilian ) + continue; + + iTotal++; + } + + char sz[256]; + sprintf( sz, m_sPlayersOnTeamString, iTotal ); + m_pPlayers[i]->setText( "%s", sz ); + + // Set the text color to the teamcolor + m_pPlayers[i]->setFgColor( iTeamColors[g_iTeamNumber % iNumberOfTeamColors][0], + iTeamColors[g_iTeamNumber % iNumberOfTeamColors][1], + iTeamColors[g_iTeamNumber % iNumberOfTeamColors][2], + 0 ); + + // set the graphic to be the team pick + for( int team = 0; team < MAX_TEAMS; team++ ) + { + // unset all the other images + if( m_pClassImages[team][i] ) + { + m_pClassImages[team][i]->setVisible( false ); + } + + // set the current team image + if( m_pClassImages[g_iTeamNumber - 1][i] != 0 ) + { + m_pClassImages[g_iTeamNumber - 1][i]->setVisible( true ); + } + else if( m_pClassImages[0][i] ) + { + m_pClassImages[0][i]->setVisible( true ); + } + } + } +#endif + + // If the player already has a class, make the cancel button visible + if( g_iPlayerClass ) + { + m_pCancelButton->setPos( CLASSMENU_TOPLEFT_BUTTON_X, iYPos ); + m_pCancelButton->setVisible( true ); + } + else + { + m_pCancelButton->setVisible( false ); + } +} + +//====================================== +// Key inputs for the Class Menu +bool CClassMenuPanel::SlotInput( int iSlot ) +{ + if( ( iSlot < 0 ) || ( iSlot > 9 ) ) + return false; + + if( !m_pButtons[iSlot] ) + return false; + + // Is the button pushable? (0 is special case) + if( iSlot == 0 ) + { + // Selects Civilian and RandomPC + if( gViewPort->GetValidClasses( g_iTeamNumber ) == -1 ) + { + m_pButtons[0]->fireActionSignal(); + return true; + } + + // Select RandomPC + iSlot = 10; + } + + if( !( m_pButtons[iSlot]->IsNotValid() ) ) + { + m_pButtons[iSlot]->fireActionSignal(); + return true; + } + + return false; +} + +//====================================== +// Update the Class menu before opening it +void CClassMenuPanel::Open( void ) +{ + Update(); + CMenuPanel::Open(); +} + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void CClassMenuPanel::Initialize( void ) +{ + setVisible( false ); + m_pScrollPanel->setScrollValue( 0, 0 ); +} + +//====================================== +// Mouse is over a class button, bring up the class info +void CClassMenuPanel::SetActiveInfo( int iInput ) +{ + // Remove all the Info panels and bring up the specified one +#ifdef _TFC + for( int i = 0; i <= PC_RANDOM; i++ ) + { + m_pButtons[i]->setArmed( false ); + m_pClassInfoPanel[i]->setVisible( false ); + } + + if( iInput > PC_RANDOM || iInput < 0 ) +#endif + iInput = 0; + + m_pButtons[iInput]->setArmed( true ); + m_pClassInfoPanel[iInput]->setVisible( true ); + m_iCurrentInfo = iInput; + + m_pScrollPanel->setScrollValue( 0, 0 ); + m_pScrollPanel->validate(); +} + diff --git a/cl_dll/vgui_ConsolePanel.cpp b/cl_dll/vgui_ConsolePanel.cpp new file mode 100644 index 00000000..ca33636a --- /dev/null +++ b/cl_dll/vgui_ConsolePanel.cpp @@ -0,0 +1,97 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include "vgui_ConsolePanel.h" +#include "hud.h" +#include +#include +#include +#include +#include + +using namespace vgui; + +namespace +{ + +class Handler : public ActionSignal +{ +private: + + ConsolePanel *_consolePanel; + +public: + + Handler( ConsolePanel *consolePanel ) + { + _consolePanel = consolePanel; + } + +public: + + virtual void actionPerformed( Panel *panel ) + { + _consolePanel->doExecCommand(); + } +}; + +} + +ConsolePanel::ConsolePanel( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) +{ + setBorder( new EtchedBorder() ); + + _textGrid = new TextGrid( 80, 21, 5, 5, 200, 100 ); + _textGrid->setBorder( new LoweredBorder() ); + _textGrid->setParent( this ); + + _textEntry=new TextEntry( "", 5, 5, 200, 20 ); + _textEntry->setParent( this ); + _textEntry->addActionSignal( new Handler( this ) ); +} + +int ConsolePanel::print( const char *text ) +{ + return _textGrid->printf( "%s", text ); +} + +int ConsolePanel::vprintf( const char *format, va_list argList ) +{ + return _textGrid->vprintf( format, argList ); +} + +int ConsolePanel::printf( const char* format, ... ) +{ + va_list argList; + va_start( argList, format ); + int ret = vprintf( format, argList ); + va_end( argList ); + return ret; +} + +void ConsolePanel::doExecCommand() +{ + char buf[2048]; + _textEntry->getText( 0, buf, sizeof buf ); + _textEntry->setText( null, 0 ); + gEngfuncs.pfnClientCmd( buf ); +} + +void ConsolePanel::setSize( int wide, int tall ) +{ + Panel::setSize( wide, tall ); + + getPaintSize( wide, tall ); + + _textGrid->setBounds( 5, 5, wide - 10, tall - 35 ); + _textEntry->setBounds( 5, tall - 25, wide - 10, 20 ); +} + + + + + diff --git a/cl_dll/vgui_ConsolePanel.h b/cl_dll/vgui_ConsolePanel.h new file mode 100644 index 00000000..cc255a73 --- /dev/null +++ b/cl_dll/vgui_ConsolePanel.h @@ -0,0 +1,37 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef CONSOLEPANEL_H +#define CONSOLEPANEL_H + +#include +#include + +namespace vgui +{ + class TextGrid; + class TextEntry; +} + +class ConsolePanel : public vgui::Panel +{ +private: + vgui::TextGrid *_textGrid; + vgui::TextEntry *_textEntry; +public: + ConsolePanel( int x, int y, int wide, int tall ); +public: + virtual void setSize( int wide, int tall ); + virtual int print( const char *text ); + virtual int vprintf( const char *format, va_list argList ); + virtual int printf( const char *format, ... ); + virtual void doExecCommand(); +}; + + + +#endif diff --git a/cl_dll/vgui_ControlConfigPanel.cpp b/cl_dll/vgui_ControlConfigPanel.cpp new file mode 100644 index 00000000..dbef1a3f --- /dev/null +++ b/cl_dll/vgui_ControlConfigPanel.cpp @@ -0,0 +1,216 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include +#include "vgui_ControlConfigPanel.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace vgui; + +namespace +{ +class FooTablePanel : public TablePanel +{ +private: + Label *_label; + TextEntry *_textEntry; + ControlConfigPanel *_controlConfigPanel; +public: + FooTablePanel( ControlConfigPanel *controlConfigPanel, int x, int y, int wide, int tall, int columnCount ) : TablePanel( x, y, wide, tall, columnCount ) + { + _controlConfigPanel = controlConfigPanel; + _label = new Label( "You are a dumb monkey", 0, 0, 100, 20 ); + _label->setBgColor( Scheme::sc_primary3 ); + _label->setFgColor( Scheme::sc_primary1 ); + _label->setFont( Scheme::sf_primary3 ); + + _textEntry=new TextEntry( "", 0, 0, 100, 20 ); + // _textEntry->setFont( Scheme::sf_primary3 ); + } +public: + virtual int getRowCount() + { + return _controlConfigPanel->GetCVarCount(); + } + + virtual int getCellTall( int row ) + { + return 12; + } + + virtual Panel *getCellRenderer( int column, int row,bool columnSelected, bool rowSelected, bool cellSelected ) + { + char cvar[128], desc[128], bind[128], bindAlt[128]; + _controlConfigPanel->GetCVar( row, cvar, 128, desc, 128 ); + + if( cellSelected ) + { + _label->setBgColor( Scheme::sc_primary1 ); + _label->setFgColor( Scheme::sc_primary3 ); + } + else if( rowSelected ) + { + _label->setBgColor( Scheme::sc_primary2 ); + _label->setFgColor( Scheme::sc_primary1 ); + } + else + { + _label->setBgColor( Scheme::sc_primary3 ); + _label->setFgColor( Scheme::sc_primary1 ); + } + + switch( column ) + { + case 0: + { + _label->setText( desc ); + _label->setContentAlignment( Label::a_west ); + break; + } + case 1: + { + _controlConfigPanel->GetCVarBind( cvar, bind, 128, bindAlt, 128 ); + _label->setText( bind ); + _label->setContentAlignment( Label::a_center ); + break; + } + case 2: + { + _controlConfigPanel->GetCVarBind( cvar, bind, 128, bindAlt, 128 ); + _label->setText( bindAlt ); + _label->setContentAlignment( Label::a_center ); + break; + } + default: + { + _label->setText( "" ); + break; + } + } + + return _label; + } + virtual Panel *startCellEditing( int column, int row ) + { + _textEntry->setText( "Goat", strlen( "Goat" ) ); + _textEntry->requestFocus(); + return _textEntry; + } +}; +} + +ControlConfigPanel::ControlConfigPanel( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) +{ + setPaintBorderEnabled( false ); + setPaintBackgroundEnabled( false ); + setPaintEnabled( false ); + + _actionLabel = new Label( "Action" ); + _actionLabel->setBgColor( Scheme::sc_primary3 ); + _actionLabel->setFgColor( Scheme::sc_primary3 ); + + _keyButtonLabel = new Label( "Key / Button" ); + _keyButtonLabel->setBgColor( Scheme::sc_primary3 ); + _keyButtonLabel->setFgColor( Scheme::sc_primary3 ); + + _alternateLabel = new Label( "Alternate" ); + _alternateLabel->setBgColor( Scheme::sc_primary3 ); + _alternateLabel->setFgColor( Scheme::sc_primary3 ); + + _headerPanel=new HeaderPanel( 0, 0, wide, 20 ); + _headerPanel->setParent( this ); + + _headerPanel->addSectionPanel( _actionLabel ); + _headerPanel->addSectionPanel( _keyButtonLabel ); + _headerPanel->addSectionPanel( _alternateLabel ); + + _headerPanel->setSliderPos( 0, wide / 2 ); + _headerPanel->setSliderPos( 1, ( wide / 2 ) + ( wide / 4 ) ); + _headerPanel->setSliderPos( 2, wide ); + + _scrollPanel=new ScrollPanel( 0, 20, wide, tall - 20 ); + _scrollPanel->setParent( this ); + _scrollPanel->setPaintBorderEnabled( false ); + _scrollPanel->setPaintBackgroundEnabled( false ); + _scrollPanel->setPaintEnabled( false ); + _scrollPanel->getClient()->setPaintBorderEnabled( false ); + _scrollPanel->getClient()->setPaintBackgroundEnabled( false ); + _scrollPanel->getClient()->setPaintEnabled( false ); + _scrollPanel->setScrollBarVisible( false, true ); + + _tablePanel = new FooTablePanel( this, 0, 0, _scrollPanel->getClient()->getWide(), 800, 3 ); + _tablePanel->setParent( _scrollPanel->getClient() ); + _tablePanel->setHeaderPanel( _headerPanel ); + _tablePanel->setBgColor( Color( 200, 0, 0, 255 ) ); + _tablePanel->setFgColor( Color( Scheme::sc_primary2 ) ); + _tablePanel->setGridVisible( true, true ); + _tablePanel->setGridSize( 1, 1 ); +} + +void ControlConfigPanel::AddCVar( const char *cvar, const char *desc ) +{ + _cvarDar.addElement( vgui_strdup( cvar ) ); + _descDar.addElement( vgui_strdup( desc ) ); +} + +int ControlConfigPanel::GetCVarCount() +{ + return _cvarDar.getCount(); +} + +void ControlConfigPanel::GetCVar( int index, char *cvar, int cvarLen, char *desc, int descLen ) +{ + vgui_strcpy( cvar, cvarLen, _cvarDar[index] ); + vgui_strcpy( desc, descLen, _descDar[index] ); +} + +void ControlConfigPanel::AddCVarFromInputStream( InputStream *is ) +{ + if( is == null ) + { + return; + } + + DataInputStream dis( is ); + + bool success; + + while( 1 ) + { + char buf[256], cvar[128], desc[128]; + + dis.readLine( buf, 256, success ); + + if( !success ) + { + break; + } + + if( sscanf( buf, "\"%[^\"]\" \"%[^\"]\"", cvar, desc ) == 2 ) + { + AddCVar( cvar, desc ); + } + } +} + +void ControlConfigPanel::GetCVarBind( const char *cvar, char *bind, int bindLen, char *bindAlt, int bindAltLen ) +{ + sprintf( bind,"%s : Bind", cvar ); + sprintf( bindAlt,"%s : BindAlt", cvar ); +} + +void ControlConfigPanel::SetCVarBind( const char *cvar, const char *bind, const char *bindAlt ) +{ +} + diff --git a/cl_dll/vgui_ControlConfigPanel.h b/cl_dll/vgui_ControlConfigPanel.h new file mode 100644 index 00000000..963adb14 --- /dev/null +++ b/cl_dll/vgui_ControlConfigPanel.h @@ -0,0 +1,43 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef CONTROLCONFIGPANEL_H +#define CONTROLCONFIGPANEL_H + +#include +#include + +namespace vgui +{ + class HeaderPanel; + class TablePanel; + class ScrollPanel; + class InputStream; + class Label; +} + +class ControlConfigPanel : public vgui::Panel +{ +private: + vgui::HeaderPanel *_headerPanel; + vgui::TablePanel *_tablePanel; + vgui::ScrollPanel *_scrollPanel; + vgui::Dar _cvarDar; + vgui::Dar _descDar; + vgui::Label *_actionLabel; + vgui::Label *_keyButtonLabel; + vgui::Label *_alternateLabel; +public: + ControlConfigPanel( int x, int y, int wide, int tall ); + void AddCVar( const char *cvar, const char *desc ); + void AddCVarFromInputStream( vgui::InputStream *is ); + int GetCVarCount(); + void GetCVar( int index, char *cvar, int cvarLen, char *desc, int descLen ); + void GetCVarBind( const char *cvar, char *bind, int bindLen, char *bindAlt, int bindAltLen ); + void SetCVarBind( const char *cvar, const char *bind, const char *bindAlt ); +}; +#endif diff --git a/cl_dll/vgui_CustomObjects.cpp b/cl_dll/vgui_CustomObjects.cpp new file mode 100644 index 00000000..920956a3 --- /dev/null +++ b/cl_dll/vgui_CustomObjects.cpp @@ -0,0 +1,551 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: Contains implementation of various VGUI-derived objects +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_loadtga.h" + +// Arrow filenames +const char *sArrowFilenames[] = +{ + "arrowup", + "arrowdn", + "arrowlt", + "arrowrt", +}; + +// Get the name of TGA file, without a gamedir +char *GetTGANameForRes( const char *pszName ) +{ + int i; + char sz[256]; + static char gd[256]; + + if( ScreenWidth < 640 ) + i = 320; + else + i = 640; + + sprintf( sz, pszName, i ); + sprintf( gd, "gfx/vgui/%s.tga", sz ); + return gd; +} + +//----------------------------------------------------------------------------- +// Purpose: Loads a .tga file and returns a pointer to the VGUI tga object +//----------------------------------------------------------------------------- +BitmapTGA *LoadTGAForRes( const char* pImageName ) +{ + BitmapTGA *pTGA; + char sz[256]; + + sprintf( sz, "%%d_%s", pImageName ); + pTGA = vgui_LoadTGA( GetTGANameForRes( sz ) ); + + return pTGA; +} + +//=========================================================== +// All TFC Hud buttons are derived from this one. +CommandButton::CommandButton( const char *text, int x, int y, int wide, int tall, bool bNoHighlight ) : Button( "", x, y, wide, tall ) +{ + m_iPlayerClass = 0; + m_bNoHighlight = bNoHighlight; + m_bFlat = false; + Init(); + setText( text ); +} + +CommandButton::CommandButton( int iPlayerClass, const char *text, int x, int y, int wide, int tall, bool bFlat ) : Button( "", x, y, wide, tall ) +{ + m_iPlayerClass = iPlayerClass; + m_bNoHighlight = false; + m_bFlat = bFlat; + Init(); + setText( text ); +} + +CommandButton::CommandButton( const char *text, int x, int y, int wide, int tall, bool bNoHighlight, bool bFlat ) : Button( "", x, y, wide, tall ) +{ + m_iPlayerClass = 0; + m_bFlat = bFlat; + m_bNoHighlight = bNoHighlight; + Init(); + setText( text ); +} + +void CommandButton::Init( void ) +{ + m_pSubMenu = NULL; + m_pSubLabel = NULL; + m_pParentMenu = NULL; + + // Set text color to orange + setFgColor( Scheme::sc_primary1 ); + + // left align + setContentAlignment( vgui::Label::a_west ); + + // Add the Highlight signal + if( !m_bNoHighlight ) + addInputSignal( new CHandler_CommandButtonHighlight( this ) ); + + // not bound to any button yet + m_cBoundKey = 0; +} + +//----------------------------------------------------------------------------- +// Purpose: Prepends the button text with the current bound key +// if no bound key, then a clear space ' ' instead +//----------------------------------------------------------------------------- +void CommandButton::RecalculateText( void ) +{ + char szBuf[128]; + + if( m_cBoundKey != 0 ) + { + if( m_cBoundKey == (char)255 ) + { + strcpy( szBuf, m_sMainText ); + } + else + { + sprintf( szBuf, " %c %s", m_cBoundKey, m_sMainText ); + } + szBuf[MAX_BUTTON_SIZE-1] = 0; + } + else + { + // just draw a space if no key bound + sprintf( szBuf, " %s", m_sMainText ); + szBuf[MAX_BUTTON_SIZE - 1] = 0; + } + + Button::setText( szBuf ); +} + +void CommandButton::setText( const char *text ) +{ + strncpy( m_sMainText, text, MAX_BUTTON_SIZE ); + m_sMainText[MAX_BUTTON_SIZE - 1] = 0; + + RecalculateText(); +} + +void CommandButton::setBoundKey( char boundKey ) +{ + m_cBoundKey = boundKey; + RecalculateText(); +} + +char CommandButton::getBoundKey( void ) +{ + return m_cBoundKey; +} + +void CommandButton::AddSubMenu( CCommandMenu *pNewMenu ) +{ + m_pSubMenu = pNewMenu; + + // Prevent this button from being pushed + setMouseClickEnabled( MOUSE_LEFT, false ); +} + +void CommandButton::UpdateSubMenus( int iAdjustment ) +{ + if( m_pSubMenu ) + m_pSubMenu->RecalculatePositions( iAdjustment ); +} + +void CommandButton::paint() +{ + // Make the sub label paint the same as the button + if( m_pSubLabel ) + { + if( isSelected() ) + m_pSubLabel->PushDown(); + else + m_pSubLabel->PushUp(); + } + + // draw armed button text in white + if( isArmed() ) + { + setFgColor( Scheme::sc_secondary2 ); + } + else + { + setFgColor( Scheme::sc_primary1 ); + } + + Button::paint(); +} + +void CommandButton::paintBackground() +{ + if( m_bFlat ) + { + if( isArmed() ) + { + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect( 0, 0, _size[0], _size[1] ); + } + } + else + { + if( isArmed() ) + { + // Orange highlight background + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( 0, 0, _size[0], _size[1] ); + } + + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect( 0, 0, _size[0], _size[1] ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Highlights the current button, and all it's parent menus +//----------------------------------------------------------------------------- +void CommandButton::cursorEntered( void ) +{ + // unarm all the other buttons in this menu + CCommandMenu *containingMenu = getParentMenu(); + if( containingMenu ) + { + containingMenu->ClearButtonsOfArmedState(); + + // make all our higher buttons armed + CCommandMenu *pCParent = containingMenu->GetParentMenu(); + if( pCParent ) + { + CommandButton *pParentButton = pCParent->FindButtonWithSubmenu( containingMenu ); + + pParentButton->cursorEntered(); + } + } + + // arm ourselves + setArmed( true ); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CommandButton::cursorExited( void ) +{ + // only clear ourselves if we have do not have a containing menu + // only stay armed if we have a sub menu + // the buttons only unarm themselves when another button is armed instead + if( !getParentMenu() || !GetSubMenu() ) + { + setArmed( false ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Returns the command menu that the button is part of, if any +// Output : CCommandMenu * +//----------------------------------------------------------------------------- +CCommandMenu *CommandButton::getParentMenu( void ) +{ + return m_pParentMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: Sets the menu that contains this button +// Input : *pParentMenu - +//----------------------------------------------------------------------------- +void CommandButton::setParentMenu( CCommandMenu *pParentMenu ) +{ + m_pParentMenu = pParentMenu; +} + +//=========================================================== +int ClassButton::IsNotValid() +{ + // If this is the main ChangeClass button, remove it if the player's only able to be civilians + if( m_iPlayerClass == -1 ) + { + if( gViewPort->GetValidClasses( g_iTeamNumber ) == -1 ) + return true; + + return false; + } + + // Is it an illegal class? +#ifdef _TFC + if( ( gViewPort->GetValidClasses( 0 ) & sTFValidClassInts[m_iPlayerClass] ) || ( gViewPort->GetValidClasses( g_iTeamNumber ) & sTFValidClassInts[m_iPlayerClass] ) ) + return true; +#endif + + // Only check current class if they've got autokill on + bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; + if( bAutoKill ) + { + // Is it the player's current class? + if ( +#ifdef _TFC + (gViewPort->IsRandomPC() && m_iPlayerClass == PC_RANDOM) || +#endif + (!gViewPort->IsRandomPC() && (m_iPlayerClass == g_iPlayerClass)) ) + return true; + } + + return false; +} + +//=========================================================== +// Button with Class image beneath it +CImageLabel::CImageLabel( const char *pImageName,int x,int y ) : Label( "", x, y ) +{ + setContentFitted( true ); + m_pTGA = LoadTGAForRes( pImageName ); + setImage( m_pTGA ); +} + +CImageLabel::CImageLabel( const char *pImageName, int x, int y, int wide, int tall ) : Label( "", x, y, wide, tall ) +{ + setContentFitted( true ); + m_pTGA = LoadTGAForRes( pImageName ); + setImage( m_pTGA ); +} + +//=========================================================== +// Image size +int CImageLabel::getImageWide( void ) +{ + if( m_pTGA ) + { + int iXSize, iYSize; + + m_pTGA->getSize( iXSize, iYSize ); + + return iXSize; + } + else + { + return 1; + } +} + +int CImageLabel::getImageTall( void ) +{ + if( m_pTGA ) + { + int iXSize, iYSize; + + m_pTGA->getSize( iXSize, iYSize ); + + return iYSize; + } + else + { + return 1; + } +} + +void CImageLabel::LoadImage( const char *pImageName ) +{ + if( m_pTGA ) + delete m_pTGA; + + // Load the Image + m_pTGA = LoadTGAForRes( pImageName ); + + if( m_pTGA == NULL ) + { + // we didn't find a matching image file for this resolution + // try to load file resolution independent + char sz[256]; + + sprintf( sz, "%s/%s", gEngfuncs.pfnGetGameDirectory(), pImageName ); + FileInputStream fis( sz, false ); + m_pTGA = new BitmapTGA( &fis, true ); + fis.close(); + } + + if( m_pTGA == NULL ) + return; // unable to load image + + int w,t; + + m_pTGA->getSize( w, t ); + + setSize( XRES ( w ),YRES ( t) ); + setImage( m_pTGA ); +} + +//=========================================================== +// Various overloaded paint functions for Custom VGUI objects +void CCommandMenu::paintBackground() +{ + // Transparent black background + + if( m_iSpectCmdMenu ) + drawSetColor( 0, 0, 0, 64 ); + else + drawSetColor( Scheme::sc_primary3 ); + + drawFilledRect( 0, 0, _size[0], _size[1] ); +} + +//================================================================================= +// CUSTOM SCROLLPANEL +//================================================================================= +CTFScrollButton::CTFScrollButton( int iArrow, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) +{ + // Set text color to orange + setFgColor( Scheme::sc_primary1 ); + + // Load in the arrow + m_pTGA = LoadTGAForRes( sArrowFilenames[iArrow] ); + setImage( m_pTGA ); + + // Highlight signal + InputSignal *pISignal = new CHandler_CommandButtonHighlight( this ); + addInputSignal( pISignal ); +} + +void CTFScrollButton::paint( void ) +{ + if( !m_pTGA ) + return; + + // draw armed button text in white + if( isArmed() ) + { + m_pTGA->setColor( Color( 255, 255, 255, 0 ) ); + } + else + { + m_pTGA->setColor( Color( 255, 255, 255, 128 ) ); + } + + m_pTGA->doPaint( this ); +} + +void CTFScrollButton::paintBackground( void ) +{ +/* + if( isArmed() ) + { + // Orange highlight background + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( 0, 0, _size[0], _size[1] ); + } + + // Orange Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect( 0, 0, _size[0] - 1, _size[1] ); +*/ +} + +void CTFSlider::paintBackground( void ) +{ + int wide, tall, nobx, noby; + + getPaintSize( wide, tall ); + getNobPos( nobx, noby ); + + // Border + drawSetColor( Scheme::sc_secondary1 ); + drawOutlinedRect( 0, 0, wide, tall ); + + if( isVertical() ) + { + // Nob Fill + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( 0, nobx, wide, noby ); + + // Nob Outline + drawSetColor( Scheme::sc_primary1 ); + drawOutlinedRect( 0, nobx, wide, noby ); + } + else + { + // Nob Fill + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( nobx, 0, noby, tall ); + + // Nob Outline + drawSetColor( Scheme::sc_primary1 ); + drawOutlinedRect( nobx, 0, noby, tall ); + } +} + +CTFScrollPanel::CTFScrollPanel( int x, int y, int wide, int tall ) : ScrollPanel( x, y, wide, tall ) +{ + ScrollBar *pScrollBar = getVerticalScrollBar(); + pScrollBar->setButton( new CTFScrollButton( ARROW_UP, "", 0, 0, 16, 16 ), 0 ); + pScrollBar->setButton( new CTFScrollButton( ARROW_DOWN, "", 0, 0, 16, 16 ), 1 ); + pScrollBar->setSlider( new CTFSlider( 0, wide - 1, wide, ( tall - ( wide * 2 ) ) + 2, true ) ); + pScrollBar->setPaintBorderEnabled( false ); + pScrollBar->setPaintBackgroundEnabled( false ); + pScrollBar->setPaintEnabled( false ); + + pScrollBar = getHorizontalScrollBar(); + pScrollBar->setButton( new CTFScrollButton( ARROW_LEFT, "", 0, 0, 16, 16 ), 0 ); + pScrollBar->setButton( new CTFScrollButton( ARROW_RIGHT, "", 0, 0, 16, 16 ), 1 ); + pScrollBar->setSlider( new CTFSlider( tall, 0, wide - ( tall * 2 ), tall, false ) ); + pScrollBar->setPaintBorderEnabled( false ); + pScrollBar->setPaintBackgroundEnabled( false ); + pScrollBar->setPaintEnabled( false ); +} + +//================================================================================= +// CUSTOM HANDLERS +//================================================================================= +void CHandler_MenuButtonOver::cursorEntered(Panel *panel) +{ + if( gViewPort && m_pMenuPanel ) + { + m_pMenuPanel->SetActiveInfo( m_iButton ); + } +} + +void CMenuHandler_StringCommandClassSelect::actionPerformed( Panel *panel ) +{ + CMenuHandler_StringCommand::actionPerformed( panel ); + + // THIS IS NOW BEING DONE ON THE TFC SERVER TO AVOID KILLING SOMEONE THEN + // HAVE THE SERVER SAY "SORRY...YOU CAN'T BE THAT CLASS". + +#if !defined _TFC + bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; + if( bAutoKill && g_iPlayerClass != 0 ) + gEngfuncs.pfnClientCmd( "kill" ); +#endif +} + diff --git a/cl_dll/vgui_MOTDWindow.cpp b/cl_dll/vgui_MOTDWindow.cpp new file mode 100644 index 00000000..d5715b92 --- /dev/null +++ b/cl_dll/vgui_MOTDWindow.cpp @@ -0,0 +1,151 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + +#include "VGUI_Font.h" +#include "VGUI_ScrollPanel.h" +#include "VGUI_TextImage.h" + +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "const.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" + +#define MOTD_TITLE_X XRES(16) +#define MOTD_TITLE_Y YRES(16) + +#define MOTD_WINDOW_X XRES(112) +#define MOTD_WINDOW_Y YRES(80) +#define MOTD_WINDOW_SIZE_X XRES(424) +#define MOTD_WINDOW_SIZE_Y YRES(312) + +//----------------------------------------------------------------------------- +// Purpose: Displays the MOTD and basic server information +//----------------------------------------------------------------------------- +class CMessageWindowPanel : public CMenuPanel +{ +public: + CMessageWindowPanel( const char *szMOTD, const char *szTitle, int iShadeFullScreen, int iRemoveMe, int x, int y, int wide, int tall ); + +private: + CTransparentPanel *m_pBackgroundPanel; +}; + +//----------------------------------------------------------------------------- +// Purpose: Creates a new CMessageWindowPanel +// Output : CMenuPanel - interface to the panel +//----------------------------------------------------------------------------- +CMenuPanel *CMessageWindowPanel_Create( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ) +{ + return new CMessageWindowPanel( szMOTD, szTitle, iShadeFullscreen, iRemoveMe, x, y, wide, tall ); +} + +//----------------------------------------------------------------------------- +// Purpose: Constructs a message panel +//----------------------------------------------------------------------------- +CMessageWindowPanel::CMessageWindowPanel( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ) : CMenuPanel( iShadeFullscreen ? 100 : 255, iRemoveMe, x, y, wide, tall ) +{ + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hMOTDText = pSchemes->getSchemeHandle( "Briefing Text" ); + + // color schemes + int r, g, b, a; + + // Create the window + m_pBackgroundPanel = new CTransparentPanel( iShadeFullscreen ? 255 : 100, MOTD_WINDOW_X, MOTD_WINDOW_Y, MOTD_WINDOW_SIZE_X, MOTD_WINDOW_SIZE_Y ); + m_pBackgroundPanel->setParent( this ); + m_pBackgroundPanel->setBorder( new LineBorder( Color( 255 * 0.7, 170 * 0.7, 0, 0 ) ) ); + m_pBackgroundPanel->setVisible( true ); + + int iXSize,iYSize,iXPos,iYPos; + m_pBackgroundPanel->getPos( iXPos, iYPos ); + m_pBackgroundPanel->getSize( iXSize, iYSize ); + + // Create the title + Label *pLabel = new Label( "", iXPos + MOTD_TITLE_X, iYPos + MOTD_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pSchemes->getFont( hTitleScheme ) ); + pLabel->setFont( Scheme::sf_primary1 ); + + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pLabel->setFgColor( Scheme::sc_primary1 ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText( "%s", szTitle); + + // Create the Scroll panel + ScrollPanel *pScrollPanel = new CTFScrollPanel( iXPos + XRES( 16 ), iYPos + MOTD_TITLE_Y * 2 + YRES( 16 ), iXSize - XRES( 32 ), iYSize - ( YRES( 48 ) + BUTTON_SIZE_Y * 2 ) ); + pScrollPanel->setParent( this ); + + // force the scrollbars on so clientClip will take them in account after the validate + pScrollPanel->setScrollBarAutoVisible( false, false ); + pScrollPanel->setScrollBarVisible( true, true ); + pScrollPanel->validate(); + + // Create the text panel + TextPanel *pText = new TextPanel( "", 0, 0, 64, 64 ); + pText->setParent( pScrollPanel->getClient() ); + + // get the font and colors from the scheme + pText->setFont( pSchemes->getFont( hMOTDText ) ); + pSchemes->getFgColor( hMOTDText, r, g, b, a ); + pText->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hMOTDText, r, g, b, a ); + pText->setBgColor( r, g, b, a ); + pText->setText( szMOTD ); + + // Get the total size of the MOTD text and resize the text panel + int iScrollSizeX, iScrollSizeY; + + // First, set the size so that the client's wdith is correct at least because the + // width is critical for getting the "wrapped" size right. + // You'll see a horizontal scroll bar if there is a single word that won't wrap in the + // specified width. + pText->getTextImage()->setSize( pScrollPanel->getClientClip()->getWide(), pScrollPanel->getClientClip()->getTall() ); + pText->getTextImage()->getTextSizeWrapped( iScrollSizeX, iScrollSizeY ); + + // Now resize the textpanel to fit the scrolled size + pText->setSize( iScrollSizeX, iScrollSizeY ); + + //turn the scrollbars back into automode + pScrollPanel->setScrollBarAutoVisible( true, true ); + pScrollPanel->setScrollBarVisible( false, false ); + + pScrollPanel->validate(); + + CommandButton *pButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_OK" ), iXPos + XRES( 16 ), iYPos + iYSize - YRES( 16 ) - BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_TextWindow( HIDE_TEXTWINDOW ) ); + pButton->setParent( this ); +} + + + + + + diff --git a/cl_dll/vgui_SchemeManager.cpp b/cl_dll/vgui_SchemeManager.cpp new file mode 100644 index 00000000..dddd268c --- /dev/null +++ b/cl_dll/vgui_SchemeManager.cpp @@ -0,0 +1,556 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + +#include "hud.h" +#include "vgui_SchemeManager.h" +#include "cvardef.h" + +#include + + +cvar_t *g_CV_BitmapFonts; + + +void Scheme_Init() +{ + g_CV_BitmapFonts = gEngfuncs.pfnRegisterVariable("bitmapfonts", "1", 0); +} + + + +//----------------------------------------------------------------------------- +// Purpose: Scheme managers data container +//----------------------------------------------------------------------------- +class CSchemeManager::CScheme +{ +public: + enum { + SCHEME_NAME_LENGTH = 32, + FONT_NAME_LENGTH = 48, + FONT_FILENAME_LENGTH = 64, + }; + + // name + char schemeName[SCHEME_NAME_LENGTH]; + + // font + char fontName[FONT_NAME_LENGTH]; + + int fontSize; + int fontWeight; + + vgui::Font *font; + int ownFontPointer; // true if the font is ours to delete + + // scheme + byte fgColor[4]; + byte bgColor[4]; + byte armedFgColor[4]; + byte armedBgColor[4]; + byte mousedownFgColor[4]; + byte mousedownBgColor[4]; + byte borderColor[4]; + + // construction/destruction + CScheme(); + ~CScheme(); +}; + +CSchemeManager::CScheme::CScheme() +{ + schemeName[0] = 0; + fontName[0] = 0; + fontSize = 0; + fontWeight = 0; + font = NULL; + ownFontPointer = false; +} + +CSchemeManager::CScheme::~CScheme() +{ + // only delete our font pointer if we own it + if ( ownFontPointer ) + { + delete font; + } +} + +//----------------------------------------------------------------------------- +// Purpose: resolution information +// !! needs to be shared out +//----------------------------------------------------------------------------- +static int g_ResArray[] = +{ + 320, + 400, + 512, + 640, + 800, + 1024, + 1152, + 1280, + 1600 +}; +static int g_NumReses = sizeof(g_ResArray) / sizeof(int); + +static byte *LoadFileByResolution( const char *filePrefix, int xRes, const char *filePostfix ) +{ + // find our resolution in the res array + int resNum = g_NumReses - 1; + while ( g_ResArray[resNum] > xRes ) + { + resNum--; + + if ( resNum < 0 ) + return NULL; + } + + // try open the file + byte *pFile = NULL; + while ( 1 ) + { + + // try load + char fname[256]; + sprintf( fname, "%s%d%s", filePrefix, g_ResArray[resNum], filePostfix ); + pFile = gEngfuncs.COM_LoadFile( fname, 5, NULL ); + + if ( pFile ) + break; + + if ( resNum == 0 ) + return NULL; + + resNum--; + }; + + return pFile; +} + +static void ParseRGBAFromString( byte colorArray[4], const char *colorVector ) +{ + int r, g, b, a; + sscanf( colorVector, "%d %d %d %d", &r, &g, &b, &a ); + colorArray[0] = r; + colorArray[1] = g; + colorArray[2] = b; + colorArray[3] = a; +} + +//----------------------------------------------------------------------------- +// Purpose: initializes the scheme manager +// loading the scheme files for the current resolution +// Input : xRes - +// yRes - dimensions of output window +//----------------------------------------------------------------------------- +CSchemeManager::CSchemeManager( int xRes, int yRes ) +{ + // basic setup + m_pSchemeList = NULL; + m_iNumSchemes = 0; + + // find the closest matching scheme file to our resolution + char token[1024]; + char *pFile = (char*)LoadFileByResolution( "", xRes, "_textscheme.txt" ); + m_xRes = xRes; + + char *pFileStart = pFile; + + byte *pFontData; + int fontFileLength; + char fontFilename[512]; + + // + // Read the scheme descriptions from the text file, into a temporary array + // format is simply: + // = + // + // a of "SchemeName" signals a new scheme is being described + // + + const static int numTmpSchemes = 64; + static CScheme tmpSchemes[numTmpSchemes]; + memset( tmpSchemes, 0, sizeof(tmpSchemes) ); + int currentScheme = -1; + CScheme *pScheme = NULL; + + if ( !pFile ) + { + gEngfuncs.Con_DPrintf( "Unable to find *_textscheme.txt\n"); + goto buildDefaultFont; + } + + // record what has been entered so we can create defaults from the different values + bool hasFgColor, hasBgColor, hasArmedFgColor, hasArmedBgColor, hasMouseDownFgColor, hasMouseDownBgColor; + + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + while ( strlen(token) > 0 && (currentScheme < numTmpSchemes) ) + { + // get the paramName name + static const int tokenSize = 64; + char paramName[tokenSize], paramValue[tokenSize]; + + strncpy( paramName, token, tokenSize ); + paramName[tokenSize-1] = 0; // ensure null termination + + // get the '=' character + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + if ( stricmp( token, "=" ) ) + { + if ( currentScheme < 0 ) + { + gEngfuncs.Con_Printf( "error parsing font scheme text file at file start - expected '=', found '%s''\n", token ); + } + else + { + gEngfuncs.Con_Printf( "error parsing font scheme text file at scheme '%s' - expected '=', found '%s''\n", tmpSchemes[currentScheme].schemeName, token ); + } + break; + } + + // get paramValue + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + strncpy( paramValue, token, tokenSize ); + paramValue[tokenSize-1] = 0; // ensure null termination + + // is this a new scheme? + if ( !stricmp(paramName, "SchemeName") ) + { + // setup the defaults for the current scheme + if ( pScheme ) + { + // foreground color defaults (normal -> armed -> mouse down) + if ( !hasFgColor ) + { + pScheme->fgColor[0] = pScheme->fgColor[1] = pScheme->fgColor[2] = pScheme->fgColor[3] = 255; + } + if ( !hasArmedFgColor ) + { + memcpy( pScheme->armedFgColor, pScheme->fgColor, sizeof(pScheme->armedFgColor) ); + } + if ( !hasMouseDownFgColor ) + { + memcpy( pScheme->mousedownFgColor, pScheme->armedFgColor, sizeof(pScheme->mousedownFgColor) ); + } + + // background color (normal -> armed -> mouse down) + if ( !hasBgColor ) + { + pScheme->bgColor[0] = pScheme->bgColor[1] = pScheme->bgColor[2] = pScheme->bgColor[3] = 0; + } + if ( !hasArmedBgColor ) + { + memcpy( pScheme->armedBgColor, pScheme->bgColor, sizeof(pScheme->armedBgColor) ); + } + if ( !hasMouseDownBgColor ) + { + memcpy( pScheme->mousedownBgColor, pScheme->armedBgColor, sizeof(pScheme->mousedownBgColor) ); + } + + // font size + if ( !pScheme->fontSize ) + { + pScheme->fontSize = 17; + } + if ( !pScheme->fontName[0] ) + { + strcpy( pScheme->fontName, "Arial" ); + } + } + + // create the new scheme + currentScheme++; + pScheme = &tmpSchemes[currentScheme]; + hasFgColor = hasBgColor = hasArmedFgColor = hasArmedBgColor = hasMouseDownFgColor = hasMouseDownBgColor = false; + + strncpy( pScheme->schemeName, paramValue, CScheme::SCHEME_NAME_LENGTH ); + pScheme->schemeName[CScheme::SCHEME_NAME_LENGTH-1] = '\0'; // ensure null termination of string + } + + if ( !pScheme ) + { + gEngfuncs.Con_Printf( "font scheme text file MUST start with a 'SchemeName'\n"); + break; + } + + // pull the data out into the scheme + if ( !stricmp(paramName, "FontName") ) + { + strncpy( pScheme->fontName, paramValue, CScheme::FONT_NAME_LENGTH ); + pScheme->fontName[CScheme::FONT_NAME_LENGTH-1] = 0; + } + else if ( !stricmp(paramName, "FontSize") ) + { + pScheme->fontSize = atoi( paramValue ); + } + else if ( !stricmp(paramName, "FontWeight") ) + { + pScheme->fontWeight = atoi( paramValue ); + } + else if ( !stricmp(paramName, "FgColor") ) + { + ParseRGBAFromString( pScheme->fgColor, paramValue ); + hasFgColor = true; + } + else if ( !stricmp(paramName, "BgColor") ) + { + ParseRGBAFromString( pScheme->bgColor, paramValue ); + hasBgColor = true; + } + else if ( !stricmp(paramName, "FgColorArmed") ) + { + ParseRGBAFromString( pScheme->armedFgColor, paramValue ); + hasArmedFgColor = true; + } + else if ( !stricmp(paramName, "BgColorArmed") ) + { + ParseRGBAFromString( pScheme->armedBgColor, paramValue ); + hasArmedBgColor = true; + } + else if ( !stricmp(paramName, "FgColorMousedown") ) + { + ParseRGBAFromString( pScheme->mousedownFgColor, paramValue ); + hasMouseDownFgColor = true; + } + else if ( !stricmp(paramName, "BgColorMousedown") ) + { + ParseRGBAFromString( pScheme->mousedownBgColor, paramValue ); + hasMouseDownBgColor = true; + } + else if ( !stricmp(paramName, "BorderColor") ) + { + ParseRGBAFromString( pScheme->borderColor, paramValue ); + hasMouseDownBgColor = true; + } + + // get the new token last, so we now if the loop needs to be continued or not + pFile = gEngfuncs.COM_ParseFile( pFile, token ); + } + + // free the file + gEngfuncs.COM_FreeFile( pFileStart ); + + +buildDefaultFont: + + // make sure we have at least 1 valid font + if ( currentScheme < 0 ) + { + currentScheme = 0; + strcpy( tmpSchemes[0].schemeName, "Default Scheme" ); + strcpy( tmpSchemes[0].fontName, "Arial" ); + tmpSchemes[0].fontSize = 0; + tmpSchemes[0].fgColor[0] = tmpSchemes[0].fgColor[1] = tmpSchemes[0].fgColor[2] = tmpSchemes[0].fgColor[3] = 255; + tmpSchemes[0].armedFgColor[0] = tmpSchemes[0].armedFgColor[1] = tmpSchemes[0].armedFgColor[2] = tmpSchemes[0].armedFgColor[3] = 255; + tmpSchemes[0].mousedownFgColor[0] = tmpSchemes[0].mousedownFgColor[1] = tmpSchemes[0].mousedownFgColor[2] = tmpSchemes[0].mousedownFgColor[3] = 255; + } + + // we have the full list of schemes in the tmpSchemes array + // now allocate the correct sized list + m_iNumSchemes = currentScheme + 1; // 0-based index + m_pSchemeList = new CScheme[ m_iNumSchemes ]; + + // copy in the data + memcpy( m_pSchemeList, tmpSchemes, sizeof(CScheme) * m_iNumSchemes ); + + // create the fonts + for ( int i = 0; i < m_iNumSchemes; i++ ) + { + m_pSchemeList[i].font = NULL; + + // see if the current font values exist in a previously loaded font + for ( int j = 0; j < i; j++ ) + { + // check if the font name, size, and weight are the same + if ( !stricmp(m_pSchemeList[i].fontName, m_pSchemeList[j].fontName) + && m_pSchemeList[i].fontSize == m_pSchemeList[j].fontSize + && m_pSchemeList[i].fontWeight == m_pSchemeList[j].fontWeight ) + { + // copy the pointer, but mark i as not owning it + m_pSchemeList[i].font = m_pSchemeList[j].font; + m_pSchemeList[i].ownFontPointer = false; + } + } + + // if we haven't found the font already, load it ourselves + if ( !m_pSchemeList[i].font ) + { + fontFileLength = -1; + pFontData = NULL; + + if(g_CV_BitmapFonts && g_CV_BitmapFonts->value) + { + int fontRes = 640; + if ( m_xRes >= 1600 ) + fontRes = 1600; + else if ( m_xRes >= 1280 ) + fontRes = 1280; + else if ( m_xRes >= 1152 ) + fontRes = 1152; + else if ( m_xRes >= 1024 ) + fontRes = 1024; + else if ( m_xRes >= 800 ) + fontRes = 800; + + sprintf(fontFilename, "gfx\\vgui\\fonts\\%d_%s.tga", fontRes, m_pSchemeList[i].schemeName); + pFontData = gEngfuncs.COM_LoadFile( fontFilename, 5, &fontFileLength ); + if(!pFontData) + gEngfuncs.Con_Printf("Missing bitmap font: %s\n", fontFilename); + } + + m_pSchemeList[i].font = new vgui::Font( + m_pSchemeList[i].fontName, + pFontData, + fontFileLength, + m_pSchemeList[i].fontSize, + 0, + 0, + m_pSchemeList[i].fontWeight, + false, + false, + false, + false); + + m_pSchemeList[i].ownFontPointer = true; + } + + // fix up alpha values; VGUI uses 1-A (A=0 being solid, A=255 transparent) + m_pSchemeList[i].fgColor[3] = 255 - m_pSchemeList[i].fgColor[3]; + m_pSchemeList[i].bgColor[3] = 255 - m_pSchemeList[i].bgColor[3]; + m_pSchemeList[i].armedFgColor[3] = 255 - m_pSchemeList[i].armedFgColor[3]; + m_pSchemeList[i].armedBgColor[3] = 255 - m_pSchemeList[i].armedBgColor[3]; + m_pSchemeList[i].mousedownFgColor[3] = 255 - m_pSchemeList[i].mousedownFgColor[3]; + m_pSchemeList[i].mousedownBgColor[3] = 255 - m_pSchemeList[i].mousedownBgColor[3]; + } +} + +//----------------------------------------------------------------------------- +// Purpose: frees all the memory used by the scheme manager +//----------------------------------------------------------------------------- +CSchemeManager::~CSchemeManager() +{ + delete [] m_pSchemeList; + m_iNumSchemes = 0; +} + +//----------------------------------------------------------------------------- +// Purpose: Finds a scheme in the list, by name +// Input : char *schemeName - string name of the scheme +// Output : SchemeHandle_t handle to the scheme +//----------------------------------------------------------------------------- +SchemeHandle_t CSchemeManager::getSchemeHandle( const char *schemeName ) +{ + // iterate through the list + for ( int i = 0; i < m_iNumSchemes; i++ ) + { + if ( !stricmp(schemeName, m_pSchemeList[i].schemeName) ) + return i; + } + + return 0; +} + +//----------------------------------------------------------------------------- +// Purpose: always returns a valid scheme handle +// Input : schemeHandle - +// Output : CScheme +//----------------------------------------------------------------------------- +CSchemeManager::CScheme *CSchemeManager::getSafeScheme( SchemeHandle_t schemeHandle ) +{ + if ( schemeHandle < m_iNumSchemes ) + return m_pSchemeList + schemeHandle; + + return m_pSchemeList; +} + + +//----------------------------------------------------------------------------- +// Purpose: Returns the schemes pointer to a font +// Input : schemeHandle - +// Output : vgui::Font +//----------------------------------------------------------------------------- +vgui::Font *CSchemeManager::getFont( SchemeHandle_t schemeHandle ) +{ + return getSafeScheme( schemeHandle )->font; +} + +void CSchemeManager::getFgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->fgColor[0]; + g = pScheme->fgColor[1]; + b = pScheme->fgColor[2]; + a = pScheme->fgColor[3]; +} + +void CSchemeManager::getBgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->bgColor[0]; + g = pScheme->bgColor[1]; + b = pScheme->bgColor[2]; + a = pScheme->bgColor[3]; +} + +void CSchemeManager::getFgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->armedFgColor[0]; + g = pScheme->armedFgColor[1]; + b = pScheme->armedFgColor[2]; + a = pScheme->armedFgColor[3]; +} + +void CSchemeManager::getBgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->armedBgColor[0]; + g = pScheme->armedBgColor[1]; + b = pScheme->armedBgColor[2]; + a = pScheme->armedBgColor[3]; +} + +void CSchemeManager::getFgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->mousedownFgColor[0]; + g = pScheme->mousedownFgColor[1]; + b = pScheme->mousedownFgColor[2]; + a = pScheme->mousedownFgColor[3]; +} + +void CSchemeManager::getBgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->mousedownBgColor[0]; + g = pScheme->mousedownBgColor[1]; + b = pScheme->mousedownBgColor[2]; + a = pScheme->mousedownBgColor[3]; +} + +void CSchemeManager::getBorderColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ) +{ + CScheme *pScheme = getSafeScheme( schemeHandle ); + r = pScheme->borderColor[0]; + g = pScheme->borderColor[1]; + b = pScheme->borderColor[2]; + a = pScheme->borderColor[3]; +} + + + diff --git a/cl_dll/vgui_SchemeManager.h b/cl_dll/vgui_SchemeManager.h new file mode 100644 index 00000000..acde6c4b --- /dev/null +++ b/cl_dll/vgui_SchemeManager.h @@ -0,0 +1,50 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include + +// handle to an individual scheme +typedef int SchemeHandle_t; + +// Register console variables, etc.. +void Scheme_Init(); + +//----------------------------------------------------------------------------- +// Purpose: Handles the loading of text scheme description from disk +// supports different font/color/size schemes at different resolutions +//----------------------------------------------------------------------------- +class CSchemeManager +{ +public: + // initialization + CSchemeManager( int xRes, int yRes ); + virtual ~CSchemeManager(); + + // scheme handling + SchemeHandle_t getSchemeHandle( const char *schemeName ); + + // getting info from schemes + vgui::Font *getFont( SchemeHandle_t schemeHandle ); + void getFgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getFgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgArmedColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getFgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBgMousedownColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + void getBorderColor( SchemeHandle_t schemeHandle, int &r, int &g, int &b, int &a ); + +private: + class CScheme; + CScheme *m_pSchemeList; + int m_iNumSchemes; + + // Resolution we were initted at. + int m_xRes; + + CScheme *getSafeScheme( SchemeHandle_t schemeHandle ); +}; + diff --git a/cl_dll/vgui_ScorePanel.cpp b/cl_dll/vgui_ScorePanel.cpp new file mode 100644 index 00000000..d71685ef --- /dev/null +++ b/cl_dll/vgui_ScorePanel.cpp @@ -0,0 +1,1147 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: VGUI scoreboard +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + + +#include + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ScorePanel.h" +#include "vgui_helpers.h" +#include "vgui_loadtga.h" +#include "voice_status.h" +#include "vgui_SpectatorPanel.h" + +int HUD_IsGame( const char *game ); +int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 ); + +// Scoreboard dimensions +#define SBOARD_TITLE_SIZE_Y YRES(22) + +#define X_BORDER XRES(4) + +// Column sizes +class SBColumnInfo +{ +public: + const char *m_pTitle; // If null, ignore, if starts with #, it's localized, otherwise use the string directly. + int m_Width; // Based on 640 width. Scaled to fit other resolutions. + Label::Alignment m_Alignment; +}; + +// grid size is marked out for 640x480 screen + +SBColumnInfo g_ColumnInfo[NUM_COLUMNS] = +{ + {NULL, 24, Label::a_east}, // tracker column + {NULL, 140, Label::a_east}, // name + {NULL, 56, Label::a_east}, // class + {"#SCORE", 40, Label::a_east}, + {"#DEATHS", 46, Label::a_east}, + {"#LATENCY", 46, Label::a_east}, + {"#VOICE", 40, Label::a_east}, + {NULL, 2, Label::a_east}, // blank column to take up the slack +}; + + +#define TEAM_NO 0 +#define TEAM_YES 1 +#define TEAM_SPECTATORS 2 +#define TEAM_BLANK 3 + + +//----------------------------------------------------------------------------- +// ScorePanel::HitTestPanel. +//----------------------------------------------------------------------------- + +void ScorePanel::HitTestPanel::internalMousePressed( MouseCode code ) +{ + for( int i = 0; i < _inputSignalDar.getCount(); i++ ) + { + _inputSignalDar[i]->mousePressed( code, this ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Create the ScoreBoard panel +//----------------------------------------------------------------------------- +ScorePanel::ScorePanel( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) +{ + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Scoreboard Title Text" ); + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle( "Scoreboard Small Text" ); + Font *tfont = pSchemes->getFont( hTitleScheme ); + Font *smallfont = pSchemes->getFont( hSmallScheme ); + + setBgColor( 0, 0, 0, 96 ); + m_pCurrentHighlightLabel = NULL; + m_iHighlightRow = -1; + + //m_pTrackerIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardtracker.tga"); + + // Initialize the top title. + m_TitleLabel.setFont( tfont ); + m_TitleLabel.setText( "" ); + m_TitleLabel.setBgColor( 0, 0, 0, 255 ); + m_TitleLabel.setFgColor( Scheme::sc_primary1 ); + m_TitleLabel.setContentAlignment( vgui::Label::a_west ); + + LineBorder *border = new LineBorder( Color( 60, 60, 60, 128 ) ); + setBorder( border ); + setPaintBorderEnabled( true ); + + int xpos = g_ColumnInfo[0].m_Width + 3; + if( ScreenWidth >= 640 ) + { + // only expand column size for res greater than 640 + xpos = XRES( xpos ); + } + m_TitleLabel.setBounds( xpos, 4, wide, SBOARD_TITLE_SIZE_Y ); + m_TitleLabel.setContentFitted( false ); + m_TitleLabel.setParent( this ); + + // Setup the header (labels like "name", "class", etc..). + m_HeaderGrid.SetDimensions( NUM_COLUMNS, 1 ); + m_HeaderGrid.SetSpacing( 0, 0 ); + + for( int i = 0; i < NUM_COLUMNS; i++ ) + { + if( g_ColumnInfo[i].m_pTitle && g_ColumnInfo[i].m_pTitle[0] == '#' ) + m_HeaderLabels[i].setText( CHudTextMessage::BufferedLocaliseTextString( g_ColumnInfo[i].m_pTitle ) ); + else if( g_ColumnInfo[i].m_pTitle ) + m_HeaderLabels[i].setText( g_ColumnInfo[i].m_pTitle ); + + int xwide = g_ColumnInfo[i].m_Width; + if( ScreenWidth >= 640 ) + { + xwide = XRES( xwide ); + } + else if( ScreenWidth == 400 ) + { + // hack to make 400x300 resolution scoreboard fit + if( i == 1 ) + { + // reduces size of player name cell + xwide -= 28; + } + else if( i == 0 ) + { + // tracker icon cell + xwide -= 8; + } + } + + m_HeaderGrid.SetColumnWidth( i, xwide ); + m_HeaderGrid.SetEntry( i, 0, &m_HeaderLabels[i] ); + + m_HeaderLabels[i].setBgColor( 0, 0, 0, 255 ); + m_HeaderLabels[i].setFgColor( Scheme::sc_primary1 ); + m_HeaderLabels[i].setFont( smallfont ); + m_HeaderLabels[i].setContentAlignment( g_ColumnInfo[i].m_Alignment ); + + int yres = 12; + if( ScreenHeight >= 480 ) + { + yres = YRES( yres ); + } + m_HeaderLabels[i].setSize( 50, yres ); + } + + // Set the width of the last column to be the remaining space. + int ex, ey, ew, eh; + + m_HeaderGrid.GetEntryBox( NUM_COLUMNS - 2, 0, ex, ey, ew, eh ); + m_HeaderGrid.SetColumnWidth( NUM_COLUMNS - 1, ( wide - X_BORDER ) - ( ex + ew ) ); + + m_HeaderGrid.AutoSetRowHeights(); + m_HeaderGrid.setBounds( X_BORDER, SBOARD_TITLE_SIZE_Y, wide - X_BORDER * 2, m_HeaderGrid.GetRowHeight( 0 ) ); + m_HeaderGrid.setParent( this ); + m_HeaderGrid.setBgColor( 0, 0, 0, 255 ); + + // Now setup the listbox with the actual player data in it. + int headerX, headerY, headerWidth, headerHeight; + + m_HeaderGrid.getBounds( headerX, headerY, headerWidth, headerHeight ); + m_PlayerList.setBounds( headerX, headerY+headerHeight, headerWidth, tall - headerY - headerHeight - 6 ); + m_PlayerList.setBgColor( 0, 0, 0, 255 ); + m_PlayerList.setParent( this ); + + for( int row=0; row < NUM_ROWS; row++ ) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + + pGridRow->SetDimensions( NUM_COLUMNS, 1 ); + + for( int col = 0; col < NUM_COLUMNS; col++ ) + { + m_PlayerEntries[col][row].setContentFitted( false ); + m_PlayerEntries[col][row].setRow( row ); + m_PlayerEntries[col][row].addInputSignal( this ); + pGridRow->SetEntry(col, 0, &m_PlayerEntries[col][row]); + } + + pGridRow->setBgColor( 0, 0, 0, 255 ); + pGridRow->SetSpacing( 0, 0 ); + pGridRow->CopyColumnWidths( &m_HeaderGrid ); + pGridRow->AutoSetRowHeights(); + pGridRow->setSize( PanelWidth( pGridRow ), pGridRow->CalcDrawHeight() ); + pGridRow->RepositionContents(); + + m_PlayerList.AddItem( pGridRow ); + } + + // Add the hit test panel. It is invisible and traps mouse clicks so we can go into squelch mode. + m_HitTestPanel.setBgColor( 0, 0, 0, 255 ); + m_HitTestPanel.setParent( this ); + m_HitTestPanel.setBounds( 0, 0, wide, tall ); + m_HitTestPanel.addInputSignal( this ); + + m_pCloseButton = new CommandButton( "x", wide - XRES( 12 + 4 ), YRES( 2 ), XRES( 12 ) , YRES( 12 ) ); + m_pCloseButton->setParent( this ); + m_pCloseButton->addActionSignal( new CMenuHandler_StringCommandWatch( "-showscores", true ) ); + m_pCloseButton->setBgColor( 0, 0, 0, 255 ); + m_pCloseButton->setFgColor( 255, 255, 255, 0 ); + m_pCloseButton->setFont( tfont ); + m_pCloseButton->setBoundKey( (char)255 ); + m_pCloseButton->setContentAlignment( Label::a_center ); + + Initialize(); +} + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void ScorePanel::Initialize( void ) +{ + // Clear out scoreboard data + m_iLastKilledBy = 0; + m_fLastKillTime = 0; + m_iPlayerNum = 0; + m_iNumTeams = 0; + memset( g_PlayerExtraInfo, 0, sizeof g_PlayerExtraInfo ); + memset( g_TeamInfo, 0, sizeof g_TeamInfo ); +} + +bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] ) +{ + return !!gEngfuncs.GetPlayerUniqueID( iPlayer, playerID ); // TODO remove after testing +} + +//----------------------------------------------------------------------------- +// Purpose: Recalculate the internal scoreboard data +//----------------------------------------------------------------------------- +void ScorePanel::Update() +{ + int i; + + // Set the title + if( gViewPort->m_szServerName[0] != '\0' ) + { + char sz[MAX_SERVERNAME_LENGTH + 16]; + + sprintf( sz, "%s", gViewPort->m_szServerName ); + m_TitleLabel.setText( sz ); + } + + m_iRows = 0; + gViewPort->GetAllPlayersInfo(); + + // Clear out sorts + for (i = 0; i < NUM_ROWS; i++) + { + m_iSortedRows[i] = 0; + m_iIsATeam[i] = TEAM_NO; + } + for (i = 0; i < MAX_PLAYERS; i++) + { + m_bHasBeenSorted[i] = false; + } + + // If it's not teamplay, sort all the players. Otherwise, sort the teams. + if( !gHUD.m_Teamplay ) + SortPlayers( 0, NULL ); + else + SortTeams(); + + // set scrollbar range + m_PlayerList.SetScrollRange(m_iRows); + + FillGrid(); + + if( gViewPort->m_pSpectatorPanel->m_menuVisible ) + { + m_pCloseButton->setVisible ( true ); + } + else + { + m_pCloseButton->setVisible ( false ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Sort all the teams +//----------------------------------------------------------------------------- +void ScorePanel::SortTeams() +{ + // clear out team scores + int i; + for ( i = 1; i <= m_iNumTeams; i++ ) + { + if( !g_TeamInfo[i].scores_overriden ) + g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0; + g_TeamInfo[i].ping = g_TeamInfo[i].packetloss = 0; + } + + // recalc the team scores, then draw them + for( i = 1; i < MAX_PLAYERS; i++ ) + { + if( g_PlayerInfoList[i].name == 0 ) + continue; // empty player slot, skip + + if( g_PlayerExtraInfo[i].teamname[0] == 0 ) + continue; // skip over players who are not in a team + + // find what team this player is in + int j; + for ( j = 1; j <= m_iNumTeams; j++ ) + { + if( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) ) + break; + } + if( j > m_iNumTeams ) // player is not in a team, skip to the next guy + continue; + + if( !g_TeamInfo[j].scores_overriden ) + { + g_TeamInfo[j].frags += g_PlayerExtraInfo[i].frags; + g_TeamInfo[j].deaths += g_PlayerExtraInfo[i].deaths; + } + + g_TeamInfo[j].ping += g_PlayerInfoList[i].ping; + g_TeamInfo[j].packetloss += g_PlayerInfoList[i].packetloss; + + if( g_PlayerInfoList[i].thisplayer ) + g_TeamInfo[j].ownteam = TRUE; + else + g_TeamInfo[j].ownteam = FALSE; + + // Set the team's number (used for team colors) + g_TeamInfo[j].teamnumber = g_PlayerExtraInfo[i].teamnumber; + } + + // find team ping/packetloss averages + for( i = 1; i <= m_iNumTeams; i++ ) + { + g_TeamInfo[i].already_drawn = FALSE; + + if( g_TeamInfo[i].players > 0 ) + { + g_TeamInfo[i].ping /= g_TeamInfo[i].players; // use the average ping of all the players in the team as the teams ping + g_TeamInfo[i].packetloss /= g_TeamInfo[i].players; // use the average ping of all the players in the team as the teams ping + } + } + + // Draw the teams + while( 1 ) + { + int highest_frags = -99999; int lowest_deaths = 99999; + int best_team = 0; + + for( i = 1; i <= m_iNumTeams; i++ ) + { + if( g_TeamInfo[i].players < 1 ) + continue; + + if( !g_TeamInfo[i].already_drawn && g_TeamInfo[i].frags >= highest_frags ) + { + if( g_TeamInfo[i].frags > highest_frags || g_TeamInfo[i].deaths < lowest_deaths ) + { + best_team = i; + lowest_deaths = g_TeamInfo[i].deaths; + highest_frags = g_TeamInfo[i].frags; + } + } + } + + // draw the best team on the scoreboard + if( !best_team ) + break; + + // Put this team in the sorted list + m_iSortedRows[m_iRows] = best_team; + m_iIsATeam[m_iRows] = TEAM_YES; + g_TeamInfo[best_team].already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get sorted again + m_iRows++; + + // Now sort all the players on this team + SortPlayers( 0, g_TeamInfo[best_team].name ); + } + + // Add all the players who aren't in a team yet into spectators + SortPlayers( TEAM_SPECTATORS, NULL ); +} + +//----------------------------------------------------------------------------- +// Purpose: Sort a list of players +//----------------------------------------------------------------------------- +void ScorePanel::SortPlayers( int iTeam, char *team ) +{ + bool bCreatedTeam = false; + + // draw the players, in order, and restricted to team if set + while ( 1 ) + { + // Find the top ranking player + int highest_frags = -99999; int lowest_deaths = 99999; + int best_player; + best_player = 0; + + for ( int i = 1; i < MAX_PLAYERS; i++ ) + { + if ( m_bHasBeenSorted[i] == false && g_PlayerInfoList[i].name && g_PlayerExtraInfo[i].frags >= highest_frags ) + { + cl_entity_t *ent = gEngfuncs.GetEntityByIndex( i ); + + if ( ent && !(team && stricmp(g_PlayerExtraInfo[i].teamname, team)) ) + { + extra_player_info_t *pl_info = &g_PlayerExtraInfo[i]; + if ( pl_info->frags > highest_frags || pl_info->deaths < lowest_deaths ) + { + best_player = i; + lowest_deaths = pl_info->deaths; + highest_frags = pl_info->frags; + } + } + } + } + + if ( !best_player ) + break; + + // If we haven't created the Team yet, do it first + if (!bCreatedTeam && iTeam) + { + m_iIsATeam[ m_iRows ] = iTeam; + m_iRows++; + + bCreatedTeam = true; + } + + // Put this player in the sorted list + m_iSortedRows[ m_iRows ] = best_player; + m_bHasBeenSorted[ best_player ] = true; + m_iRows++; + } + + if (team) + { + m_iIsATeam[m_iRows++] = TEAM_BLANK; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Recalculate the existing teams in the match +//----------------------------------------------------------------------------- +void ScorePanel::RebuildTeams() +{ + // clear out player counts from teams + int i; + for ( i = 1; i <= m_iNumTeams; i++ ) + { + g_TeamInfo[i].players = 0; + } + + // rebuild the team list + gViewPort->GetAllPlayersInfo(); + m_iNumTeams = 0; + for ( i = 1; i < MAX_PLAYERS; i++ ) + { + if ( g_PlayerInfoList[i].name == NULL ) + continue; + + if ( g_PlayerExtraInfo[i].teamname[0] == 0 ) + continue; // skip over players who are not in a team + + // is this player in an existing team? + int j; + for ( j = 1; j <= m_iNumTeams; j++ ) + { + if ( g_TeamInfo[j].name[0] == '\0' ) + break; + + if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) ) + break; + } + + if ( j > m_iNumTeams ) + { // they aren't in a listed team, so make a new one + // search through for an empty team slot + for ( j = 1; j <= m_iNumTeams; j++ ) + { + if ( g_TeamInfo[j].name[0] == '\0' ) + break; + } + m_iNumTeams = Q_max( j, m_iNumTeams ); + + strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); + g_TeamInfo[j].players = 0; + } + + g_TeamInfo[j].players++; + } + + // clear out any empty teams + for ( i = 1; i <= m_iNumTeams; i++ ) + { + if ( g_TeamInfo[i].players < 1 ) + memset( &g_TeamInfo[i], 0, sizeof(team_info_t) ); + } + + // Update the scoreboard + Update(); +} + + +void ScorePanel::FillGrid() +{ + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + SchemeHandle_t hScheme = pSchemes->getSchemeHandle("Scoreboard Text"); + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle("Scoreboard Title Text"); + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle("Scoreboard Small Text"); + + Font *sfont = pSchemes->getFont(hScheme); + Font *tfont = pSchemes->getFont(hTitleScheme); + Font *smallfont = pSchemes->getFont(hSmallScheme); + + // update highlight position + int x, y; + getApp()->getCursorPos(x, y); + cursorMoved(x, y, this); + + // remove highlight row if we're not in squelch mode + if (!GetClientVoiceMgr()->IsInSquelchMode()) + { + m_iHighlightRow = -1; + } + + bool bNextRowIsGap = false; + int row; + for(row=0; row < NUM_ROWS; row++) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + pGridRow->SetRowUnderline(0, false, 0, 0, 0, 0, 0); + + if(row >= m_iRows) + { + for(int col=0; col < NUM_COLUMNS; col++) + m_PlayerEntries[col][row].setVisible(false); + + continue; + } + + bool bRowIsGap = false; + if (bNextRowIsGap) + { + bNextRowIsGap = false; + bRowIsGap = true; + } + + for(int col=0; col < NUM_COLUMNS; col++) + { + CLabelHeader *pLabel = &m_PlayerEntries[col][row]; + + pLabel->setVisible(true); + pLabel->setText2(""); + pLabel->setImage(NULL); + pLabel->setFont(sfont); + pLabel->setTextOffset(0, 0); + + int rowheight = 13; + if (ScreenHeight > 480) + { + rowheight = YRES(rowheight); + } + else + { + // more tweaking, make sure icons fit at low res + rowheight = 15; + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setBgColor(0, 0, 0, 255); + + char sz[128]; + hud_player_info_t *pl_info = NULL; + team_info_t *team_info = NULL; + + if (m_iIsATeam[row] == TEAM_BLANK) + { + pLabel->setText(" "); + continue; + } + else if ( m_iIsATeam[row] == TEAM_YES ) + { + // Get the team's data + team_info = &g_TeamInfo[ m_iSortedRows[row] ]; + + // team color text for team names + pLabel->setFgColor( iTeamColors[team_info->teamnumber % iNumberOfTeamColors][0], + iTeamColors[team_info->teamnumber % iNumberOfTeamColors][1], + iTeamColors[team_info->teamnumber % iNumberOfTeamColors][2], + 0 ); + + // different height for team header rows + rowheight = 20; + if (ScreenHeight >= 480) + { + rowheight = YRES(rowheight); + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setFont(tfont); + + pGridRow->SetRowUnderline( 0, + true, + YRES(3), + iTeamColors[team_info->teamnumber % iNumberOfTeamColors][0], + iTeamColors[team_info->teamnumber % iNumberOfTeamColors][1], + iTeamColors[team_info->teamnumber % iNumberOfTeamColors][2], + 0 ); + } + else if ( m_iIsATeam[row] == TEAM_SPECTATORS ) + { + // grey text for spectators + pLabel->setFgColor(100, 100, 100, 0); + + // different height for team header rows + rowheight = 20; + if (ScreenHeight >= 480) + { + rowheight = YRES(rowheight); + } + pLabel->setSize(pLabel->getWide(), rowheight); + pLabel->setFont(tfont); + + pGridRow->SetRowUnderline(0, true, YRES(3), 100, 100, 100, 0); + } + else + { + // team color text for player names + pLabel->setFgColor( iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][0], + iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][1], + iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][2], + 0 ); + + // Get the player's data + pl_info = &g_PlayerInfoList[ m_iSortedRows[row] ]; + + // Set background color + if ( pl_info->thisplayer ) // if it is their name, draw it a different color + { + // Highlight this player + pLabel->setFgColor(Scheme::sc_white); + pLabel->setBgColor( iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][0], + iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][1], + iTeamColors[ g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber % iNumberOfTeamColors ][2], + 196 ); + } + else if ( m_iSortedRows[row] == m_iLastKilledBy && m_fLastKillTime && m_fLastKillTime > gHUD.m_flTime ) + { + // Killer's name + pLabel->setBgColor( 255,0,0, 255 - ((float)15 * (float)(m_fLastKillTime - gHUD.m_flTime)) ); + } + } + + // Align + if (col == COLUMN_NAME || col == COLUMN_CLASS) + { + pLabel->setContentAlignment( vgui::Label::a_west ); + } + else if (col == COLUMN_TRACKER) + { + pLabel->setContentAlignment( vgui::Label::a_center ); + } + else + { + pLabel->setContentAlignment( vgui::Label::a_east ); + } + + // Fill out with the correct data + strcpy(sz, ""); + if ( m_iIsATeam[row] ) + { + char sz2[128]; + + switch (col) + { + case COLUMN_NAME: + if ( m_iIsATeam[row] == TEAM_SPECTATORS ) + { + sprintf( sz2, "%s", CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ) ); + } + else + { + sprintf( sz2, "%s", gViewPort->GetTeamName(team_info->teamnumber) ); + } + + strcpy(sz, sz2); + + // Append the number of players + if ( m_iIsATeam[row] == TEAM_YES ) + { + if (team_info->players == 1) + { + sprintf(sz2, "(%d %s)", team_info->players, CHudTextMessage::BufferedLocaliseTextString( "#Player" ) ); + } + else + { + sprintf(sz2, "(%d %s)", team_info->players, CHudTextMessage::BufferedLocaliseTextString( "#Player_plural" ) ); + } + + pLabel->setText2(sz2); + pLabel->setFont2(smallfont); + } + break; + case COLUMN_VOICE: + break; + case COLUMN_CLASS: + break; + case COLUMN_KILLS: + if ( m_iIsATeam[row] == TEAM_YES ) + sprintf(sz, "%d", team_info->frags ); + break; + case COLUMN_DEATHS: + if ( m_iIsATeam[row] == TEAM_YES ) + sprintf(sz, "%d", team_info->deaths ); + break; + case COLUMN_LATENCY: + if ( m_iIsATeam[row] == TEAM_YES ) + sprintf(sz, "%d", team_info->ping ); + break; + default: + break; + } + } + else + { + bool bShowClass = false; + + switch (col) + { + case COLUMN_NAME: + /* + if (g_pTrackerUser) + { + int playerSlot = m_iSortedRows[row]; + int trackerID = gEngfuncs.GetTrackerIDForPlayer(playerSlot); + const char *trackerName = g_pTrackerUser->GetUserName(trackerID); + if (trackerName && *trackerName) + { + sprintf(sz, " (%s)", trackerName); + pLabel->setText2(sz); + } + } + */ + sprintf(sz, "%s ", pl_info->name); + break; + case COLUMN_VOICE: + sz[0] = 0; + // in HLTV mode allow spectator to turn on/off commentator voice + //if (!pl_info->thisplayer || gEngfuncs.IsSpectateOnly() ) + //{ + GetClientVoiceMgr()->UpdateSpeakerImage(pLabel, m_iSortedRows[row]); + //} + break; + case COLUMN_CLASS: + // No class for other team's members (unless allied or spectator) + if ( gViewPort && EV_TFC_IsAllyTeam( g_iTeamNumber, g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber ) ) + bShowClass = true; + // Don't show classes if this client hasnt picked a team yet + if ( g_iTeamNumber == 0 ) + bShowClass = false; +#ifdef _TFC + // in TFC show all classes in spectator mode + if ( g_iUser1 ) + bShowClass = true; +#endif + + if (bShowClass) + { + // Only print Civilian if this team are all civilians + bool bNoClass = false; + if ( g_PlayerExtraInfo[ m_iSortedRows[row] ].playerclass == 0 ) + { + if ( gViewPort->GetValidClasses( g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber ) != -1 ) + bNoClass = true; + } + + if (bNoClass) + sz[0] = '\0'; + else + sprintf( sz, "%s", CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[ g_PlayerExtraInfo[ m_iSortedRows[row] ].playerclass ] ) ); + } + else + { + sz[0] = '\0'; + } + break; + + case COLUMN_TRACKER: + /* + if (g_pTrackerUser) + { + int playerSlot = m_iSortedRows[row]; + int trackerID = gEngfuncs.GetTrackerIDForPlayer(playerSlot); + + if (g_pTrackerUser->IsFriend(trackerID) && trackerID != g_pTrackerUser->GetTrackerID()) + { + pLabel->setImage(m_pTrackerIcon); + pLabel->setFgColorAsImageColor(false); + m_pTrackerIcon->setColor(Color(255, 255, 255, 0)); + } + } + */ + break; + +#ifdef _TFC + case COLUMN_KILLS: + if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) + sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].frags ); + break; + case COLUMN_DEATHS: + if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) + sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].deaths ); + break; + case COLUMN_LATENCY: + if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) + sprintf(sz, "%d", g_PlayerInfoList[ m_iSortedRows[row] ].ping ); + break; +#else + case COLUMN_KILLS: + sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].frags ); + break; + case COLUMN_DEATHS: + sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].deaths ); + break; + case COLUMN_LATENCY: + sprintf(sz, "%d", g_PlayerInfoList[ m_iSortedRows[row] ].ping ); + break; +#endif + default: + break; + } + } + + pLabel->setText(sz); + } + } + + for(row=0; row < NUM_ROWS; row++) + { + CGrid *pGridRow = &m_PlayerGrids[row]; + + pGridRow->AutoSetRowHeights(); + pGridRow->setSize(PanelWidth(pGridRow), pGridRow->CalcDrawHeight()); + pGridRow->RepositionContents(); + } + + // hack, for the thing to resize + m_PlayerList.getSize(x, y); + m_PlayerList.setSize(x, y); +} + + +//----------------------------------------------------------------------------- +// Purpose: Setup highlights for player names in scoreboard +//----------------------------------------------------------------------------- +void ScorePanel::DeathMsg( int killer, int victim ) +{ + // if we were the one killed, or the world killed us, set the scoreboard to indicate suicide + if ( victim == m_iPlayerNum || killer == 0 ) + { + m_iLastKilledBy = killer ? killer : m_iPlayerNum; + m_fLastKillTime = gHUD.m_flTime + 10; // display who we were killed by for 10 seconds + + if ( killer == m_iPlayerNum ) + m_iLastKilledBy = m_iPlayerNum; + } +} + + +void ScorePanel::Open( void ) +{ + RebuildTeams(); + setVisible(true); + m_HitTestPanel.setVisible(true); +} + + +void ScorePanel::mousePressed(MouseCode code, Panel* panel) +{ + if(gHUD.m_iIntermission) + return; + + if (!GetClientVoiceMgr()->IsInSquelchMode()) + { + GetClientVoiceMgr()->StartSquelchMode(); + m_HitTestPanel.setVisible(false); + } + else if (m_iHighlightRow >= 0) + { + // mouse has been pressed, toggle mute state + int iPlayer = m_iSortedRows[m_iHighlightRow]; + if (iPlayer > 0) + { + // print text message + hud_player_info_t *pl_info = &g_PlayerInfoList[iPlayer]; + + if (pl_info && pl_info->name && pl_info->name[0]) + { + char string[256]; + if (GetClientVoiceMgr()->IsPlayerBlocked(iPlayer)) + { + char string1[1024]; + + // remove mute + GetClientVoiceMgr()->SetPlayerBlockedState(iPlayer, false); + + sprintf( string1, CHudTextMessage::BufferedLocaliseTextString( "#Unmuted" ), pl_info->name ); + sprintf( string, "%c** %s\n", HUD_PRINTTALK, string1 ); + + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); + } + else + { + char string1[1024]; + char string2[1024]; + + // mute the player + GetClientVoiceMgr()->SetPlayerBlockedState(iPlayer, true); + + sprintf( string1, CHudTextMessage::BufferedLocaliseTextString( "#Muted" ), pl_info->name ); + sprintf( string2, "%s", CHudTextMessage::BufferedLocaliseTextString( "#No_longer_hear_that_player" ) ); + sprintf( string, "%c** %s %s\n", HUD_PRINTTALK, string1, string2 ); + + gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); + } + } + } + } +} + +void ScorePanel::cursorMoved(int x, int y, Panel *panel) +{ + if (GetClientVoiceMgr()->IsInSquelchMode()) + { + // look for which cell the mouse is currently over + for (int i = 0; i < NUM_ROWS; i++) + { + int row, col; + if (m_PlayerGrids[i].getCellAtPoint(x, y, row, col)) + { + MouseOverCell(i, col); + return; + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handles mouse movement over a cell +// Input : row - +// col - +//----------------------------------------------------------------------------- +void ScorePanel::MouseOverCell(int row, int col) +{ + CLabelHeader *label = &m_PlayerEntries[col][row]; + + // clear the previously highlighted label + if (m_pCurrentHighlightLabel != label) + { + m_pCurrentHighlightLabel = NULL; + m_iHighlightRow = -1; + } + if (!label) + return; + + // don't act on teams + if (m_iIsATeam[row] != TEAM_NO) + return; + + // don't act on disconnected players or ourselves + hud_player_info_t *pl_info = &g_PlayerInfoList[ m_iSortedRows[row] ]; + if (!pl_info->name || !pl_info->name[0]) + return; + + if (pl_info->thisplayer && !gEngfuncs.IsSpectateOnly() ) + return; + + // setup the new highlight + m_pCurrentHighlightLabel = label; + m_iHighlightRow = row; +} + +//----------------------------------------------------------------------------- +// Purpose: Label paint functions - take into account current highligh status +//----------------------------------------------------------------------------- +void CLabelHeader::paintBackground() +{ + Color oldBg; + getBgColor(oldBg); + + if (gViewPort->GetScoreBoard()->m_iHighlightRow == _row) + { + setBgColor(134, 91, 19, 0); + } + + Panel::paintBackground(); + + setBgColor(oldBg); +} + + +//----------------------------------------------------------------------------- +// Purpose: Label paint functions - take into account current highligh status +//----------------------------------------------------------------------------- +void CLabelHeader::paint() +{ + Color oldFg; + getFgColor(oldFg); + + if (gViewPort->GetScoreBoard()->m_iHighlightRow == _row) + { + setFgColor(255, 255, 255, 0); + } + + // draw text + int x, y, iwide, itall; + getTextSize(iwide, itall); + calcAlignment(iwide, itall, x, y); + _dualImage->setPos(x, y); + + int x1, y1; + _dualImage->GetImage(1)->getPos(x1, y1); + _dualImage->GetImage(1)->setPos(_gap, y1); + + _dualImage->doPaint(this); + + // get size of the panel and the image + if (_image) + { + Color imgColor; + getFgColor( imgColor ); + if( _useFgColorAsImageColor ) + { + _image->setColor( imgColor ); + } + + _image->getSize(iwide, itall); + calcAlignment(iwide, itall, x, y); + _image->setPos(x, y); + _image->doPaint(this); + } + + setFgColor(oldFg[0], oldFg[1], oldFg[2], oldFg[3]); +} + + +void CLabelHeader::calcAlignment(int iwide, int itall, int &x, int &y) +{ + // calculate alignment ourselves, since vgui is so broken + int wide, tall; + getSize(wide, tall); + + x = 0, y = 0; + + // align left/right + switch (_contentAlignment) + { + // left + case Label::a_northwest: + case Label::a_west: + case Label::a_southwest: + { + x = 0; + break; + } + + // center + case Label::a_north: + case Label::a_center: + case Label::a_south: + { + x = (wide - iwide) / 2; + break; + } + + // right + case Label::a_northeast: + case Label::a_east: + case Label::a_southeast: + { + x = wide - iwide; + break; + } + } + + // top/down + switch (_contentAlignment) + { + // top + case Label::a_northwest: + case Label::a_north: + case Label::a_northeast: + { + y = 0; + break; + } + + // center + case Label::a_west: + case Label::a_center: + case Label::a_east: + { + y = (tall - itall) / 2; + break; + } + + // south + case Label::a_southwest: + case Label::a_south: + case Label::a_southeast: + { + y = tall - itall; + break; + } + } + +// don't clip to Y +// if (y < 0) +// { +// y = 0; +// } + if (x < 0) + { + x = 0; + } + + x += _offset[0]; + y += _offset[1]; +} diff --git a/cl_dll/vgui_ScorePanel.h b/cl_dll/vgui_ScorePanel.h new file mode 100644 index 00000000..b17770a4 --- /dev/null +++ b/cl_dll/vgui_ScorePanel.h @@ -0,0 +1,311 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SCOREPANEL_H +#define SCOREPANEL_H + +#include +#include +#include +#include +#include +#include +#include "../game_shared/vgui_listbox.h" +#include "cl_util.h" + +#include + +#define MAX_SCORES 10 +#define MAX_SCOREBOARD_TEAMS 5 + +// Scoreboard cells +#define COLUMN_TRACKER 0 +#define COLUMN_NAME 1 +#define COLUMN_CLASS 2 +#define COLUMN_KILLS 3 +#define COLUMN_DEATHS 4 +#define COLUMN_LATENCY 5 +#define COLUMN_VOICE 6 +#define COLUMN_BLANK 7 +#define NUM_COLUMNS 8 +#define NUM_ROWS (MAX_PLAYERS + (MAX_SCOREBOARD_TEAMS * 2)) + +using namespace vgui; + +class CTextImage2 : public Image +{ +public: + CTextImage2() + { + _image[0] = new TextImage(""); + _image[1] = new TextImage(""); + } + + ~CTextImage2() + { + delete _image[0]; + delete _image[1]; + } + + TextImage *GetImage(int image) + { + return _image[image]; + } + + void getSize(int &wide, int &tall) + { + int w1, w2, t1, t2; + _image[0]->getTextSize(w1, t1); + _image[1]->getTextSize(w2, t2); + + wide = w1 + w2; + tall = Q_max(t1, t2); + setSize(wide, tall); + } + + void doPaint(Panel *panel) + { + _image[0]->doPaint(panel); + _image[1]->doPaint(panel); + } + + void setPos(int x, int y) + { + _image[0]->setPos(x, y); + + int swide, stall; + _image[0]->getSize(swide, stall); + + int wide, tall; + _image[1]->getSize(wide, tall); + _image[1]->setPos(x + wide, y + (stall * 0.9) - tall); + } + + void setColor(Color color) + { + _image[0]->setColor(color); + } + + void setColor2(Color color) + { + _image[1]->setColor(color); + } + +private: + TextImage *_image[2]; + +}; + +//----------------------------------------------------------------------------- +// Purpose: Custom label for cells in the Scoreboard's Table Header +//----------------------------------------------------------------------------- +class CLabelHeader : public Label +{ +public: + CLabelHeader() : Label("") + { + _dualImage = new CTextImage2(); + _dualImage->setColor2(Color(255, 170, 0, 0)); + _row = -2; + _useFgColorAsImageColor = true; + _offset[0] = 0; + _offset[1] = 0; + } + + ~CLabelHeader() + { + delete _dualImage; + } + + void setRow(int row) + { + _row = row; + } + + void setFgColorAsImageColor(bool state) + { + _useFgColorAsImageColor = state; + } + + virtual void setText(int textBufferLen, const char* text) + { + _dualImage->GetImage(0)->setText(text); + + // calculate the text size + Font *font = _dualImage->GetImage(0)->getFont(); + _gap = 0; + for (const char *ch = text; *ch != 0; ch++) + { + int a, b, c; + font->getCharABCwide(*ch, a, b, c); + _gap += (a + b + c); + } + + _gap += XRES(5); + } + + virtual void setText(const char* text) + { + // strip any non-alnum characters from the end + char buf[512]; + strcpy(buf, text); + + int len = strlen(buf); + while (len && isspace(buf[--len])) + { + buf[len] = 0; + } + + CLabelHeader::setText(0, buf); + } + + void setText2(const char *text) + { + _dualImage->GetImage(1)->setText(text); + } + + void getTextSize(int &wide, int &tall) + { + _dualImage->getSize(wide, tall); + } + + void setFgColor(int r,int g,int b,int a) + { + Label::setFgColor(r,g,b,a); + Color color(r,g,b,a); + _dualImage->setColor(color); + _dualImage->setColor2(color); + repaint(); + } + + void setFgColor(Scheme::SchemeColor sc) + { + int r, g, b, a; + Label::setFgColor(sc); + Label::getFgColor( r, g, b, a ); + + // Call the r,g,b,a version so it sets the color in the dualImage.. + setFgColor( r, g, b, a ); + } + + void setFont(Font *font) + { + _dualImage->GetImage(0)->setFont(font); + } + + void setFont2(Font *font) + { + _dualImage->GetImage(1)->setFont(font); + } + + // this adjust the absolute position of the text after alignment is calculated + void setTextOffset(int x, int y) + { + _offset[0] = x; + _offset[1] = y; + } + + void paint(); + void paintBackground(); + void calcAlignment(int iwide, int itall, int &x, int &y); + +private: + CTextImage2 *_dualImage; + int _row; + int _gap; + int _offset[2]; + bool _useFgColorAsImageColor; +}; + +class ScoreTablePanel; + +#include "../game_shared/vgui_grid.h" +#include "../game_shared/vgui_defaultinputsignal.h" + +//----------------------------------------------------------------------------- +// Purpose: Scoreboard back panel +//----------------------------------------------------------------------------- +class ScorePanel : public Panel, public vgui::CDefaultInputSignal +{ +private: + // Default panel implementation doesn't forward mouse messages when there is no cursor and we need them. + class HitTestPanel : public Panel + { + public: + virtual void internalMousePressed(MouseCode code); + }; + + +private: + + Label m_TitleLabel; + + // Here is how these controls are arranged hierarchically. + // m_HeaderGrid + // m_HeaderLabels + + // m_PlayerGridScroll + // m_PlayerGrid + // m_PlayerEntries + + CGrid m_HeaderGrid; + CLabelHeader m_HeaderLabels[NUM_COLUMNS]; // Labels above the + CLabelHeader *m_pCurrentHighlightLabel; + int m_iHighlightRow; + + vgui::CListBox m_PlayerList; + CGrid m_PlayerGrids[NUM_ROWS]; // The grid with player and team info. + CLabelHeader m_PlayerEntries[NUM_COLUMNS][NUM_ROWS]; // Labels for the grid entries. + + ScorePanel::HitTestPanel m_HitTestPanel; + CommandButton *m_pCloseButton; + CLabelHeader* GetPlayerEntry(int x, int y) {return &m_PlayerEntries[x][y];} + +public: + + int m_iNumTeams; + int m_iPlayerNum; + int m_iShowscoresHeld; + + int m_iRows; + int m_iSortedRows[NUM_ROWS]; + int m_iIsATeam[NUM_ROWS]; + bool m_bHasBeenSorted[MAX_PLAYERS]; + int m_iLastKilledBy; + int m_fLastKillTime; + + +public: + + ScorePanel(int x,int y,int wide,int tall); + + void Update( void ); + + void SortTeams( void ); + void SortPlayers( int iTeam, char *team ); + void RebuildTeams( void ); + + void FillGrid(); + + void DeathMsg( int killer, int victim ); + + void Initialize( void ); + + void Open( void ); + + void MouseOverCell(int row, int col); + +// InputSignal overrides. +public: + + virtual void mousePressed(MouseCode code, Panel* panel); + virtual void cursorMoved(int x, int y, Panel *panel); + + friend class CLabelHeader; +}; + +#endif diff --git a/cl_dll/vgui_SpectatorPanel.cpp b/cl_dll/vgui_SpectatorPanel.cpp new file mode 100644 index 00000000..4b2b897c --- /dev/null +++ b/cl_dll/vgui_SpectatorPanel.cpp @@ -0,0 +1,420 @@ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// vgui_SpectatorPanel.cpp: implementation of the SpectatorPanel class. +// +////////////////////////////////////////////////////////////////////// + +#include "hud.h" +#include "cl_util.h" +#include "const.h" +#include "entity_state.h" +#include "cl_entity.h" +#include "pm_shared.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_SpectatorPanel.h" +#include "vgui_ScorePanel.h" + +//#include "Exports.h" + +/* +========================== +HUD_ChatInputPosition + +Sets the location of the input for chat text +========================== +*/ + +void DLLEXPORT HUD_ChatInputPosition( int *x, int *y ) +{ +// RecClChatInputPosition( x, y ); + + if ( g_iUser1 != 0 || gEngfuncs.IsSpectateOnly() ) + { + if ( gHUD.m_Spectator.m_pip->value == INSET_OFF ) + { + *y = YRES( PANEL_HEIGHT ); + } + else + { + *y = YRES( gHUD.m_Spectator.m_OverviewData.insetWindowHeight + 5 ); + } + } +} + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +SpectatorPanel::SpectatorPanel( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) +{ +} + +SpectatorPanel::~SpectatorPanel() +{ +} + +void SpectatorPanel::ActionSignal( int cmd ) +{ + switch( cmd ) + { + case SPECTATOR_PANEL_CMD_NONE : break; + + case SPECTATOR_PANEL_CMD_OPTIONS : gViewPort->ShowCommandMenu( gViewPort->m_SpectatorOptionsMenu ); + break; + + case SPECTATOR_PANEL_CMD_NEXTPLAYER : gHUD.m_Spectator.FindNextPlayer(true); + break; + + case SPECTATOR_PANEL_CMD_PREVPLAYER : gHUD.m_Spectator.FindNextPlayer(false); + break; + + case SPECTATOR_PANEL_CMD_PLAYERS : gViewPort->ShowCommandMenu( gViewPort->m_PlayerMenu ); + break; + + case SPECTATOR_PANEL_CMD_HIDEMENU : ShowMenu(false); + break; + + case SPECTATOR_PANEL_CMD_CAMERA : gViewPort->ShowCommandMenu( gViewPort->m_SpectatorCameraMenu ); + break; + + case SPECTATOR_PANEL_CMD_TOGGLE_INSET : gHUD.m_Spectator.SetModes( -1, + gHUD.m_Spectator.ToggleInset(false) ); + break; + + + default : gEngfuncs.Con_DPrintf("Unknown SpectatorPanel ActionSingal %i.\n",cmd); break; + } +} + +void SpectatorPanel::Initialize() +{ + int x, y, wide, tall; + + getBounds( x, y, wide, tall ); + + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle( "Team Info Text" ); + + m_TopBorder = new CTransparentPanel( 64, 0, 0, ScreenWidth, YRES( PANEL_HEIGHT ) ); + m_TopBorder->setParent( this ); + + m_BottomBorder = new CTransparentPanel( 64, 0, ScreenHeight - YRES( 32 ), ScreenWidth, YRES( PANEL_HEIGHT ) ); + m_BottomBorder->setParent( this ); + + setPaintBackgroundEnabled( false ); + + m_ExtraInfo = new Label( "Extra Info", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_ExtraInfo->setParent( m_TopBorder ); + m_ExtraInfo->setFont( pSchemes->getFont( hSmallScheme ) ); + + m_ExtraInfo->setPaintBackgroundEnabled( false ); + m_ExtraInfo->setFgColor( 143, 143, 54, 0 ); + m_ExtraInfo->setContentAlignment( vgui::Label::a_west ); + + m_TimerImage = new CImageLabel( "timer", 0, 0, 14, 14 ); + m_TimerImage->setParent( m_TopBorder ); + + m_TopBanner = new CImageLabel( "banner", 0, 0, XRES( BANNER_WIDTH ), YRES( BANNER_HEIGHT ) ); + m_TopBanner->setParent( this ); + + m_CurrentTime = new Label( "00:00", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_CurrentTime->setParent( m_TopBorder ); + m_CurrentTime->setFont( pSchemes->getFont( hSmallScheme ) ); + m_CurrentTime->setPaintBackgroundEnabled( false ); + m_CurrentTime->setFgColor( 143, 143, 54, 0 ); + m_CurrentTime->setContentAlignment( vgui::Label::a_west ); + + m_Separator = new Panel( 0, 0, XRES( 64 ), YRES( 96 ) ); + m_Separator->setParent( m_TopBorder ); + m_Separator->setFgColor( 59, 58, 34, 48 ); + m_Separator->setBgColor( 59, 58, 34, 48 ); + + for( int j = 0; j < TEAM_NUMBER; j++ ) + { + m_TeamScores[j] = new Label( " ", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_TeamScores[j]->setParent( m_TopBorder ); + m_TeamScores[j]->setFont( pSchemes->getFont( hSmallScheme ) ); + m_TeamScores[j]->setPaintBackgroundEnabled( false ); + m_TeamScores[j]->setFgColor( 143, 143, 54, 0 ); + m_TeamScores[j]->setContentAlignment( vgui::Label::a_west ); + m_TeamScores[j]->setVisible( false ); + } + + // Initialize command buttons. +// m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES(15), YRES(6), XRES(OPTIONS_BUTTON_X), YRES(20), false, false ); + m_OptionButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES(15), YRES(6), XRES(OPTIONS_BUTTON_X), YRES(20), false, false ); + m_OptionButton->setParent( m_BottomBorder ); + m_OptionButton->setContentAlignment( vgui::Label::a_center ); + m_OptionButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_OptionButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_OPTIONS ) ); + m_OptionButton->setUnArmedBorderColor( 59, 58, 34, 48 ); + m_OptionButton->setArmedBorderColor( 194, 202, 54, 0 ); + m_OptionButton->setUnArmedColor( 143, 143, 54, 0 ); + m_OptionButton->setArmedColor( 194, 202, 54, 0 ); + + m_CamButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#CAM_OPTIONS" ), ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ), YRES(6), XRES ( CAMOPTIONS_BUTTON_X ), YRES(20), false, false ); + m_CamButton->setParent( m_BottomBorder ); + m_CamButton->setContentAlignment( vgui::Label::a_center ); + m_CamButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_CamButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_CAMERA ) ); + m_CamButton->setUnArmedBorderColor( 59, 58, 34, 48 ); + m_CamButton->setArmedBorderColor( 194, 202, 54, 0 ); + m_CamButton->setUnArmedColor( 143, 143, 54, 0 ); + m_CamButton->setArmedColor( 194, 202, 54, 0 ); + +// m_PrevPlayerButton= new ColorButton("<", XRES( 15 + OPTIONS_BUTTON_X + 15 ), YRES(6), XRES(24), YRES(20), false, false ); + m_PrevPlayerButton= new CImageButton("arrowleft", XRES( 15 + OPTIONS_BUTTON_X + 15 ), YRES(6), XRES(24), YRES(20), false, false ); + m_PrevPlayerButton->setParent( m_BottomBorder ); + m_PrevPlayerButton->setContentAlignment( vgui::Label::a_center ); + m_PrevPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_PrevPlayerButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_PREVPLAYER ) ); + m_PrevPlayerButton->setUnArmedBorderColor( 59, 58, 34, 48 ); + m_PrevPlayerButton->setArmedBorderColor( 194, 202, 54, 0 ); + m_PrevPlayerButton->setUnArmedColor( 143, 143, 54, 0 ); + m_PrevPlayerButton->setArmedColor( 194, 202, 54, 0 ); + +// m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES(6), XRES(24), YRES(20),false, false ); + m_NextPlayerButton= new CImageButton("arrowright", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES(6), XRES(24), YRES(20),false, false ); + m_NextPlayerButton->setParent( m_BottomBorder ); + m_NextPlayerButton->setContentAlignment( vgui::Label::a_center ); + m_NextPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_NextPlayerButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_NEXTPLAYER ) ); + m_NextPlayerButton->setUnArmedBorderColor( 59, 58, 34, 48 ); + m_NextPlayerButton->setArmedBorderColor( 194, 202, 54, 0 ); + m_NextPlayerButton->setUnArmedColor( 143, 143, 54, 0 ); + m_NextPlayerButton->setArmedColor( 194, 202, 54, 0 ); + + // Initialize the bottom title. + float flLabelSize = ( ( ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ) ) - XRES( 24 + 15 ) ) - XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 38 ); + + m_BottomMainButton = new DropDownButton("Spectator Bottom", + XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6), flLabelSize, YRES(20), + false, false ); + + m_BottomMainButton->setParent(m_BottomBorder); + m_BottomMainButton->setPaintBackgroundEnabled(false); + m_BottomMainButton->setFgColor( Scheme::sc_primary1 ); + m_BottomMainButton->setContentAlignment( vgui::Label::a_center ); + m_BottomMainButton->setBorder( new LineBorder( Color( 59, 58, 34, 48 ) ) ); + m_BottomMainButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name + m_BottomMainButton->addActionSignal( new CSpectatorHandler_Command(this,SPECTATOR_PANEL_CMD_PLAYERS) ); + m_BottomMainButton->setUnArmedBorderColor ( 59, 58, 34, 48 ); + m_BottomMainButton->setArmedBorderColor ( 194, 202, 54, 0 ); + m_BottomMainButton->setUnArmedColor ( 143, 143, 54, 0 ); + m_BottomMainButton->setArmedColor ( 194, 202, 54, 0 ); + + + m_BottomMainLabel = new Label("Spectator Bottom", + XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6), flLabelSize, YRES(20)); + + m_BottomMainLabel->setParent( m_BottomBorder ); + m_BottomMainLabel->setPaintBackgroundEnabled( false ); + m_BottomMainLabel->setFgColor( Scheme::sc_primary1 ); + m_BottomMainLabel->setContentAlignment( vgui::Label::a_center ); + m_BottomMainLabel->setBorder( NULL ); + m_BottomMainLabel->setVisible(false); + + m_InsetViewButton = new ColorButton( "", XRES( 2 ), YRES( 2 ), XRES( 240 ), YRES( 180 ), false, false ); + m_InsetViewButton->setParent( this ); + m_InsetViewButton->setBoundKey( (char)255 ); + m_InsetViewButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_TOGGLE_INSET ) ); + m_InsetViewButton->setUnArmedBorderColor( 59, 58, 34, 48 ); + m_InsetViewButton->setArmedBorderColor( 194, 202, 54, 0 ); + m_InsetViewButton->setUnArmedColor( 143, 143, 54, 0 ); + m_InsetViewButton->setArmedColor( 194, 202, 54, 0 ); + + m_menuVisible = false; + m_insetVisible = false; + // m_HideButton->setVisible( false ); + m_CamButton->setVisible( false ); + m_OptionButton->setVisible( false ); + m_NextPlayerButton->setVisible( false ); + m_PrevPlayerButton->setVisible( false ); + m_TopBanner->setVisible( false ); + m_ExtraInfo->setVisible( false ); + m_Separator->setVisible( false ); + m_TimerImage->setVisible( false ); +} + +void SpectatorPanel::ShowMenu( bool isVisible ) +{ +// m_HideButton->setVisible(isVisible); m_HideButton->setArmed( false ); + m_OptionButton->setVisible(isVisible); m_OptionButton->setArmed( false ); + m_CamButton->setVisible(isVisible); m_CamButton->setArmed( false ); + m_NextPlayerButton->setVisible(isVisible); m_NextPlayerButton->setArmed( false ); + m_PrevPlayerButton->setVisible(isVisible); m_PrevPlayerButton->setArmed( false ); + + if( !isVisible ) + { + int iLabelSizeX, iLabelSizeY; + m_BottomMainLabel->setVisible(true); + m_BottomMainButton->setVisible(false); + + m_BottomMainLabel->getSize( iLabelSizeX, iLabelSizeY ); + m_BottomMainLabel->setPos( ( ScreenWidth / 2 ) - ( iLabelSizeX / 2 ), YRES( 6 ) ); + } + else + { + m_BottomMainButton->setPos( XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6) ); + m_BottomMainLabel->setVisible(false); + m_BottomMainButton->setVisible(true); + } + + if( !isVisible ) + { + gViewPort->HideCommandMenu(); + + // if switching from visible menu to invisible menu, show help text + if( m_menuVisible && this->isVisible() ) + { + char string[64]; + + _snprintf( string, sizeof(string) - 1, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( "#Spec_Duck" ) ); + string[sizeof(string) - 1] = '\0'; + + gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( string ) + 1, string ); + } + } + + m_menuVisible = isVisible; + + gViewPort->UpdateCursorState(); +} + +const char *GetSpectatorLabel( int iMode ) +{ + switch( iMode ) + { + case OBS_CHASE_LOCKED: + return "#OBS_CHASE_LOCKED"; + + case OBS_CHASE_FREE: + return "#OBS_CHASE_FREE"; + + case OBS_ROAMING: + return "#OBS_ROAMING"; + + case OBS_IN_EYE: + return "#OBS_IN_EYE"; + + case OBS_MAP_FREE: + return "#OBS_MAP_FREE"; + + case OBS_MAP_CHASE: + return "#OBS_MAP_CHASE"; + + case OBS_NONE: + default: + return "#OBS_NONE"; + } + + return ""; +} + +void SpectatorPanel::EnableInsetView(bool isEnabled) +{ + int x = gHUD.m_Spectator.m_OverviewData.insetWindowX; + int y = gHUD.m_Spectator.m_OverviewData.insetWindowY; + int wide = gHUD.m_Spectator.m_OverviewData.insetWindowWidth; + int tall = gHUD.m_Spectator.m_OverviewData.insetWindowHeight; + int offset = x + wide + 2; + + if( isEnabled ) + { + // short black bar to see full inset + m_TopBorder->setBounds( XRES( offset ), 0, XRES(640 - offset ), YRES( PANEL_HEIGHT ) ); + + if( gEngfuncs.IsSpectateOnly() ) + { + m_TopBanner->setVisible( true ); + m_TopBanner->setPos( XRES( offset ), 0 ); + } + else + m_TopBanner->setVisible( false ); + + m_InsetViewButton->setBounds( XRES( x -1 ), YRES( y ), + XRES( wide +2), YRES( tall ) ); + m_InsetViewButton->setVisible( true ); + } + else + { + // full black bar, no inset border + // show banner only in real HLTV mode + if( gEngfuncs.IsSpectateOnly() ) + { + m_TopBanner->setVisible( true ); + m_TopBanner->setPos( 0, 0 ); + } + else + m_TopBanner->setVisible( false ); + + m_TopBorder->setBounds( 0, 0, ScreenWidth, YRES( PANEL_HEIGHT ) ); + + m_InsetViewButton->setVisible( false ); + } + + m_insetVisible = isEnabled; + + Update(); + + m_CamButton->setText( CHudTextMessage::BufferedLocaliseTextString( GetSpectatorLabel( g_iUser1 ) ) ); +} + +void SpectatorPanel::Update() +{ + int iTextWidth, iTextHeight; + int iTimeHeight, iTimeWidth; + int offset, j; + + if( m_insetVisible ) + offset = gHUD.m_Spectator.m_OverviewData.insetWindowX + gHUD.m_Spectator.m_OverviewData.insetWindowWidth + 2; + else + offset = 0; + + bool visible = gHUD.m_Spectator.m_drawstatus->value != 0; + + m_ExtraInfo->setVisible( visible ); + m_TimerImage->setVisible( visible ); + m_CurrentTime->setVisible( visible ); + m_Separator->setVisible( visible ); + + for( j = 0; j < TEAM_NUMBER; j++ ) + m_TeamScores[j]->setVisible( visible ); + + if( !visible ) + return; + + m_ExtraInfo->getTextSize( iTextWidth, iTextHeight ); + m_CurrentTime->getTextSize( iTimeWidth, iTimeHeight ); + + iTimeWidth += XRES ( SEPERATOR_WIDTH*2 + 1 ); // +timer icon + iTimeWidth += ( SEPERATOR_WIDTH-(iTimeWidth%SEPERATOR_WIDTH) ); + + if( iTimeWidth > iTextWidth ) + iTextWidth = iTimeWidth; + + int xPos = ScreenWidth - ( iTextWidth + XRES ( SEPERATOR_WIDTH + offset ) ); + + m_ExtraInfo->setBounds( xPos, YRES( SEPERATOR_HEIGHT ), iTextWidth, iTextHeight ); + + m_TimerImage->setBounds( xPos, YRES( SEPERATOR_HEIGHT ) + iTextHeight , XRES(SEPERATOR_WIDTH*2 + 1), YRES(SEPERATOR_HEIGHT + 1) ); + + m_CurrentTime->setBounds( xPos + XRES ( SEPERATOR_WIDTH*2 + 1 ), YRES( SEPERATOR_HEIGHT ) + iTextHeight , iTimeWidth, iTimeHeight ); + + m_Separator->setPos( ScreenWidth - ( iTextWidth + XRES ( 2*SEPERATOR_WIDTH+SEPERATOR_WIDTH/2+offset ) ) , YRES( 5 ) ); + m_Separator->setSize( XRES( 1 ), PANEL_HEIGHT - 10 ); + + for( j = 0; j < TEAM_NUMBER; j++ ) + { + int iwidth, iheight; + + m_TeamScores[j]->getTextSize( iwidth, iheight ); + m_TeamScores[j]->setBounds( ScreenWidth - ( iTextWidth + XRES ( 2*SEPERATOR_WIDTH+2*SEPERATOR_WIDTH/2+offset ) + iwidth ), YRES( SEPERATOR_HEIGHT ) + ( iheight * j ), iwidth, iheight ); + } +} diff --git a/cl_dll/vgui_SpectatorPanel.h b/cl_dll/vgui_SpectatorPanel.h new file mode 100644 index 00000000..5312e963 --- /dev/null +++ b/cl_dll/vgui_SpectatorPanel.h @@ -0,0 +1,111 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// vgui_SpectatorPanel.h: interface for the SpectatorPanel class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef SPECTATORPANEL_H +#define SPECTATORPANEL_H + +#include +#include +#include + +using namespace vgui; + +#define SPECTATOR_PANEL_CMD_NONE 0 + +#define SPECTATOR_PANEL_CMD_OPTIONS 1 +#define SPECTATOR_PANEL_CMD_PREVPLAYER 2 +#define SPECTATOR_PANEL_CMD_NEXTPLAYER 3 +#define SPECTATOR_PANEL_CMD_HIDEMENU 4 +#define SPECTATOR_PANEL_CMD_TOGGLE_INSET 5 +#define SPECTATOR_PANEL_CMD_CAMERA 6 +#define SPECTATOR_PANEL_CMD_PLAYERS 7 + +// spectator panel sizes +#define PANEL_HEIGHT 64 + +#define BANNER_WIDTH 256 +#define BANNER_HEIGHT 64 + +#define OPTIONS_BUTTON_X 96 +#define CAMOPTIONS_BUTTON_X 200 + + +#define SEPERATOR_WIDTH 15 +#define SEPERATOR_HEIGHT 15 + + +#define TEAM_NUMBER 2 + +class SpectatorPanel : public Panel //, public vgui::CDefaultInputSignal +{ + +public: + SpectatorPanel( int x, int y, int wide, int tall ); + virtual ~SpectatorPanel(); + + void ActionSignal( int cmd ); + + // InputSignal overrides. +public: + void Initialize(); + void Update(); + + void EnableInsetView( bool isEnabled ); + void ShowMenu( bool isVisible ); + + DropDownButton * m_OptionButton; + // CommandButton *m_HideButton; + //ColorButton * m_PrevPlayerButton; + //ColorButton * m_NextPlayerButton; + CImageButton * m_PrevPlayerButton; + CImageButton * m_NextPlayerButton; + DropDownButton * m_CamButton; + + CTransparentPanel *m_TopBorder; + CTransparentPanel *m_BottomBorder; + + ColorButton *m_InsetViewButton; + + DropDownButton *m_BottomMainButton; + CImageLabel *m_TimerImage; + Label *m_BottomMainLabel; + Label *m_CurrentTime; + Label *m_ExtraInfo; + Panel *m_Separator; + + Label *m_TeamScores[TEAM_NUMBER]; + + CImageLabel *m_TopBanner; + + bool m_menuVisible; + bool m_insetVisible; +}; + +class CSpectatorHandler_Command : public ActionSignal +{ + +private: + SpectatorPanel *m_pFather; + int m_cmd; + +public: + CSpectatorHandler_Command( SpectatorPanel *panel, int cmd ) + { + m_pFather = panel; + m_cmd = cmd; + } + + virtual void actionPerformed( Panel *panel ) + { + m_pFather->ActionSignal( m_cmd ); + } +}; +#endif // !defined SPECTATORPANEL_H diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp new file mode 100644 index 00000000..e1d5e58d --- /dev/null +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -0,0 +1,2633 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: Client DLL VGUI Viewport +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "parsemsg.h" +#include "pm_shared.h" +#include "keydefs.h" +#include "demo.h" +#include "demo_api.h" + +#include "vgui_int.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ScorePanel.h" +#include "vgui_SpectatorPanel.h" + +#include "shake.h" +#include "screenfade.h" + +void IN_SetVisibleMouse(bool visible); +class CCommandMenu; + +// Scoreboard positions +#define SBOARD_INDENT_X XRES( 104 ) +#define SBOARD_INDENT_Y YRES( 40 ) + +// low-res scoreboard indents +#define SBOARD_INDENT_X_512 30 +#define SBOARD_INDENT_Y_512 30 + +#define SBOARD_INDENT_X_400 0 +#define SBOARD_INDENT_Y_400 20 + +void IN_ResetMouse( void ); +extern CMenuPanel *CMessageWindowPanel_Create( const char *szMOTD, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall ); +extern float *GetClientColor( int clientIndex ); + +using namespace vgui; + +// Team Colors +int iNumberOfTeamColors = 5; +int iTeamColors[5][3] = +{ + { 255, 170, 0 }, // HL orange (default) + { 125, 165, 210 }, // Blue + { 200, 90, 70 }, // Red + { 225, 205, 45 }, // Yellow + { 145, 215, 140 }, // Green +}; + +// Used for Class specific buttons +const char *sTFClasses[] = +{ + "", + "SCOUT", + "SNIPER", + "SOLDIER", + "DEMOMAN", + "MEDIC", + "HWGUY", + "PYRO", + "SPY", + "ENGINEER", + "CIVILIAN", +}; + +const char *sLocalisedClasses[] = +{ + "#Civilian", + "#Scout", + "#Sniper", + "#Soldier", + "#Demoman", + "#Medic", + "#HWGuy", + "#Pyro", + "#Spy", + "#Engineer", + "#Random", + "#Civilian", +}; + +const char *sTFClassSelection[] = +{ + "civilian", + "scout", + "sniper", + "soldier", + "demoman", + "medic", + "hwguy", + "pyro", + "spy", + "engineer", + "randompc", + "civilian", +}; + +#ifdef _TFC +int iBuildingCosts[] = +{ + BUILD_COST_DISPENSER, + BUILD_COST_SENTRYGUN, + BUILD_COST_TELEPORTER +}; + +// This maps class numbers to the Invalid Class bit. +// This is needed for backwards compatability in maps that were finished before +// all the classes were in TF. Hence the wacky sequence. +int sTFValidClassInts[] = +{ + 0, + TF_ILL_SCOUT, + TF_ILL_SNIPER, + TF_ILL_SOLDIER, + TF_ILL_DEMOMAN, + TF_ILL_MEDIC, + TF_ILL_HVYWEP, + TF_ILL_PYRO, + TF_ILL_SPY, + TF_ILL_ENGINEER, + TF_ILL_RANDOMPC, +}; +#endif + +// Get the name of TGA file, based on GameDir +char *GetVGUITGAName( const char *pszName ) +{ + int i; + char sz[256]; + static char gd[256]; + const char *gamedir; + + if( ScreenWidth < 640 ) + i = 320; + else + i = 640; + + sprintf( sz, pszName, i ); + + gamedir = gEngfuncs.pfnGetGameDirectory(); + sprintf( gd, "%s/gfx/vgui/%s.tga", gamedir, sz ); + + return gd; +} + +//================================================================ +// COMMAND MENU +//================================================================ +void CCommandMenu::AddButton( CommandButton *pButton ) +{ + if( m_iButtons >= MAX_BUTTONS ) + return; + + m_aButtons[m_iButtons] = pButton; + m_iButtons++; + pButton->setParent( this ); + pButton->setFont( Scheme::sf_primary3 ); + + // give the button a default key binding + if( m_iButtons < 10 ) + { + pButton->setBoundKey( m_iButtons + '0' ); + } + else if( m_iButtons == 10 ) + { + pButton->setBoundKey( '0' ); + } +} + +void CCommandMenu::RemoveAllButtons(void) +{ + /* + for(int i=0;iIsNotValid() ) + { + if( m_aButtons[i]->getBoundKey() == keyNum ) + { + // hit the button + if( m_aButtons[i]->GetSubMenu() ) + { + // open the sub menu + gViewPort->SetCurrentCommandMenu( m_aButtons[i]->GetSubMenu() ); + return false; + } + else + { + // run the bound command + m_aButtons[i]->fireActionSignal(); + return true; + } + } + } + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: clears the current menus buttons of any armed (highlighted) +// state, and all their sub buttons +//----------------------------------------------------------------------------- +void CCommandMenu::ClearButtonsOfArmedState( void ) +{ + for( int i = 0; i < GetNumButtons(); i++ ) + { + m_aButtons[i]->setArmed( false ); + + if( m_aButtons[i]->GetSubMenu() ) + { + m_aButtons[i]->GetSubMenu()->ClearButtonsOfArmedState(); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *pSubMenu - +// Output : CommandButton +//----------------------------------------------------------------------------- +CommandButton *CCommandMenu::FindButtonWithSubmenu( CCommandMenu *pSubMenu ) +{ + for( int i = 0; i < GetNumButtons(); i++ ) + { + if( m_aButtons[i]->GetSubMenu() == pSubMenu ) + return m_aButtons[i]; + } + + return NULL; +} + +// Recalculate the visible buttons +bool CCommandMenu::RecalculateVisibles( int iYOffset, bool bHideAll ) +{ + int i, iCurrentY = 0; + int iVisibleButtons = 0; + + // Cycle through all the buttons in this menu, and see which will be visible + for( i = 0; i < m_iButtons; i++ ) + { + int iClass = m_aButtons[i]->GetPlayerClass(); + + if( ( iClass && iClass != g_iPlayerClass ) || ( m_aButtons[i]->IsNotValid() ) || bHideAll ) + { + m_aButtons[i]->setVisible( false ); + if( m_aButtons[i]->GetSubMenu() != NULL ) + { + (m_aButtons[i]->GetSubMenu())->RecalculateVisibles( 0, true ); + } + } + else + { + // If it's got a submenu, force it to check visibilities + if( m_aButtons[i]->GetSubMenu() != NULL ) + { + if( !( m_aButtons[i]->GetSubMenu() )->RecalculateVisibles( 0, false ) ) + { + // The submenu had no visible buttons, so don't display this button + m_aButtons[i]->setVisible( false ); + continue; + } + } + + m_aButtons[i]->setVisible( true ); + iVisibleButtons++; + } + } + + // Set Size + setSize( _size[0], ( iVisibleButtons * ( m_flButtonSizeY - 1 ) ) + 1 ); + + if( iYOffset ) + { + m_iYOffset = iYOffset; + } + + for( i = 0; i < m_iButtons; i++ ) + { + if( m_aButtons[i]->isVisible() ) + { + if( m_aButtons[i]->GetSubMenu() != NULL ) + ( m_aButtons[i]->GetSubMenu() )->RecalculateVisibles( iCurrentY + m_iYOffset, false ); + + // Make sure it's at the right Y position + // m_aButtons[i]->getPos( iXPos, iYPos ); + if( m_iDirection ) + { + m_aButtons[i]->setPos( 0, ( iVisibleButtons - 1 ) * ( m_flButtonSizeY - 1 ) - iCurrentY ); + } + else + { + m_aButtons[i]->setPos( 0, iCurrentY ); + } + + iCurrentY += ( m_flButtonSizeY - 1 ); + } + } + + return iVisibleButtons ? true : false; +} + +// Make sure all submenus can fit on the screen +void CCommandMenu::RecalculatePositions( int iYOffset ) +{ + int iTop; + int iAdjust = 0; + + m_iYOffset+= iYOffset; + + if( m_iDirection ) + iTop = ScreenHeight - ( m_iYOffset + _size[1] ); + else + iTop = m_iYOffset; + + if( iTop < 0 ) + iTop = 0; + + // Calculate if this is going to fit onscreen, and shuffle it up if it won't + int iBottom = iTop + _size[1]; + + if( iBottom > ScreenHeight ) + { + // Move in increments of button sizes + while( iAdjust < ( iBottom - ScreenHeight ) ) + { + iAdjust += m_flButtonSizeY - 1; + } + + iTop -= iAdjust; + + // Make sure it doesn't move off the top of the screen (the menu's too big to fit it all) + if( iTop < 0 ) + { + iAdjust -= ( 0 - iTop ); + iTop = 0; + } + } + + setPos( _pos[0], iTop ); + + // We need to force all menus below this one to update their positions now, because they + // might have submenus riding off buttons in this menu that have just shifted. + for( int i = 0; i < m_iButtons; i++ ) + m_aButtons[i]->UpdateSubMenus( iAdjust ); +} + +// Make this menu and all menus above it in the chain visible +void CCommandMenu::MakeVisible( CCommandMenu *pChildMenu ) +{ +/* + // Push down the button leading to the child menu + for( int i = 0; i < m_iButtons; i++ ) + { + if( ( pChildMenu != NULL ) && ( m_aButtons[i]->GetSubMenu() == pChildMenu ) ) + { + m_aButtons[i]->setArmed( true ); + } + else + { + m_aButtons[i]->setArmed( false ); + } + } +*/ + + setVisible( true ); + if( m_pParentMenu ) + m_pParentMenu->MakeVisible( this ); +} + +//================================================================ +// CreateSubMenu +CCommandMenu *TeamFortressViewport::CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset ) +{ + int iXPos = 0; + int iYPos = 0; + int iWide = CMENU_SIZE_X; + int iTall = 0; + int iDirection = 0; + + if( pParentMenu ) + { + iXPos = m_pCurrentCommandMenu->GetXOffset() + ( CMENU_SIZE_X - 1 ) + iXOffset; + iYPos = m_pCurrentCommandMenu->GetYOffset() + iYOffset; + iDirection = pParentMenu->GetDirection(); + } + + CCommandMenu *pMenu = new CCommandMenu( pParentMenu, iDirection, iXPos, iYPos, iWide, iTall ); + pMenu->setParent( this ); + pButton->AddSubMenu( pMenu ); + pButton->setFont( Scheme::sf_primary3 ); + pMenu->m_flButtonSizeY = m_pCurrentCommandMenu->m_flButtonSizeY; + + // Create the Submenu-open signal + InputSignal *pISignal = new CMenuHandler_PopupSubMenuInput( pButton, pMenu ); + pButton->addInputSignal( pISignal ); + + // Put a > to show it's a submenu + CImageLabel *pLabel = new CImageLabel( "arrow", CMENU_SIZE_X - SUBMENU_SIZE_X, SUBMENU_SIZE_Y ); + pLabel->setParent( pButton ); + pLabel->addInputSignal( pISignal ); + + // Reposition + pLabel->getPos( iXPos, iYPos ); + pLabel->setPos( CMENU_SIZE_X - pLabel->getImageWide(), ( BUTTON_SIZE_Y - pLabel->getImageTall() ) / 2 ); + + // Create the mouse off signal for the Label too + if( !pButton->m_bNoHighlight ) + pLabel->addInputSignal( new CHandler_CommandButtonHighlight( pButton ) ); + + return pMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: Makes sure the memory allocated for TeamFortressViewport is nulled out +// Input : stAllocateBlock - +// Output : void * +//----------------------------------------------------------------------------- +void *TeamFortressViewport::operator new( size_t stAllocateBlock ) +{ +// void *mem = Panel::operator new( stAllocateBlock ); + void *mem = ::operator new( stAllocateBlock ); + memset( mem, 0, stAllocateBlock ); + return mem; +} + +//----------------------------------------------------------------------------- +// Purpose: InputSignal handler for the main viewport +//----------------------------------------------------------------------------- +class CViewPortInputHandler : public InputSignal +{ +public: + bool bPressed; + + CViewPortInputHandler() + { + } + + virtual void cursorMoved( int x, int y, Panel *panel ) {} + virtual void cursorEntered( Panel *panel ) {} + virtual void cursorExited( Panel *panel ) {} + virtual void mousePressed( MouseCode code, Panel *panel ) + { + if( code != MOUSE_LEFT ) + { + // send a message to close the command menu + // this needs to be a message, since a direct call screws the timing + gEngfuncs.pfnClientCmd( "ForceCloseCommandMenu\n" ); + } + } + + virtual void mouseReleased( MouseCode code, Panel *panel ) + { + } + + virtual void mouseDoublePressed( MouseCode code, Panel *panel ) {} + virtual void mouseWheeled( int delta, Panel *panel ) {} + virtual void keyPressed( KeyCode code, Panel *panel ) {} + virtual void keyTyped( KeyCode code, Panel *panel ) {} + virtual void keyReleased( KeyCode code, Panel *panel ) {} + virtual void keyFocusTicked( Panel *panel ) {} +}; + +//================================================================ +TeamFortressViewport::TeamFortressViewport( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ), m_SchemeManager( wide, tall ) +{ + gViewPort = this; + m_iInitialized = false; + m_pTeamMenu = NULL; + m_pClassMenu = NULL; + m_pScoreBoard = NULL; + m_pSpectatorPanel = NULL; + m_pCurrentMenu = NULL; + m_pCurrentCommandMenu = NULL; + + Initialize(); + addInputSignal( new CViewPortInputHandler ); + + int r, g, b, a; + + Scheme* pScheme = App::getInstance()->getScheme(); + + // primary text color + // Get the colors + //!! two different types of scheme here, need to integrate + SchemeHandle_t hPrimaryScheme = m_SchemeManager.getSchemeHandle( "Primary Button Text" ); + { + // font + pScheme->setFont( Scheme::sf_primary1, m_SchemeManager.getFont( hPrimaryScheme ) ); + + // text color + m_SchemeManager.getFgColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor( Scheme::sc_primary1, r, g, b, a ); // sc_primary1 is non-transparent orange + + // background color (transparent black) + m_SchemeManager.getBgColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor( Scheme::sc_primary3, r, g, b, a ); + + // armed foreground color + m_SchemeManager.getFgArmedColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor( Scheme::sc_secondary2, r, g, b, a ); + + // armed background color + m_SchemeManager.getBgArmedColor( hPrimaryScheme, r, g, b, a ); + pScheme->setColor( Scheme::sc_primary2, r, g, b, a ); + + //!! need to get this color from scheme file + // used for orange borders around buttons + m_SchemeManager.getBorderColor( hPrimaryScheme, r, g, b, a ); + // pScheme->setColor( Scheme::sc_secondary1, r, g, b, a ); + pScheme->setColor( Scheme::sc_secondary1, 255 * 0.7, 170 * 0.7, 0, 0); + } + + // Change the second primary font (used in the scoreboard) + SchemeHandle_t hScoreboardScheme = m_SchemeManager.getSchemeHandle( "Scoreboard Text" ); + { + pScheme->setFont( Scheme::sf_primary2, m_SchemeManager.getFont( hScoreboardScheme ) ); + } + + // Change the third primary font (used in command menu) + SchemeHandle_t hCommandMenuScheme = m_SchemeManager.getSchemeHandle( "CommandMenu Text" ); + { + pScheme->setFont( Scheme::sf_primary3, m_SchemeManager.getFont( hCommandMenuScheme ) ); + } + + App::getInstance()->setScheme( pScheme ); + + // VGUI MENUS + CreateTeamMenu(); + CreateClassMenu(); + CreateSpectatorMenu(); + CreateScoreBoard(); + // Init command menus + m_iNumMenus = 0; + m_iCurrentTeamNumber = m_iUser1 = m_iUser2 = m_iUser3 = 0; + + m_StandardMenu = CreateCommandMenu( "commandmenu.txt", 0, CMENU_TOP, false, CMENU_SIZE_X, BUTTON_SIZE_Y, 0 ); + m_SpectatorOptionsMenu = CreateCommandMenu("spectatormenu.txt", 1, PANEL_HEIGHT, true, CMENU_SIZE_X, BUTTON_SIZE_Y / 2, 0 ); // above bottom bar, flat design + m_SpectatorCameraMenu = CreateCommandMenu("spectcammenu.txt", 1, PANEL_HEIGHT, true, XRES( 200 ), BUTTON_SIZE_Y / 2, ScreenWidth - ( XRES ( 200 ) + 15 ) ); // above bottom bar, flat design + + m_PlayerMenu = m_iNumMenus; + m_iNumMenus++; + + float flLabelSize = ( (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ) ) - XRES( (15 + OPTIONS_BUTTON_X + 15) + 38 ); + + m_pCommandMenus[m_PlayerMenu] = new CCommandMenu(NULL, 1, + XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ),PANEL_HEIGHT, flLabelSize,300); + m_pCommandMenus[m_PlayerMenu]->setParent(this); + m_pCommandMenus[m_PlayerMenu]->setVisible(false); + m_pCommandMenus[m_PlayerMenu]->m_flButtonSizeY = BUTTON_SIZE_Y /2; + m_pCommandMenus[m_PlayerMenu]->m_iSpectCmdMenu = 1; + + UpdatePlayerMenu(m_PlayerMenu); +} + +//----------------------------------------------------------------------------- +// Purpose: Called everytime a new level is started. Viewport clears out it's data. +//----------------------------------------------------------------------------- +void TeamFortressViewport::Initialize( void ) +{ + // Force each menu to Initialize + if( m_pTeamMenu ) + { + m_pTeamMenu->Initialize(); + } + if( m_pClassMenu ) + { + m_pClassMenu->Initialize(); + } + if( m_pScoreBoard ) + { + m_pScoreBoard->Initialize(); + HideScoreBoard(); + } + if( m_pSpectatorPanel ) + { + // Spectator menu doesn't need initializing + m_pSpectatorPanel->setVisible( false ); + } + + // Make sure all menus are hidden + HideVGUIMenu(); + HideCommandMenu(); + + // Clear out some data + m_iGotAllMOTD = true; + m_iRandomPC = false; + m_flScoreBoardLastUpdated = 0; + m_flSpectatorPanelLastUpdated = 0; + + // reset player info + g_iPlayerClass = 0; + g_iTeamNumber = 0; + + m_sMapName[0] = '\0'; + m_szServerName[0] = '\0'; + for( int i = 0; i < 5; i++ ) + { + m_iValidClasses[i] = 0; + m_sTeamNames[i][0] = '\0'; + } + + App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_none) ); +} + +class CException; +//----------------------------------------------------------------------------- +// Purpose: Read the Command Menu structure from the txt file and create the menu. +// Returns Index of menu in m_pCommandMenus +//----------------------------------------------------------------------------- +int TeamFortressViewport::CreateCommandMenu( const char *menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset ) +{ + // COMMAND MENU + // Create the root of this new Command Menu + int newIndex = m_iNumMenus; + + m_pCommandMenus[newIndex] = new CCommandMenu( NULL, direction, xOffset, yOffset, flButtonSizeX, 300 ); // This will be resized once we know how many items are in it + m_pCommandMenus[newIndex]->setParent( this ); + m_pCommandMenus[newIndex]->setVisible( false ); + m_pCommandMenus[newIndex]->m_flButtonSizeY = flButtonSizeY; + m_pCommandMenus[newIndex]->m_iSpectCmdMenu = direction; + + m_iNumMenus++; + + // Read Command Menu from the txt file + char token[1024]; + char *pFileStart = (char*)gEngfuncs.COM_LoadFile( menuFile, 5, NULL ); + if( !pFileStart ) + { + gEngfuncs.Con_DPrintf( "Unable to open %s\n", menuFile); + SetCurrentCommandMenu( NULL ); + return newIndex; + } + +#ifdef _WIN32 + try + { +#endif + // First, read in the localisation strings + + // Detpack strings + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For5Seconds", m_sDetpackStrings[0], MAX_BUTTON_SIZE ); + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For20Seconds", m_sDetpackStrings[1], MAX_BUTTON_SIZE ); + gHUD.m_TextMessage.LocaliseTextString( "#DetpackSet_For50Seconds", m_sDetpackStrings[2], MAX_BUTTON_SIZE ); + + // Now start parsing the menu structure + m_pCurrentCommandMenu = m_pCommandMenus[newIndex]; + char szLastButtonText[32] = "file start"; + char* pfile = gEngfuncs.COM_ParseFile( pFileStart, token ); + while( ( strlen ( token ) > 0 ) && ( m_iNumMenus < MAX_MENUS ) ) + { + // Keep looping until we hit the end of this menu + while( token[0] != '}' && ( strlen( token ) > 0 ) ) + { + char cText[32] = ""; + char cBoundKey[32] = ""; + char cCustom[32] = ""; + static const int cCommandLength = 128; + char cCommand[cCommandLength] = ""; + char szMap[MAX_MAPNAME] = ""; + int iPlayerClass = 0; + int iCustom = false; + int iTeamOnly = -1; + int iToggle = 0; + int iButtonY; + bool bGetExtraToken = true; + CommandButton *pButton = NULL; + + // We should never be here without a Command Menu + if( !m_pCurrentCommandMenu ) + { + gEngfuncs.Con_Printf( "Error in %s file after '%s'.\n", menuFile, szLastButtonText ); + gEngfuncs.COM_FreeFile( pFileStart ); // Vit_amiN: prevent the memory leak + m_iInitialized = false; + + return newIndex; + } + + // token should already be the bound key, or the custom name + strncpy( cCustom, token, sizeof(cCustom) - 1 ); + cCustom[sizeof(cCustom) - 1] = '\0'; + + // See if it's a custom button + if( !strcmp( cCustom, "CUSTOM" ) ) + { + iCustom = true; + + // Get the next token + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } + // See if it's a map + else if( !strcmp( cCustom, "MAP" ) ) + { + // Get the mapname + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + strncpy( szMap, token, MAX_MAPNAME ); + szMap[MAX_MAPNAME - 1] = '\0'; + + // Get the next token + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } + else if( !strncmp( cCustom, "TEAM", 4 ) ) // TEAM1, TEAM2, TEAM3, TEAM4 + { + // make it a team only button + iTeamOnly = atoi( cCustom + 4 ); + + // Get the next token + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } + else if( !strncmp( cCustom, "TOGGLE", 6 ) ) + { + iToggle = true; + + // Get the next token + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } + else + { + // See if it's a Class +#ifdef _TFC + for( int i = 1; i <= PC_ENGINEER; i++ ) + { + if( !strcmp( token, sTFClasses[i] ) ) + { + // Save it off + iPlayerClass = i; + + // Get the button text + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + break; + } + } +#endif + } + + // Get the button bound key + strncpy( cBoundKey, token, 31 ); + cBoundKey[31] = '\0'; + + // Get the button text + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + strncpy( cText, CHudTextMessage::BufferedLocaliseTextString( token ), 31 ); // Vit_amiN: localize button text + cText[31] = '\0'; + + // save off the last button text we've come across (for error reporting) + strcpy( szLastButtonText, cText ); + + // Get the button command + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + strncpy( cCommand, token, cCommandLength - 1 ); + cCommand[cCommandLength - 1] = '\0'; + + iButtonY = ( BUTTON_SIZE_Y - 1 ) * m_pCurrentCommandMenu->GetNumButtons(); + + // Custom button handling + if( iCustom ) + { + pButton = CreateCustomButton( cText, cCommand, iButtonY ); + + // Get the next token to see if we're a menu + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + + if( token[0] == '{' ) + { + strcpy( cCommand, token ); + } + else + { + bGetExtraToken = false; + } + } + else if( szMap[0] != '\0' ) + { + // create a map button + pButton = new MapButton( szMap, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY ); + } + else if( iTeamOnly != -1 ) + { + // button that only shows up if the player is on team iTeamOnly + pButton = new TeamOnlyCommandButton( iTeamOnly, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + else if( iToggle && direction == 0 ) + { + pButton = new ToggleCommandButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + else if( direction == 1 ) + { + if( iToggle ) + pButton = new SpectToggleButton( cCommand, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + else + pButton = new SpectButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY ); + } + else + { + // normal button + pButton = new CommandButton( iPlayerClass, cText, xOffset, iButtonY, flButtonSizeX, flButtonSizeY, flatDesign ); + } + + // add the button into the command menu + if( pButton ) + { + m_pCurrentCommandMenu->AddButton( pButton ); + pButton->setBoundKey( cBoundKey[0] ); + pButton->setParentMenu( m_pCurrentCommandMenu ); + + // Override font in CommandMenu + pButton->setFont( Scheme::sf_primary3 ); + } + + // Find out if it's a submenu or a button we're dealing with + if( cCommand[0] == '{' ) + { + if( m_iNumMenus >= MAX_MENUS ) + { + gEngfuncs.Con_Printf( "Too many menus in %s past '%s'\n", menuFile, szLastButtonText ); + } + else + { + // Create the menu + m_pCommandMenus[m_iNumMenus] = CreateSubMenu( pButton, m_pCurrentCommandMenu, iButtonY ); + m_pCurrentCommandMenu = m_pCommandMenus[m_iNumMenus]; + m_iNumMenus++; + } + } + else if( !iCustom ) + { + // Create the button and attach it to the current menu + if( iToggle ) + pButton->addActionSignal( new CMenuHandler_ToggleCvar( cCommand ) ); + else + pButton->addActionSignal( new CMenuHandler_StringCommand( cCommand ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + + // Get the next token + if( bGetExtraToken ) + { + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } + } + + // Move back up a menu + m_pCurrentCommandMenu = m_pCurrentCommandMenu->GetParentMenu(); + + pfile = gEngfuncs.COM_ParseFile( pfile, token ); + } +#ifdef _WIN32 + } + catch( CException *e ) + { + e; + //e->Delete(); + e = NULL; + gEngfuncs.COM_FreeFile( pFileStart ); // Vit_amiN: prevent the memory leak + m_iInitialized = false; + return newIndex; + } +#endif + + SetCurrentMenu( NULL ); + SetCurrentCommandMenu( NULL ); + gEngfuncs.COM_FreeFile( pFileStart ); + + m_iInitialized = true; + + return newIndex; +} + +//----------------------------------------------------------------------------- +// Purpose: Creates all the class choices under a spy's disguise menus, and +// maps a command to them +// Output : CCommandMenu +//----------------------------------------------------------------------------- +CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset ) +{ + // create the submenu, under which the class choices will be listed + CCommandMenu *pMenu = CreateSubMenu( pButton, pParentMenu, iYOffset, iXOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // create the class choice buttons +#ifdef _TFC + for( int i = PC_SCOUT; i <= PC_ENGINEER; i++ ) + { + CommandButton *pDisguiseButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + + char sz[256]; + + sprintf( sz, "%s %d", commandText, i ); + pDisguiseButton->addActionSignal( new CMenuHandler_StringCommand( sz ) ); + + pMenu->AddButton( pDisguiseButton ); + } +#endif + + return pMenu; +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *pButtonText - +// *pButtonName - +// Output : CommandButton +//----------------------------------------------------------------------------- +CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char *pButtonName, int iYOffset ) +{ + CommandButton *pButton = NULL; + CCommandMenu *pMenu = NULL; + + // ChangeTeam + if( !strcmp( pButtonName, "!CHANGETEAM" ) ) + { + // ChangeTeam Submenu + pButton = new CommandButton( pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + + // Create the submenu + pMenu = CreateSubMenu(pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // ChangeTeam buttons + for( int i = 0; i < 4; i++ ) + { + char sz[256]; + + sprintf( sz, "jointeam %d", i + 1 ); + m_pTeamButtons[i] = new TeamButton( i + 1, "teamname", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + m_pTeamButtons[i]->addActionSignal( new CMenuHandler_StringCommandWatch( sz ) ); + pMenu->AddButton( m_pTeamButtons[i] ); + } + + // Auto Assign button + m_pTeamButtons[4] = new TeamButton( 5, gHUD.m_TextMessage.BufferedLocaliseTextString( "#Team_AutoAssign" ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + m_pTeamButtons[4]->addActionSignal( new CMenuHandler_StringCommand( "jointeam 5" ) ); + pMenu->AddButton( m_pTeamButtons[4] ); + + // Spectate button + m_pTeamButtons[5] = new SpectateButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Spectate" ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false ); + m_pTeamButtons[5]->addActionSignal( new CMenuHandler_StringCommand( "spectate" ) ); + pMenu->AddButton( m_pTeamButtons[5] ); + } + // ChangeClass + else if( !strcmp( pButtonName, "!CHANGECLASS" ) ) + { + // Create the Change class menu + pButton = new ClassButton( -1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false ); + + // ChangeClass Submenu + pMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + +#ifdef _TFC + for( int i = PC_SCOUT; i <= PC_RANDOM; i++ ) + { + char sz[256]; + + // ChangeClass buttons + CHudTextMessage::LocaliseTextString( sLocalisedClasses[i], sz, 256 ); + ClassButton *pClassButton = new ClassButton( i, sz, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false ); + + sprintf( sz, "%s", sTFClassSelection[i] ); + pClassButton->addActionSignal( new CMenuHandler_StringCommandClassSelect( sz ) ); + pMenu->AddButton( pClassButton ); + } +#endif + } +#ifdef _TFC + // Map Briefing + else if( !strcmp( pButtonName, "!MAPBRIEFING" ) ) + { + pButton = new CommandButton( pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_MAPBRIEFING ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Class Descriptions + else if( !strcmp( pButtonName, "!CLASSDESC" ) ) + { + pButton = new ClassButton( 0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false ); + pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_CLASSHELP ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!SERVERINFO" ) ) + { + pButton = new ClassButton( 0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false ); + pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_INTRO ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Spy abilities + else if( !strcmp( pButtonName, "!SPY" ) ) + { + pButton = new DisguiseButton( 0, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + } + // Feign + else if( !strcmp( pButtonName, "!FEIGN" ) ) + { + pButton = new FeignButton( FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "feign" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Feign Silently + else if( !strcmp( pButtonName, "!FEIGNSILENT" ) ) + { + pButton = new FeignButton( FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "sfeign" ) ); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Stop Feigning + else if( !strcmp( pButtonName, "!FEIGNSTOP" ) ) + { + pButton = new FeignButton( TRUE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "feign" ) ); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Disguise + else if( !strcmp( pButtonName, "!DISGUISEENEMY" ) ) + { + // Create the disguise enemy button, which active only if there are 2 teams + pButton = new DisguiseButton(DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); + CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_enemy", iYOffset); + } + else if( !strcmp( pButtonName, "!DISGUISEFRIENDLY" ) ) + { + // Create the disguise friendly button, which active only if there are 1 or 2 teams + pButton = new DisguiseButton( DISGUISE_TEAM1 | DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_friendly", iYOffset ); + } + else if( !strcmp( pButtonName, "!DISGUISE" ) ) + { + // Create the Disguise button + pButton = new DisguiseButton( DISGUISE_TEAM3 | DISGUISE_TEAM4, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + CCommandMenu *pDisguiseMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pDisguiseMenu; + m_iNumMenus++; + + // Disguise Enemy submenu buttons + for( int i = 1; i <= 4; i++ ) + { + // only show the 4th disguise button if we have 4 teams + m_pDisguiseButtons[i] = new DisguiseButton( ( ( i < 4 ) ? DISGUISE_TEAM3 : 0) | DISGUISE_TEAM4, "Disguise", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + + pDisguiseMenu->AddButton( m_pDisguiseButtons[i] ); + m_pDisguiseButtons[i]->setParentMenu( pDisguiseMenu ); + + char sz[256]; + + sprintf( sz, "disguise %d", i ); + CreateDisguiseSubmenu( m_pDisguiseButtons[i], pDisguiseMenu, sz, iYOffset, CMENU_SIZE_X - 1 ); + } + } + // Start setting a Detpack + else if( !strcmp( pButtonName, "!DETPACKSTART" ) ) + { + // Detpack Submenu + pButton = new DetpackButton( 2, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + + // Create the submenu + pMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); + m_pCommandMenus[m_iNumMenus] = pMenu; + m_iNumMenus++; + + // Set detpack buttons + CommandButton *pDetButton; + pDetButton = new CommandButton( m_sDetpackStrings[0], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 5" ) ); + pMenu->AddButton( pDetButton ); + pDetButton = new CommandButton( m_sDetpackStrings[1], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 20" ) ); + pMenu->AddButton( pDetButton ); + pDetButton = new CommandButton( m_sDetpackStrings[2], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 50" ) ); + pMenu->AddButton( pDetButton ); + } + // Stop setting a Detpack + else if( !strcmp( pButtonName, "!DETPACKSTOP" ) ) + { + pButton = new DetpackButton( 1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "detstop" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Engineer building + else if( !strcmp( pButtonName, "!BUILD" ) ) + { + // only appears if the player is an engineer, and either they have built something or have enough metal to build + pButton = new BuildButton( BUILDSTATE_BASE, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + } + else if( !strcmp( pButtonName, "!BUILDSENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "build 2" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!BUILDDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "build 1" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!ROTATESENTRY180" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "rotatesentry180" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!ROTATESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "rotatesentry" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if( !strcmp( pButtonName, "!DISMANTLEDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "dismantle 1" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!DISMANTLESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "dismantle 2" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!DETONATEDISPENSER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "detdispenser" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + else if( !strcmp( pButtonName, "!DETONATESENTRY" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "detsentry" ) ); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!BUILDENTRYTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("build 4")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DISMANTLEENTRYTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 4")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DETONATEENTRYTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("detentryteleporter")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!BUILDEXITTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("build 5")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DISMANTLEEXITTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 5")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); + } + else if ( !strcmp( pButtonName, "!DETONATEEXITTELEPORTER" ) ) + { + pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); + pButton->addActionSignal(new CMenuHandler_StringCommand("detexitteleporter")); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } + // Stop building + else if( !strcmp( pButtonName, "!BUILDSTOP" ) ) + { + pButton = new BuildButton( BUILDSTATE_BUILDING, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); + pButton->addActionSignal( new CMenuHandler_StringCommand( "build" ) ); + + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); + } +#endif + + return pButton; +} + +//======================================================================= +void TeamFortressViewport::ShowCommandMenu( int menuIndex ) +{ + if( !m_iInitialized ) + return; + + // Already have a menu open. + if( m_pCurrentMenu ) + return; + + // is the command menu open? + if( m_pCurrentCommandMenu == m_pCommandMenus[menuIndex] ) + { + HideCommandMenu(); + return; + } + + // Not visible while in intermission + if( gHUD.m_iIntermission ) + return; + + // Recalculate visible menus + UpdateCommandMenu( menuIndex ); + HideVGUIMenu(); + + SetCurrentCommandMenu( m_pCommandMenus[menuIndex] ); + m_flMenuOpenTime = gHUD.m_flTime; + UpdateCursorState(); + + // get command menu parameters + for( int i = 2; i < gEngfuncs.Cmd_Argc(); i++ ) + { + const char *param = gEngfuncs.Cmd_Argv( i - 1 ); + if( param ) + { + if( m_pCurrentCommandMenu->KeyInput(param[0]) ) + { + // kill the menu open time, since the key input is final + HideCommandMenu(); + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handles the key input of "-commandmenu" +// Input : +//----------------------------------------------------------------------------- +void TeamFortressViewport::InputSignalHideCommandMenu() +{ + if( !m_iInitialized ) + return; + + // if they've just tapped the command menu key, leave it open + if( (m_flMenuOpenTime + 0.3 ) > gHUD.m_flTime ) + return; + + HideCommandMenu(); +} + +//----------------------------------------------------------------------------- +// Purpose: Hides the command menu +//----------------------------------------------------------------------------- +void TeamFortressViewport::HideCommandMenu() +{ + if( !m_iInitialized ) + return; + + if( m_pCommandMenus[m_StandardMenu] ) + { + m_pCommandMenus[m_StandardMenu]->ClearButtonsOfArmedState(); + } + + if( m_pCommandMenus[m_SpectatorOptionsMenu] ) + { + m_pCommandMenus[m_SpectatorOptionsMenu]->ClearButtonsOfArmedState(); + } + + if( m_pCommandMenus[m_SpectatorCameraMenu] ) + { + m_pCommandMenus[m_SpectatorCameraMenu]->ClearButtonsOfArmedState(); + } + + if ( m_pCommandMenus[m_PlayerMenu] ) + { + m_pCommandMenus[m_PlayerMenu]->ClearButtonsOfArmedState(); + } + + + m_flMenuOpenTime = 0.0f; + SetCurrentCommandMenu( NULL ); + UpdateCursorState(); +} + +//----------------------------------------------------------------------------- +// Purpose: Bring up the scoreboard +//----------------------------------------------------------------------------- +void TeamFortressViewport::ShowScoreBoard( void ) +{ + if( m_pScoreBoard ) + { + // No Scoreboard in single-player + if( gEngfuncs.GetMaxClients() > 1 ) + { + m_pScoreBoard->Open(); + UpdateCursorState(); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Returns true if the scoreboard is up +//----------------------------------------------------------------------------- +bool TeamFortressViewport::IsScoreBoardVisible( void ) +{ + if( m_pScoreBoard ) + return m_pScoreBoard->isVisible(); + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Hide the scoreboard +//----------------------------------------------------------------------------- +void TeamFortressViewport::HideScoreBoard( void ) +{ + // Prevent removal of scoreboard during intermission + if( gHUD.m_iIntermission ) + return; + + if( m_pScoreBoard ) + { + m_pScoreBoard->setVisible( false ); + + GetClientVoiceMgr()->StopSquelchMode(); + + UpdateCursorState(); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Activate's the player special ability +// called when the player hits their "special" key +//----------------------------------------------------------------------------- +void TeamFortressViewport::InputPlayerSpecial( void ) +{ + if( !m_iInitialized ) + return; + +#ifdef _TFC + if( g_iPlayerClass == PC_ENGINEER || g_iPlayerClass == PC_SPY ) + { + ShowCommandMenu( gViewPort->m_StandardMenu ); + + if( m_pCurrentCommandMenu ) + { + m_pCurrentCommandMenu->KeyInput( '7' ); + } + } + else +#endif + { + // if it's any other class, just send the command down to the server + ClientCmd( "_special" ); + } +} + +// Set the submenu of the Command Menu +void TeamFortressViewport::SetCurrentCommandMenu( CCommandMenu *pNewMenu ) +{ + for( int i = 0; i < m_iNumMenus; i++ ) + m_pCommandMenus[i]->setVisible( false ); + + m_pCurrentCommandMenu = pNewMenu; + + if( m_pCurrentCommandMenu ) + m_pCurrentCommandMenu->MakeVisible( NULL ); +} + +void TeamFortressViewport::UpdateCommandMenu( int menuIndex ) +{ + // if its the player menu update the player list + if(menuIndex==m_PlayerMenu) + { + m_pCommandMenus[m_PlayerMenu]->RemoveAllButtons(); + UpdatePlayerMenu(m_PlayerMenu); + } + + m_pCommandMenus[menuIndex]->RecalculateVisibles( 0, false ); + m_pCommandMenus[menuIndex]->RecalculatePositions( 0 ); +} + +void TeamFortressViewport::UpdatePlayerMenu(int menuIndex) +{ + + cl_entity_t * pEnt = NULL; + float flLabelSize = ( (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ) ) - XRES( (15 + OPTIONS_BUTTON_X + 15) + 38 ); + gViewPort->GetAllPlayersInfo(); + + + for (int i = 1; i < MAX_PLAYERS; i++ ) + { + //if ( g_PlayerInfoList[i].name == NULL ) + // continue; // empty player slot, skip + + pEnt = gEngfuncs.GetEntityByIndex( i ); + + if ( !gHUD.m_Spectator.IsActivePlayer( pEnt ) ) + continue; + + //if ( g_PlayerExtraInfo[i].teamname[0] == 0 ) + // continue; // skip over players who are not in a team + + SpectButton *pButton = new SpectButton(1 , g_PlayerInfoList[pEnt->index].name , + XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ),PANEL_HEIGHT+(i-1)*CMENU_SIZE_X, flLabelSize, BUTTON_SIZE_Y /2 ); + + pButton->setBoundKey( (char)255 ); + pButton->setContentAlignment( vgui::Label::a_center ); + m_pCommandMenus[menuIndex]->AddButton( pButton ); + pButton->setParentMenu( m_pCommandMenus[menuIndex] ); + + // Override font in CommandMenu + pButton->setFont( Scheme::sf_primary3 ); + + pButton->addActionSignal(new CMenuHandler_SpectateFollow( g_PlayerInfoList[pEnt->index].name)); + // Create an input signal that'll popup the current menu + pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCommandMenus[menuIndex]) ); + + } + +} + + + +void COM_FileBase( const char *in, char *out ); + +void TeamFortressViewport::UpdateSpectatorPanel() +{ + m_iUser1 = g_iUser1; + m_iUser2 = g_iUser2; + m_iUser3 = g_iUser3; + + if( !m_pSpectatorPanel ) + return; + + if( g_iUser1 && gHUD.m_pCvarDraw->value && !gHUD.m_iIntermission ) // don't draw in dev_overview mode + { + char bottomText[128]; + char helpString2[128]; + char tempString[128]; + char *name; + char *pBottomText = NULL; + int player = 0; + + // check if spectator combinations are still valid + gHUD.m_Spectator.CheckSettings(); + + if( !m_pSpectatorPanel->isVisible() ) + { + m_pSpectatorPanel->setVisible( true ); // show spectator panel, but + m_pSpectatorPanel->ShowMenu( false ); // dsiable all menus/buttons + + _snprintf( tempString, sizeof(tempString) - 1, "%c%s", HUD_PRINTCENTER, CHudTextMessage::BufferedLocaliseTextString( "#Spec_Duck" ) ); + tempString[sizeof(tempString) - 1] = '\0'; + + gHUD.m_TextMessage.MsgFunc_TextMsg( NULL, strlen( tempString ) + 1, tempString ); + } + + sprintf(bottomText,"#Spec_Mode%d", g_iUser1 ); + sprintf(helpString2,"#Spec_Mode%d", g_iUser1 ); + + if( gEngfuncs.IsSpectateOnly() ) + strcat( helpString2, " - HLTV" ); + + // check if we're locked onto a target, show the player's name + if( ( g_iUser2 > 0 ) && ( g_iUser2 <= gEngfuncs.GetMaxClients() ) && ( g_iUser1 != OBS_ROAMING ) ) + { + player = g_iUser2; + } + + // special case in free map and inset off, don't show names + if( ( g_iUser1 == OBS_MAP_FREE ) && !gHUD.m_Spectator.m_pip->value ) + name = NULL; + else + name = g_PlayerInfoList[player].name; + + // create player & health string + if( player && name ) + { + strncpy( bottomText, name, sizeof(bottomText) ); + bottomText[ sizeof(bottomText) - 1 ] = 0; + pBottomText = bottomText; + } + else + { + pBottomText = CHudTextMessage::BufferedLocaliseTextString( bottomText ); + } + + // in first person mode colorize player names + if( ( g_iUser1 == OBS_IN_EYE ) && player ) + { + float *color = GetClientColor( player ); + int r = color[0]*255; + int g = color[1]*255; + int b = color[2]*255; + + // set team color, a bit transparent + m_pSpectatorPanel->m_BottomMainLabel->setFgColor( r, g, b, 0 ); + } + else + { // restore GUI color + m_pSpectatorPanel->m_BottomMainLabel->setFgColor( 143, 143, 54, 0 ); + } + + // add sting auto if we are in auto directed mode + if( gHUD.m_Spectator.m_autoDirector->value ) + { + char tempString[128]; + + sprintf( tempString, "#Spec_Auto %s", helpString2 ); + strcpy( helpString2, tempString ); + } + + m_pSpectatorPanel->m_BottomMainLabel->setText( "%s", pBottomText ); + m_pSpectatorPanel->m_BottomMainButton->setText( pBottomText ); + + + // update extra info field + char szText[64]; + + if( gEngfuncs.IsSpectateOnly() ) + { + // in HLTV mode show number of spectators + _snprintf( szText, sizeof(szText) - 1, "%s: %d", CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ), gHUD.m_Spectator.m_iSpectatorNumber ); + } + else + { + // otherwise show map name + char szMapName[64]; + + COM_FileBase( gEngfuncs.pfnGetLevelName(), szMapName ); + + _snprintf( szText, sizeof(szText) - 1, "%s: %s",CHudTextMessage::BufferedLocaliseTextString( "#Spec_Map" ), szMapName ); + } + + szText[sizeof(szText) - 1] = '\0'; + + m_pSpectatorPanel->m_ExtraInfo->setText( szText ); + + /* + int timer = (int)( gHUD.m_roundTimer.m_flTimeEnd - gHUD.m_flTime ); + + if( timer < 0 ) + timer = 0; + + _snprintf( szText, 63, "%d:%02d\n", ( timer / 60 ), ( timer % 60 ) ); + + szText[63] = 0; + + m_pSpectatorPanel->m_CurrentTime->setText( szText ); */ + + // update spectator panel + gViewPort->m_pSpectatorPanel->Update(); + } + else + { + if( m_pSpectatorPanel->isVisible() ) + { + m_pSpectatorPanel->setVisible( false ); + m_pSpectatorPanel->ShowMenu( false ); // dsiable all menus/buttons + } + } + + m_flSpectatorPanelLastUpdated = gHUD.m_flTime + 1.0; // update every second +} + +//====================================================================== +void TeamFortressViewport::CreateScoreBoard( void ) +{ + int xdent = SBOARD_INDENT_X, ydent = SBOARD_INDENT_Y; + if( ScreenWidth == 512 ) + { + xdent = SBOARD_INDENT_X_512; + ydent = SBOARD_INDENT_Y_512; + } + else if( ScreenWidth == 400 ) + { + xdent = SBOARD_INDENT_X_400; + ydent = SBOARD_INDENT_Y_400; + } + + m_pScoreBoard = new ScorePanel( xdent, ydent, ScreenWidth - ( xdent * 2 ), ScreenHeight - ( ydent * 2 ) ); + m_pScoreBoard->setParent( this ); + m_pScoreBoard->setVisible( false ); +} + +//====================================================================== +// Set the VGUI Menu +void TeamFortressViewport::SetCurrentMenu( CMenuPanel *pMenu ) +{ + m_pCurrentMenu = pMenu; + if( m_pCurrentMenu ) + { + // Don't open menus in demo playback + if( gEngfuncs.pDemoAPI->IsPlayingback() ) + return; + + m_pCurrentMenu->Open(); + } + else + { + gEngfuncs.pfnClientCmd( "closemenus;" ); + } +} + +//================================================================ +// Text Window +CMenuPanel *TeamFortressViewport::CreateTextWindow( int iTextToShow ) +{ + char sz[256]; + char *cText; + char *pfile = NULL; + static const int MAX_TITLE_LENGTH = 64; + char cTitle[MAX_TITLE_LENGTH]; + + if( iTextToShow == SHOW_MOTD ) + { + if( !m_szServerName[0] ) + strcpy( cTitle, "Half-Life" ); + else + { + strncpy( cTitle, m_szServerName, MAX_TITLE_LENGTH - 1 ); + cTitle[MAX_TITLE_LENGTH - 1] = '\0'; + } + + cText = m_szMOTD; + } + else if( iTextToShow == SHOW_MAPBRIEFING ) + { + // Get the current mapname, and open it's map briefing text + if( m_sMapName[0] ) + { + strcpy( sz, "maps/"); + strcat( sz, m_sMapName ); + strcat( sz, ".txt" ); + } + else + { + const char *level = gEngfuncs.pfnGetLevelName(); + if( !level ) + return NULL; + + strcpy( sz, level ); + char *ch = strchr( sz, '.' ); + *ch = '\0'; + strcat( sz, ".txt" ); + + // pull out the map name + strcpy( m_sMapName, level ); + ch = strchr( m_sMapName, '.' ); + if( ch ) + { + *ch = 0; + } + + ch = strchr( m_sMapName, '/' ); + if( ch ) + { + // move the string back over the '/' + memmove( m_sMapName, ch + 1, strlen( ch ) + 1 ); + } + } + + pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + + if( !pfile ) + return NULL; + + cText = pfile; + + strncpy( cTitle, m_sMapName, MAX_TITLE_LENGTH ); + cTitle[MAX_TITLE_LENGTH - 1] = 0; + } +#ifdef _TFC + else if( iTextToShow == SHOW_CLASSDESC ) + { + switch( g_iPlayerClass ) + { + case PC_SCOUT: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_scout" ); + CHudTextMessage::LocaliseTextString( "#Title_scout", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SNIPER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_sniper" ); + CHudTextMessage::LocaliseTextString( "#Title_sniper", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SOLDIER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_soldier" ); + CHudTextMessage::LocaliseTextString( "#Title_soldier", cTitle, MAX_TITLE_LENGTH ); break; + case PC_DEMOMAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_demoman" ); + CHudTextMessage::LocaliseTextString( "#Title_demoman", cTitle, MAX_TITLE_LENGTH ); break; + case PC_MEDIC: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_medic" ); + CHudTextMessage::LocaliseTextString( "#Title_medic", cTitle, MAX_TITLE_LENGTH ); break; + case PC_HVYWEAP: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_hwguy" ); + CHudTextMessage::LocaliseTextString( "#Title_hwguy", cTitle, MAX_TITLE_LENGTH ); break; + case PC_PYRO: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_pyro" ); + CHudTextMessage::LocaliseTextString( "#Title_pyro", cTitle, MAX_TITLE_LENGTH ); break; + case PC_SPY: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_spy" ); + CHudTextMessage::LocaliseTextString( "#Title_spy", cTitle, MAX_TITLE_LENGTH ); break; + case PC_ENGINEER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_engineer" ); + CHudTextMessage::LocaliseTextString( "#Title_engineer", cTitle, MAX_TITLE_LENGTH ); break; + case PC_CIVILIAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_civilian" ); + CHudTextMessage::LocaliseTextString( "#Title_civilian", cTitle, MAX_TITLE_LENGTH ); break; + default: + return NULL; + } + + if( g_iPlayerClass == PC_CIVILIAN ) + { + strcpy(sz, "classes/long_civilian.txt"); + } + else + { + sprintf( sz, "classes/long_%s.txt", sTFClassSelection[g_iPlayerClass] ); + } + + char *pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if( pfile ) + { + cText = pfile; + } + } +#endif + else if( iTextToShow == SHOW_SPECHELP ) + { + CHudTextMessage::LocaliseTextString( "#Spec_Help_Title", cTitle, MAX_TITLE_LENGTH ); + cTitle[MAX_TITLE_LENGTH - 1] = 0; + + char *pfile = CHudTextMessage::BufferedLocaliseTextString( "#Spec_Help_Text" ); + if( pfile ) + { + cText = pfile; + } + } + + // if we're in the game (ie. have selected a class), flag the menu to be only grayed in the dialog box, instead of full screen + CMenuPanel *pMOTDPanel = CMessageWindowPanel_Create( cText, cTitle, g_iPlayerClass == PC_UNDEFINED, false, 0, 0, ScreenWidth, ScreenHeight ); + pMOTDPanel->setParent( this ); + + if( pfile ) + gEngfuncs.COM_FreeFile( pfile ); + + return pMOTDPanel; +} + +//================================================================ +// VGUI Menus +void TeamFortressViewport::ShowVGUIMenu( int iMenu ) +{ + CMenuPanel *pNewMenu = NULL; + + // Don't open menus in demo playback + if( gEngfuncs.pDemoAPI->IsPlayingback() ) + return; + + // Don't open any menus except the MOTD during intermission + // MOTD needs to be accepted because it's sent down to the client + // after map change, before intermission's turned off + if( gHUD.m_iIntermission && iMenu != MENU_INTRO ) + return; + + // Don't create one if it's already in the list + if( m_pCurrentMenu ) + { + CMenuPanel *pMenu = m_pCurrentMenu; + while( pMenu != NULL ) + { + if( pMenu->GetMenuID() == iMenu ) + return; + + pMenu = pMenu->GetNextMenu(); + } + } + + switch( iMenu ) + { + case MENU_TEAM: + pNewMenu = ShowTeamMenu(); + break; + + // Map Briefing removed now that it appears in the team menu + case MENU_MAPBRIEFING: + pNewMenu = CreateTextWindow( SHOW_MAPBRIEFING ); + break; + + case MENU_INTRO: + pNewMenu = CreateTextWindow( SHOW_MOTD ); + break; + + case MENU_CLASSHELP: + pNewMenu = CreateTextWindow( SHOW_CLASSDESC ); + break; + + case MENU_SPECHELP: + pNewMenu = CreateTextWindow( SHOW_SPECHELP ); + break; + case MENU_CLASS: + pNewMenu = ShowClassMenu(); + break; + + default: + break; + } + + if( !pNewMenu ) + return; + + // Close the Command Menu if it's open + HideCommandMenu(); + + pNewMenu->SetMenuID( iMenu ); + pNewMenu->SetActive( true ); + pNewMenu->setParent( this ); + + // See if another menu is visible, and if so, cache this one for display once the other one's finished + if( m_pCurrentMenu ) + { + if( m_pCurrentMenu->GetMenuID() == MENU_CLASS && iMenu == MENU_TEAM ) + { + CMenuPanel *temp = m_pCurrentMenu; + m_pCurrentMenu->Close(); + m_pCurrentMenu = pNewMenu; + m_pCurrentMenu->SetNextMenu( temp ); + m_pCurrentMenu->Open(); + UpdateCursorState(); + } + else + { + m_pCurrentMenu->SetNextMenu( pNewMenu ); + } + } + else + { + m_pCurrentMenu = pNewMenu; + m_pCurrentMenu->Open(); + UpdateCursorState(); + } +} + +// Removes all VGUI Menu's onscreen +void TeamFortressViewport::HideVGUIMenu() +{ + while( m_pCurrentMenu ) + { + HideTopMenu(); + } +} + +// Remove the top VGUI menu, and bring up the next one +void TeamFortressViewport::HideTopMenu() +{ + if( m_pCurrentMenu ) + { + // Close the top one + m_pCurrentMenu->Close(); + + // Bring up the next one + gViewPort->SetCurrentMenu( m_pCurrentMenu->GetNextMenu() ); + } + + UpdateCursorState(); +} + +// Return TRUE if the HUD's allowed to print text messages +bool TeamFortressViewport::AllowedToPrintText( void ) +{ + // Prevent text messages when fullscreen menus are up + if( m_pCurrentMenu && g_iPlayerClass == 0 ) + { + int iId = m_pCurrentMenu->GetMenuID(); + if( iId == MENU_TEAM || iId == MENU_CLASS || iId == MENU_INTRO || iId == MENU_CLASSHELP ) + return FALSE; + } + + return TRUE; +} + +//====================================================================================== +// TEAM MENU +//====================================================================================== +// Bring up the Team selection Menu +CMenuPanel* TeamFortressViewport::ShowTeamMenu() +{ + // Don't open menus in demo playback + if( gEngfuncs.pDemoAPI->IsPlayingback() ) + return NULL; + + m_pTeamMenu->Reset(); + return m_pTeamMenu; +} + +void TeamFortressViewport::CreateTeamMenu() +{ + // Create the panel + m_pTeamMenu = new CTeamMenuPanel( 100, false, 0, 0, ScreenWidth, ScreenHeight ); + m_pTeamMenu->setParent( this ); + m_pTeamMenu->setVisible( false ); +} + +//====================================================================================== +// CLASS MENU +//====================================================================================== +// Bring up the Class selection Menu +CMenuPanel* TeamFortressViewport::ShowClassMenu() +{ + // Don't open menus in demo playback + if( gEngfuncs.pDemoAPI->IsPlayingback() ) + return NULL; + + m_pClassMenu->Reset(); + return m_pClassMenu; +} + +void TeamFortressViewport::CreateClassMenu() +{ + // Create the panel + m_pClassMenu = new CClassMenuPanel( 100, false, 0, 0, ScreenWidth, ScreenHeight ); + m_pClassMenu->setParent( this ); + m_pClassMenu->setVisible( false ); +} + +//====================================================================================== +//====================================================================================== +// SPECTATOR MENU +//====================================================================================== +// Spectator "Menu" explaining the Spectator buttons +void TeamFortressViewport::CreateSpectatorMenu() +{ + // Create the Panel + m_pSpectatorPanel = new SpectatorPanel( 0, 0, ScreenWidth, ScreenHeight ); + m_pSpectatorPanel->setParent( this ); + m_pSpectatorPanel->setVisible( false ); + m_pSpectatorPanel->Initialize(); +} + +//====================================================================================== +// UPDATE HUD SECTIONS +//====================================================================================== +// We've got an update on player info +// Recalculate any menus that use it. +void TeamFortressViewport::UpdateOnPlayerInfo() +{ + if( m_pTeamMenu ) + m_pTeamMenu->Update(); + + if( m_pClassMenu ) + m_pClassMenu->Update(); + + if( m_pScoreBoard ) + m_pScoreBoard->Update(); +} + +void TeamFortressViewport::UpdateCursorState() +{ + // Need cursor if any VGUI window is up + if( m_pSpectatorPanel->m_menuVisible || m_pCurrentMenu || m_pTeamMenu->isVisible() || GetClientVoiceMgr()->IsInSquelchMode() ) + { + IN_SetVisibleMouse(true); + App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_arrow) ); + return; + } + else if( m_pCurrentCommandMenu ) + { + // commandmenu doesn't have cursor if hud_capturemouse is turned off + if( gHUD.m_pCvarStealMouse->value != 0.0f ) + { + IN_SetVisibleMouse(true); + App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_arrow) ); + return; + } + } + + App::getInstance()->setCursorOveride( App::getInstance()->getScheme()->getCursor(Scheme::scu_none) ); + IN_SetVisibleMouse(false); + + // Don't reset mouse in demo playback + if( !gEngfuncs.pDemoAPI->IsPlayingback() ) + { + IN_ResetMouse(); + } +} + +void TeamFortressViewport::UpdateHighlights() +{ + if( m_pCurrentCommandMenu ) + m_pCurrentCommandMenu->MakeVisible( NULL ); +} + +void TeamFortressViewport::GetAllPlayersInfo( void ) +{ + for( int i = 1; i < MAX_PLAYERS; i++ ) + { + GetPlayerInfo( i, &g_PlayerInfoList[i] ); + + if( g_PlayerInfoList[i].thisplayer ) + m_pScoreBoard->m_iPlayerNum = i; // !!!HACK: this should be initialized elsewhere... maybe gotten from the engine + } +} + +void TeamFortressViewport::paintBackground() +{ + int wide, tall; + getParent()->getSize( wide, tall ); + setSize( wide, tall ); + if( m_pScoreBoard ) + { + int x, y; + getApp()->getCursorPos( x, y ); + m_pScoreBoard->cursorMoved( x, y, m_pScoreBoard ); + } + + // See if the command menu is visible and needs recalculating due to some external change + if( g_iTeamNumber != m_iCurrentTeamNumber ) + { + UpdateCommandMenu( m_StandardMenu ); + + if( m_pClassMenu ) + { + m_pClassMenu->Update(); + } + + m_iCurrentTeamNumber = g_iTeamNumber; + } + + if( g_iPlayerClass != m_iCurrentPlayerClass ) + { + UpdateCommandMenu( m_StandardMenu ); + + m_iCurrentPlayerClass = g_iPlayerClass; + } + + // See if the Spectator Menu needs to be update + if( ( g_iUser1 != m_iUser1 || g_iUser2 != m_iUser2 ) || + ( m_flSpectatorPanelLastUpdated < gHUD.m_flTime ) ) + { + UpdateSpectatorPanel(); + } + + // Update the Scoreboard, if it's visible + if( m_pScoreBoard->isVisible() && ( m_flScoreBoardLastUpdated < gHUD.m_flTime ) ) + { + m_pScoreBoard->Update(); + m_flScoreBoardLastUpdated = gHUD.m_flTime + 0.5; + } + + int extents[4]; + + getAbsExtents( extents[0], extents[1], extents[2], extents[3] ); + + VGui_ViewportPaintBackground( extents ); +} + +//================================================================ +// Input Handler for Drag N Drop panels +void CDragNDropHandler::cursorMoved( int x, int y, Panel *panel ) +{ + if( m_bDragging ) + { + App::getInstance()->getCursorPos( x, y ); + m_pPanel->setPos( m_iaDragOrgPos[0] + ( x - m_iaDragStart[0] ), m_iaDragOrgPos[1] + ( y - m_iaDragStart[1] ) ); + + if( m_pPanel->getParent() != null ) + { + m_pPanel->getParent()->repaint(); + } + } +} + +void CDragNDropHandler::mousePressed( MouseCode code, Panel *panel ) +{ + int x, y; + App::getInstance()->getCursorPos( x, y ); + m_bDragging = true; + m_iaDragStart[0] = x; + m_iaDragStart[1] = y; + m_pPanel->getPos( m_iaDragOrgPos[0], m_iaDragOrgPos[1] ); + App::getInstance()->setMouseCapture( panel ); + + m_pPanel->setDragged( m_bDragging ); + m_pPanel->requestFocus(); +} + +void CDragNDropHandler::mouseReleased( MouseCode code, Panel *panel ) +{ + m_bDragging = false; + m_pPanel->setDragged( m_bDragging ); + App::getInstance()->setMouseCapture( null ); +} + +//================================================================ +// Number Key Input +bool TeamFortressViewport::SlotInput( int iSlot ) +{ + // If there's a menu up, give it the input + if( m_pCurrentMenu ) + return m_pCurrentMenu->SlotInput( iSlot ); + + return FALSE; +} + +// Direct Key Input +int TeamFortressViewport::KeyInput( int down, int keynum, const char *pszCurrentBinding ) +{ + // Enter gets out of Spectator Mode by bringing up the Team Menu + if( m_iUser1 && gEngfuncs.Con_IsVisible() == false ) + { + if( down && ( keynum == K_ENTER || keynum == K_KP_ENTER ) ) + ShowVGUIMenu( MENU_TEAM ); + } + + // Open Text Window? + if( m_pCurrentMenu && gEngfuncs.Con_IsVisible() == false ) + { + int iMenuID = m_pCurrentMenu->GetMenuID(); + + // Get number keys as Input for Team/Class menus + if( iMenuID == MENU_TEAM || iMenuID == MENU_CLASS ) + { + // Escape gets you out of Team/Class menus if the Cancel button is visible + if( keynum == K_ESCAPE ) + { + if( ( iMenuID == MENU_TEAM && g_iTeamNumber ) || ( iMenuID == MENU_CLASS && g_iPlayerClass ) ) + { + HideTopMenu(); + return 0; + } + } + + for( int i = '0'; i <= '9'; i++ ) + { + if( down && ( keynum == i ) ) + { + SlotInput( i - '0' ); + return 0; + } + } + } + + // Grab enter keys to close TextWindows + if( down && ( keynum == K_ENTER || keynum == K_KP_ENTER || keynum == K_SPACE || keynum == K_ESCAPE ) ) + { + if( iMenuID == MENU_MAPBRIEFING || iMenuID == MENU_INTRO || iMenuID == MENU_CLASSHELP ) + { + HideTopMenu(); + return 0; + } + } + + // Grab jump key on Team Menu as autoassign + if( pszCurrentBinding && down && !strcmp( pszCurrentBinding, "+jump" ) ) + { + if( iMenuID == MENU_TEAM ) + { + m_pTeamMenu->SlotInput( 5 ); + return 0; + } + } + + } + + // if we're in a command menu, try hit one of it's buttons + if( down && m_pCurrentCommandMenu ) + { + // Escape hides the command menu + if( keynum == K_ESCAPE ) + { + HideCommandMenu(); + return 0; + } + + // only trap the number keys + if( keynum >= '0' && keynum <= '9' ) + { + if( m_pCurrentCommandMenu->KeyInput( keynum ) ) + { + // a final command has been issued, so close the command menu + HideCommandMenu(); + } + + return 0; + } + } + + return 1; +} + +//================================================================ +// Message Handlers +int TeamFortressViewport::MsgFunc_ValClass( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + for( int i = 0; i < 5; i++ ) + m_iValidClasses[i] = READ_SHORT(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_TeamNames( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iNumberOfTeams = READ_BYTE(); + + for( int i = 0; i < m_iNumberOfTeams; i++ ) + { + int teamNum = i + 1; + + gHUD.m_TextMessage.LocaliseTextString( READ_STRING(), m_sTeamNames[teamNum], MAX_TEAMNAME_SIZE ); + + // Set the team name buttons + if( m_pTeamButtons[i] ) + m_pTeamButtons[i]->setText( m_sTeamNames[teamNum] ); + + // range check this value...m_pDisguiseButtons[5]; + if( teamNum < 5 ) + { + // Set the disguise buttons + if( m_pDisguiseButtons[teamNum] ) + m_pDisguiseButtons[teamNum]->setText( m_sTeamNames[teamNum] ); + } + } + + // Update the Team Menu + if( m_pTeamMenu ) + m_pTeamMenu->Update(); + + return 1; +} + +int TeamFortressViewport::MsgFunc_Feign( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iIsFeigning = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_Detpack( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iIsSettingDetpack = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_VGUIMenu( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + int iMenu = READ_BYTE(); + + // Map briefing includes the name of the map (because it's sent down before the client knows what map it is) + if( iMenu == MENU_MAPBRIEFING ) + { + strncpy( m_sMapName, READ_STRING(), sizeof(m_sMapName) - 1 ); + m_sMapName[sizeof(m_sMapName) - 1] = '\0'; + } + + // Bring up the menu6 + ShowVGUIMenu( iMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) +{ + if( m_iGotAllMOTD ) + m_szMOTD[0] = 0; + + BEGIN_READ( pbuf, iSize ); + + m_iGotAllMOTD = READ_BYTE(); + + int roomInArray = sizeof(m_szMOTD) - strlen( m_szMOTD ) - 1; + + strncat( m_szMOTD, READ_STRING(), roomInArray >= 0 ? roomInArray : 0 ); + m_szMOTD[sizeof(m_szMOTD) - 1] = '\0'; + + // don't show MOTD for HLTV spectators + if( m_iGotAllMOTD && !gEngfuncs.IsSpectateOnly() ) + { + ShowVGUIMenu( MENU_INTRO ); + } + + return 1; +} + +int TeamFortressViewport::MsgFunc_BuildSt( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iBuildState = READ_SHORT(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + return 1; +} + +int TeamFortressViewport::MsgFunc_RandomPC( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iRandomPC = READ_BYTE(); + + return 1; +} + +int TeamFortressViewport::MsgFunc_ServerName( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + strncpy( m_szServerName, READ_STRING(), sizeof(m_szServerName) ); + m_szServerName[sizeof(m_szServerName) - 1] = 0; + + return 1; +} + +int TeamFortressViewport::MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + short cl = READ_BYTE(); + short frags = READ_SHORT(); + short deaths = READ_SHORT(); + short playerclass = READ_SHORT(); + short teamnumber = READ_SHORT(); + + if( cl > 0 && cl <= MAX_PLAYERS ) + { + g_PlayerExtraInfo[cl].frags = frags; + g_PlayerExtraInfo[cl].deaths = deaths; + g_PlayerExtraInfo[cl].playerclass = playerclass; + g_PlayerExtraInfo[cl].teamnumber = teamnumber; + + //Dont go bellow 0! + if( g_PlayerExtraInfo[cl].teamnumber < 0 ) + g_PlayerExtraInfo[cl].teamnumber = 0; + + UpdateOnPlayerInfo(); + } + + return 1; +} + +// Message handler for TeamScore message +// accepts three values: +// string: team name +// short: teams kills +// short: teams deaths +// if this message is never received, then scores will simply be the combined totals of the players. +int TeamFortressViewport::MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + char *TeamName = READ_STRING(); + + int i; + // find the team matching the name + for( i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ ) + { + if( !stricmp( TeamName, g_TeamInfo[i].name ) ) + break; + } + + if( i > m_pScoreBoard->m_iNumTeams ) + return 1; + + // use this new score data instead of combined player scoresw + g_TeamInfo[i].scores_overriden = TRUE; + g_TeamInfo[i].frags = READ_SHORT(); + g_TeamInfo[i].deaths = READ_SHORT(); + + return 1; +} + +// Message handler for TeamInfo message +// accepts two values: +// byte: client number +// string: client team name +int TeamFortressViewport::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ) +{ + if( !m_pScoreBoard ) + return 1; + + BEGIN_READ( pbuf, iSize ); + short cl = READ_BYTE(); + + if( cl > 0 && cl <= MAX_PLAYERS ) + { + // set the players team + strncpy( g_PlayerExtraInfo[cl].teamname, READ_STRING(), MAX_TEAM_NAME - 1 ); + g_PlayerExtraInfo[cl].teamname[MAX_TEAM_NAME - 1] = '\0'; + } + + // rebuild the list of teams + m_pScoreBoard->RebuildTeams(); + + return 1; +} + +void TeamFortressViewport::DeathMsg( int killer, int victim ) +{ + m_pScoreBoard->DeathMsg( killer, victim ); +} + +int TeamFortressViewport::MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + short cl = READ_BYTE(); + if( cl > 0 && cl <= MAX_PLAYERS ) + { + g_IsSpectator[cl] = READ_BYTE(); + } + + return 1; +} + +int TeamFortressViewport::MsgFunc_AllowSpec( const char *pszName, int iSize, void *pbuf ) +{ + BEGIN_READ( pbuf, iSize ); + + m_iAllowSpectators = READ_BYTE(); + + // Force the menu to update + UpdateCommandMenu( m_StandardMenu ); + + // If the team menu is up, update it too + if( m_pTeamMenu ) + m_pTeamMenu->Update(); + + return 1; +} + +#if defined( _TFC ) +const Vector& GetTeamColor( int team_no ); +extern globalvars_t *gpGlobals; +#endif + +// used to reset the player's screen immediately +int TeamFortressViewport::MsgFunc_ResetFade( const char *pszName, int iSize, void *pbuf ) +{ +#if defined( _TFC ) + if ( !gpGlobals ) + return 0; + + screenfade_t sf; + gEngfuncs.pfnGetScreenFade( &sf ); + + sf.fader = 0; + sf.fadeg = 0; + sf.fadeb = 0; + sf.fadealpha = 0; + + sf.fadeEnd = 0.1; + sf.fadeReset = 0.0; + sf.fadeSpeed = 0.0; + + sf.fadeFlags = FFADE_IN; + + sf.fadeReset += gpGlobals->time; + sf.fadeEnd += sf.fadeReset; + + gEngfuncs.pfnSetScreenFade( &sf ); +#endif + + return 1; +} + +// used to fade a player's screen out/in when they're spectating someone who is teleported +int TeamFortressViewport::MsgFunc_SpecFade( const char *pszName, int iSize, void *pbuf ) +{ +#if defined( _TFC ) + BEGIN_READ( pbuf, iSize ); + + int iIndex = READ_BYTE(); + + // we're in first-person spectator mode (...not first-person in the PIP) + if ( g_iUser1 == OBS_IN_EYE ) + { + // this is the person we're watching + if ( g_iUser2 == iIndex ) + { + int iFade = READ_BYTE(); + int iTeam = READ_BYTE(); + float flTime = ( (float)READ_SHORT() / 100.0 ); + int iAlpha = READ_BYTE(); + + Vector team = GetTeamColor( iTeam ); + + screenfade_t sf; + gEngfuncs.pfnGetScreenFade( &sf ); + + sf.fader = team[0]; + sf.fadeg = team[1]; + sf.fadeb = team[2]; + sf.fadealpha = iAlpha; + + sf.fadeEnd = flTime; + sf.fadeReset = 0.0; + sf.fadeSpeed = 0.0; + + if ( iFade == BUILD_TELEPORTER_FADE_OUT ) + { + sf.fadeFlags = FFADE_OUT; + sf.fadeReset = flTime; + + if ( sf.fadeEnd ) + sf.fadeSpeed = -(float)sf.fadealpha / sf.fadeEnd; + + sf.fadeTotalEnd = sf.fadeEnd += gpGlobals->time; + sf.fadeReset += sf.fadeEnd; + } + else + { + sf.fadeFlags = FFADE_IN; + + if ( sf.fadeEnd ) + sf.fadeSpeed = (float)sf.fadealpha / sf.fadeEnd; + + sf.fadeReset += gpGlobals->time; + sf.fadeEnd += sf.fadeReset; + } + + gEngfuncs.pfnSetScreenFade( &sf ); + } + } +#endif + + return 1; +} diff --git a/cl_dll/vgui_TeamFortressViewport.h b/cl_dll/vgui_TeamFortressViewport.h new file mode 100644 index 00000000..39c6b26f --- /dev/null +++ b/cl_dll/vgui_TeamFortressViewport.h @@ -0,0 +1,1816 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef TEAMFORTRESSVIEWPORT_H +#define TEAMFORTRESSVIEWPORT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// custom scheme handling +#include "vgui_SchemeManager.h" + +#define TF_DEFS_ONLY +#ifdef _TFC +#include "../tfc/tf_defs.h" +#else +#define PC_LASTCLASS 10 +#define PC_UNDEFINED 0 +#define MENU_DEFAULT 1 +#define MENU_TEAM 2 +#define MENU_CLASS 3 +#define MENU_MAPBRIEFING 4 +#define MENU_INTRO 5 +#define MENU_CLASSHELP 6 +#define MENU_CLASSHELP2 7 +#define MENU_REPEATHELP 8 +#define MENU_SPECHELP 9 +#endif +using namespace vgui; + +class Cursor; +class ScorePanel; +class SpectatorPanel; +class CCommandMenu; +class CommandLabel; +class CommandButton; +class BuildButton; +class ClassButton; +class CMenuPanel; +class DragNDropPanel; +class CTransparentPanel; +class CClassMenuPanel; +class CTeamMenuPanel; +class TeamFortressViewport; + +char *GetVGUITGAName( const char *pszName ); +BitmapTGA *LoadTGAForRes( const char* pImageName ); +void ScaleColors( int &r, int &g, int &b, int a ); +extern const char *sTFClassSelection[]; +extern int sTFValidClassInts[]; +extern const char *sLocalisedClasses[]; +extern int iTeamColors[5][3]; +extern int iNumberOfTeamColors; +extern TeamFortressViewport *gViewPort; + + +// Command Menu positions +#define MAX_MENUS 80 +#define MAX_BUTTONS 100 + +#define BUTTON_SIZE_Y YRES(30) +#define CMENU_SIZE_X XRES(160) + +#define SUBMENU_SIZE_X (CMENU_SIZE_X / 8) +#define SUBMENU_SIZE_Y (BUTTON_SIZE_Y / 6) + +#define CMENU_TOP (BUTTON_SIZE_Y * 4) + +//#define MAX_TEAMNAME_SIZE 64 +#define MAX_BUTTON_SIZE 32 + +// Map Briefing Window +#define MAPBRIEF_INDENT 30 + +// Team Menu +#define TMENU_INDENT_X (30 * ((float)ScreenHeight / 640)) +#define TMENU_HEADER 100 +#define TMENU_SIZE_X (ScreenWidth - (TMENU_INDENT_X * 2)) +#define TMENU_SIZE_Y (TMENU_HEADER + BUTTON_SIZE_Y * 7) +#define TMENU_PLAYER_INDENT (((float)TMENU_SIZE_X / 3) * 2) +#define TMENU_INDENT_Y (((float)ScreenHeight - TMENU_SIZE_Y) / 2) + +// Class Menu +#define CLMENU_INDENT_X (30 * ((float)ScreenHeight / 640)) +#define CLMENU_HEADER 100 +#define CLMENU_SIZE_X (ScreenWidth - (CLMENU_INDENT_X * 2)) +#define CLMENU_SIZE_Y (CLMENU_HEADER + BUTTON_SIZE_Y * 11) +#define CLMENU_PLAYER_INDENT (((float)CLMENU_SIZE_X / 3) * 2) +#define CLMENU_INDENT_Y (((float)ScreenHeight - CLMENU_SIZE_Y) / 2) + +// Arrows +enum +{ + ARROW_UP, + ARROW_DOWN, + ARROW_LEFT, + ARROW_RIGHT, +}; + +//============================================================================== +// VIEWPORT PIECES +//============================================================ +// Wrapper for an Image Label without a background +class CImageLabel : public Label +{ +public: + BitmapTGA *m_pTGA; + + void LoadImage(const char * pImageName); + CImageLabel( const char* pImageName,int x,int y ); + CImageLabel( const char* pImageName,int x,int y,int wide,int tall ); + + virtual int getImageTall(); + virtual int getImageWide(); + + virtual void paintBackground() + { + // Do nothing, so the background's left transparent. + } +}; + +// Command Label +// Overridden label so we can darken it when submenus open +class CommandLabel : public Label +{ +private: + int m_iState; + +public: + CommandLabel( const char *text, int x, int y, int wide, int tall ) : Label( text, x, y, wide, tall ) + { + m_iState = false; + } + + void PushUp() + { + m_iState = false; + repaint(); + } + + void PushDown() + { + m_iState = true; + repaint(); + } +}; + +//============================================================ +// Command Buttons +class CommandButton : public Button +{ +private: + int m_iPlayerClass; + bool m_bFlat; + + // Submenus under this button + CCommandMenu *m_pSubMenu; + CCommandMenu *m_pParentMenu; + CommandLabel *m_pSubLabel; + + char m_sMainText[MAX_BUTTON_SIZE]; + char m_cBoundKey; + + SchemeHandle_t m_hTextScheme; + + void RecalculateText( void ); + +public: + bool m_bNoHighlight; + + CommandButton(const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat); + // Constructors + CommandButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight = false); + CommandButton( int iPlayerClass, const char* text,int x,int y,int wide,int tall, bool bFlat ); + + void Init( void ); + + // Menu Handling + void AddSubMenu( CCommandMenu *pNewMenu ); + void AddSubLabel( CommandLabel *pSubLabel ) + { + m_pSubLabel = pSubLabel; + } + + virtual int IsNotValid( void ) + { + return false; + } + + void UpdateSubMenus( int iAdjustment ); + int GetPlayerClass() { return m_iPlayerClass; }; + CCommandMenu *GetSubMenu() { return m_pSubMenu; }; + + CCommandMenu *getParentMenu( void ); + void setParentMenu( CCommandMenu *pParentMenu ); + + // Overloaded vgui functions + virtual void paint(); + virtual void setText( const char *text ); + virtual void paintBackground(); + + void cursorEntered( void ); + void cursorExited( void ); + + void setBoundKey( char boundKey ); + char getBoundKey( void ); +}; + +class ColorButton : public CommandButton +{ +private: + + Color *ArmedColor; + Color *UnArmedColor; + + Color *ArmedBorderColor; + Color *UnArmedBorderColor; + +public: + ColorButton( const char *text, int x, int y, int wide, int tall, bool bNoHighlight, bool bFlat ) : + CommandButton( text, x, y, wide, tall, bNoHighlight, bFlat ) + { + ArmedColor = NULL; + UnArmedColor = NULL; + ArmedBorderColor = NULL; + UnArmedBorderColor = NULL; + } + + virtual void paintBackground() + { + int r, g, b, a; + Color bgcolor; + + if( isArmed() ) + { + // Highlight background + /* getBgColor( bgcolor ); + bgcolor.getColor( r, g, b, a ); + drawSetColor( r, g, b, a ); + drawFilledRect( 0, 0, _size[0], _size[1] );*/ + + if( ArmedBorderColor ) + { + ArmedBorderColor->getColor( r, g, b, a ); + drawSetColor( r, g, b, a ); + drawOutlinedRect( 0, 0, _size[0], _size[1]); + } + } + else + { + if( UnArmedBorderColor ) + { + UnArmedBorderColor->getColor( r, g, b, a ); + drawSetColor( r, g, b, a ); + drawOutlinedRect( 0, 0, _size[0], _size[1]); + } + } + } + + void paint() + { + int r, g, b, a; + if( isArmed() ) + { + if( ArmedColor ) + { + ArmedColor->getColor( r, g, b, a ); + setFgColor( r, g, b, a ); + } + else + setFgColor( Scheme::sc_secondary2 ); + } + else + { + if( UnArmedColor ) + { + UnArmedColor->getColor( r, g, b, a ); + setFgColor( r, g, b, a ); + } + else + setFgColor( Scheme::sc_primary1 ); + } + + Button::paint(); + } + + void setArmedColor( int r, int g, int b, int a ) + { + ArmedColor = new Color( r, g, b, a ); + } + + void setUnArmedColor( int r, int g, int b, int a ) + { + UnArmedColor = new Color( r, g, b, a ); + } + + void setArmedBorderColor( int r, int g, int b, int a ) + { + ArmedBorderColor = new Color( r, g, b, a ); + } + + void setUnArmedBorderColor( int r, int g, int b, int a ) + { + UnArmedBorderColor = new Color( r, g, b, a ); + } +}; + +class SpectButton : public CommandButton +{ +private: + +public: + SpectButton( int iPlayerClass, const char *text, int x, int y, int wide, int tall ) : + CommandButton( text, x, y, wide, tall, false ) + { + Init(); + + setText( text ); + } + + virtual void paintBackground() + { + if( isArmed() ) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0, _size[0] - 5, _size[1] ); + } + } + + virtual void paint() + { + + if( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + Button::paint(); + } +}; + +//============================================================ +// Command Menus +class CCommandMenu : public Panel +{ +private: + CCommandMenu *m_pParentMenu; + int m_iXOffset; + int m_iYOffset; + + // Buttons in this menu + CommandButton *m_aButtons[ MAX_BUTTONS ]; + int m_iButtons; + + // opens menu from top to bottom (0 = default), or from bottom to top (1)? + int m_iDirection; +public: + CCommandMenu( CCommandMenu *pParentMenu, int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) + { + m_pParentMenu = pParentMenu; + m_iXOffset = x; + m_iYOffset = y; + m_iButtons = 0; + m_iDirection = 0; + } + + CCommandMenu( CCommandMenu *pParentMenu, int direction, int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) + { + m_pParentMenu = pParentMenu; + m_iXOffset = x; + m_iYOffset = y; + m_iButtons = 0; + m_iDirection = direction; + } + + float m_flButtonSizeY; + int m_iSpectCmdMenu; + void AddButton( CommandButton *pButton ); + bool RecalculateVisibles( int iNewYPos, bool bHideAll ); + void RecalculatePositions( int iYOffset ); + void MakeVisible( CCommandMenu *pChildMenu ); + + CCommandMenu *GetParentMenu() { return m_pParentMenu; }; + int GetXOffset() { return m_iXOffset; }; + int GetYOffset() { return m_iYOffset; }; + int GetDirection() { return m_iDirection; }; + int GetNumButtons() { return m_iButtons; }; + CommandButton *FindButtonWithSubmenu( CCommandMenu *pSubMenu ); + + void ClearButtonsOfArmedState( void ); + + void RemoveAllButtons(void); + + + bool KeyInput( int keyNum ); + + virtual void paintBackground(); +}; + +//============================================================================== +// Command menu root button (drop down box style) + +class DropDownButton : public ColorButton +{ +private: + CImageLabel *m_pOpenButton; + +public: + + DropDownButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat ) : + ColorButton( text, x, y, wide, tall, bNoHighlight, bFlat ) + { + // Put a > to show it's a submenu + m_pOpenButton = new CImageLabel( "arrowup", XRES( CMENU_SIZE_X-2 ) , YRES( BUTTON_SIZE_Y-2 ) ); + m_pOpenButton->setParent(this); + + int textwide, texttall; + getSize( textwide, texttall); + + // Reposition + m_pOpenButton->setPos( textwide-(m_pOpenButton->getImageWide()+6), -2 /*(tall - m_pOpenButton->getImageTall()*2) / 2*/ ); + m_pOpenButton->setVisible(true); + + } + + virtual void setVisible(bool state) + { + m_pOpenButton->setVisible(state); + ColorButton::setVisible(state); + } + + +}; + +//============================================================================== +// Button with image instead of text + +class CImageButton : public ColorButton +{ +private: + CImageLabel *m_pOpenButton; + +public: + + CImageButton( const char* text,int x,int y,int wide,int tall, bool bNoHighlight, bool bFlat ) : + ColorButton( " ", x, y, wide, tall, bNoHighlight, bFlat ) + { + m_pOpenButton = new CImageLabel( text,1,1,wide-2 , tall-2 ); + m_pOpenButton->setParent(this); + + // Reposition + // m_pOpenButton->setPos( x+1,y+1 ); + // m_pOpenButton->setSize(wide-2,tall-2); + + m_pOpenButton->setVisible(true); + } + + virtual void setVisible(bool state) + { + m_pOpenButton->setVisible(state); + ColorButton::setVisible(state); + } + + +}; + +//============================================================================== +class TeamFortressViewport : public Panel +{ +private: + vgui::Cursor* _cursorNone; + vgui::Cursor* _cursorArrow; + + int m_iInitialized; + + CCommandMenu *m_pCommandMenus[MAX_MENUS]; + CCommandMenu *m_pCurrentCommandMenu; + float m_flMenuOpenTime; + float m_flScoreBoardLastUpdated; + float m_flSpectatorPanelLastUpdated; + int m_iNumMenus; + int m_iCurrentTeamNumber; + int m_iCurrentPlayerClass; + int m_iUser1; + int m_iUser2; + int m_iUser3; + + // VGUI Menus + void CreateTeamMenu( void ); + CMenuPanel* ShowTeamMenu( void ); + void CreateClassMenu( void ); + CMenuPanel* ShowClassMenu( void ); + void CreateSpectatorMenu( void ); + + // Scheme handler + CSchemeManager m_SchemeManager; + + // MOTD + int m_iGotAllMOTD; + char m_szMOTD[ MAX_MOTD_LENGTH ]; + + // Command Menu Team buttons + CommandButton *m_pTeamButtons[6]; + CommandButton *m_pDisguiseButtons[5]; + BuildButton *m_pBuildButtons[3]; + BuildButton *m_pBuildActiveButtons[3]; + + int m_iAllowSpectators; + + // Data for specific sections of the Command Menu + int m_iValidClasses[5]; + int m_iIsFeigning; + int m_iIsSettingDetpack; + int m_iNumberOfTeams; + int m_iBuildState; + int m_iRandomPC; + char m_sTeamNames[5][MAX_TEAMNAME_SIZE]; + + // Localisation strings + char m_sDetpackStrings[3][MAX_BUTTON_SIZE]; + + char m_sMapName[64]; + + // helper function to update the player menu entries + void UpdatePlayerMenu(int menuIndex); + +public: + TeamFortressViewport(int x,int y,int wide,int tall); + void Initialize( void ); + + int CreateCommandMenu( const char * menuFile, int direction, int yOffset, bool flatDesign, float flButtonSizeX, float flButtonSizeY, int xOffset ); + void CreateScoreBoard( void ); + CommandButton * CreateCustomButton( char *pButtonText, char * pButtonName, int iYOffset ); + CCommandMenu * CreateDisguiseSubmenu( CommandButton *pButton, CCommandMenu *pParentMenu, const char *commandText, int iYOffset, int iXOffset = 0 ); + + void UpdateCursorState( void ); + void UpdateCommandMenu(int menuIndex); + void UpdateOnPlayerInfo( void ); + void UpdateHighlights( void ); + void UpdateSpectatorPanel( void ); + + int KeyInput( int down, int keynum, const char *pszCurrentBinding ); + void InputPlayerSpecial( void ); + void GetAllPlayersInfo( void ); + void DeathMsg( int killer, int victim ); + + void ShowCommandMenu(int menuIndex); + void InputSignalHideCommandMenu( void ); + void HideCommandMenu( void ); + void SetCurrentCommandMenu( CCommandMenu *pNewMenu ); + void SetCurrentMenu( CMenuPanel *pMenu ); + + void ShowScoreBoard( void ); + void HideScoreBoard( void ); + bool IsScoreBoardVisible( void ); + + bool AllowedToPrintText( void ); + + void ShowVGUIMenu( int iMenu ); + void HideVGUIMenu( void ); + void HideTopMenu( void ); + + CMenuPanel* CreateTextWindow( int iTextToShow ); + + CCommandMenu *CreateSubMenu( CommandButton *pButton, CCommandMenu *pParentMenu, int iYOffset, int iXOffset = 0 ); + + // Data Handlers + int GetValidClasses(int iTeam) { return m_iValidClasses[iTeam]; }; + int GetNumberOfTeams() { return m_iNumberOfTeams; }; + int GetIsFeigning() { return m_iIsFeigning; }; + int GetIsSettingDetpack() { return m_iIsSettingDetpack; }; + int GetBuildState() { return m_iBuildState; }; + int IsRandomPC() { return m_iRandomPC; }; + char *GetTeamName( int iTeam ) { return m_sTeamNames[iTeam]; }; + int GetAllowSpectators() { return m_iAllowSpectators; }; + + // Message Handlers + int MsgFunc_ValClass(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamNames(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Feign(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Detpack(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_VGUIMenu(const char *pszName, int iSize, void *pbuf ); + int MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_BuildSt( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_RandomPC( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ServerName( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_AllowSpec( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_SpecFade( const char *pszName, int iSize, void *pbuf ); + int MsgFunc_ResetFade( const char *pszName, int iSize, void *pbuf ); + + // Input + bool SlotInput( int iSlot ); + + virtual void paintBackground(); + + CSchemeManager *GetSchemeManager( void ) { return &m_SchemeManager; } + ScorePanel *GetScoreBoard( void ) { return m_pScoreBoard; } + + void *operator new( size_t stAllocateBlock ); + +public: + // VGUI Menus + CMenuPanel *m_pCurrentMenu; + CTeamMenuPanel *m_pTeamMenu; + int m_StandardMenu; // indexs in m_pCommandMenus + int m_SpectatorOptionsMenu; + int m_SpectatorCameraMenu; + int m_PlayerMenu; // a list of current player + CClassMenuPanel *m_pClassMenu; + ScorePanel *m_pScoreBoard; + SpectatorPanel *m_pSpectatorPanel; + char m_szServerName[ MAX_SERVERNAME_LENGTH ]; +}; + +//============================================================ +// Command Menu Button Handlers +#define MAX_COMMAND_SIZE 256 + +class CMenuHandler_StringCommand : public ActionSignal +{ +protected: + char m_pszCommand[MAX_COMMAND_SIZE]; + int m_iCloseVGUIMenu; +public: + CMenuHandler_StringCommand( const char *pszCommand ) + { + strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE - 1 ); + m_pszCommand[MAX_COMMAND_SIZE - 1] = '\0'; + m_iCloseVGUIMenu = false; + } + + CMenuHandler_StringCommand( const char *pszCommand, int iClose ) + { + strncpy( m_pszCommand, pszCommand, MAX_COMMAND_SIZE - 1 ); + m_pszCommand[MAX_COMMAND_SIZE - 1] = '\0'; + m_iCloseVGUIMenu = true; + } + + virtual void actionPerformed(Panel *panel) + { + gEngfuncs.pfnClientCmd( m_pszCommand ); + + if( m_iCloseVGUIMenu ) + gViewPort->HideTopMenu(); + else + gViewPort->HideCommandMenu(); + } +}; + +// This works the same as CMenuHandler_StringCommand, except it watches the string command +// for specific commands, and modifies client vars based upon them. +class CMenuHandler_StringCommandWatch : public CMenuHandler_StringCommand +{ +private: +public: + CMenuHandler_StringCommandWatch( const char *pszCommand ) : CMenuHandler_StringCommand( pszCommand ) + { + } + + CMenuHandler_StringCommandWatch( const char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose ) + { + } + + virtual void actionPerformed( Panel *panel ) + { + CMenuHandler_StringCommand::actionPerformed( panel ); + + // Try to guess the player's new team (it'll be corrected if it's wrong) + if( !strcmp( m_pszCommand, "jointeam 1" ) ) + g_iTeamNumber = 1; + else if( !strcmp( m_pszCommand, "jointeam 2" ) ) + g_iTeamNumber = 2; + else if( !strcmp( m_pszCommand, "jointeam 3" ) ) + g_iTeamNumber = 3; + else if( !strcmp( m_pszCommand, "jointeam 4" ) ) + g_iTeamNumber = 4; + } +}; + +// Used instead of CMenuHandler_StringCommand for Class Selection buttons. +// Checks the state of hud_classautokill and kills the player if set +class CMenuHandler_StringCommandClassSelect : public CMenuHandler_StringCommand +{ +private: +public: + CMenuHandler_StringCommandClassSelect( char *pszCommand ) : CMenuHandler_StringCommand( pszCommand ) + { + } + + CMenuHandler_StringCommandClassSelect( char *pszCommand, int iClose ) : CMenuHandler_StringCommand( pszCommand, iClose ) + { + } + + virtual void actionPerformed( Panel *panel ); +}; + +class CMenuHandler_PopupSubMenuInput : public InputSignal +{ +private: + CCommandMenu *m_pSubMenu; + Button *m_pButton; +public: + CMenuHandler_PopupSubMenuInput( Button *pButton, CCommandMenu *pSubMenu ) + { + m_pSubMenu = pSubMenu; + m_pButton = pButton; + } + + virtual void cursorMoved( int x, int y, Panel *panel ) + { + // gViewPort->SetCurrentCommandMenu( m_pSubMenu ); + } + + virtual void cursorEntered( Panel *panel ) + { + gViewPort->SetCurrentCommandMenu( m_pSubMenu ); + + if( m_pButton ) + m_pButton->setArmed( true ); + }; + virtual void cursorExited(Panel* Panel) {}; + virtual void mousePressed(MouseCode code,Panel* panel) {}; + virtual void mouseDoublePressed(MouseCode code,Panel* panel) {}; + virtual void mouseReleased(MouseCode code,Panel* panel) {}; + virtual void mouseWheeled(int delta,Panel* panel) {}; + virtual void keyPressed(KeyCode code,Panel* panel) {}; + virtual void keyTyped(KeyCode code,Panel* panel) {}; + virtual void keyReleased(KeyCode code,Panel* panel) {}; + virtual void keyFocusTicked(Panel* panel) {}; +}; + +class CMenuHandler_LabelInput : public InputSignal +{ +private: + ActionSignal *m_pActionSignal; +public: + CMenuHandler_LabelInput( ActionSignal *pSignal ) + { + m_pActionSignal = pSignal; + } + + virtual void mousePressed( MouseCode code, Panel *panel ) + { + m_pActionSignal->actionPerformed( panel ); + } + + virtual void mouseReleased( MouseCode code, Panel *panel ) {}; + virtual void cursorEntered( Panel *panel ) {}; + virtual void cursorExited( Panel *Panel ) {}; + virtual void cursorMoved( int x, int y, Panel *panel ) {}; + virtual void mouseDoublePressed( MouseCode code, Panel *panel ) {}; + virtual void mouseWheeled( int delta, Panel *panel ) {}; + virtual void keyPressed( KeyCode code, Panel *panel ) {}; + virtual void keyTyped( KeyCode code, Panel *panel ) {}; + virtual void keyReleased( KeyCode code, Panel *panel ) {}; + virtual void keyFocusTicked( Panel *panel ) {}; +}; + +#define HIDE_TEXTWINDOW 0 +#define SHOW_MAPBRIEFING 1 +#define SHOW_CLASSDESC 2 +#define SHOW_MOTD 3 +#define SHOW_SPECHELP 4 + +class CMenuHandler_TextWindow : public ActionSignal +{ +private: + int m_iState; + +public: + CMenuHandler_TextWindow( int iState ) + { + m_iState = iState; + } + + virtual void actionPerformed( Panel *panel ) + { + if( m_iState == HIDE_TEXTWINDOW ) + { + gViewPort->HideTopMenu(); + } + else + { + gViewPort->HideCommandMenu(); + gViewPort->ShowVGUIMenu( m_iState ); + } + } +}; + +class CMenuHandler_ToggleCvar : public ActionSignal +{ +private: + struct cvar_s *m_cvar; + +public: + CMenuHandler_ToggleCvar( char *cvarname ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + } + + virtual void actionPerformed( Panel *panel ) + { + if( m_cvar->value ) + m_cvar->value = 0.0f; + else + m_cvar->value = 1.0f; + + // hide the menu + gViewPort->HideCommandMenu(); + + gViewPort->UpdateSpectatorPanel(); + } +}; + + + +class CMenuHandler_SpectateFollow : public ActionSignal +{ +protected: + char m_szplayer[MAX_COMMAND_SIZE]; +public: + CMenuHandler_SpectateFollow( char *player ) + { + strncpy( m_szplayer, player, MAX_COMMAND_SIZE); + m_szplayer[MAX_COMMAND_SIZE-1] = '\0'; + } + + virtual void actionPerformed(Panel* panel) + { + gHUD.m_Spectator.FindPlayer(m_szplayer); + gViewPort->HideCommandMenu(); + } +}; + + + +class CDragNDropHandler : public InputSignal +{ +private: + DragNDropPanel *m_pPanel; + bool m_bDragging; + int m_iaDragOrgPos[2]; + int m_iaDragStart[2]; + +public: + CDragNDropHandler( DragNDropPanel *pPanel ) + { + m_pPanel = pPanel; + m_bDragging = false; + } + + void cursorMoved( int x, int y, Panel *panel ); + void mousePressed( MouseCode code, Panel *panel ); + void mouseReleased( MouseCode code, Panel *panel ); + + void mouseDoublePressed( MouseCode code, Panel *panel ) {}; + void cursorEntered( Panel *panel ) {}; + void cursorExited( Panel *panel ) {}; + void mouseWheeled( int delta, Panel *panel ) {}; + void keyPressed( KeyCode code, Panel *panel ) {}; + void keyTyped( KeyCode code, Panel *panel ) {}; + void keyReleased( KeyCode code, Panel *panel ) {}; + void keyFocusTicked( Panel *panel ) {}; +}; + +class CHandler_MenuButtonOver : public InputSignal +{ +private: + int m_iButton; + CMenuPanel *m_pMenuPanel; +public: + CHandler_MenuButtonOver( CMenuPanel *pPanel, int iButton ) + { + m_iButton = iButton; + m_pMenuPanel = pPanel; + } + + void cursorEntered( Panel *panel ); + + void cursorMoved( int x, int y, Panel *panel ) {}; + void mousePressed( MouseCode code, Panel *panel ) {}; + void mouseReleased( MouseCode code, Panel *panel ) {}; + void mouseDoublePressed( MouseCode code, Panel *panel ) {}; + void cursorExited( Panel *panel) {}; + void mouseWheeled( int delta, Panel *panel ) {}; + void keyPressed( KeyCode code, Panel *panel ) {}; + void keyTyped( KeyCode code, Panel *panel ) {}; + void keyReleased( KeyCode code, Panel *panel ) {}; + void keyFocusTicked( Panel *panel ) {}; +}; + +class CHandler_ButtonHighlight : public InputSignal +{ +private: + Button *m_pButton; +public: + CHandler_ButtonHighlight( Button *pButton ) + { + m_pButton = pButton; + } + + virtual void cursorEntered( Panel *panel ) + { + m_pButton->setArmed( true ); + }; + + virtual void cursorExited( Panel *Panel ) + { + m_pButton->setArmed( false ); + }; + + virtual void mousePressed( MouseCode code, Panel *panel ) {}; + virtual void mouseReleased( MouseCode code, Panel *panel ) {}; + virtual void cursorMoved( int x, int y, Panel *panel ) {}; + virtual void mouseDoublePressed( MouseCode code, Panel *panel ) {}; + virtual void mouseWheeled( int delta, Panel *panel ) {}; + virtual void keyPressed( KeyCode code, Panel *panel ) {}; + virtual void keyTyped( KeyCode code, Panel *panel ) {}; + virtual void keyReleased( KeyCode code, Panel *panel ) {}; + virtual void keyFocusTicked( Panel *panel ) {}; +}; + +//----------------------------------------------------------------------------- +// Purpose: Special handler for highlighting of command menu buttons +//----------------------------------------------------------------------------- +class CHandler_CommandButtonHighlight : public CHandler_ButtonHighlight +{ +private: + CommandButton *m_pCommandButton; +public: + CHandler_CommandButtonHighlight( CommandButton *pButton ) : CHandler_ButtonHighlight( pButton ) + { + m_pCommandButton = pButton; + } + + virtual void cursorEntered( Panel *panel ) + { + m_pCommandButton->cursorEntered(); + } + + virtual void cursorExited( Panel *panel ) + { + m_pCommandButton->cursorExited(); + } +}; + + +//================================================================ +// Overidden Command Buttons for special visibilities +class ClassButton : public CommandButton +{ +protected: + int m_iPlayerClass; + +public: + ClassButton( int iClass, const char *text, int x, int y, int wide, int tall, bool bNoHighlight ) : CommandButton( text, x, y, wide, tall, bNoHighlight ) + { + m_iPlayerClass = iClass; + } + + virtual int IsNotValid(); +}; + +class TeamButton : public CommandButton +{ +private: + int m_iTeamNumber; +public: + TeamButton( int iTeam, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) + { + m_iTeamNumber = iTeam; + } + + virtual int IsNotValid() + { + int iTeams = gViewPort->GetNumberOfTeams(); + + // Never valid if there's only 1 team + if( iTeams == 1 ) + return true; + + // Auto Team's always visible + if( m_iTeamNumber == 5 ) + return false; + + if( iTeams >= m_iTeamNumber && m_iTeamNumber != g_iTeamNumber ) + return false; + + return true; + } +}; + +class FeignButton : public CommandButton +{ +private: + int m_iFeignState; +public: + FeignButton( int iState, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) + { + m_iFeignState = iState; + } + + virtual int IsNotValid() + { + // Only visible for spies +#ifdef _TFC + if( g_iPlayerClass != PC_SPY ) + return true; +#endif + + if( m_iFeignState == gViewPort->GetIsFeigning() ) + return false; + + return true; + } +}; + +class SpectateButton : public CommandButton +{ +public: + SpectateButton( const char *text, int x, int y, int wide, int tall, bool bNoHighlight ) : CommandButton( text, x, y, wide, tall, bNoHighlight ) + { + } + + virtual int IsNotValid() + { + // Only visible if the server allows it + if( gViewPort->GetAllowSpectators() != 0 ) + return false; + + return true; + } +}; + +#define DISGUISE_TEAM1 (1<<0) +#define DISGUISE_TEAM2 (1<<1) +#define DISGUISE_TEAM3 (1<<2) +#define DISGUISE_TEAM4 (1<<3) + +class DisguiseButton : public CommandButton +{ +private: + int m_iValidTeamsBits; + int m_iThisTeam; +public: + DisguiseButton( int iValidTeamNumsBits, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall, false ) + { + m_iValidTeamsBits = iValidTeamNumsBits; + } + + virtual int IsNotValid() + { +#ifdef _TFC + // Only visible for spies + if( g_iPlayerClass != PC_SPY ) + return true; +#endif + + // if it's not tied to a specific team, then always show (for spies) + if( !m_iValidTeamsBits ) + return false; + + // if we're tied to a team make sure we can change to that team + int iTmp = 1 << ( gViewPort->GetNumberOfTeams() - 1 ); + if( m_iValidTeamsBits & iTmp ) + return false; + + return true; + } +}; + +class DetpackButton : public CommandButton +{ +private: + int m_iDetpackState; +public: + DetpackButton( int iState, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) + { + m_iDetpackState = iState; + } + + virtual int IsNotValid() + { +#ifdef _TFC + // Only visible for demomen + if( g_iPlayerClass != PC_DEMOMAN ) + return true; +#endif + + if( m_iDetpackState == gViewPort->GetIsSettingDetpack() ) + return false; + + return true; + } +}; + +extern int iBuildingCosts[]; +#define BUILDSTATE_HASBUILDING (1<<0) // Data is building ID (1 = Dispenser, 2 = Sentry, 3 = Entry Teleporter, 4 = Exit Teleporter) +#define BUILDSTATE_BUILDING (1<<1) +#define BUILDSTATE_BASE (1<<2) +#define BUILDSTATE_CANBUILD (1<<3) // Data is building ID (1 = Dispenser, 2 = Sentry, 3 = Entry Teleporter, 4 = Exit Teleporter) + +class BuildButton : public CommandButton +{ +private: + int m_iBuildState; + int m_iBuildData; + +public: + enum Buildings + { + DISPENSER = 0, + SENTRYGUN = 1, + ENTRY_TELEPORTER = 2, + EXIT_TELEPORTER = 3 + }; + + BuildButton( int iState, int iData, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) + { + m_iBuildState = iState; + m_iBuildData = iData; + } + + virtual int IsNotValid() + { +#ifdef _TFC + // Only visible for engineers + if( g_iPlayerClass != PC_ENGINEER ) + return true; + + // If this isn't set, it's only active when they're not building + if( m_iBuildState & BUILDSTATE_BUILDING ) + { + // Make sure the player's building + if( !( gViewPort->GetBuildState() & BS_BUILDING ) ) + return true; + } + else + { + // Make sure the player's not building + if( gViewPort->GetBuildState() & BS_BUILDING ) + return true; + } + + if( m_iBuildState & BUILDSTATE_BASE ) + { + // Only appear if we've got enough metal to build something, or something already built + if ( gViewPort->GetBuildState() & (BS_HAS_SENTRYGUN | BS_HAS_DISPENSER | BS_CANB_SENTRYGUN | BS_CANB_DISPENSER | BS_HAS_ENTRY_TELEPORTER | BS_HAS_EXIT_TELEPORTER | BS_CANB_ENTRY_TELEPORTER | BS_CANB_EXIT_TELEPORTER) ) + return false; + + return true; + } + + // Must have a building + if( m_iBuildState & BUILDSTATE_HASBUILDING ) + { + if( m_iBuildData == BuildButton::DISPENSER && !( gViewPort->GetBuildState() & BS_HAS_DISPENSER ) ) + return true; + + if( m_iBuildData == BuildButton::SENTRYGUN && !( gViewPort->GetBuildState() & BS_HAS_SENTRYGUN ) ) + return true; + if ( m_iBuildData == BuildButton::ENTRY_TELEPORTER && !(gViewPort->GetBuildState() & BS_HAS_ENTRY_TELEPORTER) ) + return true; + if ( m_iBuildData == BuildButton::EXIT_TELEPORTER && !(gViewPort->GetBuildState() & BS_HAS_EXIT_TELEPORTER) ) + return true; + } + + // Can build something + if( m_iBuildState & BUILDSTATE_CANBUILD ) + { + // Make sure they've got the ammo and don't have one already + if( m_iBuildData == BuildButton::DISPENSER && ( gViewPort->GetBuildState() & BS_CANB_DISPENSER ) ) + return false; + if( m_iBuildData == BuildButton::SENTRYGUN && ( gViewPort->GetBuildState() & BS_CANB_SENTRYGUN ) ) + return false; + if ( m_iBuildData == BuildButton::ENTRY_TELEPORTER && (gViewPort->GetBuildState() & BS_CANB_ENTRY_TELEPORTER) ) + return false; + if ( m_iBuildData == BuildButton::EXIT_TELEPORTER && (gViewPort->GetBuildState() & BS_CANB_EXIT_TELEPORTER) ) + return false; + + return true; + } +#endif + return false; + } +}; + +#define MAX_MAPNAME 256 + +class MapButton : public CommandButton +{ +private: + char m_szMapName[MAX_MAPNAME]; + +public: + MapButton( const char *pMapName, const char *text, int x, int y, int wide, int tall ) : CommandButton( text, x, y, wide, tall ) + { + sprintf( m_szMapName, "maps/%s.bsp", pMapName ); + } + + virtual int IsNotValid() + { + const char *level = gEngfuncs.pfnGetLevelName(); + if( !level ) + return true; + + // Does it match the current map name? + if( strcmp( m_szMapName, level ) ) + return true; + + return false; + } +}; + +//----------------------------------------------------------------------------- +// Purpose: CommandButton which is only displayed if the player is on team X +//----------------------------------------------------------------------------- +class TeamOnlyCommandButton : public CommandButton +{ +private: + int m_iTeamNum; + +public: + TeamOnlyCommandButton( int iTeamNum, const char *text, int x, int y, int wide, int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ), m_iTeamNum( iTeamNum ) {} + + virtual int IsNotValid() + { + if( g_iTeamNumber != m_iTeamNum ) + return true; + + return CommandButton::IsNotValid(); + } +}; + +//----------------------------------------------------------------------------- +// Purpose: CommandButton which is only displayed if the player is on team X +//----------------------------------------------------------------------------- +class ToggleCommandButton : public CommandButton, public InputSignal +{ +private: + struct cvar_s *m_cvar; + CImageLabel *pLabelOn; + CImageLabel *pLabelOff; + +public: + ToggleCommandButton( const char *cvarname, const char *text, int x, int y, int wide, int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent(this); + pLabelOn->addInputSignal(this); + + pLabelOff = new CImageLabel( "unchecked", 0, 0 ); + pLabelOff->setParent(this); + pLabelOff->setEnabled(true); + pLabelOff->addInputSignal(this); + + int textwide, texttall; + getTextSize( textwide, texttall ); + + // Reposition + pLabelOn->setPos( textwide, ( tall - pLabelOn->getTall() ) / 2 ); + + pLabelOff->setPos( textwide, ( tall - pLabelOff->getTall() ) / 2 ); + + // Set text color to orange + setFgColor( Scheme::sc_primary1 ); + } + + virtual void cursorEntered( Panel *panel ) + { + CommandButton::cursorEntered(); + } + + virtual void cursorExited( Panel *panel ) + { + CommandButton::cursorExited(); + } + + virtual void mousePressed( MouseCode code, Panel *panel ) + { + doClick(); + }; + + virtual void cursorMoved( int x, int y, Panel *panel ) {}; + + virtual void mouseDoublePressed( MouseCode code, Panel *panel) {}; + virtual void mouseReleased( MouseCode code, Panel *panel ) {}; + virtual void mouseWheeled( int delta, Panel *panel ) {}; + virtual void keyPressed( KeyCode code, Panel *panel ) {}; + virtual void keyTyped( KeyCode code, Panel *panel ) {}; + virtual void keyReleased( KeyCode code, Panel *panel ) {}; + virtual void keyFocusTicked( Panel *panel) {}; + + virtual void paint( void ) + { + if( !m_cvar ) + { + pLabelOff->setVisible( false ); + pLabelOn->setVisible( false ); + } + else if( m_cvar->value ) + { + pLabelOff->setVisible( false ); + pLabelOn->setVisible( true ); + } + else + { + pLabelOff->setVisible( true ); + pLabelOn->setVisible( false ); + } + + CommandButton::paint(); + } +}; +class SpectToggleButton : public CommandButton, public InputSignal +{ +private: + struct cvar_s *m_cvar; + CImageLabel *pLabelOn; + +public: + SpectToggleButton( const char *cvarname, const char *text, int x, int y, int wide, int tall, bool flat ) : + CommandButton( text, x, y, wide, tall, false, flat ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent( this ); + pLabelOn->addInputSignal( this ); + + int textwide, texttall; + getTextSize( textwide, texttall ); + + // Reposition + pLabelOn->setPos( textwide, ( tall - pLabelOn->getTall() ) / 2 ); + } + + virtual void cursorEntered( Panel *panel ) + { + CommandButton::cursorEntered(); + } + + virtual void cursorExited( Panel *panel ) + { + CommandButton::cursorExited(); + } + + virtual void mousePressed( MouseCode code, Panel *panel ) + { + doClick(); + }; + + virtual void cursorMoved( int x, int y, Panel *panel ) {}; + + virtual void mouseDoublePressed( MouseCode code, Panel *panel ) {}; + virtual void mouseReleased( MouseCode code, Panel *panel ) {}; + virtual void mouseWheeled( int delta, Panel *panel ) {}; + virtual void keyPressed( KeyCode code, Panel *panel ) {}; + virtual void keyTyped( KeyCode code, Panel *panel ) {}; + virtual void keyReleased( KeyCode code, Panel *panel ) {}; + virtual void keyFocusTicked( Panel *panel ) {}; + + virtual void paintBackground() + { + if( isArmed() ) + { + drawSetColor( 143, 143, 54, 125 ); + drawFilledRect( 5, 0, _size[0] - 5, _size[1] ); + } + } + + virtual void paint( void ) + { + if( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + if( !m_cvar ) + { + pLabelOn->setVisible( false ); + } + else if( m_cvar->value ) + { + pLabelOn->setVisible( true ); + } + else + { + pLabelOn->setVisible( false ); + } + + Button::paint(); + } +}; + +/* +class SpectToggleButton : public ToggleCommandButton +{ +private: + struct cvar_s *m_cvar; + CImageLabel *pLabelOn; + CImageLabel *pLabelOff; + +public: + SpectToggleButton( const char *cvarname, const char *text, int x, int y, int wide, int tall, bool flat ) : + ToggleCommandButton( cvarname, text, x, y, wide, tall, flat, TRUE ) + { + m_cvar = gEngfuncs.pfnGetCvarPointer( cvarname ); + + // Put a > to show it's a submenu + pLabelOn = new CImageLabel( "checked", 0, 0 ); + pLabelOn->setParent( this ); + pLabelOn->addInputSignal( this ); + + pLabelOff = new CImageLabel( "unchecked", 0, 0 ); + pLabelOff->setParent( this ); + pLabelOff->setEnabled( true ); + pLabelOff->addInputSignal( this ); + + int textwide, texttall; + getTextSize( textwide, texttall ); + + // Reposition + pLabelOn->setPos( textwide, ( tall - pLabelOn->getTall() ) / 2 ); + + pLabelOff->setPos( textwide, ( tall - pLabelOff->getTall() ) / 2 ); + + // Set text color to orange + setFgColor( Scheme::sc_primary1 ); + } + + virtual void paintBackground() + { + if( isArmed() ) + { + drawSetColor( 143,143, 54, 125 ); + drawFilledRect( 5, 0, _size[0] - 5,_size[1] ); + } + } + + virtual void paint() + { + + if( isArmed() ) + { + setFgColor( 194, 202, 54, 0 ); + } + else + { + setFgColor( 143, 143, 54, 15 ); + } + + if( !m_cvar ) + { + pLabelOff->setVisible( false ); + pLabelOn->setVisible( false ); + } + else if( m_cvar->value ) + { + pLabelOff->setVisible( false ); + pLabelOn->setVisible( true ); + } + else + { + pLabelOff->setVisible( true ); + pLabelOn->setVisible( false ); + } + + Button::paint(); + } +}; +*/ + +//============================================================ +// Panel that can be dragged around +class DragNDropPanel : public Panel +{ +private: + bool m_bBeingDragged; + LineBorder *m_pBorder; +public: + DragNDropPanel( int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) + { + m_bBeingDragged = false; + + // Create the Drag Handler + addInputSignal( new CDragNDropHandler( this ) ); + + // Create the border (for dragging) + m_pBorder = new LineBorder(); + } + + virtual void setDragged( bool bState ) + { + m_bBeingDragged = bState; + + if( m_bBeingDragged ) + setBorder( m_pBorder ); + else + setBorder( NULL ); + } +}; + +//================================================================ +// Panel that draws itself with a transparent black background +class CTransparentPanel : public Panel +{ +private: + int m_iTransparency; +public: + CTransparentPanel( int iTrans, int x, int y, int wide, int tall ) : Panel( x, y, wide, tall ) + { + m_iTransparency = iTrans; + } + + virtual void paintBackground() + { + if( m_iTransparency ) + { + // Transparent black background + drawSetColor( 0, 0, 0, m_iTransparency ); + drawFilledRect( 0, 0, _size[0], _size[1] ); + } + } +}; + +//================================================================ +// Menu Panel that supports buffering of menus +class CMenuPanel : public CTransparentPanel +{ +private: + CMenuPanel *m_pNextMenu; + int m_iMenuID; + int m_iRemoveMe; + int m_iIsActive; + float m_flOpenTime; +public: + CMenuPanel( int iRemoveMe, int x, int y, int wide, int tall ) : CTransparentPanel( 100, x, y, wide, tall ) + { + Reset(); + m_iRemoveMe = iRemoveMe; + } + + CMenuPanel( int iTrans, int iRemoveMe, int x, int y, int wide, int tall ) : CTransparentPanel( iTrans, x, y, wide, tall ) + { + Reset(); + m_iRemoveMe = iRemoveMe; + } + + virtual void Reset( void ) + { + m_pNextMenu = NULL; + m_iIsActive = false; + m_flOpenTime = 0; + } + + void SetNextMenu( CMenuPanel *pNextPanel ) + { + if( m_pNextMenu ) + m_pNextMenu->SetNextMenu( pNextPanel ); + else + m_pNextMenu = pNextPanel; + } + + void SetMenuID( int iID ) + { + m_iMenuID = iID; + } + + void SetActive( int iState ) + { + m_iIsActive = iState; + } + + virtual void Open( void ) + { + setVisible( true ); + + // Note the open time, so we can delay input for a bit + m_flOpenTime = gHUD.m_flTime; + } + + virtual void Close( void ) + { + setVisible( false ); + m_iIsActive = false; + + if ( m_iRemoveMe ) + gViewPort->removeChild( this ); + + // This MenuPanel has now been deleted. Don't append code here. + } + + int ShouldBeRemoved() { return m_iRemoveMe; }; + CMenuPanel* GetNextMenu() { return m_pNextMenu; }; + int GetMenuID() { return m_iMenuID; }; + int IsActive() { return m_iIsActive; }; + float GetOpenTime() { return m_flOpenTime; }; + + // Numeric input + virtual bool SlotInput( int iSlot ) { return false; }; + virtual void SetActiveInfo( int iInput ) {}; +}; + +//================================================================ +// Custom drawn scroll bars +class CTFScrollButton : public CommandButton +{ +private: + BitmapTGA *m_pTGA; + +public: + CTFScrollButton( int iArrow, const char *text, int x, int y, int wide, int tall ); + + virtual void paint( void ); + virtual void paintBackground( void ); +}; + +// Custom drawn slider bar +class CTFSlider : public Slider +{ +public: + CTFSlider( int x, int y, int wide, int tall, bool vertical ) : Slider( x, y, wide, tall, vertical ) + { + }; + + virtual void paintBackground( void ); +}; + +// Custom drawn scrollpanel +class CTFScrollPanel : public ScrollPanel +{ +public: + CTFScrollPanel(int x,int y,int wide,int tall); +}; + +//================================================================ +// Menu Panels that take key input +//============================================================ +class CClassMenuPanel : public CMenuPanel +{ +private: + CTransparentPanel *m_pClassInfoPanel[PC_LASTCLASS]; + Label *m_pPlayers[PC_LASTCLASS]; + ClassButton *m_pButtons[PC_LASTCLASS]; + CommandButton *m_pCancelButton; + ScrollPanel *m_pScrollPanel; + + CImageLabel *m_pClassImages[MAX_TEAMS][PC_LASTCLASS]; + + int m_iCurrentInfo; + + enum { STRLENMAX_PLAYERSONTEAM = 128 }; + char m_sPlayersOnTeamString[STRLENMAX_PLAYERSONTEAM]; + +public: + CClassMenuPanel( int iTrans, int iRemoveMe, int x, int y, int wide, int tall ); + + virtual bool SlotInput( int iSlot ); + virtual void Open( void ); + virtual void Update( void ); + virtual void SetActiveInfo( int iInput ); + virtual void Initialize( void ); + + virtual void Reset( void ) + { + CMenuPanel::Reset(); + m_iCurrentInfo = 0; + } +}; + +class CTeamMenuPanel : public CMenuPanel +{ +public: + ScrollPanel *m_pScrollPanel; + CTransparentPanel *m_pTeamWindow; + Label *m_pMapTitle; + TextPanel *m_pBriefing; + TextPanel *m_pTeamInfoPanel[6]; + CommandButton *m_pButtons[6]; + bool m_bUpdatedMapName; + CommandButton *m_pCancelButton; + CommandButton *m_pSpectateButton; + + int m_iCurrentInfo; + +public: + CTeamMenuPanel( int iTrans, int iRemoveMe, int x, int y, int wide, int tall ); + + virtual bool SlotInput( int iSlot ); + virtual void Open( void ); + virtual void Update( void ); + virtual void SetActiveInfo( int iInput ); + virtual void paintBackground( void ); + + virtual void Initialize( void ); + + virtual void Reset( void ) + { + CMenuPanel::Reset(); + m_iCurrentInfo = 0; + } +}; + +//========================================================= +// Specific Menus to handle old HUD sections +class CHealthPanel : public DragNDropPanel +{ +private: + BitmapTGA *m_pHealthTGA; + Label *m_pHealthLabel; +public: + CHealthPanel( int x, int y, int wide, int tall ) : DragNDropPanel( x, y, wide, tall ) + { + // Load the Health icon + FileInputStream *fis = new FileInputStream( GetVGUITGAName( "%d_hud_health" ), false ); + m_pHealthTGA = new BitmapTGA( fis, true ); + fis->close(); + + // Create the Health Label + int iXSize, iYSize; + m_pHealthTGA->getSize( iXSize, iYSize ); + m_pHealthLabel = new Label( "", 0, 0, iXSize, iYSize ); + m_pHealthLabel->setImage( m_pHealthTGA ); + m_pHealthLabel->setParent( this ); + + // Set panel dimension + // Shouldn't be needed once Billy's fized setImage not recalculating the size + // setSize( iXSize + 100, gHUD.m_iFontHeight + 10 ); + // m_pHealthLabel->setPos( 10, ( getTall() - iYSize ) / 2 ); + } + + virtual void paintBackground() + { + } + + void paint() + { + // Get the paint color + int r,g,b,a; + // Has health changed? Flash the health # + if( gHUD.m_Health.m_fFade ) + { + gHUD.m_Health.m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + if( gHUD.m_Health.m_fFade <= 0 ) + { + a = MIN_ALPHA; + gHUD.m_Health.m_fFade = 0; + } + + // Fade the health number back to dim + a = MIN_ALPHA + ( gHUD.m_Health.m_fFade / FADE_TIME ) * 128; + } + else + a = MIN_ALPHA; + + gHUD.m_Health.GetPainColor( r, g, b ); + ScaleColors(r, g, b, a ); + + // If health is getting low, make it bright red + if( gHUD.m_Health.m_iHealth <= 15 ) + a = 255; + + int iXSize, iYSize, iXPos, iYPos; + m_pHealthTGA->getSize( iXSize, iYSize ); + m_pHealthTGA->getPos( iXPos, iYPos ); + + // Paint the player's health + int x = gHUD.DrawHudNumber( iXPos + iXSize + 5, iYPos + 5, DHN_3DIGITS | DHN_DRAWZERO, gHUD.m_Health.m_iHealth, r, g, b ); + + // Draw the vertical line + int HealthWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; + x += HealthWidth / 2; + FillRGBA( x, iYPos + 5, HealthWidth / 10, gHUD.m_iFontHeight, 255, 160, 0, a ); + } +}; +#endif diff --git a/cl_dll/vgui_int.cpp b/cl_dll/vgui_int.cpp new file mode 100644 index 00000000..2a4272d8 --- /dev/null +++ b/cl_dll/vgui_int.cpp @@ -0,0 +1,127 @@ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#include "vgui_int.h" +#include +#include +#include +#include +#include +#include +#include +#include "hud.h" +#include "cl_util.h" +#include "camera.h" +#include "kbutton.h" +#include "cvardef.h" +#include "usercmd.h" +#include "const.h" +#include "camera.h" +#include "in_defs.h" +#include "vgui_TeamFortressViewport.h" +#include "vgui_ControlConfigPanel.h" + +namespace +{ + +class TexturePanel : public Panel, public ActionSignal +{ +private: + int _bindIndex; + TextEntry *_textEntry; +public: + TexturePanel() : Panel( 0, 0, 256, 276 ) + { + _bindIndex = 2700; + _textEntry = new TextEntry( "2700", 0, 0, 128, 20 ); + _textEntry->setParent( this ); + _textEntry->addActionSignal( this ); + } + + virtual bool isWithin( int x, int y ) + { + return _textEntry->isWithin( x, y ); + } + + virtual void actionPerformed( Panel *panel ) + { + char buf[256]; + + _textEntry->getText( 0, buf, 256 ); + sscanf( buf, "%d", &_bindIndex); + } +protected: + virtual void paintBackground() + { + Panel::paintBackground(); + + int wide, tall; + + getPaintSize( wide, tall ); + + drawSetColor( 0, 0, 255, 0 ); + drawSetTexture( _bindIndex ); + drawTexturedRect( 0, 19, 257, 257 ); + } +}; + +} + +using namespace vgui; + +void VGui_ViewportPaintBackground( int extents[4] ) +{ + gEngfuncs.VGui_ViewportPaintBackground( extents ); +} + +void* VGui_GetPanel() +{ + return (Panel*)gEngfuncs.VGui_GetPanel(); +} + +void VGui_Startup() +{ + Panel *root = (Panel*)VGui_GetPanel(); + root->setBgColor( 128, 128, 0, 0 ); + // root->setNonPainted( false ); + // root->setBorder( new LineBorder() ); + root->setLayout( new BorderLayout( 0 ) ); + + // root->getSurfaceBase()->setEmulatedCursorVisible( true ); + + if( gViewPort != NULL ) + { +// root->removeChild( gViewPort ); + + // free the memory +// delete gViewPort; +// gViewPort = NULL; + + gViewPort->Initialize(); + } + else + { + gViewPort = new TeamFortressViewport( 0, 0, root->getWide(), root->getTall() ); + gViewPort->setParent( root ); + } + + /* + TexturePanel *texturePanel = new TexturePanel(); + texturePanel->setParent( gViewPort ); + */ +} + +void VGui_Shutdown() +{ + delete gViewPort; + gViewPort = NULL; +} + + + + + diff --git a/cl_dll/vgui_int.h b/cl_dll/vgui_int.h new file mode 100644 index 00000000..6510853e --- /dev/null +++ b/cl_dll/vgui_int.h @@ -0,0 +1,21 @@ +//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef VGUI_INT_H +#define VGUI_INT_H + +extern "C" +{ +void VGui_Startup(); +void VGui_Shutdown(); + +//Only safe to call from inside subclass of Panel::paintBackground +void VGui_ViewportPaintBackground(int extents[4]); +} + + +#endif \ No newline at end of file diff --git a/cl_dll/vgui_teammenu.cpp b/cl_dll/vgui_teammenu.cpp new file mode 100644 index 00000000..bc7b22e6 --- /dev/null +++ b/cl_dll/vgui_teammenu.cpp @@ -0,0 +1,394 @@ +//=========== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. =========== +// +// The copyright to the contents herein is the property of Valve, L.L.C. +// The contents may be used and/or copied only with the written permission of +// Valve, L.L.C., or in accordance with the terms and conditions stipulated in +// the agreement/contract under which the contents have been supplied. +// +// Purpose: TFC Team Menu +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//============================================================================= + +#include "vgui_int.h" +#include "VGUI_Font.h" +#include "VGUI_ScrollPanel.h" +#include "VGUI_TextImage.h" + +#include "hud.h" +#include "cl_util.h" +#include "vgui_TeamFortressViewport.h" + +// Team Menu Dimensions +#define TEAMMENU_TITLE_X XRES(40) +#define TEAMMENU_TITLE_Y YRES(32) +#define TEAMMENU_TOPLEFT_BUTTON_X XRES(40) +#define TEAMMENU_TOPLEFT_BUTTON_Y YRES(80) +#define TEAMMENU_BUTTON_SIZE_X XRES(124) +#define TEAMMENU_BUTTON_SIZE_Y YRES(24) +#define TEAMMENU_BUTTON_SPACER_Y YRES(8) +#define TEAMMENU_WINDOW_X XRES(176) +#define TEAMMENU_WINDOW_Y YRES(80) +#define TEAMMENU_WINDOW_SIZE_X XRES(424) +#define TEAMMENU_WINDOW_SIZE_Y YRES(312) +#define TEAMMENU_WINDOW_TITLE_X XRES(16) +#define TEAMMENU_WINDOW_TITLE_Y YRES(16) +#define TEAMMENU_WINDOW_TEXT_X XRES(16) +#define TEAMMENU_WINDOW_TEXT_Y YRES(48) +#define TEAMMENU_WINDOW_TEXT_SIZE_Y YRES(178) +#define TEAMMENU_WINDOW_INFO_X XRES(16) +#define TEAMMENU_WINDOW_INFO_Y YRES(234) + +// Creation +CTeamMenuPanel::CTeamMenuPanel( int iTrans, int iRemoveMe, int x, int y, int wide, int tall ) : CMenuPanel( iTrans, iRemoveMe, x, y, wide, tall ) +{ + // Get the scheme used for the Titles + CSchemeManager *pSchemes = gViewPort->GetSchemeManager(); + + // schemes + SchemeHandle_t hTitleScheme = pSchemes->getSchemeHandle( "Title Font" ); + SchemeHandle_t hTeamWindowText = pSchemes->getSchemeHandle( "Briefing Text" ); + SchemeHandle_t hTeamInfoText = pSchemes->getSchemeHandle( "Team Info Text" ); + + // get the Font used for the Titles + Font *pTitleFont = pSchemes->getFont( hTitleScheme ); + int r, g, b, a; + + // Create the title + Label *pLabel = new Label( "", TEAMMENU_TITLE_X, TEAMMENU_TITLE_Y ); + pLabel->setParent( this ); + pLabel->setFont( pTitleFont ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + pLabel->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + pLabel->setBgColor( r, g, b, a ); + pLabel->setContentAlignment( vgui::Label::a_west ); + pLabel->setText( "%s", gHUD.m_TextMessage.BufferedLocaliseTextString("#Title_SelectYourTeam")); + + // Create the Info Window + m_pTeamWindow = new CTransparentPanel( 255, TEAMMENU_WINDOW_X, TEAMMENU_WINDOW_Y, TEAMMENU_WINDOW_SIZE_X, TEAMMENU_WINDOW_SIZE_Y ); + m_pTeamWindow->setParent( this ); + m_pTeamWindow->setBorder( new LineBorder( Color( 255 * 0.7, 170 * 0.7 ,0 ,0 ) ) ); + + // Create the Map Name Label + m_pMapTitle = new Label( "", TEAMMENU_WINDOW_TITLE_X, TEAMMENU_WINDOW_TITLE_Y ); + m_pMapTitle->setFont( pTitleFont ); + m_pMapTitle->setParent( m_pTeamWindow ); + pSchemes->getFgColor( hTitleScheme, r, g, b, a ); + m_pMapTitle->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTitleScheme, r, g, b, a ); + m_pMapTitle->setBgColor( r, g, b, a ); + m_pMapTitle->setContentAlignment( vgui::Label::a_west ); + + // Create the Scroll panel + m_pScrollPanel = new CTFScrollPanel( TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_Y, TEAMMENU_WINDOW_SIZE_X - ( TEAMMENU_WINDOW_TEXT_X * 2 ), TEAMMENU_WINDOW_TEXT_SIZE_Y ); + m_pScrollPanel->setParent( m_pTeamWindow ); + m_pScrollPanel->setScrollBarVisible( false, false ); + + // Create the Map Briefing panel + m_pBriefing = new TextPanel("", 0, 0, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_TEXT_X, TEAMMENU_WINDOW_TEXT_SIZE_Y ); + m_pBriefing->setParent( m_pScrollPanel->getClient() ); + m_pBriefing->setFont( pSchemes->getFont( hTeamWindowText ) ); + pSchemes->getFgColor( hTeamWindowText, r, g, b, a ); + m_pBriefing->setFgColor( r, g, b, a ); + pSchemes->getBgColor( hTeamWindowText, r, g, b, a ); + m_pBriefing->setBgColor( r, g, b, a ); + + m_pBriefing->setText( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Map_Description_not_available" ) ); + + // Team Menu buttons + for( int i = 1; i <= 5; i++ ) + { + char sz[256]; + + int iYPos = TEAMMENU_TOPLEFT_BUTTON_Y + ( ( TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y ) * i ); + + // Team button + m_pButtons[i] = new CommandButton( "", TEAMMENU_TOPLEFT_BUTTON_X, iYPos, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true ); + m_pButtons[i]->setParent( this ); + m_pButtons[i]->setContentAlignment( vgui::Label::a_west ); + m_pButtons[i]->setVisible( false ); + + // AutoAssign button uses special case + if( i == 5 ) + { + m_pButtons[5]->setBoundKey( '5' ); + m_pButtons[5]->setText( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Team_AutoAssign" ) ); + m_pButtons[5]->setVisible( true ); + } + + // Create the Signals + sprintf( sz, "jointeam %d", i ); + m_pButtons[i]->addActionSignal( new CMenuHandler_StringCommandWatch( sz, true ) ); + m_pButtons[i]->addInputSignal( new CHandler_MenuButtonOver( this, i ) ); + + // Create the Team Info panel + m_pTeamInfoPanel[i] = new TextPanel( "", TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_INFO_Y, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_X, TEAMMENU_WINDOW_SIZE_X - TEAMMENU_WINDOW_INFO_Y ); + m_pTeamInfoPanel[i]->setParent( m_pTeamWindow ); + m_pTeamInfoPanel[i]->setFont( pSchemes->getFont( hTeamInfoText ) ); + m_pTeamInfoPanel[i]->setFgColor( iTeamColors[i % iNumberOfTeamColors][0], + iTeamColors[i % iNumberOfTeamColors][1], + iTeamColors[i % iNumberOfTeamColors][2], + 0 ); + m_pTeamInfoPanel[i]->setBgColor( 0, 0, 0, 255 ); + } + + // Create the Cancel button + m_pCancelButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Cancel" ), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y ); + m_pCancelButton->setParent( this ); + m_pCancelButton->addActionSignal( new CMenuHandler_TextWindow( HIDE_TEXTWINDOW ) ); + + // Create the Spectate button + m_pSpectateButton = new SpectateButton( CHudTextMessage::BufferedLocaliseTextString( "#Menu_Spectate" ), TEAMMENU_TOPLEFT_BUTTON_X, 0, TEAMMENU_BUTTON_SIZE_X, TEAMMENU_BUTTON_SIZE_Y, true ); + m_pSpectateButton->setParent( this ); + m_pSpectateButton->addActionSignal( new CMenuHandler_StringCommand( "spectate", true ) ); + m_pSpectateButton->setBoundKey( '6' ); + m_pSpectateButton->addInputSignal( new CHandler_MenuButtonOver( this, 6 ) ); + + Initialize(); +} + +//----------------------------------------------------------------------------- +// Purpose: Called each time a new level is started. +//----------------------------------------------------------------------------- +void CTeamMenuPanel::Initialize( void ) +{ + m_bUpdatedMapName = false; + m_iCurrentInfo = 0; + m_pScrollPanel->setScrollValue( 0, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: Called everytime the Team Menu is displayed +//----------------------------------------------------------------------------- +void CTeamMenuPanel::Update( void ) +{ + int iYPos = TEAMMENU_TOPLEFT_BUTTON_Y; + + // Set the team buttons + for( int i = 1; i <= 4; i++ ) + { + if( m_pButtons[i] ) + { + if( i <= gViewPort->GetNumberOfTeams() ) + { + m_pButtons[i]->setText( gViewPort->GetTeamName( i ) ); + + // bound key replacement + char sz[32]; + sprintf( sz, "%d", i ); + m_pButtons[i]->setBoundKey( sz[0] ); + + m_pButtons[i]->setVisible( true ); + m_pButtons[i]->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + + // Start with the first option up + if( !m_iCurrentInfo ) + SetActiveInfo( i ); + + char szPlayerList[( MAX_PLAYER_NAME_LENGTH + 3 ) * 31]; // name + ", " + strcpy(szPlayerList, "\n"); + // Update the Team Info + // Now count the number of teammembers of this class + int iTotal = 0; + for( int j = 1; j < MAX_PLAYERS; j++ ) + { + if( g_PlayerInfoList[j].name == NULL ) + continue; // empty player slot, skip + if( g_PlayerInfoList[j].thisplayer ) + continue; // skip this player + if( g_PlayerExtraInfo[j].teamnumber != i ) + continue; // skip over players in other teams + + iTotal++; + if( iTotal > 1 ) + strncat( szPlayerList, ", ", sizeof(szPlayerList) - strlen( szPlayerList ) - 1 ); + strncat( szPlayerList, g_PlayerInfoList[j].name, sizeof(szPlayerList) - strlen( szPlayerList ) - 1 ); + szPlayerList[sizeof(szPlayerList) - 1] = '\0'; + } + + if( iTotal > 0 ) + { + // Set the text of the info Panel + char szText[( ( MAX_PLAYER_NAME_LENGTH + 3 ) * 31 ) + 256]; + if( iTotal == 1 ) + sprintf( szText, "%s: %d Player (%d points)", gViewPort->GetTeamName( i ), iTotal, g_TeamInfo[i].frags ); + else + sprintf( szText, "%s: %d Players (%d points)", gViewPort->GetTeamName( i ), iTotal, g_TeamInfo[i].frags ); + strncat( szText, szPlayerList, sizeof(szText) - strlen( szText ) - 1 ); + szText[sizeof(szText) - 1] = '\0'; + + m_pTeamInfoPanel[i]->setText( szText ); + } + else + { + m_pTeamInfoPanel[i]->setText( "" ); + } + } + else + { + // Hide the button (may be visible from previous maps) + m_pButtons[i]->setVisible( false ); + } + } + } + + // Move the AutoAssign button into place + m_pButtons[5]->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + + // Spectate button + if( m_pSpectateButton->IsNotValid() ) + { + m_pSpectateButton->setVisible( false ); + } + else + { + m_pSpectateButton->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + m_pSpectateButton->setVisible( true ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + } + + // If the player is already in a team, make the cancel button visible + if( g_iTeamNumber ) + { + m_pCancelButton->setPos( TEAMMENU_TOPLEFT_BUTTON_X, iYPos ); + iYPos += TEAMMENU_BUTTON_SIZE_Y + TEAMMENU_BUTTON_SPACER_Y; + m_pCancelButton->setVisible( true ); + } + else + { + m_pCancelButton->setVisible( false ); + } + + // Set the Map Title + if( !m_bUpdatedMapName ) + { + const char *level = gEngfuncs.pfnGetLevelName(); + if( level && level[0] ) + { + char sz[256]; + char szTitle[256]; + char *ch; + + // Update the level name + strcpy( sz, level ); + ch = strchr( sz, '/' ); + if( !ch ) + ch = strchr( sz, '\\' ); + strcpy( szTitle, ch + 1 ); + ch = strchr( szTitle, '.' ); + *ch = '\0'; + m_pMapTitle->setText( "%s", szTitle ); + *ch = '.'; + + // Update the map briefing + strcpy( sz, level ); + ch = strchr( sz, '.' ); + *ch = '\0'; + strcat( sz, ".txt" ); + char *pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); + if( pfile ) + { + m_pBriefing->setText( pfile ); + + // Get the total size of the Briefing text and resize the text panel + int iXSize, iYSize; + m_pBriefing->getTextImage()->getTextSize( iXSize, iYSize ); + m_pBriefing->setSize( iXSize, iYSize ); + gEngfuncs.COM_FreeFile( pfile ); + } + + m_bUpdatedMapName = true; + } + } + + m_pScrollPanel->validate(); +} + +//===================================== +// Key inputs +bool CTeamMenuPanel::SlotInput( int iSlot ) +{ + // Check for AutoAssign + if( iSlot == 5 ) + { + m_pButtons[5]->fireActionSignal(); + return true; + } + + // Spectate + if( iSlot == 6 ) + { + m_pSpectateButton->fireActionSignal(); + return true; + } + + // Otherwise, see if a particular team is selectable + if( ( iSlot < 1 ) || ( iSlot > gViewPort->GetNumberOfTeams() ) ) + return false; + + if( !m_pButtons[iSlot] ) + return false; + + // Is the button pushable? + if( m_pButtons[iSlot]->isVisible() ) + { + m_pButtons[iSlot]->fireActionSignal(); + return true; + } + + return false; +} + +//====================================== +// Update the Team menu before opening it +void CTeamMenuPanel::Open( void ) +{ + Update(); + CMenuPanel::Open(); +} + +void CTeamMenuPanel::paintBackground() +{ + // make sure we get the map briefing up + if( !m_bUpdatedMapName ) + Update(); + + CMenuPanel::paintBackground(); +} + +//====================================== +// Mouse is over a team button, bring up the class info +void CTeamMenuPanel::SetActiveInfo( int iInput ) +{ + // Remove all the Info panels and bring up the specified one + m_pSpectateButton->setArmed( false ); + for( int i = 1; i <= 5; i++ ) + { + m_pButtons[i]->setArmed( false ); + m_pTeamInfoPanel[i]->setVisible( false ); + } + + // 6 is Spectate + if( iInput == 6 ) + { + m_pSpectateButton->setArmed( true ); + } + else + { + m_pButtons[iInput]->setArmed( true ); + m_pTeamInfoPanel[iInput]->setVisible( true ); + } + + m_iCurrentInfo = iInput; + + m_pScrollPanel->validate(); +} diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp new file mode 100644 index 00000000..53cd9d5f --- /dev/null +++ b/cl_dll/voice_status.cpp @@ -0,0 +1,884 @@ +//========= Copyright � 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// There are hud.h's coming out of the woodwork so this ensures that we get the right one. +#if defined(THREEWAVE) || defined(DMC_BUILD) + #include "../dmc/cl_dll/hud.h" +#elif defined(CSTRIKE) + #include "../cstrike/cl_dll/hud.h" +#elif defined(DOD) + #include "../dod/cl_dll/hud.h" +#else + #include "hud.h" +#endif + +#include "cl_util.h" +#include +#include +#include +#include "parsemsg.h" +#include "demo.h" +#include "demo_api.h" +#include "voice_status.h" +#include "r_efx.h" +#include "entity_types.h" +#include "VGUI_ActionSignal.h" +#include "VGUI_Scheme.h" +#include "VGUI_TextImage.h" +#include "vgui_loadtga.h" +#include "vgui_helpers.h" +#include "VGUI_MouseCode.h" + + + +using namespace vgui; + + +extern int cam_thirdperson; + + +#define VOICE_MODEL_INTERVAL 0.3 +#define SCOREBOARD_BLINK_FREQUENCY 0.3 // How often to blink the scoreboard icons. +#define SQUELCHOSCILLATE_PER_SECOND 2.0f + + +extern BitmapTGA *LoadTGA( const char* pImageName ); + + + +// ---------------------------------------------------------------------- // +// The voice manager for the client. +// ---------------------------------------------------------------------- // +CVoiceStatus g_VoiceStatus; + +CVoiceStatus* GetClientVoiceMgr() +{ + return &g_VoiceStatus; +} + + + +// ---------------------------------------------------------------------- // +// CVoiceStatus. +// ---------------------------------------------------------------------- // + +static CVoiceStatus *g_pInternalVoiceStatus = NULL; + +int __MsgFunc_VoiceMask(const char *pszName, int iSize, void *pbuf) +{ + if(g_pInternalVoiceStatus) + g_pInternalVoiceStatus->HandleVoiceMaskMsg(iSize, pbuf); + + return 1; +} + +int __MsgFunc_ReqState(const char *pszName, int iSize, void *pbuf) +{ + if(g_pInternalVoiceStatus) + g_pInternalVoiceStatus->HandleReqStateMsg(iSize, pbuf); + + return 1; +} + + +int g_BannedPlayerPrintCount; +void ForEachBannedPlayer(char id[16]) +{ + char str[256]; + sprintf(str, "Ban %d: %2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x\n", + g_BannedPlayerPrintCount++, + id[0], id[1], id[2], id[3], + id[4], id[5], id[6], id[7], + id[8], id[9], id[10], id[11], + id[12], id[13], id[14], id[15] + ); +#ifdef _WIN32 + strupr(str); +#endif + gEngfuncs.pfnConsolePrint(str); +} + + +void ShowBannedCallback() +{ + if(g_pInternalVoiceStatus) + { + g_BannedPlayerPrintCount = 0; + gEngfuncs.pfnConsolePrint("------- BANNED PLAYERS -------\n"); + g_pInternalVoiceStatus->m_BanMgr.ForEachBannedPlayer(ForEachBannedPlayer); + gEngfuncs.pfnConsolePrint("------------------------------\n"); + } +} + + +// ---------------------------------------------------------------------- // +// CVoiceStatus. +// ---------------------------------------------------------------------- // + +CVoiceStatus::CVoiceStatus() +{ + m_bBanMgrInitialized = false; + m_LastUpdateServerState = 0; + + m_pSpeakerLabelIcon = NULL; + m_pScoreboardNeverSpoken = NULL; + m_pScoreboardNotSpeaking = NULL; + m_pScoreboardSpeaking = NULL; + m_pScoreboardSpeaking2 = NULL; + m_pScoreboardSquelch = NULL; + m_pScoreboardBanned = NULL; + + m_pLocalBitmap = NULL; + m_pAckBitmap = NULL; + + m_bTalking = m_bServerAcked = false; + + memset(m_pBanButtons, 0, sizeof(m_pBanButtons)); + + m_pParentPanel = NULL; + + m_bServerModEnable = -1; + + m_pchGameDir = NULL; +} + + +CVoiceStatus::~CVoiceStatus() +{ + g_pInternalVoiceStatus = NULL; + + for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + { + delete m_Labels[i].m_pLabel; + m_Labels[i].m_pLabel = NULL; + + delete m_Labels[i].m_pIcon; + m_Labels[i].m_pIcon = NULL; + + delete m_Labels[i].m_pBackground; + m_Labels[i].m_pBackground = NULL; + } + + delete m_pLocalLabel; + m_pLocalLabel = NULL; + + FreeBitmaps(); + + if(m_pchGameDir) + { + if(m_bBanMgrInitialized) + { + m_BanMgr.SaveState(m_pchGameDir); + } + + free(m_pchGameDir); + } +} + + +int CVoiceStatus::Init( + IVoiceStatusHelper *pHelper, + Panel **pParentPanel) +{ + // Setup the voice_modenable cvar. + gEngfuncs.pfnRegisterVariable("voice_modenable", "1", FCVAR_ARCHIVE); + + gEngfuncs.pfnRegisterVariable("voice_clientdebug", "0", 0); + + gEngfuncs.pfnAddCommand("voice_showbanned", ShowBannedCallback); + + if(gEngfuncs.pfnGetGameDirectory()) + { + m_BanMgr.Init(gEngfuncs.pfnGetGameDirectory()); + m_bBanMgrInitialized = true; + } + + assert(!g_pInternalVoiceStatus); + g_pInternalVoiceStatus = this; + + m_BlinkTimer = 0; + m_VoiceHeadModel = 0; + memset(m_Labels, 0, sizeof(m_Labels)); + + for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + { + CVoiceLabel *pLabel = &m_Labels[i]; + + pLabel->m_pBackground = new Label(""); + + if((pLabel->m_pLabel = new Label("")) != 0) + { + pLabel->m_pLabel->setVisible( true ); + pLabel->m_pLabel->setFont( Scheme::sf_primary2 ); + pLabel->m_pLabel->setTextAlignment( Label::a_east ); + pLabel->m_pLabel->setContentAlignment( Label::a_east ); + pLabel->m_pLabel->setParent( pLabel->m_pBackground ); + } + + if( (pLabel->m_pIcon = new ImagePanel( NULL )) != 0 ) + { + pLabel->m_pIcon->setVisible( true ); + pLabel->m_pIcon->setParent( pLabel->m_pBackground ); + } + + pLabel->m_clientindex = -1; + } + + m_pLocalLabel = new ImagePanel(NULL); + + m_bInSquelchMode = false; + + m_pHelper = pHelper; + m_pParentPanel = pParentPanel; + gHUD.AddHudElem(this); + m_iFlags = HUD_ACTIVE; + HOOK_MESSAGE(VoiceMask); + HOOK_MESSAGE(ReqState); + + // Cache the game directory for use when we shut down + const char *pchGameDirT = gEngfuncs.pfnGetGameDirectory(); + m_pchGameDir = (char *)malloc(strlen(pchGameDirT) + 1); + strcpy(m_pchGameDir, pchGameDirT); + + return 1; +} + + +int CVoiceStatus::VidInit() +{ + FreeBitmaps(); + + + if( (m_pLocalBitmap = vgui_LoadTGA("gfx/vgui/icntlk_pl.tga")) != 0 ) + { + m_pLocalBitmap->setColor(Color(255,255,255,135)); + } + + if( (m_pAckBitmap = vgui_LoadTGA("gfx/vgui/icntlk_sv.tga")) != 0 ) + { + m_pAckBitmap->setColor(Color(255,255,255,135)); // Give just a tiny bit of translucency so software draws correctly. + } + + m_pLocalLabel->setImage( m_pLocalBitmap ); + m_pLocalLabel->setVisible( false ); + + + if( (m_pSpeakerLabelIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/speaker4.tga" )) != 0 ) + m_pSpeakerLabelIcon->setColor( Color(255,255,255,1) ); // Give just a tiny bit of translucency so software draws correctly. + + if ((m_pScoreboardNeverSpoken = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker1.tga")) != 0) + m_pScoreboardNeverSpoken->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + if((m_pScoreboardNotSpeaking = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker2.tga")) != 0) + m_pScoreboardNotSpeaking->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + if((m_pScoreboardSpeaking = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker3.tga")) != 0) + m_pScoreboardSpeaking->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + if((m_pScoreboardSpeaking2 = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker4.tga")) != 0) + m_pScoreboardSpeaking2->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + if((m_pScoreboardSquelch = vgui_LoadTGA("gfx/vgui/icntlk_squelch.tga")) != 0) + m_pScoreboardSquelch->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + if((m_pScoreboardBanned = vgui_LoadTGA("gfx/vgui/640_voiceblocked.tga")) != 0) + m_pScoreboardBanned->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + + // Figure out the voice head model height. + m_VoiceHeadModelHeight = 45; + char *pFile = (char *)gEngfuncs.COM_LoadFile("scripts/voicemodel.txt", 5, NULL); + if(pFile) + { + char token[4096]; + gEngfuncs.COM_ParseFile(pFile, token); + if(token[0] >= '0' && token[0] <= '9') + { + m_VoiceHeadModelHeight = (float)atof(token); + } + + gEngfuncs.COM_FreeFile(pFile); + } + + m_VoiceHeadModel = gEngfuncs.pfnSPR_Load("sprites/voiceicon.spr"); + return TRUE; +} + + +void CVoiceStatus::Frame(double frametime) +{ + // check server banned players once per second + if(gEngfuncs.GetClientTime() - m_LastUpdateServerState > 1) + { + UpdateServerState(false); + } + + m_BlinkTimer += frametime; + + // Update speaker labels. + if( m_pHelper->CanShowSpeakerLabels() ) + { + for( int i=0; i < MAX_VOICE_SPEAKERS; i++ ) + m_Labels[i].m_pBackground->setVisible( m_Labels[i].m_clientindex != -1 ); + } + else + { + for( int i=0; i < MAX_VOICE_SPEAKERS; i++ ) + m_Labels[i].m_pBackground->setVisible( false ); + } + + for(int i=0; i < VOICE_MAX_PLAYERS; i++) + UpdateBanButton(i); +} + + +void CVoiceStatus::CreateEntities() +{ + if(!m_VoiceHeadModel) + return; + + cl_entity_t *localPlayer = gEngfuncs.GetLocalPlayer(); + + int iOutModel = 0; + for(int i=0; i < VOICE_MAX_PLAYERS; i++) + { + if(!m_VoicePlayers[i]) + continue; + + cl_entity_s *pClient = gEngfuncs.GetEntityByIndex(i+1); + + // Don't show an icon if the player is not in our PVS. + if(!pClient || pClient->curstate.messagenum < localPlayer->curstate.messagenum) + continue; + + // Don't show an icon for dead or spectating players (ie: invisible entities). + if(pClient->curstate.effects & EF_NODRAW) + continue; + + // Don't show an icon for the local player unless we're in thirdperson mode. + if(pClient == localPlayer && !cam_thirdperson) + continue; + + cl_entity_s *pEnt = &m_VoiceHeadModels[iOutModel]; + ++iOutModel; + + memset(pEnt, 0, sizeof(*pEnt)); + + pEnt->curstate.rendermode = kRenderTransAdd; + pEnt->curstate.renderamt = 255; + pEnt->baseline.renderamt = 255; + pEnt->curstate.renderfx = kRenderFxNoDissipation; + pEnt->curstate.framerate = 1; + pEnt->curstate.frame = 0; + pEnt->model = (struct model_s*)gEngfuncs.GetSpritePointer(m_VoiceHeadModel); + pEnt->angles[0] = pEnt->angles[1] = pEnt->angles[2] = 0; + pEnt->curstate.scale = 0.5f; + + pEnt->origin[0] = pEnt->origin[1] = 0; + pEnt->origin[2] = 45; + + VectorAdd(pEnt->origin, pClient->origin, pEnt->origin); + + // Tell the engine. + gEngfuncs.CL_CreateVisibleEntity(ET_NORMAL, pEnt); + } +} + + +void CVoiceStatus::UpdateSpeakerStatus( int entindex, qboolean bTalking ) +{ + cvar_t *pVoiceLoopback = NULL; + + if ( !m_pParentPanel || !*m_pParentPanel ) + { + return; + } + + if ( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) + { + char msg[256]; + _snprintf( msg, sizeof( msg ), "CVoiceStatus::UpdateSpeakerStatus: ent %d talking = %d\n", entindex, bTalking ); + gEngfuncs.pfnConsolePrint( msg ); + } + + int iLocalPlayerIndex = gEngfuncs.GetLocalPlayer()->index; + + // Is it the local player talking? + if ( entindex == -1 ) + { + m_bTalking = !!bTalking; + if( bTalking ) + { + // Enable voice for them automatically if they try to talk. + gEngfuncs.pfnClientCmd( "voice_modenable 1" ); + } + + // now set the player index to the correct index for the local player + // this will allow us to have the local player's icon flash in the scoreboard + entindex = iLocalPlayerIndex; + + pVoiceLoopback = gEngfuncs.pfnGetCvarPointer( "voice_loopback" ); + } + else if ( entindex == -2 ) + { + m_bServerAcked = !!bTalking; + } + + if ( entindex >= 0 && entindex <= VOICE_MAX_PLAYERS ) + { + int iClient = entindex - 1; + if ( iClient < 0 ) + { + return; + } + + CVoiceLabel *pLabel = FindVoiceLabel( iClient ); + if ( bTalking ) + { + m_VoicePlayers[iClient] = true; + m_VoiceEnabledPlayers[iClient] = true; + + // If we don't have a label for this guy yet, then create one. + if ( !pLabel ) + { + // if this isn't the local player (unless they have voice_loopback on) + if ( ( entindex != iLocalPlayerIndex ) || ( pVoiceLoopback && pVoiceLoopback->value ) ) + { + if ( (pLabel = GetFreeVoiceLabel()) != 0 ) + { + // Get the name from the engine. + hud_player_info_t info; + memset( &info, 0, sizeof( info ) ); + gEngfuncs.pfnGetPlayerInfo( entindex, &info ); + + char paddedName[512]; + _snprintf( paddedName, sizeof( paddedName ), "%s ", info.name ); + + int color[3]; + m_pHelper->GetPlayerTextColor( entindex, color ); + + if ( pLabel->m_pBackground ) + { + pLabel->m_pBackground->setBgColor( color[0], color[1], color[2], 135 ); + pLabel->m_pBackground->setParent( *m_pParentPanel ); + pLabel->m_pBackground->setVisible( m_pHelper->CanShowSpeakerLabels() ); + } + + if ( pLabel->m_pLabel ) + { + pLabel->m_pLabel->setFgColor( 255, 255, 255, 0 ); + pLabel->m_pLabel->setBgColor( 0, 0, 0, 255 ); + pLabel->m_pLabel->setText( "%s", paddedName ); + } + + pLabel->m_clientindex = iClient; + } + } + } + } + else + { + m_VoicePlayers[iClient] = false; + + // If we have a label for this guy, kill it. + if ( pLabel ) + { + pLabel->m_pBackground->setVisible( false ); + pLabel->m_clientindex = -1; + } + } + } + + RepositionLabels(); +} + + +void CVoiceStatus::UpdateServerState(bool bForce) +{ + // Can't do anything when we're not in a level. + char const *pLevelName = gEngfuncs.pfnGetLevelName(); + if( pLevelName[0] == 0 ) + { + if( gEngfuncs.pfnGetCvarFloat("voice_clientdebug") ) + { + gEngfuncs.pfnConsolePrint( "CVoiceStatus::UpdateServerState: pLevelName[0]==0\n" ); + } + + return; + } + + int bCVarModEnable = !!gEngfuncs.pfnGetCvarFloat("voice_modenable"); + if(bForce || m_bServerModEnable != bCVarModEnable) + { + m_bServerModEnable = bCVarModEnable; + + char str[256]; + _snprintf(str, sizeof(str), "VModEnable %d", m_bServerModEnable); + ServerCmd(str); + + if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + char msg[256]; + sprintf(msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str); + gEngfuncs.pfnConsolePrint(msg); + } + } + + char str[2048]; + sprintf(str, "vban"); + bool bChange = false; + + for(unsigned long dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) + { + unsigned int serverBanMask = 0; + unsigned int banMask = 0; + for(unsigned int i=0; i < 32; i++) + { + char playerID[16]; + if(!gEngfuncs.GetPlayerUniqueID(i+1, playerID)) + continue; + + if(m_BanMgr.GetPlayerBan(playerID)) + banMask |= 1 << i; + + if(m_ServerBannedPlayers[dw*32 + i]) + serverBanMask |= 1 << i; + } + + if(serverBanMask != banMask) + bChange = true; + + // Ok, the server needs to be updated. + char numStr[512]; + sprintf(numStr, " %x", banMask); + strcat(str, numStr); + } + + if(bChange || bForce) + { + if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + char msg[256]; + sprintf(msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str); + gEngfuncs.pfnConsolePrint(msg); + } + + gEngfuncs.pfnServerCmdUnreliable(str); // Tell the server.. + } + else + { + if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + gEngfuncs.pfnConsolePrint( "CVoiceStatus::UpdateServerState: no change\n" ); + } + } + + m_LastUpdateServerState = gEngfuncs.GetClientTime(); +} + +void CVoiceStatus::UpdateSpeakerImage(Label *pLabel, int iPlayer) +{ + m_pBanButtons[iPlayer-1] = pLabel; + UpdateBanButton(iPlayer-1); +} + +void CVoiceStatus::UpdateBanButton(int iClient) +{ + Label *pPanel = m_pBanButtons[iClient]; + + if (!pPanel) + return; + + char playerID[16]; + extern bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] ); + if(!HACK_GetPlayerUniqueID(iClient+1, playerID)) + return; + + // Figure out if it's blinking or not. + bool bBlink = fmod(m_BlinkTimer, SCOREBOARD_BLINK_FREQUENCY*2) < SCOREBOARD_BLINK_FREQUENCY; + bool bTalking = !!m_VoicePlayers[iClient]; + bool bBanned = m_BanMgr.GetPlayerBan(playerID); + bool bNeverSpoken = !m_VoiceEnabledPlayers[iClient]; + + // Get the appropriate image to display on the panel. + if (bBanned) + { + pPanel->setImage(m_pScoreboardBanned); + } + else if (bTalking) + { + if (bBlink) + { + pPanel->setImage(m_pScoreboardSpeaking2); + } + else + { + pPanel->setImage(m_pScoreboardSpeaking); + } + pPanel->setFgColor(255, 170, 0, 1); + } + else if (bNeverSpoken) + { + pPanel->setImage(m_pScoreboardNeverSpoken); + pPanel->setFgColor(100, 100, 100, 1); + } + else + { + pPanel->setImage(m_pScoreboardNotSpeaking); + } +} + + +void CVoiceStatus::HandleVoiceMaskMsg(int iSize, void *pbuf) +{ + BEGIN_READ( pbuf, iSize ); + + unsigned int dw; + for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) + { + m_AudiblePlayers.SetDWord(dw, (unsigned long)READ_LONG()); + m_ServerBannedPlayers.SetDWord(dw, (unsigned long)READ_LONG()); + + if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + char str[256]; + gEngfuncs.pfnConsolePrint("CVoiceStatus::HandleVoiceMaskMsg\n"); + + sprintf(str, " - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw)); + gEngfuncs.pfnConsolePrint(str); + + sprintf(str, " - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw)); + gEngfuncs.pfnConsolePrint(str); + } + } + + m_bServerModEnable = READ_BYTE(); +} + +void CVoiceStatus::HandleReqStateMsg(int iSize, void *pbuf) +{ + if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + gEngfuncs.pfnConsolePrint("CVoiceStatus::HandleReqStateMsg\n"); + } + + UpdateServerState(true); +} + +void CVoiceStatus::StartSquelchMode() +{ + if(m_bInSquelchMode) + return; + + m_bInSquelchMode = true; + m_pHelper->UpdateCursorState(); +} + +void CVoiceStatus::StopSquelchMode() +{ + m_bInSquelchMode = false; + m_pHelper->UpdateCursorState(); +} + +bool CVoiceStatus::IsInSquelchMode() +{ + return m_bInSquelchMode; +} + +CVoiceLabel* CVoiceStatus::FindVoiceLabel(int clientindex) +{ + for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + { + if(m_Labels[i].m_clientindex == clientindex) + return &m_Labels[i]; + } + + return NULL; +} + + +CVoiceLabel* CVoiceStatus::GetFreeVoiceLabel() +{ + return FindVoiceLabel(-1); +} + + +void CVoiceStatus::RepositionLabels() +{ + // find starting position to draw from, along right-hand side of screen + int y = ScreenHeight / 2; + + int iconWide = 8, iconTall = 8; + if( m_pSpeakerLabelIcon ) + { + m_pSpeakerLabelIcon->getSize( iconWide, iconTall ); + } + + // Reposition active labels. + for(int i = 0; i < MAX_VOICE_SPEAKERS; i++) + { + CVoiceLabel *pLabel = &m_Labels[i]; + + if( pLabel->m_clientindex == -1 || !pLabel->m_pLabel ) + { + if( pLabel->m_pBackground ) + pLabel->m_pBackground->setVisible( false ); + + continue; + } + + int textWide, textTall; + pLabel->m_pLabel->getContentSize( textWide, textTall ); + + // Don't let it stretch too far across their screen. + if( textWide > (ScreenWidth*2)/3 ) + textWide = (ScreenWidth*2)/3; + + // Setup the background label to fit everything in. + int border = 2; + int bgWide = textWide + iconWide + border*3; + int bgTall = Q_max( textTall, iconTall ) + border*2; + pLabel->m_pBackground->setBounds( ScreenWidth - bgWide - 8, y, bgWide, bgTall ); + + // Put the text at the left. + pLabel->m_pLabel->setBounds( border, (bgTall - textTall) / 2, textWide, textTall ); + + // Put the icon at the right. + int iconLeft = border + textWide + border; + int iconTop = (bgTall - iconTall) / 2; + if( pLabel->m_pIcon ) + { + pLabel->m_pIcon->setImage( m_pSpeakerLabelIcon ); + pLabel->m_pIcon->setBounds( iconLeft, iconTop, iconWide, iconTall ); + } + + y += bgTall + 2; + } + + if( m_pLocalBitmap && m_pAckBitmap && m_pLocalLabel && (m_bTalking || m_bServerAcked) ) + { + m_pLocalLabel->setParent(*m_pParentPanel); + m_pLocalLabel->setVisible( true ); + + if( m_bServerAcked && !!gEngfuncs.pfnGetCvarFloat("voice_clientdebug") ) + m_pLocalLabel->setImage( m_pAckBitmap ); + else + m_pLocalLabel->setImage( m_pLocalBitmap ); + + int sizeX, sizeY; + m_pLocalBitmap->getSize(sizeX, sizeY); + + int local_xPos = ScreenWidth - sizeX - 10; + int local_yPos = m_pHelper->GetAckIconHeight() - sizeY; + + m_pLocalLabel->setPos( local_xPos, local_yPos ); + } + else + { + m_pLocalLabel->setVisible( false ); + } +} + + +void CVoiceStatus::FreeBitmaps() +{ + // Delete all the images we have loaded. + delete m_pLocalBitmap; + m_pLocalBitmap = NULL; + + delete m_pAckBitmap; + m_pAckBitmap = NULL; + + delete m_pSpeakerLabelIcon; + m_pSpeakerLabelIcon = NULL; + + delete m_pScoreboardNeverSpoken; + m_pScoreboardNeverSpoken = NULL; + + delete m_pScoreboardNotSpeaking; + m_pScoreboardNotSpeaking = NULL; + + delete m_pScoreboardSpeaking; + m_pScoreboardSpeaking = NULL; + + delete m_pScoreboardSpeaking2; + m_pScoreboardSpeaking2 = NULL; + + delete m_pScoreboardSquelch; + m_pScoreboardSquelch = NULL; + + delete m_pScoreboardBanned; + m_pScoreboardBanned = NULL; + + // Clear references to the images in panels. + for(int i=0; i < VOICE_MAX_PLAYERS; i++) + { + if (m_pBanButtons[i]) + { + m_pBanButtons[i]->setImage(NULL); + } + } + + if(m_pLocalLabel) + m_pLocalLabel->setImage(NULL); +} + +//----------------------------------------------------------------------------- +// Purpose: returns true if the target client has been banned +// Input : playerID - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +bool CVoiceStatus::IsPlayerBlocked(int iPlayer) +{ + char playerID[16]; + if (!gEngfuncs.GetPlayerUniqueID(iPlayer, playerID)) + return false; + + return m_BanMgr.GetPlayerBan(playerID); +} + +//----------------------------------------------------------------------------- +// Purpose: returns true if the player can't hear the other client due to game rules (eg. the other team) +// Input : playerID - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +bool CVoiceStatus::IsPlayerAudible(int iPlayer) +{ + return !!m_AudiblePlayers[iPlayer-1]; +} + +//----------------------------------------------------------------------------- +// Purpose: blocks/unblocks the target client from being heard +// Input : playerID - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +void CVoiceStatus::SetPlayerBlockedState(int iPlayer, bool blocked) +{ + if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + gEngfuncs.pfnConsolePrint( "CVoiceStatus::SetPlayerBlockedState part 1\n" ); + } + + char playerID[16]; + if (!gEngfuncs.GetPlayerUniqueID(iPlayer, playerID)) + return; + + if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + gEngfuncs.pfnConsolePrint( "CVoiceStatus::SetPlayerBlockedState part 2\n" ); + } + + // Squelch or (try to) unsquelch this player. + if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + { + char str[256]; + sprintf(str, "CVoiceStatus::SetPlayerBlockedState: setting player %d ban to %d\n", iPlayer, !m_BanMgr.GetPlayerBan(playerID)); + gEngfuncs.pfnConsolePrint(str); + } + + m_BanMgr.SetPlayerBan( playerID, blocked ); + UpdateServerState(false); +} diff --git a/cl_dll/voice_status.h b/cl_dll/voice_status.h new file mode 100644 index 00000000..48f00db2 --- /dev/null +++ b/cl_dll/voice_status.h @@ -0,0 +1,228 @@ +//========= Copyright (c) 1996-2001, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef VOICE_STATUS_H +#define VOICE_STATUS_H +#pragma once + + +#include "VGUI_Label.h" +#include "VGUI_LineBorder.h" +#include "VGUI_ImagePanel.h" +#include "VGUI_BitmapTGA.h" +#include "VGUI_InputSignal.h" +#include "VGUI_Button.h" +#include "voice_common.h" +#include "cl_entity.h" +#include "voice_banmgr.h" +#include "vgui_checkbutton2.h" +#include "vgui_defaultinputsignal.h" + + +class CVoiceStatus; + + +class CVoiceLabel +{ +public: + vgui::Label *m_pLabel; + vgui::Label *m_pBackground; + vgui::ImagePanel *m_pIcon; // Voice icon next to player name. + int m_clientindex; // Client index of the speaker. -1 if this label isn't being used. +}; + + +// This is provided by each mod to access data that may not be the same across mods. +class IVoiceStatusHelper +{ +public: + virtual ~IVoiceStatusHelper() {} + + // Get RGB color for voice status text about this player. + virtual void GetPlayerTextColor(int entindex, int color[3]) = 0; + + // Force it to update the cursor state. + virtual void UpdateCursorState() = 0; + + // Return the height above the bottom that the voice ack icons should be drawn at. + virtual int GetAckIconHeight() = 0; + + // Return true if the voice manager is allowed to show speaker labels + // (mods usually return false when the scoreboard is up). + virtual bool CanShowSpeakerLabels() = 0; +}; + +//----------------------------------------------------------------------------- +// Purpose: Holds a color for the shared image +//----------------------------------------------------------------------------- +class VoiceImagePanel : public vgui::ImagePanel +{ + virtual void paintBackground() + { + if (_image!=null) + { + vgui::Color col; + getFgColor(col); + _image->setColor(col); + _image->doPaint(this); + } + } +}; + + +class CVoiceStatus : public CHudBase, public vgui::CDefaultInputSignal +{ +public: + CVoiceStatus(); + virtual ~CVoiceStatus(); + +// CHudBase overrides. +public: + + // Initialize the cl_dll's voice manager. + virtual int Init( + IVoiceStatusHelper *m_pHelper, + vgui::Panel **pParentPanel); + + // ackPosition is the bottom position of where CVoiceStatus will draw the voice acknowledgement labels. + virtual int VidInit(); + + +public: + + // Call from HUD_Frame each frame. + void Frame(double frametime); + + // Called when a player starts or stops talking. + // entindex is -1 to represent the local client talking (before the data comes back from the server). + // When the server acknowledges that the local client is talking, then entindex will be gEngfuncs.GetLocalPlayer(). + // entindex is -2 to represent the local client's voice being acked by the server. + void UpdateSpeakerStatus(int entindex, qboolean bTalking); + + // sets the correct image in the label for the player + void UpdateSpeakerImage(vgui::Label *pLabel, int iPlayer); + + // Call from the HUD_CreateEntities function so it can add sprites above player heads. + void CreateEntities(); + + // Called when the server registers a change to who this client can hear. + void HandleVoiceMaskMsg(int iSize, void *pbuf); + + // The server sends this message initially to tell the client to send their state. + void HandleReqStateMsg(int iSize, void *pbuf); + + +// Squelch mode functions. +public: + + // When you enter squelch mode, pass in + void StartSquelchMode(); + void StopSquelchMode(); + bool IsInSquelchMode(); + + // returns true if the target client has been banned + // playerIndex is of range 1..maxplayers + bool IsPlayerBlocked(int iPlayerIndex); + + // returns false if the player can't hear the other client due to game rules (eg. the other team) + bool IsPlayerAudible(int iPlayerIndex); + + // blocks the target client from being heard + void SetPlayerBlockedState(int iPlayerIndex, bool blocked); + +public: + + CVoiceLabel* FindVoiceLabel(int clientindex); // Find a CVoiceLabel representing the specified speaker. + // Returns NULL if none. + // entindex can be -1 if you want a currently-unused voice label. + CVoiceLabel* GetFreeVoiceLabel(); // Get an unused voice label. Returns NULL if none. + + void RepositionLabels(); + + void FreeBitmaps(); + + void UpdateServerState(bool bForce); + + // Update the button artwork to reflect the client's current state. + void UpdateBanButton(int iClient); + + +public: + + enum {MAX_VOICE_SPEAKERS=7}; + + float m_LastUpdateServerState; // Last time we called this function. + int m_bServerModEnable; // What we've sent to the server about our "voice_modenable" cvar. + + vgui::Panel **m_pParentPanel; + CPlayerBitVec m_VoicePlayers; // Who is currently talking. Indexed by client index. + + // This is the gamerules-defined list of players that you can hear. It is based on what teams people are on + // and is totally separate from the ban list. Indexed by client index. + CPlayerBitVec m_AudiblePlayers; + + // Players who have spoken at least once in the game so far + CPlayerBitVec m_VoiceEnabledPlayers; + + // This is who the server THINKS we have banned (it can become incorrect when a new player arrives on the server). + // It is checked periodically, and the server is told to squelch or unsquelch the appropriate players. + CPlayerBitVec m_ServerBannedPlayers; + + cl_entity_s m_VoiceHeadModels[VOICE_MAX_PLAYERS]; // These aren't necessarily in the order of players. They are just + // a place for it to put data in during CreateEntities. + + IVoiceStatusHelper *m_pHelper; // Each mod provides an implementation of this. + + + // Scoreboard icons. + double m_BlinkTimer; // Blink scoreboard icons.. + vgui::BitmapTGA *m_pScoreboardNeverSpoken; + vgui::BitmapTGA *m_pScoreboardNotSpeaking; + vgui::BitmapTGA *m_pScoreboardSpeaking; + vgui::BitmapTGA *m_pScoreboardSpeaking2; + vgui::BitmapTGA *m_pScoreboardSquelch; + vgui::BitmapTGA *m_pScoreboardBanned; + + vgui::Label *m_pBanButtons[VOICE_MAX_PLAYERS]; // scoreboard buttons. + + // Squelch mode stuff. + bool m_bInSquelchMode; + + HSPRITE m_VoiceHeadModel; // Voice head model (goes above players who are speaking). + float m_VoiceHeadModelHeight; // Height above their head to place the model. + + vgui::Image *m_pSpeakerLabelIcon; // Icon next to speaker labels. + + // Lower-right icons telling when the local player is talking.. + vgui::BitmapTGA *m_pLocalBitmap; // Represents the local client talking. + vgui::BitmapTGA *m_pAckBitmap; // Represents the server ack'ing the client talking. + vgui::ImagePanel *m_pLocalLabel; // Represents the local client talking. + + bool m_bTalking; // Set to true when the client thinks it's talking. + bool m_bServerAcked; // Set to true when the server knows the client is talking. + +public: + + CVoiceBanMgr m_BanMgr; // Tracks which users we have squelched and don't want to hear. + +public: + + bool m_bBanMgrInitialized; + + // Labels telling who is speaking. + CVoiceLabel m_Labels[MAX_VOICE_SPEAKERS]; + + // Cache the game directory for use when we shut down + char * m_pchGameDir; +}; + + +// Get the (global) voice manager. +CVoiceStatus* GetClientVoiceMgr(); + + +#endif // VOICE_STATUS_H diff --git a/common/winsani_in.h b/common/winsani_in.h new file mode 100644 index 00000000..d8c85271 --- /dev/null +++ b/common/winsani_in.h @@ -0,0 +1,7 @@ +#if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) +#pragma push_macro("ARRAYSIZE") +#ifdef ARRAYSIZE +#undef ARRAYSIZE +#endif +#define HSPRITE WINDOWS_HSPRITE +#endif diff --git a/common/winsani_out.h b/common/winsani_out.h new file mode 100644 index 00000000..27269500 --- /dev/null +++ b/common/winsani_out.h @@ -0,0 +1,4 @@ +#if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) +#undef HSPRITE +#pragma pop_macro("ARRAYSIZE") +#endif diff --git a/game_shared/bitvec.h b/game_shared/bitvec.h index bb6d8fb7..d77796fb 100644 --- a/game_shared/bitvec.h +++ b/game_shared/bitvec.h @@ -1,10 +1,9 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= -#pragma once #if !defined(BITVEC_H) #define BITVEC_H @@ -155,3 +154,4 @@ inline void CBitVec::SetDWord( int i, unsigned long val ) m_DWords[i] = val; } #endif // BITVEC_H + diff --git a/game_shared/vgui_checkbutton2.cpp b/game_shared/vgui_checkbutton2.cpp index b998a41d..bb67f31a 100644 --- a/game_shared/vgui_checkbutton2.cpp +++ b/game_shared/vgui_checkbutton2.cpp @@ -10,57 +10,50 @@ #include "vgui_checkbutton2.h" #include "vgui_loadtga.h" - #define EXTRA_X 5 - using namespace vgui; - - CCheckButton2::CCheckButton2() : - m_Label(""), - m_pChecked(NULL), - m_pUnchecked(NULL), - m_pHandler(NULL), - m_CheckboxPanel(NULL) + m_Label( "" ), + m_pChecked( NULL ), + m_pUnchecked( NULL ), + m_pHandler( NULL ), + m_CheckboxPanel( NULL ) { m_bOwnImages = false; m_bChecked = false; m_pChecked = m_pUnchecked = NULL; m_bCheckboxLeft = true; - m_Label.setParent(this); - m_Label.setFgColor(255,255,255,0); - m_Label.setBgColor(0,0,0,255); // background is not drawn and foreground is white - m_Label.addInputSignal(this); + m_Label.setParent( this ); + m_Label.setFgColor( 255, 255, 255, 0 ); + m_Label.setBgColor( 0, 0, 0, 255 ); // background is not drawn and foreground is white + m_Label.addInputSignal( this ); - m_CheckboxPanel.setParent(this); - m_CheckboxPanel.addInputSignal(this); + m_CheckboxPanel.setParent( this ); + m_CheckboxPanel.addInputSignal( this ); - setPaintBackgroundEnabled(false); + setPaintBackgroundEnabled( false ); } - CCheckButton2::~CCheckButton2() { DeleteImages(); } - -void CCheckButton2::SetImages(char const *pChecked, char const *pUnchecked) +void CCheckButton2::SetImages( char const *pChecked, char const *pUnchecked ) { DeleteImages(); - - m_pChecked = vgui_LoadTGA(pChecked); - m_pUnchecked = vgui_LoadTGA(pUnchecked); + + m_pChecked = vgui_LoadTGA( pChecked ); + m_pUnchecked = vgui_LoadTGA( pUnchecked ); m_bOwnImages = true; SetupControls(); } - -void CCheckButton2::SetImages(Image *pChecked, Image *pUnchecked) +void CCheckButton2::SetImages( Image *pChecked, Image *pUnchecked ) { DeleteImages(); @@ -71,10 +64,9 @@ void CCheckButton2::SetImages(Image *pChecked, Image *pUnchecked) SetupControls(); } - void CCheckButton2::DeleteImages() { - if(m_bOwnImages) + if( m_bOwnImages ) { delete m_pChecked; delete m_pUnchecked; @@ -87,71 +79,62 @@ void CCheckButton2::DeleteImages() SetupControls(); } - -void CCheckButton2::SetCheckboxLeft(bool bLeftAlign) +void CCheckButton2::SetCheckboxLeft( bool bLeftAlign ) { m_bCheckboxLeft = bLeftAlign; SetupControls(); } - bool CCheckButton2::GetCheckboxLeft() { return m_bCheckboxLeft; } - -void CCheckButton2::SetText(char const *pText, ...) +void CCheckButton2::SetText( char const *pText, ... ) { char str[512]; - - va_list marker; - va_start(marker, pText); - _vsnprintf(str, sizeof(str), pText, marker); - va_end(marker); - m_Label.setText(str); + va_list marker; + va_start( marker, pText ); + _vsnprintf( str, sizeof( str ), pText, marker ); + va_end( marker ); + + m_Label.setText( str ); SetupControls(); } - -void CCheckButton2::SetTextColor(int r, int g, int b, int a) +void CCheckButton2::SetTextColor( int r, int g, int b, int a ) { - m_Label.setFgColor(r, g, b, a); + m_Label.setFgColor( r, g, b, a ); repaint(); } - -void CCheckButton2::SetHandler(ICheckButton2Handler *pHandler) +void CCheckButton2::SetHandler( ICheckButton2Handler *pHandler ) { m_pHandler = pHandler; } - bool CCheckButton2::IsChecked() { return m_bChecked; } - -void CCheckButton2::SetChecked(bool bChecked) +void CCheckButton2::SetChecked( bool bChecked ) { m_bChecked = bChecked; SetupControls(); } - -void CCheckButton2::internalMousePressed(MouseCode code) +void CCheckButton2::internalMousePressed( MouseCode code ) { m_bChecked = !m_bChecked; - if(m_pHandler) - m_pHandler->StateChanged(this); + if( m_pHandler ) + m_pHandler->StateChanged( this ); SetupControls(); } - void CCheckButton2::SetupControls() { // Initialize the checkbutton bitmap. @@ -161,37 +144,28 @@ void CCheckButton2::SetupControls() int controlSizes[2][2]; controlSizes[0][0] = controlSizes[0][1] = 0; - if(pBitmap) - pBitmap->getSize(controlSizes[0][0], controlSizes[0][1]); - - m_CheckboxPanel.setImage(pBitmap); - m_CheckboxPanel.setSize(controlSizes[0][0], controlSizes[0][1]); + if( pBitmap ) + pBitmap->getSize( controlSizes[0][0], controlSizes[0][1] ); + + m_CheckboxPanel.setImage( pBitmap ); + m_CheckboxPanel.setSize( controlSizes[0][0], controlSizes[0][1] ); - // Get the label's size. - m_Label.getSize(controlSizes[1][0], controlSizes[1][1]); - m_Label.setContentAlignment(Label::a_west); - + m_Label.getSize( controlSizes[1][0], controlSizes[1][1] ); + m_Label.setContentAlignment( Label::a_west ); // Position the controls. int iLeftControl = !m_bCheckboxLeft; int iBiggestY = controlSizes[0][1] > controlSizes[1][0] ? 0 : 1; - controls[iLeftControl]->setPos(0, (controlSizes[iBiggestY][1] - controlSizes[iLeftControl][1]) / 2); - controls[!iLeftControl]->setPos(controlSizes[iLeftControl][0] + EXTRA_X, (controlSizes[iBiggestY][1] - controlSizes[!iLeftControl][1]) / 2); + controls[iLeftControl]->setPos( 0, ( controlSizes[iBiggestY][1] - controlSizes[iLeftControl][1] ) / 2 ); + controls[!iLeftControl]->setPos( controlSizes[iLeftControl][0] + EXTRA_X, ( controlSizes[iBiggestY][1] - controlSizes[!iLeftControl][1]) / 2 ); - // Fit this control to the sizes of the subcontrols. - setSize(controlSizes[0][0] + controlSizes[1][0] + EXTRA_X, (controlSizes[0][1] > controlSizes[1][1]) ? controlSizes[0][1] : controlSizes[1][1]); + setSize(controlSizes[0][0] + controlSizes[1][0] + EXTRA_X, ( controlSizes[0][1] > controlSizes[1][1]) ? controlSizes[0][1] : controlSizes[1][1] ); repaint(); } - -void CCheckButton2::mousePressed(MouseCode code, Panel *panel) +void CCheckButton2::mousePressed( MouseCode code, Panel *panel ) { - internalMousePressed(code); + internalMousePressed( code ); } - - - - - diff --git a/game_shared/vgui_checkbutton2.h b/game_shared/vgui_checkbutton2.h index 7267abe2..d04fc182 100644 --- a/game_shared/vgui_checkbutton2.h +++ b/game_shared/vgui_checkbutton2.h @@ -1,32 +1,29 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= -#pragma once -#if !defined(VGUI_CHECKBUTTON2_H) + +#ifndef VGUI_CHECKBUTTON2_H #define VGUI_CHECKBUTTON2_H +#ifdef _WIN32 +#pragma once +#endif -#include "vgui_label.h" -#include "vgui_imagepanel.h" +#include "VGUI_Label.h" +#include "VGUI_ImagePanel.h" #include "vgui_defaultinputsignal.h" - namespace vgui { - - class CCheckButton2; - - class ICheckButton2Handler { public: - virtual void StateChanged(CCheckButton2 *pButton) = 0; + virtual void StateChanged( CCheckButton2 *pButton ) = 0; }; - // VGUI checkbox class. // - Provides access to the checkbox images. // - Provides an easy callback mechanism for state changes. @@ -34,47 +31,37 @@ public: class CCheckButton2 : public Panel, public CDefaultInputSignal { public: + CCheckButton2(); + ~CCheckButton2(); - CCheckButton2(); - ~CCheckButton2(); - // Initialize the button with these. - void SetImages(char const *pChecked, char const *pUnchecked); - void SetImages(Image *pChecked, Image *pUnchecked); // If you use this, the button will never delete the images. + void SetImages( char const *pChecked, char const *pUnchecked ); + void SetImages( Image *pChecked, Image *pUnchecked ); // If you use this, the button will never delete the images. void DeleteImages(); // The checkbox can be to the left or the right of the text (default is left). - void SetCheckboxLeft(bool bLeftAlign); + void SetCheckboxLeft( bool bLeftAlign ); bool GetCheckboxLeft(); - + // Set the label text. - void SetText(char const *pText, ...); - void SetTextColor(int r, int g, int b, int a); + void SetText( char const *pText, ... ); + void SetTextColor( int r, int g, int b, int a ); // You can register for change notification here. - void SetHandler(ICheckButton2Handler *pHandler); - + void SetHandler( ICheckButton2Handler *pHandler ); + // Get/set the check state. bool IsChecked(); - void SetChecked(bool bChecked); - - + void SetChecked( bool bChecked ); // Panel overrides. -public: - - virtual void internalMousePressed(MouseCode code); - + virtual void internalMousePressed( MouseCode code ); protected: - void SetupControls(); - // InputSignal overrides. -protected: - virtual void mousePressed(MouseCode code,Panel* panel); - + virtual void mousePressed( MouseCode code, Panel *panel ); public: ICheckButton2Handler *m_pHandler; @@ -89,9 +76,5 @@ public: bool m_bChecked; }; - - } - - #endif // VGUI_CHECKBUTTON2_H diff --git a/game_shared/vgui_defaultinputsignal.h b/game_shared/vgui_defaultinputsignal.h index 25d89d70..cd55b76c 100644 --- a/game_shared/vgui_defaultinputsignal.h +++ b/game_shared/vgui_defaultinputsignal.h @@ -1,14 +1,17 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= -#pragma once -#if !defined(VGUI_DEFAULTINPUTSIGNAL_H) -#define VGUI_DEFAULTINPUTSIGNAL_H -#include "vgui_inputsignal.h" +#ifndef VGUI_DEFAULTINPUTSIGNAL_H +#define VGUI_DEFAULTINPUTSIGNAL_H +#ifdef _WIN32 +#pragma once +#endif + +#include "VGUI_InputSignal.h" namespace vgui { @@ -16,8 +19,8 @@ namespace vgui class CDefaultInputSignal : public vgui::InputSignal { public: - virtual void cursorMoved(int x,int y,Panel* panel) {} - virtual void cursorEntered(Panel* panel) {} + virtual void cursorMoved( int x, int y, Panel *panel ) {} + virtual void cursorEntered( Panel *panel ) {} virtual void cursorExited(Panel* panel) {} virtual void mousePressed(MouseCode code,Panel* panel) {} virtual void mouseDoublePressed(MouseCode code,Panel* panel) {} @@ -29,4 +32,6 @@ namespace vgui virtual void keyFocusTicked(Panel* panel) {} }; } + + #endif // VGUI_DEFAULTINPUTSIGNAL_H diff --git a/game_shared/vgui_grid.cpp b/game_shared/vgui_grid.cpp index 5a1af15e..f94e1cef 100644 --- a/game_shared/vgui_grid.cpp +++ b/game_shared/vgui_grid.cpp @@ -8,10 +8,8 @@ #include #include "vgui_grid.h" - using namespace vgui; - #define AssertCheck(expr, msg) \ if(!(expr))\ {\ @@ -19,12 +17,9 @@ using namespace vgui; return 0;\ } - - // ------------------------------------------------------------------------------ // // CGrid::CGridEntry. // ------------------------------------------------------------------------------ // - CGrid::CGridEntry::CGridEntry() { m_pPanel = NULL; @@ -35,47 +30,42 @@ CGrid::CGridEntry::~CGridEntry() { } - // ------------------------------------------------------------------------------ // // CGrid. // ------------------------------------------------------------------------------ // - CGrid::CGrid() { Clear(); } - CGrid::~CGrid() { Term(); } - -bool CGrid::SetDimensions(int xCols, int yRows) +bool CGrid::SetDimensions( int xCols, int yRows ) { Term(); m_GridEntries = new CGridEntry[xCols * yRows]; - m_Widths = new int[xCols*2 + yRows*2]; + m_Widths = new int[xCols * 2 + yRows * 2]; m_Heights = m_Widths + xCols; m_ColOffsets = m_Heights + yRows; m_RowOffsets = m_ColOffsets + xCols; - if(!m_GridEntries || !m_Widths) + if( !m_GridEntries || !m_Widths ) { Term(); return false; } - memset(m_Widths, 0, sizeof(int) * (xCols*2 + yRows*2)); + memset( m_Widths, 0, sizeof(int) * ( xCols * 2 + yRows * 2 ) ); m_xCols = xCols; m_yRows = yRows; return true; } - void CGrid::Term() { delete [] m_GridEntries; @@ -83,180 +73,164 @@ void CGrid::Term() Clear(); } - -Panel* CGrid::GetEntry(int x, int y) +Panel *CGrid::GetEntry( int x, int y ) { - return GridEntry(x, y)->m_pPanel; + return GridEntry( x, y )->m_pPanel; } - -bool CGrid::SetEntry(int x, int y, Panel *pPanel) +bool CGrid::SetEntry( int x, int y, Panel *pPanel ) { - CGridEntry *pEntry = GridEntry(x, y); - if(!pEntry) + CGridEntry *pEntry = GridEntry( x, y ); + if( !pEntry ) return false; - if(pEntry->m_pPanel) - pEntry->m_pPanel->setParent(NULL); + if( pEntry->m_pPanel ) + pEntry->m_pPanel->setParent( NULL ); pEntry->m_pPanel = pPanel; - if(pPanel) - pPanel->setParent(this); + if( pPanel ) + pPanel->setParent( this ); m_bDirty = true; return true; } - int CGrid::GetXSpacing() { return m_xSpacing; } - int CGrid::GetYSpacing() { return m_ySpacing; } - -void CGrid::SetSpacing(int xSpacing, int ySpacing) +void CGrid::SetSpacing( int xSpacing, int ySpacing ) { - if(xSpacing != m_xSpacing) + if( xSpacing != m_xSpacing ) { m_xSpacing = xSpacing; - CalcColOffsets(0); + CalcColOffsets( 0 ); m_bDirty = true; } - if(ySpacing != m_ySpacing) + if( ySpacing != m_ySpacing ) { m_ySpacing = ySpacing; - CalcRowOffsets(0); + CalcRowOffsets( 0 ); m_bDirty = true; } } - bool CGrid::SetColumnWidth(int iColumn, int width) { - AssertCheck(iColumn >= 0 && iColumn < m_xCols, "CGrid::SetColumnWidth : invalid location specified"); + AssertCheck( iColumn >= 0 && iColumn < m_xCols, "CGrid::SetColumnWidth : invalid location specified" ); m_Widths[iColumn] = width; - CalcColOffsets(iColumn+1); + CalcColOffsets( iColumn + 1 ); m_bDirty = true; return true; } - -bool CGrid::SetRowHeight(int iRow, int height) +bool CGrid::SetRowHeight( int iRow, int height ) { - AssertCheck(iRow >= 0 && iRow < m_yRows, "CGrid::SetColumnWidth : invalid location specified"); + AssertCheck( iRow >= 0 && iRow < m_yRows, "CGrid::SetColumnWidth : invalid location specified" ); m_Heights[iRow] = height; - CalcRowOffsets(iRow+1); + CalcRowOffsets( iRow + 1 ); m_bDirty = true; return true; } - -int CGrid::GetColumnWidth(int iColumn) +int CGrid::GetColumnWidth( int iColumn ) { - AssertCheck(iColumn >= 0 && iColumn < m_xCols, "CGrid::GetColumnWidth: invalid location specified"); + AssertCheck( iColumn >= 0 && iColumn < m_xCols, "CGrid::GetColumnWidth: invalid location specified" ); return m_Widths[iColumn]; } - -int CGrid::GetRowHeight(int iRow) +int CGrid::GetRowHeight( int iRow ) { - AssertCheck(iRow >= 0 && iRow < m_yRows, "CGrid::GetRowHeight: invalid location specified"); + AssertCheck( iRow >= 0 && iRow < m_yRows, "CGrid::GetRowHeight: invalid location specified" ); return m_Heights[iRow]; } - -int CGrid::CalcFitColumnWidth(int iColumn) +int CGrid::CalcFitColumnWidth( int iColumn ) { - AssertCheck(iColumn >= 0 && iColumn < m_xCols, "CGrid::CalcFitColumnWidth: invalid location specified"); + AssertCheck( iColumn >= 0 && iColumn < m_xCols, "CGrid::CalcFitColumnWidth: invalid location specified" ); int maxSize = 0; - for(int i=0; i < m_yRows; i++) + for( int i = 0; i < m_yRows; i++ ) { - Panel *pPanel = GridEntry(iColumn, i)->m_pPanel; - if(!pPanel) + Panel *pPanel = GridEntry( iColumn, i )->m_pPanel; + if( !pPanel ) continue; int w, h; - pPanel->getSize(w,h); - if(w > maxSize) + pPanel->getSize( w, h ); + if( w > maxSize ) maxSize = w; } return maxSize; } - -int CGrid::CalcFitRowHeight(int iRow) +int CGrid::CalcFitRowHeight( int iRow ) { - AssertCheck(iRow >= 0 && iRow < m_yRows, "CGrid::CalcFitRowHeight: invalid location specified"); + AssertCheck( iRow >= 0 && iRow < m_yRows, "CGrid::CalcFitRowHeight: invalid location specified" ); int maxSize = 0; - for(int i=0; i < m_xCols; i++) + for( int i = 0; i < m_xCols; i++ ) { - Panel *pPanel = GridEntry(i, iRow)->m_pPanel; - if(!pPanel) + Panel *pPanel = GridEntry( i, iRow )->m_pPanel; + if( !pPanel ) continue; int w, h; - pPanel->getSize(w,h); - if(h > maxSize) + pPanel->getSize( w, h ); + if( h > maxSize ) maxSize = h; } return maxSize; } - void CGrid::AutoSetRowHeights() { - for(int i=0; i < m_yRows; i++) - SetRowHeight(i, CalcFitRowHeight(i)); + for( int i = 0; i < m_yRows; i++ ) + SetRowHeight( i, CalcFitRowHeight( i ) ); } - -bool CGrid::GetEntryBox( - int col, int row, int &x, int &y, int &w, int &h) +bool CGrid::GetEntryBox( int col, int row, int &x, int &y, int &w, int &h ) { - AssertCheck(col >= 0 && col < m_xCols && row >= 0 && row < m_yRows, "CGrid::GetEntryBox: invalid location specified"); + AssertCheck( col >= 0 && col < m_xCols && row >= 0 && row < m_yRows, "CGrid::GetEntryBox: invalid location specified" ); x = m_ColOffsets[col]; w = m_Widths[col]; y = m_RowOffsets[row]; h = m_Heights[row]; - return true; + return true; } - -bool CGrid::CopyColumnWidths(CGrid *pOther) +bool CGrid::CopyColumnWidths( CGrid *pOther ) { - if(!pOther || pOther->m_xCols != m_xCols) + if( !pOther || pOther->m_xCols != m_xCols ) return false; - for(int i=0; i < m_xCols; i++) + for( int i = 0; i < m_xCols; i++ ) m_Widths[i] = pOther->m_Widths[i]; - CalcColOffsets(0); + CalcColOffsets( 0 ); m_bDirty = true; return true; } - void CGrid::RepositionContents() { - for(int x=0; x < m_xCols; x++) + for( int x = 0; x < m_xCols; x++ ) { - for(int y=0; y < m_yRows; y++) + for( int y=0; y < m_yRows; y++ ) { - Panel *pPanel = GridEntry(x,y)->m_pPanel; - if(!pPanel) + Panel *pPanel = GridEntry( x, y )->m_pPanel; + if( !pPanel ) continue; pPanel->setBounds( @@ -270,12 +244,11 @@ void CGrid::RepositionContents() m_bDirty = false; } - int CGrid::CalcDrawHeight() { - if(m_yRows > 0) + if( m_yRows > 0 ) { - return m_RowOffsets[m_yRows-1] + m_Heights[m_yRows - 1] + m_ySpacing; + return m_RowOffsets[m_yRows - 1] + m_Heights[m_yRows - 1] + m_ySpacing; } else { @@ -283,25 +256,24 @@ int CGrid::CalcDrawHeight() } } - void CGrid::paint() { - if(m_bDirty) + if( m_bDirty ) RepositionContents(); Panel::paint(); // walk the grid looking for underlined rows int x = 0, y = 0; - for (int row = 0; row < m_yRows; row++) + for( int row = 0; row < m_yRows; row++ ) { - CGridEntry *cell = GridEntry(0, row); + CGridEntry *cell = GridEntry( 0, row ); y += cell->m_pPanel->getTall() + m_ySpacing; - if (cell->m_bUnderline) + if( cell->m_bUnderline ) { - drawSetColor(cell->m_UnderlineColor[0], cell->m_UnderlineColor[1], cell->m_UnderlineColor[2], cell->m_UnderlineColor[3]); - drawFilledRect(0, y - (cell->m_iUnderlineOffset + 1), getWide(), y - cell->m_iUnderlineOffset); + drawSetColor( cell->m_UnderlineColor[0], cell->m_UnderlineColor[1], cell->m_UnderlineColor[2], cell->m_UnderlineColor[3] ); + drawFilledRect( 0, y - (cell->m_iUnderlineOffset + 1 ), getWide(), y - cell->m_iUnderlineOffset ); } } } @@ -314,11 +286,11 @@ void CGrid::paintBackground() //----------------------------------------------------------------------------- // Purpose: sets underline color for a particular row //----------------------------------------------------------------------------- -void CGrid::SetRowUnderline(int row, bool enabled, int offset, int r, int g, int b, int a) +void CGrid::SetRowUnderline( int row, bool enabled, int offset, int r, int g, int b, int a ) { - CGridEntry *cell = GridEntry(0, row); + CGridEntry *cell = GridEntry( 0, row ); cell->m_bUnderline = enabled; - if (enabled) + if( enabled ) { cell->m_iUnderlineOffset = offset; cell->m_UnderlineColor[0] = r; @@ -337,53 +309,51 @@ void CGrid::Clear() m_bDirty = false; } - CGrid::CGridEntry* CGrid::GridEntry(int x, int y) { - AssertCheck(x >= 0 && x < m_xCols && y >= 0 && y < m_yRows, "CGrid::GridEntry: invalid location specified"); - return &m_GridEntries[y*m_xCols + x]; + AssertCheck( x >= 0 && x < m_xCols && y >= 0 && y < m_yRows, "CGrid::GridEntry: invalid location specified" ); + return &m_GridEntries[y * m_xCols + x]; } - -void CGrid::CalcColOffsets(int iStart) +void CGrid::CalcColOffsets( int iStart ) { int cur = m_xSpacing; - if(iStart != 0) - cur += m_ColOffsets[iStart-1] + m_Widths[iStart-1]; + if( iStart != 0 ) + cur += m_ColOffsets[iStart - 1] + m_Widths[iStart - 1]; - for(int i=iStart; i < m_xCols; i++) + for( int i = iStart; i < m_xCols; i++ ) { m_ColOffsets[i] = cur; cur += m_Widths[i] + m_xSpacing; } } - -void CGrid::CalcRowOffsets(int iStart) +void CGrid::CalcRowOffsets( int iStart ) { int cur = m_ySpacing; - if(iStart != 0) - cur += m_RowOffsets[iStart-1]; + if( iStart != 0 ) + cur += m_RowOffsets[iStart - 1]; - for(int i=iStart; i < m_yRows; i++) + for( int i = iStart; i < m_yRows; i++ ) { m_RowOffsets[i] = cur; cur += m_Heights[i] + m_ySpacing; } } -bool CGrid::getCellAtPoint(int worldX, int worldY, int &row, int &col) +bool CGrid::getCellAtPoint( int worldX, int worldY, int &row, int &col ) { row = -1; col = -1; - for(int x=0; x < m_xCols; x++) + + for( int x = 0; x < m_xCols; x++ ) { - for(int y=0; y < m_yRows; y++) + for( int y = 0; y < m_yRows; y++ ) { - Panel *pPanel = GridEntry(x,y)->m_pPanel; - if (!pPanel) + Panel *pPanel = GridEntry( x, y )->m_pPanel; + if( !pPanel ) continue; - if (pPanel->isWithin(worldX, worldY)) + if( pPanel->isWithin( worldX, worldY ) ) { col = x; row = y; @@ -395,4 +365,3 @@ bool CGrid::getCellAtPoint(int worldX, int worldY, int &row, int &col) return false; } - diff --git a/game_shared/vgui_grid.h b/game_shared/vgui_grid.h index 739834e5..0e45ac4a 100644 --- a/game_shared/vgui_grid.h +++ b/game_shared/vgui_grid.h @@ -5,22 +5,20 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VGUI_GRID_H) +#ifndef VGUI_GRID_H #define VGUI_GRID_H -#include "vgui_panel.h" - +#include "VGUI_Panel.h" namespace vgui { - // The grid control simply manages a grid of panels. You can adjust column sizes and spacings and // configure and fill the panels however you want. // To use this control, call SetDimensions, SetSpacing and fill the controls. class CGrid : public Panel { public: - CGrid(); + CGrid(); virtual ~CGrid(); bool SetDimensions(int xCols, int yRows); // Set how many columns and rows in the grid. @@ -66,8 +64,6 @@ public: bool getCellAtPoint(int worldX, int worldY, int &row, int &col); // Panel overrides. -public: - virtual void paint(); virtual void paintBackground(); @@ -76,8 +72,8 @@ protected: class CGridEntry { public: - CGridEntry(); - ~CGridEntry(); + CGridEntry(); + ~CGridEntry(); Panel *m_pPanel; @@ -92,9 +88,6 @@ protected: void CalcColOffsets(int iStart); void CalcRowOffsets(int iStart); - -protected: - bool m_bDirty; // Set when controls will need to be repositioned. int m_xCols; @@ -108,9 +101,8 @@ protected: int *m_ColOffsets; int *m_RowOffsets; - CGridEntry *m_GridEntries; - -}; - + CGridEntry *m_GridEntries; }; +} #endif // VGUI_GRID_H + diff --git a/game_shared/vgui_helpers.cpp b/game_shared/vgui_helpers.cpp index c2694759..79c4e378 100644 --- a/game_shared/vgui_helpers.cpp +++ b/game_shared/vgui_helpers.cpp @@ -7,37 +7,36 @@ #include "vgui_helpers.h" - using namespace vgui; - -void AlignPanel(Panel *pChild, Panel *pParent, int alignment) +void AlignPanel( Panel *pChild, Panel *pParent, int alignment ) { int w, h, cw, ch; - pParent->getSize(w, h); - pChild->getSize(cw, ch); - int xCenter = (w - cw) / 2; - int yCenter = (h - ch) / 2; + pParent->getSize( w, h ); + pChild->getSize( cw, ch ); - if(alignment == Label::a_west) - pChild->setPos(0, yCenter); - else if(alignment == Label::a_northwest) - pChild->setPos(0,0); - else if(alignment == Label::a_north) - pChild->setPos(xCenter, 0); - else if(alignment == Label::a_northeast) - pChild->setPos(w - cw, 0); - else if(alignment == Label::a_east) - pChild->setPos(w - cw, yCenter); - else if(alignment == Label::a_southeast) - pChild->setPos(w - cw, h - ch); - else if(alignment == Label::a_south) - pChild->setPos(xCenter, h - ch); - else if(alignment == Label::a_southwest) - pChild->setPos(0, h - ch); - else if(alignment == Label::a_center) - pChild->setPos(xCenter, yCenter); + int xCenter = ( w - cw ) / 2; + int yCenter = ( h - ch ) / 2; + + if( alignment == Label::a_west ) + pChild->setPos( 0, yCenter ); + else if( alignment == Label::a_northwest ) + pChild->setPos( 0, 0 ); + else if( alignment == Label::a_north ) + pChild->setPos( xCenter, 0 ); + else if( alignment == Label::a_northeast ) + pChild->setPos( w - cw, 0 ); + else if( alignment == Label::a_east ) + pChild->setPos( w - cw, yCenter ); + else if( alignment == Label::a_southeast ) + pChild->setPos( w - cw, h - ch ); + else if( alignment == Label::a_south ) + pChild->setPos( xCenter, h - ch ); + else if( alignment == Label::a_southwest ) + pChild->setPos( 0, h - ch ); + else if( alignment == Label::a_center ) + pChild->setPos( xCenter, yCenter ); } diff --git a/game_shared/vgui_helpers.h b/game_shared/vgui_helpers.h index fb150eb5..91c24343 100644 --- a/game_shared/vgui_helpers.h +++ b/game_shared/vgui_helpers.h @@ -5,22 +5,68 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VGUI_HELPERS_H) +#ifndef VGUI_HELPERS_H #define VGUI_HELPERS_H +#include "VGUI_Panel.h" +#include "VGUI_Label.h" -#include "vgui_panel.h" -#include "vgui_label.h" +inline int PanelTop( vgui::Panel *pPanel ) +{ + int x, y, w, h; + pPanel->getBounds( x, y, w, h ); -inline int PanelTop(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return y;} -inline int PanelLeft(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return x;} -inline int PanelRight(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return x+w;} -inline int PanelBottom(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return y+h;} -inline int PanelWidth(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return w;} -inline int PanelHeight(vgui::Panel *pPanel) {int x,y,w,h; pPanel->getBounds(x,y,w,h); return h;} + return y; +} + +inline int PanelLeft( vgui::Panel *pPanel ) +{ + int x, y, w, h; + + pPanel->getBounds( x, y, w, h ); + + return x; +} + +inline int PanelRight( vgui::Panel *pPanel ) +{ + int x, y, w, h; + + pPanel->getBounds( x, y, w, h ); + + return x + w; +} + +inline int PanelBottom( vgui::Panel *pPanel ) +{ + int x, y, w, h; + + pPanel->getBounds( x, y, w, h ); + + return y + h; +} + +inline int PanelWidth( vgui::Panel *pPanel ) +{ + int x, y, w, h; + + pPanel->getBounds( x, y, w, h ); + + return w; +} + +inline int PanelHeight( vgui::Panel *pPanel ) +{ + int x, y, w, h; + + pPanel->getBounds( x, y, w, h ); + + return h; +} // Places child at the requested position inside pParent. iAlignment is from Label::Alignment. -void AlignPanel(vgui::Panel *pChild, vgui::Panel *pParent, int alignment); +void AlignPanel( vgui::Panel *pChild, vgui::Panel *pParent, int alignment ); + #endif // VGUI_HELPERS_H diff --git a/game_shared/vgui_listbox.cpp b/game_shared/vgui_listbox.cpp index 6986d909..77b7689b 100644 --- a/game_shared/vgui_listbox.cpp +++ b/game_shared/vgui_listbox.cpp @@ -7,28 +7,25 @@ #include "vgui_listbox.h" - - using namespace vgui; - -CListBox::CListBox() : Panel(0, 0, 0, 0), - m_ItemsPanel(0,0,0,0), - m_ScrollBar(0, 0, 0, 0, true), - m_Slider(0, 0, 10, 40, true) +CListBox::CListBox() : Panel( 0, 0, 0, 0 ), + m_ItemsPanel( 0, 0, 0, 0 ), + m_ScrollBar( 0, 0, 0, 0, true ), + m_Slider( 0, 0, 10, 40, true ) { m_Signal.m_pListBox = this; - m_ItemsPanel.setParent(this); - m_ItemsPanel.setBgColor(0,0,0,255); - - m_Slider.setRangeWindow(50); - m_Slider.setRangeWindowEnabled(true); + m_ItemsPanel.setParent( this ); + m_ItemsPanel.setBgColor( 0, 0, 0, 255 ); - m_ScrollBar.setParent(this); - m_ScrollBar.addIntChangeSignal(&m_Signal); - m_ScrollBar.setSlider(&m_Slider); - m_ScrollBar.setButtonPressedScrollValue(1); + m_Slider.setRangeWindow( 50 ); + m_Slider.setRangeWindowEnabled( true ); + + m_ScrollBar.setParent( this ); + m_ScrollBar.addIntChangeSignal( &m_Signal ); + m_ScrollBar.setSlider( &m_Slider ); + m_ScrollBar.setButtonPressedScrollValue( 1 ); m_Items.m_pNext = m_Items.m_pPrev = &m_Items; m_ItemOffset = 0; @@ -51,40 +48,42 @@ void CListBox::Term() // Free the LBItems. LBItem *pNext; - for(LBItem *pItem=m_Items.m_pNext; pItem != &m_Items; pItem=pNext) + + for( LBItem *pItem =m_Items.m_pNext; pItem != &m_Items; pItem = pNext ) { - pItem->m_pPanel->setParent(NULL); // detach the panel from us + pItem->m_pPanel->setParent( NULL ); // detach the panel from us pNext = pItem->m_pNext; delete pItem; } m_Items.m_pPrev = m_Items.m_pNext = &m_Items; } -void CListBox::AddItem(Panel* panel) +void CListBox::AddItem( Panel *panel ) { // Add the item. LBItem *pItem = new LBItem; - if(!pItem) + if( !pItem ) return; pItem->m_pPanel = panel; - pItem->m_pPanel->setParent(&m_ItemsPanel); + pItem->m_pPanel->setParent( &m_ItemsPanel ); pItem->m_pPrev = m_Items.m_pPrev; pItem->m_pNext = &m_Items; pItem->m_pNext->m_pPrev = pItem->m_pPrev->m_pNext = pItem; - m_ScrollBar.setRange(0, GetScrollMax()); - m_Slider.setRangeWindow(50); - m_Slider.setRangeWindowEnabled(true); + m_ScrollBar.setRange( 0, GetScrollMax() ); + m_Slider.setRangeWindow( 50 ); + m_Slider.setRangeWindowEnabled( true ); InternalLayout(); } int CListBox::GetNumItems() { - int count=0; - for(LBItem *pItem=m_Items.m_pNext; pItem != &m_Items; pItem=pItem->m_pNext) + int count = 0; + + for( LBItem *pItem = m_Items.m_pNext; pItem != &m_Items; pItem = pItem->m_pNext ) ++count; return count; @@ -93,7 +92,9 @@ int CListBox::GetNumItems() int CListBox::GetItemWidth() { int wide, tall; - m_ItemsPanel.getSize(wide, tall); + + m_ItemsPanel.getSize( wide, tall ); + return wide; } @@ -102,29 +103,29 @@ int CListBox::GetScrollPos() return m_ItemOffset; } -void CListBox::SetScrollPos(int pos) +void CListBox::SetScrollPos( int pos ) { int maxItems = GetScrollMax(); - if(maxItems < 0) + if( maxItems < 0 ) return; - m_ItemOffset = (pos < 0) ? 0 : ((pos > maxItems) ? maxItems : pos); + m_ItemOffset = ( pos < 0 ) ? 0 : ( ( pos > maxItems ) ? maxItems : pos ); InternalLayout(); } -void CListBox::setPos(int x, int y) +void CListBox::setPos( int x, int y ) { - Panel::setPos(x, y); + Panel::setPos( x, y ); InternalLayout(); } -void CListBox::setSize(int wide,int tall) +void CListBox::setSize( int wide, int tall ) { - Panel::setSize(wide,tall); + Panel::setSize( wide, tall ); InternalLayout(); } -void CListBox::setPixelScroll(int value) +void CListBox::setPixelScroll( int value ) { m_ItemOffset = m_ScrollBar.getValue(); InternalLayout(); @@ -133,11 +134,11 @@ void CListBox::setPixelScroll(int value) void CListBox::InternalLayout() { int x, y, wide, tall; - getBounds(x, y, wide, tall); + getBounds( x, y, wide, tall ); // Reposition the main panel and the scrollbar. - m_ItemsPanel.setBounds(0, 0, wide-15, tall); - m_ScrollBar.setBounds(wide-15, 0, 15, tall); + m_ItemsPanel.setBounds( 0, 0, wide - 15, tall ); + m_ScrollBar.setBounds( wide - 15, 0, 15, tall ); bool bNeedScrollbar = false; @@ -145,31 +146,32 @@ void CListBox::InternalLayout() int curItem = 0; int curY = 0; int maxItem = GetScrollMax(); - for(LBItem *pItem=m_Items.m_pNext; pItem != &m_Items; pItem=pItem->m_pNext) + for( LBItem *pItem = m_Items.m_pNext; pItem != &m_Items; pItem = pItem->m_pNext ) { - if(curItem < m_ItemOffset) + if( curItem < m_ItemOffset ) { - pItem->m_pPanel->setVisible(false); + pItem->m_pPanel->setVisible( false ); bNeedScrollbar = true; } - else if (curItem >= maxItem) + else if( curItem >= maxItem ) { // item is past the end of the items we care about - pItem->m_pPanel->setVisible(false); + pItem->m_pPanel->setVisible( false ); } else { - pItem->m_pPanel->setVisible(true); + pItem->m_pPanel->setVisible( true ); int itemWidth, itemHeight; - pItem->m_pPanel->getSize(itemWidth, itemHeight); + + pItem->m_pPanel->getSize( itemWidth, itemHeight ); // Don't change the item's height but change its width to fit the listbox. - pItem->m_pPanel->setBounds(0, curY, wide, itemHeight); + pItem->m_pPanel->setBounds( 0, curY, wide, itemHeight ); curY += itemHeight; - if (curY > tall) + if( curY > tall ) { bNeedScrollbar = true; } @@ -178,7 +180,7 @@ void CListBox::InternalLayout() ++curItem; } - m_ScrollBar.setVisible(bNeedScrollbar); + m_ScrollBar.setVisible( bNeedScrollbar ); repaint(); } @@ -187,16 +189,16 @@ void CListBox::paintBackground() { } -void CListBox::SetScrollRange(int maxScroll) +void CListBox::SetScrollRange( int maxScroll ) { m_iScrollMax = maxScroll; - m_ScrollBar.setRange(0, maxScroll); + m_ScrollBar.setRange( 0, maxScroll ); InternalLayout(); } -int CListBox::GetScrollMax() +int CListBox::GetScrollMax() { - if (m_iScrollMax < 0) + if( m_iScrollMax < 0 ) { return GetNumItems() - 1; } @@ -204,4 +206,3 @@ int CListBox::GetScrollMax() return m_iScrollMax; } - diff --git a/game_shared/vgui_listbox.h b/game_shared/vgui_listbox.h index 9b245b4c..a97c780d 100644 --- a/game_shared/vgui_listbox.h +++ b/game_shared/vgui_listbox.h @@ -5,19 +5,17 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VOICE_LISTBOX_H) +#ifndef VOICE_LISTBOX_H #define VOICE_LISTBOX_H #include "VGUI_Panel.h" #include "VGUI_IntChangeSignal.h" -#include "VGUI_Slider2.h" -#include "VGUI_ScrollBar2.h" - +#include "vgui_slider2.h" +#include "vgui_scrollbar2.h" namespace vgui { - // Listbox class used by voice code. Based off of vgui's list panel but with some modifications: // - This listbox clips its child items to its rectangle. // - You can access things like the scrollbar and find out the item width. @@ -27,45 +25,39 @@ namespace vgui class CListBox : public Panel { public: - - CListBox(); - ~CListBox(); + CListBox(); + ~CListBox(); - void Init(); - void Term(); + void Init(); + void Term(); // Add an item to the listbox. This automatically sets the item's parent to the listbox // and resizes the item's width to fit within the listbox. - void AddItem(Panel *pPanel); + void AddItem( Panel *pPanel ); // Get the number of items currently in the listbox. - int GetNumItems(); + int GetNumItems(); // Get the width that listbox items will be set to (this changes if you resize the listbox). - int GetItemWidth(); + int GetItemWidth(); // Get/set the scrollbar position (position says which element is at the top of the listbox). - int GetScrollPos(); - void SetScrollPos(int pos); + int GetScrollPos(); + void SetScrollPos( int pos ); // sets the last item the listbox should scroll to // scroll to GetNumItems() if not set - void SetScrollRange(int maxScroll); + void SetScrollRange( int maxScroll ); // returns the maximum value the scrollbar can scroll to - int GetScrollMax(); + int GetScrollMax(); -// vgui overrides. -public: - - virtual void setPos(int x, int y); - virtual void setSize(int wide,int tall); - virtual void setPixelScroll(int value); + // vgui overrides. + virtual void setPos( int x, int y ); + virtual void setSize( int wide, int tall ); + virtual void setPixelScroll( int value ); virtual void paintBackground(); - - protected: - class LBItem { public: @@ -76,34 +68,29 @@ protected: class ListBoxSignal : public IntChangeSignal { public: - void intChanged(int value,Panel* panel) + void intChanged( int value, Panel *panel ) { - m_pListBox->setPixelScroll(-value); + m_pListBox->setPixelScroll( -value ); } vgui::CListBox *m_pListBox; }; - -protected: - - void InternalLayout(); - - -protected: + void InternalLayout(); // All the items.. - LBItem m_Items; + LBItem m_Items; - Panel m_ItemsPanel; + Panel m_ItemsPanel; - int m_ItemOffset; // where we're scrolled to - Slider2 m_Slider; - ScrollBar2 m_ScrollBar; + int m_ItemOffset; // where we're scrolled to + Slider2 m_Slider; + ScrollBar2 m_ScrollBar; ListBoxSignal m_Signal; - int m_iScrollMax; + int m_iScrollMax; }; } #endif // VOICE_LISTBOX_H + diff --git a/game_shared/vgui_loadtga.cpp b/game_shared/vgui_loadtga.cpp index 5c0d9189..bfd8ee7a 100644 --- a/game_shared/vgui_loadtga.cpp +++ b/game_shared/vgui_loadtga.cpp @@ -7,10 +7,9 @@ #include "../cl_dll/wrect.h" #include "../cl_dll/cl_dll.h" -#include "vgui.h" +#include "VGUI.h" #include "vgui_loadtga.h" -#include "vgui_inputstream.h" - +#include "VGUI_InputStream.h" // ---------------------------------------------------------------------- // // Helper class for loading tga files. @@ -18,76 +17,96 @@ class MemoryInputStream : public vgui::InputStream { public: - MemoryInputStream() - { - m_pData = NULL; - m_DataLen = m_ReadPos = 0; - } - - virtual void seekStart(bool& success) {m_ReadPos=0; success=true;} - virtual void seekRelative(int count,bool& success) {m_ReadPos+=count; success=true;} - virtual void seekEnd(bool& success) {m_ReadPos=m_DataLen; success=true;} - virtual int getAvailable(bool& success) {success=false; return 0;} // This is what vgui does for files... - - virtual uchar readUChar(bool& success) + MemoryInputStream() { - if(m_ReadPos>=0 && m_ReadPos= 0 && m_ReadPos < m_DataLen ) { - success=true; + success = true; uchar ret = m_pData[m_ReadPos]; ++m_ReadPos; return ret; } else { - success=false; + success = false; return 0; } } - virtual void readUChar(uchar* buf,int count,bool& success) + virtual void readUChar( uchar *buf, int count, bool &success ) { - for(int i=0; i < count; i++) - buf[i] = readUChar(success); + for( int i = 0; i < count; i++) + buf[i] = readUChar( success ); } - virtual void close(bool& success) + virtual void close( bool &success) { m_pData = NULL; m_DataLen = m_ReadPos = 0; } - uchar *m_pData; - int m_DataLen; - int m_ReadPos; + uchar *m_pData; + int m_DataLen; + int m_ReadPos; }; -vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename) +vgui::BitmapTGA *vgui_LoadTGA( char const *pFilename ) { MemoryInputStream stream; - stream.m_pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &stream.m_DataLen); - if(!stream.m_pData) + stream.m_pData = gEngfuncs.COM_LoadFile( (char*)pFilename, 5, &stream.m_DataLen ); + if( !stream.m_pData ) return NULL; stream.m_ReadPos = 0; - vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, true); - gEngfuncs.COM_FreeFile(stream.m_pData); - + vgui::BitmapTGA *pRet = new vgui::BitmapTGA( &stream, true ); + gEngfuncs.COM_FreeFile( stream.m_pData ); + return pRet; } -vgui::BitmapTGA* vgui_LoadTGANoInvertAlpha(char const *pFilename) +vgui::BitmapTGA *vgui_LoadTGANoInvertAlpha( char const *pFilename ) { MemoryInputStream stream; - - stream.m_pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &stream.m_DataLen); - if(!stream.m_pData) + + stream.m_pData = gEngfuncs.COM_LoadFile( (char*)pFilename, 5, &stream.m_DataLen ); + if( !stream.m_pData ) return NULL; - + stream.m_ReadPos = 0; - vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, false); - gEngfuncs.COM_FreeFile(stream.m_pData); + vgui::BitmapTGA *pRet = new vgui::BitmapTGA( &stream, false ); + gEngfuncs.COM_FreeFile( stream.m_pData ); return pRet; } diff --git a/game_shared/vgui_loadtga.h b/game_shared/vgui_loadtga.h index ea0ecac2..26505b18 100644 --- a/game_shared/vgui_loadtga.h +++ b/game_shared/vgui_loadtga.h @@ -5,12 +5,12 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VGUI_LOADTGA_H) +#ifndef VGUI_LOADTGA_H #define VGUI_LOADTGA_H -#include "vgui_bitmaptga.h" +#include "VGUI_BitmapTGA.h" - -vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename); -vgui::BitmapTGA* vgui_LoadTGANoInvertAlpha(char const *pFilename); +vgui::BitmapTGA *vgui_LoadTGA( char const *pFilename ); +vgui::BitmapTGA *vgui_LoadTGANoInvertAlpha( char const *pFilename ); #endif // VGUI_LOADTGA_H + diff --git a/game_shared/vgui_scrollbar2.cpp b/game_shared/vgui_scrollbar2.cpp index 3f3194bc..805bb191 100644 --- a/game_shared/vgui_scrollbar2.cpp +++ b/game_shared/vgui_scrollbar2.cpp @@ -1,58 +1,56 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= - -#include "VGUI_ScrollBar2.h" -#include "VGUI_Slider2.h" +#include "vgui_scrollbar2.h" +#include "vgui_slider2.h" #include "vgui_loadtga.h" -#include -#include -#include -#include +#include +#include +#include +#include using namespace vgui; - namespace { class FooDefaultScrollBarIntChangeSignal : public IntChangeSignal { public: - FooDefaultScrollBarIntChangeSignal(ScrollBar2* scrollBar) + FooDefaultScrollBarIntChangeSignal( ScrollBar2 *scrollBar ) { - _scrollBar=scrollBar; + _scrollBar = scrollBar; } - virtual void intChanged(int value,Panel* panel) + + virtual void intChanged( int value, Panel *panel ) { _scrollBar->fireIntChangeSignal(); } protected: - ScrollBar2* _scrollBar; + ScrollBar2 *_scrollBar; }; class FooDefaultButtonSignal : public ActionSignal { public: - ScrollBar2* _scrollBar; - int _buttonIndex; -public: - FooDefaultButtonSignal(ScrollBar2* scrollBar,int buttonIndex) + ScrollBar2 *_scrollBar; + int _buttonIndex; + + FooDefaultButtonSignal( ScrollBar2 *scrollBar, int buttonIndex ) { - _scrollBar=scrollBar; - _buttonIndex=buttonIndex; + _scrollBar = scrollBar; + _buttonIndex = buttonIndex; } -public: - virtual void actionPerformed(Panel* panel) + + virtual void actionPerformed( Panel *panel ) { - _scrollBar->doButtonPressed(_buttonIndex); + _scrollBar->doButtonPressed( _buttonIndex ); } }; - } //----------------------------------------------------------------------------- @@ -65,32 +63,29 @@ private: LineBorder m_Border; public: - ScrollBarButton(const char *filename, int x, int y, int wide, int tall) : m_Border(Color(60, 60, 60, 0)), Button("", x, y, wide, tall) + ScrollBarButton( const char *filename, int x, int y, int wide, int tall ) : m_Border( Color( 60, 60, 60, 0 ) ), Button( "", x, y, wide, tall ) { - Image *image = vgui_LoadTGA(filename); - if (image) + Image *image = vgui_LoadTGA( filename ); + if( image ) { - image->setColor(Color(140, 140, 140, 0)); - setImage(image); + image->setColor( Color( 140, 140, 140, 0 ) ); + setImage( image ); } - setBorder(&m_Border); + setBorder( &m_Border ); } virtual void paintBackground() { - int wide,tall; - getPaintSize(wide,tall); + int wide, tall; + getPaintSize( wide, tall ); // fill the background - drawSetColor(0, 0, 0, 0); - drawFilledRect(0, 0, wide, tall); + drawSetColor( 0, 0, 0, 0 ); + drawFilledRect( 0, 0, wide, tall ); } }; - - - //----------------------------------------------------------------------------- // Purpose: Constructor // Input : x - @@ -99,68 +94,68 @@ public: // tall - // vertical - //----------------------------------------------------------------------------- -ScrollBar2::ScrollBar2(int x,int y,int wide,int tall,bool vertical) : Panel(x,y,wide,tall) +ScrollBar2::ScrollBar2( int x, int y, int wide, int tall, bool vertical ) : Panel( x, y, wide, tall ) { - _slider=null; - _button[0]=null; - _button[1]=null; + _slider = null; + _button[0] = null; + _button[1] = null; - if(vertical) + if( vertical ) { - setSlider(new Slider2(0,wide-1,wide,(tall-(wide*2))+2,true)); - setButton(new ScrollBarButton("gfx/vgui/arrowup.tga",0,0,wide,wide),0); - setButton(new ScrollBarButton("gfx/vgui/arrowdown.tga",0,tall-wide,wide,wide),1); + setSlider( new Slider2( 0, wide - 1, wide, ( tall - ( wide * 2 ) ) + 2, true ) ); + setButton( new ScrollBarButton( "gfx/vgui/arrowup.tga", 0, 0, wide, wide ), 0 ); + setButton( new ScrollBarButton( "gfx/vgui/arrowdown.tga", 0, tall - wide, wide, wide ), 1 ); } else { // untested code - setSlider(new Slider2(tall,0,wide-(tall*2),tall,false)); - setButton(new ScrollBarButton("gfx/vgui/320_arrowlt.tga",0,0,tall+1,tall+1),0); - setButton(new ScrollBarButton("gfx/vgui/320_arrowrt.tga",wide-tall,0,tall+1,tall+1),1); + setSlider( new Slider2( tall, 0, wide - ( tall * 2 ), tall, false ) ); + setButton( new ScrollBarButton( "gfx/vgui/320_arrowlt.tga", 0, 0, tall + 1, tall + 1 ), 0 ); + setButton( new ScrollBarButton( "gfx/vgui/320_arrowrt.tga", wide - tall, 0, tall + 1, tall + 1 ) , 1 ); } - setPaintBorderEnabled(true); - setPaintBackgroundEnabled(true); - setPaintEnabled(true); - setButtonPressedScrollValue(15); + setPaintBorderEnabled( true ); + setPaintBackgroundEnabled( true ); + setPaintEnabled( true ); + setButtonPressedScrollValue( 15 ); validate(); - } +} -void ScrollBar2::setSize(int wide,int tall) +void ScrollBar2::setSize( int wide, int tall ) { - Panel::setSize(wide,tall); + Panel::setSize( wide, tall ); - if(_slider==null) + if( _slider == null ) { return; } - if(_button[0]==null) + if( _button[0] == null ) { return; } - if(_button[1]==null) + if( _button[1] == null ) { return; } - getPaintSize(wide,tall); + getPaintSize( wide, tall ); - if(_slider->isVertical()) + if( _slider->isVertical() ) { - _slider->setBounds(0,wide,wide,tall-(wide*2)); - //_slider->setBounds(0,0,wide,tall); - _button[0]->setBounds(0,0,wide,wide); - _button[1]->setBounds(0,tall-wide,wide,wide); + _slider->setBounds( 0, wide, wide, tall - ( wide * 2 ) ); + // _slider->setBounds( 0, 0, wide, tall ); + _button[0]->setBounds( 0, 0, wide, wide ); + _button[1]->setBounds( 0, tall - wide, wide, wide ); } else { - _slider->setBounds(tall,0,wide-(tall*2),tall); - //_slider->setBounds(0,0,wide,tall); - _button[0]->setBounds(0,0,tall,tall); - _button[1]->setBounds((wide-tall),0,tall,tall); + _slider->setBounds( tall, 0, wide - ( tall * 2 ), tall ); + // _slider->setBounds( 0, 0, wide, tall ); + _button[0]->setBounds( 0, 0, tall, tall ); + _button[1]->setBounds( ( wide - tall ), 0, tall, tall); } } @@ -168,9 +163,9 @@ void ScrollBar2::performLayout() { } -void ScrollBar2::setValue(int value) +void ScrollBar2::setValue( int value ) { - _slider->setValue(value); + _slider->setValue( value ); } int ScrollBar2::getValue() @@ -178,22 +173,22 @@ int ScrollBar2::getValue() return _slider->getValue(); } -void ScrollBar2::addIntChangeSignal(IntChangeSignal* s) +void ScrollBar2::addIntChangeSignal( IntChangeSignal *s ) { - _intChangeSignalDar.putElement(s); - _slider->addIntChangeSignal(new FooDefaultScrollBarIntChangeSignal(this)); + _intChangeSignalDar.putElement( s ); + _slider->addIntChangeSignal( new FooDefaultScrollBarIntChangeSignal( this ) ); } -void ScrollBar2::setRange(int min,int max) +void ScrollBar2::setRange( int min, int max ) { - _slider->setRange(min,max); + _slider->setRange( min, max ); } void ScrollBar2::fireIntChangeSignal() { - for(int i=0;i<_intChangeSignalDar.getCount();i++) + for( int i = 0; i < _intChangeSignalDar.getCount(); i++ ) { - _intChangeSignalDar[i]->intChanged(_slider->getValue(),this); + _intChangeSignalDar[i]->intChanged( _slider->getValue(), this ); } } @@ -207,39 +202,41 @@ bool ScrollBar2::hasFullRange() return _slider->hasFullRange(); } -//LEAK: new and old slider will leak -void ScrollBar2::setButton(Button* button,int index) +// LEAK: new and old slider will leak +void ScrollBar2::setButton( Button *button, int index ) { - if(_button[index]!=null) + if( _button[index] != null ) { - removeChild(_button[index]); + removeChild( _button[index] ); } - _button[index]=button; - addChild(_button[index]); - _button[index]->addActionSignal(new FooDefaultButtonSignal(this,index)); + _button[index] = button; + addChild( _button[index] ); + + _button[index]->addActionSignal( new FooDefaultButtonSignal( this, index ) ); validate(); - //_button[index]->setVisible(false); + // _button[index]->setVisible( false ); } -Button* ScrollBar2::getButton(int index) +Button *ScrollBar2::getButton( int index ) { return _button[index]; } -//LEAK: new and old slider will leak -void ScrollBar2::setSlider(Slider2 *slider) +// LEAK: new and old slider will leak +void ScrollBar2::setSlider( Slider2 *slider ) { - if(_slider!=null) + if( _slider != null ) { - removeChild(_slider); + removeChild( _slider ); } - _slider=slider; - addChild(_slider); - _slider->addIntChangeSignal(new FooDefaultScrollBarIntChangeSignal(this)); + _slider = slider; + addChild( _slider ); + + _slider->addIntChangeSignal( new FooDefaultScrollBarIntChangeSignal( this ) ); validate(); } @@ -249,62 +246,62 @@ Slider2 *ScrollBar2::getSlider() return _slider; } -void ScrollBar2::doButtonPressed(int buttonIndex) +void ScrollBar2::doButtonPressed( int buttonIndex ) { - if(buttonIndex==0) + if( buttonIndex == 0 ) { - _slider->setValue(_slider->getValue()-_buttonPressedScrollValue); + _slider->setValue( _slider->getValue() - _buttonPressedScrollValue ); } else { - _slider->setValue(_slider->getValue()+_buttonPressedScrollValue); + _slider->setValue( _slider->getValue() + _buttonPressedScrollValue ); } - } -void ScrollBar2::setButtonPressedScrollValue(int value) +void ScrollBar2::setButtonPressedScrollValue( int value ) { - _buttonPressedScrollValue=value; + _buttonPressedScrollValue = value; } -void ScrollBar2::setRangeWindow(int rangeWindow) +void ScrollBar2::setRangeWindow( int rangeWindow ) { - _slider->setRangeWindow(rangeWindow); + _slider->setRangeWindow( rangeWindow ); } -void ScrollBar2::setRangeWindowEnabled(bool state) +void ScrollBar2::setRangeWindowEnabled( bool state ) { - _slider->setRangeWindowEnabled(state); + _slider->setRangeWindowEnabled( state ); } void ScrollBar2::validate() { - if(_slider!=null) + if( _slider != null ) { - int buttonOffset=0; + int buttonOffset = 0; - for(int i=0;i<2;i++) + for( int i = 0; i < 2; i++ ) { - if(_button[i]!=null) + if( _button[i] != null ) { - if(_button[i]->isVisible()) + if( _button[i]->isVisible() ) { - if(_slider->isVertical()) - { - buttonOffset+=_button[i]->getTall(); + if( _slider->isVertical() ) + { + buttonOffset += _button[i]->getTall(); } else { - buttonOffset+=_button[i]->getWide(); + buttonOffset += _button[i]->getWide(); } } } } - _slider->setButtonOffset(buttonOffset); + _slider->setButtonOffset( buttonOffset ); } - int wide,tall; - getSize(wide,tall); - setSize(wide,tall); + int wide, tall; + + getSize( wide, tall ); + setSize( wide, tall ); } diff --git a/game_shared/vgui_scrollbar2.h b/game_shared/vgui_scrollbar2.h index 16fe8a46..71cd965b 100644 --- a/game_shared/vgui_scrollbar2.h +++ b/game_shared/vgui_scrollbar2.h @@ -5,16 +5,15 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VGUI_SCROLLBAR2_H) +#ifndef VGUI_SCROLLBAR2_H #define VGUI_SCROLLBAR2_H -#include -#include -#include +#include +#include +#include namespace vgui { - class IntChangeSignal; class Button; class Slider2; @@ -25,34 +24,34 @@ class Slider2; class VGUIAPI ScrollBar2 : public Panel { public: - ScrollBar2(int x,int y,int wide,int tall,bool vertical); -public: - virtual void setValue(int value); - virtual int getValue(); - virtual void addIntChangeSignal(IntChangeSignal* s); - virtual void setRange(int min,int max); - virtual void setRangeWindow(int rangeWindow); - virtual void setRangeWindowEnabled(bool state); - virtual void setSize(int wide,int tall); - virtual bool isVertical(); - virtual bool hasFullRange(); - virtual void setButton(Button *button,int index); - virtual Button* getButton(int index); - virtual void setSlider(Slider2 *slider); - virtual Slider2 *getSlider(); - virtual void doButtonPressed(int buttonIndex); - virtual void setButtonPressedScrollValue(int value); - virtual void validate(); -public: //bullshit public - virtual void fireIntChangeSignal(); -protected: - virtual void performLayout(); -protected: - Button* _button[2]; - Slider2 *_slider; - Dar _intChangeSignalDar; - int _buttonPressedScrollValue; -}; + ScrollBar2( int x, int y, int wide, int tall, bool vertical ); + virtual void setValue( int value ); + virtual int getValue(); + virtual void addIntChangeSignal( IntChangeSignal *s ); + virtual void setRange(int min, int max ); + virtual void setRangeWindow( int rangeWindow ); + virtual void setRangeWindowEnabled( bool state ); + virtual void setSize( int wide, int tall ); + virtual bool isVertical(); + virtual bool hasFullRange(); + virtual void setButton( Button *button,int index ); + virtual Button *getButton( int index ); + virtual void setSlider( Slider2 *slider ); + virtual Slider2 *getSlider(); + virtual void doButtonPressed( int buttonIndex ); + virtual void setButtonPressedScrollValue( int value ); + virtual void validate(); + // bullshit public + virtual void fireIntChangeSignal(); +protected: + virtual void performLayout(); + + Button *_button[2]; + Slider2 *_slider; + Dar _intChangeSignalDar; + int _buttonPressedScrollValue; +}; } #endif // VGUI_SCROLLBAR2_H + diff --git a/game_shared/vgui_slider2.cpp b/game_shared/vgui_slider2.cpp index 801f5c00..d7e2c564 100644 --- a/game_shared/vgui_slider2.cpp +++ b/game_shared/vgui_slider2.cpp @@ -5,12 +5,12 @@ // $NoKeywords: $ //============================================================================= -#include "VGUI_Slider2.h" +#include "vgui_slider2.h" -#include -#include -#include -#include +#include +#include +#include +#include using namespace vgui; @@ -18,54 +18,57 @@ namespace { class FooDefaultSliderSignal : public InputSignal { -private: - Slider2* _slider; + Slider2 *_slider; public: - FooDefaultSliderSignal(Slider2* slider) + FooDefaultSliderSignal( Slider2 *slider ) { - _slider=slider; + _slider = slider; } -public: - void cursorMoved(int x,int y,Panel* panel) + + void cursorMoved( int x, int y, Panel *panel ) { - _slider->privateCursorMoved(x,y,panel); + _slider->privateCursorMoved( x, y, panel ); } - void cursorEntered(Panel* panel){} - void cursorExited(Panel* panel){} - void mouseDoublePressed(MouseCode code,Panel* panel){} - void mousePressed(MouseCode code,Panel* panel) + + void cursorEntered( Panel *panel ) {} + void cursorExited( Panel *panel ) {} + void mouseDoublePressed( MouseCode code, Panel *panel ) {} + + void mousePressed( MouseCode code, Panel *panel ) { - _slider->privateMousePressed(code,panel); + _slider->privateMousePressed( code, panel ); } - void mouseReleased(MouseCode code,Panel* panel) + + void mouseReleased( MouseCode code, Panel *panel ) { - _slider->privateMouseReleased(code,panel); + _slider->privateMouseReleased( code, panel ); } - void mouseWheeled(int delta,Panel* panel){} - void keyPressed(KeyCode code,Panel* panel){} - void keyTyped(KeyCode code,Panel* panel){} - void keyReleased(KeyCode code,Panel* panel){} - void keyFocusTicked(Panel* panel){} + + void mouseWheeled( int delta, Panel *panel ) {} + void keyPressed( KeyCode code, Panel *panel ) {} + void keyTyped( KeyCode code, Panel *panel ) {} + void keyReleased( KeyCode code, Panel *panel ) {} + void keyFocusTicked( Panel *panel ) {} }; } -Slider2::Slider2(int x,int y,int wide,int tall,bool vertical) : Panel(x,y,wide,tall) +Slider2::Slider2( int x, int y, int wide, int tall, bool vertical ) : Panel( x, y, wide, tall ) { - _vertical=vertical; - _dragging=false; - _value=0; - _range[0]=0; - _range[1]=299; - _rangeWindow=0; - _rangeWindowEnabled=false; - _buttonOffset=0; + _vertical = vertical; + _dragging = false; + _value = 0; + _range[0] = 0; + _range[1] = 299; + _rangeWindow = 0; + _rangeWindowEnabled = false; + _buttonOffset = 0; recomputeNobPosFromValue(); - addInputSignal(new FooDefaultSliderSignal(this)); + addInputSignal( new FooDefaultSliderSignal( this ) ); } -void Slider2::setSize(int wide,int tall) +void Slider2::setSize( int wide, int tall ) { - Panel::setSize(wide,tall); + Panel::setSize( wide, tall ); recomputeNobPosFromValue(); } @@ -74,24 +77,24 @@ bool Slider2::isVertical() return _vertical; } -void Slider2::setValue(int value) +void Slider2::setValue( int value ) { - int oldValue=_value; + int oldValue = _value; - if(value<_range[0]) + if( value < _range[0] ) { - value=_range[0]; + value = _range[0]; } - if(value>_range[1]) + if( value > _range[1] ) { value=_range[1]; } - _value=value; + _value = value; recomputeNobPosFromValue(); - if(_value!=oldValue) + if( _value != oldValue ) { fireIntChangeSignal(); } @@ -104,48 +107,48 @@ int Slider2::getValue() void Slider2::recomputeNobPosFromValue() { - int wide,tall; + int wide, tall; - getPaintSize(wide,tall); + getPaintSize( wide, tall ); - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float fvalue=(float)(_value-_range[0]); - float fper=fvalue/frange; - float frangewindow=(float)(_rangeWindow); + float fwide = (float)wide; + float ftall = (float)tall; + float frange = (float)(_range[1] - _range[0]); + float fvalue = (float)(_value - _range[0]); + float fper = fvalue / frange; + float frangewindow = (float)_rangeWindow; - if(frangewindow<0) + if( frangewindow < 0 ) { - frangewindow=0; + frangewindow = 0; } - if(!_rangeWindowEnabled) + if( !_rangeWindowEnabled ) { - frangewindow=frange; + frangewindow = frange; } - if ( frangewindow > 0 ) + if( frangewindow > 0 ) { - if(_vertical) + if( _vertical ) { float fnobsize=frangewindow; float freepixels = ftall - fnobsize; float firstpixel = freepixels * fper; - _nobPos[0]=(int)( firstpixel ); - _nobPos[1]=(int)( firstpixel + fnobsize ); + _nobPos[0] = (int)( firstpixel ); + _nobPos[1] = (int)( firstpixel + fnobsize ); - if(_nobPos[1]>tall) + if( _nobPos[1] > tall ) { - _nobPos[0]=tall-((int)fnobsize); - _nobPos[1]=tall; + _nobPos[0] = tall - ((int)fnobsize); + _nobPos[1] = tall; } } else { - float fnobsize=frangewindow; + float fnobsize = frangewindow; float freepixels = fwide - fnobsize; float firstpixel = freepixels * fper; @@ -153,10 +156,10 @@ void Slider2::recomputeNobPosFromValue() _nobPos[0]=(int)( firstpixel ); _nobPos[1]=(int)( firstpixel + fnobsize ); - if(_nobPos[1]>wide) + if( _nobPos[1] > wide ) { - _nobPos[0]=wide-((int)fnobsize); - _nobPos[1]=wide; + _nobPos[0] = wide - ((int)fnobsize); + _nobPos[1] = wide; } } } @@ -167,40 +170,41 @@ void Slider2::recomputeNobPosFromValue() void Slider2::recomputeValueFromNobPos() { int wide,tall; - getPaintSize(wide,tall); - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float fvalue=(float)(_value-_range[0]); - float fnob=(float)_nobPos[0]; - float frangewindow=(float)(_rangeWindow); + getPaintSize( wide, tall ); - if(frangewindow<0) + float fwide = (float)wide; + float ftall = (float)tall; + float frange = (float)(_range[1] - _range[0]); + float fvalue = (float)(_value - _range[0]); + float fnob = (float)_nobPos[0]; + float frangewindow = (float)(_rangeWindow); + + if( frangewindow < 0 ) { - frangewindow=0; + frangewindow = 0; } - if(!_rangeWindowEnabled) + if( !_rangeWindowEnabled ) { - frangewindow=frange; + frangewindow = frange; } - if ( frangewindow > 0 ) + if( frangewindow > 0 ) { - if(_vertical) + if( _vertical ) { - float fnobsize=frangewindow; - fvalue=frange*(fnob/(ftall-fnobsize)); + float fnobsize = frangewindow; + fvalue = frange * ( fnob / ( ftall - fnobsize ) ); } else { - float fnobsize=frangewindow; - fvalue=frange*(fnob/(fwide-fnobsize)); + float fnobsize = frangewindow; + fvalue = frange * ( fnob / ( fwide - fnobsize ) ); } } // Take care of rounding issues. - _value=(int)(fvalue+_range[0]+0.5); + _value = (int)( fvalue+_range[0] + 0.5 ); // Clamp final result _value = ( _value < _range[1] ) ? _value : _range[1]; @@ -208,27 +212,28 @@ void Slider2::recomputeValueFromNobPos() bool Slider2::hasFullRange() { - int wide,tall; - getPaintSize(wide,tall); + int wide, tall; - float fwide=(float)wide; - float ftall=(float)tall; - float frange=(float)(_range[1]-_range[0]); - float frangewindow=(float)(_rangeWindow); + getPaintSize( wide, tall ); - if(frangewindow<0) + float fwide = (float)wide; + float ftall = (float)tall; + float frange = (float)( _range[1] - _range[0] ); + float frangewindow = (float)( _rangeWindow ); + + if( frangewindow < 0 ) { - frangewindow=0; + frangewindow = 0; } - if(!_rangeWindowEnabled) + if( !_rangeWindowEnabled ) { - frangewindow=frange; + frangewindow = frange; } - if ( frangewindow > 0 ) + if( frangewindow > 0 ) { - if(_vertical) + if( _vertical ) { if( frangewindow <= ( ftall + _buttonOffset ) ) { @@ -247,126 +252,125 @@ bool Slider2::hasFullRange() return false; } -void Slider2::addIntChangeSignal(IntChangeSignal* s) +void Slider2::addIntChangeSignal( IntChangeSignal *s ) { _intChangeSignalDar.putElement(s); } void Slider2::fireIntChangeSignal() { - for(int i=0;i<_intChangeSignalDar.getCount();i++) + for( int i = 0; i < _intChangeSignalDar.getCount(); i++ ) { - _intChangeSignalDar[i]->intChanged(getValue(),this); + _intChangeSignalDar[i]->intChanged( getValue(), this ); } } void Slider2::paintBackground() { - int wide,tall; - getPaintSize(wide,tall); + int wide, tall; + getPaintSize( wide, tall ); - if (_vertical) + if( _vertical ) { // background behind slider - drawSetColor(40, 40, 40, 0); - drawFilledRect(0, 0, wide, tall); + drawSetColor( 40, 40, 40, 0 ); + drawFilledRect( 0, 0, wide, tall ); // slider front - drawSetColor(0, 0, 0, 0); - drawFilledRect(0,_nobPos[0],wide,_nobPos[1]); + drawSetColor( 0, 0, 0, 0 ); + drawFilledRect( 0, _nobPos[0], wide, _nobPos[1] ); // slider border - drawSetColor(60, 60, 60, 0); - drawFilledRect(0,_nobPos[0],wide,_nobPos[0]+1); // top - drawFilledRect(0,_nobPos[1],wide,_nobPos[1]+1); // bottom - drawFilledRect(0,_nobPos[0]+1,1,_nobPos[1]); // left - drawFilledRect(wide-1,_nobPos[0]+1,wide,_nobPos[1]); // right + drawSetColor( 60, 60, 60, 0 ); + drawFilledRect( 0, _nobPos[0], wide, _nobPos[0] + 1 ); // top + drawFilledRect( 0, _nobPos[1], wide, _nobPos[1] + 1 ); // bottom + drawFilledRect( 0, _nobPos[0] + 1, 1, _nobPos[1] ); // left + drawFilledRect( wide - 1, _nobPos[0] + 1, wide, _nobPos[1] ); // right } else { //!! doesn't work + drawSetColor( Scheme::sc_secondary3 ); + drawFilledRect( 0, 0, wide, tall ); - drawSetColor(Scheme::sc_secondary3); - drawFilledRect(0,0,wide,tall); + drawSetColor( Scheme::sc_black ); + drawOutlinedRect( 0, 0, wide, tall ); - drawSetColor(Scheme::sc_black); - drawOutlinedRect(0,0,wide,tall); - - drawSetColor(Scheme::sc_primary2); - drawFilledRect(_nobPos[0],0,_nobPos[1],tall); + drawSetColor( Scheme::sc_primary2 ); + drawFilledRect( _nobPos[0], 0, _nobPos[1], tall ); - drawSetColor(Scheme::sc_black); - drawOutlinedRect(_nobPos[0],0,_nobPos[1],tall); + drawSetColor( Scheme::sc_black ); + drawOutlinedRect( _nobPos[0], 0, _nobPos[1], tall ); } } -void Slider2::setRange(int min,int max) +void Slider2::setRange( int min, int max ) { - if(maxmax) + if( min > max ) { - min=max; + min = max; } - _range[0]=min; - _range[1]=max; + _range[0] = min; + _range[1] = max; } -void Slider2::getRange(int& min,int& max) +void Slider2::getRange( int &min, int &max ) { - min=_range[0]; - max=_range[1]; + min = _range[0]; + max = _range[1]; } -void Slider2::privateCursorMoved(int x,int y,Panel* panel) +void Slider2::privateCursorMoved( int x, int y, Panel *panel ) { - if(!_dragging) + if( !_dragging ) { return; } - getApp()->getCursorPos(x,y); - screenToLocal(x,y); + getApp()->getCursorPos( x, y ); + screenToLocal( x, y ); - int wide,tall; - getPaintSize(wide,tall); + int wide, tall; + getPaintSize( wide, tall); - if(_vertical) + if( _vertical ) { - _nobPos[0]=_nobDragStartPos[0]+(y-_dragStartPos[1]); - _nobPos[1]=_nobDragStartPos[1]+(y-_dragStartPos[1]); + _nobPos[0] = _nobDragStartPos[0] + ( y - _dragStartPos[1] ); + _nobPos[1] = _nobDragStartPos[1] + ( y - _dragStartPos[1] ); - if(_nobPos[1]>tall) + if( _nobPos[1] > tall ) { - _nobPos[0]=tall-(_nobPos[1]-_nobPos[0]); - _nobPos[1]=tall; + _nobPos[0] = tall - ( _nobPos[1] - _nobPos[0] ); + _nobPos[1] = tall; } - - if(_nobPos[0]<0) + + if( _nobPos[0] < 0 ) { - _nobPos[1]=_nobPos[1]-_nobPos[0]; - _nobPos[0]=0; + _nobPos[1] = _nobPos[1] - _nobPos[0]; + _nobPos[0] = 0; } } else { - _nobPos[0]=_nobDragStartPos[0]+(x-_dragStartPos[0]); - _nobPos[1]=_nobDragStartPos[1]+(x-_dragStartPos[0]); + _nobPos[0] = _nobDragStartPos[0] + ( x - _dragStartPos[0] ); + _nobPos[1] = _nobDragStartPos[1] + ( x - _dragStartPos[0] ); - if(_nobPos[1]>wide) + if( _nobPos[1] > wide ) { - _nobPos[0]=wide-(_nobPos[1]-_nobPos[0]); - _nobPos[1]=wide; + _nobPos[0] = wide - ( _nobPos[1] - _nobPos[0] ); + _nobPos[1] = wide; } - - if(_nobPos[0]<0) + + if( _nobPos[0] < 0 ) { - _nobPos[1]=_nobPos[1]-_nobPos[0]; - _nobPos[0]=0; + _nobPos[1] = _nobPos[1] - _nobPos[0]; + _nobPos[0] = 0; } } @@ -375,62 +379,61 @@ void Slider2::privateCursorMoved(int x,int y,Panel* panel) fireIntChangeSignal(); } -void Slider2::privateMousePressed(MouseCode code,Panel* panel) +void Slider2::privateMousePressed( MouseCode code, Panel *panel ) { int x,y; - getApp()->getCursorPos(x,y); - screenToLocal(x,y); + getApp()->getCursorPos( x, y ); + screenToLocal( x, y ); - if(_vertical) + if( _vertical ) { - if((y>=_nobPos[0])&&(y<_nobPos[1])) + if( ( y >= _nobPos[0] ) && ( y < _nobPos[1] ) ) { - _dragging=true; - getApp()->setMouseCapture(this); - _nobDragStartPos[0]=_nobPos[0]; - _nobDragStartPos[1]=_nobPos[1]; - _dragStartPos[0]=x; - _dragStartPos[1]=y; + _dragging = true; + getApp()->setMouseCapture( this ); + _nobDragStartPos[0] = _nobPos[0]; + _nobDragStartPos[1] = _nobPos[1]; + _dragStartPos[0] = x; + _dragStartPos[1] = y; } } else { - if((x>=_nobPos[0])&&(x<_nobPos[1])) + if( ( x >= _nobPos[0] ) && ( x < _nobPos[1] ) ) { - _dragging=true; - getApp()->setMouseCapture(this); - _nobDragStartPos[0]=_nobPos[0]; - _nobDragStartPos[1]=_nobPos[1]; - _dragStartPos[0]=x; - _dragStartPos[1]=y; + _dragging = true; + getApp()->setMouseCapture( this ); + _nobDragStartPos[0] = _nobPos[0]; + _nobDragStartPos[1] = _nobPos[1]; + _dragStartPos[0] = x; + _dragStartPos[1] = y; } } - } -void Slider2::privateMouseReleased(MouseCode code,Panel* panel) +void Slider2::privateMouseReleased( MouseCode code, Panel *panel ) { - _dragging=false; - getApp()->setMouseCapture(null); + _dragging = false; + getApp()->setMouseCapture( null ); } -void Slider2::getNobPos(int& min, int& max) +void Slider2::getNobPos( int &min, int &max ) { - min=_nobPos[0]; - max=_nobPos[1]; + min = _nobPos[0]; + max = _nobPos[1]; } -void Slider2::setRangeWindow(int rangeWindow) +void Slider2::setRangeWindow( int rangeWindow ) { _rangeWindow=rangeWindow; } -void Slider2::setRangeWindowEnabled(bool state) +void Slider2::setRangeWindowEnabled( bool state ) { _rangeWindowEnabled=state; } -void Slider2::setButtonOffset(int buttonOffset) +void Slider2::setButtonOffset( int buttonOffset ) { _buttonOffset=buttonOffset; -} \ No newline at end of file +} diff --git a/game_shared/vgui_slider2.h b/game_shared/vgui_slider2.h index e421bba5..9f9388c8 100644 --- a/game_shared/vgui_slider2.h +++ b/game_shared/vgui_slider2.h @@ -5,22 +5,20 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VGUI_SLIDER2_H) +#ifndef VGUI_SLIDER2_H #define VGUI_SLIDER2_H -#include -#include -#include +#include +#include +#include namespace vgui { - enum MouseCode; class IntChangeSignal; class VGUIAPI Slider2 : public Panel { -private: bool _vertical; bool _dragging; int _nobPos[2]; @@ -33,31 +31,31 @@ private: bool _rangeWindowEnabled; int _buttonOffset; public: - Slider2(int x,int y,int wide,int tall,bool vertical); -public: - virtual void setValue(int value); + Slider2( int x, int y, int wide, int tall, bool vertical ); + + virtual void setValue( int value ); virtual int getValue(); virtual bool isVertical(); - virtual void addIntChangeSignal(IntChangeSignal* s); - virtual void setRange(int min,int max); - virtual void getRange(int& min,int& max); - virtual void setRangeWindow(int rangeWindow); - virtual void setRangeWindowEnabled(bool state); - virtual void setSize(int wide,int tall); - virtual void getNobPos(int& min, int& max); + virtual void addIntChangeSignal( IntChangeSignal *s ); + virtual void setRange( int min, int max ); + virtual void getRange( int &min, int &max ); + virtual void setRangeWindow( int rangeWindow ); + virtual void setRangeWindowEnabled( bool state ); + virtual void setSize( int wide, int tall ); + virtual void getNobPos( int &min, int &max ); virtual bool hasFullRange(); - virtual void setButtonOffset(int buttonOffset); + virtual void setButtonOffset( int buttonOffset ); private: virtual void recomputeNobPosFromValue(); virtual void recomputeValueFromNobPos(); -public: //bullshit public - virtual void privateCursorMoved(int x,int y,Panel* panel); - virtual void privateMousePressed(MouseCode code,Panel* panel); - virtual void privateMouseReleased(MouseCode code,Panel* panel); +public: // bullshit public + virtual void privateCursorMoved( int x, int y, Panel *panel ); + virtual void privateMousePressed( MouseCode code, Panel *panel ); + virtual void privateMouseReleased( MouseCode code, Panel *panel ); protected: - virtual void fireIntChangeSignal(); + virtual void fireIntChangeSignal(); virtual void paintBackground(); }; - } + #endif // VGUI_SLIDER2_H diff --git a/game_shared/voice_banmgr.cpp b/game_shared/voice_banmgr.cpp index 915e854f..f8241bf3 100644 --- a/game_shared/voice_banmgr.cpp +++ b/game_shared/voice_banmgr.cpp @@ -9,79 +9,73 @@ #include #include "voice_banmgr.h" - #define BANMGR_FILEVERSION 1 char const *g_pBanMgrFilename = "voice_ban.dt"; - - // Hash a player ID to a byte. -unsigned char HashPlayerID(char const playerID[16]) +unsigned char HashPlayerID( char const playerID[16] ) { unsigned char curHash = 0; - for(int i=0; i < 16; i++) + for( int i = 0; i < 16; i++ ) curHash += (unsigned char)playerID[i]; return curHash; } - - CVoiceBanMgr::CVoiceBanMgr() { Clear(); } - CVoiceBanMgr::~CVoiceBanMgr() { Term(); } - -bool CVoiceBanMgr::Init(char const *pGameDir) +bool CVoiceBanMgr::Init( char const *pGameDir ) { Term(); char filename[512]; - _snprintf(filename, sizeof(filename), "%s/%s", pGameDir, g_pBanMgrFilename); + sprintf( filename, "%s/%s", pGameDir, g_pBanMgrFilename ); // Load in the squelch file. - FILE *fp = fopen(filename, "rb"); - if(fp) + FILE *fp = fopen( filename, "rb" ); + if( fp ) { int version; - fread(&version, 1, sizeof(version), fp); - if(version == BANMGR_FILEVERSION) + fread( &version, 1, sizeof(version), fp ); + if( version == BANMGR_FILEVERSION ) { - fseek(fp, 0, SEEK_END); - int nIDs = (ftell(fp) - sizeof(version)) / 16; - fseek(fp, sizeof(version), SEEK_SET); + fseek( fp, 0, SEEK_END ); + int nIDs = ( ftell( fp ) - sizeof(version) ) / 16; + fseek( fp, sizeof(version), SEEK_SET ); - for(int i=0; i < nIDs; i++) + for( int i = 0; i < nIDs; i++ ) { char playerID[16]; - fread(playerID, 1, 16, fp); - AddBannedPlayer(playerID); - } + + fread( playerID, 1, 16, fp ); + AddBannedPlayer( playerID ); + } } - fclose(fp); + fclose( fp ); } return true; } - void CVoiceBanMgr::Term() { // Free all the player structures. - for(int i=0; i < 256; i++) + for( int i = 0; i < 256; i++ ) { BannedPlayer *pListHead = &m_PlayerHash[i]; BannedPlayer *pNext; - for(BannedPlayer *pCur=pListHead->m_pNext; pCur != pListHead; pCur=pNext) + + for( BannedPlayer *pCur=pListHead->m_pNext; pCur != pListHead; pCur = pNext ) { pNext = pCur->m_pNext; delete pCur; @@ -91,53 +85,51 @@ void CVoiceBanMgr::Term() Clear(); } - void CVoiceBanMgr::SaveState(char const *pGameDir) { // Save the file out. char filename[512]; - _snprintf(filename, sizeof(filename), "%s/%s", pGameDir, g_pBanMgrFilename); - FILE *fp = fopen(filename, "wb"); - if(fp) + sprintf( filename, "%s/%s", pGameDir, g_pBanMgrFilename ); + + FILE *fp = fopen( filename, "wb" ); + if( fp ) { int version = BANMGR_FILEVERSION; - fwrite(&version, 1, sizeof(version), fp); + fwrite( &version, 1, sizeof(version), fp ); - for(int i=0; i < 256; i++) + for( int i = 0; i < 256; i++ ) { BannedPlayer *pListHead = &m_PlayerHash[i]; - for(BannedPlayer *pCur=pListHead->m_pNext; pCur != pListHead; pCur=pCur->m_pNext) + for( BannedPlayer *pCur = pListHead->m_pNext; pCur != pListHead; pCur = pCur->m_pNext ) { - fwrite(pCur->m_PlayerID, 1, 16, fp); + fwrite( pCur->m_PlayerID, 1, 16, fp ); } } - fclose(fp); + fclose( fp ); } } - -bool CVoiceBanMgr::GetPlayerBan(char const playerID[16]) +bool CVoiceBanMgr::GetPlayerBan( char const playerID[16] ) { - return !!InternalFindPlayerSquelch(playerID); + return !!InternalFindPlayerSquelch( playerID ); } - -void CVoiceBanMgr::SetPlayerBan(char const playerID[16], bool bSquelch) +void CVoiceBanMgr::SetPlayerBan( char const playerID[16], bool bSquelch ) { - if(bSquelch) + if( bSquelch ) { // Is this guy already squelched? - if(GetPlayerBan(playerID)) + if( GetPlayerBan( playerID ) ) return; - - AddBannedPlayer(playerID); + + AddBannedPlayer( playerID ); } else { - BannedPlayer *pPlayer = InternalFindPlayerSquelch(playerID); - if(pPlayer) + BannedPlayer *pPlayer = InternalFindPlayerSquelch( playerID ); + if( pPlayer ) { pPlayer->m_pPrev->m_pNext = pPlayer->m_pNext; pPlayer->m_pNext->m_pPrev = pPlayer->m_pPrev; @@ -146,52 +138,51 @@ void CVoiceBanMgr::SetPlayerBan(char const playerID[16], bool bSquelch) } } - -void CVoiceBanMgr::ForEachBannedPlayer(void (*callback)(char id[16])) +void CVoiceBanMgr::ForEachBannedPlayer(void (*callback)( char id[16] ) ) { - for(int i=0; i < 256; i++) + for( int i = 0; i < 256; i++ ) { - for(BannedPlayer *pCur=m_PlayerHash[i].m_pNext; pCur != &m_PlayerHash[i]; pCur=pCur->m_pNext) + for( BannedPlayer *pCur = m_PlayerHash[i].m_pNext; pCur != &m_PlayerHash[i]; pCur = pCur->m_pNext ) { - callback(pCur->m_PlayerID); + callback( pCur->m_PlayerID ); } } } - void CVoiceBanMgr::Clear() { // Tie off the hash table entries. - for(int i=0; i < 256; i++) + for( int i = 0; i < 256; i++ ) m_PlayerHash[i].m_pNext = m_PlayerHash[i].m_pPrev = &m_PlayerHash[i]; } - -CVoiceBanMgr::BannedPlayer* CVoiceBanMgr::InternalFindPlayerSquelch(char const playerID[16]) +CVoiceBanMgr::BannedPlayer *CVoiceBanMgr::InternalFindPlayerSquelch( char const playerID[16] ) { - int index = HashPlayerID(playerID); + int index = HashPlayerID( playerID ); + BannedPlayer *pListHead = &m_PlayerHash[index]; - for(BannedPlayer *pCur=pListHead->m_pNext; pCur != pListHead; pCur=pCur->m_pNext) + for( BannedPlayer *pCur = pListHead->m_pNext; pCur != pListHead; pCur=pCur->m_pNext ) { - if(memcmp(playerID, pCur->m_PlayerID, 16) == 0) + if( memcmp( playerID, pCur->m_PlayerID, 16 ) == 0 ) return pCur; } return NULL; } - -CVoiceBanMgr::BannedPlayer* CVoiceBanMgr::AddBannedPlayer(char const playerID[16]) +CVoiceBanMgr::BannedPlayer* CVoiceBanMgr::AddBannedPlayer( char const playerID[16] ) { BannedPlayer *pNew = new BannedPlayer; - if(!pNew) + if( !pNew ) return NULL; - int index = HashPlayerID(playerID); - memcpy(pNew->m_PlayerID, playerID, 16); + int index = HashPlayerID( playerID ); + + memcpy( pNew->m_PlayerID, playerID, 16 ); pNew->m_pNext = &m_PlayerHash[index]; pNew->m_pPrev = m_PlayerHash[index].m_pPrev; pNew->m_pPrev->m_pNext = pNew->m_pNext->m_pPrev = pNew; + return pNew; } diff --git a/game_shared/voice_banmgr.h b/game_shared/voice_banmgr.h index 4c4f7b63..64c0c2bb 100644 --- a/game_shared/voice_banmgr.h +++ b/game_shared/voice_banmgr.h @@ -5,47 +5,42 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VOICE_BANMGR_H) +#ifndef VOICE_BANMGR_H #define VOICE_BANMGR_H // This class manages the (persistent) list of squelched players. class CVoiceBanMgr { public: - - CVoiceBanMgr(); - ~CVoiceBanMgr(); + CVoiceBanMgr(); + ~CVoiceBanMgr(); // Init loads the list of squelched players from disk. - bool Init(char const *pGameDir); + bool Init( char const *pGameDir ); void Term(); // Saves the state into voice_squelch.dt. - void SaveState(char const *pGameDir); + void SaveState( char const *pGameDir ); - bool GetPlayerBan(char const playerID[16]); - void SetPlayerBan(char const playerID[16], bool bSquelch); + bool GetPlayerBan( char const playerID[16] ); + void SetPlayerBan( char const playerID[16], bool bSquelch ); // Call your callback for each banned player. - void ForEachBannedPlayer(void (*callback)(char id[16])); - + void ForEachBannedPlayer( void (*callback)( char id[16] ) ); protected: - class BannedPlayer { public: - char m_PlayerID[16]; + char m_PlayerID[16]; BannedPlayer *m_pPrev, *m_pNext; }; - void Clear(); - BannedPlayer* InternalFindPlayerSquelch(char const playerID[16]); - BannedPlayer* AddBannedPlayer(char const playerID[16]); - - -protected: + void Clear(); + BannedPlayer *InternalFindPlayerSquelch( char const playerID[16] ); + BannedPlayer *AddBannedPlayer( char const playerID[16] ); BannedPlayer m_PlayerHash[256]; }; #endif // VOICE_BANMGR_H + diff --git a/game_shared/voice_common.h b/game_shared/voice_common.h index 58225955..c32011a3 100644 --- a/game_shared/voice_common.h +++ b/game_shared/voice_common.h @@ -5,14 +5,14 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VOICE_COMMON_H) +#ifndef VOICE_COMMON_H #define VOICE_COMMON_H #include "bitvec.h" - #define VOICE_MAX_PLAYERS 32 // (todo: this should just be set to MAX_CLIENTS). -#define VOICE_MAX_PLAYERS_DW ((VOICE_MAX_PLAYERS / 32) + !!(VOICE_MAX_PLAYERS & 31)) +#define VOICE_MAX_PLAYERS_DW ((VOICE_MAX_PLAYERS / 32) + !!(VOICE_MAX_PLAYERS & 31)) typedef CBitVec CPlayerBitVec; #endif // VOICE_COMMON_H + diff --git a/game_shared/voice_gamemgr.cpp b/game_shared/voice_gamemgr.cpp index 403d4320..086c715c 100644 --- a/game_shared/voice_gamemgr.cpp +++ b/game_shared/voice_gamemgr.cpp @@ -1,10 +1,11 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ // -// Purpose: +// Purpose: // // $NoKeywords: $ //============================================================================= +#include "archtypes.h" // DAL #include "voice_gamemgr.h" #include #include @@ -13,8 +14,11 @@ #include "cbase.h" #include "player.h" + + #define UPDATE_INTERVAL 0.3 + // These are stored off as CVoiceGameMgr is created and deleted. CPlayerBitVec g_PlayerModEnable; // Set to 1 for each player if the player wants to use voice in this mod. // (If it's zero, then the server reports that the game rules are saying the @@ -32,24 +36,25 @@ cvar_t voice_serverdebug = {"voice_serverdebug", "0"}; // Set game rules to allow all clients to talk to each other. // Muted players still can't talk to each other. -cvar_t sv_alltalk = {"sv_alltalk", "0"}; +cvar_t sv_alltalk = {"sv_alltalk", "0", FCVAR_SERVER}; // ------------------------------------------------------------------------ // // Static helpers. // ------------------------------------------------------------------------ // + // Find a player with a case-insensitive name search. -static CBasePlayer* FindPlayerByName( const char *pTestName ) +static CBasePlayer* FindPlayerByName(const char *pTestName) { - for( int i = 1; i <= gpGlobals->maxClients; i++ ) + for(int i=1; i <= gpGlobals->maxClients; i++) { - edict_t *pEdict = g_engfuncs.pfnPEntityOfEntIndex( i ); - if( pEdict ) + edict_t *pEdict = g_engfuncs.pfnPEntityOfEntIndex(i); + if(pEdict) { - CBaseEntity *pEnt = CBaseEntity::Instance( pEdict ); - if( pEnt && pEnt->IsPlayer() ) - { - const char *pNetName = STRING( pEnt->pev->netname ); - if( stricmp( pNetName, pTestName ) == 0 ) + CBaseEntity *pEnt = CBaseEntity::Instance(pEdict); + if(pEnt && pEnt->IsPlayer()) + { + const char *pNetName = STRING(pEnt->pev->netname); + if(stricmp(pNetName, pTestName) == 0) { return (CBasePlayer*)pEnt; } @@ -75,30 +80,37 @@ static void VoiceServerDebug( char const *pFmt, ... ) ALERT( at_console, "%s", msg ); } + + // ------------------------------------------------------------------------ // // CVoiceGameMgr. // ------------------------------------------------------------------------ // + CVoiceGameMgr::CVoiceGameMgr() { m_UpdateInterval = 0; m_nMaxPlayers = 0; } + CVoiceGameMgr::~CVoiceGameMgr() { } -bool CVoiceGameMgr::Init( IVoiceGameMgrHelper *pHelper, int maxClients ) + +bool CVoiceGameMgr::Init( + IVoiceGameMgrHelper *pHelper, + int maxClients) { m_pHelper = pHelper; m_nMaxPlayers = VOICE_MAX_PLAYERS < maxClients ? VOICE_MAX_PLAYERS : maxClients; - g_engfuncs.pfnPrecacheModel( "sprites/voiceicon.spr" ); + g_engfuncs.pfnPrecacheModel("sprites/voiceicon.spr"); - m_msgPlayerVoiceMask = REG_USER_MSG( "VoiceMask", VOICE_MAX_PLAYERS_DW * 4 * 2 ); + m_msgPlayerVoiceMask = REG_USER_MSG( "VoiceMask", VOICE_MAX_PLAYERS_DW*4 * 2 ); m_msgRequestState = REG_USER_MSG( "ReqState", 0 ); // register voice_serverdebug if it hasn't been registered already - if( !CVAR_GET_POINTER( "voice_serverdebug" ) ) + if ( !CVAR_GET_POINTER( "voice_serverdebug" ) ) CVAR_REGISTER( &voice_serverdebug ); if( !CVAR_GET_POINTER( "sv_alltalk" ) ) @@ -107,70 +119,73 @@ bool CVoiceGameMgr::Init( IVoiceGameMgrHelper *pHelper, int maxClients ) return true; } -void CVoiceGameMgr::SetHelper( IVoiceGameMgrHelper *pHelper ) + +void CVoiceGameMgr::SetHelper(IVoiceGameMgrHelper *pHelper) { m_pHelper = pHelper; } -void CVoiceGameMgr::Update( double frametime ) + +void CVoiceGameMgr::Update(double frametime) { // Only update periodically. m_UpdateInterval += frametime; - if( m_UpdateInterval < UPDATE_INTERVAL ) + if(m_UpdateInterval < UPDATE_INTERVAL) return; UpdateMasks(); } -void CVoiceGameMgr::ClientConnected( edict_t *pEdict ) + +void CVoiceGameMgr::ClientConnected(edict_t *pEdict) { - int index = ENTINDEX( pEdict ) - 1; + int index = ENTINDEX(pEdict) - 1; // Clear out everything we use for deltas on this guy. g_bWantModEnable[index] = true; - g_SentGameRulesMasks[index].Init( 0 ); - g_SentBanMasks[index].Init( 0 ); + g_SentGameRulesMasks[index].Init(0); + g_SentBanMasks[index].Init(0); } // Called to determine if the Receiver has muted (blocked) the Sender // Returns true if the receiver has blocked the sender -bool CVoiceGameMgr::PlayerHasBlockedPlayer( CBasePlayer *pReceiver, CBasePlayer *pSender ) +bool CVoiceGameMgr::PlayerHasBlockedPlayer(CBasePlayer *pReceiver, CBasePlayer *pSender) { int iReceiverIndex, iSenderIndex; - if( !pReceiver || !pSender ) + if ( !pReceiver || !pSender ) return false; iReceiverIndex = pReceiver->entindex() - 1; - iSenderIndex = pSender->entindex() - 1; + iSenderIndex = pSender->entindex() - 1; - if( iReceiverIndex < 0 || iReceiverIndex >= m_nMaxPlayers || iSenderIndex < 0 || iSenderIndex >= m_nMaxPlayers ) + if ( iReceiverIndex < 0 || iReceiverIndex >= m_nMaxPlayers || iSenderIndex < 0 || iSenderIndex >= m_nMaxPlayers ) return false; return ( g_BanMasks[iReceiverIndex][iSenderIndex] ? true : false ); } -bool CVoiceGameMgr::ClientCommand( CBasePlayer *pPlayer, const char *cmd ) +bool CVoiceGameMgr::ClientCommand(CBasePlayer *pPlayer, const char *cmd) { int playerClientIndex = pPlayer->entindex() - 1; - if( playerClientIndex < 0 || playerClientIndex >= m_nMaxPlayers ) + if(playerClientIndex < 0 || playerClientIndex >= m_nMaxPlayers) { VoiceServerDebug( "CVoiceGameMgr::ClientCommand: cmd %s from invalid client (%d)\n", cmd, playerClientIndex ); return true; } - bool bBan = stricmp( cmd, "vban" ) == 0; - if( bBan && CMD_ARGC() >= 2 ) + bool bBan = stricmp(cmd, "vban") == 0; + if(bBan && CMD_ARGC() >= 2) { - for( int i = 1; i < CMD_ARGC(); i++ ) + for(int i=1; i < CMD_ARGC(); i++) { - unsigned long mask = 0; - sscanf( CMD_ARGV(i), "%lx", &mask ); + uint32 mask = 0; + sscanf(CMD_ARGV(i), "%x", &mask); - if( i <= VOICE_MAX_PLAYERS_DW ) + if(i <= VOICE_MAX_PLAYERS_DW) { VoiceServerDebug( "CVoiceGameMgr::ClientCommand: vban (0x%x) from %d\n", mask, playerClientIndex ); - g_BanMasks[playerClientIndex].SetDWord( i - 1, mask ); + g_BanMasks[playerClientIndex].SetDWord(i-1, mask); } else { @@ -179,15 +194,15 @@ bool CVoiceGameMgr::ClientCommand( CBasePlayer *pPlayer, const char *cmd ) } // Force it to update the masks now. - //UpdateMasks(); + // UpdateMasks(); return true; } - else if( stricmp( cmd, "VModEnable" ) == 0 && CMD_ARGC() >= 2 ) + else if(stricmp(cmd, "VModEnable") == 0 && CMD_ARGC() >= 2) { - VoiceServerDebug( "CVoiceGameMgr::ClientCommand: VModEnable (%d)\n", !!atoi( CMD_ARGV( 1 ) ) ); - g_PlayerModEnable[playerClientIndex] = !!atoi( CMD_ARGV( 1 ) ); + VoiceServerDebug( "CVoiceGameMgr::ClientCommand: VModEnable (%d)\n", !!atoi(CMD_ARGV(1)) ); + g_PlayerModEnable[playerClientIndex] = !!atoi(CMD_ARGV(1)); g_bWantModEnable[playerClientIndex] = false; - //UpdateMasks(); + // UpdateMasks(); return true; } else @@ -196,22 +211,23 @@ bool CVoiceGameMgr::ClientCommand( CBasePlayer *pPlayer, const char *cmd ) } } + void CVoiceGameMgr::UpdateMasks() { m_UpdateInterval = 0; - bool bAllTalk = !!g_engfuncs.pfnCVarGetFloat( "sv_alltalk" ); + bool bAllTalk = !!(sv_alltalk.value); - for( int iClient = 0; iClient < m_nMaxPlayers; iClient++ ) + for(int iClient=0; iClient < m_nMaxPlayers; iClient++) { - CBaseEntity *pEnt = UTIL_PlayerByIndex( iClient + 1 ); - if( !pEnt || !pEnt->IsPlayer() ) + CBaseEntity *pEnt = UTIL_PlayerByIndex(iClient+1); + if(!pEnt || !pEnt->IsPlayer()) continue; // Request the state of their "VModEnable" cvar. - if( g_bWantModEnable[iClient] ) + if(g_bWantModEnable[iClient]) { - MESSAGE_BEGIN( MSG_ONE, m_msgRequestState, NULL, pEnt->pev ); + MESSAGE_BEGIN(MSG_ONE, m_msgRequestState, NULL, pEnt->pev); MESSAGE_END(); } @@ -221,10 +237,10 @@ void CVoiceGameMgr::UpdateMasks() if( g_PlayerModEnable[iClient] ) { // Build a mask of who they can hear based on the game rules. - for( int iOtherClient = 0; iOtherClient < m_nMaxPlayers; iOtherClient++ ) + for(int iOtherClient=0; iOtherClient < m_nMaxPlayers; iOtherClient++) { - pEnt = UTIL_PlayerByIndex( iOtherClient + 1 ); - if( pEnt && pEnt->IsPlayer() && ( bAllTalk || m_pHelper->CanPlayerHearPlayer( pPlayer, (CBasePlayer*)pEnt ) ) ) + CBaseEntity *pEnt = UTIL_PlayerByIndex(iOtherClient+1); + if(pEnt && (bAllTalk || m_pHelper->CanPlayerHearPlayer(pPlayer, (CBasePlayer*)pEnt)) ) { gameRulesMask[iOtherClient] = true; } @@ -232,26 +248,27 @@ void CVoiceGameMgr::UpdateMasks() } // If this is different from what the client has, send an update. - if( gameRulesMask != g_SentGameRulesMasks[iClient] || g_BanMasks[iClient] != g_SentBanMasks[iClient] ) + if(gameRulesMask != g_SentGameRulesMasks[iClient] || + g_BanMasks[iClient] != g_SentBanMasks[iClient]) { g_SentGameRulesMasks[iClient] = gameRulesMask; g_SentBanMasks[iClient] = g_BanMasks[iClient]; - MESSAGE_BEGIN( MSG_ONE, m_msgPlayerVoiceMask, NULL, pPlayer->pev ); + MESSAGE_BEGIN(MSG_ONE, m_msgPlayerVoiceMask, NULL, pPlayer->pev); int dw; - for( dw = 0; dw < VOICE_MAX_PLAYERS_DW; dw++ ) + for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) { - WRITE_LONG( gameRulesMask.GetDWord( dw ) ); - WRITE_LONG( g_BanMasks[iClient].GetDWord( dw ) ); + WRITE_LONG(gameRulesMask.GetDWord(dw)); + WRITE_LONG(g_BanMasks[iClient].GetDWord(dw)); } MESSAGE_END(); } // Tell the engine. - for( int iOtherClient = 0; iOtherClient < m_nMaxPlayers; iOtherClient++ ) + for(int iOtherClient=0; iOtherClient < m_nMaxPlayers; iOtherClient++) { bool bCanHear = gameRulesMask[iOtherClient] && !g_BanMasks[iClient][iOtherClient]; - g_engfuncs.pfnVoice_SetClientListening( iClient + 1, iOtherClient + 1, bCanHear ); + g_engfuncs.pfnVoice_SetClientListening(iClient+1, iOtherClient+1, bCanHear); } } } diff --git a/game_shared/voice_gamemgr.h b/game_shared/voice_gamemgr.h index f6e9d92c..cdbb8815 100644 --- a/game_shared/voice_gamemgr.h +++ b/game_shared/voice_gamemgr.h @@ -1,66 +1,80 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright � 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VOICE_GAMEMGR_H) +#ifndef VOICE_GAMEMGR_H #define VOICE_GAMEMGR_H +#ifdef _WIN32 +#endif + + #include "voice_common.h" + class CGameRules; class CBasePlayer; + class IVoiceGameMgrHelper { public: - virtual ~IVoiceGameMgrHelper() {} + virtual ~IVoiceGameMgrHelper() {} // Called each frame to determine which players are allowed to hear each other. This overrides // whatever squelch settings players have. - virtual bool CanPlayerHearPlayer( CBasePlayer *pListener, CBasePlayer *pTalker ) = 0; + virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pTalker) = 0; }; + // CVoiceGameMgr manages which clients can hear which other clients. class CVoiceGameMgr { public: - CVoiceGameMgr(); - virtual ~CVoiceGameMgr(); + CVoiceGameMgr(); + virtual ~CVoiceGameMgr(); + + bool Init( + IVoiceGameMgrHelper *m_pHelper, + int maxClients + ); - bool Init( IVoiceGameMgrHelper *m_pHelper, int maxClients ); - - void SetHelper( IVoiceGameMgrHelper *pHelper ); + void SetHelper(IVoiceGameMgrHelper *pHelper); // Updates which players can hear which other players. // If gameplay mode is DM, then only players within the PVS can hear each other. // If gameplay mode is teamplay, then only players on the same team can hear each other. // Player masks are always applied. - void Update( double frametime ); + void Update(double frametime); // Called when a new client connects (unsquelches its entity for everyone). - void ClientConnected( struct edict_s *pEdict ); + void ClientConnected(struct edict_s *pEdict); // Called on ClientCommand. Checks for the squelch and unsquelch commands. // Returns true if it handled the command. - bool ClientCommand( CBasePlayer *pPlayer, const char *cmd ); + bool ClientCommand(CBasePlayer *pPlayer, const char *cmd); // Called to determine if the Receiver has muted (blocked) the Sender // Returns true if the receiver has blocked the sender - bool PlayerHasBlockedPlayer( CBasePlayer *pReceiver, CBasePlayer *pSender ); + bool PlayerHasBlockedPlayer(CBasePlayer *pReceiver, CBasePlayer *pSender); + private: + // Force it to update the client masks. - void UpdateMasks(); + void UpdateMasks(); -private: - int m_msgPlayerVoiceMask; - int m_msgRequestState; - IVoiceGameMgrHelper *m_pHelper; - int m_nMaxPlayers; - double m_UpdateInterval; // How long since the last update. + int m_msgPlayerVoiceMask; + int m_msgRequestState; + + IVoiceGameMgrHelper *m_pHelper; + int m_nMaxPlayers; + double m_UpdateInterval; // How long since the last update. }; + + #endif // VOICE_GAMEMGR_H diff --git a/game_shared/voice_status.cpp b/game_shared/voice_status.cpp index 57bc0f16..cbc81e81 100644 --- a/game_shared/voice_status.cpp +++ b/game_shared/voice_status.cpp @@ -6,34 +6,16 @@ //============================================================================= // There are hud.h's coming out of the woodwork so this ensures that we get the right one. -#if defined( DMC_BUILD ) - #include "../dmc/cl_dll/hud.h" - #include "../dmc/cl_dll/cl_util.h" -#elif defined( RICOCHET_BUILD ) - #include "../ricochet/cl_dll/hud.h" - #include "../ricochet/cl_dll/cl_util.h" -#else - #include "../cl_dll/hud.h" - #include "../cl_dll/cl_util.h" -#endif +#include "../cl_dll/hud.h" +#include "../cl_dll/cl_util.h" #include #include #include -#if defined( DMC_BUILD ) - #include "../dmc/cl_dll/parsemsg.h" - #include "../dmc/cl_dll/hud_servers.h" - #include "../dmc/cl_dll/demo.h" -#elif defined( RICOCHET_BUILD ) - #include "../ricochet/cl_dll/parsemsg.h" - #include "../ricochet/cl_dll/hud_servers.h" - #include "../ricochet/cl_dll/demo.h" -#else - #include "../cl_dll/parsemsg.h" - #include "../cl_dll/hud_servers.h" - #include "../cl_dll/demo.h" -#endif +#include "../cl_dll/parsemsg.h" +#include "../cl_dll/hud_servers.h" +#include "../cl_dll/demo.h" #include "demo_api.h" #include "voice_status.h" @@ -46,23 +28,16 @@ #include "vgui_helpers.h" #include "vgui_mousecode.h" - - using namespace vgui; - extern int cam_thirdperson; - #define VOICE_MODEL_INTERVAL 0.3 #define SCOREBOARD_BLINK_FREQUENCY 0.3 // How often to blink the scoreboard icons. #define SQUELCHOSCILLATE_PER_SECOND 2.0f - extern BitmapTGA *LoadTGA( const char* pImageName ); - - // ---------------------------------------------------------------------- // // The voice manager for the client. // ---------------------------------------------------------------------- // @@ -73,63 +48,60 @@ CVoiceStatus* GetClientVoiceMgr() return &g_VoiceStatus; } - - // ---------------------------------------------------------------------- // // CVoiceStatus. // ---------------------------------------------------------------------- // - static CVoiceStatus *g_pInternalVoiceStatus = NULL; -int __MsgFunc_VoiceMask(const char *pszName, int iSize, void *pbuf) +int __MsgFunc_VoiceMask( const char *pszName, int iSize, void *pbuf ) { - if(g_pInternalVoiceStatus) - g_pInternalVoiceStatus->HandleVoiceMaskMsg(iSize, pbuf); + if( g_pInternalVoiceStatus ) + g_pInternalVoiceStatus->HandleVoiceMaskMsg( iSize, pbuf ); return 1; } -int __MsgFunc_ReqState(const char *pszName, int iSize, void *pbuf) +int __MsgFunc_ReqState( const char *pszName, int iSize, void *pbuf ) { - if(g_pInternalVoiceStatus) - g_pInternalVoiceStatus->HandleReqStateMsg(iSize, pbuf); + if( g_pInternalVoiceStatus ) + g_pInternalVoiceStatus->HandleReqStateMsg( iSize, pbuf ); return 1; } - int g_BannedPlayerPrintCount; -void ForEachBannedPlayer(char id[16]) + +void ForEachBannedPlayer( char id[16] ) { char str[256]; - sprintf(str, "Ban %d: %2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x\n", + + sprintf( str, "Ban %d: %2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x\n", g_BannedPlayerPrintCount++, id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11], id[12], id[13], id[14], id[15] ); - strupr(str); + + strupr( str ); + gEngfuncs.pfnConsolePrint(str); } - void ShowBannedCallback() { - if(g_pInternalVoiceStatus) + if( g_pInternalVoiceStatus ) { g_BannedPlayerPrintCount = 0; gEngfuncs.pfnConsolePrint("------- BANNED PLAYERS -------\n"); - g_pInternalVoiceStatus->m_BanMgr.ForEachBannedPlayer(ForEachBannedPlayer); + g_pInternalVoiceStatus->m_BanMgr.ForEachBannedPlayer( ForEachBannedPlayer ); gEngfuncs.pfnConsolePrint("------------------------------\n"); } } - // ---------------------------------------------------------------------- // // CVoiceStatus. // ---------------------------------------------------------------------- // - CVoiceStatus::CVoiceStatus() { m_bBanMgrInitialized = false; @@ -142,84 +114,80 @@ CVoiceStatus::CVoiceStatus() m_pScoreboardSpeaking2 = NULL; m_pScoreboardSquelch = NULL; m_pScoreboardBanned = NULL; - + m_pLocalBitmap = NULL; m_pAckBitmap = NULL; m_bTalking = m_bServerAcked = false; - memset(m_pBanButtons, 0, sizeof(m_pBanButtons)); + memset( m_pBanButtons, 0, sizeof(m_pBanButtons) ); m_bServerModEnable = -1; m_pchGameDir = NULL; } - CVoiceStatus::~CVoiceStatus() { g_pInternalVoiceStatus = NULL; - - for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) { delete m_Labels[i].m_pLabel; m_Labels[i].m_pLabel = NULL; delete m_Labels[i].m_pIcon; m_Labels[i].m_pIcon = NULL; - + delete m_Labels[i].m_pBackground; m_Labels[i].m_pBackground = NULL; - } + } delete m_pLocalLabel; m_pLocalLabel = NULL; FreeBitmaps(); - if(m_pchGameDir) + if( m_pchGameDir ) { - if(m_bBanMgrInitialized) + if( m_bBanMgrInitialized ) { - m_BanMgr.SaveState(m_pchGameDir); + m_BanMgr.SaveState( m_pchGameDir ); } - free(m_pchGameDir); + free( m_pchGameDir ); } } - -int CVoiceStatus::Init( - IVoiceStatusHelper *pHelper, - Panel **pParentPanel) +int CVoiceStatus::Init( IVoiceStatusHelper *pHelper, Panel **pParentPanel ) { // Setup the voice_modenable cvar. - gEngfuncs.pfnRegisterVariable("voice_modenable", "1", FCVAR_ARCHIVE); + gEngfuncs.pfnRegisterVariable( "voice_modenable", "1", FCVAR_ARCHIVE ); - gEngfuncs.pfnRegisterVariable("voice_clientdebug", "0", 0); + gEngfuncs.pfnRegisterVariable( "voice_clientdebug", "0", 0 ); - gEngfuncs.pfnAddCommand("voice_showbanned", ShowBannedCallback); + gEngfuncs.pfnAddCommand( "voice_showbanned", ShowBannedCallback ); - if(gEngfuncs.pfnGetGameDirectory()) + if( gEngfuncs.pfnGetGameDirectory() ) { - m_BanMgr.Init(gEngfuncs.pfnGetGameDirectory()); + m_BanMgr.Init( gEngfuncs.pfnGetGameDirectory() ); m_bBanMgrInitialized = true; } - assert(!g_pInternalVoiceStatus); + assert( !g_pInternalVoiceStatus ); g_pInternalVoiceStatus = this; m_BlinkTimer = 0; m_VoiceHeadModel = NULL; - memset(m_Labels, 0, sizeof(m_Labels)); - - for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + memset( m_Labels, 0, sizeof(m_Labels) ); + + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) { CVoiceLabel *pLabel = &m_Labels[i]; - pLabel->m_pBackground = new Label(""); + pLabel->m_pBackground = new Label( "" ); - if(pLabel->m_pLabel = new Label("")) + if( pLabel->m_pLabel = new Label( "" ) ) { pLabel->m_pLabel->setVisible( true ); pLabel->m_pLabel->setFont( Scheme::sf_primary2 ); @@ -237,92 +205,90 @@ int CVoiceStatus::Init( pLabel->m_clientindex = -1; } - m_pLocalLabel = new ImagePanel(NULL); + m_pLocalLabel = new ImagePanel( NULL ); m_bInSquelchMode = false; m_pHelper = pHelper; m_pParentPanel = pParentPanel; - gHUD.AddHudElem(this); + gHUD.AddHudElem( this ); m_iFlags = HUD_ACTIVE; - HOOK_MESSAGE(VoiceMask); - HOOK_MESSAGE(ReqState); + HOOK_MESSAGE( VoiceMask ); + HOOK_MESSAGE( ReqState ); // Cache the game directory for use when we shut down const char *pchGameDirT = gEngfuncs.pfnGetGameDirectory(); - m_pchGameDir = (char *)malloc(strlen(pchGameDirT) + 1); - strcpy(m_pchGameDir, pchGameDirT); + m_pchGameDir = (char *)malloc( strlen( pchGameDirT ) + 1 ); + strcpy( m_pchGameDir, pchGameDirT ); return 1; } - int CVoiceStatus::VidInit() { FreeBitmaps(); - - if( m_pLocalBitmap = vgui_LoadTGA("gfx/vgui/icntlk_pl.tga") ) + if( m_pLocalBitmap = vgui_LoadTGA( "gfx/vgui/icntlk_pl.tga" ) ) { - m_pLocalBitmap->setColor(Color(255,255,255,135)); + m_pLocalBitmap->setColor( Color( 255, 255, 255, 135 ) ); } - if( m_pAckBitmap = vgui_LoadTGA("gfx/vgui/icntlk_sv.tga") ) + if( m_pAckBitmap = vgui_LoadTGA( "gfx/vgui/icntlk_sv.tga" ) ) { - m_pAckBitmap->setColor(Color(255,255,255,135)); // Give just a tiny bit of translucency so software draws correctly. + m_pAckBitmap->setColor( Color( 255, 255, 255, 135 ) ); // Give just a tiny bit of translucency so software draws correctly. } m_pLocalLabel->setImage( m_pLocalBitmap ); m_pLocalLabel->setVisible( false ); + if( m_pSpeakerLabelIcon = vgui_LoadTGANoInvertAlpha( "gfx/vgui/speaker4.tga" ) ) + m_pSpeakerLabelIcon->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. - if( m_pSpeakerLabelIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/speaker4.tga" ) ) - m_pSpeakerLabelIcon->setColor( Color(255,255,255,1) ); // Give just a tiny bit of translucency so software draws correctly. + if( m_pScoreboardNeverSpoken = vgui_LoadTGANoInvertAlpha( "gfx/vgui/640_speaker1.tga" ) ) + m_pScoreboardNeverSpoken->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. - if (m_pScoreboardNeverSpoken = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker1.tga")) - m_pScoreboardNeverSpoken->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + if( m_pScoreboardNotSpeaking = vgui_LoadTGANoInvertAlpha( "gfx/vgui/640_speaker2.tga" ) ) + m_pScoreboardNotSpeaking->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. - if(m_pScoreboardNotSpeaking = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker2.tga")) - m_pScoreboardNotSpeaking->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. - - if(m_pScoreboardSpeaking = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker3.tga")) - m_pScoreboardSpeaking->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. - - if(m_pScoreboardSpeaking2 = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_speaker4.tga")) - m_pScoreboardSpeaking2->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. - - if(m_pScoreboardSquelch = vgui_LoadTGA("gfx/vgui/icntlk_squelch.tga")) - m_pScoreboardSquelch->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + if( m_pScoreboardSpeaking = vgui_LoadTGANoInvertAlpha( "gfx/vgui/640_speaker3.tga" ) ) + m_pScoreboardSpeaking->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. - if(m_pScoreboardBanned = vgui_LoadTGA("gfx/vgui/640_voiceblocked.tga")) - m_pScoreboardBanned->setColor(Color(255,255,255,1)); // Give just a tiny bit of translucency so software draws correctly. + if( m_pScoreboardSpeaking2 = vgui_LoadTGANoInvertAlpha( "gfx/vgui/640_speaker4.tga" ) ) + m_pScoreboardSpeaking2->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. + + if( m_pScoreboardSquelch = vgui_LoadTGA( "gfx/vgui/icntlk_squelch.tga" ) ) + m_pScoreboardSquelch->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. + + if( m_pScoreboardBanned = vgui_LoadTGA( "gfx/vgui/640_voiceblocked.tga" ) ) + m_pScoreboardBanned->setColor( Color( 255, 255, 255, 1 ) ); // Give just a tiny bit of translucency so software draws correctly. // Figure out the voice head model height. m_VoiceHeadModelHeight = 45; - char *pFile = (char *)gEngfuncs.COM_LoadFile("scripts/voicemodel.txt", 5, NULL); - if(pFile) + char *pFile = (char *)gEngfuncs.COM_LoadFile( "scripts/voicemodel.txt", 5, NULL ); + if( pFile ) { char token[4096]; - gEngfuncs.COM_ParseFile(pFile, token); - if(token[0] >= '0' && token[0] <= '9') + + gEngfuncs.COM_ParseFile( pFile, token ); + if( token[0] >= '0' && token[0] <= '9' ) { - m_VoiceHeadModelHeight = (float)atof(token); + m_VoiceHeadModelHeight = (float)atof( token ); } - gEngfuncs.COM_FreeFile(pFile); + gEngfuncs.COM_FreeFile( pFile ); } - m_VoiceHeadModel = gEngfuncs.pfnSPR_Load("sprites/voiceicon.spr"); + m_VoiceHeadModel = gEngfuncs.pfnSPR_Load( "sprites/voiceicon.spr" ); + return TRUE; } - -void CVoiceStatus::Frame(double frametime) +void CVoiceStatus::Frame( double frametime ) { // check server banned players once per second - if(gEngfuncs.GetClientTime() - m_LastUpdateServerState > 1) + if( gEngfuncs.GetClientTime() - m_LastUpdateServerState > 1 ) { - UpdateServerState(false); + UpdateServerState( false ); } m_BlinkTimer += frametime; @@ -330,51 +296,50 @@ void CVoiceStatus::Frame(double frametime) // Update speaker labels. if( m_pHelper->CanShowSpeakerLabels() ) { - for( int i=0; i < MAX_VOICE_SPEAKERS; i++ ) + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) m_Labels[i].m_pBackground->setVisible( m_Labels[i].m_clientindex != -1 ); } else { - for( int i=0; i < MAX_VOICE_SPEAKERS; i++ ) + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) m_Labels[i].m_pBackground->setVisible( false ); } - for(int i=0; i < VOICE_MAX_PLAYERS; i++) + for( int i = 0; i < VOICE_MAX_PLAYERS; i++ ) UpdateBanButton(i); } - void CVoiceStatus::CreateEntities() { - if(!m_VoiceHeadModel) + if( !m_VoiceHeadModel ) return; cl_entity_t *localPlayer = gEngfuncs.GetLocalPlayer(); int iOutModel = 0; - for(int i=0; i < VOICE_MAX_PLAYERS; i++) + for( int i = 0; i < VOICE_MAX_PLAYERS; i++ ) { - if(!m_VoicePlayers[i]) + if( !m_VoicePlayers[i] ) continue; - - cl_entity_s *pClient = gEngfuncs.GetEntityByIndex(i+1); - + + cl_entity_s *pClient = gEngfuncs.GetEntityByIndex( i + 1 ); + // Don't show an icon if the player is not in our PVS. - if(!pClient || pClient->curstate.messagenum < localPlayer->curstate.messagenum) + if( !pClient || pClient->curstate.messagenum < localPlayer->curstate.messagenum ) continue; // Don't show an icon for dead or spectating players (ie: invisible entities). - if(pClient->curstate.effects & EF_NODRAW) + if( pClient->curstate.effects & EF_NODRAW ) continue; // Don't show an icon for the local player unless we're in thirdperson mode. - if(pClient == localPlayer && !cam_thirdperson) + if( pClient == localPlayer && !cam_thirdperson ) continue; cl_entity_s *pEnt = &m_VoiceHeadModels[iOutModel]; ++iOutModel; - memset(pEnt, 0, sizeof(*pEnt)); + memset( pEnt, 0, sizeof(*pEnt) ); pEnt->curstate.rendermode = kRenderTransAdd; pEnt->curstate.renderamt = 255; @@ -382,30 +347,30 @@ void CVoiceStatus::CreateEntities() pEnt->curstate.renderfx = kRenderFxNoDissipation; pEnt->curstate.framerate = 1; pEnt->curstate.frame = 0; - pEnt->model = (struct model_s*)gEngfuncs.GetSpritePointer(m_VoiceHeadModel); + pEnt->model = (struct model_s*)gEngfuncs.GetSpritePointer( m_VoiceHeadModel ); pEnt->angles[0] = pEnt->angles[1] = pEnt->angles[2] = 0; pEnt->curstate.scale = 0.5f; - + pEnt->origin[0] = pEnt->origin[1] = 0; pEnt->origin[2] = 45; - VectorAdd(pEnt->origin, pClient->origin, pEnt->origin); + VectorAdd( pEnt->origin, pClient->origin, pEnt->origin ); // Tell the engine. - gEngfuncs.CL_CreateVisibleEntity(ET_NORMAL, pEnt); + gEngfuncs.CL_CreateVisibleEntity( ET_NORMAL, pEnt ); } } - -void CVoiceStatus::UpdateSpeakerStatus(int entindex, qboolean bTalking) +void CVoiceStatus::UpdateSpeakerStatus( int entindex, qboolean bTalking ) { - if(!*m_pParentPanel) + if( !*m_pParentPanel ) return; if( gEngfuncs.pfnGetCvarFloat("voice_clientdebug") ) { char msg[256]; - _snprintf( msg, sizeof(msg), "CVoiceStatus::UpdateSpeakerStatus: ent %d talking = %d\n", entindex, bTalking ); + + sprintf( msg, "CVoiceStatus::UpdateSpeakerStatus: ent %d talking = %d\n", entindex, bTalking ); gEngfuncs.pfnConsolePrint( msg ); } @@ -423,30 +388,30 @@ void CVoiceStatus::UpdateSpeakerStatus(int entindex, qboolean bTalking) { m_bServerAcked = !!bTalking; } - else if(entindex >= 0 && entindex <= VOICE_MAX_PLAYERS) + else if( entindex >= 0 && entindex <= VOICE_MAX_PLAYERS ) { int iClient = entindex - 1; - if(iClient < 0) + if( iClient < 0 ) return; - CVoiceLabel *pLabel = FindVoiceLabel(iClient); - if(bTalking) + CVoiceLabel *pLabel = FindVoiceLabel( iClient ); + if( bTalking ) { m_VoicePlayers[iClient] = true; m_VoiceEnabledPlayers[iClient] = true; // If we don't have a label for this guy yet, then create one. - if(!pLabel) + if( !pLabel ) { - if(pLabel = GetFreeVoiceLabel()) + if( pLabel = GetFreeVoiceLabel() ) { // Get the name from the engine. - hud_player_info_t info; - memset(&info, 0, sizeof(info)); - GetPlayerInfo(entindex, &info); + hud_player_info_t info = {0}; + + GetPlayerInfo( entindex, &info ); char paddedName[512]; - _snprintf(paddedName, sizeof(paddedName), "%s ", info.name); + sprintf( paddedName, "%s ", info.name ); int color[3]; m_pHelper->GetPlayerTextColor( entindex, color ); @@ -474,9 +439,9 @@ void CVoiceStatus::UpdateSpeakerStatus(int entindex, qboolean bTalking) m_VoicePlayers[iClient] = false; // If we have a label for this guy, kill it. - if(pLabel) + if( pLabel ) { - pLabel->m_pBackground->setVisible(false); + pLabel->m_pBackground->setVisible( false ); pLabel->m_clientindex = -1; } } @@ -485,14 +450,13 @@ void CVoiceStatus::UpdateSpeakerStatus(int entindex, qboolean bTalking) RepositionLabels(); } - -void CVoiceStatus::UpdateServerState(bool bForce) +void CVoiceStatus::UpdateServerState( bool bForce ) { // Can't do anything when we're not in a level. char const *pLevelName = gEngfuncs.pfnGetLevelName(); if( pLevelName[0] == 0 ) { - if( gEngfuncs.pfnGetCvarFloat("voice_clientdebug") ) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { gEngfuncs.pfnConsolePrint( "CVoiceStatus::UpdateServerState: pLevelName[0]==0\n" ); } @@ -500,167 +464,177 @@ void CVoiceStatus::UpdateServerState(bool bForce) return; } - int bCVarModEnable = !!gEngfuncs.pfnGetCvarFloat("voice_modenable"); - if(bForce || m_bServerModEnable != bCVarModEnable) + int bCVarModEnable = !!gEngfuncs.pfnGetCvarFloat( "voice_modenable" ); + if( bForce || m_bServerModEnable != bCVarModEnable ) { m_bServerModEnable = bCVarModEnable; char str[256]; - _snprintf(str, sizeof(str), "VModEnable %d", m_bServerModEnable); - ServerCmd(str); - if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + sprintf( str, "VModEnable %d", m_bServerModEnable ); + ServerCmd( str ); + + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { char msg[256]; - sprintf(msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str); - gEngfuncs.pfnConsolePrint(msg); + + sprintf( msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str ); + gEngfuncs.pfnConsolePrint( msg ); } } - char str[2048]; - sprintf(str, "vban"); + char str[2048] = "vban"; + bool bChange = false; - for(unsigned long dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) + for( unsigned long dw = 0; dw < VOICE_MAX_PLAYERS_DW; dw++ ) { unsigned long serverBanMask = 0; unsigned long banMask = 0; - for(unsigned long i=0; i < 32; i++) + + for( unsigned long i = 0; i < 32; i++ ) { char playerID[16]; - if(!gEngfuncs.GetPlayerUniqueID(i+1, playerID)) + + if( !gEngfuncs.GetPlayerUniqueID( i + 1, playerID ) ) continue; - if(m_BanMgr.GetPlayerBan(playerID)) + if( m_BanMgr.GetPlayerBan( playerID ) ) banMask |= 1 << i; - if(m_ServerBannedPlayers[dw*32 + i]) + if( m_ServerBannedPlayers[dw * 32 + i] ) serverBanMask |= 1 << i; } - if(serverBanMask != banMask) + if( serverBanMask != banMask ) bChange = true; // Ok, the server needs to be updated. char numStr[512]; + sprintf(numStr, " %x", banMask); + strcat(str, numStr); } - if(bChange || bForce) + if( bChange || bForce ) { - if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { char msg[256]; - sprintf(msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str); - gEngfuncs.pfnConsolePrint(msg); + + sprintf( msg, "CVoiceStatus::UpdateServerState: Sending '%s'\n", str ); + + gEngfuncs.pfnConsolePrint( msg ); } - gEngfuncs.pfnServerCmdUnreliable(str); // Tell the server.. + gEngfuncs.pfnServerCmdUnreliable( str ); // Tell the server.. } else { - if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { gEngfuncs.pfnConsolePrint( "CVoiceStatus::UpdateServerState: no change\n" ); } } - + m_LastUpdateServerState = gEngfuncs.GetClientTime(); } -void CVoiceStatus::UpdateSpeakerImage(Label *pLabel, int iPlayer) +void CVoiceStatus::UpdateSpeakerImage( Label *pLabel, int iPlayer ) { - m_pBanButtons[iPlayer-1] = pLabel; - UpdateBanButton(iPlayer-1); + m_pBanButtons[iPlayer - 1] = pLabel; + UpdateBanButton(iPlayer - 1); } -void CVoiceStatus::UpdateBanButton(int iClient) +void CVoiceStatus::UpdateBanButton( int iClient ) { Label *pPanel = m_pBanButtons[iClient]; - if (!pPanel) + if( !pPanel ) return; char playerID[16]; extern bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] ); - if(!HACK_GetPlayerUniqueID(iClient+1, playerID)) + + if( !HACK_GetPlayerUniqueID( iClient + 1, playerID ) ) return; // Figure out if it's blinking or not. - bool bBlink = fmod(m_BlinkTimer, SCOREBOARD_BLINK_FREQUENCY*2) < SCOREBOARD_BLINK_FREQUENCY; + bool bBlink = fmod( m_BlinkTimer, SCOREBOARD_BLINK_FREQUENCY * 2 ) < SCOREBOARD_BLINK_FREQUENCY; bool bTalking = !!m_VoicePlayers[iClient]; - bool bBanned = m_BanMgr.GetPlayerBan(playerID); + bool bBanned = m_BanMgr.GetPlayerBan( playerID ); bool bNeverSpoken = !m_VoiceEnabledPlayers[iClient]; // Get the appropriate image to display on the panel. - if (bBanned) + if( bBanned ) { - pPanel->setImage(m_pScoreboardBanned); + pPanel->setImage( m_pScoreboardBanned ); } - else if (bTalking) + else if( bTalking ) { - if (bBlink) + if( bBlink ) { - pPanel->setImage(m_pScoreboardSpeaking2); + pPanel->setImage( m_pScoreboardSpeaking2 ); } else { - pPanel->setImage(m_pScoreboardSpeaking); + pPanel->setImage( m_pScoreboardSpeaking ); } - pPanel->setFgColor(255, 170, 0, 1); + + pPanel->setFgColor( 255, 170, 0, 1 ); } - else if (bNeverSpoken) + else if( bNeverSpoken ) { - pPanel->setImage(m_pScoreboardNeverSpoken); - pPanel->setFgColor(100, 100, 100, 1); + pPanel->setImage( m_pScoreboardNeverSpoken ); + pPanel->setFgColor( 100, 100, 100, 1 ); } else { - pPanel->setImage(m_pScoreboardNotSpeaking); + pPanel->setImage( m_pScoreboardNotSpeaking ); } } - -void CVoiceStatus::HandleVoiceMaskMsg(int iSize, void *pbuf) +void CVoiceStatus::HandleVoiceMaskMsg( int iSize, void *pbuf ) { BEGIN_READ( pbuf, iSize ); unsigned long dw; - for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) - { - m_AudiblePlayers.SetDWord(dw, (unsigned long)READ_LONG()); - m_ServerBannedPlayers.SetDWord(dw, (unsigned long)READ_LONG()); - if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + for( dw = 0; dw < VOICE_MAX_PLAYERS_DW; dw++ ) + { + m_AudiblePlayers.SetDWord( dw, (unsigned long)READ_LONG() ); + m_ServerBannedPlayers.SetDWord( dw, (unsigned long)READ_LONG() ); + + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { char str[256]; - gEngfuncs.pfnConsolePrint("CVoiceStatus::HandleVoiceMaskMsg\n"); - - sprintf(str, " - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord(dw)); - gEngfuncs.pfnConsolePrint(str); - - sprintf(str, " - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord(dw)); - gEngfuncs.pfnConsolePrint(str); + gEngfuncs.pfnConsolePrint( "CVoiceStatus::HandleVoiceMaskMsg\n" ); + + sprintf( str, " - m_AudiblePlayers[%d] = %lu\n", dw, m_AudiblePlayers.GetDWord( dw ) ); + gEngfuncs.pfnConsolePrint( str ); + + sprintf( str, " - m_ServerBannedPlayers[%d] = %lu\n", dw, m_ServerBannedPlayers.GetDWord( dw ) ); + gEngfuncs.pfnConsolePrint( str ); } } m_bServerModEnable = READ_BYTE(); } -void CVoiceStatus::HandleReqStateMsg(int iSize, void *pbuf) +void CVoiceStatus::HandleReqStateMsg( int iSize, void *pbuf ) { - if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { - gEngfuncs.pfnConsolePrint("CVoiceStatus::HandleReqStateMsg\n"); + gEngfuncs.pfnConsolePrint( "CVoiceStatus::HandleReqStateMsg\n" ); } - UpdateServerState(true); + UpdateServerState( true ); } void CVoiceStatus::StartSquelchMode() { - if(m_bInSquelchMode) + if( m_bInSquelchMode ) return; m_bInSquelchMode = true; @@ -678,37 +652,35 @@ bool CVoiceStatus::IsInSquelchMode() return m_bInSquelchMode; } -CVoiceLabel* CVoiceStatus::FindVoiceLabel(int clientindex) +CVoiceLabel *CVoiceStatus::FindVoiceLabel( int clientindex ) { - for(int i=0; i < MAX_VOICE_SPEAKERS; i++) + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) { - if(m_Labels[i].m_clientindex == clientindex) + if( m_Labels[i].m_clientindex == clientindex ) return &m_Labels[i]; } return NULL; } - -CVoiceLabel* CVoiceStatus::GetFreeVoiceLabel() +CVoiceLabel *CVoiceStatus::GetFreeVoiceLabel() { - return FindVoiceLabel(-1); + return FindVoiceLabel( -1 ); } - void CVoiceStatus::RepositionLabels() { // find starting position to draw from, along right-hand side of screen int y = ScreenHeight / 2; - + int iconWide = 8, iconTall = 8; if( m_pSpeakerLabelIcon ) { m_pSpeakerLabelIcon->getSize( iconWide, iconTall ); } - + // Reposition active labels. - for(int i = 0; i < MAX_VOICE_SPEAKERS; i++) + for( int i = 0; i < MAX_VOICE_SPEAKERS; i++ ) { CVoiceLabel *pLabel = &m_Labels[i]; @@ -721,24 +693,25 @@ void CVoiceStatus::RepositionLabels() } int textWide, textTall; + pLabel->m_pLabel->getContentSize( textWide, textTall ); // Don't let it stretch too far across their screen. - if( textWide > (ScreenWidth*2)/3 ) - textWide = (ScreenWidth*2)/3; + if( textWide > ( ScreenWidth * 2 ) / 3 ) + textWide = ( ScreenWidth * 2 ) / 3; // Setup the background label to fit everything in. int border = 2; - int bgWide = textWide + iconWide + border*3; - int bgTall = max( textTall, iconTall ) + border*2; + int bgWide = textWide + iconWide + border * 3; + int bgTall = max( textTall, iconTall ) + border * 2; pLabel->m_pBackground->setBounds( ScreenWidth - bgWide - 8, y, bgWide, bgTall ); // Put the text at the left. - pLabel->m_pLabel->setBounds( border, (bgTall - textTall) / 2, textWide, textTall ); + pLabel->m_pLabel->setBounds( border, ( bgTall - textTall ) / 2, textWide, textTall ); // Put the icon at the right. int iconLeft = border + textWide + border; - int iconTop = (bgTall - iconTall) / 2; + int iconTop = ( bgTall - iconTall ) / 2; if( pLabel->m_pIcon ) { pLabel->m_pIcon->setImage( m_pSpeakerLabelIcon ); @@ -748,22 +721,23 @@ void CVoiceStatus::RepositionLabels() y += bgTall + 2; } - if( m_pLocalBitmap && m_pAckBitmap && m_pLocalLabel && (m_bTalking || m_bServerAcked) ) + if( m_pLocalBitmap && m_pAckBitmap && m_pLocalLabel && ( m_bTalking || m_bServerAcked ) ) { - m_pLocalLabel->setParent(*m_pParentPanel); + m_pLocalLabel->setParent( *m_pParentPanel ); m_pLocalLabel->setVisible( true ); - if( m_bServerAcked && !!gEngfuncs.pfnGetCvarFloat("voice_clientdebug") ) + if( m_bServerAcked && !!gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) m_pLocalLabel->setImage( m_pAckBitmap ); else m_pLocalLabel->setImage( m_pLocalBitmap ); int sizeX, sizeY; - m_pLocalBitmap->getSize(sizeX, sizeY); + + m_pLocalBitmap->getSize( sizeX, sizeY ); int local_xPos = ScreenWidth - sizeX - 10; int local_yPos = m_pHelper->GetAckIconHeight() - sizeY; - + m_pLocalLabel->setPos( local_xPos, local_yPos ); } else @@ -772,7 +746,6 @@ void CVoiceStatus::RepositionLabels() } } - void CVoiceStatus::FreeBitmaps() { // Delete all the images we have loaded. @@ -804,16 +777,16 @@ void CVoiceStatus::FreeBitmaps() m_pScoreboardBanned = NULL; // Clear references to the images in panels. - for(int i=0; i < VOICE_MAX_PLAYERS; i++) + for( int i = 0; i < VOICE_MAX_PLAYERS; i++ ) { - if (m_pBanButtons[i]) + if( m_pBanButtons[i] ) { - m_pBanButtons[i]->setImage(NULL); + m_pBanButtons[i]->setImage( NULL ); } } - if(m_pLocalLabel) - m_pLocalLabel->setImage(NULL); + if( m_pLocalLabel ) + m_pLocalLabel->setImage( NULL ); } //----------------------------------------------------------------------------- @@ -821,13 +794,14 @@ void CVoiceStatus::FreeBitmaps() // Input : playerID - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- -bool CVoiceStatus::IsPlayerBlocked(int iPlayer) +bool CVoiceStatus::IsPlayerBlocked( int iPlayer ) { char playerID[16]; - if (!gEngfuncs.GetPlayerUniqueID(iPlayer, playerID)) + + if( !gEngfuncs.GetPlayerUniqueID( iPlayer, playerID ) ) return false; - return m_BanMgr.GetPlayerBan(playerID); + return m_BanMgr.GetPlayerBan( playerID ); } //----------------------------------------------------------------------------- @@ -835,9 +809,9 @@ bool CVoiceStatus::IsPlayerBlocked(int iPlayer) // Input : playerID - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- -bool CVoiceStatus::IsPlayerAudible(int iPlayer) +bool CVoiceStatus::IsPlayerAudible( int iPlayer ) { - return !!m_AudiblePlayers[iPlayer-1]; + return !!m_AudiblePlayers[iPlayer - 1]; } //----------------------------------------------------------------------------- @@ -845,30 +819,32 @@ bool CVoiceStatus::IsPlayerAudible(int iPlayer) // Input : playerID - // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- -void CVoiceStatus::SetPlayerBlockedState(int iPlayer, bool blocked) +void CVoiceStatus::SetPlayerBlockedState( int iPlayer, bool blocked ) { - if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { gEngfuncs.pfnConsolePrint( "CVoiceStatus::SetPlayerBlockedState part 1\n" ); } char playerID[16]; - if (!gEngfuncs.GetPlayerUniqueID(iPlayer, playerID)) + + if( !gEngfuncs.GetPlayerUniqueID( iPlayer, playerID ) ) return; - if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { gEngfuncs.pfnConsolePrint( "CVoiceStatus::SetPlayerBlockedState part 2\n" ); } // Squelch or (try to) unsquelch this player. - if (gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) + if( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { char str[256]; - sprintf(str, "CVoiceStatus::SetPlayerBlockedState: setting player %d ban to %d\n", iPlayer, !m_BanMgr.GetPlayerBan(playerID)); - gEngfuncs.pfnConsolePrint(str); + + sprintf( str, "CVoiceStatus::SetPlayerBlockedState: setting player %d ban to %d\n", iPlayer, !m_BanMgr.GetPlayerBan( playerID ) ); + gEngfuncs.pfnConsolePrint( str ); } m_BanMgr.SetPlayerBan( playerID, blocked ); - UpdateServerState(false); + UpdateServerState( false ); } diff --git a/game_shared/voice_status.h b/game_shared/voice_status.h index efc5e5c5..22bd864c 100644 --- a/game_shared/voice_status.h +++ b/game_shared/voice_status.h @@ -1,10 +1,9 @@ -//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= -#pragma once #if !defined(VOICE_STATUS_H) #define VOICE_STATUS_H @@ -20,17 +19,15 @@ #include "vgui_checkbutton2.h" #include "vgui_defaultinputsignal.h" - class CVoiceStatus; - class CVoiceLabel { public: - vgui::Label *m_pLabel; - vgui::Label *m_pBackground; + vgui::Label *m_pLabel; + vgui::Label *m_pBackground; vgui::ImagePanel *m_pIcon; // Voice icon next to player name. - int m_clientindex; // Client index of the speaker. -1 if this label isn't being used. + int m_clientindex; // Client index of the speaker. -1 if this label isn't being used. }; @@ -38,7 +35,7 @@ public: class IVoiceStatusHelper { public: - virtual ~IVoiceStatusHelper() {} + virtual ~IVoiceStatusHelper() {} // Get RGB color for voice status text about this player. virtual void GetPlayerTextColor(int entindex, int color[3]) = 0; @@ -47,7 +44,7 @@ public: virtual void UpdateCursorState() = 0; // Return the height above the bottom that the voice ack icons should be drawn at. - virtual int GetAckIconHeight() = 0; + virtual int GetAckIconHeight() = 0; // Return true if the voice manager is allowed to show speaker labels // (mods usually return false when the scoreboard is up). @@ -61,164 +58,148 @@ class VoiceImagePanel : public vgui::ImagePanel { virtual void paintBackground() { - if (_image!=null) + if( _image != null ) { vgui::Color col; - getFgColor(col); - _image->setColor(col); - _image->doPaint(this); + getFgColor( col ); + _image->setColor( col ); + _image->doPaint( this ); } } }; - class CVoiceStatus : public CHudBase, public vgui::CDefaultInputSignal { public: - CVoiceStatus(); + CVoiceStatus(); virtual ~CVoiceStatus(); -// CHudBase overrides. -public: + // CHudBase overrides. // Initialize the cl_dll's voice manager. - virtual int Init( - IVoiceStatusHelper *m_pHelper, - vgui::Panel **pParentPanel); - + virtual int Init( IVoiceStatusHelper *m_pHelper, vgui::Panel **pParentPanel ); + // ackPosition is the bottom position of where CVoiceStatus will draw the voice acknowledgement labels. - virtual int VidInit(); - - -public: + virtual int VidInit(); // Call from HUD_Frame each frame. - void Frame(double frametime); + void Frame( double frametime ); // Called when a player starts or stops talking. // entindex is -1 to represent the local client talking (before the data comes back from the server). // When the server acknowledges that the local client is talking, then entindex will be gEngfuncs.GetLocalPlayer(). // entindex is -2 to represent the local client's voice being acked by the server. - void UpdateSpeakerStatus(int entindex, qboolean bTalking); + void UpdateSpeakerStatus( int entindex, qboolean bTalking ); // sets the correct image in the label for the player - void UpdateSpeakerImage(vgui::Label *pLabel, int iPlayer); + void UpdateSpeakerImage( vgui::Label *pLabel, int iPlayer ); // Call from the HUD_CreateEntities function so it can add sprites above player heads. - void CreateEntities(); + void CreateEntities(); // Called when the server registers a change to who this client can hear. - void HandleVoiceMaskMsg(int iSize, void *pbuf); + void HandleVoiceMaskMsg( int iSize, void *pbuf ); // The server sends this message initially to tell the client to send their state. - void HandleReqStateMsg(int iSize, void *pbuf); + void HandleReqStateMsg( int iSize, void *pbuf ); - -// Squelch mode functions. -public: + // Squelch mode functions. // When you enter squelch mode, pass in - void StartSquelchMode(); - void StopSquelchMode(); - bool IsInSquelchMode(); + void StartSquelchMode(); + void StopSquelchMode(); + bool IsInSquelchMode(); // returns true if the target client has been banned // playerIndex is of range 1..maxplayers - bool IsPlayerBlocked(int iPlayerIndex); + bool IsPlayerBlocked( int iPlayerIndex ); // returns false if the player can't hear the other client due to game rules (eg. the other team) - bool IsPlayerAudible(int iPlayerIndex); + bool IsPlayerAudible( int iPlayerIndex ); // blocks the target client from being heard - void SetPlayerBlockedState(int iPlayerIndex, bool blocked); + void SetPlayerBlockedState( int iPlayerIndex, bool blocked ); -public: - - CVoiceLabel* FindVoiceLabel(int clientindex); // Find a CVoiceLabel representing the specified speaker. + CVoiceLabel *FindVoiceLabel( int clientindex ); // Find a CVoiceLabel representing the specified speaker. // Returns NULL if none. // entindex can be -1 if you want a currently-unused voice label. - CVoiceLabel* GetFreeVoiceLabel(); // Get an unused voice label. Returns NULL if none. + CVoiceLabel *GetFreeVoiceLabel(); // Get an unused voice label. Returns NULL if none. void RepositionLabels(); void FreeBitmaps(); - void UpdateServerState(bool bForce); + void UpdateServerState( bool bForce ); // Update the button artwork to reflect the client's current state. - void UpdateBanButton(int iClient); + void UpdateBanButton( int iClient ); + enum + { + MAX_VOICE_SPEAKERS = 7 + }; -public: + float m_LastUpdateServerState; // Last time we called this function. + int m_bServerModEnable; // What we've sent to the server about our "voice_modenable" cvar. - enum {MAX_VOICE_SPEAKERS=7}; - - float m_LastUpdateServerState; // Last time we called this function. - int m_bServerModEnable; // What we've sent to the server about our "voice_modenable" cvar. - - vgui::Panel **m_pParentPanel; - CPlayerBitVec m_VoicePlayers; // Who is currently talking. Indexed by client index. + vgui::Panel **m_pParentPanel; + CPlayerBitVec m_VoicePlayers; // Who is currently talking. Indexed by client index. // This is the gamerules-defined list of players that you can hear. It is based on what teams people are on // and is totally separate from the ban list. Indexed by client index. - CPlayerBitVec m_AudiblePlayers; + CPlayerBitVec m_AudiblePlayers; // Players who have spoken at least once in the game so far - CPlayerBitVec m_VoiceEnabledPlayers; + CPlayerBitVec m_VoiceEnabledPlayers; // This is who the server THINKS we have banned (it can become incorrect when a new player arrives on the server). // It is checked periodically, and the server is told to squelch or unsquelch the appropriate players. - CPlayerBitVec m_ServerBannedPlayers; + CPlayerBitVec m_ServerBannedPlayers; - cl_entity_s m_VoiceHeadModels[VOICE_MAX_PLAYERS]; // These aren't necessarily in the order of players. They are just - // a place for it to put data in during CreateEntities. + cl_entity_s m_VoiceHeadModels[VOICE_MAX_PLAYERS]; // These aren't necessarily in the order of players. They are just + // a place for it to put data in during CreateEntities. - IVoiceStatusHelper *m_pHelper; // Each mod provides an implementation of this. + IVoiceStatusHelper *m_pHelper; // Each mod provides an implementation of this. - // Scoreboard icons. - double m_BlinkTimer; // Blink scoreboard icons.. - vgui::BitmapTGA *m_pScoreboardNeverSpoken; - vgui::BitmapTGA *m_pScoreboardNotSpeaking; - vgui::BitmapTGA *m_pScoreboardSpeaking; - vgui::BitmapTGA *m_pScoreboardSpeaking2; - vgui::BitmapTGA *m_pScoreboardSquelch; - vgui::BitmapTGA *m_pScoreboardBanned; - - vgui::Label *m_pBanButtons[VOICE_MAX_PLAYERS]; // scoreboard buttons. + double m_BlinkTimer; // Blink scoreboard icons.. + vgui::BitmapTGA *m_pScoreboardNeverSpoken; + vgui::BitmapTGA *m_pScoreboardNotSpeaking; + vgui::BitmapTGA *m_pScoreboardSpeaking; + vgui::BitmapTGA *m_pScoreboardSpeaking2; + vgui::BitmapTGA *m_pScoreboardSquelch; + vgui::BitmapTGA *m_pScoreboardBanned; + + vgui::Label *m_pBanButtons[VOICE_MAX_PLAYERS]; // scoreboard buttons. // Squelch mode stuff. - bool m_bInSquelchMode; - - HSPRITE m_VoiceHeadModel; // Voice head model (goes above players who are speaking). - float m_VoiceHeadModelHeight; // Height above their head to place the model. + bool m_bInSquelchMode; - vgui::Image *m_pSpeakerLabelIcon; // Icon next to speaker labels. + HSPRITE m_VoiceHeadModel; // Voice head model (goes above players who are speaking). + float m_VoiceHeadModelHeight; // Height above their head to place the model. + + vgui::Image *m_pSpeakerLabelIcon; // Icon next to speaker labels. // Lower-right icons telling when the local player is talking.. - vgui::BitmapTGA *m_pLocalBitmap; // Represents the local client talking. - vgui::BitmapTGA *m_pAckBitmap; // Represents the server ack'ing the client talking. - vgui::ImagePanel *m_pLocalLabel; // Represents the local client talking. + vgui::BitmapTGA *m_pLocalBitmap; // Represents the local client talking. + vgui::BitmapTGA *m_pAckBitmap; // Represents the server ack'ing the client talking. + vgui::ImagePanel *m_pLocalLabel; // Represents the local client talking. - bool m_bTalking; // Set to true when the client thinks it's talking. - bool m_bServerAcked; // Set to true when the server knows the client is talking. + bool m_bTalking; // Set to true when the client thinks it's talking. + bool m_bServerAcked; // Set to true when the server knows the client is talking. -public: - - CVoiceBanMgr m_BanMgr; // Tracks which users we have squelched and don't want to hear. + CVoiceBanMgr m_BanMgr; // Tracks which users we have squelched and don't want to hear. -public: - - bool m_bBanMgrInitialized; + bool m_bBanMgrInitialized; // Labels telling who is speaking. - CVoiceLabel m_Labels[MAX_VOICE_SPEAKERS]; + CVoiceLabel m_Labels[MAX_VOICE_SPEAKERS]; // Cache the game directory for use when we shut down - char * m_pchGameDir; + char *m_pchGameDir; }; - -// Get the (global) voice manager. +// Get the (global) voice manager. CVoiceStatus* GetClientVoiceMgr(); #endif // VOICE_STATUS_H + diff --git a/game_shared/voice_vgui_tweakdlg.cpp b/game_shared/voice_vgui_tweakdlg.cpp index 07f02ad7..ea61f509 100644 --- a/game_shared/voice_vgui_tweakdlg.cpp +++ b/game_shared/voice_vgui_tweakdlg.cpp @@ -9,7 +9,6 @@ #include "../cl_dll/cl_util.h" #include "../cl_dll/vgui_teamfortressviewport.h" - #include "vgui_actionsignal.h" #include "voice_vgui_tweakdlg.h" #include "voice_vgui_tweakdlg.h" @@ -21,20 +20,18 @@ #include "vgui_checkbutton2.h" #include "vgui_helpers.h" - -#define ITEM_BORDER 40 // Border between text and scrollbars on left and right. +#define ITEM_BORDER 40 // Border between text and scrollbars on left and right. #define VOICETWEAK_TRANSPARENCY 150 - class TweakScroller { public: - TweakScroller(); - void Init(Panel *pParent, char *pText, int yPos); + TweakScroller(); + void Init( Panel *pParent, char *pText, int yPos ); // Get/set value. Values are 0-1. float GetValue(); - void SetValue(float val); + void SetValue( float val ); public: Label m_Label; @@ -46,48 +43,36 @@ public: class CVoiceVGUITweakDlg : public CMenuPanel, public ICheckButton2Handler { typedef CMenuPanel BaseClass; - public: - CVoiceVGUITweakDlg(); - ~CVoiceVGUITweakDlg(); + CVoiceVGUITweakDlg(); + ~CVoiceVGUITweakDlg(); -// CMenuPanel overrides. -public: + // CMenuPanel overrides. virtual void Open(); virtual void Close(); - -// ICheckButton2Handler overrides. -public: - + // ICheckButton2Handler overrides. virtual void StateChanged(CCheckButton2 *pButton); - - -// Panel overrides. -public: + // Panel overrides. virtual void paintBackground(); - private: + int m_DlgWidth; + int m_DlgHeight; - int m_DlgWidth; - int m_DlgHeight; + Label m_Label; - Label m_Label; - - IVoiceTweak *m_pVoiceTweak; // Engine voice tweak API. + IVoiceTweak *m_pVoiceTweak; // Engine voice tweak API. - TweakScroller m_MicVolume; - TweakScroller m_SpeakerVolume; + TweakScroller m_MicVolume; + TweakScroller m_SpeakerVolume; - CCheckButton2 m_VoiceModEnable; - - Button m_Button_OK; + CCheckButton2 m_VoiceModEnable; + + Button m_Button_OK; }; - - bool g_bTweakDlgOpen = false; bool IsTweakDlgOpen() @@ -95,107 +80,97 @@ bool IsTweakDlgOpen() return g_bTweakDlgOpen; } - - // ------------------------------------------------------------------------ // // Global functions. // ------------------------------------------------------------------------ // - static CVoiceVGUITweakDlg g_VoiceTweakDlg; -CMenuPanel* GetVoiceTweakDlg() + +CMenuPanel *GetVoiceTweakDlg() { return &g_VoiceTweakDlg; } - class CVoiceTweakOKButton : public ActionSignal { public: - virtual void actionPerformed(Panel *pPanel) + virtual void actionPerformed( Panel *pPanel ) { gViewPort->HideVGUIMenu(); } }; + CVoiceTweakOKButton g_OKButtonSignal; - - // ------------------------------------------------------------------------ // // TweakScroller // ------------------------------------------------------------------------ // - TweakScroller::TweakScroller() : - m_Label(""), - m_Scroll(0,0,0,0,false), - m_Slider(0,0,10,10,false) + m_Label( "" ), + m_Scroll( 0, 0, 0, 0, false ), + m_Slider( 0, 0, 10, 10, false ) { } - -void TweakScroller::Init(Panel *pParent, char *pText, int yPos) +void TweakScroller::Init( Panel *pParent, char *pText, int yPos ) { int parentWidth, parentHeight; - pParent->getSize(parentWidth, parentHeight); + + pParent->getSize( parentWidth, parentHeight ); // Setup the volume scroll bar. - m_Label.setParent(pParent); - m_Label.setFont(Scheme::sf_primary1); - m_Label.setContentAlignment(vgui::Label::a_northwest); - m_Label.setBgColor(0, 0, 0, 255); - m_Label.setFgColor(255,255,255,0); - m_Label.setPos(ITEM_BORDER, yPos); - m_Label.setSize(parentWidth/2-ITEM_BORDER, 20); - m_Label.setText(pText); - m_Label.setVisible(true); + m_Label.setParent( pParent ); + m_Label.setFont( Scheme::sf_primary1 ); + m_Label.setContentAlignment( vgui::Label::a_northwest ); + m_Label.setBgColor( 0, 0, 0, 255 ); + m_Label.setFgColor( 255, 255, 255, 0 ); + m_Label.setPos( ITEM_BORDER, yPos ); + m_Label.setSize( parentWidth / 2 - ITEM_BORDER, 20 ); + m_Label.setText( pText ); + m_Label.setVisible( true ); - m_Slider.setRangeWindow(10); - m_Slider.setRangeWindowEnabled(true); - - m_Scroll.setPos(parentWidth/2+ITEM_BORDER, yPos); - m_Scroll.setSize(parentWidth/2-ITEM_BORDER*2, 20); - m_Scroll.setSlider(&m_Slider); - m_Scroll.setParent(pParent); - m_Scroll.setRange(0, 100); - m_Scroll.setFgColor(255,255,255,0); - m_Scroll.setBgColor(255,255,255,0); + m_Slider.setRangeWindow( 10 ); + m_Slider.setRangeWindowEnabled( true ); + + m_Scroll.setPos( parentWidth / 2 + ITEM_BORDER, yPos ); + m_Scroll.setSize( parentWidth / 2 - ITEM_BORDER * 2, 20 ); + m_Scroll.setSlider( &m_Slider ); + m_Scroll.setParent( pParent ); + m_Scroll.setRange( 0, 100 ); + m_Scroll.setFgColor( 255, 255, 255, 0 ); + m_Scroll.setBgColor( 255, 255, 255, 0 ); } - float TweakScroller::GetValue() { return m_Scroll.getValue() / 100.0f; } - -void TweakScroller::SetValue(float val) +void TweakScroller::SetValue( float val ) { - m_Scroll.setValue((int)(val * 100.0f)); + m_Scroll.setValue( (int)( val * 100.0f ) ); } - // ------------------------------------------------------------------------ // // CVoiceVGUITweakDlg implementation. // ------------------------------------------------------------------------ // CVoiceVGUITweakDlg::CVoiceVGUITweakDlg() - : CMenuPanel(VOICETWEAK_TRANSPARENCY, false, 0, 0, 0, 0), - m_Button_OK("",0,0), - m_Label("") + : CMenuPanel( VOICETWEAK_TRANSPARENCY, false, 0, 0, 0, 0 ), + m_Button_OK( "", 0, 0 ), + m_Label( "" ) { m_pVoiceTweak = NULL; - m_Button_OK.addActionSignal(&g_OKButtonSignal); - m_Label.setBgColor(255,255,255,200); + m_Button_OK.addActionSignal( &g_OKButtonSignal ); + m_Label.setBgColor( 255, 255, 255, 200 ); } - CVoiceVGUITweakDlg::~CVoiceVGUITweakDlg() { } - void CVoiceVGUITweakDlg::Open() { - if(g_bTweakDlgOpen) + if( g_bTweakDlgOpen ) return; g_bTweakDlgOpen = true; @@ -209,46 +184,48 @@ void CVoiceVGUITweakDlg::Open() m_pVoiceTweak->StartVoiceTweakMode(); // Set our size. - setPos((ScreenWidth - m_DlgWidth) / 2, (ScreenHeight - m_DlgHeight) / 2); - setSize(m_DlgWidth, m_DlgHeight); + setPos( ( ScreenWidth - m_DlgWidth ) / 2, ( ScreenHeight - m_DlgHeight ) / 2 ); + setSize( m_DlgWidth, m_DlgHeight ); int curY = ITEM_BORDER; - m_MicVolume.Init(this, gHUD.m_TextMessage.BufferedLocaliseTextString("#Mic_Volume"), curY); - m_MicVolume.SetValue(m_pVoiceTweak->GetControlFloat(MicrophoneVolume)); - curY = PanelBottom(&m_MicVolume.m_Label); + m_MicVolume.Init( this, gHUD.m_TextMessage.BufferedLocaliseTextString( "#Mic_Volume" ), curY ); + m_MicVolume.SetValue( m_pVoiceTweak->GetControlFloat( MicrophoneVolume ) ); + curY = PanelBottom( &m_MicVolume.m_Label ); - m_SpeakerVolume.Init(this, gHUD.m_TextMessage.BufferedLocaliseTextString("#Speaker_Volume"), curY); - m_SpeakerVolume.SetValue(m_pVoiceTweak->GetControlFloat(OtherSpeakerScale)); - curY = PanelBottom(&m_SpeakerVolume.m_Label); + m_SpeakerVolume.Init( this, gHUD.m_TextMessage.BufferedLocaliseTextString( "#Speaker_Volume" ), curY ); + m_SpeakerVolume.SetValue( m_pVoiceTweak->GetControlFloat( OtherSpeakerScale ) ); + curY = PanelBottom( &m_SpeakerVolume.m_Label ); - m_VoiceModEnable.setParent(this); - m_VoiceModEnable.SetImages("gfx/vgui/checked.tga", "gfx/vgui/unchecked.tga"); - m_VoiceModEnable.SetText("Enable Voice In This Mod"); - m_VoiceModEnable.setPos(ITEM_BORDER, curY); - m_VoiceModEnable.SetCheckboxLeft(false); - m_VoiceModEnable.SetChecked(!!gEngfuncs.pfnGetCvarFloat("voice_modenable")); - m_VoiceModEnable.SetHandler(this); + m_VoiceModEnable.setParent( this ); + m_VoiceModEnable.SetImages( "gfx/vgui/checked.tga", "gfx/vgui/unchecked.tga" ); + m_VoiceModEnable.SetText( "Enable Voice In This Mod" ); + m_VoiceModEnable.setPos( ITEM_BORDER, curY ); + m_VoiceModEnable.SetCheckboxLeft( false ); + m_VoiceModEnable.SetChecked( !!gEngfuncs.pfnGetCvarFloat( "voice_modenable" ) ); + m_VoiceModEnable.SetHandler( this ); // Setup the OK button. int buttonWidth, buttonHeight; - m_Button_OK.setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Menu_OK")); - m_Button_OK.getSize(buttonWidth, buttonHeight); - m_Button_OK.setPos((m_DlgWidth - buttonWidth) / 2, m_DlgHeight - buttonHeight - 3); - m_Button_OK.setParent(this); + + m_Button_OK.setText( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Menu_OK" ) ); + m_Button_OK.getSize( buttonWidth, buttonHeight ); + m_Button_OK.setPos(( m_DlgWidth - buttonWidth ) / 2, m_DlgHeight - buttonHeight - 3 ); + m_Button_OK.setParent( this ); // Put the label on the top. - m_Label.setBgColor(0, 0, 0, 255); - m_Label.setFgColor(255,255,255,0); - m_Label.setText(gHUD.m_TextMessage.BufferedLocaliseTextString("#Voice_Properties")); + m_Label.setBgColor( 0, 0, 0, 255 ); + m_Label.setFgColor( 255, 255, 255, 0 ); + m_Label.setText( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Voice_Properties" ) ); + int labelWidth, labelHeight; - m_Label.getSize(labelWidth, labelHeight); - m_Label.setPos((m_DlgWidth - labelWidth) / 2, 5); - m_Label.setParent(this); + + m_Label.getSize( labelWidth, labelHeight ); + m_Label.setPos( ( m_DlgWidth - labelWidth ) / 2, 5 ); + m_Label.setParent( this ); BaseClass::Open(); } - void CVoiceVGUITweakDlg::Close() { m_pVoiceTweak->EndVoiceTweakMode(); @@ -257,33 +234,33 @@ void CVoiceVGUITweakDlg::Close() BaseClass::Close(); } - void CVoiceVGUITweakDlg::paintBackground() { BaseClass::paintBackground(); // Draw our border. - int w,h; - getSize(w,h); + int w, h; - drawSetColor(128,128,128,1); - drawOutlinedRect(0, 0, w, h); + getSize( w, h ); + + drawSetColor( 128, 128, 128, 1 ); + drawOutlinedRect( 0, 0, w, h ); float volume = m_MicVolume.GetValue(); - m_pVoiceTweak->SetControlFloat(MicrophoneVolume, volume); + m_pVoiceTweak->SetControlFloat( MicrophoneVolume, volume ); - m_pVoiceTweak->SetControlFloat(OtherSpeakerScale, m_SpeakerVolume.GetValue()); + m_pVoiceTweak->SetControlFloat( OtherSpeakerScale, m_SpeakerVolume.GetValue() ); } -void CVoiceVGUITweakDlg::StateChanged(CCheckButton2 *pButton) +void CVoiceVGUITweakDlg::StateChanged( CCheckButton2 *pButton ) { - if(pButton == &m_VoiceModEnable) + if( pButton == &m_VoiceModEnable ) { - if(pButton->IsChecked()) - gEngfuncs.pfnClientCmd("voice_modenable 1"); + if( pButton->IsChecked() ) + gEngfuncs.pfnClientCmd( "voice_modenable 1" ); else - gEngfuncs.pfnClientCmd("voice_modenable 0"); + gEngfuncs.pfnClientCmd( "voice_modenable 0" ); } } diff --git a/game_shared/voice_vgui_tweakdlg.h b/game_shared/voice_vgui_tweakdlg.h index 960a8d85..21af03ae 100644 --- a/game_shared/voice_vgui_tweakdlg.h +++ b/game_shared/voice_vgui_tweakdlg.h @@ -5,17 +5,16 @@ // $NoKeywords: $ //============================================================================= #pragma once -#if !defined(VOICE_VGUI_TWEAKDLG_H) +#ifndef VOICE_VGUI_TWEAKDLG_H #define VOICE_VGUI_TWEAKDLG_H class CMenuPanel; - // Returns true if the tweak dialog is currently up. bool IsTweakDlgOpen(); // Returns a global instance of the tweak dialog. -CMenuPanel* GetVoiceTweakDlg(); - +CMenuPanel *GetVoiceTweakDlg(); #endif // VOICE_VGUI_TWEAKDLG_H + diff --git a/vgui-dev b/vgui-dev new file mode 160000 index 00000000..93573075 --- /dev/null +++ b/vgui-dev @@ -0,0 +1 @@ +Subproject commit 93573075afe885618ea15831e72d44bdacd65bfb From 504e8b19d5947d5201da9ec48d580a668016e4f0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 27 Oct 2021 21:20:03 +0300 Subject: [PATCH 168/298] Handle key input in vgui (#198) --- cl_dll/input.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index d0267f9b..d11abf56 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -380,7 +380,11 @@ Return 1 to allow engine to process the key, otherwise, act on it as needed ============ */ int DLLEXPORT HUD_Key_Event( int down, int keynum, const char *pszCurrentBinding ) -{ +{ +#if USE_VGUI + if (gViewPort) + return gViewPort->KeyInput(down, keynum, pszCurrentBinding); +#endif return 1; } From 548fb6e82ce5bddc1c20bf30d9161782d603ef15 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 27 Oct 2021 21:20:55 +0300 Subject: [PATCH 169/298] gitignore: ignore cmake artifacts --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3e46defd..42594b50 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ *.dll *.pdb build/ -CMakeLists.txt.user +CMakeLists.txt.* cmake_install.cmake *.orig *.cbp @@ -25,4 +25,7 @@ waf3-* *.pyc .vscode/ .vs/ -CMakeSettings.json \ No newline at end of file +CMakeSettings.json +CMakeFiles +CMakeCache.txt +Makefile From 5c6b660e9443a01839c0c8bebe46eed280134edd Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 27 Oct 2021 21:21:36 +0300 Subject: [PATCH 170/298] public: sync build.h with engine --- public/build.h | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/public/build.h b/public/build.h index abfe1902..a7bb78f4 100644 --- a/public/build.h +++ b/public/build.h @@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to */ #pragma once -#if !defined(BUILD_H) +#ifndef BUILD_H #define BUILD_H // All XASH_* macros set by this header are guaranteed to have positive value otherwise not defined @@ -35,10 +35,10 @@ For more information, please refer to // Any new define must be undefined at first // You can generate #undef list below with this oneliner: // $ cat build.h | sed 's/\t//g' | grep '^#define XASH' | awk '{ print $2 }' | sort | uniq | awk '{ print "#undef " $1 }' -// +// // So in various buildscripts you can grep for ^#undef XASH and select only second word // or in another oneliner: -// $ cat build.h | grep '^#undef XASH' | awk '{ print $2 }' +// $ cat build.h | grep '^#undef XASH' | awk '{ print $2 }' #undef XASH_64BIT #undef XASH_AMD64 @@ -52,22 +52,28 @@ For more information, please refer to #undef XASH_ARMv6 #undef XASH_ARMv7 #undef XASH_ARMv8 -//#undef XASH_BIG_ENDIAN +#undef XASH_BIG_ENDIAN #undef XASH_BSD +#undef XASH_DOS4GW #undef XASH_E2K #undef XASH_EMSCRIPTEN #undef XASH_FREEBSD +#undef XASH_HAIKU #undef XASH_IOS #undef XASH_JS #undef XASH_LINUX -//#undef XASH_LITTLE_ENDIAN +#undef XASH_LITTLE_ENDIAN #undef XASH_MINGW #undef XASH_MIPS #undef XASH_MOBILE_PLATFORM #undef XASH_MSVC #undef XASH_NETBSD #undef XASH_OPENBSD -#undef XASH_HAIKU +#undef XASH_POSIX +#undef XASH_RISCV +#undef XASH_RISCV_DOUBLEFP +#undef XASH_RISCV_SINGLEFP +#undef XASH_RISCV_SOFTFP #undef XASH_WIN32 #undef XASH_WIN64 #undef XASH_X86 @@ -133,8 +139,12 @@ For more information, please refer to // //================================================================ -#if defined(XASH_LITTLE_ENDIAN) && defined(XASH_BIG_ENDIAN) - #error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined" +#if defined(XASH_FORCE_LITTLE_ENDIAN) && defined(XASH_FORCE_BIG_ENDIAN) + #error "Both XASH_FORCE_LITTLE_ENDIAN and XASH_FORCE_BIG_ENDIAN are defined" +#elif defined(XASH_FORCE_LITTLE_ENDIAN) + #define XASH_LITTLE_ENDIAN 1 +#elif defined(XASH_FORCE_BIG_ENDIAN) + #define XASH_BIG_ENDIAN 1 #endif #if !defined(XASH_LITTLE_ENDIAN) && !defined(XASH_BIG_ENDIAN) @@ -207,6 +217,25 @@ For more information, please refer to #elif defined __e2k__ #define XASH_64BIT 1 #define XASH_E2K 1 +#elif defined __riscv + #define XASH_RISCV 1 + #if __riscv_xlen == 64 + #define XASH_64BIT + #elif __riscv_xlen == 32 + // ... + #else + #error "Unknown RISC-V ABI" + #endif + + #if defined __riscv_float_abi_soft + #define XASH_RISCV_SOFTFP + #elif defined __riscv_float_abi_single + #define XASH_RISCV_SINGLEFP + #elif defined __riscv_float_abi_double + #define XASH_RISCV_DOUBLEFP + #else + #error "Unknown RISC-V float ABI" + #endif #else #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" #endif From d7123abd50b4c4ce5ac91c332bc667fd08df52e4 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 27 Oct 2021 21:22:01 +0300 Subject: [PATCH 171/298] Update library naming for RISC-V and MIPS64 support --- cmake/LibraryNaming.cmake | 33 ++++++++++++++++++++++++++---- scripts/waifulib/library_naming.py | 31 ++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index cbea3f72..514313ff 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -1,6 +1,7 @@ include(CheckSymbolExists) # generated(see comments in public/build.h) +# cat build.h | grep '^#undef XASH' | awk '{ print "check_symbol_exists(" $2 " \"build.h\" " $2 ")" }' set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/") check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) @@ -16,9 +17,11 @@ 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_DOS4GW "build.h" XASH_DOS4GW) check_symbol_exists(XASH_E2K "build.h" XASH_E2K) check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN) check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD) +check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU) check_symbol_exists(XASH_IOS "build.h" XASH_IOS) check_symbol_exists(XASH_JS "build.h" XASH_JS) check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX) @@ -29,7 +32,11 @@ 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_POSIX "build.h" XASH_POSIX) +check_symbol_exists(XASH_RISCV "build.h" XASH_RISCV) +check_symbol_exists(XASH_RISCV_DOUBLEFP "build.h" XASH_RISCV_DOUBLEFP) +check_symbol_exists(XASH_RISCV_SINGLEFP "build.h" XASH_RISCV_SINGLEFP) +check_symbol_exists(XASH_RISCV_SOFTFP "build.h" XASH_RISCV_SOFTFP) 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) @@ -81,10 +88,28 @@ elseif(XASH_ARM) else() set(BUILDARCH "${BUILDARCH}l") endif() -elseif(XASH_MIPS AND XASH_BIG_ENDIAN) +elseif(XASH_MIPS) set(BUILDARCH "mips") -elseif(XASH_MIPS AND XASH_LITTLE_ENDIAN) - set(BUILDARCH "mipsel") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + endif() + + if(XASH_LITTLE_ENDIAN) + set(BUILDARCH "${BUILDARCH}el") + endif() +elseif(XASH_RISCV) + set(BUILDARCH "riscv") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + else() + set(BUILDARCH "${BUILDARCH}32") + endif() + + if(XASH_RISCV_DOUBLEFP) + set(BUILDARCH "${BUILDARCH}d") + elseif(XASH_RISCV_SINGLEFP) + set(BUILDARCH "${BUILDARCH}f") + endif() elseif(XASH_JS) set(BUILDARCH "javascript") elseif(XASH_E2K) diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index baf2ee71..dd825088 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -19,6 +19,8 @@ int main(int argc, char** argv) } ''' +# generated(see comments in public/build.h) +# cat build.h | grep '^#undef XASH' | awk '{ print "'\''" $2 "'\''," }' DEFINES = [ 'XASH_64BIT', 'XASH_AMD64', @@ -34,9 +36,11 @@ DEFINES = [ 'XASH_ARMv8', 'XASH_BIG_ENDIAN', 'XASH_BSD', +'XASH_DOS4GW', 'XASH_E2K', 'XASH_EMSCRIPTEN', 'XASH_FREEBSD', +'XASH_HAIKU', 'XASH_IOS', 'XASH_JS', 'XASH_LINUX', @@ -47,12 +51,14 @@ DEFINES = [ 'XASH_MSVC', 'XASH_NETBSD', 'XASH_OPENBSD', -'XASH_HAIKU', +'XASH_POSIX', +'XASH_RISCV', +'XASH_RISCV_DOUBLEFP', +'XASH_RISCV_SINGLEFP', +'XASH_RISCV_SOFTFP', 'XASH_WIN32', 'XASH_WIN64', 'XASH_X86', -'XASH_DOS4GW', -'XASH_POSIX' ] def configure(conf): @@ -111,10 +117,23 @@ def configure(conf): buildarch += "hf" else: buildarch += "l" - elif conf.env.XASH_MIPS and conf.env.XASH_BIG_ENDIAN: + elif conf.env.XASH_MIPS: buildarch = "mips" - elif conf.env.XASH_MIPS and conf.env.XASH_LITTLE_ENDIAN: - buildarch = "mipsel" + if conf.env.XASH_64BIT: + buildarch += "64" + if conf.env.XASH_LITTLE_ENDIAN: + buildarch += "el" + elif conf.env.XASH_RISCV: + buildarch = "riscv" + if conf.env.XASH_64BIT: + buildarch += "64" + else: + buildarch += "32" + + if conf.env.XASH_RISCV_DOUBLEFP: + buildarch += "d" + elif conf.env.XASH_RISCV_SINGLEFP: + buildarch += "f" elif conf.env.XASH_JS: buildarch = "javascript" elif conf.env.XASH_E2K: From 9fde15075b18e5333e1be5d17353bdd06faf8071 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 27 Oct 2021 21:22:32 +0300 Subject: [PATCH 172/298] cmake: fix minor 64BIT checks --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7321d4c8..12b296cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT) error("UNDONE: set 32 build flags") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") endif() set(CMAKE_SIZEOF_VOID_P 4) @@ -73,7 +73,7 @@ endif() # see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/library-naming.md include(LibraryNaming) -if(64BIT) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) message(STATUS "Building for 64 Bit") else() message(STATUS "Building for 32 Bit") From da7322ba387920b99c2390eec3292f90daef17bf Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 28 Oct 2021 20:12:01 +0300 Subject: [PATCH 173/298] public: sync build.h with engine --- public/build.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/build.h b/public/build.h index a7bb78f4..6e1f326d 100644 --- a/public/build.h +++ b/public/build.h @@ -121,7 +121,7 @@ For more information, please refer to #define XASH_EMSCRIPTEN 1 #elif defined __WATCOMC__ && defined __DOS__ #define XASH_DOS4GW 1 - #define XASH_LITTLE_ENDIAN + #define XASH_LITTLE_ENDIAN 1 #elif defined __HAIKU__ #define XASH_HAIKU 1 #define XASH_POSIX 1 @@ -220,7 +220,7 @@ For more information, please refer to #elif defined __riscv #define XASH_RISCV 1 #if __riscv_xlen == 64 - #define XASH_64BIT + #define XASH_64BIT 1 #elif __riscv_xlen == 32 // ... #else @@ -228,11 +228,11 @@ For more information, please refer to #endif #if defined __riscv_float_abi_soft - #define XASH_RISCV_SOFTFP + #define XASH_RISCV_SOFTFP 1 #elif defined __riscv_float_abi_single - #define XASH_RISCV_SINGLEFP + #define XASH_RISCV_SINGLEFP 1 #elif defined __riscv_float_abi_double - #define XASH_RISCV_DOUBLEFP + #define XASH_RISCV_DOUBLEFP 1 #else #error "Unknown RISC-V float ABI" #endif From db4cd7846de57007b9ccdecd9e3905acf5c1f3d9 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 28 Oct 2021 20:23:12 +0300 Subject: [PATCH 174/298] Support cmake older than 3.7 (#203) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12b296cf..ab3160c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,8 @@ cmake_minimum_required(VERSION 2.8.12) -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0") - cmake_policy(SET CMP0091 NEW) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0") + cmake_policy(SET CMP0091 NEW) endif() # Install custom module path From b3804d5ad833cb8a6e4bad5506c2aefb3d0b52f3 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 3 Nov 2021 20:52:12 +0300 Subject: [PATCH 175/298] Remove redundant dependency on ws2_32 (#204) --- cl_dll/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 8e8e3fb2..5402372a 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -187,7 +187,6 @@ if (USE_VGUI) set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.dll") set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.lib") target_link_libraries(${CLDLL_LIBRARY} vgui) - target_link_libraries(${CLDLL_LIBRARY} ws2_32) elseif(APPLE) target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui-dev/lib vgui.dylib") else() From 6802cda932749ac7a5bd0cd0b7a7c297a8d35856 Mon Sep 17 00:00:00 2001 From: Aydar Zarifullin Date: Wed, 3 Nov 2021 21:53:42 +0400 Subject: [PATCH 176/298] premake5.lua: update (#196) add arch suffix to library names change mechanism of checking header files existence add vgui-related options --- contrib/iZarif/premake5.lua | 145 ++++++++++++++++++---- contrib/iZarif/xash.lua | 240 ++++++++++++++++++++++++++++++++++++ 2 files changed, 359 insertions(+), 26 deletions(-) create mode 100644 contrib/iZarif/xash.lua diff --git a/contrib/iZarif/premake5.lua b/contrib/iZarif/premake5.lua index 97d3e7dd..91817da5 100644 --- a/contrib/iZarif/premake5.lua +++ b/contrib/iZarif/premake5.lua @@ -1,3 +1,5 @@ +local xash = require("xash") + workspace("hlsdk-xash3d") configurations{"Debug", "Release"} language("C++") @@ -40,29 +42,76 @@ defines{"BARNACLE_FIX_VISIBILITY=0", "OEM_BUILD=0", "HLDEMO_BUILD=0"} +newoption{trigger = "toolset-prefix", description = "Prefix for crosscompiler (should contain the final dash)"} + +xash.prefix = _OPTIONS["toolset-prefix"] +xash.find_cxx_compiler() + newoption{trigger = "64bits", description = "Allow targetting 64-bit engine", default = false} -newoption{trigger = "voicemgr", description = "Eable voice manager", default = false} +newoption{trigger = "voicemgr", description = "Enable voice manager", default = false} newoption{trigger = "goldsrc", description = "Enable GoldSource engine support", default = false} newoption{trigger = "lto", description = "Enable Link Time Optimization", default = false} -if _OPTIONS["64bits"] then - architecture("x86_64") -else - architecture("x86") -end +newoption{trigger = "arch", description = "Destination arch", default = xash.get_arch(), allowed = { + {"amd64", ""}, + {"x86", ""}, + {"arm64", ""}, + {"armv8_32l", ""}, + {"armv7l", ""}, + {"armv6l", ""}, + {"armv5l", ""}, + {"armv4l", ""}, + {"armv8_32hf", ""}, + {"armv7hf", ""}, + {"armv6hf", ""}, + {"armv5hf", ""}, + {"armv4hf", ""}, + {"mips64", ""}, + {"mipsel", ""}, + {"riscv32d", ""}, + {"riscv32f", ""}, + {"riscv64d", ""}, + {"riscv64f", ""}, + {"javascript", ""}, + {"e2k", ""} +}} -if _OPTIONS["lto"] then - flags{"LinkTimeOptimization"} -end +newoption{trigger = "bsd-flavour", description = "BSD flavour", allowed = { + {"freebsd", ""}, + {"openbsd", ""}, + {"netbsd", ""} +}} -if os.findheader("tgmath.h") then +newoption{trigger = "vgui", description = "Enable VGUI1", default = false} +newoption{trigger = "novgui-motd", description = "Prefer non-VGUI MOTD when VGUI is enabled", default = false} +newoption{trigger = "novgui-scoreboard", description = "Prefer non-VGUI scoreboard when VGUI is enabled", default = false} + +xash.bsd_flavour = _OPTIONS["bsd-flavour"] + +if xash.is_cxx_header_exist("tgmath.h") then defines{"HAVE_TGMATH_H"} end -if os.findheader("cmath") then +if xash.is_cxx_header_exist("cmath") then defines{"HAVE_CMATH"} end +if xash.prefix then + gccprefix(xash.prefix) +end + +if _OPTIONS["arch"] == "amd64" then + if not _OPTIONS["64bits"] then + xash.arch = "x86" + architecture(xash.arch) + end +end + +targetsuffix(xash.get_lib_suffix()) + +filter("options:lto") +flags{"LinkTimeOptimization"} + filter("configurations:Release") optimize("Full") symbols("Off") @@ -77,7 +126,7 @@ filter("toolset:msc") buildoptions{"/D_USING_V110_SDK71_", "/Zc:threadSafeInit-"} defines{"_CRT_SECURE_NO_WARNINGS=1", "_CRT_NONSTDC_NO_DEPRECATE=1"} -filter("toolset:gcc or clang") +filter("toolset:not msc") visibility("Hidden") defines{"stricmp=strcasecmp", "strnicmp=strncasecmp", @@ -177,11 +226,11 @@ files{"dlls/agrunt.cpp", includedirs{"public"} -if _OPTIONS["voicemgr"] then - files{"game_shared/voice_gamemgr.cpp"} -else - defines{"NO_VOICEGAMEMGR"} -end +filter("options:voicemgr") +files{"game_shared/voice_gamemgr.cpp"} + +filter("options:not voicemgr") +defines{"NO_VOICEGAMEMGR"} filter("toolset:msc") buildoptions{"/def:" .. path.getabsolute("dlls/hl.def")} @@ -194,7 +243,6 @@ files{"cl_dll/hl/hl_baseentity.cpp", "cl_dll/hl/hl_objects.cpp", "cl_dll/hl/hl_weapons.cpp", "cl_dll/GameStudioModelRenderer.cpp", -"cl_dll/MOTD.cpp", "cl_dll/StudioModelRenderer.cpp", "cl_dll/ammo.cpp", "cl_dll/ammo_secondary.cpp", @@ -226,7 +274,6 @@ files{"cl_dll/hl/hl_baseentity.cpp", "cl_dll/overview.cpp", "cl_dll/parsemsg.cpp", "cl_dll/saytext.cpp", -"cl_dll/scoreboard.cpp", "cl_dll/status_icons.cpp", "cl_dll/statusbar.cpp", "cl_dll/studio_util.cpp", @@ -237,18 +284,64 @@ files{"cl_dll/hl/hl_baseentity.cpp", "cl_dll/view.cpp"} includedirs{"cl_dll", -"cl_dll/hl", -"utils/false_vgui/include"} +"cl_dll/hl"} defines{"CLIENT_DLL"} -if _OPTIONS["goldsrc"] then - defines{"GOLDSOURCE_SUPPORT"} -end +filter("options:goldsrc") +defines{"GOLDSOURCE_SUPPORT"} -filter("system:Windows") +filter("options:vgui") +files{"cl_dll/vgui_int.cpp", +"cl_dll/vgui_ClassMenu.cpp", +"cl_dll/vgui_ConsolePanel.cpp", +"cl_dll/vgui_ControlConfigPanel.cpp", +"cl_dll/vgui_CustomObjects.cpp", +"cl_dll/vgui_MOTDWindow.cpp", +"cl_dll/vgui_SchemeManager.cpp", +"cl_dll/vgui_ScorePanel.cpp", +"cl_dll/vgui_TeamFortressViewport.cpp", +"cl_dll/vgui_SpectatorPanel.cpp", +"cl_dll/vgui_teammenu.cpp", +"cl_dll/voice_status.cpp", +"game_shared/vgui_checkbutton2.cpp", +"game_shared/vgui_grid.cpp", +"game_shared/vgui_helpers.cpp", +"game_shared/vgui_listbox.cpp", +"game_shared/vgui_loadtga.cpp", +"game_shared/vgui_scrollbar2.cpp", +"game_shared/vgui_slider2.cpp", +"game_shared/voice_banmgr.cpp"} +includedirs{"vgui-dev/include"} +defines{"USE_VGUI"} + +filter{"options:vgui", "system:windows"} +libdirs{"vgui-dev/lib/win32_vc6/"} + +filter{"options:vgui", "system:macosx"} +libdirs{"vgui-dev/lib"} + +filter{"options:vgui", "system:windows or macosx"} +links{"vgui"} + +filter{"options:vgui", "system:not windows or not macosx"} +linkoptions{path.getabsolute("vgui-dev/lib/vgui.so")} + +filter{"options:vgui", "options:novgui-motd"} +defines{"USE_NOVGUI_MOTD"} +files{"cl_dll/MOTD.cpp"} + +filter{"options:vgui", "options:novgui-scoreboard"} +defines{"USE_NOVGUI_SCOREBOARD"} +files{"cl_dll/scoreboard.cpp"} + +filter("options:not vgui") +files{"cl_dll/MOTD.cpp", +"cl_dll/scoreboard.cpp"} +includedirs{"utils/false_vgui/include"} + +filter("system:windows") links{"user32", "winmm"} filter("system:not windows") links{"dl"} - diff --git a/contrib/iZarif/xash.lua b/contrib/iZarif/xash.lua new file mode 100644 index 00000000..0388602d --- /dev/null +++ b/contrib/iZarif/xash.lua @@ -0,0 +1,240 @@ +local m = {} +local toolsets = {gcc = {}, clang = {}, mingw = {}, msc = {}} +local toolset = nil +local cxx = nil + +function toolsets.gcc.is_cxx_compileable(code, include_dirs) + local include_dirs = include_dirs or {} + local code_file_path = _MAIN_SCRIPT_DIR .. "/tmp.cpp" + local code_file = io.open(code_file_path, "w") + + code_file:write(code) + code_file:close() + + local include_dirs_str = "" + + for _, include_dir in ipairs(include_dirs) do + include_dirs_str = include_dirs_str .. "-I" .. include_dir + end + + local cmd = string.format("%s %s -c %s", cxx, include_dirs_str, code_file_path) + local _, _, rc = os.execute(cmd) + local result = false + + if rc == 0 then + result = true + end + + return result +end + +function toolsets.msc.is_cxx_compileable(code, include_dirs) + local include_dirs = include_dirs or {} + local code_file_path = _XASHAIN_SCRIPT_DIR .. "/tmp.cpp" + local code_file = io.open(code_file_path, "w") + + code_file:write(code) + code_file:close() + + local include_dirs_str = "" + + for _, include_dir in ipairs(include_dirs) do + include_dirs_str = include_dirs_str .. "/I" .. include_dir + end + + local cmd = string.format("%s %s /c %s", cxx, include_dirs_str, code_file_path) + local _, _, rc = os.execute(cmd) + local result = false + + if rc == 0 then + result = true + end + + return result +end + +toolsets.clang.is_cxx_compileable = toolsets.gcc.is_cxx_compileable +toolsets.mingw.is_cxx_compileable = toolsets.gcc.is_cxx_compileable + +function m.is_cxx_symbol_defined(symbol, headers, include_dirs) + local headers = headers or {} + local include_dirs = include_dirs or {} + local code = "" + + for _, header in ipairs(headers) do + code = code .. string.format("#include <%s>\n", header) + end + + code = code .. string.format("#ifndef %s\n.\n#endif", symbol) + + return m.is_cxx_compileable(code, include_dirs) +end + +function m.is_cxx_header_exist(header, include_dirs) + local include_dirs = include_dirs or {} + local code = "" + + code = code .. string.format("#include <%s>\n", header) + + return m.is_cxx_compileable(code, include_dirs) +end + +function m.get_arch() + local arch = m.arch + + if not arch then + if m.is_cxx_symbol_defined("XASH_AMD64", {"build.h"}, {"public"}) then + arch = "amd64" + elseif m.is_cxx_symbol_defined("XASH_X86", {"build.h"}, {"public"}) then + arch = "x86" + elseif m.is_cxx_symbol_defined("XASH_ARM", {"build.h"}, {"public"}) then + if m.is_cxx_symbol_defined("XASH_64BIT", {"build.h"}, {"public"}) then + arch = "arm64" + else + arch = "armv" + + if m.is_cxx_symbol_defined("XASH_ARMv8", {"build.h"}, {"public"}) then + arch = arch .. "8_32" + elseif m.is_cxx_symbol_defined("XASH_ARMv7", {"build.h"}, {"public"}) then + arch = arch .. "7" + elseif m.is_cxx_symbol_defined("XASH_ARMv6", {"build.h"}, {"public"}) then + arch = arch .. "6" + elseif m.is_cxx_symbol_defined("XASH_ARMv5", {"build.h"}, {"public"}) then + arch = arch .. "5" + elseif m.is_cxx_symbol_defined("XASH_ARMv4", {"build.h"}, {"public"}) then + arch = arch .. "4" + end + + if m.is_cxx_symbol_defined("XASH_ARM_HARDFP", {"build.h"}, {"public"}) then + arch = arch .. "hf" + else + arch = arch .. "l" + end + end + elseif m.is_cxx_symbol_defined("XASH_MIPS", {"build.h"}, {"public"}) then + arch = "mips" + + if m.is_cxx_symbol_defined("XASH_64BIT", {"build.h"}, {"public"}) then + arch = arch .. "64" + end + + if m.is_cxx_symbol_defined("XASH_LITTLE_ENDIAN", {"build.h"}, {"public"}) then + arch = arch .. "el" + end + elseif m.is_cxx_symbol_defined("XASH_RISCV", {"build.h"}, {"public"}) then + arch = "riscv" + + if m.is_cxx_symbol_defined("XASH_64BIT", {"build.h"}, {"public"}) then + arch = arch .. "64" + else + arch = arch .. "32" + end + + if m.is_cxx_symbol_defined("XASH_RISCV_DOUBLEFP", {"build.h"}, {"public"}) then + arch = arch .. "d" + else + arch = arch .. "f" + end + elseif m.is_cxx_symbol_defined("XASH_JS", {"build.h"}, {"public"}) then + arch = "javascript" + elseif m.is_cxx_symbol_defined("XASH_E2K", {"build.h"}, {"public"}) then + arch = "e2k" + end + end + + return arch +end + +function m.get_os() + local dest_os = os.target() + + if dest_os == "bsd" then + dest_os = m.bsd_flavour + + if not dest_os then + if m.is_cxx_symbol_defined("XASH_FREEBSD", {"build.h"}, {"public"}) then + dest_os = "freebsd" + elseif m.is_cxx_symbol_defined("XASH_NETBSD", {"build.h"}, {"public"}) then + dest_os = "netbsd" + elseif m.is_cxx_symbol_defined("XASH_OPENBSD", {"build.h"}, {"public"}) then + dest_os = "openbsd" + end + end + end + + return dest_os +end + +function m.get_lib_suffix() + local dest_os = m.get_os() + local arch = m.get_arch() + + if dest_os == "windows" or dest_os == "linux" or dest_os == "macosx" then + dest_os = nil + elseif dest_os == "android" then + dest_os = nil + arch = nil + end + + if arch == "x86" then + arch = nil + end + + local suffix = "" + + if dest_os and arch then + suffix = string.format("%s_%s", dest_os, arch) + elseif arch then + suffix = string.format("_%s", arch) + end + + return suffix +end + +function m.find_cxx_compiler() + local prefix = m.prefix or "" + local host_os = os.host() + + toolset = _OPTIONS["cc"] + + if not toolset then + if host_os == "windows" then + toolset = "msc" + elseif host_os == "macosx" then + toolset = "clang" + else + toolset = "gcc" + end + end + + if toolset == "gcc" or "mingw" then + cxx = prefix .. "g++" + elseif toolset == "clang" then + cxx = prefix .. "clang++" + elseif toolset == "msc" then + cxx = "cl.exe" + end + + local is_found = false + + if cxx then + local cmd = "" + + if toolset == "msc" then + cmd = cxx .. " /HELP" + else + cmd = cxx .. " --help" + end + + _, _, rc = os.execute(cmd) + + if rc == 0 then + is_found = true + m.is_cxx_compileable = toolsets[toolset].is_cxx_compileable + end + end + + return is_found +end + +return m From 0c46e1b5bd226e05cf276fdcf91572f212b2f938 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 18 Nov 2021 22:39:50 +0300 Subject: [PATCH 177/298] Fix graphs directory being created with strange permissions (#205) --- dlls/nodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index 07c58826..42ff2404 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -48,7 +48,7 @@ LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ) #elif !_WIN32 #include #include -#define CreateDirectoryA(p, n) mkdir(p,777) +#define CreateDirectoryA(p, n) mkdir(p, 0777) #endif //========================================================= From 74b5543c83c5cdcb88e9254bacab08bc63c4c896 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 21 Nov 2021 05:18:13 -0500 Subject: [PATCH 178/298] Fixed beam attachment invalidated on restore. (#208) --- dlls/effects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/effects.cpp b/dlls/effects.cpp index e6ad257f..3cdd111d 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -174,13 +174,13 @@ void CBeam::Precache( void ) void CBeam::SetStartEntity( int entityIndex ) { - pev->sequence = ( entityIndex & 0x0FFF ) | ( ( pev->sequence & 0xF000 ) << 12 ); + pev->sequence = ( entityIndex & 0x0FFF ) | ( pev->sequence & 0xF000 ); pev->owner = g_engfuncs.pfnPEntityOfEntIndex( entityIndex ); } void CBeam::SetEndEntity( int entityIndex ) { - pev->skin = ( entityIndex & 0x0FFF ) | ( ( pev->skin & 0xF000 ) << 12 ); + pev->skin = ( entityIndex & 0x0FFF ) | ( pev->skin & 0xF000 ); pev->aiment = g_engfuncs.pfnPEntityOfEntIndex( entityIndex ); } From 3674e3f154accaa8b004ef6a733040b7c7ca14c7 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 21 Nov 2021 05:20:38 -0500 Subject: [PATCH 179/298] Fixed RPG client prediction results stored in wrong pointer. (#206) --- cl_dll/hl/hl_weapons.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 536392e3..b982fa7f 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -899,8 +899,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm if( player.m_pActiveItem->m_iId == WEAPON_RPG ) { - from->client.vuser2[1] = ( (CRpg *)player.m_pActiveItem)->m_fSpotActive; - from->client.vuser2[2] = ( (CRpg *)player.m_pActiveItem)->m_cActiveRockets; + to->client.vuser2[1] = ( (CRpg *)player.m_pActiveItem)->m_fSpotActive; + to->client.vuser2[2] = ( (CRpg *)player.m_pActiveItem)->m_cActiveRockets; } // Make sure that weapon animation matches what the game .dll is telling us From ec2826a96a9e734479df8c6e0033d552874b4c19 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 21 Nov 2021 05:21:36 -0500 Subject: [PATCH 180/298] Fixed crossbow fire on empty sequence not playing. (#207) --- cl_dll/ev_hldm.cpp | 4 ++-- dlls/crossbow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index a5011f33..31fcfd17 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1246,7 +1246,7 @@ void EV_FireCrossbow2( event_args_t *args ) { if( args->iparam1 ) gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); - else if( args->iparam2 ) + else gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); } @@ -1322,7 +1322,7 @@ void EV_FireCrossbow( event_args_t *args ) { if( args->iparam1 ) gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); - else if ( args->iparam2 ) + else gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); V_PunchAxis( 0.0f, -2.0f ); diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index c7b04f77..9432b04f 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -374,7 +374,7 @@ void CCrossbow::FireSniperBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, 0, 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -417,7 +417,7 @@ void CCrossbow::FireBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, 0, 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); From 4e7111e434080e1c8877cf96d013870b4c219238 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 21 Nov 2021 05:21:54 -0500 Subject: [PATCH 181/298] Removed identical line in conditional statement. (#209) --- cl_dll/ev_hldm.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 31fcfd17..f3ed52f8 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -717,14 +717,7 @@ void EV_FireMP5( event_args_t *args ) EV_GetGunPosition( args, vecSrc, origin ); VectorCopy( forward, vecAiming ); - if( gEngfuncs.GetMaxClients() > 1 ) - { - EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_MP5, 2, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); - } - else - { - EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_MP5, 2, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); - } + EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_MP5, 2, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); } // We only predict the animation and sound From 3e2808de62e479e83068c075cb88b4f177f9acc7 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 28 Nov 2021 23:04:50 +0300 Subject: [PATCH 182/298] Fix possible bug with talkmonster facing during the script (#213) --- dlls/talkmonster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index 581d87a9..2b3ac14f 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -847,7 +847,8 @@ void CTalkMonster::Touch( CBaseEntity *pOther ) if( speed > 50.0f ) { SetConditions( bits_COND_CLIENT_PUSH ); - MakeIdealYaw( pOther->pev->origin ); + if ( m_MonsterState != MONSTERSTATE_SCRIPT ) + MakeIdealYaw( pOther->pev->origin ); } } } From 7f8f73c6798dffa4e7bbcdcafa579f67f3dbcfda Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Wed, 1 Dec 2021 02:14:12 -0500 Subject: [PATCH 183/298] Remove unused source files (#212) * Delete AI_BaseNPC_Schedule.cpp * Delete soundsystem.cpp --- cl_dll/soundsystem.cpp | 163 ---- dlls/AI_BaseNPC_Schedule.cpp | 1514 ---------------------------------- 2 files changed, 1677 deletions(-) delete mode 100644 cl_dll/soundsystem.cpp delete mode 100644 dlls/AI_BaseNPC_Schedule.cpp diff --git a/cl_dll/soundsystem.cpp b/cl_dll/soundsystem.cpp deleted file mode 100644 index 9ee33861..00000000 --- a/cl_dll/soundsystem.cpp +++ /dev/null @@ -1,163 +0,0 @@ -//======== (C) Copyright 1996-2002 Valve, L.L.C. All rights reserved. ======== -// -// The copyright to the contents herein is the property of Valve, L.L.C. -// The contents may be used and/or copied only with the written permission of -// Valve, L.L.C., or in accordance with the terms and conditions stipulated in -// the agreement/contract under which the contents have been supplied. -// -// Purpose: -// -// $Workfile: $ -// $Date: $ -// -//----------------------------------------------------------------------------- -// $Log: $ -// -// $NoKeywords: $ -//============================================================================= - -#include -#include -#include -#include "r_studioint.h" - -extern engine_studio_api_t IEngineStudio; - -#define RENDERTYPE_UNDEFINED 0 -#define RENDERTYPE_SOFTWARE 1 -#define RENDERTYPE_HARDWARE 2 - -#define ENGINE_LAUNCHER_API_VERSION 1 - -LPDIRECTSOUND lpDS = NULL; -LPDIRECTSOUNDBUFFER lpDSBuf = NULL; -LPHWAVEOUT lpHW = NULL; - -static HMODULE hEngine = 0; - -typedef struct engine_api_s -{ - int version; - int rendertype; - int size; - - // Functions - void ( *unused1 ) ( void ); - void ( *unused2 ) ( void ); - void ( *unused3 ) ( void ); - void ( *unused4 ) ( void ); - void ( *unused5 ) ( void ); - void ( *unused6 ) ( void ); - void ( *unused7 ) ( void ); - void ( *unused8 ) ( void ); - void ( *unused9 ) ( void ); - void ( *unused10 ) ( void ); - void ( *unused11 ) ( void ); - void ( *unused12 ) ( void ); - void ( *unused13 ) ( void ); - void ( *unused14 ) ( void ); - void ( *unused15 ) ( void ); - void ( *unused16 ) ( void ); - void ( *unused17 ) ( void ); - void ( *unused18 ) ( void ); - void ( *unused19 ) ( void ); - void ( *unused20 ) ( void ); - void ( *unused21 ) ( void ); - void ( *unused22 ) ( void ); - void ( *unused23 ) ( void ); - void ( *unused24 ) ( void ); - void ( *unused25 ) ( void ); - void ( *unused26 ) ( void ); - void ( *unused27 ) ( void ); - void ( *unused28 ) ( void ); - void ( *unused29 ) ( void ); - void ( *unused30 ) ( void ); - void ( *unused31 ) ( void ); - void ( *unused32 ) ( void ); - void ( *unused33 ) ( void ); - void ( *unused34 ) ( void ); - - void ( *S_GetDSPointer ) ( struct IDirectSound **lpDS, struct IDirectSoundBuffer **lpDSBuf ); - void *( *S_GetWAVPointer ) ( void ); - - void ( *unused35 ) ( void ); - void ( *unused36 ) ( void ); - void ( *unused37 ) ( void ); - void ( *unused38 ) ( void ); - void ( *unused39 ) ( void ); - void ( *unused40 ) ( void ); - void ( *unused41 ) ( void ); - void ( *unused42 ) ( void ); - void ( *unused43 ) ( void ); - void ( *unused44 ) ( void ); - void ( *unused45 ) ( void ); - void ( *unused46 ) ( void ); - void ( *unused47 ) ( void ); - void ( *unused48 ) ( void ); - void ( *unused49 ) ( void ); - void ( *unused50 ) ( void ); - void ( *unused51 ) ( void ); - void ( *unused52 ) ( void ); - void ( *unused53 ) ( void ); - void ( *unused54 ) ( void ); - void ( *unused55 ) ( void ); -} engine_api_t; - -static engine_api_t engineapi; - -typedef int (*engine_api_func)( int version, int size, struct engine_api_s *api ); - -//----------------------------------------------------------------------------- -// Purpose: Get launcher/engine interface from engine module -// Input : hMod - -// Output : int -//----------------------------------------------------------------------------- -int Eng_LoadFunctions( HMODULE hMod ) -{ - engine_api_func pfnEngineAPI; - - pfnEngineAPI = ( engine_api_func )GetProcAddress( hMod, "Sys_EngineAPI" ); - if( !pfnEngineAPI ) - return 0; - - if( !(*pfnEngineAPI)( ENGINE_LAUNCHER_API_VERSION, sizeof( engine_api_t ), &engineapi ) ) - return 0; - - // All is okay - return 1; -} - -//----------------------------------------------------------------------------- -// Purpose: Load proper engine .dll and get pointer to either DSound and primary buffer or HWAVEOUT ( NT 4.0, e.g. ) -//----------------------------------------------------------------------------- -void LoadSoundAPIs( void ) -{ - hEngine = ::LoadLibrary( IEngineStudio.IsHardware() ? "hw.dll" : "sw.dll" ); - if( hEngine ) - { - if( Eng_LoadFunctions( hEngine ) ) - { - if( engineapi.S_GetDSPointer && engineapi.S_GetWAVPointer ) - { - engineapi.S_GetDSPointer(&lpDS, &lpDSBuf); - lpHW = (HWAVEOUT FAR *)engineapi.S_GetWAVPointer(); - } - } - } -} - -//----------------------------------------------------------------------------- -// Purpose: Close engine library, release sound pointers -//----------------------------------------------------------------------------- -void ShutdownSoundAPIs( void ) -{ - if( hEngine ) - { - FreeLibrary( hEngine ); - hEngine = 0; - } - - lpDS = 0; - lpDSBuf = 0; - lpHW = 0; -} diff --git a/dlls/AI_BaseNPC_Schedule.cpp b/dlls/AI_BaseNPC_Schedule.cpp deleted file mode 100644 index a6e4962b..00000000 --- a/dlls/AI_BaseNPC_Schedule.cpp +++ /dev/null @@ -1,1514 +0,0 @@ -/*** -* -* Copyright (c) 1996-2002, Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* This source code contains proprietary and confidential information of -* Valve LLC and its suppliers. Access to this code is restricted to -* persons who have executed a written SDK license with Valve. Any access, -* use or distribution of this code by or to any unlicensed person is illegal. -* -****/ -//========================================================= -// schedule.cpp - functions and data pertaining to the -// monsters' AI scheduling system. -//========================================================= -#include "extdll.h" -#include "util.h" -#include "cbase.h" -#include "monsters.h" -#include "animation.h" -#include "scripted.h" -#include "nodes.h" -#include "defaultai.h" -#include "soundent.h" - -extern CGraph WorldGraph; - -//========================================================= -// FHaveSchedule - Returns TRUE if monster's m_pSchedule -// is anything other than NULL. -//========================================================= -BOOL CBaseMonster :: FHaveSchedule( void ) -{ - if ( m_pSchedule == NULL ) - { - return FALSE; - } - - return TRUE; -} - -//========================================================= -// ClearSchedule - blanks out the caller's schedule pointer -// and index. -//========================================================= -void CBaseMonster :: ClearSchedule( void ) -{ - m_iTaskStatus = TASKSTATUS_NEW; - m_pSchedule = NULL; - m_iScheduleIndex = 0; -} - -//========================================================= -// FScheduleDone - Returns TRUE if the caller is on the -// last task in the schedule -//========================================================= -BOOL CBaseMonster :: FScheduleDone ( void ) -{ - ASSERT( m_pSchedule != NULL ); - - if ( m_iScheduleIndex == m_pSchedule->cTasks ) - { - return TRUE; - } - - return FALSE; -} - -//========================================================= -// ChangeSchedule - replaces the monster's schedule pointer -// with the passed pointer, and sets the ScheduleIndex back -// to 0 -//========================================================= -void CBaseMonster :: ChangeSchedule ( Schedule_t *pNewSchedule ) -{ - ASSERT( pNewSchedule != NULL ); - - m_pSchedule = pNewSchedule; - m_iScheduleIndex = 0; - m_iTaskStatus = TASKSTATUS_NEW; - m_afConditions = 0;// clear all of the conditions - m_failSchedule = SCHED_NONE; - - if ( m_pSchedule->iInterruptMask & bits_COND_HEAR_SOUND && !(m_pSchedule->iSoundMask) ) - { - ALERT ( at_aiconsole, "COND_HEAR_SOUND with no sound mask!\n" ); - } - else if ( m_pSchedule->iSoundMask && !(m_pSchedule->iInterruptMask & bits_COND_HEAR_SOUND) ) - { - ALERT ( at_aiconsole, "Sound mask without COND_HEAR_SOUND!\n" ); - } - -#if _DEBUG - if ( !ScheduleFromName( pNewSchedule->pName ) ) - { - ALERT( at_console, "Schedule %s not in table!!!\n", pNewSchedule->pName ); - } -#endif - -// this is very useful code if you can isolate a test case in a level with a single monster. It will notify -// you of every schedule selection the monster makes. -#if 0 - if ( FClassnameIs( pev, "monster_human_grunt" ) ) - { - Task_t *pTask = GetTask(); - - if ( pTask ) - { - const char *pName = NULL; - - if ( m_pSchedule ) - { - pName = m_pSchedule->pName; - } - else - { - pName = "No Schedule"; - } - - if ( !pName ) - { - pName = "Unknown"; - } - - ALERT( at_aiconsole, "%s: picked schedule %s\n", STRING( pev->classname ), pName ); - } - } -#endif// 0 - -} - -//========================================================= -// NextScheduledTask - increments the ScheduleIndex -//========================================================= -void CBaseMonster :: NextScheduledTask ( void ) -{ - ASSERT( m_pSchedule != NULL ); - - m_iTaskStatus = TASKSTATUS_NEW; - m_iScheduleIndex++; - - if ( FScheduleDone() ) - { - // just completed last task in schedule, so make it invalid by clearing it. - SetConditions( bits_COND_SCHEDULE_DONE ); - //ClearSchedule(); - } -} - -//========================================================= -// IScheduleFlags - returns an integer with all Conditions -// bits that are currently set and also set in the current -// schedule's Interrupt mask. -//========================================================= -int CBaseMonster :: IScheduleFlags ( void ) -{ - if( !m_pSchedule ) - { - return 0; - } - - // strip off all bits excepts the ones capable of breaking this schedule. - return m_afConditions & m_pSchedule->iInterruptMask; -} - -//========================================================= -// FScheduleValid - returns TRUE as long as the current -// schedule is still the proper schedule to be executing, -// taking into account all conditions -//========================================================= -BOOL CBaseMonster :: FScheduleValid ( void ) -{ - if ( m_pSchedule == NULL ) - { - // schedule is empty, and therefore not valid. - return FALSE; - } - - if ( HasConditions( m_pSchedule->iInterruptMask | bits_COND_SCHEDULE_DONE | bits_COND_TASK_FAILED ) ) - { -#if DEBUG - if ( HasConditions ( bits_COND_TASK_FAILED ) && m_failSchedule == SCHED_NONE ) - { - // fail! Send a visual indicator. - ALERT ( at_aiconsole, "Schedule: %s Failed\n", m_pSchedule->pName ); - - Vector tmp = pev->origin; - tmp.z = pev->absmax.z + 16; - UTIL_Sparks( tmp ); - } -#endif // DEBUG - - // some condition has interrupted the schedule, or the schedule is done - return FALSE; - } - - return TRUE; -} - -//========================================================= -// MaintainSchedule - does all the per-think schedule maintenance. -// ensures that the monster leaves this function with a valid -// schedule! -//========================================================= -void CBaseMonster :: MaintainSchedule ( void ) -{ - Schedule_t *pNewSchedule; - int i; - - // UNDONE: Tune/fix this 10... This is just here so infinite loops are impossible - for ( i = 0; i < 10; i++ ) - { - if ( m_pSchedule != NULL && TaskIsComplete() ) - { - NextScheduledTask(); - } - - // validate existing schedule - if ( !FScheduleValid() || m_MonsterState != m_IdealMonsterState ) - { - // if we come into this block of code, the schedule is going to have to be changed. - // if the previous schedule was interrupted by a condition, GetIdealState will be - // called. Else, a schedule finished normally. - - // Notify the monster that his schedule is changing - ScheduleChange(); - - // Call GetIdealState if we're not dead and one or more of the following... - // - in COMBAT state with no enemy (it died?) - // - conditions bits (excluding SCHEDULE_DONE) indicate interruption, - // - schedule is done but schedule indicates it wants GetIdealState called - // after successful completion (by setting bits_COND_SCHEDULE_DONE in iInterruptMask) - // DEAD & SCRIPT are not suggestions, they are commands! - if ( m_IdealMonsterState != MONSTERSTATE_DEAD && - (m_IdealMonsterState != MONSTERSTATE_SCRIPT || m_IdealMonsterState == m_MonsterState) ) - { - if ( (m_afConditions && !HasConditions(bits_COND_SCHEDULE_DONE)) || - (m_pSchedule && (m_pSchedule->iInterruptMask & bits_COND_SCHEDULE_DONE)) || - ((m_MonsterState == MONSTERSTATE_COMBAT) && (m_hEnemy == NULL)) ) - { - GetIdealState(); - } - } - if ( HasConditions( bits_COND_TASK_FAILED ) && m_MonsterState == m_IdealMonsterState ) - { - if ( m_failSchedule != SCHED_NONE ) - pNewSchedule = GetScheduleOfType( m_failSchedule ); - else - pNewSchedule = GetScheduleOfType( SCHED_FAIL ); - // schedule was invalid because the current task failed to start or complete - ALERT ( at_aiconsole, "Schedule Failed at %d!\n", m_iScheduleIndex ); - ChangeSchedule( pNewSchedule ); - } - else - { - SetState( m_IdealMonsterState ); - if ( m_MonsterState == MONSTERSTATE_SCRIPT || m_MonsterState == MONSTERSTATE_DEAD ) - pNewSchedule = CBaseMonster::GetSchedule(); - else - pNewSchedule = GetSchedule(); - ChangeSchedule( pNewSchedule ); - } - } - - if ( m_iTaskStatus == TASKSTATUS_NEW ) - { - Task_t *pTask = GetTask(); - ASSERT( pTask != NULL ); - TaskBegin(); - StartTask( pTask ); - } - - // UNDONE: Twice?!!! - if ( m_Activity != m_IdealActivity ) - { - SetActivity ( m_IdealActivity ); - } - - if ( !TaskIsComplete() && m_iTaskStatus != TASKSTATUS_NEW ) - break; - } - - if ( TaskIsRunning() ) - { - Task_t *pTask = GetTask(); - ASSERT( pTask != NULL ); - RunTask( pTask ); - } - - // UNDONE: We have to do this so that we have an animation set to blend to if RunTask changes the animation - // RunTask() will always change animations at the end of a script! - // Don't do this twice - if ( m_Activity != m_IdealActivity ) - { - SetActivity ( m_IdealActivity ); - } -} - -//========================================================= -// RunTask -//========================================================= -void CBaseMonster :: RunTask ( Task_t *pTask ) -{ - switch ( pTask->iTask ) - { - case TASK_TURN_RIGHT: - case TASK_TURN_LEFT: - { - ChangeYaw( pev->yaw_speed ); - - if ( FacingIdeal() ) - { - TaskComplete(); - } - break; - } - - case TASK_PLAY_SEQUENCE_FACE_ENEMY: - case TASK_PLAY_SEQUENCE_FACE_TARGET: - { - CBaseEntity *pTarget; - - if ( pTask->iTask == TASK_PLAY_SEQUENCE_FACE_TARGET ) - pTarget = m_hTargetEnt; - else - pTarget = m_hEnemy; - if ( pTarget ) - { - pev->ideal_yaw = UTIL_VecToYaw( pTarget->pev->origin - pev->origin ); - ChangeYaw( pev->yaw_speed ); - } - if ( m_fSequenceFinished ) - TaskComplete(); - } - break; - - case TASK_PLAY_SEQUENCE: - case TASK_PLAY_ACTIVE_IDLE: - { - if ( m_fSequenceFinished ) - { - TaskComplete(); - } - break; - } - - - case TASK_FACE_ENEMY: - { - MakeIdealYaw( m_vecEnemyLKP ); - - ChangeYaw( pev->yaw_speed ); - - if ( FacingIdeal() ) - { - TaskComplete(); - } - break; - } - case TASK_FACE_HINTNODE: - case TASK_FACE_LASTPOSITION: - case TASK_FACE_TARGET: - case TASK_FACE_IDEAL: - case TASK_FACE_ROUTE: - { - ChangeYaw( pev->yaw_speed ); - - if ( FacingIdeal() ) - { - TaskComplete(); - } - break; - } - case TASK_WAIT_PVS: - { - if ( !FNullEnt(FIND_CLIENT_IN_PVS(edict())) ) - { - TaskComplete(); - } - break; - } - case TASK_WAIT_INDEFINITE: - { - // don't do anything. - break; - } - case TASK_WAIT: - case TASK_WAIT_RANDOM: - { - if ( gpGlobals->time >= m_flWaitFinished ) - { - TaskComplete(); - } - break; - } - case TASK_WAIT_FACE_ENEMY: - { - MakeIdealYaw ( m_vecEnemyLKP ); - ChangeYaw( pev->yaw_speed ); - - if ( gpGlobals->time >= m_flWaitFinished ) - { - TaskComplete(); - } - break; - } - case TASK_MOVE_TO_TARGET_RANGE: - { - float distance; - - if ( m_hTargetEnt == NULL ) - TaskFail(); - else - { - distance = ( m_vecMoveGoal - pev->origin ).Length2D(); - // Re-evaluate when you think your finished, or the target has moved too far - if ( (distance < pTask->flData) || (m_vecMoveGoal - m_hTargetEnt->pev->origin).Length() > pTask->flData * 0.5 ) - { - m_vecMoveGoal = m_hTargetEnt->pev->origin; - distance = ( m_vecMoveGoal - pev->origin ).Length2D(); - FRefreshRoute(); - } - - // Set the appropriate activity based on an overlapping range - // overlap the range to prevent oscillation - if ( distance < pTask->flData ) - { - TaskComplete(); - RouteClear(); // Stop moving - } - else if ( distance < 190 && m_movementActivity != ACT_WALK ) - m_movementActivity = ACT_WALK; - else if ( distance >= 270 && m_movementActivity != ACT_RUN ) - m_movementActivity = ACT_RUN; - } - - break; - } - case TASK_WAIT_FOR_MOVEMENT: - { - if (MovementIsComplete()) - { - TaskComplete(); - RouteClear(); // Stop moving - } - break; - } - case TASK_DIE: - { - if ( m_fSequenceFinished && pev->frame >= 255 ) - { - pev->deadflag = DEAD_DEAD; - - SetThink( NULL ); - StopAnimation(); - - if ( !BBoxFlat() ) - { - // a bit of a hack. If a corpses' bbox is positioned such that being left solid so that it can be attacked will - // block the player on a slope or stairs, the corpse is made nonsolid. -// pev->solid = SOLID_NOT; - UTIL_SetSize ( pev, Vector ( -4, -4, 0 ), Vector ( 4, 4, 1 ) ); - } - else // !!!HACKHACK - put monster in a thin, wide bounding box until we fix the solid type/bounding volume problem - UTIL_SetSize ( pev, Vector ( pev->mins.x, pev->mins.y, pev->mins.z ), Vector ( pev->maxs.x, pev->maxs.y, pev->mins.z + 1 ) ); - - if ( ShouldFadeOnDeath() ) - { - // this monster was created by a monstermaker... fade the corpse out. - SUB_StartFadeOut(); - } - else - { - // body is gonna be around for a while, so have it stink for a bit. - CSoundEnt::InsertSound ( bits_SOUND_CARCASS, pev->origin, 384, 30 ); - } - } - break; - } - case TASK_RANGE_ATTACK1_NOTURN: - case TASK_MELEE_ATTACK1_NOTURN: - case TASK_MELEE_ATTACK2_NOTURN: - case TASK_RANGE_ATTACK2_NOTURN: - case TASK_RELOAD_NOTURN: - { - if ( m_fSequenceFinished ) - { - m_Activity = ACT_RESET; - TaskComplete(); - } - break; - } - case TASK_RANGE_ATTACK1: - case TASK_MELEE_ATTACK1: - case TASK_MELEE_ATTACK2: - case TASK_RANGE_ATTACK2: - case TASK_SPECIAL_ATTACK1: - case TASK_SPECIAL_ATTACK2: - case TASK_RELOAD: - { - MakeIdealYaw ( m_vecEnemyLKP ); - ChangeYaw ( pev->yaw_speed ); - - if ( m_fSequenceFinished ) - { - m_Activity = ACT_RESET; - TaskComplete(); - } - break; - } - case TASK_SMALL_FLINCH: - { - if ( m_fSequenceFinished ) - { - TaskComplete(); - } - } - break; - case TASK_WAIT_FOR_SCRIPT: - { - if ( m_pCine->m_iDelay <= 0 && gpGlobals->time >= m_pCine->m_startTime ) - { - TaskComplete(); - m_pCine->StartSequence( (CBaseMonster *)this, m_pCine->m_iszPlay, TRUE ); - if ( m_fSequenceFinished ) - ClearSchedule(); - pev->framerate = 1.0; - //ALERT( at_aiconsole, "Script %s has begun for %s\n", STRING( m_pCine->m_iszPlay ), STRING(pev->classname) ); - } - break; - } - case TASK_PLAY_SCRIPT: - { - if (m_fSequenceFinished) - { - m_pCine->SequenceDone( this ); - } - break; - } - } -} - -//========================================================= -// SetTurnActivity - measures the difference between the way -// the monster is facing and determines whether or not to -// select one of the 180 turn animations. -//========================================================= -void CBaseMonster :: SetTurnActivity ( void ) -{ - float flYD; - flYD = FlYawDiff(); - - if ( flYD <= -45 && LookupActivity ( ACT_TURN_RIGHT ) != ACTIVITY_NOT_AVAILABLE ) - {// big right turn - m_IdealActivity = ACT_TURN_RIGHT; - } - else if ( flYD > 45 && LookupActivity ( ACT_TURN_LEFT ) != ACTIVITY_NOT_AVAILABLE ) - {// big left turn - m_IdealActivity = ACT_TURN_LEFT; - } -} - -//========================================================= -// Start task - selects the correct activity and performs -// any necessary calculations to start the next task on the -// schedule. -//========================================================= -void CBaseMonster :: StartTask ( Task_t *pTask ) -{ - switch ( pTask->iTask ) - { - case TASK_TURN_RIGHT: - { - float flCurrentYaw; - - flCurrentYaw = UTIL_AngleMod( pev->angles.y ); - pev->ideal_yaw = UTIL_AngleMod( flCurrentYaw - pTask->flData ); - SetTurnActivity(); - break; - } - case TASK_TURN_LEFT: - { - float flCurrentYaw; - - flCurrentYaw = UTIL_AngleMod( pev->angles.y ); - pev->ideal_yaw = UTIL_AngleMod( flCurrentYaw + pTask->flData ); - SetTurnActivity(); - break; - } - case TASK_REMEMBER: - { - Remember ( (int)pTask->flData ); - TaskComplete(); - break; - } - case TASK_FORGET: - { - Forget ( (int)pTask->flData ); - TaskComplete(); - break; - } - case TASK_FIND_HINTNODE: - { - m_iHintNode = FindHintNode(); - - if ( m_iHintNode != NO_NODE ) - { - TaskComplete(); - } - else - { - TaskFail(); - } - break; - } - case TASK_STORE_LASTPOSITION: - { - m_vecLastPosition = pev->origin; - TaskComplete(); - break; - } - case TASK_CLEAR_LASTPOSITION: - { - m_vecLastPosition = g_vecZero; - TaskComplete(); - break; - } - case TASK_CLEAR_HINTNODE: - { - m_iHintNode = NO_NODE; - TaskComplete(); - break; - } - case TASK_STOP_MOVING: - { - if ( m_IdealActivity == m_movementActivity ) - { - m_IdealActivity = GetStoppedActivity(); - } - - RouteClear(); - TaskComplete(); - break; - } - case TASK_PLAY_SEQUENCE_FACE_ENEMY: - case TASK_PLAY_SEQUENCE_FACE_TARGET: - case TASK_PLAY_SEQUENCE: - { - m_IdealActivity = ( Activity )( int )pTask->flData; - break; - } - case TASK_PLAY_ACTIVE_IDLE: - { - // monsters verify that they have a sequence for the node's activity BEFORE - // moving towards the node, so it's ok to just set the activity without checking here. - m_IdealActivity = ( Activity )WorldGraph.m_pNodes[ m_iHintNode ].m_sHintActivity; - break; - } - case TASK_SET_SCHEDULE: - { - Schedule_t *pNewSchedule; - - pNewSchedule = GetScheduleOfType( (int)pTask->flData ); - - if ( pNewSchedule ) - { - ChangeSchedule( pNewSchedule ); - } - else - { - TaskFail(); - } - - break; - } - case TASK_FIND_NEAR_NODE_COVER_FROM_ENEMY: - { - if ( m_hEnemy == NULL ) - { - TaskFail(); - return; - } - - if ( FindCover( m_hEnemy->pev->origin, m_hEnemy->pev->view_ofs, 0, pTask->flData ) ) - { - // try for cover farther than the FLData from the schedule. - TaskComplete(); - } - else - { - // no coverwhatsoever. - TaskFail(); - } - break; - } - case TASK_FIND_FAR_NODE_COVER_FROM_ENEMY: - { - if ( m_hEnemy == NULL ) - { - TaskFail(); - return; - } - - if ( FindCover( m_hEnemy->pev->origin, m_hEnemy->pev->view_ofs, pTask->flData, CoverRadius() ) ) - { - // try for cover farther than the FLData from the schedule. - TaskComplete(); - } - else - { - // no coverwhatsoever. - TaskFail(); - } - break; - } - case TASK_FIND_NODE_COVER_FROM_ENEMY: - { - if ( m_hEnemy == NULL ) - { - TaskFail(); - return; - } - - if ( FindCover( m_hEnemy->pev->origin, m_hEnemy->pev->view_ofs, 0, CoverRadius() ) ) - { - // try for cover farther than the FLData from the schedule. - TaskComplete(); - } - else - { - // no coverwhatsoever. - TaskFail(); - } - break; - } - case TASK_FIND_COVER_FROM_ENEMY: - { - entvars_t *pevCover; - - if ( m_hEnemy == NULL ) - { - // Find cover from self if no enemy available - pevCover = pev; -// TaskFail(); -// return; - } - else - pevCover = m_hEnemy->pev; - - if ( FindLateralCover( pevCover->origin, pevCover->view_ofs ) ) - { - // try lateral first - m_flMoveWaitFinished = gpGlobals->time + pTask->flData; - TaskComplete(); - } - else if ( FindCover( pevCover->origin, pevCover->view_ofs, 0, CoverRadius() ) ) - { - // then try for plain ole cover - m_flMoveWaitFinished = gpGlobals->time + pTask->flData; - TaskComplete(); - } - else - { - // no coverwhatsoever. - TaskFail(); - } - break; - } - case TASK_FIND_COVER_FROM_ORIGIN: - { - if ( FindCover( pev->origin, pev->view_ofs, 0, CoverRadius() ) ) - { - // then try for plain ole cover - m_flMoveWaitFinished = gpGlobals->time + pTask->flData; - TaskComplete(); - } - else - { - // no cover! - TaskFail(); - } - } - break; - case TASK_FIND_COVER_FROM_BEST_SOUND: - { - CSound *pBestSound; - - pBestSound = PBestSound(); - - ASSERT( pBestSound != NULL ); - /* - if ( pBestSound && FindLateralCover( pBestSound->m_vecOrigin, g_vecZero ) ) - { - // try lateral first - m_flMoveWaitFinished = gpGlobals->time + pTask->flData; - TaskComplete(); - } - */ - - if ( pBestSound && FindCover( pBestSound->m_vecOrigin, g_vecZero, pBestSound->m_iVolume, CoverRadius() ) ) - { - // then try for plain ole cover - m_flMoveWaitFinished = gpGlobals->time + pTask->flData; - TaskComplete(); - } - else - { - // no coverwhatsoever. or no sound in list - TaskFail(); - } - break; - } - case TASK_FACE_HINTNODE: - { - pev->ideal_yaw = WorldGraph.m_pNodes[ m_iHintNode ].m_flHintYaw; - SetTurnActivity(); - break; - } - - case TASK_FACE_LASTPOSITION: - MakeIdealYaw ( m_vecLastPosition ); - SetTurnActivity(); - break; - - case TASK_FACE_TARGET: - if ( m_hTargetEnt != NULL ) - { - MakeIdealYaw ( m_hTargetEnt->pev->origin ); - SetTurnActivity(); - } - else - TaskFail(); - break; - case TASK_FACE_ENEMY: - { - MakeIdealYaw ( m_vecEnemyLKP ); - SetTurnActivity(); - break; - } - case TASK_FACE_IDEAL: - { - SetTurnActivity(); - break; - } - case TASK_FACE_ROUTE: - { - if (FRouteClear()) - { - ALERT(at_aiconsole, "No route to face!\n"); - TaskFail(); - } - else - { - MakeIdealYaw(m_Route[m_iRouteIndex].vecLocation); - SetTurnActivity(); - } - break; - } - case TASK_WAIT_PVS: - case TASK_WAIT_INDEFINITE: - { - // don't do anything. - break; - } - case TASK_WAIT: - case TASK_WAIT_FACE_ENEMY: - {// set a future time that tells us when the wait is over. - m_flWaitFinished = gpGlobals->time + pTask->flData; - break; - } - case TASK_WAIT_RANDOM: - {// set a future time that tells us when the wait is over. - m_flWaitFinished = gpGlobals->time + RANDOM_FLOAT( 0.1, pTask->flData ); - break; - } - case TASK_MOVE_TO_TARGET_RANGE: - { - if ( (m_hTargetEnt->pev->origin - pev->origin).Length() < 1 ) - TaskComplete(); - else - { - m_vecMoveGoal = m_hTargetEnt->pev->origin; - if ( !MoveToTarget( ACT_WALK, 2 ) ) - TaskFail(); - } - break; - } - case TASK_RUN_TO_TARGET: - case TASK_WALK_TO_TARGET: - { - Activity newActivity; - - if ( (m_hTargetEnt->pev->origin - pev->origin).Length() < 1 ) - TaskComplete(); - else - { - if ( pTask->iTask == TASK_WALK_TO_TARGET ) - newActivity = ACT_WALK; - else - newActivity = ACT_RUN; - // This monster can't do this! - if ( LookupActivity( newActivity ) == ACTIVITY_NOT_AVAILABLE ) - TaskComplete(); - else - { - if ( m_hTargetEnt == NULL || !MoveToTarget( newActivity, 2 ) ) - { - TaskFail(); - ALERT( at_aiconsole, "%s Failed to reach target!!!\n", STRING(pev->classname) ); - RouteClear(); - } - } - } - TaskComplete(); - break; - } - case TASK_CLEAR_MOVE_WAIT: - { - m_flMoveWaitFinished = gpGlobals->time; - TaskComplete(); - break; - } - case TASK_MELEE_ATTACK1_NOTURN: - case TASK_MELEE_ATTACK1: - { - m_IdealActivity = ACT_MELEE_ATTACK1; - break; - } - case TASK_MELEE_ATTACK2_NOTURN: - case TASK_MELEE_ATTACK2: - { - m_IdealActivity = ACT_MELEE_ATTACK2; - break; - } - case TASK_RANGE_ATTACK1_NOTURN: - case TASK_RANGE_ATTACK1: - { - m_IdealActivity = ACT_RANGE_ATTACK1; - break; - } - case TASK_RANGE_ATTACK2_NOTURN: - case TASK_RANGE_ATTACK2: - { - m_IdealActivity = ACT_RANGE_ATTACK2; - break; - } - case TASK_RELOAD_NOTURN: - case TASK_RELOAD: - { - m_IdealActivity = ACT_RELOAD; - break; - } - case TASK_SPECIAL_ATTACK1: - { - m_IdealActivity = ACT_SPECIAL_ATTACK1; - break; - } - case TASK_SPECIAL_ATTACK2: - { - m_IdealActivity = ACT_SPECIAL_ATTACK2; - break; - } - case TASK_SET_ACTIVITY: - { - m_IdealActivity = (Activity)(int)pTask->flData; - TaskComplete(); - break; - } - case TASK_GET_PATH_TO_ENEMY_LKP: - { - if ( BuildRoute ( m_vecEnemyLKP, bits_MF_TO_LOCATION, NULL ) ) - { - TaskComplete(); - } - else if (BuildNearestRoute( m_vecEnemyLKP, pev->view_ofs, 0, (m_vecEnemyLKP - pev->origin).Length() )) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToEnemyLKP failed!!\n" ); - TaskFail(); - } - break; - } - case TASK_GET_PATH_TO_ENEMY: - { - CBaseEntity *pEnemy = m_hEnemy; - - if ( pEnemy == NULL ) - { - TaskFail(); - return; - } - - if ( BuildRoute ( pEnemy->pev->origin, bits_MF_TO_ENEMY, pEnemy ) ) - { - TaskComplete(); - } - else if (BuildNearestRoute( pEnemy->pev->origin, pEnemy->pev->view_ofs, 0, (pEnemy->pev->origin - pev->origin).Length() )) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToEnemy failed!!\n" ); - TaskFail(); - } - break; - } - case TASK_GET_PATH_TO_ENEMY_CORPSE: - { - UTIL_MakeVectors( pev->angles ); - if ( BuildRoute ( m_vecEnemyLKP - gpGlobals->v_forward * 64, bits_MF_TO_LOCATION, NULL ) ) - { - TaskComplete(); - } - else - { - ALERT ( at_aiconsole, "GetPathToEnemyCorpse failed!!\n" ); - TaskFail(); - } - } - break; - case TASK_GET_PATH_TO_SPOT: - { - CBaseEntity *pPlayer = CBaseEntity::Instance( FIND_ENTITY_BY_CLASSNAME( NULL, "player" ) ); - if ( BuildRoute ( m_vecMoveGoal, bits_MF_TO_LOCATION, pPlayer ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToSpot failed!!\n" ); - TaskFail(); - } - break; - } - - case TASK_GET_PATH_TO_TARGET: - { - RouteClear(); - if ( m_hTargetEnt != NULL && MoveToTarget( m_movementActivity, 1 ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToSpot failed!!\n" ); - TaskFail(); - } - break; - } - case TASK_GET_PATH_TO_HINTNODE:// for active idles! - { - if ( MoveToLocation( m_movementActivity, 2, WorldGraph.m_pNodes[ m_iHintNode ].m_vecOrigin ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToHintNode failed!!\n" ); - TaskFail(); - } - break; - } - case TASK_GET_PATH_TO_LASTPOSITION: - { - m_vecMoveGoal = m_vecLastPosition; - - if ( MoveToLocation( m_movementActivity, 2, m_vecMoveGoal ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToLastPosition failed!!\n" ); - TaskFail(); - } - break; - } - case TASK_GET_PATH_TO_BESTSOUND: - { - CSound *pSound; - - pSound = PBestSound(); - - if ( pSound && MoveToLocation( m_movementActivity, 2, pSound->m_vecOrigin ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToBestSound failed!!\n" ); - TaskFail(); - } - break; - } -case TASK_GET_PATH_TO_BESTSCENT: - { - CSound *pScent; - - pScent = PBestScent(); - - if ( pScent && MoveToLocation( m_movementActivity, 2, pScent->m_vecOrigin ) ) - { - TaskComplete(); - } - else - { - // no way to get there =( - ALERT ( at_aiconsole, "GetPathToBestScent failed!!\n" ); - - TaskFail(); - } - break; - } - case TASK_RUN_PATH: - { - // UNDONE: This is in some default AI and some monsters can't run? -- walk instead? - if ( LookupActivity( ACT_RUN ) != ACTIVITY_NOT_AVAILABLE ) - { - m_movementActivity = ACT_RUN; - } - else - { - m_movementActivity = ACT_WALK; - } - TaskComplete(); - break; - } - case TASK_WALK_PATH: - { - if ( pev->movetype == MOVETYPE_FLY ) - { - m_movementActivity = ACT_FLY; - } - if ( LookupActivity( ACT_WALK ) != ACTIVITY_NOT_AVAILABLE ) - { - m_movementActivity = ACT_WALK; - } - else - { - m_movementActivity = ACT_RUN; - } - TaskComplete(); - break; - } - case TASK_STRAFE_PATH: - { - Vector2D vec2DirToPoint; - Vector2D vec2RightSide; - - // to start strafing, we have to first figure out if the target is on the left side or right side - UTIL_MakeVectors ( pev->angles ); - - vec2DirToPoint = ( m_Route[ 0 ].vecLocation - pev->origin ).Make2D().Normalize(); - vec2RightSide = gpGlobals->v_right.Make2D().Normalize(); - - if ( DotProduct ( vec2DirToPoint, vec2RightSide ) > 0 ) - { - // strafe right - m_movementActivity = ACT_STRAFE_RIGHT; - } - else - { - // strafe left - m_movementActivity = ACT_STRAFE_LEFT; - } - TaskComplete(); - break; - } - - - case TASK_WAIT_FOR_MOVEMENT: - { - if (FRouteClear()) - { - TaskComplete(); - } - break; - } - - case TASK_EAT: - { - Eat( pTask->flData ); - TaskComplete(); - break; - } - case TASK_SMALL_FLINCH: - { - m_IdealActivity = GetSmallFlinchActivity(); - break; - } - case TASK_DIE: - { - RouteClear(); - - m_IdealActivity = GetDeathActivity(); - - pev->deadflag = DEAD_DYING; - break; - } - case TASK_SOUND_WAKE: - { - AlertSound(); - TaskComplete(); - break; - } - case TASK_SOUND_DIE: - { - DeathSound(); - TaskComplete(); - break; - } - case TASK_SOUND_IDLE: - { - IdleSound(); - TaskComplete(); - break; - } - case TASK_SOUND_PAIN: - { - PainSound(); - TaskComplete(); - break; - } - case TASK_SOUND_DEATH: - { - DeathSound(); - TaskComplete(); - break; - } - case TASK_SOUND_ANGRY: - { - // sounds are complete as soon as we get here, cause we've already played them. - ALERT ( at_aiconsole, "SOUND\n" ); - TaskComplete(); - break; - } - case TASK_WAIT_FOR_SCRIPT: - { - if (m_pCine->m_iszIdle) - { - m_pCine->StartSequence( (CBaseMonster *)this, m_pCine->m_iszIdle, FALSE ); - if (FStrEq( STRING(m_pCine->m_iszIdle), STRING(m_pCine->m_iszPlay))) - { - pev->framerate = 0; - } - } - else - m_IdealActivity = ACT_IDLE; - - break; - } - case TASK_PLAY_SCRIPT: - { - pev->movetype = MOVETYPE_FLY; - ClearBits(pev->flags, FL_ONGROUND); - m_scriptState = SCRIPT_PLAYING; - break; - } - case TASK_ENABLE_SCRIPT: - { - m_pCine->DelayStart( 0 ); - TaskComplete(); - break; - } - case TASK_PLANT_ON_SCRIPT: - { - if ( m_hTargetEnt != NULL ) - { - pev->origin = m_hTargetEnt->pev->origin; // Plant on target - } - - TaskComplete(); - break; - } - case TASK_FACE_SCRIPT: - { - if ( m_hTargetEnt != NULL ) - { - pev->ideal_yaw = UTIL_AngleMod( m_hTargetEnt->pev->angles.y ); - } - - TaskComplete(); - m_IdealActivity = ACT_IDLE; - RouteClear(); - break; - } - - case TASK_SUGGEST_STATE: - { - m_IdealMonsterState = (MONSTERSTATE)(int)pTask->flData; - TaskComplete(); - break; - } - - case TASK_SET_FAIL_SCHEDULE: - m_failSchedule = (int)pTask->flData; - TaskComplete(); - break; - - case TASK_CLEAR_FAIL_SCHEDULE: - m_failSchedule = SCHED_NONE; - TaskComplete(); - break; - - default: - { - ALERT ( at_aiconsole, "No StartTask entry for %d\n", (SHARED_TASKS)pTask->iTask ); - break; - } - } -} - -//========================================================= -// GetTask - returns a pointer to the current -// scheduled task. NULL if there's a problem. -//========================================================= -Task_t *CBaseMonster :: GetTask ( void ) -{ - if ( m_iScheduleIndex < 0 || m_iScheduleIndex >= m_pSchedule->cTasks ) - { - // m_iScheduleIndex is not within valid range for the monster's current schedule. - return NULL; - } - else - { - return &m_pSchedule->pTasklist[ m_iScheduleIndex ]; - } -} - -//========================================================= -// GetSchedule - Decides which type of schedule best suits -// the monster's current state and conditions. Then calls -// monster's member function to get a pointer to a schedule -// of the proper type. -//========================================================= -Schedule_t *CBaseMonster :: GetSchedule ( void ) -{ - switch ( m_MonsterState ) - { - case MONSTERSTATE_PRONE: - { - return GetScheduleOfType( SCHED_BARNACLE_VICTIM_GRAB ); - break; - } - case MONSTERSTATE_NONE: - { - ALERT ( at_aiconsole, "MONSTERSTATE IS NONE!\n" ); - break; - } - case MONSTERSTATE_IDLE: - { - if ( HasConditions ( bits_COND_HEAR_SOUND ) ) - { - return GetScheduleOfType( SCHED_ALERT_FACE ); - } - else if ( FRouteClear() ) - { - // no valid route! - return GetScheduleOfType( SCHED_IDLE_STAND ); - } - else - { - // valid route. Get moving - return GetScheduleOfType( SCHED_IDLE_WALK ); - } - break; - } - case MONSTERSTATE_ALERT: - { - if ( HasConditions( bits_COND_ENEMY_DEAD ) && LookupActivity( ACT_VICTORY_DANCE ) != ACTIVITY_NOT_AVAILABLE ) - { - return GetScheduleOfType ( SCHED_VICTORY_DANCE ); - } - - if ( HasConditions(bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE) ) - { - if ( fabs( FlYawDiff() ) < (1.0 - m_flFieldOfView) * 60 ) // roughly in the correct direction - { - return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ORIGIN ); - } - else - { - return GetScheduleOfType( SCHED_ALERT_SMALL_FLINCH ); - } - } - - else if ( HasConditions ( bits_COND_HEAR_SOUND ) ) - { - return GetScheduleOfType( SCHED_ALERT_FACE ); - } - else - { - return GetScheduleOfType( SCHED_ALERT_STAND ); - } - break; - } - case MONSTERSTATE_COMBAT: - { - if ( HasConditions( bits_COND_ENEMY_DEAD ) ) - { - // clear the current (dead) enemy and try to find another. - m_hEnemy = NULL; - - if ( GetEnemy() ) - { - ClearConditions( bits_COND_ENEMY_DEAD ); - return GetSchedule(); - } - else - { - SetState( MONSTERSTATE_ALERT ); - return GetSchedule(); - } - } - - if ( HasConditions(bits_COND_NEW_ENEMY) ) - { - return GetScheduleOfType ( SCHED_WAKE_ANGRY ); - } - else if (HasConditions(bits_COND_LIGHT_DAMAGE) && !HasMemory( bits_MEMORY_FLINCHED) ) - { - return GetScheduleOfType( SCHED_SMALL_FLINCH ); - } - else if ( !HasConditions(bits_COND_SEE_ENEMY) ) - { - // we can't see the enemy - if ( !HasConditions(bits_COND_ENEMY_OCCLUDED) ) - { - // enemy is unseen, but not occluded! - // turn to face enemy - return GetScheduleOfType( SCHED_COMBAT_FACE ); - } - else - { - // chase! - return GetScheduleOfType( SCHED_CHASE_ENEMY ); - } - } - else - { - // we can see the enemy - if ( HasConditions(bits_COND_CAN_RANGE_ATTACK1) ) - { - return GetScheduleOfType( SCHED_RANGE_ATTACK1 ); - } - if ( HasConditions(bits_COND_CAN_RANGE_ATTACK2) ) - { - return GetScheduleOfType( SCHED_RANGE_ATTACK2 ); - } - if ( HasConditions(bits_COND_CAN_MELEE_ATTACK1) ) - { - return GetScheduleOfType( SCHED_MELEE_ATTACK1 ); - } - if ( HasConditions(bits_COND_CAN_MELEE_ATTACK2) ) - { - return GetScheduleOfType( SCHED_MELEE_ATTACK2 ); - } - if ( !HasConditions(bits_COND_CAN_RANGE_ATTACK1 | bits_COND_CAN_MELEE_ATTACK1) ) - { - // if we can see enemy but can't use either attack type, we must need to get closer to enemy - return GetScheduleOfType( SCHED_CHASE_ENEMY ); - } - else if ( !FacingIdeal() ) - { - //turn - return GetScheduleOfType( SCHED_COMBAT_FACE ); - } - else - { - ALERT ( at_aiconsole, "No suitable combat schedule!\n" ); - } - } - break; - } - case MONSTERSTATE_DEAD: - { - return GetScheduleOfType( SCHED_DIE ); - break; - } - case MONSTERSTATE_SCRIPT: - { - ASSERT( m_pCine != NULL ); - if ( !m_pCine ) - { - ALERT( at_aiconsole, "Script failed for %s\n", STRING(pev->classname) ); - CineCleanup(); - return GetScheduleOfType( SCHED_IDLE_STAND ); - } - - return GetScheduleOfType( SCHED_AISCRIPT ); - } - default: - { - ALERT ( at_aiconsole, "Invalid State for GetSchedule!\n" ); - break; - } - } - - return &slError[ 0 ]; -} From 4596f19734fe5cb23ff24808abcd7e1dd579e56c Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 2 Dec 2021 02:19:12 +0300 Subject: [PATCH 184/298] Update windows and visual studio version (#214) * Update windows and visual studio versions in CI * Try without XP toolchain * Revert "Try without XP toolchain" This reverts commit d80321a81880c4200d2e4e14f7bbed3bf9346ab0. * Force 32-bit --- .github/workflows/.github.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 34c449d1..796110fa 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -14,7 +14,7 @@ jobs: - os: ubuntu-latest cc: clang cxx: clang++ - - os: windows-2016 + - os: windows-2019 cc: cl cxx: cl env: @@ -81,12 +81,12 @@ jobs: - name: Build with msvc if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Build with msvc and vgui if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 15 2017" -B build -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name From ac2a757b9092de9102f07361f0ab07f7d475e07c Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 5 Dec 2021 14:13:44 -0500 Subject: [PATCH 185/298] Added missing tracerCount for EV_HLDM_FireBullets. (#216) --- cl_dll/ev_hldm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index f3ed52f8..00835bc8 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -500,7 +500,7 @@ void EV_FireGlock1( event_args_t *args ) VectorCopy( forward, vecAiming ); - EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, 0, args->fparam1, args->fparam2 ); + EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); } void EV_FireGlock2( event_args_t *args ) @@ -798,7 +798,7 @@ void EV_FirePython( event_args_t *args ) VectorCopy( forward, vecAiming ); - EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_357, 0, 0, args->fparam1, args->fparam2 ); + EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_357, 0, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); } //====================== // PHYTON END From 0a0952e186a81a3b219d8c373fd6ce7cc401c42e Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 5 Dec 2021 14:14:31 -0500 Subject: [PATCH 186/298] Use sound array macros. (#215) * Use random sound array. * Use random sound array. * Use random sound array. * Use random sound array. * Use random sound array. --- dlls/agrunt.cpp | 45 ++++++++++++----------------------- dlls/gargantua.cpp | 59 ++++++++++++++-------------------------------- dlls/islave.cpp | 29 ++++++++--------------- dlls/leech.cpp | 12 ++++------ dlls/zombie.cpp | 45 +++++++++++++---------------------- 5 files changed, 63 insertions(+), 127 deletions(-) diff --git a/dlls/agrunt.cpp b/dlls/agrunt.cpp index 28374a6b..6c58ba8c 100644 --- a/dlls/agrunt.cpp +++ b/dlls/agrunt.cpp @@ -335,7 +335,7 @@ void CAGrunt::DeathSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pDieSounds[RANDOM_LONG( 0, ARRAYSIZE( pDieSounds ) - 1 )], 1.0f, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pDieSounds ), 1.0f, ATTN_NORM ); } //========================================================= @@ -345,7 +345,7 @@ void CAGrunt::AlertSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAlertSounds ), 1.0f, ATTN_NORM ); } //========================================================= @@ -355,7 +355,7 @@ void CAGrunt::AttackSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0f, ATTN_NORM ); } //========================================================= @@ -372,7 +372,7 @@ void CAGrunt::PainSound( void ) StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0f, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0f, ATTN_NORM ); } //========================================================= @@ -528,7 +528,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -537,7 +537,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -557,7 +557,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * -250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -566,7 +566,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -608,30 +608,15 @@ void CAGrunt::Spawn() //========================================================= void CAGrunt::Precache() { - size_t i; - PRECACHE_MODEL( "models/agrunt.mdl" ); - for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) - PRECACHE_SOUND( pAttackHitSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) - PRECACHE_SOUND( pAttackMissSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ ) - PRECACHE_SOUND( pIdleSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pDieSounds ); i++ ) - PRECACHE_SOUND( pDieSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ ) - PRECACHE_SOUND( pPainSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) - PRECACHE_SOUND( pAttackSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ ) - PRECACHE_SOUND( pAlertSounds[i] ); + PRECACHE_SOUND_ARRAY( pAttackHitSounds ); + PRECACHE_SOUND_ARRAY( pAttackMissSounds ); + PRECACHE_SOUND_ARRAY( pIdleSounds ); + PRECACHE_SOUND_ARRAY( pDieSounds ); + PRECACHE_SOUND_ARRAY( pPainSounds ); + PRECACHE_SOUND_ARRAY( pAttackSounds ); + PRECACHE_SOUND_ARRAY( pAlertSounds ); PRECACHE_SOUND( "hassault/hw_shoot1.wav" ); diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index bc4205e5..f99b4913 100644 --- a/dlls/gargantua.cpp +++ b/dlls/gargantua.cpp @@ -471,7 +471,7 @@ void CGargantua::StompAttack( void ) UTIL_TraceLine( vecStart, vecEnd, ignore_monsters, edict(), &trace ); CStomp::StompCreate( vecStart, trace.vecEndPos, 0 ); UTIL_ScreenShake( pev->origin, 12.0, 100.0, 2.0, 1000 ); - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pStompSounds[RANDOM_LONG( 0, ARRAYSIZE( pStompSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pStompSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace ); if( trace.flFraction < 1.0f ) @@ -759,8 +759,6 @@ void CGargantua::Spawn() //========================================================= void CGargantua::Precache() { - size_t i; - PRECACHE_MODEL( "models/garg.mdl" ); PRECACHE_MODEL( GARG_EYE_SPRITE_NAME ); PRECACHE_MODEL( GARG_BEAM_SPRITE_NAME ); @@ -769,38 +767,17 @@ void CGargantua::Precache() gGargGibModel = PRECACHE_MODEL( GARG_GIB_MODEL ); PRECACHE_SOUND( GARG_STOMP_BUZZ_SOUND ); - for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) - PRECACHE_SOUND( pAttackHitSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pBeamAttackSounds ); i++ ) - PRECACHE_SOUND( pBeamAttackSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) - PRECACHE_SOUND( pAttackMissSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pRicSounds ); i++ ) - PRECACHE_SOUND( pRicSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pFootSounds ); i++ ) - PRECACHE_SOUND( pFootSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ ) - PRECACHE_SOUND( pIdleSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ ) - PRECACHE_SOUND( pAlertSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ ) - PRECACHE_SOUND( pPainSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) - PRECACHE_SOUND( pAttackSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pStompSounds ); i++ ) - PRECACHE_SOUND( pStompSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pBreatheSounds ); i++ ) - PRECACHE_SOUND( pBreatheSounds[i] ); + PRECACHE_SOUND_ARRAY( pAttackHitSounds ); + PRECACHE_SOUND_ARRAY( pBeamAttackSounds ); + PRECACHE_SOUND_ARRAY( pAttackMissSounds ); + PRECACHE_SOUND_ARRAY( pRicSounds ); + PRECACHE_SOUND_ARRAY( pFootSounds ); + PRECACHE_SOUND_ARRAY( pIdleSounds ); + PRECACHE_SOUND_ARRAY( pAlertSounds ); + PRECACHE_SOUND_ARRAY( pPainSounds ); + PRECACHE_SOUND_ARRAY( pAttackSounds ); + PRECACHE_SOUND_ARRAY( pStompSounds ); + PRECACHE_SOUND_ARRAY( pBreatheSounds ); } void CGargantua::UpdateOnRemove() @@ -831,7 +808,7 @@ void CGargantua::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec { if( m_painSoundTime < gpGlobals->time ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM ); m_painSoundTime = gpGlobals->time + RANDOM_FLOAT( 2.5, 4 ); } } @@ -976,10 +953,10 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) //UTIL_MakeVectors( pev->angles ); // called by CheckTraceHullAttack pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; } - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); } else // Play a random attack miss sound - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); Vector forward; UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL ); @@ -988,14 +965,14 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) case GARG_AE_RIGHT_FOOT: case GARG_AE_LEFT_FOOT: UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); - EMIT_SOUND_DYN( edict(), CHAN_BODY, pFootSounds[RANDOM_LONG( 0, ARRAYSIZE( pFootSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); + EMIT_SOUND_DYN( edict(), CHAN_BODY, RANDOM_SOUND_ARRAY( pFootSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); break; case GARG_AE_STOMP: StompAttack(); m_seeTime = gpGlobals->time + 12.0f; break; case GARG_AE_BREATHE: - EMIT_SOUND_DYN( edict(), CHAN_VOICE, pBreatheSounds[RANDOM_LONG( 0, ARRAYSIZE( pBreatheSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); + EMIT_SOUND_DYN( edict(), CHAN_VOICE, RANDOM_SOUND_ARRAY( pBreatheSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); break; default: CBaseMonster::HandleAnimEvent( pEvent ); @@ -1071,7 +1048,7 @@ void CGargantua::StartTask( Task_t *pTask ) break; case TASK_SOUND_ATTACK: if( RANDOM_LONG( 0, 100 ) < 30 ) - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM ); TaskComplete(); break; case TASK_DIE: diff --git a/dlls/islave.cpp b/dlls/islave.cpp index 51883be3..577eda24 100644 --- a/dlls/islave.cpp +++ b/dlls/islave.cpp @@ -235,7 +235,7 @@ void CISlave::PainSound( void ) { if( RANDOM_LONG( 0, 2 ) == 0 ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } } @@ -244,7 +244,7 @@ void CISlave::PainSound( void ) //========================================================= void CISlave::DeathSound( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pDeathSounds[RANDOM_LONG( 0, ARRAYSIZE( pDeathSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pDeathSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } //========================================================= @@ -315,12 +315,12 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.x = 5; } // Play a random attack hit sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } } break; @@ -334,11 +334,11 @@ void CISlave::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.z = -18; pHurt->pev->punchangle.x = 5; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } else { - EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, m_voicePitch ); + EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, m_voicePitch ); } } break; @@ -531,8 +531,6 @@ void CISlave::Spawn() //========================================================= void CISlave::Precache() { - size_t i; - PRECACHE_MODEL( "models/islave.mdl" ); PRECACHE_MODEL( "sprites/lgtning.spr" ); PRECACHE_SOUND( "debris/zap1.wav" ); @@ -543,17 +541,10 @@ void CISlave::Precache() PRECACHE_SOUND( "headcrab/hc_headbite.wav" ); PRECACHE_SOUND( "weapons/cbar_miss1.wav" ); - for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) - PRECACHE_SOUND( pAttackHitSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) - PRECACHE_SOUND( pAttackMissSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ ) - PRECACHE_SOUND( pPainSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pDeathSounds ); i++ ) - PRECACHE_SOUND( pDeathSounds[i] ); + PRECACHE_SOUND_ARRAY( pAttackHitSounds ); + PRECACHE_SOUND_ARRAY( pAttackMissSounds ); + PRECACHE_SOUND_ARRAY( pPainSounds ); + PRECACHE_SOUND_ARRAY( pDeathSounds ); UTIL_PrecacheOther( "test_effect" ); } diff --git a/dlls/leech.cpp b/dlls/leech.cpp index 092f338e..fd912510 100644 --- a/dlls/leech.cpp +++ b/dlls/leech.cpp @@ -259,27 +259,23 @@ void CLeech::AttackSound( void ) { if( gpGlobals->time > m_attackSoundTime ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0f, ATTN_NORM, 0, PITCH_NORM ); m_attackSoundTime = gpGlobals->time + 0.5f; } } void CLeech::AlertSound( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM * 0.5f, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAlertSounds ), 1.0f, ATTN_NORM * 0.5f, 0, PITCH_NORM ); } void CLeech::Precache( void ) { - size_t i; - //PRECACHE_MODEL( "models/icky.mdl" ); PRECACHE_MODEL( "models/leech.mdl" ); - for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) - PRECACHE_SOUND( pAttackSounds[i] ); - for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ ) - PRECACHE_SOUND( pAlertSounds[i] ); + PRECACHE_SOUND_ARRAY( pAttackSounds ); + PRECACHE_SOUND_ARRAY( pAlertSounds ); } int CLeech::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 7f891a36..b44dba38 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -154,14 +154,14 @@ void CZombie::PainSound( void ) int pitch = 95 + RANDOM_LONG( 0, 9 ); if( RANDOM_LONG( 0, 5 ) < 2 ) - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_NORM, 0, pitch ); } void CZombie::AlertSound( void ) { int pitch = 95 + RANDOM_LONG( 0, 9 ); - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[ RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAlertSounds ), 1.0, ATTN_NORM, 0, pitch ); } void CZombie::IdleSound( void ) @@ -169,7 +169,7 @@ void CZombie::IdleSound( void ) int pitch = 95 + RANDOM_LONG( 0, 9 ); // Play a random idle sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pIdleSounds[RANDOM_LONG( 0, ARRAYSIZE( pIdleSounds ) -1 )], 1.0, ATTN_NORM, 0, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pIdleSounds ), 1.0, ATTN_NORM, 0, pitch ); } void CZombie::AttackSound( void ) @@ -177,7 +177,7 @@ void CZombie::AttackSound( void ) int pitch = 95 + RANDOM_LONG( 0, 9 ); // Play a random attack sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, ATTN_NORM, 0, pitch ); } //========================================================= @@ -202,10 +202,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; } // Play a random attack hit sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5 , 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5 , 5 ) ); } else // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); if( RANDOM_LONG( 0, 1 ) ) AttackSound(); @@ -224,10 +224,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.x = 5; pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 100; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } else - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); if( RANDOM_LONG( 0, 1 ) ) AttackSound(); @@ -244,10 +244,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.x = 5; pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * -100; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } else - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); if( RANDOM_LONG( 0, 1 ) ) AttackSound(); @@ -286,27 +286,14 @@ void CZombie::Spawn() //========================================================= void CZombie::Precache() { - size_t i; - PRECACHE_MODEL( "models/zombie.mdl" ); - for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) - PRECACHE_SOUND( pAttackHitSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) - PRECACHE_SOUND( pAttackMissSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) - PRECACHE_SOUND( pAttackSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ ) - PRECACHE_SOUND( pIdleSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ ) - PRECACHE_SOUND( pAlertSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ ) - PRECACHE_SOUND( pPainSounds[i] ); + PRECACHE_SOUND_ARRAY( pAttackHitSounds ); + PRECACHE_SOUND_ARRAY( pAttackMissSounds ); + PRECACHE_SOUND_ARRAY( pAttackSounds ); + PRECACHE_SOUND_ARRAY( pIdleSounds ); + PRECACHE_SOUND_ARRAY( pAlertSounds ); + PRECACHE_SOUND_ARRAY( pPainSounds ); } //========================================================= From f7fa565c3fffcb09dd33e32b5d7835de65eafca9 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Sun, 5 Dec 2021 14:14:52 -0500 Subject: [PATCH 187/298] Removed unused variables in ev_hldm.cpp (#218) --- cl_dll/ev_hldm.cpp | 14 +++++++------- dlls/egon.cpp | 4 ++-- dlls/hornetgun.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 00835bc8..c05d6630 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -514,7 +514,7 @@ void EV_FireGlock2( event_args_t *args ) vec3_t ShellOrigin; int shell; vec3_t vecSrc, vecAiming; - vec3_t vecSpread; + //vec3_t vecSpread; vec3_t up, right, forward; idx = args->entindex; @@ -567,7 +567,7 @@ void EV_FireShotGunDouble( event_args_t *args ) vec3_t ShellOrigin; int shell; vec3_t vecSrc, vecAiming; - vec3_t vecSpread; + //vec3_t vecSpread; vec3_t up, right, forward; //float flSpread = 0.01; @@ -621,7 +621,7 @@ void EV_FireShotGunSingle( event_args_t *args ) vec3_t ShellOrigin; int shell; vec3_t vecSrc, vecAiming; - vec3_t vecSpread; + //vec3_t vecSpread; vec3_t up, right, forward; //float flSpread = 0.01; @@ -1150,8 +1150,8 @@ void EV_Crowbar( event_args_t *args ) { int idx; vec3_t origin; - vec3_t angles; - vec3_t velocity; + //vec3_t angles; + //vec3_t velocity; idx = args->entindex; VectorCopy( args->origin, origin ); @@ -1588,7 +1588,7 @@ enum hgun_e void EV_HornetGunFire( event_args_t *args ) { int idx; //, iFireMode; - vec3_t origin, angles, vecSrc, forward, right, up; + vec3_t origin, angles; //, vecSrc, forward, right, up; idx = args->entindex; VectorCopy( args->origin, origin ); @@ -1694,7 +1694,7 @@ enum squeak_e void EV_SnarkFire( event_args_t *args ) { int idx; - vec3_t vecSrc, angles, view_ofs, forward; + vec3_t vecSrc, angles, /*view_ofs,*/ forward; pmtrace_t tr; idx = args->entindex; diff --git a/dlls/egon.cpp b/dlls/egon.cpp index efbe4449..d315e26f 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -197,7 +197,7 @@ void CEgon::Attack( void ) m_flAmmoUseTime = gpGlobals->time;// start using ammo ASAP. - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 1, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, m_fireMode, 1, 0 ); m_shakeTime = 0; @@ -216,7 +216,7 @@ void CEgon::Attack( void ) if( pev->fuser1 <= UTIL_WeaponTimeBase() ) { - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, m_fireMode, 0, 0 ); pev->fuser1 = 1000; } diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index f8c54fbe..4223ddd6 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -150,7 +150,7 @@ void CHgun::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_TRACK, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -231,7 +231,7 @@ void CHgun::SecondaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_FAST, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME; From b776a2b4fc366e7b266cdae166ba031ae7cdb3b3 Mon Sep 17 00:00:00 2001 From: James Davies Date: Sun, 5 Dec 2021 16:12:41 +0000 Subject: [PATCH 188/298] Add PowerPC support --- cmake/LibraryNaming.cmake | 10 ++++++++++ public/build.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 514313ff..22a70eb3 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -28,6 +28,7 @@ check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX) check_symbol_exists(XASH_LITTLE_ENDIAN "build.h" XASH_LITTLE_ENDIAN) check_symbol_exists(XASH_MINGW "build.h" XASH_MINGW) check_symbol_exists(XASH_MIPS "build.h" XASH_MIPS) +check_symbol_exists(XASH_PPC "build.h" XASH_PPC) 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) @@ -97,6 +98,15 @@ elseif(XASH_MIPS) if(XASH_LITTLE_ENDIAN) set(BUILDARCH "${BUILDARCH}el") endif() +elseif(XASH_PPC) + set(BUILDARCH "powerpc") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + endif() + + if(XASH_LITTLE_ENDIAN) + set(BUILDARCH "${BUILDARCH}le") + endif() elseif(XASH_RISCV) set(BUILDARCH "riscv") if(XASH_64BIT) diff --git a/public/build.h b/public/build.h index 6e1f326d..3692cf17 100644 --- a/public/build.h +++ b/public/build.h @@ -65,6 +65,7 @@ For more information, please refer to #undef XASH_LITTLE_ENDIAN #undef XASH_MINGW #undef XASH_MIPS +#undef XASH_PPC #undef XASH_MOBILE_PLATFORM #undef XASH_MSVC #undef XASH_NETBSD @@ -212,6 +213,11 @@ For more information, please refer to #endif // __SOFTFP__ #elif defined __mips__ #define XASH_MIPS 1 +#elif defined __powerpc__ + #define XASH_PPC 1 + #if defined __powerpc64__ + #define XASH_64BIT 1 + #endif #elif defined __EMSCRIPTEN__ #define XASH_JS 1 #elif defined __e2k__ From a754219217cadb2e5cd2024a20b8516d44607848 Mon Sep 17 00:00:00 2001 From: James Davies Date: Sun, 5 Dec 2021 18:38:33 +0000 Subject: [PATCH 189/298] Add PowerPC support --- scripts/waifulib/library_naming.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index dd825088..a3929067 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -47,6 +47,7 @@ DEFINES = [ 'XASH_LITTLE_ENDIAN', 'XASH_MINGW', 'XASH_MIPS', +'XASH_PPC', 'XASH_MOBILE_PLATFORM', 'XASH_MSVC', 'XASH_NETBSD', @@ -123,6 +124,12 @@ def configure(conf): buildarch += "64" if conf.env.XASH_LITTLE_ENDIAN: buildarch += "el" + elif conf.env.XASH_PPC: + buildarch = "powerpc" + if conf.env.XASH_64BIT: + buildarch += "64" + if conf.env.XASH_LITTLE_ENDIAN: + buildarch += "le" elif conf.env.XASH_RISCV: buildarch = "riscv" if conf.env.XASH_64BIT: From 46d642b72b2ef414e6f4aa3202845c3753103864 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 7 Dec 2021 08:30:54 +0300 Subject: [PATCH 190/298] waifulib: update xcompile --- scripts/waifulib/xcompile.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 752a0794..5d7082b3 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -20,12 +20,12 @@ import os import sys ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK'] -ANDROID_NDK_SUPPORTED = [10, 19, 20] +ANDROID_NDK_SUPPORTED = [10, 19, 20, 23] ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag -ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16 } # minimal API level ndk revision supports +ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16 } # minimal API level ndk revision supports ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets # This class does support ONLY r10e and r19c/r20 NDK @@ -196,6 +196,8 @@ class Android: return os.path.join(self.gen_gcc_toolchain_path(), 'bin', triplet) def gen_binutils_path(self): + if self.ndk_rev >= 23: + return os.path.join(self.gen_gcc_toolchain_path(), 'bin') return os.path.join(self.gen_gcc_toolchain_path(), self.ndk_triplet(), 'bin') def cc(self): @@ -227,6 +229,9 @@ class Android: if 'STRIP' in environ: return environ['STRIP'] return 'llvm-strip' + + if self.ndk_rev >= 23: + return os.path.join(self.gen_binutils_path(), 'llvm-strip') return os.path.join(self.gen_binutils_path(), 'strip') def system_stl(self): @@ -322,9 +327,16 @@ class Android: return linkflags def ldflags(self): - ldflags = ['-lgcc', '-no-canonical-prefixes'] + ldflags = [] + + if self.ndk_rev < 23: + ldflags += ['-lgcc'] + + ldflags += ['-no-canonical-prefixes'] + if self.is_clang() or self.is_host(): ldflags += ['-stdlib=libstdc++'] + if self.is_arm(): if self.arch == 'armeabi-v7a': ldflags += ['-march=armv7-a', '-mthumb'] From 8a43dfbaabf5094514021c6462acff77b47d1717 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 7 Dec 2021 09:00:35 +0300 Subject: [PATCH 191/298] waifulib: migrate to compiler_optimizations waf tool --- scripts/waifulib/compiler_optimizations.py | 167 +++++++++++++++++++++ wscript | 89 +---------- 2 files changed, 170 insertions(+), 86 deletions(-) create mode 100644 scripts/waifulib/compiler_optimizations.py diff --git a/scripts/waifulib/compiler_optimizations.py b/scripts/waifulib/compiler_optimizations.py new file mode 100644 index 00000000..e964c812 --- /dev/null +++ b/scripts/waifulib/compiler_optimizations.py @@ -0,0 +1,167 @@ +# encoding: utf-8 +# compiler_optimizations.py -- main entry point for configuring C/C++ compilers +# Copyright (C) 2021 a1batross +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +try: from fwgslib import get_flags_by_type, get_flags_by_compiler +except: from waflib.extras.fwgslib import get_flags_by_type, get_flags_by_compiler +from waflib.Configure import conf +from waflib import Logs + +''' +Flags can be overriden and new types can be added +by importing this as normal Python module + +Example: +#!/usr/bin/env python +from waflib.extras import compiler_optimizations + +compiler_optimizations.VALID_BUILD_TYPES += 'gottagofast' +compiler_optimizations.CFLAGS['gottagofast'] = { + 'gcc': ['-Ogentoo'] +} +''' + +VALID_BUILD_TYPES = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] + +LINKFLAGS = { + 'common': { + 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries + 'gcc': ['-Wl,--no-undefined'], + 'owcc': ['-Wl,option stack=512k'] + }, + 'sanitize': { + 'clang': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'], + 'gcc': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'], + }, + 'debug': { + 'msvc': ['/INCREMENTAL', '/SAFESEH:NO'] + } +} + +CFLAGS = { + 'common': { + # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP + 'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden', '-fno-threadsafe-statics'], + 'gcc': ['-g', '-fvisibility=hidden'], + 'owcc': ['-fno-short-enum', '-ffloat-store', '-g3'] + }, + 'fast': { + 'msvc': ['/O2', '/Oy', '/Zi'], + 'gcc': { + '3': ['-O3', '-fomit-frame-pointer'], + 'default': ['-Ofast', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'] + }, + 'clang': ['-Ofast'], + 'default': ['-O3'] + }, + 'fastnative': { + 'msvc': ['/O2', '/Oy', '/Zi'], + 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], + 'clang': ['-Ofast', '-march=native'], + 'default': ['-O3'] + }, + 'release': { + 'msvc': ['/O2', '/Zi'], + 'owcc': ['-O3', '-foptimize-sibling-calls', '-fomit-leaf-frame-pointer', '-fomit-frame-pointer', '-fschedule-insns', '-funsafe-math-optimizations', '-funroll-loops', '-frerun-optimizer', '-finline-functions', '-finline-limit=512', '-fguess-branch-probability', '-fno-strict-aliasing', '-floop-optimize'], + 'default': ['-O3'] + }, + 'debug': { + 'msvc': ['/Od', '/ZI'], + 'owcc': ['-O0', '-fno-omit-frame-pointer', '-funwind-tables', '-fno-omit-leaf-frame-pointer'], + 'default': ['-O0'] + }, + 'sanitize': { + 'msvc': ['/Od', '/RTC1', '/Zi'], + 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address', '-pthread'], + 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'], + 'default': ['-O0'] + }, + 'nooptimize': { + 'msvc': ['/Od', '/Zi'], + 'default': ['-O0'] + } +} + +LTO_CFLAGS = { + 'msvc': ['/GL'], + 'gcc': ['-flto'], + 'clang': ['-flto'] +} + +LTO_LINKFLAGS = { + 'msvc': ['/LTCG'], + 'gcc': ['-flto'], + 'clang': ['-flto'] +} + +POLLY_CFLAGS = { + 'gcc': ['-fgraphite-identity'], + 'clang': ['-mllvm', '-polly'] + # msvc sosat :( +} + +def options(opt): + grp = opt.add_option_group('Compiler optimization options') + + grp.add_option('-T', '--build-type', action='store', dest='BUILD_TYPE', default=None, + help = 'build type: debug, release or none(custom flags)') + + grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, + help = 'enable Link Time Optimization if possible [default: %default]') + + grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, + help = 'enable polyhedral optimization if possible [default: %default]') + +def configure(conf): + conf.start_msg('Build type') + if conf.options.BUILD_TYPE == None: + conf.end_msg('not set', color='RED') + conf.fatal('Set a build type, for example "-T release"') + elif not conf.options.BUILD_TYPE in VALID_BUILD_TYPES: + conf.end_msg(conf.options.BUILD_TYPE, color='RED') + conf.fatal('Invalid build type. Valid are: %s' % ', '.join(VALID_BUILD_TYPES)) + conf.end_msg(conf.options.BUILD_TYPE) + + conf.msg('LTO build', 'yes' if conf.options.LTO else 'no') + conf.msg('PolyOpt build', 'yes' if conf.options.POLLY else 'no') + + # -march=native should not be used + if conf.options.BUILD_TYPE.startswith('fast'): + Logs.warn('WARNING: \'%s\' build type should not be used in release builds', conf.options.BUILD_TYPE) + + try: + conf.env.CC_VERSION[0] + except IndexError: + conf.env.CC_VERSION = (0,) + +@conf +def get_optimization_flags(conf): + '''Returns a list of compile flags, + depending on build type and options set by user + + NOTE: it doesn't filter out unsupported flags + + :returns: tuple of cflags and linkflags + ''' + linkflags = conf.get_flags_by_type(LINKFLAGS, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + + cflags = conf.get_flags_by_type(CFLAGS, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + + if conf.options.LTO: + linkflags+= conf.get_flags_by_compiler(LTO_LINKFLAGS, conf.env.COMPILER_CC) + cflags += conf.get_flags_by_compiler(LTO_CFLAGS, conf.env.COMPILER_CC) + + if conf.options.POLLY: + cflags += conf.get_flags_by_compiler(POLLY_CFLAGS, conf.env.COMPILER_CC) + + return cflags, linkflags diff --git a/wscript b/wscript index 200b1e82..336e8d34 100644 --- a/wscript +++ b/wscript @@ -22,9 +22,6 @@ def get_taskgen_count(self): def options(opt): grp = opt.add_option_group('Common options') - grp.add_option('-T', '--build-type', action='store', dest='BUILD_TYPE', default = None, - help = 'build type: debug, release or none(custom flags)') - grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False, help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %default]') @@ -34,13 +31,7 @@ def options(opt): grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False, help = 'enable GoldSource engine support [default: %default]') - grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, - help = 'enable Link Time Optimization [default: %default]') - - grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, - help = 'enable polyhedral optimization if possible [default: %default]') - - opt.load('subproject') + opt.load('compiler_optimizations subproject') opt.add_subproject(['cl_dll', 'dlls']) @@ -57,23 +48,9 @@ def configure(conf): conf.env.SERVER_NAME = 'hl' conf.env.PREFIX = '' - conf.load('fwgslib reconfigure enforce_pic') + conf.load('fwgslib reconfigure compiler_optimizations enforce_pic') enforce_pic = True # modern defaults - valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] - conf.load('fwgslib reconfigure') - conf.start_msg('Build type') - if conf.options.BUILD_TYPE == None: - conf.end_msg('not set', color='RED') - conf.fatal('Please set a build type, for example "-T release"') - elif not conf.options.BUILD_TYPE in valid_build_types: - conf.end_msg(conf.options.BUILD_TYPE, color='RED') - conf.fatal('Invalid build type. Valid are: %s' % ', '.join(valid_build_types)) - conf.end_msg(conf.options.BUILD_TYPE) - - # -march=native should not be used - if conf.options.BUILD_TYPE == 'fast': - Logs.warn('WARNING: \'fast\' build type should not be used in release builds') conf.env.VOICEMGR = conf.options.VOICEMGR conf.env.GOLDSRC = conf.options.GOLDSRC @@ -96,11 +73,6 @@ def configure(conf): conf.load('msvs msdev strip_on_install') - try: - conf.env.CC_VERSION[0] - except IndexError: - conf.env.CC_VERSION = (0, ) - if conf.env.DEST_OS == 'android': conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified @@ -121,60 +93,6 @@ def configure(conf): conf.env.BIT32_MANDATORY = not conf.env.BIT32_ALLOW64 conf.load('force_32bit library_naming') - linker_flags = { - 'common': { - 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries - 'gcc': ['-Wl,--no-undefined'] - }, - 'sanitize': { - 'clang': ['-fsanitize=undefined', '-fsanitize=address'], - 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], - } - } - - compiler_c_cxx_flags = { - 'common': { - # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP - 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], - 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'], - 'gcc': ['-g'] - }, - 'fast': { - 'msvc': ['/O2', '/Oy'], - 'gcc': { - '3': ['-O3', '-Os', '-funsafe-math-optimizations', '-fomit-frame-pointer'], - 'default': ['-Ofast', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'] - }, - 'clang': ['-Ofast'], - 'default': ['-O3'] - }, - 'fastnative': { - 'msvc': ['/O2', '/Oy'], - 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], - 'clang': ['-Ofast', '-march=native'], - 'default': ['-O3'] - }, - 'release': { - 'msvc': ['/O2'], - 'default': ['-O3'] - }, - 'debug': { - 'msvc': ['/O1'], - 'gcc': ['-Og'], - 'default': ['-O1'] - }, - 'sanitize': { - 'msvc': ['/Od', '/RTC1'], - 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], - 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address'], - 'default': ['-O0'] - }, - 'nooptimize': { - 'msvc': ['/Od'], - 'default': ['-O0'] - } - } - compiler_optional_flags = [ '-fdiagnostics-color=always', '-Werror=return-type', @@ -194,8 +112,7 @@ def configure(conf): '-Werror=declaration-after-statement' ] - linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) - cflags = conf.get_flags_by_type(compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + cflags, linkflags = conf.get_optimization_flags() # Here we don't differentiate C or C++ flags if conf.options.LTO: From 9d65397325db05da88c8cf21dd6a9c9691f1eb99 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Tue, 7 Dec 2021 19:50:05 -0500 Subject: [PATCH 192/298] Fixed incorrect field types. (#219) --- dlls/animating.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/animating.cpp b/dlls/animating.cpp index cab2c198..d6cb4190 100644 --- a/dlls/animating.cpp +++ b/dlls/animating.cpp @@ -28,11 +28,11 @@ TYPEDESCRIPTION CBaseAnimating::m_SaveData[] = { - DEFINE_FIELD( CBaseMonster, m_flFrameRate, FIELD_FLOAT ), - DEFINE_FIELD( CBaseMonster, m_flGroundSpeed, FIELD_FLOAT ), - DEFINE_FIELD( CBaseMonster, m_flLastEventCheck, FIELD_TIME ), - DEFINE_FIELD( CBaseMonster, m_fSequenceFinished, FIELD_BOOLEAN ), - DEFINE_FIELD( CBaseMonster, m_fSequenceLoops, FIELD_BOOLEAN ), + DEFINE_FIELD( CBaseAnimating, m_flFrameRate, FIELD_FLOAT ), + DEFINE_FIELD( CBaseAnimating, m_flGroundSpeed, FIELD_FLOAT ), + DEFINE_FIELD( CBaseAnimating, m_flLastEventCheck, FIELD_TIME ), + DEFINE_FIELD( CBaseAnimating, m_fSequenceFinished, FIELD_BOOLEAN ), + DEFINE_FIELD( CBaseAnimating, m_fSequenceLoops, FIELD_BOOLEAN ), }; IMPLEMENT_SAVERESTORE( CBaseAnimating, CBaseDelay ) From dcb83a68565d06d46d963f70ac0fda1c2ef4ab8d Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Tue, 7 Dec 2021 19:50:25 -0500 Subject: [PATCH 193/298] Fixed wrong base class specified. (#221) --- dlls/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 87e08ce7..9a63fe34 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -130,7 +130,7 @@ TYPEDESCRIPTION CMultiSource::m_SaveData[] = DEFINE_FIELD( CMultiSource, m_globalstate, FIELD_STRING ), }; -IMPLEMENT_SAVERESTORE( CMultiSource, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CMultiSource, CPointEntity ) LINK_ENTITY_TO_CLASS( multisource, CMultiSource ) From 9aff6c088d2236c28e647834b2ae757fa29c9b1f Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Tue, 7 Dec 2021 19:50:45 -0500 Subject: [PATCH 194/298] Fixed wrong base class specified. (#220) --- dlls/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 9a63fe34..7ca7c2fd 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -57,7 +57,7 @@ TYPEDESCRIPTION CEnvGlobal::m_SaveData[] = DEFINE_FIELD( CEnvGlobal, m_initialstate, FIELD_INTEGER ), }; -IMPLEMENT_SAVERESTORE( CEnvGlobal, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CEnvGlobal, CPointEntity ) LINK_ENTITY_TO_CLASS( env_global, CEnvGlobal ) From 59fe50125403b0bddd23ad829ac7e9e4570dc926 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Wed, 8 Dec 2021 20:02:49 -0500 Subject: [PATCH 195/298] Fixed wrong base class specified. (#222) --- dlls/func_break.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 98432d06..916913f2 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -139,7 +139,7 @@ TYPEDESCRIPTION CBreakable::m_SaveData[] = // Explosion magnitude is stored in pev->impulse }; -IMPLEMENT_SAVERESTORE( CBreakable, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CBreakable, CBaseDelay ) void CBreakable::Spawn( void ) { From ccfe0c659e2b9d2a44b70c278dc54ad475ed4c62 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Wed, 8 Dec 2021 20:03:12 -0500 Subject: [PATCH 196/298] Fixed wrong base class specified. (#224) --- dlls/h_battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index f0cf612b..77559cc5 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -60,7 +60,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] = DEFINE_FIELD( CRecharge, m_flSoundTime, FIELD_TIME ), }; -IMPLEMENT_SAVERESTORE( CRecharge, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CRecharge, CBaseToggle ) LINK_ENTITY_TO_CLASS( func_recharge, CRecharge ) From 0df2d289bb5a1b0135dc51c674b77eebb89c538e Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Wed, 8 Dec 2021 20:03:47 -0500 Subject: [PATCH 197/298] Fixed wrong base class specified. (#223) --- dlls/healthkit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index 9e111300..37e4624a 100644 --- a/dlls/healthkit.cpp +++ b/dlls/healthkit.cpp @@ -127,7 +127,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] = DEFINE_FIELD( CWallHealth, m_flSoundTime, FIELD_TIME ), }; -IMPLEMENT_SAVERESTORE( CWallHealth, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CWallHealth, CBaseToggle ) LINK_ENTITY_TO_CLASS( func_healthcharger, CWallHealth ) From a5344eb4ccaf10c1deaec27e6e10de90aa92438f Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Thu, 9 Dec 2021 21:38:48 -0500 Subject: [PATCH 198/298] Fixed wrong base class specified. (#226) --- dlls/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 688b4016..3dbd097a 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -825,7 +825,7 @@ TYPEDESCRIPTION CEnvSound::m_SaveData[] = DEFINE_FIELD( CEnvSound, m_flRoomtype, FIELD_FLOAT ), }; -IMPLEMENT_SAVERESTORE( CEnvSound, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CEnvSound, CPointEntity ) void CEnvSound::KeyValue( KeyValueData *pkvd ) { From f0ed7d1bc194f66be5c5df084d8dc7f76706a56c Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Thu, 9 Dec 2021 21:39:06 -0500 Subject: [PATCH 199/298] Fixed wrong base class specified. (#225) --- dlls/pathcorner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/pathcorner.cpp b/dlls/pathcorner.cpp index bc999675..c563bf69 100644 --- a/dlls/pathcorner.cpp +++ b/dlls/pathcorner.cpp @@ -125,7 +125,7 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] = DEFINE_FIELD( CPathTrack, m_altName, FIELD_STRING ), }; -IMPLEMENT_SAVERESTORE( CPathTrack, CBaseEntity ) +IMPLEMENT_SAVERESTORE( CPathTrack, CPointEntity ) LINK_ENTITY_TO_CLASS( path_track, CPathTrack ) // From f43961e4d044bbc82dae0c7aac0797008cd7adf4 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Tue, 14 Dec 2021 09:23:07 -0500 Subject: [PATCH 200/298] Simplify glock fire events (#231) * Refactor EV_FireGlock2. * Moved EV_FireGlock1 implementation to static function. --- cl_dll/ev_hldm.cpp | 51 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index c05d6630..6eee0328 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -458,7 +458,8 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int //====================== // GLOCK START //====================== -void EV_FireGlock1( event_args_t *args ) +// Shared Glock fire implementation for EV_FireGlock1 and EV_FireGlock2. +static void EV_FireGlock_Impl( event_args_t *args ) { int idx; vec3_t origin; @@ -503,50 +504,14 @@ void EV_FireGlock1( event_args_t *args ) EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); } +void EV_FireGlock1( event_args_t *args ) +{ + EV_FireGlock_Impl( args ); +} + void EV_FireGlock2( event_args_t *args ) { - int idx; - vec3_t origin; - vec3_t angles; - vec3_t velocity; - - vec3_t ShellVelocity; - vec3_t ShellOrigin; - int shell; - vec3_t vecSrc, vecAiming; - //vec3_t vecSpread; - vec3_t up, right, forward; - - idx = args->entindex; - VectorCopy( args->origin, origin ); - VectorCopy( args->angles, angles ); - VectorCopy( args->velocity, velocity ); - int empty = args->bparam1; - - AngleVectors( angles, forward, right, up ); - - shell = gEngfuncs.pEventAPI->EV_FindModelIndex( "models/shell.mdl" );// brass shell - - if( EV_IsLocal( idx ) ) - { - // Add muzzle flash to current weapon model - EV_MuzzleFlash(); - gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 2 ); - - V_PunchAxis( 0, -2.0 ); - } - - EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 ); - - EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[YAW], shell, TE_BOUNCE_SHELL ); - - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/pl_gun3.wav", gEngfuncs.pfnRandomFloat( 0.92, 1.0 ), ATTN_NORM, 0, 98 + gEngfuncs.pfnRandomLong( 0, 3 ) ); - - EV_GetGunPosition( args, vecSrc, origin ); - - VectorCopy( forward, vecAiming ); - - EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_9MM, 0, &g_tracerCount[idx - 1], args->fparam1, args->fparam2 ); + EV_FireGlock_Impl( args ); } //====================== // GLOCK END From 215ac04f7094880c04d5eb40c9c63dd8853b6ed8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 17 Dec 2021 03:16:35 +0300 Subject: [PATCH 201/298] waifulib: update xcompile from engine branch --- scripts/waifulib/xcompile.py | 52 +++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 5d7082b3..0abf53f1 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -26,6 +26,8 @@ ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16 } # minimal API level ndk revision supports + +ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21 ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets # This class does support ONLY r10e and r19c/r20 NDK @@ -266,47 +268,43 @@ class Android: '-isystem', '%s/usr/include/' % (self.sysroot()) ] - cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] + cflags += ['-I%s' % (self.system_stl())] + if not self.is_clang(): + cflags += ['-DANDROID', '-D__ANDROID__'] if cxx and not self.is_clang() and self.toolchain not in ['4.8','4.9']: cflags += ['-fno-sized-deallocation'] - def fixup_host_clang_with_old_ndk(): - cflags = [] - # Clang builtin redefine w/ different calling convention bug - # NOTE: I did not added complex.h functions here, despite - # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex - # math functions - # I personally don't need complex numbers support, but if you want it - # just run sed to patch header - for f in ['strtod', 'strtof', 'strtold']: - cflags += ['-fno-builtin-%s' % f] - return cflags - + if self.is_clang(): + # stpcpy() isn't available in early Android versions + # disable it here so Clang won't use it + if self.api < ANDROID_STPCPY_API_MIN: + cflags += ['-fno-builtin-stpcpy'] if self.is_arm(): if self.arch == 'armeabi-v7a': # ARMv7 support - cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS'] - - if not self.is_clang() and not self.is_host(): - cflags += [ '-mvectorize-with-neon-quad' ] - - if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: - cflags += fixup_host_clang_with_old_ndk() + cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9'] if self.is_hardfp(): cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] + + if self.is_host(): + # Clang builtin redefine w/ different calling convention bug + # NOTE: I did not added complex.h functions here, despite + # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex + # math functions + # I personally don't need complex numbers support, but if you want it + # just run sed to patch header + for f in ['strtod', 'strtof', 'strtold']: + cflags += ['-fno-builtin-%s' % f] else: cflags += ['-mfloat-abi=softfp'] else: - if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: - cflags += fixup_host_clang_with_old_ndk() - # ARMv5 support cflags += ['-march=armv5te', '-msoft-float'] elif self.is_x86(): - cflags += ['-mtune=atom', '-march=atom', '-mssse3', '-mfpmath=sse', '-DVECTORIZE_SINCOS', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS'] + cflags += ['-mtune=atom', '-march=atom', '-mssse3', '-mfpmath=sse'] return cflags # they go before object list @@ -322,8 +320,9 @@ class Android: if self.is_clang() or self.is_host(): linkflags += ['-fuse-ld=lld'] + else: linkflags += ['-no-canonical-prefixes'] - linkflags += ['-Wl,--hash-style=sysv', '-Wl,--no-undefined', '-no-canonical-prefixes'] + linkflags += ['-Wl,--hash-style=sysv', '-Wl,--no-undefined'] return linkflags def ldflags(self): @@ -332,10 +331,9 @@ class Android: if self.ndk_rev < 23: ldflags += ['-lgcc'] - ldflags += ['-no-canonical-prefixes'] - if self.is_clang() or self.is_host(): ldflags += ['-stdlib=libstdc++'] + else: ldflags += ['-no-canonical-prefixes'] if self.is_arm(): if self.arch == 'armeabi-v7a': From db95d4a1ccdfdbcf379155c9122b11c557cfb05d Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Mon, 20 Dec 2021 09:17:49 -0500 Subject: [PATCH 202/298] Removed duplicate field in CShotgun save data table. (#233) --- dlls/weapons.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 773213b3..f4ad57c4 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1603,7 +1603,6 @@ TYPEDESCRIPTION CShotgun::m_SaveData[] = { DEFINE_FIELD( CShotgun, m_flNextReload, FIELD_TIME ), DEFINE_FIELD( CShotgun, m_fInSpecialReload, FIELD_INTEGER ), - DEFINE_FIELD( CShotgun, m_flNextReload, FIELD_TIME ), // DEFINE_FIELD( CShotgun, m_iShell, FIELD_INTEGER ), DEFINE_FIELD( CShotgun, m_flPumpTime, FIELD_TIME ), }; From 8768594509cfd330613211fb2e176117ad4eaa37 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Mon, 20 Dec 2021 18:00:54 -0500 Subject: [PATCH 203/298] Decrement rocket count only if it was successfully created. (#234) In addition, make smoke effect and swap sides only if rocket was successfully created. --- dlls/apache.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/dlls/apache.cpp b/dlls/apache.cpp index 0844e2c4..f37f8cb1 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -757,23 +757,25 @@ void CApache::FireRocket( void ) break; } - MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSrc ); - WRITE_BYTE( TE_SMOKE ); - WRITE_COORD( vecSrc.x ); - WRITE_COORD( vecSrc.y ); - WRITE_COORD( vecSrc.z ); - WRITE_SHORT( g_sModelIndexSmoke ); - WRITE_BYTE( 20 ); // scale * 10 - WRITE_BYTE( 12 ); // framerate - MESSAGE_END(); - CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() ); if( pRocket ) + { + MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSrc ); + WRITE_BYTE( TE_SMOKE ); + WRITE_COORD( vecSrc.x ); + WRITE_COORD( vecSrc.y ); + WRITE_COORD( vecSrc.z ); + WRITE_SHORT( g_sModelIndexSmoke ); + WRITE_BYTE( 20 ); // scale * 10 + WRITE_BYTE( 12 ); // framerate + MESSAGE_END(); + pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100.0f; - m_iRockets--; + m_iRockets--; - side = - side; + side = - side; + } } BOOL CApache::FireGun() From 1f23bff236b9d3a3bd717ea533cee42b931d564c Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Fri, 31 Dec 2021 12:03:05 -0500 Subject: [PATCH 204/298] Restore Hornetgun fire phase. (#238) --- dlls/weapons.cpp | 1 + dlls/weapons.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index f4ad57c4..76e5408d 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1637,6 +1637,7 @@ IMPLEMENT_SAVERESTORE( CEgon, CBasePlayerWeapon ) TYPEDESCRIPTION CHgun::m_SaveData[] = { DEFINE_FIELD( CHgun, m_flRechargeTime, FIELD_TIME ), + DEFINE_FIELD( CHgun, m_iFirePhase, FIELD_INTEGER ), }; IMPLEMENT_SAVERESTORE( CHgun, CBasePlayerWeapon ) diff --git a/dlls/weapons.h b/dlls/weapons.h index 7e33de78..c5f0d46a 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -870,7 +870,7 @@ public: float m_flRechargeTime; - int m_iFirePhase;// don't save me. + int m_iFirePhase; virtual BOOL UseDecrement( void ) { From e7ef84c83db25f5b5b4c8549069135331b5ceeb2 Mon Sep 17 00:00:00 2001 From: a1batross Date: Fri, 21 Jan 2022 03:58:52 +0300 Subject: [PATCH 205/298] engine: delete obsolete engine VC6 project --- engine/engine.dsp | 621 ---------------------------------------------- 1 file changed, 621 deletions(-) delete mode 100644 engine/engine.dsp diff --git a/engine/engine.dsp b/engine/engine.dsp deleted file mode 100644 index b79d1bfe..00000000 --- a/engine/engine.dsp +++ /dev/null @@ -1,621 +0,0 @@ -# Microsoft Developer Studio Project File - Name="engine" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=engine - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "engine.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "engine.mak" CFG="engine - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "engine - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "engine - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir ".\Release" -# PROP BASE Intermediate_Dir ".\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\temp\engine\!release" -# PROP Intermediate_Dir "..\temp\engine\!release" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "common" /I "common/imagelib" /I "common/soundlib" /I "server" /I "client" /I "client/vgui" /I "../common" /I "../game_shared" /I "../pm_shared" /I "../utils/vgui/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /Fr /YX -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /opt:nowin98 -# ADD LINK32 msvcrt.lib user32.lib gdi32.lib shell32.lib advapi32.lib winmm.lib mpeg.lib ../utils/vgui/lib/win32_vc6/vgui.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /nodefaultlib:"libc" /out:"..\temp\engine\!release/xash.dll" /libpath:"./common/soundlib" /opt:nowin98 -# SUBTRACT LINK32 /debug /nodefaultlib -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\engine\!release -InputPath=\Xash3D\src_main\temp\engine\!release\xash.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\xash.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\xash.dll "D:\Xash3D\xash.dll" - -# End Custom Build - -!ELSEIF "$(CFG)" == "engine - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir ".\Debug" -# PROP BASE Intermediate_Dir ".\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\temp\engine\!debug" -# PROP Intermediate_Dir "..\temp\engine\!debug" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c -# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "./" /I "common" /I "common/imagelib" /I "common/soundlib" /I "server" /I "client" /I "client/vgui" /I "../common" /I "../game_shared" /I "../pm_shared" /I "../utils/vgui/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FAs /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 -# ADD LINK32 msvcrtd.lib user32.lib gdi32.lib shell32.lib advapi32.lib winmm.lib mpeg_dbg.lib ../utils/vgui/lib/win32_vc6/vgui.lib /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libcd.lib" /out:"..\temp\engine\!debug/xash.dll" /pdbtype:sept /libpath:"./common/soundlib" -# SUBTRACT LINK32 /incremental:no /map /nodefaultlib -# Begin Custom Build -TargetDir=\Xash3D\src_main\temp\engine\!debug -InputPath=\Xash3D\src_main\temp\engine\!debug\xash.dll -SOURCE="$(InputPath)" - -"D:\Xash3D\xash.dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\xash.dll "D:\Xash3D\xash.dll" - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "engine - Win32 Release" -# Name "engine - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" -# Begin Source File - -SOURCE=.\common\avikit.c -# End Source File -# Begin Source File - -SOURCE=.\common\build.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_cmds.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_demo.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_events.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_frame.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_game.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_main.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_menu.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_parse.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_pmove.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_remap.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_scrn.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_tent.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_video.c -# End Source File -# Begin Source File - -SOURCE=.\client\cl_view.c -# End Source File -# Begin Source File - -SOURCE=.\common\cmd.c -# End Source File -# Begin Source File - -SOURCE=.\common\common.c -# End Source File -# Begin Source File - -SOURCE=.\common\con_utils.c -# End Source File -# Begin Source File - -SOURCE=.\common\console.c -# End Source File -# Begin Source File - -SOURCE=.\common\crclib.c -# End Source File -# Begin Source File - -SOURCE=.\common\crtlib.c -# End Source File -# Begin Source File - -SOURCE=.\common\cvar.c -# End Source File -# Begin Source File - -SOURCE=.\common\filesystem.c -# End Source File -# Begin Source File - -SOURCE=.\common\gamma.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_backend.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_beams.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_cull.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_decals.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_draw.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_image.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_mirror.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_refrag.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rlight.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rmain.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rmath.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rmisc.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rpart.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_rsurf.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_sprite.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_studio.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_vidnt.c -# End Source File -# Begin Source File - -SOURCE=.\client\gl_warp.c -# End Source File -# Begin Source File - -SOURCE=.\common\host.c -# End Source File -# Begin Source File - -SOURCE=.\common\hpak.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_bmp.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_dds.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_main.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_quant.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_tga.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_utils.c -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\img_wad.c -# End Source File -# Begin Source File - -SOURCE=.\common\infostring.c -# End Source File -# Begin Source File - -SOURCE=.\common\input.c -# End Source File -# Begin Source File - -SOURCE=.\common\keys.c -# End Source File -# Begin Source File - -SOURCE=.\common\library.c -# End Source File -# Begin Source File - -SOURCE=.\common\mathlib.c -# End Source File -# Begin Source File - -SOURCE=.\common\matrixlib.c -# End Source File -# Begin Source File - -SOURCE=.\common\mod_studio.c -# End Source File -# Begin Source File - -SOURCE=.\common\model.c -# End Source File -# Begin Source File - -SOURCE=.\common\net_buffer.c -# End Source File -# Begin Source File - -SOURCE=.\common\net_chan.c -# End Source File -# Begin Source File - -SOURCE=.\common\net_encode.c -# End Source File -# Begin Source File - -SOURCE=.\common\net_huff.c -# End Source File -# Begin Source File - -SOURCE=.\common\network.c -# End Source File -# Begin Source File - -SOURCE=.\common\pm_surface.c -# End Source File -# Begin Source File - -SOURCE=.\common\pm_trace.c -# End Source File -# Begin Source File - -SOURCE=.\common\random.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_backend.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_dsp.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_load.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_main.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_mix.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_mouth.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_stream.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_utils.c -# End Source File -# Begin Source File - -SOURCE=.\client\s_vox.c -# End Source File -# Begin Source File - -SOURCE=.\common\soundlib\snd_main.c -# End Source File -# Begin Source File - -SOURCE=.\common\soundlib\snd_mp3.c -# End Source File -# Begin Source File - -SOURCE=.\common\soundlib\snd_utils.c -# End Source File -# Begin Source File - -SOURCE=.\common\soundlib\snd_wav.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_client.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_cmds.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_custom.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_frame.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_game.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_init.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_main.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_move.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_phys.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_pmove.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_save.c -# End Source File -# Begin Source File - -SOURCE=.\server\sv_world.c -# End Source File -# Begin Source File - -SOURCE=.\common\sys_con.c -# End Source File -# Begin Source File - -SOURCE=.\common\sys_win.c -# End Source File -# Begin Source File - -SOURCE=.\common\titles.c -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_clip.cpp -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_draw.c -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_font.cpp -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_input.cpp -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_int.cpp -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_surf.cpp -# End Source File -# Begin Source File - -SOURCE=.\common\world.c -# End Source File -# Begin Source File - -SOURCE=.\common\zone.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" -# Begin Source File - -SOURCE=.\client\cl_tent.h -# End Source File -# Begin Source File - -SOURCE=.\client\client.h -# End Source File -# Begin Source File - -SOURCE=.\common\common.h -# End Source File -# Begin Source File - -SOURCE=.\common\crtlib.h -# End Source File -# Begin Source File - -SOURCE=.\common\filesystem.h -# End Source File -# Begin Source File - -SOURCE=.\client\gl_export.h -# End Source File -# Begin Source File - -SOURCE=.\client\gl_local.h -# End Source File -# Begin Source File - -SOURCE=.\common\imagelib\imagelib.h -# End Source File -# Begin Source File - -SOURCE=.\common\library.h -# End Source File -# Begin Source File - -SOURCE=.\common\mathlib.h -# End Source File -# Begin Source File - -SOURCE=.\common\mod_local.h -# End Source File -# Begin Source File - -SOURCE=.\common\net_buffer.h -# End Source File -# Begin Source File - -SOURCE=.\common\net_encode.h -# End Source File -# Begin Source File - -SOURCE=.\common\protocol.h -# End Source File -# Begin Source File - -SOURCE=.\server\server.h -# End Source File -# Begin Source File - -SOURCE=.\client\sound.h -# End Source File -# Begin Source File - -SOURCE=.\common\soundlib\soundlib.h -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_draw.h -# End Source File -# Begin Source File - -SOURCE=.\client\vgui\vgui_main.h -# End Source File -# Begin Source File - -SOURCE=.\client\vox.h -# End Source File -# Begin Source File - -SOURCE=.\common\world.h -# End Source File -# End Group -# End Target -# End Project From 808be9442f60b4388f68fcef8b2659d0cd6db17b Mon Sep 17 00:00:00 2001 From: a1batross Date: Sun, 24 Apr 2022 01:43:45 +0300 Subject: [PATCH 206/298] Use filtered command buffer when string came from network (#241) * cdll_int: add undocumented FilteredClientCmd function to client interface * client: use filtered command buffer where we have to execute command from server * client: use normal pfnClientCmd in place of pfnFilteredClientCmd in case of engine doesn't supports it * client: don't read out of bounds if engine interface is old and don't have pfnFilteredClientCmd * client: fix incorrect cvar pointer comparison --- cl_dll/cdll_int.cpp | 12 +++++++++++- cl_dll/hud_spectator.cpp | 2 +- cl_dll/vgui_TeamFortressViewport.h | 2 +- engine/cdll_int.h | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 23da5ae7..17fc06f3 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -167,7 +167,17 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) if( iVersion != CLDLL_INTERFACE_VERSION ) return 0; - memcpy( &gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t) ); + // for now filterstuffcmd is last in the engine interface + memcpy( &gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t) - sizeof( void * ) ); + + if( gEngfuncs.pfnGetCvarPointer( "cl_filterstuffcmd" ) == 0 ) + { + gEngfuncs.pfnFilteredClientCmd = gEngfuncs.pfnClientCmd; + } + else + { + gEngfuncs.pfnFilteredClientCmd = pEnginefuncs->pfnFilteredClientCmd; + } EV_HookEvents(); diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index bfd8112b..c20e6ba0 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -577,7 +577,7 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) case DRC_CMD_FADE: break; case DRC_CMD_STUFFTEXT: - ClientCmd( READ_STRING() ); + gEngfuncs.pfnFilteredClientCmd( READ_STRING() ); break; default: gEngfuncs.Con_DPrintf( "CHudSpectator::DirectorMessage: unknown command %i.\n", cmd ); diff --git a/cl_dll/vgui_TeamFortressViewport.h b/cl_dll/vgui_TeamFortressViewport.h index 39c6b26f..ee295b59 100644 --- a/cl_dll/vgui_TeamFortressViewport.h +++ b/cl_dll/vgui_TeamFortressViewport.h @@ -667,7 +667,7 @@ public: virtual void actionPerformed(Panel *panel) { - gEngfuncs.pfnClientCmd( m_pszCommand ); + gEngfuncs.pfnFilteredClientCmd( m_pszCommand ); if( m_iCloseVGUIMenu ) gViewPort->HideTopMenu(); diff --git a/engine/cdll_int.h b/engine/cdll_int.h index 02d277dd..64620497 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -303,6 +303,9 @@ typedef struct cl_enginefuncs_s int (*pfnGetAppID)( void ); cmdalias_t *(*pfnGetAliases)( void ); void (*pfnVguiWrap2_GetMouseDelta)( int *x, int *y ); + + // added in 2019 update, not documented yet + int (*pfnFilteredClientCmd)( const char *cmd ); } cl_enginefunc_t; #define CLDLL_INTERFACE_VERSION 7 From cf4d2a74dce92c737b8757d0240960d48f9748ec Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Fri, 3 Jun 2022 21:43:06 +0500 Subject: [PATCH 207/298] Change default thirdperson view. --- cl_dll/in_camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index ac68be5e..7a81a15f 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -535,9 +535,9 @@ void CAM_Init( void ) cam_command = gEngfuncs.pfnRegisterVariable( "cam_command", "0", 0 ); // tells camera to go to thirdperson cam_snapto = gEngfuncs.pfnRegisterVariable( "cam_snapto", "0", 0 ); // snap to thirdperson view - cam_idealyaw = gEngfuncs.pfnRegisterVariable( "cam_idealyaw", "90", 0 ); // thirdperson yaw + cam_idealyaw = gEngfuncs.pfnRegisterVariable( "cam_idealyaw", "0", 0 ); // thirdperson yaw cam_idealpitch = gEngfuncs.pfnRegisterVariable( "cam_idealpitch", "0", 0 ); // thirperson pitch - cam_idealdist = gEngfuncs.pfnRegisterVariable( "cam_idealdist", "64", 0 ); // thirdperson distance + cam_idealdist = gEngfuncs.pfnRegisterVariable( "cam_idealdist", "128", 0 ); // thirdperson distance cam_contain = gEngfuncs.pfnRegisterVariable( "cam_contain", "0", 0 ); // contain camera to world c_maxpitch = gEngfuncs.pfnRegisterVariable( "c_maxpitch", "90.0", 0 ); From e2da6954c85e092d80ab182290aeaaa4d162f16f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 4 Jun 2022 20:13:28 +0500 Subject: [PATCH 208/298] Fix crowbar not showing in weapon list if there are empty weapon slots with lower id. Same as https://github.com/SamVanheer/halflife-updated/commit/ffe736252c45ad953ad709572f0c9d42db06dd33 --- cl_dll/ammo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 94952df7..0e3d0a07 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -359,7 +359,7 @@ void CHudAmmo::Think( void ) { WEAPON *p = gWR.GetWeapon( i ); - if( p ) + if( p && p->iId ) { if( gHUD.m_iWeaponBits & ( 1 << p->iId ) ) gWR.PickupWeapon( p ); From 630217f0b111a51cce24a83c7377958588d0a083 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 4 Jun 2022 21:17:26 +0500 Subject: [PATCH 209/298] cmake: fix wrong library naming scheme --- CMakeLists.txt | 2 +- cmake/LibraryNaming.cmake | 6 +++++- dlls/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab3160c1..2c6e0987 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ option(64BIT "Disable auto -m32 appending to compiler flags" OFF) set(GAMEDIR "valve" CACHE STRING "Gamedir path") set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Where put server dll") set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll") -set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for Linux/MacOS/Windows") +set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for PC platforms") #----------------- # MAIN BUILD CODE \ diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 22a70eb3..ca6fb42e 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -65,7 +65,11 @@ endif() if(XASH_AMD64) set(BUILDARCH "amd64") elseif(XASH_X86) - set(BUILDARCH "") + if(XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) + set(BUILDARCH "") # no prefix for default OS + else() + set(BUILDARCH "i386") + endif() elseif(XASH_ARM AND XASH_64BIT) set(BUILDARCH "arm64") elseif(XASH_ARM) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 4f8e60ac..77cd47e6 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -169,7 +169,7 @@ add_library (${SVDLL_LIBRARY} SHARED ${SVDLL_SOURCES}) set_target_properties (${SVDLL_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE 1) -if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(SVDLL_NAME "${SERVER_LIBRARY_NAME}") set_target_properties(${SVDLL_LIBRARY} PROPERTIES From c3f77a2ea5f6890620dc7935cbc8e5b63a5b14c6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 4 Jun 2022 22:23:41 +0500 Subject: [PATCH 210/298] cmake: disable 64BIT flag by default only for 32-bit archs and 64-bit windows and linux --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c6e0987..e07c471c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,17 @@ option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) -option(64BIT "Disable auto -m32 appending to compiler flags" OFF) + +if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR + (WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64" + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")) + option(64BIT "Disable auto -m32 appending to compiler flags" OFF) +else() + option(64BIT "Disable auto -m32 appending to compiler flags" ON) +endif() + set(GAMEDIR "valve" CACHE STRING "Gamedir path") set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Where put server dll") set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll") From 3db3772bff576cc0cb7fd0a380090d3c8794de5c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 4 Jun 2022 22:49:11 +0500 Subject: [PATCH 211/298] cmake: add a missing brackets --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e07c471c..123cd838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,10 +46,10 @@ option(BUILD_SERVER "Build server dll" ON) option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR - (WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" - OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")) + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64"))) option(64BIT "Disable auto -m32 appending to compiler flags" OFF) else() option(64BIT "Disable auto -m32 appending to compiler flags" ON) From 4e13400c615248f6eed3de0fd69f4139ae640df5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 5 Jun 2022 19:35:04 +0300 Subject: [PATCH 212/298] Add 'explosionfix' cvar to control explosions going through walls sometimes. Related issue: https://github.com/ValveSoftware/halflife/issues/3244 (#252) --- dlls/game.cpp | 2 ++ dlls/game.h | 1 + dlls/ggrenade.cpp | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index eb4ae16b..57defc57 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -35,6 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; +cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; @@ -486,6 +487,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &chargerfix ); CVAR_REGISTER( &satchelfix ); + CVAR_REGISTER( &explosionfix ); CVAR_REGISTER( &monsteryawspeedfix ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); diff --git a/dlls/game.h b/dlls/game.h index 3119351a..17c15219 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -30,6 +30,7 @@ extern cvar_t weaponstay; extern cvar_t selfgauss; extern cvar_t chargerfix; extern cvar_t satchelfix; +extern cvar_t explosionfix; extern cvar_t monsteryawspeedfix; extern cvar_t forcerespawn; extern cvar_t flashlight; diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index 60b658b9..5995fe53 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -26,6 +26,7 @@ #include "nodes.h" #include "soundent.h" #include "decals.h" +#include "game.h" //===================grenade @@ -59,7 +60,10 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) // Pull out of the wall a bit if( pTrace->flFraction != 1.0f ) { - pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6f ); + if (explosionfix.value) + pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * 0.6f ); + else + pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6f ); } int iContents = UTIL_PointContents( pev->origin ); From 3dc739547c3413db0383a80f0ac72038a6fa6541 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 6 Jun 2022 18:49:21 +0300 Subject: [PATCH 213/298] Play smoke effect on the correct osprey wing. Related issue: https://github.com/ValveSoftware/halflife/issues/3263 (#253) --- dlls/osprey.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index 670ad3b7..055cddd2 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -756,7 +756,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flRightHealth -= flDamage; - m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0f ); + m_iDoRightSmokePuff = 3 + ( flDamage / 5.0f ); } if( ptr->iHitgroup == 2 ) @@ -765,7 +765,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flLeftHealth -= flDamage; - m_iDoRightSmokePuff = 3 + ( flDamage / 5.0f ); + m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0f ); } // hit hard, hits cockpit, hits engines From 8d844a1764d60cb0f8c668171d9c56bd33a1caba Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 6 Jun 2022 18:49:48 +0300 Subject: [PATCH 214/298] Fix Gauss sound not stopping when players are not in the PAS. https://github.com/ValveSoftware/halflife/issues/3233 (#254) --- dlls/gauss.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 6c4c0a08..fb512757 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -391,7 +391,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) // It's delayed by a fraction of second to make sure it is delayed by 1 frame on the client // It's sent reliably anyway, which could lead to other delays - PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_RELIABLE, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); /*ALERT( at_console, "%f %f %f\n%f %f %f\n", vecSrc.x, vecSrc.y, vecSrc.z, From ab38461c334211c53a78c0edc05b6759402177a4 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 6 Jun 2022 18:51:03 +0300 Subject: [PATCH 215/298] Implement 'corpsephysics' cvar. Issue #190 (#255) --- dlls/combat.cpp | 15 +++++++++++---- dlls/game.cpp | 2 ++ dlls/game.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 1bd5a5bf..512c8996 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -29,6 +29,7 @@ #include "animation.h" #include "weapons.h" #include "func_break.h" +#include "game.h" extern DLL_GLOBAL Vector g_vecAttackDir; extern DLL_GLOBAL int g_iSkillLevel; @@ -514,10 +515,16 @@ void CBaseMonster::BecomeDead( void ) // make the corpse fly away from the attack vector pev->movetype = MOVETYPE_TOSS; - //pev->flags &= ~FL_ONGROUND; - //pev->origin.z += 2.0f; - //pev->velocity = g_vecAttackDir * -1.0f; - //pev->velocity = pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); + if (corpsephysics.value && + // affect only dying monsters, not initially dead ones + m_IdealMonsterState == MONSTERSTATE_DEAD) + { + pev->flags &= ~FL_ONGROUND; + pev->origin.z += 2.0f; + pev->velocity = g_vecAttackDir * -1.0f; + pev->velocity = pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); + } + } BOOL CBaseMonster::ShouldGibMonster( int iGib ) diff --git a/dlls/game.cpp b/dlls/game.cpp index 57defc57..690256c2 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -37,6 +37,7 @@ cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; +cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; @@ -489,6 +490,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &satchelfix ); CVAR_REGISTER( &explosionfix ); CVAR_REGISTER( &monsteryawspeedfix ); + CVAR_REGISTER( &corpsephysics ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &aimcrosshair ); diff --git a/dlls/game.h b/dlls/game.h index 17c15219..54e3281d 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -32,6 +32,7 @@ extern cvar_t chargerfix; extern cvar_t satchelfix; extern cvar_t explosionfix; extern cvar_t monsteryawspeedfix; +extern cvar_t corpsephysics; extern cvar_t forcerespawn; extern cvar_t flashlight; extern cvar_t aimcrosshair; From 1397f3ab4f43da5dc6f472e86d2bbaf44ddb25be Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 16 Jun 2022 10:50:14 +0500 Subject: [PATCH 216/298] cmake: use "lib" prefixe only for Android. --- cl_dll/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 5402372a..0869467d 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -204,7 +204,7 @@ endif() set_target_properties (${CLDLL_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE 1) -if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android") set(CLDLL_NAME "client") set_target_properties(${CLDLL_LIBRARY} PROPERTIES OUTPUT_NAME ${CLDLL_NAME} From d8b05d12d52ba390b1b8dceca784f35a13f42934 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 16 Jun 2022 11:54:55 +0500 Subject: [PATCH 217/298] cmake: better tgmath.h check. --- CMakeLists.txt | 11 +++++++++++ cl_dll/CMakeLists.txt | 6 ------ dlls/CMakeLists.txt | 6 ------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 123cd838..0a8c657c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ endif() # Install custom module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") +include(CheckIncludeFile) +include(CheckCSourceCompiles) include(VSForceXPToolchain) # Force XP toolchain for Visual Studio project (HLSDK-XASH3D) @@ -111,6 +113,15 @@ else() add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H) endif() +check_include_file("tgmath.h" HAVE_TGMATH_H) +if(HAVE_TGMATH_H) + check_c_source_compiles("#include + const float val = 2, val2 = 3; + int main(){ return (int)(-asin(val) + cos(val2));" HAVE_VALID_TGMATH_H ) + if(${HAVE_VALID_TGMATH_H}) + add_definitions(-DHAVE_TGMATH_H) + endif() +endif() if(BUILD_CLIENT) add_subdirectory(cl_dll) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 0869467d..ae4a47cc 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -25,12 +25,6 @@ project (CLDLL) set (CLDLL_LIBRARY client) -include(CheckIncludeFile) -check_include_file("tgmath.h" HAVE_TGMATH_H) -if(HAVE_TGMATH_H) - add_definitions(-DHAVE_TGMATH_H) -endif() - add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL) if(NOT MSVC) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 77cd47e6..ba828008 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -25,12 +25,6 @@ project (SVDLL) set (SVDLL_LIBRARY server) -include(CheckIncludeFile) -check_include_file("tgmath.h" HAVE_TGMATH_H) -if(HAVE_TGMATH_H) - add_definitions(-DHAVE_TGMATH_H) -endif() - add_definitions(-DCLIENT_WEAPONS) if(NOT MSVC) From d8dea3cc2be15fff98d4095d74cfe5d4008ab9e3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 16 Jun 2022 12:04:30 +0500 Subject: [PATCH 218/298] cmake: add missing bracket. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a8c657c..11667593 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ check_include_file("tgmath.h" HAVE_TGMATH_H) if(HAVE_TGMATH_H) check_c_source_compiles("#include const float val = 2, val2 = 3; - int main(){ return (int)(-asin(val) + cos(val2));" HAVE_VALID_TGMATH_H ) + int main(){ return (int)(-asin(val) + cos(val2)); }" HAVE_VALID_TGMATH_H ) if(${HAVE_VALID_TGMATH_H}) add_definitions(-DHAVE_TGMATH_H) endif() From 7431c7a717c778e2e50061ebd9d4f3e7ba8d5b6a Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 16 Jun 2022 12:19:33 +0500 Subject: [PATCH 219/298] cmake: try to link libm. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11667593..d88bf8e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,7 @@ endif() check_include_file("tgmath.h" HAVE_TGMATH_H) if(HAVE_TGMATH_H) + set(CMAKE_REQUIRED_LIBRARIES "m") check_c_source_compiles("#include const float val = 2, val2 = 3; int main(){ return (int)(-asin(val) + cos(val2)); }" HAVE_VALID_TGMATH_H ) From 2363a8ff218c320fe7838dea741e0974b8cb5d14 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 16 Jun 2022 12:30:17 +0500 Subject: [PATCH 220/298] cmake: do not link libm for MSVC. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d88bf8e5..3472f33c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,9 @@ endif() check_include_file("tgmath.h" HAVE_TGMATH_H) if(HAVE_TGMATH_H) - set(CMAKE_REQUIRED_LIBRARIES "m") + if(NOT MSVC) + set(CMAKE_REQUIRED_LIBRARIES "m") + endif() check_c_source_compiles("#include const float val = 2, val2 = 3; int main(){ return (int)(-asin(val) + cos(val2)); }" HAVE_VALID_TGMATH_H ) From 987ea07ce1f73098bed2f4ed271ef565d117b011 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Fri, 17 Jun 2022 03:59:39 +0500 Subject: [PATCH 221/298] cmake: add more options and show more diagnostic messages. --- CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++- cl_dll/CMakeLists.txt | 2 +- dlls/CMakeLists.txt | 2 -- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3472f33c..fe344cdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,15 +57,29 @@ else() option(64BIT "Disable auto -m32 appending to compiler flags" ON) endif() +option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" OFF) +option(CLIENT_WEAPONS "Enable client local weapons prediction" ON) +option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" OFF) +option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF) +option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) +option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) +option(OEM_BUILD "Enable OEM Build" OFF) +option(HLDEMO_BUILD "Enable Demo Build" OFF) + set(GAMEDIR "valve" CACHE STRING "Gamedir path") set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Where put server dll") set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll") set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for PC platforms") +message(STATUS "Half-Life") #----------------- # MAIN BUILD CODE \ ###################\ +if(HLDEMO_BUILD AND OEM_BUILD) + message(FATAL_ERROR "Don't mix Demo and OEM builds!") +endif() + if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT) if(MSVC) error("UNDONE: set 32 build flags") @@ -91,6 +105,46 @@ else() message(STATUS "Building for 32 Bit") endif() +if(CLIENT_WEAPONS) + message(STATUS "Client weapons enabled.") + add_definitions(-DCLIENT_WEAPONS) +endif() + +if(BARNACLE_FIX_VISIBILITY) + message(STATUS "Barnacle tongue fix enabled") + add_definitions(-DBARNACLE_FIX_VISIBILITY) +endif() + +if(CROWBAR_IDLE_ANIM) + message(STATUS "Crowbar idle animation enabled") + add_definitions(-DCROWBAR_IDLE_ANIM) +endif() + +if(CROWBAR_DELAY_FIX) + message(STATUS "Crowbar attack delay fix enabled") + add_definitions(-DCROWBAR_DELAY_FIX) +endif() + +if(CROWBAR_FIX_RAPID_CROWBAR) + message(STATUS "Rapid crowbar fix enabled") + add_definitions(-DCROWBAR_FIX_RAPID_CROWBAR) +endif() + +if(GAUSS_OVERCHARGE_FIX) + message(STATUS "Gauss overcharge fix enabled") + add_definitions(-DGAUSS_OVERCHARGE_FIX) +endif() + +if(OEM_BUILD) + message(STATUS "OEM build enabled") + add_definitions(-DOEM_BUILD) +endif() + +if(HLDEMO_BUILD) + message(STATUS "Demo build enabled") + add_definitions(-DHLDEMO_BUILD) +endif() + if (MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias") @@ -127,13 +181,15 @@ if(HAVE_TGMATH_H) endif() if(BUILD_CLIENT) + message(STATUS "Building client enabled") add_subdirectory(cl_dll) endif() if(BUILD_SERVER) + message(STATUS "Building server enabled") add_subdirectory(dlls) endif() if(NOT BUILD_SERVER AND NOT BUILD_CLIENT) - error("Nothing to build") + message(FATAL_ERROR "Nothing to build") endif() diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index ae4a47cc..6486cc9d 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -25,7 +25,7 @@ project (CLDLL) set (CLDLL_LIBRARY client) -add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL) +add_definitions(-DCLIENT_DLL) if(NOT MSVC) add_compile_options(-fno-exceptions) # GCC/Clang flag diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index ba828008..7e5378e1 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -25,8 +25,6 @@ project (SVDLL) set (SVDLL_LIBRARY server) -add_definitions(-DCLIENT_WEAPONS) - if(NOT MSVC) add_compile_options(-fno-exceptions) # GCC/Clang flag add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag From 748ff6133c2775f81429b8cf202b04c5cdbe8592 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Fri, 17 Jun 2022 11:00:30 +0500 Subject: [PATCH 222/298] cmake: fix broken link. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe344cdc..489b84de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,7 @@ if(64BIT AND CMAKE_SIZEOF_VOID_P EQUAL 4) endif() # Xash3D FWGS Library Naming Scheme compliance -# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/library-naming.md +# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/extensions/library-naming.md include(LibraryNaming) if(CMAKE_SIZEOF_VOID_P EQUAL 8) From ecd846d48e9f78a395113a06dc17baaf393eb8b8 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 18 Jun 2022 06:34:15 +0500 Subject: [PATCH 223/298] Remove submodule vgui-dev. --- .gitmodules | 3 --- vgui-dev | 1 - 2 files changed, 4 deletions(-) delete mode 160000 vgui-dev diff --git a/.gitmodules b/.gitmodules index 25dfc145..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "vgui-dev"] - path = vgui-dev - url = https://github.com/FWGS/vgui-dev diff --git a/vgui-dev b/vgui-dev deleted file mode 160000 index 93573075..00000000 --- a/vgui-dev +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93573075afe885618ea15831e72d44bdacd65bfb From eeeff1aa34dd9260e714dcefcc0590693c40a258 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 18 Jun 2022 06:36:40 +0500 Subject: [PATCH 224/298] Add vgui_support as submodule. --- .gitmodules | 3 +++ vgui_support | 1 + 2 files changed, 4 insertions(+) create mode 160000 vgui_support diff --git a/.gitmodules b/.gitmodules index e69de29b..9510c702 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vgui_support"] + path = vgui_support + url = https://github.com/FWGS/vgui_support diff --git a/vgui_support b/vgui_support new file mode 160000 index 00000000..99108598 --- /dev/null +++ b/vgui_support @@ -0,0 +1 @@ +Subproject commit 991085982209a1b8eefabae04d842004d4f4fe4f From b0b68d5755438b05a4ebce58768e5d96d2bd161c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 18 Jun 2022 06:42:42 +0500 Subject: [PATCH 225/298] cmake: update vgui path. --- cl_dll/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 6486cc9d..4c4474ea 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -156,8 +156,8 @@ include_directories (. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_ if (USE_VGUI) SET(CMAKE_SKIP_RPATH TRUE) - link_directories(${CMAKE_SOURCE_DIR}/vgui-dev/lib) - include_directories(../vgui-dev/include) + link_directories(${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib) + include_directories(../vgui_support/vgui-dev/include) else() include_directories(../utils/false_vgui/include) endif() @@ -178,11 +178,11 @@ endif() if (USE_VGUI) if (WIN32) add_library(vgui SHARED IMPORTED) - set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.dll") - set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui-dev/lib/win32_vc6/vgui.lib") + set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.dll") + set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.lib") target_link_libraries(${CLDLL_LIBRARY} vgui) elseif(APPLE) - target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui-dev/lib vgui.dylib") + target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib vgui.dylib") else() target_link_libraries(${CLDLL_LIBRARY} :vgui.so) endif() From 7276284f8e646f8fca63d7d66c17117bf2d2330c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 18 Jun 2022 06:55:40 +0500 Subject: [PATCH 226/298] github actions: update vgui path. --- .github/workflows/.github.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 796110fa..2795f59e 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -24,7 +24,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: recursive - name: Checkout steam-runtime if: startsWith(matrix.os, 'ubuntu') @@ -64,7 +64,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') run: | schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" - cp vgui-dev/lib/vgui.so build-vgui/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install From b933d1438468ab490915528aa136641a8a6957f2 Mon Sep 17 00:00:00 2001 From: Jesse Buhagiar Date: Sun, 2 Jan 2022 00:10:53 +1100 Subject: [PATCH 227/298] Build: Add SerenityOS to list of compatible systems This is required by the build system to spit out a library with the correct name/platform. --- public/build.h | 4 ++++ scripts/waifulib/library_naming.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/public/build.h b/public/build.h index 3692cf17..5b6bcc36 100644 --- a/public/build.h +++ b/public/build.h @@ -75,6 +75,7 @@ For more information, please refer to #undef XASH_RISCV_DOUBLEFP #undef XASH_RISCV_SINGLEFP #undef XASH_RISCV_SOFTFP +#undef XASH_SERENITY #undef XASH_WIN32 #undef XASH_WIN64 #undef XASH_X86 @@ -126,6 +127,9 @@ For more information, please refer to #elif defined __HAIKU__ #define XASH_HAIKU 1 #define XASH_POSIX 1 +#elif defined __serenity__ + #define XASH_SERENITY 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 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index a3929067..44ade2fd 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -57,6 +57,7 @@ DEFINES = [ 'XASH_RISCV_DOUBLEFP', 'XASH_RISCV_SINGLEFP', 'XASH_RISCV_SOFTFP', +'XASH_SERENITY', 'XASH_WIN32', 'XASH_WIN64', 'XASH_X86', @@ -89,6 +90,8 @@ def configure(conf): buildos = "dos4gw" # unused, just in case elif conf.env.XASH_HAIKU: buildos = "haiku" + elif conf.env.XASH_SERENITY: + buildos = "serenityos" 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") From 4aba145f9ee2760a5473a4401277881fef950a9d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 20 Jun 2022 00:18:38 +0300 Subject: [PATCH 228/298] cmake: add missing definitions for SerenityOS and DOS4GW --- cmake/LibraryNaming.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index ca6fb42e..c97c92f7 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -38,6 +38,7 @@ check_symbol_exists(XASH_RISCV "build.h" XASH_RISCV) check_symbol_exists(XASH_RISCV_DOUBLEFP "build.h" XASH_RISCV_DOUBLEFP) check_symbol_exists(XASH_RISCV_SINGLEFP "build.h" XASH_RISCV_SINGLEFP) check_symbol_exists(XASH_RISCV_SOFTFP "build.h" XASH_RISCV_SOFTFP) +check_symbol_exists(XASH_SERENITY "build.h" XASH_SERENITY) 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) @@ -54,10 +55,14 @@ elseif(XASH_NETBSD) set(BUILDOS "netbsd") elseif(XASH_OPENBSD) set(BUILDOS "openbsd") -elseif(XASH_HAIKU) - set(BUILDOS "haiku") elseif(XASH_EMSCRIPTEN) set(BUILDOS "emscripten") +elseif(XASH_DOS4GW) + set(BUILDOS "DOS4GW") +elseif(XASH_HAIKU) + set(BUILDOS "haiku") +elseif(XASH_SERENITY) + set(BUILDOS "serenityos") else() message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") endif() From 1c42a4170c603281d62d708800fe660f0e3810fe Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 8 Jul 2022 20:17:29 +0300 Subject: [PATCH 229/298] Fix drawing non-latin characters from titles.txt (#261) --- cl_dll/message.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index 29834a13..a07e85d5 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -294,7 +294,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) for( j = 0; j < m_parms.lineLength; j++ ) { - m_parms.text = pLineStart[j]; + m_parms.text = (unsigned char)pLineStart[j]; int next = m_parms.x + gHUD.m_scrinfo.charWidths[m_parms.text]; MessageScanNextChar(); From c01f154873013da409f1c31eeba5cb2e9e185e01 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 8 Jul 2022 20:17:50 +0300 Subject: [PATCH 230/298] Fix tripmine viewmodel having wrong body on first pickup (#262) --- dlls/tripmine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 9da8b90e..7c41b3a6 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -1,4 +1,4 @@ -/*** +/*** * * Copyright (c) 1996-2002, Valve LLC. All rights reserved. * @@ -483,6 +483,8 @@ void CTripmine::PrimaryAttack( void ) void CTripmine::WeaponIdle( void ) { + pev->body = 0; + if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) return; From c8c2841ab9471da8a33fb83c29f133fcadfa692b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 9 Jul 2022 23:35:57 +0300 Subject: [PATCH 231/298] Build with GoldSource input by default on Windows and Linux (#264) --- .github/workflows/.github.yml | 21 ++++++++------------- CMakeLists.txt | 3 ++- appveyor.yml | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 2795f59e..8a9d50a4 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -49,21 +49,16 @@ jobs: ./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf - - name: Build with xash3d-fwgs input + - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build-fwgs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" - schroot --chroot steamrt_scout_i386 -- cmake --build build-fwgs --target all - - name: Build with goldsource input - if: startsWith(matrix.os, 'ubuntu') - run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install - - name: Build with goldsource input and vgui + - name: Build on Linux with vgui if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" + schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install @@ -78,15 +73,15 @@ jobs: - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') uses: microsoft/setup-msbuild@v1.0.2 - - name: Build with msvc + - name: Build on Windows if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - - name: Build with msvc and vgui + - name: Build on Windows with vgui if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name diff --git a/CMakeLists.txt b/CMakeLists.txt index 489b84de..75372379 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,6 @@ option(USE_NOVGUI_SCOREBOARD "Prefer non-VGUI Scoreboard when USE_VGUI is enable option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) -option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -53,8 +52,10 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64"))) option(64BIT "Disable auto -m32 appending to compiler flags" OFF) + option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" ON) else() option(64BIT "Disable auto -m32 appending to compiler flags" ON) + option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) endif() option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" OFF) diff --git a/appveyor.yml b/appveyor.yml index 6616ee57..75269482 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ configuration: before_build: - git submodule update --init --recursive - - cmake -G "%GENERATOR_NAME%" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + - cmake -G "%GENERATOR_NAME%" -B build -DCMAKE_INSTALL_PREFIX="dist" artifacts: - path: dist From 7e8dec0c036ca6c02aad57f2c3516e07a78ae0e4 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 10 Jul 2022 01:39:26 +0300 Subject: [PATCH 232/298] Update README.me with better build instructions (#266) --- README.md | 255 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 174 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 32d4fc05..96b16e40 100644 --- a/README.md +++ b/README.md @@ -1,140 +1,233 @@ -# 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 GoldSource and 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. +Half-Life SDK for GoldSource & Xash3D with some bugfixes. -## How to build +# Obtaining source code -### CMake as most universal way +Either clone the repository via [git](`https://git-scm.com/downloads`) or just download ZIP via **Code** button on github. The first option is more preferable as it also allows you to search through the repo history, switch between branches and clone the vgui submodule. - mkdir build && cd build - cmake ../ - make +To clone the repository with git type in Git Bash (on Windows) or in terminal (on Unix-like operating systems): -Crosscompiling using mingw: +``` +git clone --recursive https://github.com/FWGS/hlsdk-xash3d +``` - mkdir build-mingw && cd build-mingw - TOOLCHAIN_PREFIX=i686-w64-mingw32 # check up the actual mingw prefix of your mingw installation - cmake ../ -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER="$TOOLCHAIN_PREFIX-gcc" -DCMAKE_CXX_COMPILER="$TOOLCHAIN_PREFIX-g++" +# Build Instructions -You may enable or disable some build options by -Dkey=value. All available build options are defined in CMakeLists.txt at root directory. -See below if you want to build the GoldSource compatible libraries. +## Windows. Using Developer Command Propmt for Visual Studio -See below, if CMake is not suitable for you: +### Prerequisites -### Windows +Install and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). The installer allows you to choose specific components. Select `Desktop development with C++`. You can untick everything you don't need in Installation details, but you must keep `MSVC` and `C++ CMake tools for Windows` ticked. -#### Using msvc +### Building -We use compilers provided with Microsoft Visual Studio 6. There're `compile.bat` scripts in both `cl_dll` and `dlls` directories. -Before running any of those files you must define `MSVCDir` variable which is the path to your msvc installation. +Run `Developer command prompt for VS` via Windows `Start` menu. Inside the prompt navigate to the hlsdk directory, using `cd` command, e.g. +``` +cd C:\Users\username\projects\hlsdk-xash3d +``` - set MSVCDir=C:\Program Files\Microsoft Visual Studio - compile.bat +Note: if hlsdk-xash3d is unpacked on another disk, nagivate there first: +``` +D: +cd projects\hlsdk-xash3d +``` -These scripts also can be ran via wine: +Сonfigure the project: +``` +cmake -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" +``` +Once you configure the project you don't need to call `cmake` anymore unless you modify `CMakeLists.txt` files or want to reconfigure the project with different parameters. - MSVCDir="z:\home\$USER\.wine\drive_c\Program Files\Microsoft Visual Studio" wine cmd /c compile.bat +The next step is to compile the libraries: +``` +msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj +``` +`hl.dll` and `client.dll` will appear in the directory configured via **CMAKE_INSTALL_PREFIX** option (**dist** in this example). -The libraries built this way are always GoldSource compatible. +If you have a mod and want to automatically install libraries to the mod directory, set **GAMEDIR** variable to the directory name and **CMAKE_INSTALL_PREFIX** to your Half-Life or Xash3D installation path: +``` +cmake -A Win32 -B build -DGAMEDIR=mod -DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\Steam\steamapps\common\Half-Life" +``` +Then call `msbuild` as described above. -#### Using mingw +#### Choosing Visual Studio version -TODO +You can explicitly choose a Visual Studio version on the configuration step by specifying cmake generator: +``` +cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" +``` -### Unix-like +### Editing code in Visual Studio -To use waf, you need to install python (2.7 minimum) +After the configuration step, `HLSDK-XASH3D.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there. - (./waf configure -T release) - (./waf) +## Windows. Using Microsoft Visual Studio 6 -### Android +Microsoft Visual Studio 6 is very old, but if you still have it installed, you can use it to build this hlsdk. There are no project files, but two `.bat` files, for server and client libraries. They require variable **MSVCDir** to be set to the installation path of Visual Studio: -Just typical `ndk-build`. -TODO: describe what it is. +``` +set MSVCDir=C:\Program Files\Microsoft Visual Studio +cd dlls && compile.bat && cd ../cl_dll && compile.bat +``` -### Building GoldSource-compatible libraries +`hl.dll` and `client.dll` will appear in `dlls/` and `cl_dll/` diretories. The libraries built with msvc6 should be compatible with Windows XP. -To enable building the goldsource compatible client library add GOLDSOURCE_SUPPORT flag when calling cmake: +## Linux. Using Steam Runtime in chroot - cmake .. -DGOLDSOURCE_SUPPORT=ON +### Prerequisites -or when using waf: +The official way to build Steam compatible games for Linux is through steam-runtime. - ./waf configure -T release --enable-goldsrc-support +Install schroot. On Ubuntu or Debian: -Unlike original client by Valve the resulting client library will not depend on vgui or SDL2 just like the one that's used in FWGS Xash3d. +``` +sudo apt install schroot +``` -Note for **Windows**: it's not possible to create GoldSource compatible libraries using mingw, only msvc builds will work. +Clone https://github.com/ValveSoftware/steam-runtime and follow instructions: [download](https://github.com/ValveSoftware/steam-runtime/blob/e014a74f60b45a861d38a867b1c81efe8484f77a/README.md#downloading-a-steam-runtime) and [setup](https://github.com/ValveSoftware/steam-runtime/blob/e014a74f60b45a861d38a867b1c81efe8484f77a/README.md#using-schroot) the chroot. -Note for **Linux**: GoldSource requires libraries (both client and server) to be compiled with libstdc++ bundled with g++ of major version 4 (versions from 4.6 to 4.9 should work). -If your Linux distribution does not provide compatible g++ version you have several options. +``` +sudo ./setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz +``` -#### Method 1: Statically build with c++ library +### Building -This one is the most simple but has a drawback. +Now you can use cmake and make prepending the commands with `schroot --chroot steamrt_scout_i386 --`: +``` +mkdir build-in-steamrt && cd build-in-steamrt +schroot --chroot steamrt_scout_i386 -- cmake .. +schroot --chroot steamrt_scout_i386 -- make +``` - cmake ../ -DGOLDSOURCE_SUPPORT=ON -DCMAKE_C_FLAGS="-static-libstdc++ -static-libgcc" +## Linux. Build without Steam Runtime -The drawback is that the compiled libraries will be larger in size. +### Prerequisites -#### Method 2: Build in Steam Runtime chroot +Install C++ compilers, cmake and x86 development libraries for C, C++ and SDL2. On Ubuntu/Debian: +``` +sudo apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev:i386 +``` -This is the official way to build Steam compatible games for Linux. +### Building -Clone https://github.com/ValveSoftware/steam-runtime and follow instructions https://github.com/ValveSoftware/steam-runtime#building-in-the-runtime +``` +mkdir build && cd build +cmake .. +make +``` - sudo ./setup_chroot.sh --i386 +Note that the libraries built this way might be not compatible with Steam Half-Life. If you have such issue you can configure it to build statically with c++ and gcc libraries: +``` +cmake .. -DCMAKE_C_FLAGS="-static-libstdc++ -static-libgcc" +``` +To ensure portability it's still better to build using Steam Runtime or another chroot of some older distro. -Then use cmake and make as usual, but prepend the commands with `schroot --chroot steamrt_scout_i386 --`: +## Linux. Build in your own chroot - mkdir build-in-steamrt && cd build-in-steamrt - schroot --chroot steamrt_scout_i386 -- cmake ../ -DGOLDSOURCE_SUPPORT=ON - schroot --chroot steamrt_scout_i386 -- make +### Prerequisites -#### Method 3: Create your own chroot with older distro that includes g++ 4. +Use the most suitable way for you to create an old distro 32-bit chroot. E.g. on Ubuntu/Debian you can use debootstrap. -Use the most suitable way for you to create an old distro 32-bit chroot. E.g. on Debian (and similar) you can use debootstrap. +``` +sudo apt install debootstrap schroot +sudo mkdir -p /var/choots +sudo debootstrap --arch=i386 jessie /var/chroots/jessie-i386 # On Ubuntu type trusty instead of jessie +sudo chroot /var/chroots/jessie-i386 +``` - sudo debootstrap --arch=i386 jessie /var/chroot/jessie-debian-i386 # On Ubuntu type trusty instead of jessie - sudo chroot /var/chroot/jessie-debian-i386 +``` +# inside chroot +apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev +exit +``` -Inside chroot install cmake, make, g++ and libsdl2-dev. Then exit the chroot. - -On the host system install schroot. Then create and adapt the following config in /etc/schroot/chroot.d/jessie.conf (you can choose a different name): +Create and adapt the following config in /etc/schroot/chroot.d/jessie.conf (you can choose a different name): ``` [jessie] type=directory description=Debian jessie i386 -directory=/var/chroot/debian-jessie-i386/ +directory=/var/chroots/jessie-i386/ users=yourusername -groups=yourusername +groups=adm root-groups=root preserve-environment=true personality=linux32 ``` -Insert your actual user name in place of `yourusername`. Then prepend any make or cmake call with `schroot -c jessie --`: +Insert your actual user name in place of `yourusername`. - mkdir build-in-chroot && cd build-in-chroot - schroot --chroot jessie -- cmake ../ -DGOLDSOURCE_SUPPORT=ON - schroot --chroot jessie -- make +### Building -#### Method 4: Install the needed g++ version yourself - -TODO: describe steps. - -#### Configuring Qt Creator to use toolchain from chroot - -Create a file with the following contents anywhere: - -```sh -#!/bin/sh -schroot --chroot steamrt_scout_i386 -- cmake "$@" +Prepend any make or cmake call with `schroot -c jessie --`: +``` +mkdir build-in-chroot && cd build-in-chroot +schroot --chroot jessie -- cmake .. +schroot --chroot jessie -- make ``` -Make it executable. -In Qt Creator go to `Tools` -> `Options` -> `Build & Run` -> `CMake`. Add a new cmake tool and specify the path of previously created file. -Go to `Kits` tab, clone your default configuration and choose your CMake tool there. -Choose the new kit when opening CMakeLists.txt. +## Linux. Crosscompiling using mingw + +Note that GoldSource won't work with libraries compiled with mingw. + +TODO: do we need this section at all? Is Xash3D-FWGS distributed with support for game libraries built with mingw? + +### Prerequisites + +Install mingw. On Ubuntu/Debian: +``` +sudo apt-get install -y mingw-w64-i686-dev binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 +``` + +### Building + +``` +mkdir build-mingw && cd build-mingw +TOOLCHAIN_PREFIX=i686-w64-mingw32 # check up the actual mingw prefix of your mingw installation +cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER="$TOOLCHAIN_PREFIX-gcc" -DCMAKE_CXX_COMPILER="$TOOLCHAIN_PREFIX-g++" +``` + +## Android + +TODO + +## Other platforms + +Building on other Unix-like platforms (e.g. FreeBSD) is supported. + +### Prerequisites + +Install C and C++ compilers (like gcc or clang), cmake and make (or gmake) + +### Building + +``` +mkdir build && cd build +cmake .. +make +``` + +### Building with waf + +To use waf, you need to install python (2.7 minimum) + +``` +(./waf configure -T release) +(./waf) +``` + +## Build options + +Some useful build options that can be set during the cmake step. + +* **GOLDSOURCE_SUPPORT** - allows to turn off/on the support for GoldSource input. Set to **ON** by default on Windows and Linux, **OFF** on other platforms. +* **USE_VGUI** - whether to use VGUI library. **OFF** by default. You need to init `vgui_support` submodule in order to build with VGUI. + +This list is incomplete. Look at `CMakeLists.txt` to see all available options. + +Prepend option names with `-D` when passing to cmake. Boolean options can take values **OFF** and **ON**. Example: + +``` +cmake .. -DUSE_VGUI=ON -DGOLDSOURCE_SUPPORT=ON -DCROWBAR_IDLE_ANIM=ON -DCROWBAR_FIX_RAPID_CROWBAR=ON +``` From 33aa1b0a10e9d60159780e69f78825101289ea97 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 10 Jul 2022 18:40:16 +0300 Subject: [PATCH 233/298] engine: add new undocumented function to server funcs --- engine/eiface.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/eiface.h b/engine/eiface.h index f7cdb095..2863319e 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -268,6 +268,9 @@ typedef struct enginefuncs_s void (*pfnQueryClientCvarValue)( const edict_t *player, const char *cvarName ); void (*pfnQueryClientCvarValue2)( const edict_t *player, const char *cvarName, int requestID ); int (*CheckParm)( char *parm, char **ppnext ); + + // added in 8279 + edict_t* (*pfnPEntityOfEntIndexAllEntities)( int iEntIndex ); } enginefuncs_t; // ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 138 From 468780d9979d84ea020589d018e9075839e08e71 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 10 Jul 2022 18:49:03 +0300 Subject: [PATCH 234/298] wscript: sync with cmake, enable goldsrc support by default --- wscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 336e8d34..46017809 100644 --- a/wscript +++ b/wscript @@ -28,8 +28,8 @@ def options(opt): grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False, help = 'enable voice manager [default: %default]') - grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False, - help = 'enable GoldSource engine support [default: %default]') + grp.add_option('--disable-goldsrc-support', action = 'store_false', dest = 'GOLDSRC', default = True, + help = 'disable GoldSource engine support [default: %default]') opt.load('compiler_optimizations subproject') From 5a68ce08bc16c3ad04bd068a501d07b3f540aca7 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 11 Jul 2022 23:36:25 +0300 Subject: [PATCH 235/298] Add TRIPMINE_BEAM_DUPLICATION_FIX macros for fixing beam duplication on level transition (#272) --- CMakeLists.txt | 6 ++++++ dlls/tripmine.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75372379..ab6a1872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" OFF) option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF) option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) +option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF) option(OEM_BUILD "Enable OEM Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF) @@ -136,6 +137,11 @@ if(GAUSS_OVERCHARGE_FIX) add_definitions(-DGAUSS_OVERCHARGE_FIX) endif() +if(TRIPMINE_BEAM_DUPLICATION_FIX) + message(STATUS "Tripmine beam duplication fix enabled") + add_definitions(-DTRIPMINE_BEAM_DUPLICATION_FIX) +endif() + if(OEM_BUILD) message(STATUS "OEM build enabled") add_definitions(-DOEM_BUILD) diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 7c41b3a6..e9e55b67 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -82,7 +82,9 @@ TYPEDESCRIPTION CTripmineGrenade::m_SaveData[] = DEFINE_FIELD( CTripmineGrenade, m_vecEnd, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_flBeamLength, FIELD_FLOAT ), DEFINE_FIELD( CTripmineGrenade, m_hOwner, FIELD_EHANDLE ), +#if !TRIPMINE_BEAM_DUPLICATION_FIX DEFINE_FIELD( CTripmineGrenade, m_pBeam, FIELD_CLASSPTR ), +#endif DEFINE_FIELD( CTripmineGrenade, m_posOwner, FIELD_POSITION_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_angleOwner, FIELD_VECTOR ), DEFINE_FIELD( CTripmineGrenade, m_pRealOwner, FIELD_EDICT ), @@ -256,6 +258,9 @@ void CTripmineGrenade::MakeBeam( void ) Vector vecTmpEnd = pev->origin + m_vecDir * 2048.0f * m_flBeamLength; m_pBeam = CBeam::BeamCreate( g_pModelNameLaser, 10 ); +#if TRIPMINE_BEAM_DUPLICATION_FIX + m_pBeam->pev->spawnflags |= SF_BEAM_TEMPORARY; +#endif m_pBeam->PointEntInit( vecTmpEnd, entindex() ); m_pBeam->SetColor( 0, 214, 198 ); m_pBeam->SetScrollRate( 255 ); From 1313bb1b66d77764569bda423fadc303d9dd494f Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 18 Jul 2022 16:13:44 +0300 Subject: [PATCH 236/298] Update build instructions. Rename cmake project from HLSDK-XASH3D to HLSDK-PORTABLE (#274) --- CMakeLists.txt | 2 +- README.md | 69 ++++++++++++++++++++++++++------------------------ appveyor.yml | 2 +- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab6a1872..7342ec7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ include(CheckIncludeFile) include(CheckCSourceCompiles) include(VSForceXPToolchain) # Force XP toolchain for Visual Studio -project (HLSDK-XASH3D) +project (HLSDK-PORTABLE) #-------------- # USER DEFINES \ diff --git a/README.md b/README.md index 96b16e40..f9335307 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Half-Life SDK for GoldSource and 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 GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/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 GoldSource & Xash3D with some bugfixes. @@ -9,58 +9,65 @@ Either clone the repository via [git](`https://git-scm.com/downloads`) or just d To clone the repository with git type in Git Bash (on Windows) or in terminal (on Unix-like operating systems): ``` -git clone --recursive https://github.com/FWGS/hlsdk-xash3d +git clone --recursive https://github.com/FWGS/hlsdk-portable ``` # Build Instructions -## Windows. Using Developer Command Propmt for Visual Studio +## Windows ### Prerequisites -Install and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). The installer allows you to choose specific components. Select `Desktop development with C++`. You can untick everything you don't need in Installation details, but you must keep `MSVC` and `C++ CMake tools for Windows` ticked. +Install and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). The installer allows you to choose specific components. Select `Desktop development with C++`. You can untick everything you don't need in Installation details, but you must keep `MSVC` ticked. You may also keep `C++ CMake tools for Windows` ticked as you'll need **cmake**. Alternatively you can install **cmake** from the [cmake.org](https://cmake.org/download/) and during installation tick *Add to the PATH...*. + +### Opening command prompt + +If **cmake** was installed with Visual Studio Installer, you'll need to run `Developer command prompt for VS` via Windows `Start` menu. If **cmake** was installed with cmake installer, you can run the regular Windows `cmd`. + +Inside the prompt navigate to the hlsdk directory, using `cd` command, e.g. +``` +cd C:\Users\username\projects\hlsdk-portable +``` + +Note: if hlsdk-portable is unpacked on another disk, nagivate there first: +``` +D: +cd projects\hlsdk-portable +``` ### Building -Run `Developer command prompt for VS` via Windows `Start` menu. Inside the prompt navigate to the hlsdk directory, using `cd` command, e.g. -``` -cd C:\Users\username\projects\hlsdk-xash3d -``` - -Note: if hlsdk-xash3d is unpacked on another disk, nagivate there first: -``` -D: -cd projects\hlsdk-xash3d -``` - Сonfigure the project: ``` -cmake -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" +cmake -A Win32 -B build ``` Once you configure the project you don't need to call `cmake` anymore unless you modify `CMakeLists.txt` files or want to reconfigure the project with different parameters. The next step is to compile the libraries: ``` -msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj +cmake --build build --config Release ``` -`hl.dll` and `client.dll` will appear in the directory configured via **CMAKE_INSTALL_PREFIX** option (**dist** in this example). +`hl.dll` and `client.dll` will appear in the `build/dlls/Release` and `build/cl_dll/Release` directories. If you have a mod and want to automatically install libraries to the mod directory, set **GAMEDIR** variable to the directory name and **CMAKE_INSTALL_PREFIX** to your Half-Life or Xash3D installation path: ``` cmake -A Win32 -B build -DGAMEDIR=mod -DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\Steam\steamapps\common\Half-Life" ``` -Then call `msbuild` as described above. +Then call `cmake` with `--target install` parameter: +``` +cmake --build build --config Release --target install +``` #### Choosing Visual Studio version You can explicitly choose a Visual Studio version on the configuration step by specifying cmake generator: ``` -cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" +cmake -G "Visual Studio 16 2019" -A Win32 -B build ``` ### Editing code in Visual Studio -After the configuration step, `HLSDK-XASH3D.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there. +After the configuration step, `HLSDK-PORTABLE.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there. ## Windows. Using Microsoft Visual Studio 6 @@ -95,9 +102,8 @@ sudo ./setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i38 Now you can use cmake and make prepending the commands with `schroot --chroot steamrt_scout_i386 --`: ``` -mkdir build-in-steamrt && cd build-in-steamrt -schroot --chroot steamrt_scout_i386 -- cmake .. -schroot --chroot steamrt_scout_i386 -- make +schroot --chroot steamrt_scout_i386 -- cmake -B build-in-steamrt -S . +schroot --chroot steamrt_scout_i386 -- cmake --build build-in-steamrt ``` ## Linux. Build without Steam Runtime @@ -112,9 +118,8 @@ sudo apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev:i38 ### Building ``` -mkdir build && cd build -cmake .. -make +cmake -B build -S . +cmake --build build ``` Note that the libraries built this way might be not compatible with Steam Half-Life. If you have such issue you can configure it to build statically with c++ and gcc libraries: @@ -162,9 +167,8 @@ Insert your actual user name in place of `yourusername`. Prepend any make or cmake call with `schroot -c jessie --`: ``` -mkdir build-in-chroot && cd build-in-chroot -schroot --chroot jessie -- cmake .. -schroot --chroot jessie -- make +schroot --chroot jessie -- cmake -B build-in-chroot -S . +schroot --chroot jessie -- cmake --build build-in-chroot ``` ## Linux. Crosscompiling using mingw @@ -203,9 +207,8 @@ Install C and C++ compilers (like gcc or clang), cmake and make (or gmake) ### Building ``` -mkdir build && cd build -cmake .. -make +cmake -B build -S . +cmake --build build ``` ### Building with waf diff --git a/appveyor.yml b/appveyor.yml index 75269482..044bb512 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ environment: # - os: Visual Studio 2017 # GENERATOR_NAME: "Visual Studio 15 2017" -clone_folder: c:\projects\xash\hlsdk-xash3d +clone_folder: c:\projects\xash\hlsdk-portable build: project: build/INSTALL.vcxproj From 763af2905467b6b2df87a393866340821d4074dc Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 18 Jul 2022 16:13:58 +0300 Subject: [PATCH 237/298] Add HANDGRENADE_DEPLOY_FIX macros for fixing the handgrenade deploy animation after finishing a throw (#275) --- CMakeLists.txt | 6 ++++++ dlls/handgrenade.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7342ec7f..7d75ade3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF) option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF) +option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" OFF) option(OEM_BUILD "Enable OEM Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF) @@ -142,6 +143,11 @@ if(TRIPMINE_BEAM_DUPLICATION_FIX) add_definitions(-DTRIPMINE_BEAM_DUPLICATION_FIX) endif() +if(HANDGRENADE_DEPLOY_FIX) + message(STATUS "Handgrenade deploy animation fix enabled") + add_definitions(-DHANDGRENADE_DEPLOY_FIX) +endif() + if(OEM_BUILD) message(STATUS "OEM build enabled") add_definitions(-DOEM_BUILD) diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index 0e9fde30..f9f360ec 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -173,7 +173,9 @@ void CHandGrenade::WeaponIdle( void ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); +#if !HANDGRENADE_DEPLOY_FIX m_flReleaseThrow = 0.0f; +#endif m_flStartThrow = 0.0f; m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; From 12a2aeb3c14cdd52fa954eadd8f4111e296796e3 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 18 Jul 2022 22:31:56 +0300 Subject: [PATCH 238/298] Add WEAPONS_ANIMATION_TIMES_FIX macros for fixing some weapons animation times --- CMakeLists.txt | 6 ++++++ dlls/crowbar.cpp | 4 ++++ dlls/rpg.cpp | 5 ++++- dlls/satchel.cpp | 17 ++++++++++++++--- dlls/squeakgrenade.cpp | 9 ++++++++- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d75ade3..86d0a981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF) option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" OFF) +option(WEAPONS_ANIMATION_TIMES_FIX "Enable animation times fix for some weapons" OFF) option(OEM_BUILD "Enable OEM Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF) @@ -148,6 +149,11 @@ if(HANDGRENADE_DEPLOY_FIX) add_definitions(-DHANDGRENADE_DEPLOY_FIX) endif() +if(WEAPONS_ANIMATION_TIMES_FIX) + message(STATUS "Weapons animation times fix enabled") + add_definitions(-DWEAPONS_ANIMATION_TIMES_FIX) +endif() + if(OEM_BUILD) message(STATUS "OEM build enabled") add_definitions(-DOEM_BUILD) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index f1b2393b..667ebd7e 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -366,7 +366,11 @@ void CCrowbar::WeaponIdle( void ) if( flRand > 0.5f ) { iAnim = CROWBAR_IDLE; +#if WEAPONS_ANIMATION_TIMES_FIX + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 25.0f; +#else m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; +#endif } else { diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index 65f1bd49..c81e6246 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -518,8 +518,11 @@ void CRpg::WeaponIdle( void ) iAnim = RPG_FIDGET_UL; else iAnim = RPG_FIDGET; - +#if WEAPONS_ANIMATION_TIMES_FIX + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.1f; +#else m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; +#endif } SendWeaponAnim( iAnim ); diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 528a3ba8..625a88d1 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -293,14 +293,25 @@ BOOL CSatchel::CanDeploy( void ) BOOL CSatchel::Deploy() { m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; +#if !WEAPONS_ANIMATION_TIMES_FIX m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); +#endif + + BOOL result; if( m_chargeReady ) - return DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" ); + result = DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" ); else - return DefaultDeploy( "models/v_satchel.mdl", "models/p_satchel.mdl", SATCHEL_DRAW, "trip" ); + result = DefaultDeploy( "models/v_satchel.mdl", "models/p_satchel.mdl", SATCHEL_DRAW, "trip" ); - return TRUE; +#if WEAPONS_ANIMATION_TIMES_FIX + if ( result ) + { + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + } +#endif + + return result; } void CSatchel::Holster( int skiplocal /* = 0 */ ) diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index 4bf2e3df..f332a5a8 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -465,7 +465,14 @@ BOOL CSqueak::Deploy() m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME; - return DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" ); + const BOOL result = DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" ); +#if WEAPONS_ANIMATION_TIMES_FIX + if ( result ) + { + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.7f; + } +#endif + return result; } void CSqueak::Holster( int skiplocal /* = 0 */ ) From 058626fc18d76fa1e33685c22a15993b68ef79a3 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 19 Jul 2022 12:29:32 +0300 Subject: [PATCH 239/298] Remove redundant assignment to m_flTimeWeaponIdle in CSatchel::Deploy --- dlls/satchel.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index 625a88d1..38ebec08 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -293,10 +293,6 @@ BOOL CSatchel::CanDeploy( void ) BOOL CSatchel::Deploy() { m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; -#if !WEAPONS_ANIMATION_TIMES_FIX - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); -#endif - BOOL result; if( m_chargeReady ) @@ -310,7 +306,6 @@ BOOL CSatchel::Deploy() m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; } #endif - return result; } From 74f3ec7f61055e00b2f7602a8be849f4ce2aca0e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 19 Jul 2022 12:32:51 +0300 Subject: [PATCH 240/298] Fix crowbar idle animation time regardless of WEAPONS_ANIMATION_TIMES_FIX macro --- dlls/crowbar.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 667ebd7e..5342e7c2 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -366,11 +366,7 @@ void CCrowbar::WeaponIdle( void ) if( flRand > 0.5f ) { iAnim = CROWBAR_IDLE; -#if WEAPONS_ANIMATION_TIMES_FIX m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 25.0f; -#else - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; -#endif } else { From 88e13e8ce1c2ed8bdaed2c56bdac9d71b480a82e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 19 Jul 2022 13:17:59 +0300 Subject: [PATCH 241/298] readme: update appveyor links AppVeyor didn't ack'ed that we changed repository name, so it was done manually. Thanks, @FreeSlave, for pointing me at this --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9335307..c71b303a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Half-Life SDK for GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/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 GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-portable?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-portable) Half-Life SDK for GoldSource & Xash3D with some bugfixes. From e51878c45b618f9b3920b46357545cbb47befeda Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 19 Jul 2022 14:35:27 +0300 Subject: [PATCH 242/298] Fix alien controllers facing in idle state (#282) --- dlls/controller.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/controller.cpp b/dlls/controller.cpp index 20c9a502..bfe3032e 100644 --- a/dlls/controller.cpp +++ b/dlls/controller.cpp @@ -669,8 +669,11 @@ void CController::RunTask( Task_t *pTask ) case TASK_WAIT: case TASK_WAIT_FACE_ENEMY: case TASK_WAIT_PVS: - MakeIdealYaw( m_vecEnemyLKP ); - ChangeYaw( pev->yaw_speed ); + if (m_hEnemy != 0) + { + MakeIdealYaw( m_vecEnemyLKP ); + ChangeYaw( pev->yaw_speed ); + } if( m_fSequenceFinished ) { From bed35fe8d1c9f90c21f751cb8a44526f01783a26 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 19 Jul 2022 14:35:44 +0300 Subject: [PATCH 243/298] Remove mingw build instructions and remove building with mingw from github workflow (#283) --- .github/workflows/.github.yml | 7 ------- README.md | 21 --------------------- 2 files changed, 28 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 8a9d50a4..29c3bdaa 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -63,13 +63,6 @@ jobs: schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install - - name: Build with mingw - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') - run: | - sudo apt-get install -y mingw-w64-i686-dev binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 - cmake -B build-mingw -S . -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ - cmake --build build-mingw --target all - - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') uses: microsoft/setup-msbuild@v1.0.2 diff --git a/README.md b/README.md index c71b303a..06d18e4e 100644 --- a/README.md +++ b/README.md @@ -171,27 +171,6 @@ schroot --chroot jessie -- cmake -B build-in-chroot -S . schroot --chroot jessie -- cmake --build build-in-chroot ``` -## Linux. Crosscompiling using mingw - -Note that GoldSource won't work with libraries compiled with mingw. - -TODO: do we need this section at all? Is Xash3D-FWGS distributed with support for game libraries built with mingw? - -### Prerequisites - -Install mingw. On Ubuntu/Debian: -``` -sudo apt-get install -y mingw-w64-i686-dev binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 -``` - -### Building - -``` -mkdir build-mingw && cd build-mingw -TOOLCHAIN_PREFIX=i686-w64-mingw32 # check up the actual mingw prefix of your mingw installation -cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER="$TOOLCHAIN_PREFIX-gcc" -DCMAKE_CXX_COMPILER="$TOOLCHAIN_PREFIX-g++" -``` - ## Android TODO From 66482655943ac8967b5ca9adce3ed59aa3954ed2 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 19 Jul 2022 15:29:44 +0300 Subject: [PATCH 244/298] compile.bat in release mode. Remove BOM from tripmine.cpp (#284) --- cl_dll/compile.bat | 5 ++--- dlls/compile.bat | 5 ++--- dlls/tripmine.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cl_dll/compile.bat b/cl_dll/compile.bat index 18b45459..7442b89a 100644 --- a/cl_dll/compile.bat +++ b/cl_dll/compile.bat @@ -71,12 +71,11 @@ set SOURCES=../dlls/crossbow.cpp ^ view.cpp ^ scoreboard.cpp ^ MOTD.cpp -set DEFINES=/DCLIENT_DLL /DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR /DGOLDSOURCE_SUPPORT +set DEFINES=/DCLIENT_DLL /DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR /DGOLDSOURCE_SUPPORT /DNDEBUG set LIBS=user32.lib Winmm.lib set OUTNAME=client.dll -set DEBUG=/debug -cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% +cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% /release echo -- Compile done. Cleaning... diff --git a/dlls/compile.bat b/dlls/compile.bat index f97806a5..4eba92c7 100644 --- a/dlls/compile.bat +++ b/dlls/compile.bat @@ -108,12 +108,11 @@ set SOURCES=agrunt.cpp ^ xen.cpp ^ zombie.cpp ^ ../pm_shared/pm_debug.c ../pm_shared/pm_math.c ../pm_shared/pm_shared.c -set DEFINES=/DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR +set DEFINES=/DCLIENT_WEAPONS /Dsnprintf=_snprintf /DNO_VOICEGAMEMGR /DNDEBUG set LIBS=user32.lib set OUTNAME=hl.dll -set DEBUG=/debug -cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% %DEBUG% /def:".\hl.def" +cl %DEFINES% %LIBS% %SOURCES% %INCLUDES% -o %OUTNAME% /link /dll /out:%OUTNAME% /release /def:".\hl.def" echo -- Compile done. Cleaning... diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index e9e55b67..3a46c6a5 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -1,4 +1,4 @@ -/*** +/*** * * Copyright (c) 1996-2002, Valve LLC. All rights reserved. * From 695e2e060bfea4ac9ad96aab91762c0296edaee0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 20 Jul 2022 08:23:52 +0300 Subject: [PATCH 245/298] Rename false_vgui to fake_vgui (#286) --- cl_dll/CMakeLists.txt | 2 +- utils/{false_vgui => fake_vgui}/include/VGUI.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_App.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_Color.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_Cursor.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_Dar.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_KeyCode.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_MouseCode.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_Panel.h | 0 utils/{false_vgui => fake_vgui}/include/VGUI_Scheme.h | 0 10 files changed, 1 insertion(+), 1 deletion(-) rename utils/{false_vgui => fake_vgui}/include/VGUI.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_App.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_Color.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_Cursor.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_Dar.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_KeyCode.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_MouseCode.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_Panel.h (100%) rename utils/{false_vgui => fake_vgui}/include/VGUI_Scheme.h (100%) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 4c4474ea..bd97f73c 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -159,7 +159,7 @@ if (USE_VGUI) link_directories(${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib) include_directories(../vgui_support/vgui-dev/include) else() - include_directories(../utils/false_vgui/include) + include_directories(../utils/fake_vgui/include) endif() if(USE_VOICEMGR) diff --git a/utils/false_vgui/include/VGUI.h b/utils/fake_vgui/include/VGUI.h similarity index 100% rename from utils/false_vgui/include/VGUI.h rename to utils/fake_vgui/include/VGUI.h diff --git a/utils/false_vgui/include/VGUI_App.h b/utils/fake_vgui/include/VGUI_App.h similarity index 100% rename from utils/false_vgui/include/VGUI_App.h rename to utils/fake_vgui/include/VGUI_App.h diff --git a/utils/false_vgui/include/VGUI_Color.h b/utils/fake_vgui/include/VGUI_Color.h similarity index 100% rename from utils/false_vgui/include/VGUI_Color.h rename to utils/fake_vgui/include/VGUI_Color.h diff --git a/utils/false_vgui/include/VGUI_Cursor.h b/utils/fake_vgui/include/VGUI_Cursor.h similarity index 100% rename from utils/false_vgui/include/VGUI_Cursor.h rename to utils/fake_vgui/include/VGUI_Cursor.h diff --git a/utils/false_vgui/include/VGUI_Dar.h b/utils/fake_vgui/include/VGUI_Dar.h similarity index 100% rename from utils/false_vgui/include/VGUI_Dar.h rename to utils/fake_vgui/include/VGUI_Dar.h diff --git a/utils/false_vgui/include/VGUI_KeyCode.h b/utils/fake_vgui/include/VGUI_KeyCode.h similarity index 100% rename from utils/false_vgui/include/VGUI_KeyCode.h rename to utils/fake_vgui/include/VGUI_KeyCode.h diff --git a/utils/false_vgui/include/VGUI_MouseCode.h b/utils/fake_vgui/include/VGUI_MouseCode.h similarity index 100% rename from utils/false_vgui/include/VGUI_MouseCode.h rename to utils/fake_vgui/include/VGUI_MouseCode.h diff --git a/utils/false_vgui/include/VGUI_Panel.h b/utils/fake_vgui/include/VGUI_Panel.h similarity index 100% rename from utils/false_vgui/include/VGUI_Panel.h rename to utils/fake_vgui/include/VGUI_Panel.h diff --git a/utils/false_vgui/include/VGUI_Scheme.h b/utils/fake_vgui/include/VGUI_Scheme.h similarity index 100% rename from utils/false_vgui/include/VGUI_Scheme.h rename to utils/fake_vgui/include/VGUI_Scheme.h From c1f0f25f1be481d99c98b2892085d0bb517b498e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 20 Jul 2022 08:24:03 +0300 Subject: [PATCH 246/298] Rename .github.yml to build.yml (#285) --- .github/workflows/{.github.yml => build.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{.github.yml => build.yml} (100%) diff --git a/.github/workflows/.github.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/.github.yml rename to .github/workflows/build.yml diff --git a/README.md b/README.md index 06d18e4e..310194e7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Half-Life SDK for GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/actions/workflows/.github.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-portable?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-portable) +# Half-Life SDK for GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/actions/workflows/build.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-portable?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-portable) Half-Life SDK for GoldSource & Xash3D with some bugfixes. From 0207817bf40811832afa90b35b9e968dd563683f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:42:45 +0500 Subject: [PATCH 247/298] client: wscript: false_vgui->fake_vgui. --- cl_dll/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 07dabf08..b516fe5f 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -96,7 +96,7 @@ def build(bld): '../pm_shared', '../game_shared', '../public', - '../utils/false_vgui/include' + '../utils/fake_vgui/include' ] defines = ['CLIENT_DLL'] From 4e7d64180bf28988e0d3a4ea2797a629d444a268 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Jul 2022 17:23:09 +0300 Subject: [PATCH 248/298] Fix trace initialization in PM_TraceModel usage. Related issue: https://github.com/ValveSoftware/halflife/issues/3283 (#287) --- pm_shared/pm_shared.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index e16072de..15156910 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -120,6 +120,20 @@ static char grgchTextureType[CTEXTURESMAX]; int g_onladder = 0; +static inline void PM_InitTrace( trace_t *trace, const vec3_t end ) +{ + memset( trace, 0, sizeof( *trace )); + VectorCopy( end, trace->endpos ); + trace->allsolid = true; + trace->fraction = 1.0f; +} + +static void PM_TraceModel( physent_t *pe, float *start, float *end, trace_t *trace ) +{ + PM_InitTrace( trace, end ); + pmove->PM_TraceModel(pe, start, end, trace); +} + void PM_SwapTextures( int i, int j ) { char chTemp; @@ -2108,7 +2122,7 @@ void PM_LadderMove( physent_t *pLadder ) onFloor = false; pmove->gravity = 0; - pmove->PM_TraceModel( pLadder, pmove->origin, ladderCenter, &trace ); + PM_TraceModel(pLadder, pmove->origin, ladderCenter, &trace); if( trace.fraction != 1.0f ) { float forward = 0, right = 0; From 25ba2b4e5f737aff106077fa9a93a5b59e1ce588 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Jul 2022 17:23:22 +0300 Subject: [PATCH 249/298] Fix ServerActivate check for clients (#288) --- dlls/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/client.cpp b/dlls/client.cpp index 82b8e7e7..5c0d8392 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -734,7 +734,7 @@ void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) continue; // Clients aren't necessarily initialized until ClientPutInServer() - if( i < clientMax || !pEdictList[i].pvPrivateData ) + if( (i > 0 && i <= clientMax) || !pEdictList[i].pvPrivateData ) continue; pClass = CBaseEntity::Instance( &pEdictList[i] ); From ed676a5413c2d26b2982e5b014e0731f0eda6a0d Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Jul 2022 17:40:51 +0300 Subject: [PATCH 250/298] Fix deploy animations on fast weapon switching (#289) --- dlls/player.cpp | 17 +++++++++++++++++ dlls/weapons.cpp | 2 +- dlls/weapons.h | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index cce57d02..e4d7f0fb 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3095,7 +3095,15 @@ void CBasePlayer::SelectItem( const char *pstr ) if( m_pActiveItem ) { + CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr()); + if (weapon) + weapon->m_ForceSendAnimations = true; + m_pActiveItem->Deploy(); + + if (weapon) + weapon->m_ForceSendAnimations = false; + m_pActiveItem->UpdateItemInfo(); } } @@ -3121,7 +3129,16 @@ void CBasePlayer::SelectLastItem( void ) CBasePlayerItem *pTemp = m_pActiveItem; m_pActiveItem = m_pLastItem; m_pLastItem = pTemp; + + CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr()); + if (weapon) + weapon->m_ForceSendAnimations = true; + m_pActiveItem->Deploy(); + + if (weapon) + weapon->m_ForceSendAnimations = false; + m_pActiveItem->UpdateItemInfo(); } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 76e5408d..094a4f38 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -820,7 +820,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body ) { if( UseDecrement() ) - skiplocal = 1; + skiplocal = !m_ForceSendAnimations; else skiplocal = 0; diff --git a/dlls/weapons.h b/dlls/weapons.h index c5f0d46a..396f3724 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -351,6 +351,9 @@ public: // hle time creep vars float m_flPrevPrimaryAttack; float m_flLastFireTime; + + //Hack so deploy animations work when weapon prediction is enabled. + bool m_ForceSendAnimations; }; class CBasePlayerAmmo : public CBaseEntity From d3dba792b109c008644620d345d867f847af86bb Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 21 Jul 2022 17:46:05 +0300 Subject: [PATCH 251/298] Fix client event angles (#290) --- cl_dll/com_weapons.cpp | 2 +- cl_dll/com_weapons.h | 1 + cl_dll/view.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 4b9ae338..854f8689 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -137,7 +137,7 @@ void HUD_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short event // Weapon prediction events are assumed to occur at the player's origin org = g_finalstate->playerstate.origin; - ang = v_angles; + ang = v_client_aimangles; gEngfuncs.pfnPlaybackEvent( flags, pInvoker, eventindex, delay, org, ang, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 ); } diff --git a/cl_dll/com_weapons.h b/cl_dll/com_weapons.h index 89fb3cfe..349a848d 100644 --- a/cl_dll/com_weapons.h +++ b/cl_dll/com_weapons.h @@ -39,6 +39,7 @@ extern cvar_t *cl_lw; extern int g_runfuncs; extern vec3_t v_angles; +extern vec3_t v_client_aimangles; extern float g_lastFOV; extern struct local_state_s *g_finalstate; #endif diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index fdbee778..6c9a1582 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -88,6 +88,7 @@ float v_cameraFocusAngle = 35.0f; int v_cameraMode = CAM_MODE_FOCUS; qboolean v_resetCamera = 1; +vec3_t v_client_aimangles; vec3_t g_ev_punchangle; cvar_t *scr_ofsx; @@ -724,6 +725,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // Store off v_angles before munging for third person v_angles = pparams->viewangles; + v_client_aimangles = pparams->cl_viewangles; v_lastAngles = pparams->viewangles; //v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles ! if( CL_IsThirdPerson() ) From 3b0046cb3dcd7df36c30afd578431fea14aabe00 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 22 Jul 2022 04:12:08 +0300 Subject: [PATCH 252/298] Fix func_button's sparks origin when func_button has origin brush (#291) --- dlls/buttons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 7ca7c2fd..9c7d5d39 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -639,7 +639,7 @@ void CBaseButton::ButtonSpark( void ) SetThink( &CBaseButton::ButtonSpark ); pev->nextthink = pev->ltime + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval - DoSpark( pev, pev->mins ); + DoSpark( pev, pev->absmin ); } // From b69d37e30e0d6a16f07f5beff8aad5606f86b17a Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 22 Jul 2022 15:56:02 +0300 Subject: [PATCH 253/298] Fix scientist's voice pitch selection (#292) --- dlls/scientist.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index e04fabea..15acf989 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -639,6 +639,13 @@ void CScientist::HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= void CScientist::Spawn( void ) { + // We need to set it before precache so the right voice will be chosen + if( pev->body == -1 ) + { + // -1 chooses a random head + pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head + } + Precache(); SET_MODEL( ENT( pev ), "models/scientist.mdl" ); @@ -659,12 +666,6 @@ void CScientist::Spawn( void ) // White hands pev->skin = 0; - if( pev->body == -1 ) - { - // -1 chooses a random head - pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head - } - // Luther is black, make his hands black if( pev->body == HEAD_LUTHER ) pev->skin = 1; @@ -722,7 +723,7 @@ void CScientist::TalkInit() m_szGrp[TLK_MORTAL] = "SC_MORTAL"; // get voice for head - switch( pev->body % 3 ) + switch( pev->body % NUM_SCIENTIST_HEADS ) { default: case HEAD_GLASSES: From 4678d493929c59239c97e10182a443d97581e916 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 27 Jul 2022 08:23:58 +0300 Subject: [PATCH 254/298] Add manual workflow (#296) * Add manual workflow * Quote OFF and ON for YAML --- .github/workflows/manual.yml | 113 +++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 00000000..19cf0201 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,113 @@ +name: manual build + +on: + workflow_dispatch: + inputs: + buildtype: + type: choice + description: Build Type + options: + - Release + - Debug + usevgui: + type: choice + description: Use VGUI + options: + - 'OFF' + - 'ON' +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + cc: gcc + cxx: g++ + - os: windows-2019 + cc: cl + cxx: cl + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Checkout steam-runtime + if: startsWith(matrix.os, 'ubuntu') + uses: actions/checkout@v2 + with: + repository: ValveSoftware/steam-runtime + path: steam-runtime + - name: Cache steam-runtime + if: startsWith(matrix.os, 'ubuntu') + id: cache-steam-runtime + uses: actions/cache@v2 + with: + path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + key: ${{ runner.os }}-steam-runtime + - name: Download steam-runtime + if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true' + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + - name: Install steam runtime + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt update + ./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz + sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf + + - name: Copy vgui.so + if: ${{ startsWith(matrix.os, 'ubuntu') && github.event.inputs.usevgui == 'ON' }} + run: | + mkdir -p build/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll + - name: Build on Linux + if: startsWith(matrix.os, 'ubuntu') + run: | + schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }} + schroot --chroot steamrt_scout_i386 -- cmake --build build --target all + schroot --chroot steamrt_scout_i386 -- cmake --build build --target install + + - name: Add msbuild to PATH + if: startsWith(matrix.os, 'windows') + uses: microsoft/setup-msbuild@v1.0.2 + - name: Build on Windows + if: startsWith(matrix.os, 'windows') + run: | + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }} + msbuild -verbosity:normal /property:Configuration=${{ github.event.inputs.buildtype }} build/INSTALL.vcxproj + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" + id: extract_branch + - name: Extract gamedir + shell: bash + run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" + id: extract_gamedir + - name: Copy pdbs to dist dir + if: ${{ startsWith(matrix.os, 'windows') && github.event.inputs.buildtype == 'Debug' }} + run: | + copy build/cl_dll/Debug/client.pdb dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/ + copy build/dlls/Debug/hl.pdb dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/ + - name: Delete .lib files from dist + if: startsWith(matrix.os, 'windows') + run: | + Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib + Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib + - name: Upload linux artifact + if: startsWith(matrix.os, 'ubuntu') + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux + path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + - name: Upload windows artifact + if: startsWith(matrix.os, 'windows') + uses: actions/upload-artifact@v2 + with: + name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows + path: dist/${{ steps.extract_gamedir.outputs.gamedir }} + From 5d64c9ceb428265a33bc18df3c4dce3c0206b160 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 27 Jul 2022 08:24:10 +0300 Subject: [PATCH 255/298] Fix building with msvc 6 (#295) --- cl_dll/compile.bat | 2 +- pm_shared/pm_shared.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cl_dll/compile.bat b/cl_dll/compile.bat index 7442b89a..cc4ed5ac 100644 --- a/cl_dll/compile.bat +++ b/cl_dll/compile.bat @@ -7,7 +7,7 @@ set PATH=%MSVCDir%\VC98\Bin;%MSVCDir%\Common\MSDev98\Bin\;%PATH% echo -- Compiler is MSVC6 set XASH3DSRC=..\..\Xash3D_original -set INCLUDES=-I../common -I../engine -I../pm_shared -I../game_shared -I../public -I../external -I../dlls -I../utils/false_vgui/include +set INCLUDES=-I../common -I../engine -I../pm_shared -I../game_shared -I../public -I../external -I../dlls -I../utils/fake_vgui/include set SOURCES=../dlls/crossbow.cpp ^ ../dlls/crowbar.cpp ^ ../dlls/egon.cpp ^ diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 15156910..d5ad05d5 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -120,7 +120,7 @@ static char grgchTextureType[CTEXTURESMAX]; int g_onladder = 0; -static inline void PM_InitTrace( trace_t *trace, const vec3_t end ) +static void PM_InitTrace( trace_t *trace, const vec3_t end ) { memset( trace, 0, sizeof( *trace )); VectorCopy( end, trace->endpos ); From 8d91e9b4c09f4cb79b3043c4289a30a23e00e71e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 27 Jul 2022 08:24:22 +0300 Subject: [PATCH 256/298] Use MAX_WEAPONS constant instead of magic numbers (#294) --- cl_dll/entity.cpp | 2 +- cl_dll/hl/hl_weapons.cpp | 8 ++++---- dlls/client.cpp | 7 ++----- dlls/weapons.h | 2 -- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index ba524f6a..36705466 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -222,7 +222,7 @@ void DLLEXPORT HUD_TxferPredictionData( struct entity_state_s *ps, const struct VectorCopy( ppcd->vuser3, pcd->vuser3 ); VectorCopy( ppcd->vuser4, pcd->vuser4 ); - memcpy( wd, pwd, 32 * sizeof(weapon_data_t) ); + memcpy( wd, pwd, MAX_WEAPONS * sizeof(weapon_data_t) ); } /* diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index b982fa7f..f8473eaa 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -36,7 +36,7 @@ extern globalvars_t *gpGlobals; extern int g_iUser1; // Pool of client side entities/entvars_t -static entvars_t ev[32]; +static entvars_t ev[MAX_WEAPONS]; static int num_ents = 0; // The entity we'll use to represent the local client @@ -45,7 +45,7 @@ static CBasePlayer player; // Local version of game .dll global variables ( time, etc. ) static globalvars_t Globals; -static CBasePlayerWeapon *g_pWpns[32]; +static CBasePlayerWeapon *g_pWpns[MAX_WEAPONS]; float g_flApplyVel = 0.0; int g_irunninggausspred = 0; @@ -752,7 +752,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm if( !pWeapon ) return; - for( i = 0; i < 32; i++ ) + for( i = 0; i < MAX_WEAPONS; i++ ) { pCurrent = g_pWpns[i]; if( !pCurrent ) @@ -921,7 +921,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm HUD_SendWeaponAnim( to->client.weaponanim, body, 1 ); } - for( i = 0; i < 32; i++ ) + for( i = 0; i < MAX_WEAPONS; i++ ) { pCurrent = g_pWpns[i]; diff --git a/dlls/client.cpp b/dlls/client.cpp index 5c0d8392..2ca1de59 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -1627,6 +1627,7 @@ void RegisterEncoders( void ) int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) { + memset( info, 0, MAX_WEAPONS * sizeof(weapon_data_t) ); #if CLIENT_WEAPONS int i; weapon_data_t *item; @@ -1634,8 +1635,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) CBasePlayer *pl = (CBasePlayer *)CBasePlayer::Instance( pev ); CBasePlayerWeapon *gun; - memset( info, 0, 32 * sizeof(weapon_data_t) ); - if( !pl ) return 1; @@ -1656,7 +1655,7 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) // Get The ID. gun->GetItemInfo( &II ); - if( II.iId >= 0 && II.iId < 32 ) + if( II.iId >= 0 && II.iId < MAX_WEAPONS ) { item = &info[II.iId]; @@ -1682,8 +1681,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) } } } -#else - memset( info, 0, 32 * sizeof(weapon_data_t) ); #endif return 1; } diff --git a/dlls/weapons.h b/dlls/weapons.h index 396f3724..2963afa6 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -83,8 +83,6 @@ public: #define WEAPON_SUIT 31 // ????? -#define MAX_WEAPONS 32 - #define MAX_NORMAL_BATTERY 100 // weapon weight factors (for auto-switching) (-1 = noswitch) From 70516c988fa73199d7124789bf4e448e2b92ac13 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 1 Aug 2022 14:43:42 +0300 Subject: [PATCH 257/298] scripts: upgrade to Android NDK 25 --- scripts/waifulib/xcompile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 0abf53f1..b9ce398f 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -20,12 +20,12 @@ import os import sys ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK'] -ANDROID_NDK_SUPPORTED = [10, 19, 20, 23] +ANDROID_NDK_SUPPORTED = [10, 19, 20, 23, 25] ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag -ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16 } # minimal API level ndk revision supports +ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16, 25: 19 } # minimal API level ndk revision supports ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21 ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets From abf08e4520e3b6cd12a40f269f4a256cf8496227 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 5 Aug 2022 16:21:43 +0300 Subject: [PATCH 258/298] Fix client tripmine body and weapon bodies passed to EV_WeaponAnimation (#298) --- cl_dll/ev_hldm.cpp | 32 ++++++++++++++++---------------- cl_dll/hl/hl_weapons.cpp | 6 +----- dlls/tripmine.cpp | 5 +++++ 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 6eee0328..c0b8b475 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -486,7 +486,7 @@ static void EV_FireGlock_Impl( event_args_t *args ) if( EV_IsLocal( idx ) ) { EV_MuzzleFlash(); - gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 0 ); V_PunchAxis( 0, -2.0 ); } @@ -549,7 +549,7 @@ void EV_FireShotGunDouble( event_args_t *args ) { // Add muzzle flash to current weapon model EV_MuzzleFlash(); - gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 0 ); V_PunchAxis( 0, -10.0 ); } @@ -603,7 +603,7 @@ void EV_FireShotGunSingle( event_args_t *args ) { // Add muzzle flash to current weapon model EV_MuzzleFlash(); - gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 0 ); V_PunchAxis( 0, -5.0 ); } @@ -660,7 +660,7 @@ void EV_FireMP5( event_args_t *args ) { // Add muzzle flash to current weapon model EV_MuzzleFlash(); - gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 0 ); V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -2, 2 ) ); } @@ -697,7 +697,7 @@ void EV_FireMP52( event_args_t *args ) if( EV_IsLocal( idx ) ) { - gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 0 ); V_PunchAxis( 0, -10 ); } @@ -862,7 +862,7 @@ void EV_FireGauss( event_args_t *args ) if( EV_IsLocal( idx ) ) { V_PunchAxis( 0.0f, -2.0f ); - gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 0 ); if( m_fPrimaryFire == false ) g_flApplyVel = flDamage; @@ -1129,13 +1129,13 @@ void EV_Crowbar( event_args_t *args ) switch( (g_iSwing++) % 3 ) { case 0: - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 0 ); break; case 1: - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 0 ); break; case 2: - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 0 ); break; } } @@ -1203,9 +1203,9 @@ void EV_FireCrossbow2( event_args_t *args ) if( EV_IsLocal( idx ) ) { if( args->iparam1 ) - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 ); else - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 ); } // Store off the old count @@ -1279,9 +1279,9 @@ void EV_FireCrossbow( event_args_t *args ) if( EV_IsLocal( idx ) ) { if( args->iparam1 ) - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 ); else - gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 ); V_PunchAxis( 0.0f, -2.0f ); } @@ -1321,7 +1321,7 @@ void EV_FireRpg( event_args_t *args ) //Only play the weapon anims if I shot it. if( EV_IsLocal( idx ) ) { - gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 0 ); V_PunchAxis( 0, -5.0 ); } @@ -1422,7 +1422,7 @@ void EV_EgonFire( event_args_t *args ) //Only play the weapon anims if I shot it. if( EV_IsLocal( idx ) ) - gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 0 ); if( iStartup == 1 && EV_IsLocal( idx ) && !( pBeam || pBeam2 || pFlare ) && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction. { @@ -1564,7 +1564,7 @@ void EV_HornetGunFire( event_args_t *args ) if( EV_IsLocal( idx ) ) { V_PunchAxis( 0, gEngfuncs.pfnRandomLong( 0, 2 ) ); - gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 1 ); + gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 0 ); } switch( gEngfuncs.pfnRandomLong( 0, 2 ) ) diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index f8473eaa..4f119f02 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -907,11 +907,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm // over the wire ( fixes some animation glitches ) if( g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) ) { - int body = 2; - - //Pop the model to body 0. - if( pWeapon == &g_Tripmine ) - body = 0; + int body = 0; //Show laser sight/scope combo if( pWeapon == &g_Python && bIsMultiplayer() ) diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 3a46c6a5..7df4b93d 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -364,7 +364,12 @@ void CTripmine::Spawn() m_iId = WEAPON_TRIPMINE; SET_MODEL( ENT( pev ), "models/v_tripmine.mdl" ); pev->frame = 0; + +#ifdef CLIENT_DLL + pev->body = 0; +#else pev->body = 3; +#endif pev->sequence = TRIPMINE_GROUND; // ResetSequenceInfo(); pev->framerate = 0; From 4053dca7a9cf999391cbd77224144da207e4540b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 5 Aug 2022 16:22:03 +0300 Subject: [PATCH 259/298] Fix deploy animations sometimes not playing on weapon pickup (#299) --- dlls/player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/player.cpp b/dlls/player.cpp index e4d7f0fb..234cfb31 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -4609,8 +4609,16 @@ BOOL CBasePlayer::SwitchWeapon( CBasePlayerItem *pWeapon ) } m_pActiveItem = pWeapon; + + CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(pWeapon->GetWeaponPtr()); + if (weapon) + weapon->m_ForceSendAnimations = true; + pWeapon->Deploy(); + if (weapon) + weapon->m_ForceSendAnimations = false; + return TRUE; } From ae4d65439c0a87308164027fbced1cb249768e85 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 5 Aug 2022 16:22:36 +0300 Subject: [PATCH 260/298] Don't play tripmine draw animation after placing the last tripmine (#300) --- cl_dll/ev_hldm.cpp | 3 ++- dlls/tripmine.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index c0b8b475..a3160cb9 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -1609,6 +1609,7 @@ void EV_TripmineFire( event_args_t *args ) pmtrace_t tr; idx = args->entindex; + const bool last = args->bparam1 != 0; VectorCopy( args->origin, vecSrc ); VectorCopy( args->angles, angles ); @@ -1631,7 +1632,7 @@ void EV_TripmineFire( event_args_t *args ) gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr ); //Hit something solid - if( tr.fraction < 1.0f ) + if( tr.fraction < 1.0f && !last ) gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 ); gEngfuncs.pEventAPI->EV_PopPMStates(); diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 7df4b93d..859e3548 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -454,7 +454,7 @@ void CTripmine::PrimaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] == 1, 0 ); if( tr.flFraction < 1.0f ) { From d9d46bcc2b12da2ebf7bf26eef482c60215bab03 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 6 Aug 2022 17:39:55 +0300 Subject: [PATCH 261/298] Include changelog in README.md [ci skip] (#302) --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 310194e7..c07deea0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,52 @@ Half-Life SDK for GoldSource & Xash3D with some bugfixes. +

Changelog +

+ +- Fixed an occasional bug when houndeyes stuck unable to do anything. Technical detail: now monster's `Activity` is set before the call to `SetYawSpeed`. [Patch](https://github.com/FWGS/hlsdk-portable/commit/467899b99aa225a95d90222137f18c141c929c86) +- Monsters now play idle sounds as it's supposed by the code. Technical detail: the problem was a check for a wrong variable. [Patch](https://github.com/FWGS/hlsdk-portable/commit/9fc712da019a1ca646171e912209a993e7c43976) +- Fixed a bug that caused talk monsters (scientists and security guards) to face a wrong direction during scripted sequence sometimes. [Patch](https://github.com/FWGS/hlsdk-portable/commit/3e2808de62e479e83068c075cb88b4f177f9acc7) +- Fixed squad member removal. This bug affected houndeye attacks as their attack depends on percieved number of squad members. [Patch](https://github.com/FWGS/hlsdk-portable/commit/b4502f71336a08f3f2c72b7b061b2838a149a11b) +- Scientists now react to smells. [Patch](https://github.com/FWGS/hlsdk-portable/commit/2de4e7ab003d5b1674d12525f5aefb1e57a49fa3) +- Tau-cannon (gauss) plays idle animations. +- Tau-cannon (gauss) beam color depends on the charge as it was before the prediction code was introduced in Half-Life. [Patch](https://github.com/FWGS/hlsdk-portable/commit/0a29ec49c8183ebb8da22a6d2ef395eae9c3dffe) +- Brought back gluon flare in singleplayer. +- Hand grenades don't stay primed after holster, preventing detonation after weapon switch. [Patch](https://github.com/FWGS/hlsdk-portable/commit/6e1059026faa90c5bfe5e3b3f4f58fde398d4524) +- Fixed flashlight battery appearing as depleted on restore. +- Fixed a potential overflow when reading sentences.txt. [Patch](https://github.com/FWGS/hlsdk-xash3d/commit/cb51d2aa179f1eb622e08c1c07b053ccd49e40a5) +- Fixed beam attachment invalidated on restore (that led to visual bugs). [Patch](https://github.com/FWGS/hlsdk-xash3d/commit/74b5543c83c5cdcb88e9254bacab08bc63c4c896) +- Fixed alien controllers facing wrong direction in non-combat state. [Patch](https://github.com/FWGS/hlsdk-portable/commit/e51878c45b618f9b3920b46357545cbb47befeda) +- Fixed weapon deploy animations not playing sometimes on fast switching between weapons. [Patch](https://github.com/FWGS/hlsdk-portable/commit/ed676a5413c2d26b2982e5b014e0731f0eda6a0d) [Patch2](https://github.com/FWGS/hlsdk-portable/commit/4053dca7a9cf999391cbd77224144da207e4540b) +- Fixed tripmine sometimes having wrong body on pickup [Patch](https://github.com/FWGS/hlsdk-portable/commit/abf08e4520e3b6cd12a40f269f4a256cf8496227) + +Bugfix-related macros that can be enabled during the compilation: + +- **CROWBAR_DELAY_FIX** fixes a bug when crowbar has a longer delay after the first hit. +- **CROWBAR_FIX_RAPID_CROWBAR** fixes a "rapid crowbar" bug when hitting corpses of killed monsters. +- **GAUSS_OVERCHARGE_FIX** fixes tau-cannon (gauss) charge sound not stopping after the overcharge. +- **CROWBAR_IDLE_ANIM** makes crowbar play idle animations. +- **TRIPMINE_BEAM_DUPLICATION_FIX** fixes tripmine's beam duplication on level transition. +- **HANDGRENADE_DEPLOY_FIX** makes handgrenade play draw animation after finishing a throw. +- **WEAPONS_ANIMATION_TIMES_FIX** fixes deploy and idle animation times of some weapons. + +Bugfix-related server cvars: + +- **satchelfix**: if set to 1, doors won't get blocked by satchels. Fixes an infamous exploit on `crossfire` map. +- **explosionfix**: if set to 1, explosion damage won't propagate through thin bruses. +- **selfgauss**: if set to 0, players won't hurt themselves with secondary attack when shooting thick brushes. + +*Note*: the macros and cvars were adjusted in [hlfixed](https://github.com/FWGS/hlsdk-portable/tree/hlfixed) branch. The bugfix macros are kept turned off in master branch to maintain the compatibility with vanilla servers and clients. + +Other server cvars: + +- **mp_bhopcap**: if set to 1, enable bunny-hop. +- **chargerfix**: if set to 1, wall-mounted health and battery chargers will play reject sounds if player has the full health or armor. +- **corpsephysics**: if set to 1, corpses of killed monsters will fly a bit from an impact. It's a cut feature from Half-Life. + +

+
+ # Obtaining source code Either clone the repository via [git](`https://git-scm.com/downloads`) or just download ZIP via **Code** button on github. The first option is more preferable as it also allows you to search through the repo history, switch between branches and clone the vgui submodule. From e12d1aa743ccc7557302358fc7a57f1675044495 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 6 Aug 2022 17:40:26 +0300 Subject: [PATCH 262/298] Replace usage of m_ForceSendAnimations with entvars to avoid changing the class data layout (#306) --- dlls/player.cpp | 28 ++++++---------------------- dlls/weapons.cpp | 2 +- dlls/weapons.h | 3 --- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index 234cfb31..f011b550 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3095,15 +3095,9 @@ void CBasePlayer::SelectItem( const char *pstr ) if( m_pActiveItem ) { - CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr()); - if (weapon) - weapon->m_ForceSendAnimations = true; - + m_pActiveItem->pev->oldbuttons = 1; m_pActiveItem->Deploy(); - - if (weapon) - weapon->m_ForceSendAnimations = false; - + m_pActiveItem->pev->oldbuttons = 0; m_pActiveItem->UpdateItemInfo(); } } @@ -3130,14 +3124,9 @@ void CBasePlayer::SelectLastItem( void ) m_pActiveItem = m_pLastItem; m_pLastItem = pTemp; - CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr()); - if (weapon) - weapon->m_ForceSendAnimations = true; - + m_pActiveItem->pev->oldbuttons = 1; m_pActiveItem->Deploy(); - - if (weapon) - weapon->m_ForceSendAnimations = false; + m_pActiveItem->pev->oldbuttons = 0; m_pActiveItem->UpdateItemInfo(); } @@ -4610,14 +4599,9 @@ BOOL CBasePlayer::SwitchWeapon( CBasePlayerItem *pWeapon ) m_pActiveItem = pWeapon; - CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(pWeapon->GetWeaponPtr()); - if (weapon) - weapon->m_ForceSendAnimations = true; - + pWeapon->pev->oldbuttons = 1; pWeapon->Deploy(); - - if (weapon) - weapon->m_ForceSendAnimations = false; + pWeapon->pev->oldbuttons = 0; return TRUE; } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 094a4f38..0443d271 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -820,7 +820,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer ) void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body ) { if( UseDecrement() ) - skiplocal = !m_ForceSendAnimations; + skiplocal = !pev->oldbuttons; else skiplocal = 0; diff --git a/dlls/weapons.h b/dlls/weapons.h index 2963afa6..889e0c5a 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -349,9 +349,6 @@ public: // hle time creep vars float m_flPrevPrimaryAttack; float m_flLastFireTime; - - //Hack so deploy animations work when weapon prediction is enabled. - bool m_ForceSendAnimations; }; class CBasePlayerAmmo : public CBaseEntity From 8f5c36dc62b463044cffa3ddf40347905ea39f08 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 8 Aug 2022 23:36:39 +0300 Subject: [PATCH 263/298] client: fix GoldSrc input being enabled for Android on x86 --- cl_dll/input_mouse.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cl_dll/input_mouse.h b/cl_dll/input_mouse.h index 0ecd8147..814e239f 100644 --- a/cl_dll/input_mouse.h +++ b/cl_dll/input_mouse.h @@ -1,4 +1,7 @@ #pragma once + +#include "build.h" + #if !defined(INPUT_MOUSE_H) #define INPUT_MOUSE_H #include "cl_dll.h" @@ -45,7 +48,7 @@ protected: }; // No need for goldsource input support on the platforms that are not supported by GoldSource. -#if GOLDSOURCE_SUPPORT && (_WIN32 || __linux__ || __APPLE__) && (__i386 || _M_IX86) +#if GOLDSOURCE_SUPPORT && ( XASH_WIN32 || ( XASH_LINUX && !XASH_ANDROID ) || XASH_APPLE ) && XASH_X86 #define SUPPORT_GOLDSOURCE_INPUT 1 #if _WIN32 From 939237df7156f903d2a84f37e5d9c2bde24d045e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 28 Aug 2022 14:28:29 +0300 Subject: [PATCH 264/298] Update README.md. Add a note about mods [ci skip] (#321) --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c07deea0..3f7e36a6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Half-Life SDK for GoldSource & Xash3D with some bugfixes. - Scientists now react to smells. [Patch](https://github.com/FWGS/hlsdk-portable/commit/2de4e7ab003d5b1674d12525f5aefb1e57a49fa3) - Tau-cannon (gauss) plays idle animations. - Tau-cannon (gauss) beam color depends on the charge as it was before the prediction code was introduced in Half-Life. [Patch](https://github.com/FWGS/hlsdk-portable/commit/0a29ec49c8183ebb8da22a6d2ef395eae9c3dffe) -- Brought back gluon flare in singleplayer. +- Brought back gluon flare in singleplayer. [Patch](https://github.com/FWGS/hlsdk-portable/commit/9d7ab6acf46a8b71ef119d9c252767865522d21d) - Hand grenades don't stay primed after holster, preventing detonation after weapon switch. [Patch](https://github.com/FWGS/hlsdk-portable/commit/6e1059026faa90c5bfe5e3b3f4f58fde398d4524) - Fixed flashlight battery appearing as depleted on restore. - Fixed a potential overflow when reading sentences.txt. [Patch](https://github.com/FWGS/hlsdk-xash3d/commit/cb51d2aa179f1eb622e08c1c07b053ccd49e40a5) @@ -37,7 +37,7 @@ Bugfix-related server cvars: - **explosionfix**: if set to 1, explosion damage won't propagate through thin bruses. - **selfgauss**: if set to 0, players won't hurt themselves with secondary attack when shooting thick brushes. -*Note*: the macros and cvars were adjusted in [hlfixed](https://github.com/FWGS/hlsdk-portable/tree/hlfixed) branch. The bugfix macros are kept turned off in master branch to maintain the compatibility with vanilla servers and clients. +*Note*: the macros and cvars were adjusted in [hlfixed](https://github.com/FWGS/hlsdk-portable/tree/hlfixed) branch (for further information read [this](https://github.com/FWGS/hlsdk-portable/wiki/HL-Fixed)). The bugfix macros are kept turned off in `master` branch to maintain the compatibility with vanilla servers and clients. Other server cvars: @@ -48,6 +48,22 @@ Other server cvars:

+
Support for mods +

+ +This repository contains (re-)implementations of some mods as separate branches derived from `master`. The list of supported mods can be found [here](https://github.com/FWGS/hlsdk-portable/wiki/Mods). Note that some branches are unstable and incomplete. + +To get the mod branch locally run the following git command: + +``` +git fetch origin asheep:asheep +``` + +This is considering that you have set **FWGS/hlsdk-portable** as an `origin` remote and want to fetch `asheep` branch. + +

+
+ # Obtaining source code Either clone the repository via [git](`https://git-scm.com/downloads`) or just download ZIP via **Code** button on github. The first option is more preferable as it also allows you to search through the repo history, switch between branches and clone the vgui submodule. @@ -87,7 +103,7 @@ cd projects\hlsdk-portable ``` cmake -A Win32 -B build ``` -Once you configure the project you don't need to call `cmake` anymore unless you modify `CMakeLists.txt` files or want to reconfigure the project with different parameters. +Note that you must repeat the configuration step if you modify `CMakeLists.txt` files or want to reconfigure the project with different parameters. The next step is to compile the libraries: ``` From 99dc2c519f5523ed9c3bc38e1f81c29e09baf957 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 30 Aug 2022 19:35:13 +0300 Subject: [PATCH 265/298] Fix HUD_ChatInputPosition qualifier (#323) --- cl_dll/vgui_SpectatorPanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/vgui_SpectatorPanel.cpp b/cl_dll/vgui_SpectatorPanel.cpp index 4b2b897c..2d78b932 100644 --- a/cl_dll/vgui_SpectatorPanel.cpp +++ b/cl_dll/vgui_SpectatorPanel.cpp @@ -29,7 +29,7 @@ Sets the location of the input for chat text ========================== */ -void DLLEXPORT HUD_ChatInputPosition( int *x, int *y ) +extern "C" void DLLEXPORT HUD_ChatInputPosition( int *x, int *y ) { // RecClChatInputPosition( x, y ); From 1394637ce87755f9d1f2673a806b24dc8624f518 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 18 Sep 2022 23:49:58 +0300 Subject: [PATCH 266/298] server: func_tank: prevent domain error on barrel adjust (#328) When target is too close to the tank origin, `d2 - r2` expression may become negative causing domain error on square root, and poisoning other fields and even other entities with NaN --- dlls/func_tank.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/func_tank.cpp b/dlls/func_tank.cpp index fd6ff1e7..c9945848 100644 --- a/dlls/func_tank.cpp +++ b/dlls/func_tank.cpp @@ -626,12 +626,14 @@ void CFuncTank::AdjustAnglesForBarrel( Vector &angles, float distance ) if( m_barrelPos.y ) { r2 = m_barrelPos.y * m_barrelPos.y; - angles.y += ( 180.0f / M_PI_F ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); + if( d2 > r2 ) + angles.y += ( 180.0f / M_PI_F ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); } if( m_barrelPos.z ) { r2 = m_barrelPos.z * m_barrelPos.z; - angles.x += ( 180.0f / M_PI_F ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); + if( d2 > r2 ) + angles.x += ( 180.0f / M_PI_F ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); } } } From 63ce6eda310f9a8b3fb5477a402b3ea3a97c805d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 19 Sep 2022 21:35:26 +0300 Subject: [PATCH 267/298] client: view: fix reading from uninitialized variable when setting model angles from camera angles (#329) --- cl_dll/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 6c9a1582..4c93fb87 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -735,7 +735,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // Apply this at all times { - float pitch = camAngles[0]; + float pitch = pparams->viewangles[0]; // Normalize angles if( pitch > 180.0f ) From 5db68d407624152fa00b4862b01ec4d1a34797bf Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 26 Sep 2022 01:40:52 +0300 Subject: [PATCH 268/298] Revert changes to LinearMove (#331) --- dlls/subs.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dlls/subs.cpp b/dlls/subs.cpp index 400e05c8..118554d4 100644 --- a/dlls/subs.cpp +++ b/dlls/subs.cpp @@ -400,13 +400,6 @@ void CBaseToggle::LinearMove( Vector vecDest, float flSpeed ) // divide vector length by speed to get time to reach dest float flTravelTime = vecDestDelta.Length() / flSpeed; - if( flTravelTime < 0.05f ) - { - UTIL_SetOrigin( pev, m_vecFinalDest ); - LinearMoveDone(); - return; - } - // set nextthink to trigger a call to LinearMoveDone when dest is reached pev->nextthink = pev->ltime + flTravelTime; SetThink( &CBaseToggle::LinearMoveDone ); From 901d1947fba561dba7555b02997c843c59914e2b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 26 Sep 2022 17:55:19 +0300 Subject: [PATCH 269/298] Fix tripmines blowing up after loading save game in c1a3d with TRIPMINE_BEAM_DUPLICATION_FIX enabled (#332) --- dlls/tripmine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 859e3548..90379807 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -282,9 +282,23 @@ void CTripmineGrenade::BeamBreakThink( void ) // respawn detect. if( !m_pBeam ) { +#if TRIPMINE_BEAM_DUPLICATION_FIX + // Use the same trace parameters as the original trace above so the right entity is hit. + TraceResult tr2; + UTIL_TraceLine( pev->origin + m_vecDir * 8.0f, pev->origin - m_vecDir * 32.0f, dont_ignore_monsters, ENT( pev ), &tr2 ); +#endif MakeBeam(); +#if TRIPMINE_BEAM_DUPLICATION_FIX + if( tr2.pHit ) + { + // reset owner too + pev->owner = tr2.pHit; + m_hOwner = CBaseEntity::Instance( tr2.pHit ); + } +#else if( tr.pHit ) m_hOwner = CBaseEntity::Instance( tr.pHit ); // reset owner too +#endif } if( fabs( m_flBeamLength - tr.flFraction ) > 0.001f ) From 06521e89500b277a04fe9c101eb97929203c8b1e Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 23 Oct 2022 16:38:28 +0300 Subject: [PATCH 270/298] Update github actions (#341) --- .github/workflows/build.yml | 20 ++++++++++---------- .github/workflows/manual.yml | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29c3bdaa..3b5ae35c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,20 +22,20 @@ jobs: CXX: ${{ matrix.cxx }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Checkout steam-runtime if: startsWith(matrix.os, 'ubuntu') - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ValveSoftware/steam-runtime path: steam-runtime - name: Cache steam-runtime if: startsWith(matrix.os, 'ubuntu') id: cache-steam-runtime - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz key: ${{ runner.os }}-steam-runtime @@ -65,7 +65,7 @@ jobs: - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v1.1 - name: Build on Windows if: startsWith(matrix.os, 'windows') run: | @@ -79,33 +79,33 @@ jobs: - name: Extract branch name shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" >> $GITHUB_OUTPUT id: extract_branch - name: Extract gamedir shell: bash - run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" + run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT id: extract_gamedir - name: Upload linux artifact if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux path: dist/${{ steps.extract_gamedir.outputs.gamedir }} - name: Upload linux artifact with vgui if: startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux-vgui path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }} - name: Upload windows artifact if: startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows path: dist/${{ steps.extract_gamedir.outputs.gamedir }} - name: Upload windows artifact with vgui if: startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows-vgui path: dist-vgui/${{ steps.extract_gamedir.outputs.gamedir }} diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 19cf0201..9f03d110 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -32,20 +32,20 @@ jobs: CXX: ${{ matrix.cxx }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Checkout steam-runtime if: startsWith(matrix.os, 'ubuntu') - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ValveSoftware/steam-runtime path: steam-runtime - name: Cache steam-runtime if: startsWith(matrix.os, 'ubuntu') id: cache-steam-runtime - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz key: ${{ runner.os }}-steam-runtime @@ -73,7 +73,7 @@ jobs: - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v1.1 - name: Build on Windows if: startsWith(matrix.os, 'windows') run: | @@ -82,11 +82,11 @@ jobs: - name: Extract branch name shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')" >> $GITHUB_OUTPUT id: extract_branch - name: Extract gamedir shell: bash - run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" + run: echo "gamedir=$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)" >> $GITHUB_OUTPUT id: extract_gamedir - name: Copy pdbs to dist dir if: ${{ startsWith(matrix.os, 'windows') && github.event.inputs.buildtype == 'Debug' }} @@ -100,13 +100,13 @@ jobs: Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib - name: Upload linux artifact if: startsWith(matrix.os, 'ubuntu') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux path: dist/${{ steps.extract_gamedir.outputs.gamedir }} - name: Upload windows artifact if: startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows path: dist/${{ steps.extract_gamedir.outputs.gamedir }} From 60bd3121fb37fc12c266bdf2e10bb22f1375d90a Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:25:27 +0500 Subject: [PATCH 271/298] Prevent possible null pointer dereference. --- dlls/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/client.cpp b/dlls/client.cpp index 2ca1de59..32740dc5 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -817,7 +817,7 @@ void StartFrame( void ) g_ulFrameCount++; int oldBhopcap = g_bhopcap; - g_bhopcap = ( g_pGameRules->IsMultiplayer() && bhopcap.value != 0.0f ) ? 1 : 0; + g_bhopcap = ( g_pGameRules && g_pGameRules->IsMultiplayer() && bhopcap.value != 0.0f ) ? 1 : 0; if( g_bhopcap != oldBhopcap ) { MESSAGE_BEGIN( MSG_ALL, gmsgBhopcap, NULL ); From 8b628676435c0c8463c5c8e6e17a752837ee4334 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:45:20 +0500 Subject: [PATCH 272/298] Initialize string instead of incorrect copying using sprintf. --- cl_dll/voice_status.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp index 53cd9d5f..7d705db5 100644 --- a/cl_dll/voice_status.cpp +++ b/cl_dll/voice_status.cpp @@ -527,8 +527,7 @@ void CVoiceStatus::UpdateServerState(bool bForce) } } - char str[2048]; - sprintf(str, "vban"); + char str[2048] = "vban"; bool bChange = false; for(unsigned long dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++) From 7fb1dab079002bf1aa5c52cc83b2bb9b655042cb Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:53:07 +0500 Subject: [PATCH 273/298] Remove useless files overview.cpp/.h. --- cl_dll/Android.mk | 1 - cl_dll/CMakeLists.txt | 1 - cl_dll/compile.bat | 1 - cl_dll/overview.cpp | 161 ------------------------------------------ cl_dll/overview.h | 27 ------- cl_dll/wscript | 1 - 6 files changed, 192 deletions(-) delete mode 100644 cl_dll/overview.cpp delete mode 100644 cl_dll/overview.h diff --git a/cl_dll/Android.mk b/cl_dll/Android.mk index df6130ed..9cb79970 100755 --- a/cl_dll/Android.mk +++ b/cl_dll/Android.mk @@ -73,7 +73,6 @@ SRCS+=./input_mouse.cpp #SRCS+=./inputw32.cpp SRCS+=./menu.cpp SRCS+=./message.cpp -SRCS+=./overview.cpp SRCS+=./parsemsg.cpp SRCS_C+=../pm_shared/pm_debug.c SRCS_C+=../pm_shared/pm_math.c diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index bd97f73c..45c24b91 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -101,7 +101,6 @@ set (CLDLL_SOURCES input_xash3d.cpp menu.cpp message.cpp - overview.cpp parsemsg.cpp ../pm_shared/pm_debug.c ../pm_shared/pm_math.c diff --git a/cl_dll/compile.bat b/cl_dll/compile.bat index cc4ed5ac..720d1e3f 100644 --- a/cl_dll/compile.bat +++ b/cl_dll/compile.bat @@ -54,7 +54,6 @@ set SOURCES=../dlls/crossbow.cpp ^ input_xash3d.cpp ^ menu.cpp ^ message.cpp ^ - overview.cpp ^ parsemsg.cpp ^ ../pm_shared/pm_debug.c ^ ../pm_shared/pm_math.c ^ diff --git a/cl_dll/overview.cpp b/cl_dll/overview.cpp deleted file mode 100644 index 81f028e2..00000000 --- a/cl_dll/overview.cpp +++ /dev/null @@ -1,161 +0,0 @@ -//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= - -#include "hud.h" -#include "cl_util.h" -#include "cl_entity.h" -#include "triangleapi.h" -#include "overview.h" - -// these are included for the math functions -#include "com_model.h" -#include "studio_util.h" - -#pragma warning(disable: 4244) - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -int CHudOverview::Init() -{ - gHUD.AddHudElem(this); - - m_iFlags |= HUD_ACTIVE; - - return 1; -} - -//----------------------------------------------------------------------------- -// Purpose: Loads new icons -//----------------------------------------------------------------------------- -int CHudOverview::VidInit() -{ - m_hsprPlayer = gEngfuncs.pfnSPR_Load( "sprites/ring.spr" ); - m_hsprViewcone = gEngfuncs.pfnSPR_Load( "sprites/camera.spr" ); - - return 1; -} - -//----------------------------------------------------------------------------- -// Purpose: -// Input : flTime - -// intermission - -//----------------------------------------------------------------------------- -int CHudOverview::Draw( float flTime ) -{ -#if 0 - // only draw in overview mode - if( !gEngfuncs.Overview_GetOverviewState() ) - return 1; - - // make sure we have player info - //gViewPort->GetAllPlayersInfo(); - gHUD.m_Scoreboard.GetAllPlayersInfo(); - - // calculate player size on the overview - int x1, y1, x2, y2; - float v0[3] = { 0.0f }, v1[3] = { 64.0f, 64.0f }; - gEngfuncs.Overview_WorldToScreen( v0, &x1, &y1 ); - gEngfuncs.Overview_WorldToScreen( v1, &x2, &y2 ); - float scale = abs( x2 - x1 ); - - // loop through all the players and draw them on the map - for( int i = 1; i < MAX_PLAYERS; i++ ) - { - cl_entity_t *pl = gEngfuncs.GetEntityByIndex( i ); - - if( pl && pl->player && pl->curstate.health > 0 && pl->curstate.solid != SOLID_NOT ) - { - int x, y, z = 0; - float v[3] = { pl->origin[0], pl->origin[1], 0 }; - gEngfuncs.Overview_WorldToScreen( v, &x, &y ); - - // hack in some team colors - float r, g, bc; - if( g_PlayerExtraInfo[i].teamnumber == 1 ) - { - r = 0.0f; g = 0.0f; bc = 1.0f; - } - else if( g_PlayerExtraInfo[i].teamnumber == 2 ) - { - r = 1.0f; g = 0.0f; bc = 0.0f; - } - else - { - // just use the default orange color if the team isn't set - r = 1.0f; g = 0.7f; bc = 0.0f; - } - - // set the current texture - gEngfuncs.pTriAPI->SpriteTexture( (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprPlayer ), 0 ); - - // additive render mode - gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); - - // no culling - gEngfuncs.pTriAPI->CullFace( TRI_NONE ); - - // draw a square - gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - - // set the color to be that of the team - gEngfuncs.pTriAPI->Color4f( r, g, bc, 1.0f ); - - // calculate rotational matrix - vec3_t a, b, angles; - float rmatrix[3][4]; // transformation matrix - VectorCopy( pl->angles, angles ); - angles[0] = 0.0f; - angles[1] += 90.f; - angles[1] = -angles[1]; - angles[2] = 0.0f; - AngleMatrix( angles, rmatrix ); - a[2] = 0; - - a[0] = -scale; a[1] = -scale; - VectorTransform( a, rmatrix, b ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); - gEngfuncs.pTriAPI->Vertex3f( x + b[0], y + b[1], z ); - - a[0] = -scale; a[1] = scale; - VectorTransform( a, rmatrix, b ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); - gEngfuncs.pTriAPI->Vertex3f( x + b[0], y + b[1], z ); - - a[0] = scale; a[1] = scale; - VectorTransform( a, rmatrix, b ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); - gEngfuncs.pTriAPI->Vertex3f( x + b[0], y + b[1], z ); - - a[0] = scale; a[1] = -scale; - VectorTransform( a, rmatrix, b ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); - gEngfuncs.pTriAPI->Vertex3f( x + b[0], y + b[1], z ); - - // finish up - gEngfuncs.pTriAPI->End(); - gEngfuncs.pTriAPI->RenderMode( kRenderNormal ); - - // draw the players name and health underneath - char string[256]; - sprintf( string, "%s (%i%%)", g_PlayerInfoList[i].name, pl->curstate.health ); - DrawConsoleString( x, y + ( 1.1 * scale ), string ); - } - } -#endif - return 1; -} - -//----------------------------------------------------------------------------- -// Purpose: called every time a server is connected to -//----------------------------------------------------------------------------- -void CHudOverview::InitHUDData() -{ - //this block would force the spectator view to be on - //gEngfuncs.Overview_SetDrawOverview( 1 ); - //gEngfuncs.Overview_SetDrawInset( 0 ); -} diff --git a/cl_dll/overview.h b/cl_dll/overview.h deleted file mode 100644 index 4c1dc4d8..00000000 --- a/cl_dll/overview.h +++ /dev/null @@ -1,27 +0,0 @@ -//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -// $NoKeywords: $ -//============================================================================= -#pragma once -#if !defined(OVERVIEW_H) -#define OVERVIEW_H - -//----------------------------------------------------------------------------- -// Purpose: Handles the drawing of the top-down map and all the things on it -//----------------------------------------------------------------------------- -class CHudOverview : public CHudBase -{ -public: - int Init(); - int VidInit(); - - int Draw( float flTime ); - void InitHUDData( void ); - -private: - HSPRITE m_hsprPlayer; - HSPRITE m_hsprViewcone; -}; -#endif // OVERVIEW_H diff --git a/cl_dll/wscript b/cl_dll/wscript index b516fe5f..b368ebd8 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -73,7 +73,6 @@ def build(bld): 'input_xash3d.cpp', 'menu.cpp', 'message.cpp', - 'overview.cpp', 'parsemsg.cpp', 'saytext.cpp', 'scoreboard.cpp', From e761d1d405c190f7842b1ab6cad718f6ae9a1ee1 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 06:59:52 +0500 Subject: [PATCH 274/298] Remove mod-specific code under macros. --- cl_dll/vgui_ClassMenu.cpp | 242 +------------- cl_dll/vgui_CustomObjects.cpp | 13 +- cl_dll/vgui_ScorePanel.cpp | 21 -- cl_dll/vgui_TeamFortressViewport.cpp | 465 +-------------------------- cl_dll/vgui_TeamFortressViewport.h | 80 ----- cl_dll/voice_status.cpp | 11 +- 6 files changed, 5 insertions(+), 827 deletions(-) diff --git a/cl_dll/vgui_ClassMenu.cpp b/cl_dll/vgui_ClassMenu.cpp index 568ed98c..02a0a389 100644 --- a/cl_dll/vgui_ClassMenu.cpp +++ b/cl_dll/vgui_ClassMenu.cpp @@ -100,147 +100,6 @@ CClassMenuPanel::CClassMenuPanel( int iTrans, int iRemoveMe, int x, int y, int w m_pScrollPanel->setScrollBarVisible( false, false ); m_pScrollPanel->validate(); - // Create the Class buttons -#ifdef _TFC - for( int i = 0; i <= PC_RANDOM; i++ ) - { - char sz[256]; - int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y + ( ( CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y ) * i ); - - ActionSignal *pASignal = new CMenuHandler_StringCommandClassSelect( sTFClassSelection[i], true ); - - // Class button - sprintf( sz, "%s", CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ) ); - m_pButtons[i] = new ClassButton( i, sz, CLASSMENU_TOPLEFT_BUTTON_X, iYPos, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y, true ); - - // RandomPC uses '0' - if( i >= 1 && i <= 9 ) - { - sprintf( sz, "%d", i ); - } - else - { - strcpy( sz, "0" ); - } - m_pButtons[i]->setBoundKey( sz[0] ); - m_pButtons[i]->setContentAlignment( vgui::Label::a_west ); - m_pButtons[i]->addActionSignal( pASignal ); - m_pButtons[i]->addInputSignal( new CHandler_MenuButtonOver(this, i) ); - m_pButtons[i]->setParent( this ); - - // Create the Class Info Window - // m_pClassInfoPanel[i] = new CTransparentPanel( 255, CLASSMENU_WINDOW_X, CLASSMENU_WINDOW_Y, CLASSMENU_WINDOW_SIZE_X, CLASSMENU_WINDOW_SIZE_Y ); - m_pClassInfoPanel[i] = new CTransparentPanel( 255, 0, 0, clientWide, CLASSMENU_WINDOW_SIZE_Y ); - m_pClassInfoPanel[i]->setParent( m_pScrollPanel->getClient() ); - // m_pClassInfoPanel[i]->setVisible( false ); - - // don't show class pic in lower resolutions - int textOffs = XRES( 8 ); - - if( bShowClassGraphic ) - { - textOffs = CLASSMENU_WINDOW_NAME_X; - } - - // Create the Class Name Label - sprintf( sz, "#Title_%s", sTFClassSelection[i] ); - char *localName=CHudTextMessage::BufferedLocaliseTextString( sz ); - Label *pNameLabel = new Label( "", textOffs, CLASSMENU_WINDOW_NAME_Y ); - pNameLabel->setFont( pSchemes->getFont( hTitleScheme ) ); - pNameLabel->setParent( m_pClassInfoPanel[i] ); - pSchemes->getFgColor( hTitleScheme, r, g, b, a ); - pNameLabel->setFgColor( r, g, b, a ); - pSchemes->getBgColor( hTitleScheme, r, g, b, a ); - pNameLabel->setBgColor( r, g, b, a ); - pNameLabel->setContentAlignment( vgui::Label::a_west ); - // pNameLabel->setBorder( new LineBorder() ); - pNameLabel->setText( "%s", localName); - - // Create the Class Image - if( bShowClassGraphic ) - { - for( int team = 0; team < 2; team++ ) - { - if( team == 1 ) - { - sprintf( sz, "%sred", sTFClassSelection[i] ); - } - else - { - sprintf( sz, "%sblue", sTFClassSelection[i] ); - } - - m_pClassImages[team][i] = new CImageLabel( sz, 0, 0, CLASSMENU_WINDOW_TEXT_X, CLASSMENU_WINDOW_TEXT_Y ); - - CImageLabel *pLabel = m_pClassImages[team][i]; - pLabel->setParent( m_pClassInfoPanel[i] ); - // pLabel->setBorder( new LineBorder() ); - - if( team != 1 ) - { - pLabel->setVisible( false ); - } - - // Reposition it based upon it's size - int xOut, yOut; - pNameLabel->getTextSize( xOut, yOut ); - pLabel->setPos( ( CLASSMENU_WINDOW_TEXT_X - pLabel->getWide() ) / 2, yOut / 2 ); - } - } - - // Create the Player count string - gHUD.m_TextMessage.LocaliseTextString( "#Title_CurrentlyOnYourTeam", m_sPlayersOnTeamString, STRLENMAX_PLAYERSONTEAM ); - m_pPlayers[i] = new Label( "", textOffs, CLASSMENU_WINDOW_PLAYERS_Y ); - m_pPlayers[i]->setParent( m_pClassInfoPanel[i] ); - m_pPlayers[i]->setBgColor( 0, 0, 0, 255 ); - m_pPlayers[i]->setContentAlignment( vgui::Label::a_west ); - m_pPlayers[i]->setFont( pSchemes->getFont( hClassWindowText ) ); - - // Open up the Class Briefing File - sprintf(sz, "classes/short_%s.txt", sTFClassSelection[i]); - char *cText = "Class Description not available."; - char *pfile = (char *)gEngfuncs.COM_LoadFile( sz, 5, NULL ); - if( pfile ) - { - cText = pfile; - } - - // Create the Text info window - TextPanel *pTextWindow = new TextPanel( cText, textOffs, CLASSMENU_WINDOW_TEXT_Y, ( CLASSMENU_WINDOW_SIZE_X - textOffs ) - 5, CLASSMENU_WINDOW_SIZE_Y - CLASSMENU_WINDOW_TEXT_Y ); - pTextWindow->setParent( m_pClassInfoPanel[i] ); - pTextWindow->setFont( pSchemes->getFont( hClassWindowText ) ); - pSchemes->getFgColor( hClassWindowText, r, g, b, a ); - pTextWindow->setFgColor( r, g, b, a ); - pSchemes->getBgColor( hClassWindowText, r, g, b, a ); - pTextWindow->setBgColor( r, g, b, a ); - - // Resize the Info panel to fit it all - int wide,tall; - pTextWindow->getTextImage()->getTextSizeWrapped( wide, tall ); - pTextWindow->setSize( wide, tall ); - - int xx, yy; - pTextWindow->getPos( xx, yy ); - int maxX = xx + wide; - int maxY = yy + tall; - - //check to see if the image goes lower than the text - //just use the red teams [0] images - if( m_pClassImages[0][i] != null ) - { - m_pClassImages[0][i]->getPos( xx, yy ); - if( ( yy + m_pClassImages[0][i]->getTall() ) > maxY ) - { - maxY = yy + m_pClassImages[0][i]->getTall(); - } - } - - m_pClassInfoPanel[i]->setSize( maxX , maxY ); - if( pfile ) - gEngfuncs.COM_FreeFile( pfile ); - // m_pClassInfoPanel[i]->setBorder( new LineBorder() ); - } -#endif // Create the Cancel button m_pCancelButton = new CommandButton( gHUD.m_TextMessage.BufferedLocaliseTextString( "#Menu_Cancel" ), CLASSMENU_TOPLEFT_BUTTON_X, 0, CLASSMENU_BUTTON_SIZE_X, CLASSMENU_BUTTON_SIZE_Y ); m_pCancelButton->setParent( this ); @@ -258,96 +117,6 @@ void CClassMenuPanel::Update() int iYPos = CLASSMENU_TOPLEFT_BUTTON_Y; - // Cycle through the rest of the buttons -#ifdef _TFC - for( int i = 0; i <= PC_RANDOM; i++ ) - { - bool bCivilian = ( gViewPort->GetValidClasses( g_iTeamNumber ) == -1 ); - - if( bCivilian ) - { - // If this team can only be civilians, only the civilian button's visible - if( i == 0 ) - { - m_pButtons[0]->setVisible( true ); - SetActiveInfo( 0 ); - iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; - } - else - { - m_pButtons[i]->setVisible( false ); - } - } - else - { - if( m_pButtons[i]->IsNotValid() || i == 0 ) - { - m_pButtons[i]->setVisible( false ); - } - else - { - m_pButtons[i]->setVisible( true ); - m_pButtons[i]->setPos( CLASSMENU_TOPLEFT_BUTTON_X, iYPos ); - iYPos += CLASSMENU_BUTTON_SIZE_Y + CLASSMENU_BUTTON_SPACER_Y; - - // Start with the first option up - if( !m_iCurrentInfo ) - SetActiveInfo( i ); - } - } - - // Now count the number of teammembers of this class - int iTotal = 0; - for( int j = 1; j < MAX_PLAYERS; j++ ) - { - if( g_PlayerInfoList[j].name == 0 ) - continue; // empty player slot, skip - if( g_PlayerExtraInfo[j].teamname[0] == 0 ) - continue; // skip over players who are not in a team - if( g_PlayerInfoList[j].thisplayer ) - continue; // skip this player - if( g_PlayerExtraInfo[j].teamnumber != g_iTeamNumber ) - continue; // skip over players in other teams - - // If this team is forced to be civilians, just count the number of teammates - if( g_PlayerExtraInfo[j].playerclass != i && !bCivilian ) - continue; - - iTotal++; - } - - char sz[256]; - sprintf( sz, m_sPlayersOnTeamString, iTotal ); - m_pPlayers[i]->setText( "%s", sz ); - - // Set the text color to the teamcolor - m_pPlayers[i]->setFgColor( iTeamColors[g_iTeamNumber % iNumberOfTeamColors][0], - iTeamColors[g_iTeamNumber % iNumberOfTeamColors][1], - iTeamColors[g_iTeamNumber % iNumberOfTeamColors][2], - 0 ); - - // set the graphic to be the team pick - for( int team = 0; team < MAX_TEAMS; team++ ) - { - // unset all the other images - if( m_pClassImages[team][i] ) - { - m_pClassImages[team][i]->setVisible( false ); - } - - // set the current team image - if( m_pClassImages[g_iTeamNumber - 1][i] != 0 ) - { - m_pClassImages[g_iTeamNumber - 1][i]->setVisible( true ); - } - else if( m_pClassImages[0][i] ) - { - m_pClassImages[0][i]->setVisible( true ); - } - } - } -#endif - // If the player already has a class, make the cancel button visible if( g_iPlayerClass ) { @@ -415,16 +184,7 @@ void CClassMenuPanel::Initialize( void ) void CClassMenuPanel::SetActiveInfo( int iInput ) { // Remove all the Info panels and bring up the specified one -#ifdef _TFC - for( int i = 0; i <= PC_RANDOM; i++ ) - { - m_pButtons[i]->setArmed( false ); - m_pClassInfoPanel[i]->setVisible( false ); - } - - if( iInput > PC_RANDOM || iInput < 0 ) -#endif - iInput = 0; + iInput = 0; m_pButtons[iInput]->setArmed( true ); m_pClassInfoPanel[iInput]->setVisible( true ); diff --git a/cl_dll/vgui_CustomObjects.cpp b/cl_dll/vgui_CustomObjects.cpp index 920956a3..0bd63652 100644 --- a/cl_dll/vgui_CustomObjects.cpp +++ b/cl_dll/vgui_CustomObjects.cpp @@ -304,21 +304,12 @@ int ClassButton::IsNotValid() return false; } - // Is it an illegal class? -#ifdef _TFC - if( ( gViewPort->GetValidClasses( 0 ) & sTFValidClassInts[m_iPlayerClass] ) || ( gViewPort->GetValidClasses( g_iTeamNumber ) & sTFValidClassInts[m_iPlayerClass] ) ) - return true; -#endif - // Only check current class if they've got autokill on bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; if( bAutoKill ) { // Is it the player's current class? if ( -#ifdef _TFC - (gViewPort->IsRandomPC() && m_iPlayerClass == PC_RANDOM) || -#endif (!gViewPort->IsRandomPC() && (m_iPlayerClass == g_iPlayerClass)) ) return true; } @@ -539,13 +530,11 @@ void CMenuHandler_StringCommandClassSelect::actionPerformed( Panel *panel ) { CMenuHandler_StringCommand::actionPerformed( panel ); - // THIS IS NOW BEING DONE ON THE TFC SERVER TO AVOID KILLING SOMEONE THEN + // THIS IS NOW BEING DONE ON THE TFC SERVER TO AVOID KILLING SOMEONE THEN // HAVE THE SERVER SAY "SORRY...YOU CAN'T BE THAT CLASS". -#if !defined _TFC bool bAutoKill = CVAR_GET_FLOAT( "hud_classautokill" ) != 0; if( bAutoKill && g_iPlayerClass != 0 ) gEngfuncs.pfnClientCmd( "kill" ); -#endif } diff --git a/cl_dll/vgui_ScorePanel.cpp b/cl_dll/vgui_ScorePanel.cpp index d71685ef..af2d9ec2 100644 --- a/cl_dll/vgui_ScorePanel.cpp +++ b/cl_dll/vgui_ScorePanel.cpp @@ -776,11 +776,6 @@ void ScorePanel::FillGrid() // Don't show classes if this client hasnt picked a team yet if ( g_iTeamNumber == 0 ) bShowClass = false; -#ifdef _TFC - // in TFC show all classes in spectator mode - if ( g_iUser1 ) - bShowClass = true; -#endif if (bShowClass) { @@ -819,21 +814,6 @@ void ScorePanel::FillGrid() } */ break; - -#ifdef _TFC - case COLUMN_KILLS: - if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) - sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].frags ); - break; - case COLUMN_DEATHS: - if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) - sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].deaths ); - break; - case COLUMN_LATENCY: - if (g_PlayerExtraInfo[ m_iSortedRows[row] ].teamnumber) - sprintf(sz, "%d", g_PlayerInfoList[ m_iSortedRows[row] ].ping ); - break; -#else case COLUMN_KILLS: sprintf(sz, "%d", g_PlayerExtraInfo[ m_iSortedRows[row] ].frags ); break; @@ -843,7 +823,6 @@ void ScorePanel::FillGrid() case COLUMN_LATENCY: sprintf(sz, "%d", g_PlayerInfoList[ m_iSortedRows[row] ].ping ); break; -#endif default: break; } diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp index e1d5e58d..151b0a49 100644 --- a/cl_dll/vgui_TeamFortressViewport.cpp +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -136,32 +136,6 @@ const char *sTFClassSelection[] = "civilian", }; -#ifdef _TFC -int iBuildingCosts[] = -{ - BUILD_COST_DISPENSER, - BUILD_COST_SENTRYGUN, - BUILD_COST_TELEPORTER -}; - -// This maps class numbers to the Invalid Class bit. -// This is needed for backwards compatability in maps that were finished before -// all the classes were in TF. Hence the wacky sequence. -int sTFValidClassInts[] = -{ - 0, - TF_ILL_SCOUT, - TF_ILL_SNIPER, - TF_ILL_SOLDIER, - TF_ILL_DEMOMAN, - TF_ILL_MEDIC, - TF_ILL_HVYWEP, - TF_ILL_PYRO, - TF_ILL_SPY, - TF_ILL_ENGINEER, - TF_ILL_RANDOMPC, -}; -#endif // Get the name of TGA file, based on GameDir char *GetVGUITGAName( const char *pszName ) @@ -784,20 +758,6 @@ int TeamFortressViewport::CreateCommandMenu( const char *menuFile, int direction else { // See if it's a Class -#ifdef _TFC - for( int i = 1; i <= PC_ENGINEER; i++ ) - { - if( !strcmp( token, sTFClasses[i] ) ) - { - // Save it off - iPlayerClass = i; - - // Get the button text - pfile = gEngfuncs.COM_ParseFile( pfile, token ); - break; - } - } -#endif } // Get the button bound key @@ -946,21 +906,6 @@ CCommandMenu *TeamFortressViewport::CreateDisguiseSubmenu( CommandButton *pButto CCommandMenu *pMenu = CreateSubMenu( pButton, pParentMenu, iYOffset, iXOffset ); m_pCommandMenus[m_iNumMenus] = pMenu; m_iNumMenus++; - - // create the class choice buttons -#ifdef _TFC - for( int i = PC_SCOUT; i <= PC_ENGINEER; i++ ) - { - CommandButton *pDisguiseButton = new CommandButton( CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[i] ), 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - - char sz[256]; - - sprintf( sz, "%s %d", commandText, i ); - pDisguiseButton->addActionSignal( new CMenuHandler_StringCommand( sz ) ); - - pMenu->AddButton( pDisguiseButton ); - } -#endif return pMenu; } @@ -1018,268 +963,7 @@ CommandButton *TeamFortressViewport::CreateCustomButton( char *pButtonText, char pMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); m_pCommandMenus[m_iNumMenus] = pMenu; m_iNumMenus++; - -#ifdef _TFC - for( int i = PC_SCOUT; i <= PC_RANDOM; i++ ) - { - char sz[256]; - - // ChangeClass buttons - CHudTextMessage::LocaliseTextString( sLocalisedClasses[i], sz, 256 ); - ClassButton *pClassButton = new ClassButton( i, sz, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y, false ); - - sprintf( sz, "%s", sTFClassSelection[i] ); - pClassButton->addActionSignal( new CMenuHandler_StringCommandClassSelect( sz ) ); - pMenu->AddButton( pClassButton ); - } -#endif } -#ifdef _TFC - // Map Briefing - else if( !strcmp( pButtonName, "!MAPBRIEFING" ) ) - { - pButton = new CommandButton( pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_MAPBRIEFING ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Class Descriptions - else if( !strcmp( pButtonName, "!CLASSDESC" ) ) - { - pButton = new ClassButton( 0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false ); - pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_CLASSHELP ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!SERVERINFO" ) ) - { - pButton = new ClassButton( 0, pButtonText, 0, BUTTON_SIZE_Y * m_pCurrentCommandMenu->GetNumButtons(), CMENU_SIZE_X, BUTTON_SIZE_Y, false ); - pButton->addActionSignal( new CMenuHandler_TextWindow( MENU_INTRO ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Spy abilities - else if( !strcmp( pButtonName, "!SPY" ) ) - { - pButton = new DisguiseButton( 0, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - } - // Feign - else if( !strcmp( pButtonName, "!FEIGN" ) ) - { - pButton = new FeignButton( FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "feign" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Feign Silently - else if( !strcmp( pButtonName, "!FEIGNSILENT" ) ) - { - pButton = new FeignButton( FALSE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "sfeign" ) ); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Stop Feigning - else if( !strcmp( pButtonName, "!FEIGNSTOP" ) ) - { - pButton = new FeignButton( TRUE, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "feign" ) ); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Disguise - else if( !strcmp( pButtonName, "!DISGUISEENEMY" ) ) - { - // Create the disguise enemy button, which active only if there are 2 teams - pButton = new DisguiseButton(DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y); - CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_enemy", iYOffset); - } - else if( !strcmp( pButtonName, "!DISGUISEFRIENDLY" ) ) - { - // Create the disguise friendly button, which active only if there are 1 or 2 teams - pButton = new DisguiseButton( DISGUISE_TEAM1 | DISGUISE_TEAM2, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - CreateDisguiseSubmenu( pButton, m_pCurrentCommandMenu, "disguise_friendly", iYOffset ); - } - else if( !strcmp( pButtonName, "!DISGUISE" ) ) - { - // Create the Disguise button - pButton = new DisguiseButton( DISGUISE_TEAM3 | DISGUISE_TEAM4, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - CCommandMenu *pDisguiseMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); - m_pCommandMenus[m_iNumMenus] = pDisguiseMenu; - m_iNumMenus++; - - // Disguise Enemy submenu buttons - for( int i = 1; i <= 4; i++ ) - { - // only show the 4th disguise button if we have 4 teams - m_pDisguiseButtons[i] = new DisguiseButton( ( ( i < 4 ) ? DISGUISE_TEAM3 : 0) | DISGUISE_TEAM4, "Disguise", 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - - pDisguiseMenu->AddButton( m_pDisguiseButtons[i] ); - m_pDisguiseButtons[i]->setParentMenu( pDisguiseMenu ); - - char sz[256]; - - sprintf( sz, "disguise %d", i ); - CreateDisguiseSubmenu( m_pDisguiseButtons[i], pDisguiseMenu, sz, iYOffset, CMENU_SIZE_X - 1 ); - } - } - // Start setting a Detpack - else if( !strcmp( pButtonName, "!DETPACKSTART" ) ) - { - // Detpack Submenu - pButton = new DetpackButton( 2, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - - // Create the submenu - pMenu = CreateSubMenu( pButton, m_pCurrentCommandMenu, iYOffset ); - m_pCommandMenus[m_iNumMenus] = pMenu; - m_iNumMenus++; - - // Set detpack buttons - CommandButton *pDetButton; - pDetButton = new CommandButton( m_sDetpackStrings[0], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 5" ) ); - pMenu->AddButton( pDetButton ); - pDetButton = new CommandButton( m_sDetpackStrings[1], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 20" ) ); - pMenu->AddButton( pDetButton ); - pDetButton = new CommandButton( m_sDetpackStrings[2], 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pDetButton->addActionSignal( new CMenuHandler_StringCommand( "detstart 50" ) ); - pMenu->AddButton( pDetButton ); - } - // Stop setting a Detpack - else if( !strcmp( pButtonName, "!DETPACKSTOP" ) ) - { - pButton = new DetpackButton( 1, pButtonText, 0, BUTTON_SIZE_Y, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "detstop" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Engineer building - else if( !strcmp( pButtonName, "!BUILD" ) ) - { - // only appears if the player is an engineer, and either they have built something or have enough metal to build - pButton = new BuildButton( BUILDSTATE_BASE, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - } - else if( !strcmp( pButtonName, "!BUILDSENTRY" ) ) - { - pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "build 2" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!BUILDDISPENSER" ) ) - { - pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "build 1" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!ROTATESENTRY180" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "rotatesentry180" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!ROTATESENTRY" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "rotatesentry" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if( !strcmp( pButtonName, "!DISMANTLEDISPENSER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "dismantle 1" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!DISMANTLESENTRY" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "dismantle 2" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!DETONATEDISPENSER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::DISPENSER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "detdispenser" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - else if( !strcmp( pButtonName, "!DETONATESENTRY" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::SENTRYGUN, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "detsentry" ) ); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!BUILDENTRYTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("build 4")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!DISMANTLEENTRYTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 4")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!DETONATEENTRYTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::ENTRY_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("detentryteleporter")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!BUILDEXITTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_CANBUILD, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("build 5")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!DISMANTLEEXITTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("dismantle 5")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput(pButton, m_pCurrentCommandMenu) ); - } - else if ( !strcmp( pButtonName, "!DETONATEEXITTELEPORTER" ) ) - { - pButton = new BuildButton( BUILDSTATE_HASBUILDING, BuildButton::EXIT_TELEPORTER, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y); - pButton->addActionSignal(new CMenuHandler_StringCommand("detexitteleporter")); - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } - // Stop building - else if( !strcmp( pButtonName, "!BUILDSTOP" ) ) - { - pButton = new BuildButton( BUILDSTATE_BUILDING, 0, pButtonText, 0, BUTTON_SIZE_Y * 2, CMENU_SIZE_X, BUTTON_SIZE_Y ); - pButton->addActionSignal( new CMenuHandler_StringCommand( "build" ) ); - - // Create an input signal that'll popup the current menu - pButton->addInputSignal( new CMenuHandler_PopupSubMenuInput( pButton, m_pCurrentCommandMenu ) ); - } -#endif return pButton; } @@ -1433,22 +1117,8 @@ void TeamFortressViewport::InputPlayerSpecial( void ) if( !m_iInitialized ) return; -#ifdef _TFC - if( g_iPlayerClass == PC_ENGINEER || g_iPlayerClass == PC_SPY ) - { - ShowCommandMenu( gViewPort->m_StandardMenu ); - - if( m_pCurrentCommandMenu ) - { - m_pCurrentCommandMenu->KeyInput( '7' ); - } - } - else -#endif - { - // if it's any other class, just send the command down to the server - ClientCmd( "_special" ); - } + // if it's any other class, just send the command down to the server + ClientCmd( "_special" ); } // Set the submenu of the Command Menu @@ -1767,51 +1437,6 @@ CMenuPanel *TeamFortressViewport::CreateTextWindow( int iTextToShow ) strncpy( cTitle, m_sMapName, MAX_TITLE_LENGTH ); cTitle[MAX_TITLE_LENGTH - 1] = 0; } -#ifdef _TFC - else if( iTextToShow == SHOW_CLASSDESC ) - { - switch( g_iPlayerClass ) - { - case PC_SCOUT: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_scout" ); - CHudTextMessage::LocaliseTextString( "#Title_scout", cTitle, MAX_TITLE_LENGTH ); break; - case PC_SNIPER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_sniper" ); - CHudTextMessage::LocaliseTextString( "#Title_sniper", cTitle, MAX_TITLE_LENGTH ); break; - case PC_SOLDIER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_soldier" ); - CHudTextMessage::LocaliseTextString( "#Title_soldier", cTitle, MAX_TITLE_LENGTH ); break; - case PC_DEMOMAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_demoman" ); - CHudTextMessage::LocaliseTextString( "#Title_demoman", cTitle, MAX_TITLE_LENGTH ); break; - case PC_MEDIC: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_medic" ); - CHudTextMessage::LocaliseTextString( "#Title_medic", cTitle, MAX_TITLE_LENGTH ); break; - case PC_HVYWEAP: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_hwguy" ); - CHudTextMessage::LocaliseTextString( "#Title_hwguy", cTitle, MAX_TITLE_LENGTH ); break; - case PC_PYRO: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_pyro" ); - CHudTextMessage::LocaliseTextString( "#Title_pyro", cTitle, MAX_TITLE_LENGTH ); break; - case PC_SPY: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_spy" ); - CHudTextMessage::LocaliseTextString( "#Title_spy", cTitle, MAX_TITLE_LENGTH ); break; - case PC_ENGINEER: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_engineer" ); - CHudTextMessage::LocaliseTextString( "#Title_engineer", cTitle, MAX_TITLE_LENGTH ); break; - case PC_CIVILIAN: cText = CHudTextMessage::BufferedLocaliseTextString( "#Help_civilian" ); - CHudTextMessage::LocaliseTextString( "#Title_civilian", cTitle, MAX_TITLE_LENGTH ); break; - default: - return NULL; - } - - if( g_iPlayerClass == PC_CIVILIAN ) - { - strcpy(sz, "classes/long_civilian.txt"); - } - else - { - sprintf( sz, "classes/long_%s.txt", sTFClassSelection[g_iPlayerClass] ); - } - - char *pfile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL ); - if( pfile ) - { - cText = pfile; - } - } -#endif else if( iTextToShow == SHOW_SPECHELP ) { CHudTextMessage::LocaliseTextString( "#Spec_Help_Title", cTitle, MAX_TITLE_LENGTH ); @@ -2534,100 +2159,14 @@ int TeamFortressViewport::MsgFunc_AllowSpec( const char *pszName, int iSize, voi return 1; } -#if defined( _TFC ) -const Vector& GetTeamColor( int team_no ); -extern globalvars_t *gpGlobals; -#endif - // used to reset the player's screen immediately int TeamFortressViewport::MsgFunc_ResetFade( const char *pszName, int iSize, void *pbuf ) { -#if defined( _TFC ) - if ( !gpGlobals ) - return 0; - - screenfade_t sf; - gEngfuncs.pfnGetScreenFade( &sf ); - - sf.fader = 0; - sf.fadeg = 0; - sf.fadeb = 0; - sf.fadealpha = 0; - - sf.fadeEnd = 0.1; - sf.fadeReset = 0.0; - sf.fadeSpeed = 0.0; - - sf.fadeFlags = FFADE_IN; - - sf.fadeReset += gpGlobals->time; - sf.fadeEnd += sf.fadeReset; - - gEngfuncs.pfnSetScreenFade( &sf ); -#endif - return 1; } // used to fade a player's screen out/in when they're spectating someone who is teleported int TeamFortressViewport::MsgFunc_SpecFade( const char *pszName, int iSize, void *pbuf ) { -#if defined( _TFC ) - BEGIN_READ( pbuf, iSize ); - - int iIndex = READ_BYTE(); - - // we're in first-person spectator mode (...not first-person in the PIP) - if ( g_iUser1 == OBS_IN_EYE ) - { - // this is the person we're watching - if ( g_iUser2 == iIndex ) - { - int iFade = READ_BYTE(); - int iTeam = READ_BYTE(); - float flTime = ( (float)READ_SHORT() / 100.0 ); - int iAlpha = READ_BYTE(); - - Vector team = GetTeamColor( iTeam ); - - screenfade_t sf; - gEngfuncs.pfnGetScreenFade( &sf ); - - sf.fader = team[0]; - sf.fadeg = team[1]; - sf.fadeb = team[2]; - sf.fadealpha = iAlpha; - - sf.fadeEnd = flTime; - sf.fadeReset = 0.0; - sf.fadeSpeed = 0.0; - - if ( iFade == BUILD_TELEPORTER_FADE_OUT ) - { - sf.fadeFlags = FFADE_OUT; - sf.fadeReset = flTime; - - if ( sf.fadeEnd ) - sf.fadeSpeed = -(float)sf.fadealpha / sf.fadeEnd; - - sf.fadeTotalEnd = sf.fadeEnd += gpGlobals->time; - sf.fadeReset += sf.fadeEnd; - } - else - { - sf.fadeFlags = FFADE_IN; - - if ( sf.fadeEnd ) - sf.fadeSpeed = (float)sf.fadealpha / sf.fadeEnd; - - sf.fadeReset += gpGlobals->time; - sf.fadeEnd += sf.fadeReset; - } - - gEngfuncs.pfnSetScreenFade( &sf ); - } - } -#endif - return 1; } diff --git a/cl_dll/vgui_TeamFortressViewport.h b/cl_dll/vgui_TeamFortressViewport.h index ee295b59..27f3c991 100644 --- a/cl_dll/vgui_TeamFortressViewport.h +++ b/cl_dll/vgui_TeamFortressViewport.h @@ -32,9 +32,6 @@ #include "vgui_SchemeManager.h" #define TF_DEFS_ONLY -#ifdef _TFC -#include "../tfc/tf_defs.h" -#else #define PC_LASTCLASS 10 #define PC_UNDEFINED 0 #define MENU_DEFAULT 1 @@ -46,7 +43,6 @@ #define MENU_CLASSHELP2 7 #define MENU_REPEATHELP 8 #define MENU_SPECHELP 9 -#endif using namespace vgui; class Cursor; @@ -1031,12 +1027,6 @@ public: virtual int IsNotValid() { - // Only visible for spies -#ifdef _TFC - if( g_iPlayerClass != PC_SPY ) - return true; -#endif - if( m_iFeignState == gViewPort->GetIsFeigning() ) return false; @@ -1079,12 +1069,6 @@ public: virtual int IsNotValid() { -#ifdef _TFC - // Only visible for spies - if( g_iPlayerClass != PC_SPY ) - return true; -#endif - // if it's not tied to a specific team, then always show (for spies) if( !m_iValidTeamsBits ) return false; @@ -1110,12 +1094,6 @@ public: virtual int IsNotValid() { -#ifdef _TFC - // Only visible for demomen - if( g_iPlayerClass != PC_DEMOMAN ) - return true; -#endif - if( m_iDetpackState == gViewPort->GetIsSettingDetpack() ) return false; @@ -1152,64 +1130,6 @@ public: virtual int IsNotValid() { -#ifdef _TFC - // Only visible for engineers - if( g_iPlayerClass != PC_ENGINEER ) - return true; - - // If this isn't set, it's only active when they're not building - if( m_iBuildState & BUILDSTATE_BUILDING ) - { - // Make sure the player's building - if( !( gViewPort->GetBuildState() & BS_BUILDING ) ) - return true; - } - else - { - // Make sure the player's not building - if( gViewPort->GetBuildState() & BS_BUILDING ) - return true; - } - - if( m_iBuildState & BUILDSTATE_BASE ) - { - // Only appear if we've got enough metal to build something, or something already built - if ( gViewPort->GetBuildState() & (BS_HAS_SENTRYGUN | BS_HAS_DISPENSER | BS_CANB_SENTRYGUN | BS_CANB_DISPENSER | BS_HAS_ENTRY_TELEPORTER | BS_HAS_EXIT_TELEPORTER | BS_CANB_ENTRY_TELEPORTER | BS_CANB_EXIT_TELEPORTER) ) - return false; - - return true; - } - - // Must have a building - if( m_iBuildState & BUILDSTATE_HASBUILDING ) - { - if( m_iBuildData == BuildButton::DISPENSER && !( gViewPort->GetBuildState() & BS_HAS_DISPENSER ) ) - return true; - - if( m_iBuildData == BuildButton::SENTRYGUN && !( gViewPort->GetBuildState() & BS_HAS_SENTRYGUN ) ) - return true; - if ( m_iBuildData == BuildButton::ENTRY_TELEPORTER && !(gViewPort->GetBuildState() & BS_HAS_ENTRY_TELEPORTER) ) - return true; - if ( m_iBuildData == BuildButton::EXIT_TELEPORTER && !(gViewPort->GetBuildState() & BS_HAS_EXIT_TELEPORTER) ) - return true; - } - - // Can build something - if( m_iBuildState & BUILDSTATE_CANBUILD ) - { - // Make sure they've got the ammo and don't have one already - if( m_iBuildData == BuildButton::DISPENSER && ( gViewPort->GetBuildState() & BS_CANB_DISPENSER ) ) - return false; - if( m_iBuildData == BuildButton::SENTRYGUN && ( gViewPort->GetBuildState() & BS_CANB_SENTRYGUN ) ) - return false; - if ( m_iBuildData == BuildButton::ENTRY_TELEPORTER && (gViewPort->GetBuildState() & BS_CANB_ENTRY_TELEPORTER) ) - return false; - if ( m_iBuildData == BuildButton::EXIT_TELEPORTER && (gViewPort->GetBuildState() & BS_CANB_EXIT_TELEPORTER) ) - return false; - - return true; - } -#endif return false; } }; diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp index 7d705db5..2e216a7e 100644 --- a/cl_dll/voice_status.cpp +++ b/cl_dll/voice_status.cpp @@ -5,16 +5,7 @@ // $NoKeywords: $ //============================================================================= -// There are hud.h's coming out of the woodwork so this ensures that we get the right one. -#if defined(THREEWAVE) || defined(DMC_BUILD) - #include "../dmc/cl_dll/hud.h" -#elif defined(CSTRIKE) - #include "../cstrike/cl_dll/hud.h" -#elif defined(DOD) - #include "../dod/cl_dll/hud.h" -#else - #include "hud.h" -#endif +#include "hud.h" #include "cl_util.h" #include From 4ad82ee54196f1a5c991ba9d0bff8ccd89bb40fe Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:41:21 +0500 Subject: [PATCH 275/298] Fix strange sprintf usage. --- cl_dll/ev_hldm.cpp | 2 +- cl_dll/hud_redraw.cpp | 4 +--- cl_dll/hud_spectator.cpp | 4 ++-- cl_dll/scoreboard.cpp | 2 +- cl_dll/tri.cpp | 4 +--- cl_dll/vgui_ScorePanel.cpp | 17 ++++++----------- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index a3160cb9..166f86bd 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -247,7 +247,7 @@ char *EV_HLDM_DamageDecal( physent_t *pe ) } else if( pe->rendermode != kRenderNormal ) { - sprintf( decalname, "{bproof1" ); + strcpy( decalname, "{bproof1" ); } else { diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 300c228f..64e24e1c 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -201,9 +201,7 @@ int CHud::Redraw( float flTime, int intermission ) if( m_hsprCursor == 0 ) { - char sz[256]; - sprintf( sz, "sprites/cursor.spr" ); - m_hsprCursor = SPR_Load( sz ); + m_hsprCursor = SPR_Load( "sprites/cursor.spr" ); } SPR_Set( m_hsprCursor, 250, 250, 250 ); diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index c20e6ba0..a6db99f2 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -448,12 +448,12 @@ int CHudSpectator::Draw( float flTime ) color = GetClientColor( i + 1 ); // draw the players name and health underneath - sprintf( string, "%s", g_PlayerInfoList[i + 1].name ); + strcpy( string, g_PlayerInfoList[i + 1].name ); lx = strlen( string ) * 3; // 3 is avg. character length :) DrawSetTextColor( color[0], color[1], color[2] ); - DrawConsoleString( m_vPlayerPos[i][0] - lx,m_vPlayerPos[i][1], string ); + DrawConsoleString( m_vPlayerPos[i][0] - lx,m_vPlayerPos[i][1], string ); } return 1; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 2b8d7d20..685aaa9f 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -453,7 +453,7 @@ int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, if( g_PlayerInfoList[best_player].packetloss >= 63 ) { UnpackRGB( r, g, b, RGB_REDISH ); - sprintf( buf, " !!!!" ); + strcpy( buf, " !!!!" ); } else { diff --git a/cl_dll/tri.cpp b/cl_dll/tri.cpp index 0c45307c..0088daf3 100644 --- a/cl_dll/tri.cpp +++ b/cl_dll/tri.cpp @@ -50,9 +50,7 @@ void Draw_Triangles( void ) if( gHUD.m_hsprCursor == 0 ) { - char sz[256]; - sprintf( sz, "sprites/cursor.spr" ); - gHUD.m_hsprCursor = SPR_Load( sz ); + gHUD.m_hsprCursor = SPR_Load( "sprites/cursor.spr" ); } if( !gEngfuncs.pTriAPI->SpriteTexture( (struct model_s *)gEngfuncs.GetSpritePointer( gHUD.m_hsprCursor ), 0 ) ) diff --git a/cl_dll/vgui_ScorePanel.cpp b/cl_dll/vgui_ScorePanel.cpp index af2d9ec2..e746675d 100644 --- a/cl_dll/vgui_ScorePanel.cpp +++ b/cl_dll/vgui_ScorePanel.cpp @@ -256,10 +256,7 @@ void ScorePanel::Update() // Set the title if( gViewPort->m_szServerName[0] != '\0' ) { - char sz[MAX_SERVERNAME_LENGTH + 16]; - - sprintf( sz, "%s", gViewPort->m_szServerName ); - m_TitleLabel.setText( sz ); + m_TitleLabel.setText( gViewPort->m_szServerName ); } m_iRows = 0; @@ -684,7 +681,7 @@ void ScorePanel::FillGrid() } // Fill out with the correct data - strcpy(sz, ""); + sz[0] = '\0'; if ( m_iIsATeam[row] ) { char sz2[128]; @@ -694,11 +691,11 @@ void ScorePanel::FillGrid() case COLUMN_NAME: if ( m_iIsATeam[row] == TEAM_SPECTATORS ) { - sprintf( sz2, "%s", CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ) ); + strcpy( sz2, CHudTextMessage::BufferedLocaliseTextString( "#Spectators" ) ); } else { - sprintf( sz2, "%s", gViewPort->GetTeamName(team_info->teamnumber) ); + strcpy( sz2, gViewPort->GetTeamName(team_info->teamnumber) ); } strcpy(sz, sz2); @@ -790,7 +787,7 @@ void ScorePanel::FillGrid() if (bNoClass) sz[0] = '\0'; else - sprintf( sz, "%s", CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[ g_PlayerExtraInfo[ m_iSortedRows[row] ].playerclass ] ) ); + strcpy( sz, CHudTextMessage::BufferedLocaliseTextString( sLocalisedClasses[ g_PlayerExtraInfo[ m_iSortedRows[row] ].playerclass ] ) ); } else { @@ -909,14 +906,12 @@ void ScorePanel::mousePressed(MouseCode code, Panel* panel) else { char string1[1024]; - char string2[1024]; // mute the player GetClientVoiceMgr()->SetPlayerBlockedState(iPlayer, true); sprintf( string1, CHudTextMessage::BufferedLocaliseTextString( "#Muted" ), pl_info->name ); - sprintf( string2, "%s", CHudTextMessage::BufferedLocaliseTextString( "#No_longer_hear_that_player" ) ); - sprintf( string, "%c** %s %s\n", HUD_PRINTTALK, string1, string2 ); + sprintf( string, "%c** %s %s\n", HUD_PRINTTALK, string1, CHudTextMessage::BufferedLocaliseTextString( "#No_longer_hear_that_player" ) ); gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, strlen(string)+1, string ); } From 7cffbef773b435e8271289fbd402e213f78956be Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 08:00:53 +0500 Subject: [PATCH 276/298] More safe _snprintf usage. --- cl_dll/vgui_TeamFortressViewport.cpp | 4 ++-- cl_dll/voice_status.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp index 151b0a49..09a215b9 100644 --- a/cl_dll/vgui_TeamFortressViewport.cpp +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -1309,9 +1309,9 @@ void TeamFortressViewport::UpdateSpectatorPanel() if( timer < 0 ) timer = 0; - _snprintf( szText, 63, "%d:%02d\n", ( timer / 60 ), ( timer % 60 ) ); + _snprintf( szText, sizeof(szText) - 1, "%d:%02d\n", ( timer / 60 ), ( timer % 60 ) ); - szText[63] = 0; + szText[sizeof(szText) - 1] = '\0'; m_pSpectatorPanel->m_CurrentTime->setText( szText ); */ diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp index 2e216a7e..2ad4aaaf 100644 --- a/cl_dll/voice_status.cpp +++ b/cl_dll/voice_status.cpp @@ -391,7 +391,7 @@ void CVoiceStatus::UpdateSpeakerStatus( int entindex, qboolean bTalking ) if ( gEngfuncs.pfnGetCvarFloat( "voice_clientdebug" ) ) { char msg[256]; - _snprintf( msg, sizeof( msg ), "CVoiceStatus::UpdateSpeakerStatus: ent %d talking = %d\n", entindex, bTalking ); + sprintf( msg, "CVoiceStatus::UpdateSpeakerStatus: ent %d talking = %d\n", entindex, bTalking ); gEngfuncs.pfnConsolePrint( msg ); } @@ -446,7 +446,8 @@ void CVoiceStatus::UpdateSpeakerStatus( int entindex, qboolean bTalking ) gEngfuncs.pfnGetPlayerInfo( entindex, &info ); char paddedName[512]; - _snprintf( paddedName, sizeof( paddedName ), "%s ", info.name ); + _snprintf( paddedName, sizeof( paddedName ) - 1, "%s ", info.name ); + paddedName[sizeof(paddedName) - 1] = '\0'; int color[3]; m_pHelper->GetPlayerTextColor( entindex, color ); @@ -507,7 +508,7 @@ void CVoiceStatus::UpdateServerState(bool bForce) m_bServerModEnable = bCVarModEnable; char str[256]; - _snprintf(str, sizeof(str), "VModEnable %d", m_bServerModEnable); + sprintf(str, "VModEnable %d", m_bServerModEnable); ServerCmd(str); if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug")) From cea0903626813faad91b8d7db46679fdf5efcc0c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 08:14:24 +0500 Subject: [PATCH 277/298] More safe strncat usage. --- cl_dll/MOTD.cpp | 3 ++- cl_dll/death.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index c48a9af1..1ca1c0f8 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -134,7 +134,8 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) BEGIN_READ( pbuf, iSize ); int is_finished = READ_BYTE(); - strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - 1 ); + strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - strlen(m_szMOTD) - 1 ); + m_szMOTD[sizeof(m_szMOTD) - 1] = '\0'; if( is_finished ) { diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 1dbb0b39..b4a6539c 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -173,6 +173,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu char killedwith[32]; strcpy( killedwith, "d_" ); strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 ); + killedwith[sizeof(killedwith) - 1] = '\0'; #if USE_VGUI if (gViewPort) From 368fdf12591b5a86f4f2d1b1485384f1c8df66f7 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 08:19:12 +0500 Subject: [PATCH 278/298] More safe _snprintf usage. --- dlls/client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/client.cpp b/dlls/client.cpp index 32740dc5..e81e6772 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -109,7 +109,10 @@ void ClientDisconnect( edict_t *pEntity ) char text[256] = ""; if( pEntity->v.netname ) - _snprintf( text, sizeof(text), "- %s has left the game\n", STRING( pEntity->v.netname ) ); + { + _snprintf( text, sizeof(text) - 1, "- %s has left the game\n", STRING( pEntity->v.netname ) ); + text[sizeof(text) - 1] = '\0'; + } MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL ); WRITE_BYTE( ENTINDEX( pEntity ) ); WRITE_STRING( text ); @@ -667,7 +670,8 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) if( gpGlobals->maxClients > 1 ) { char text[256]; - _snprintf( text, 256, "* %s changed name to %s\n", STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); + _snprintf( text, sizeof(text) - 1, "* %s changed name to %s\n", STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); + text[sizeof(text) - 1] = '\0'; MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL ); WRITE_BYTE( ENTINDEX( pEntity ) ); WRITE_STRING( text ); From 58f78b4f1cf6157dd9f7558eed5cc004864483f7 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 08:47:47 +0500 Subject: [PATCH 279/298] More safe strncpy usage. --- cl_dll/death.cpp | 4 ++-- cl_dll/hud.cpp | 8 ++++---- cl_dll/hud_spectator.cpp | 2 +- cl_dll/menu.cpp | 6 +++--- cl_dll/saytext.cpp | 2 +- cl_dll/scoreboard.cpp | 4 ++-- cl_dll/statusbar.cpp | 5 +++-- cl_dll/vgui_CustomObjects.cpp | 2 +- cl_dll/vgui_SchemeManager.cpp | 8 ++++---- cl_dll/vgui_ScorePanel.cpp | 2 +- cl_dll/vgui_TeamFortressViewport.cpp | 8 ++++---- cl_dll/vgui_TeamFortressViewport.h | 2 +- dlls/client.cpp | 4 ++-- dlls/teamplay_gamerules.cpp | 21 ++++++++++++++------- 14 files changed, 43 insertions(+), 35 deletions(-) diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index b4a6539c..90024245 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -207,7 +207,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu else { rgDeathNoticeList[i].KillerColor = GetClientColor( killer ); - strncpy( rgDeathNoticeList[i].szKiller, killer_name, MAX_PLAYER_NAME_LENGTH ); + strncpy( rgDeathNoticeList[i].szKiller, killer_name, MAX_PLAYER_NAME_LENGTH - 1 ); rgDeathNoticeList[i].szKiller[MAX_PLAYER_NAME_LENGTH - 1] = 0; } @@ -224,7 +224,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu else { rgDeathNoticeList[i].VictimColor = GetClientColor( victim ); - strncpy( rgDeathNoticeList[i].szVictim, victim_name, MAX_PLAYER_NAME_LENGTH ); + strncpy( rgDeathNoticeList[i].szVictim, victim_name, MAX_PLAYER_NAME_LENGTH - 1 ); rgDeathNoticeList[i].szVictim[MAX_PLAYER_NAME_LENGTH - 1] = 0; } diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index eae37b7a..f16e30b9 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -519,8 +519,8 @@ void CHud::VidInit( void ) sprintf( sz, "sprites/%s.spr", p->szSprite ); m_rghSprites[index] = SPR_Load( sz ); m_rgrcRects[index] = p->rc; - strncpy( &m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH], p->szName, MAX_SPRITE_NAME_LENGTH ); - + strncpy( &m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH], p->szName, MAX_SPRITE_NAME_LENGTH - 1 ); + m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH + ( MAX_SPRITE_NAME_LENGTH - 1 )] = '\0'; index++; } @@ -562,8 +562,8 @@ void CHud::VidInit( void ) sprintf( sz, "sprites/%s.spr", p->szSprite ); m_rghSprites[index] = SPR_Load( sz ); m_rgrcRects[index] = p->rc; - strncpy( &m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH], p->szName, MAX_SPRITE_NAME_LENGTH ); - + strncpy( &m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH], p->szName, MAX_SPRITE_NAME_LENGTH - 1 ); + m_rgszSpriteNames[index * MAX_SPRITE_NAME_LENGTH + ( MAX_SPRITE_NAME_LENGTH - 1 )] = '\0'; index++; } diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index a6db99f2..7e115f51 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -537,7 +537,7 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) msg->holdtime = READ_FLOAT(); // holdtime msg->fxtime = READ_FLOAT(); // fxtime; - strncpy( m_HUDMessageText[m_lastHudMessage], READ_STRING(), 128 ); + strncpy( m_HUDMessageText[m_lastHudMessage], READ_STRING(), 127 ); m_HUDMessageText[m_lastHudMessage][127] = 0; // text msg->pMessage = m_HUDMessageText[m_lastHudMessage]; diff --git a/cl_dll/menu.cpp b/cl_dll/menu.cpp index e9166979..45147e78 100644 --- a/cl_dll/menu.cpp +++ b/cl_dll/menu.cpp @@ -157,7 +157,7 @@ int CHudMenu::MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf ) { if( !m_fWaitingForMore ) // this is the start of a new menu { - strncpy( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING ); + strncpy( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING - 1 ); } else { @@ -169,13 +169,13 @@ int CHudMenu::MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf ) if( !NeedMore ) { // we have the whole string, so we can localise it now - strncpy( g_szMenuString, gHUD.m_TextMessage.BufferedLocaliseTextString( g_szPrelocalisedMenuString ), MAX_MENU_STRING ); + strncpy( g_szMenuString, gHUD.m_TextMessage.BufferedLocaliseTextString( g_szPrelocalisedMenuString ), MAX_MENU_STRING - 1 ); g_szMenuString[MAX_MENU_STRING - 1] = '\0'; // Swap in characters if( KB_ConvertString( g_szMenuString, &temp ) ) { - strncpy( g_szMenuString, temp, MAX_MENU_STRING ); + strncpy( g_szMenuString, temp, MAX_MENU_STRING - 1 ); g_szMenuString[MAX_MENU_STRING - 1] = '\0'; free( temp ); } diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index d7a7dd98..35d08bec 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -133,7 +133,7 @@ int CHudSayText::Draw( float flTime ) static char buf[MAX_PLAYER_NAME_LENGTH + 32]; // draw the first x characters in the player color - strncpy( buf, g_szLineBuffer[i], Q_min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 32 ) ); + strncpy( buf, g_szLineBuffer[i], Q_min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 ) ); buf[Q_min( g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 )] = 0; DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] ); int x = DrawConsoleString( LINE_START, y, buf ); diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 685aaa9f..007585f5 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -522,7 +522,7 @@ int CHudScoreboard::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf if( cl > 0 && cl <= MAX_PLAYERS ) { // set the players team - strncpy( g_PlayerExtraInfo[cl].teamname, READ_STRING(), MAX_TEAM_NAME ); + strncpy( g_PlayerExtraInfo[cl].teamname, READ_STRING(), MAX_TEAM_NAME - 1 ); } // rebuild the list of teams @@ -564,7 +564,7 @@ int CHudScoreboard::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf } m_iNumTeams = Q_max( j, m_iNumTeams ); - strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); + strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME - 1 ); g_TeamInfo[j].players = 0; } diff --git a/cl_dll/statusbar.cpp b/cl_dll/statusbar.cpp index 79f30b7e..41b5008e 100644 --- a/cl_dll/statusbar.cpp +++ b/cl_dll/statusbar.cpp @@ -141,7 +141,8 @@ void CHudStatusBar::ParseStatusString( int line_num ) GetPlayerInfo( indexval, &g_PlayerInfoList[indexval] ); if( g_PlayerInfoList[indexval].name != NULL ) { - strncpy( szRepString, g_PlayerInfoList[indexval].name, MAX_PLAYER_NAME_LENGTH ); + strncpy( szRepString, g_PlayerInfoList[indexval].name, MAX_PLAYER_NAME_LENGTH - 1 ); + szRepString[MAX_PLAYER_NAME_LENGTH - 1] = '\0'; m_pflNameColors[line_num] = GetClientColor( indexval ); } else @@ -231,7 +232,7 @@ int CHudStatusBar::MsgFunc_StatusText( const char *pszName, int iSize, void *pbu if( line < 0 || line >= MAX_STATUSBAR_LINES ) return 1; - strncpy( m_szStatusText[line], READ_STRING(), MAX_STATUSTEXT_LENGTH ); + strncpy( m_szStatusText[line], READ_STRING(), MAX_STATUSTEXT_LENGTH - 1 ); m_szStatusText[line][MAX_STATUSTEXT_LENGTH - 1] = 0; // ensure it's null terminated ( strncpy() won't null terminate if read string too long) if( m_szStatusText[0] == 0 ) diff --git a/cl_dll/vgui_CustomObjects.cpp b/cl_dll/vgui_CustomObjects.cpp index 0bd63652..d14e59bc 100644 --- a/cl_dll/vgui_CustomObjects.cpp +++ b/cl_dll/vgui_CustomObjects.cpp @@ -154,7 +154,7 @@ void CommandButton::RecalculateText( void ) void CommandButton::setText( const char *text ) { - strncpy( m_sMainText, text, MAX_BUTTON_SIZE ); + strncpy( m_sMainText, text, MAX_BUTTON_SIZE - 1 ); m_sMainText[MAX_BUTTON_SIZE - 1] = 0; RecalculateText(); diff --git a/cl_dll/vgui_SchemeManager.cpp b/cl_dll/vgui_SchemeManager.cpp index dddd268c..e50e5b73 100644 --- a/cl_dll/vgui_SchemeManager.cpp +++ b/cl_dll/vgui_SchemeManager.cpp @@ -205,7 +205,7 @@ CSchemeManager::CSchemeManager( int xRes, int yRes ) static const int tokenSize = 64; char paramName[tokenSize], paramValue[tokenSize]; - strncpy( paramName, token, tokenSize ); + strncpy( paramName, token, tokenSize - 1 ); paramName[tokenSize-1] = 0; // ensure null termination // get the '=' character @@ -225,7 +225,7 @@ CSchemeManager::CSchemeManager( int xRes, int yRes ) // get paramValue pFile = gEngfuncs.COM_ParseFile( pFile, token ); - strncpy( paramValue, token, tokenSize ); + strncpy( paramValue, token, tokenSize - 1 ); paramValue[tokenSize-1] = 0; // ensure null termination // is this a new scheme? @@ -278,7 +278,7 @@ CSchemeManager::CSchemeManager( int xRes, int yRes ) pScheme = &tmpSchemes[currentScheme]; hasFgColor = hasBgColor = hasArmedFgColor = hasArmedBgColor = hasMouseDownFgColor = hasMouseDownBgColor = false; - strncpy( pScheme->schemeName, paramValue, CScheme::SCHEME_NAME_LENGTH ); + strncpy( pScheme->schemeName, paramValue, CScheme::SCHEME_NAME_LENGTH - 1 ); pScheme->schemeName[CScheme::SCHEME_NAME_LENGTH-1] = '\0'; // ensure null termination of string } @@ -291,7 +291,7 @@ CSchemeManager::CSchemeManager( int xRes, int yRes ) // pull the data out into the scheme if ( !stricmp(paramName, "FontName") ) { - strncpy( pScheme->fontName, paramValue, CScheme::FONT_NAME_LENGTH ); + strncpy( pScheme->fontName, paramValue, CScheme::FONT_NAME_LENGTH - 1 ); pScheme->fontName[CScheme::FONT_NAME_LENGTH-1] = 0; } else if ( !stricmp(paramName, "FontSize") ) diff --git a/cl_dll/vgui_ScorePanel.cpp b/cl_dll/vgui_ScorePanel.cpp index e746675d..13c2fb19 100644 --- a/cl_dll/vgui_ScorePanel.cpp +++ b/cl_dll/vgui_ScorePanel.cpp @@ -499,7 +499,7 @@ void ScorePanel::RebuildTeams() } m_iNumTeams = Q_max( j, m_iNumTeams ); - strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); + strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME - 1 ); g_TeamInfo[j].players = 0; } diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp index 09a215b9..21a8a928 100644 --- a/cl_dll/vgui_TeamFortressViewport.cpp +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -734,7 +734,7 @@ int TeamFortressViewport::CreateCommandMenu( const char *menuFile, int direction { // Get the mapname pfile = gEngfuncs.COM_ParseFile( pfile, token ); - strncpy( szMap, token, MAX_MAPNAME ); + strncpy( szMap, token, MAX_MAPNAME - 1 ); szMap[MAX_MAPNAME - 1] = '\0'; // Get the next token @@ -1243,7 +1243,7 @@ void TeamFortressViewport::UpdateSpectatorPanel() // create player & health string if( player && name ) { - strncpy( bottomText, name, sizeof(bottomText) ); + strncpy( bottomText, name, sizeof(bottomText) - 1 ); bottomText[ sizeof(bottomText) - 1 ] = 0; pBottomText = bottomText; } @@ -1434,7 +1434,7 @@ CMenuPanel *TeamFortressViewport::CreateTextWindow( int iTextToShow ) cText = pfile; - strncpy( cTitle, m_sMapName, MAX_TITLE_LENGTH ); + strncpy( cTitle, m_sMapName, MAX_TITLE_LENGTH - 1 ); cTitle[MAX_TITLE_LENGTH - 1] = 0; } else if( iTextToShow == SHOW_SPECHELP ) @@ -2038,7 +2038,7 @@ int TeamFortressViewport::MsgFunc_ServerName( const char *pszName, int iSize, vo { BEGIN_READ( pbuf, iSize ); - strncpy( m_szServerName, READ_STRING(), sizeof(m_szServerName) ); + strncpy( m_szServerName, READ_STRING(), sizeof(m_szServerName) - 1 ); m_szServerName[sizeof(m_szServerName) - 1] = 0; return 1; diff --git a/cl_dll/vgui_TeamFortressViewport.h b/cl_dll/vgui_TeamFortressViewport.h index 27f3c991..023d716d 100644 --- a/cl_dll/vgui_TeamFortressViewport.h +++ b/cl_dll/vgui_TeamFortressViewport.h @@ -846,7 +846,7 @@ protected: public: CMenuHandler_SpectateFollow( char *player ) { - strncpy( m_szplayer, player, MAX_COMMAND_SIZE); + strncpy( m_szplayer, player, MAX_COMMAND_SIZE - 1 ); m_szplayer[MAX_COMMAND_SIZE-1] = '\0'; } diff --git a/dlls/client.cpp b/dlls/client.cpp index e81e6772..cd33bd20 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -625,8 +625,8 @@ void ClientCommand( edict_t *pEntity ) // check the length of the command (prevents crash) // max total length is 192 ...and we're adding a string below ("Unknown command: %s\n") - strncpy( command, pcmd, 127 ); - command[127] = '\0'; + strncpy( command, pcmd, sizeof(command) - 1); + command[sizeof(command) - 1] = '\0'; // tell the user they entered an unknown command ClientPrint( &pEntity->v, HUD_PRINTCONSOLE, UTIL_VarArgs( "Unknown command: %s\n", command ) ); diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index 6f53582a..5c9a98d3 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -44,7 +44,8 @@ CHalfLifeTeamplay::CHalfLifeTeamplay() m_szTeamList[0] = 0; // Cache this because the team code doesn't want to deal with changing this in the middle of a game - strncpy( m_szTeamList, teamlist.string, TEAMPLAY_TEAMLISTLENGTH ); + strncpy( m_szTeamList, teamlist.string, TEAMPLAY_TEAMLISTLENGTH - 1 ); + m_szTeamList[TEAMPLAY_TEAMLISTLENGTH - 1] = '\0'; edict_t *pWorld = INDEXENT( 0 ); if( pWorld && pWorld->v.team ) @@ -54,7 +55,8 @@ CHalfLifeTeamplay::CHalfLifeTeamplay() const char *pTeamList = STRING( pWorld->v.team ); if( pTeamList && pTeamList[0] != '\0' ) { - strncpy( m_szTeamList, pTeamList, TEAMPLAY_TEAMLISTLENGTH ); + strncpy( m_szTeamList, pTeamList, TEAMPLAY_TEAMLISTLENGTH - 1 ); + m_szTeamList[TEAMPLAY_TEAMLISTLENGTH - 1] = '\0'; } } } @@ -183,7 +185,8 @@ const char *CHalfLifeTeamplay::SetDefaultPlayerTeam( CBasePlayer *pPlayer ) { // copy out the team name from the model char *mdls = g_engfuncs.pfnInfoKeyValue( g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model" ); - strncpy( pPlayer->m_szTeamName, mdls, TEAM_NAME_LENGTH ); + strncpy( pPlayer->m_szTeamName, mdls, TEAM_NAME_LENGTH - 1 ); + pPlayer->m_szTeamName[TEAM_NAME_LENGTH - 1] = '\0'; RecountTeams(); @@ -200,7 +203,8 @@ const char *CHalfLifeTeamplay::SetDefaultPlayerTeam( CBasePlayer *pPlayer ) { pTeamName = TeamWithFewestPlayers(); } - strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH ); + strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH - 1 ); + pPlayer->m_szTeamName[TEAM_NAME_LENGTH - 1] = '\0'; } return pPlayer->m_szTeamName; @@ -287,8 +291,10 @@ void CHalfLifeTeamplay::ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTea // copy out the team name from the model if( pPlayer->m_szTeamName != pTeamName ) - strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH ); - + { + strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH - 1 ); + pPlayer->m_szTeamName[TEAM_NAME_LENGTH - 1] = '\0'; + } g_engfuncs.pfnSetClientKeyValue( clientIndex, g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", pPlayer->m_szTeamName ); g_engfuncs.pfnSetClientKeyValue( clientIndex, g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "team", pPlayer->m_szTeamName ); @@ -603,7 +609,8 @@ void CHalfLifeTeamplay::RecountTeams( bool bResendInfo ) tm = num_teams; num_teams++; team_scores[tm] = 0; - strncpy( team_names[tm], pTeamName, MAX_TEAMNAME_LENGTH ); + strncpy( team_names[tm], pTeamName, MAX_TEAMNAME_LENGTH - 1 ); + team_names[tm][MAX_TEAMNAME_LENGTH - 1] = '\0'; } } From 73301aa7169f3eaa288bfd211fe720de731e43c6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 14 Nov 2022 09:17:47 +0500 Subject: [PATCH 280/298] Use capital letters instead of strupr usage. --- cl_dll/voice_status.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp index 2ad4aaaf..1f1c33ac 100644 --- a/cl_dll/voice_status.cpp +++ b/cl_dll/voice_status.cpp @@ -80,16 +80,14 @@ int g_BannedPlayerPrintCount; void ForEachBannedPlayer(char id[16]) { char str[256]; - sprintf(str, "Ban %d: %2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x\n", + sprintf(str, "BAN %d: %2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X%2X\n", g_BannedPlayerPrintCount++, id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7], id[8], id[9], id[10], id[11], id[12], id[13], id[14], id[15] ); -#ifdef _WIN32 - strupr(str); -#endif + gEngfuncs.pfnConsolePrint(str); } From c8438f3fd7bf05c8c03d32fae14f6440684b60a1 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:19:52 +0500 Subject: [PATCH 281/298] scripts: waifulib: library_naming: fix wrong library naming scheme for i386. --- scripts/waifulib/library_naming.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 44ade2fd..f3b9762a 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -99,7 +99,10 @@ def configure(conf): if conf.env.XASH_AMD64: buildarch = "amd64" elif conf.env.XASH_X86: - buildarch = "" + if conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: + buildarch = "" + else: + buildarch = "i386" elif conf.env.XASH_ARM and conf.env.XASH_64BIT: buildarch = "arm64" elif conf.env.XASH_ARM: From 4ba4f5a9bc5d89f5ccc6eead79994a3971ebabbf Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 15 Nov 2022 15:46:31 +0300 Subject: [PATCH 282/298] wscript: keep lib prefix only on selected platforms, e.g. Android --- wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wscript b/wscript index 46017809..c4f85fae 100644 --- a/wscript +++ b/wscript @@ -175,7 +175,7 @@ def configure(conf): conf.env.append_unique('CXXFLAGS', ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) # strip lib from pattern - if conf.env.DEST_OS in ['linux', 'darwin']: + if conf.env.DEST_OS not in ['android']: if conf.env.cshlib_PATTERN.startswith('lib'): conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:] if conf.env.cxxshlib_PATTERN.startswith('lib'): From 813aa0ae91296075f539b773ac77963829e5fcc8 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 16 Nov 2022 05:45:28 +0500 Subject: [PATCH 283/298] More safe string copying. --- dlls/client.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/client.cpp b/dlls/client.cpp index cd33bd20..53786de7 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -355,13 +355,15 @@ void Host_Say( edict_t *pEntity, int teamonly ) { if( CMD_ARGC() >= 2 ) { - sprintf( szTemp, "%s %s", (char *)pcmd, (char *)CMD_ARGS() ); + _snprintf( szTemp, sizeof(szTemp) - 1, "%s %s", (char *)pcmd, (char *)CMD_ARGS() ); } else { // Just a one word command, use the first word...sigh - sprintf( szTemp, "%s", (char *)pcmd ); + strncpy( szTemp, (char *)pcmd, sizeof(szTemp) - 1 ); } + szTemp[sizeof(szTemp) - 1] = '\0'; + p = szTemp; } @@ -377,11 +379,12 @@ void Host_Say( edict_t *pEntity, int teamonly ) // turn on color set 2 (color on, no sound) if( player->IsObserver() && ( teamonly ) ) - sprintf( text, "%c(SPEC) %s: ", 2, STRING( pEntity->v.netname ) ); + _snprintf( text, sizeof(text) - 1, "%c(SPEC) %s: ", 2, STRING( pEntity->v.netname ) ); else if( teamonly ) - sprintf( text, "%c(TEAM) %s: ", 2, STRING( pEntity->v.netname ) ); + _snprintf( text, sizeof(text) - 1, "%c(TEAM) %s: ", 2, STRING( pEntity->v.netname ) ); else - sprintf( text, "%c%s: ", 2, STRING( pEntity->v.netname ) ); + _snprintf( text, sizeof(text) - 1, "%c%s: ", 2, STRING( pEntity->v.netname ) ); + text[sizeof(text) - 1] = '\0'; j = sizeof( text ) - 2 - strlen( text ); // -2 for /n and null terminator if( (int)strlen( p ) > j ) From 1c80e4bbcda6a6088701852ff4bb17adb2b71929 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Fri, 25 Nov 2022 12:41:42 +0300 Subject: [PATCH 284/298] Add a cvar fixing pushable excessive acceleration (#343) --- dlls/func_break.cpp | 28 ++++++++++++++++++++++++---- dlls/game.cpp | 2 ++ dlls/game.h | 1 + 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 916913f2..0c5e0114 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -26,6 +26,7 @@ #include "func_break.h" #include "decals.h" #include "explode.h" +#include "game.h" extern DLL_GLOBAL Vector g_vecAttackDir; @@ -925,12 +926,24 @@ void CPushable::Move( CBaseEntity *pOther, int push ) return; } - // g-cont. fix pushable acceleration bug (reverted as it used in mods) if( pOther->IsPlayer() ) { - // Don't push unless the player is pushing forward and NOT use (pull) - if( push && !( pevToucher->button & ( IN_FORWARD | IN_USE ) ) ) - return; + // g-cont. fix pushable acceleration bug (now implemented as cvar) + if (pushablemode.value == 1) + { + // Allow player push when moving right, left and back too + if ( push && !(pevToucher->button & (IN_FORWARD|IN_MOVERIGHT|IN_MOVELEFT|IN_BACK)) ) + return; + // Require player walking back when applying '+use' on pushable + if ( !push && !(pevToucher->button & (IN_BACK)) ) + return; + } + else + { + // Don't push unless the player is pushing forward and NOT use (pull) + if( push && !( pevToucher->button & ( IN_FORWARD | IN_USE ) ) ) + return; + } playerTouch = 1; } @@ -951,6 +964,13 @@ void CPushable::Move( CBaseEntity *pOther, int push ) else factor = 0.25f; + // Spirit fix for pushable acceleration + if (pushablemode.value == 2) + { + if (!push) + factor *= 0.5f; + } + pev->velocity.x += pevToucher->velocity.x * factor; pev->velocity.y += pevToucher->velocity.y * factor; diff --git a/dlls/game.cpp b/dlls/game.cpp index 690256c2..c648c796 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -38,6 +38,7 @@ cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER }; +cvar_t pushablemode = { "pushablemode", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; @@ -491,6 +492,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &explosionfix ); CVAR_REGISTER( &monsteryawspeedfix ); CVAR_REGISTER( &corpsephysics ); + CVAR_REGISTER( &pushablemode ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &aimcrosshair ); diff --git a/dlls/game.h b/dlls/game.h index 54e3281d..fee1a71b 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -33,6 +33,7 @@ extern cvar_t satchelfix; extern cvar_t explosionfix; extern cvar_t monsteryawspeedfix; extern cvar_t corpsephysics; +extern cvar_t pushablemode; extern cvar_t forcerespawn; extern cvar_t flashlight; extern cvar_t aimcrosshair; From 63e3769c46ba7f502b53abdfdd55597e4130c0dd Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 26 Nov 2022 02:27:38 +0500 Subject: [PATCH 285/298] Fix animation code accessing invalid sequence descriptor. https://github.com/ValveSoftware/halflife/issues/3308 --- dlls/animation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/animation.cpp b/dlls/animation.cpp index c7d38e71..c66d49cd 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -238,7 +238,7 @@ void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float * mstudioseqdesc_t *pseqdesc; - if( pev->sequence >= pstudiohdr->numseq ) + if( pev->sequence < 0 || pev->sequence >= pstudiohdr->numseq ) { *pflFrameRate = 0.0f; *pflGroundSpeed = 0.0f; @@ -265,7 +265,7 @@ int GetSequenceFlags( void *pmodel, entvars_t *pev ) studiohdr_t *pstudiohdr; pstudiohdr = (studiohdr_t *)pmodel; - if( !pstudiohdr || pev->sequence >= pstudiohdr->numseq ) + if( !pstudiohdr || pev->sequence < 0 || pev->sequence >= pstudiohdr->numseq ) return 0; mstudioseqdesc_t *pseqdesc; @@ -279,7 +279,7 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve studiohdr_t *pstudiohdr; pstudiohdr = (studiohdr_t *)pmodel; - if( !pstudiohdr || pev->sequence >= pstudiohdr->numseq || !pMonsterEvent ) + if( !pstudiohdr || pev->sequence < 0 || pev->sequence >= pstudiohdr->numseq || !pMonsterEvent ) return 0; mstudioseqdesc_t *pseqdesc; @@ -379,7 +379,7 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) studiohdr_t *pstudiohdr; pstudiohdr = (studiohdr_t *)pmodel; - if( !pstudiohdr ) + if( !pstudiohdr || pev->sequence < 0 || pev->sequence >= pstudiohdr->numseq ) return flValue; mstudioseqdesc_t *pseqdesc; From 06424ce6fa35fa32e58c8b68c874ec92fe6cb87e Mon Sep 17 00:00:00 2001 From: FreeSlave Date: Fri, 30 Dec 2022 10:57:07 +0300 Subject: [PATCH 286/298] Track m_rawinput changes when weapon prediction is disabled --- cl_dll/input_goldsource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index bf029639..a11d26b1 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -158,7 +158,6 @@ bool isMouseRelative = false; #if _WIN32 #include "progdefs.h" -extern globalvars_t *gpGlobals; #endif int CL_IsDead( void ); @@ -781,9 +780,10 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) #if _WIN32 // update m_bRawInput occasionally: - if ( gpGlobals && gpGlobals->time - s_flRawInputUpdateTime > 1.0f ) + const float currentTime = gEngfuncs.GetClientTime(); + if ( currentTime - s_flRawInputUpdateTime > 1.0f || s_flRawInputUpdateTime == 0.0f ) { - s_flRawInputUpdateTime = gpGlobals->time; + s_flRawInputUpdateTime = currentTime; bool lockEntered = MouseThread_ActiveLock_Enter(); From e0279920c7bf32b9a67c6c383cff90a32a99d573 Mon Sep 17 00:00:00 2001 From: FreeSlave Date: Fri, 30 Dec 2022 13:14:00 +0300 Subject: [PATCH 287/298] Access m_rawinput cvar via pointer instead of CVAR_GET_FLOAT --- cl_dll/input_goldsource.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index a11d26b1..615cb3d6 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -150,6 +150,7 @@ extern cvar_t *cl_pitchspeed; extern cvar_t *cl_movespeedkey; #if _WIN32 +static cvar_t* m_rawinput = NULL; static double s_flRawInputUpdateTime = 0.0f; static bool m_bRawInput = false; static bool m_bMouseThread = false; @@ -385,7 +386,7 @@ void IN_SetMouseMode(bool enable) if (mouseparmsvalid) restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0); - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_bRawInput = m_rawinput->value != 0; if(m_bRawInput) { #if USE_SDL2 @@ -787,7 +788,7 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) bool lockEntered = MouseThread_ActiveLock_Enter(); - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_bRawInput = m_rawinput->value != 0; if(m_bRawInput && !isMouseRelative) { @@ -1571,7 +1572,8 @@ void GoldSourceInput::IN_Init (void) m_customaccel_exponent = gEngfuncs.pfnRegisterVariable ( "m_customaccel_exponent", "1", FCVAR_ARCHIVE ); #if _WIN32 - m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) != 0; + m_rawinput = gEngfuncs.pfnGetCvarPointer("m_rawinput"); + m_bRawInput = m_rawinput->value != 0; m_bMouseThread = gEngfuncs.CheckParm ("-mousethread", NULL ) != NULL; m_mousethread_sleep = gEngfuncs.pfnRegisterVariable ( "m_mousethread_sleep", "1", FCVAR_ARCHIVE ); // default to less than 1000 Hz From eceb28a304db24b7a5292d72755bfbac6f8b3959 Mon Sep 17 00:00:00 2001 From: Bohdan Shulyar Date: Mon, 9 Jan 2023 17:03:07 +0200 Subject: [PATCH 288/298] Remove useless macro from weapons.h (#352) --- dlls/weapons.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/weapons.h b/dlls/weapons.h index 889e0c5a..46e88edb 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -122,7 +122,6 @@ public: #define GLOCK_MAX_CLIP 17 #define PYTHON_MAX_CLIP 6 #define MP5_MAX_CLIP 50 -#define MP5_DEFAULT_AMMO 25 #define SHOTGUN_MAX_CLIP 8 #define CROSSBOW_MAX_CLIP 5 #define RPG_MAX_CLIP 1 @@ -138,7 +137,6 @@ public: #define GLOCK_DEFAULT_GIVE 17 #define PYTHON_DEFAULT_GIVE 6 #define MP5_DEFAULT_GIVE 25 -#define MP5_DEFAULT_AMMO 25 #define MP5_M203_DEFAULT_GIVE 0 #define SHOTGUN_DEFAULT_GIVE 12 #define CROSSBOW_DEFAULT_GIVE 5 From d32df8082288c5b7ae4d51c8f3adb2e9468e3b9a Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sun, 5 Feb 2023 01:59:50 +0100 Subject: [PATCH 289/298] nswitch support --- cmake/LibraryNaming.cmake | 5 +- contrib/iZarif/premake5.lua | 2 +- contrib/iZarif/xash.lua | 2 +- public/build.h | 7 +- scripts/waifulib/library_naming.py | 5 +- scripts/waifulib/xcompile.py | 143 ++++++++++++++++++++++++++--- wscript | 11 ++- 7 files changed, 156 insertions(+), 19 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index c97c92f7..feae5b70 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -42,6 +42,7 @@ check_symbol_exists(XASH_SERENITY "build.h" XASH_SERENITY) 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) +check_symbol_exists(XASH_NSWITCH "build.h" XASH_NSWITCH) unset(CMAKE_REQUIRED_INCLUDES) # engine/common/build.c @@ -63,6 +64,8 @@ elseif(XASH_HAIKU) set(BUILDOS "haiku") elseif(XASH_SERENITY) set(BUILDOS "serenityos") +elseif(XASH_NSWITCH) + set(BUILDOS "nswitch") else() message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") endif() @@ -76,7 +79,7 @@ elseif(XASH_X86) set(BUILDARCH "i386") endif() elseif(XASH_ARM AND XASH_64BIT) - set(BUILDARCH "arm64") + set(BUILDARCH "aarch64") elseif(XASH_ARM) set(BUILDARCH "armv") if(XASH_ARMv8) diff --git a/contrib/iZarif/premake5.lua b/contrib/iZarif/premake5.lua index 91817da5..55e438ea 100644 --- a/contrib/iZarif/premake5.lua +++ b/contrib/iZarif/premake5.lua @@ -55,7 +55,7 @@ newoption{trigger = "lto", description = "Enable Link Time Optimization", defaul newoption{trigger = "arch", description = "Destination arch", default = xash.get_arch(), allowed = { {"amd64", ""}, {"x86", ""}, - {"arm64", ""}, + {"aarch64", ""}, {"armv8_32l", ""}, {"armv7l", ""}, {"armv6l", ""}, diff --git a/contrib/iZarif/xash.lua b/contrib/iZarif/xash.lua index 0388602d..a94febb3 100644 --- a/contrib/iZarif/xash.lua +++ b/contrib/iZarif/xash.lua @@ -89,7 +89,7 @@ function m.get_arch() arch = "x86" elseif m.is_cxx_symbol_defined("XASH_ARM", {"build.h"}, {"public"}) then if m.is_cxx_symbol_defined("XASH_64BIT", {"build.h"}, {"public"}) then - arch = "arm64" + arch = "aarch64" else arch = "armv" diff --git a/public/build.h b/public/build.h index 5b6bcc36..521e4675 100644 --- a/public/build.h +++ b/public/build.h @@ -79,6 +79,7 @@ For more information, please refer to #undef XASH_WIN32 #undef XASH_WIN64 #undef XASH_X86 +#undef XASH_NSWITCH //================================================================ // @@ -96,6 +97,10 @@ For more information, please refer to #if defined(_WIN64) #define XASH_WIN64 1 #endif +#elif defined __SWITCH__ + #define XASH_NSWITCH 1 + #define XASH_LITTLE_ENDIAN 1 + #define XASH_POSIX 1 #elif defined(__linux__) #define XASH_LINUX 1 #if defined(__ANDROID__) @@ -134,7 +139,7 @@ For more information, please refer to #error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" #endif -#if defined XASH_ANDROID || defined XASH_IOS +#if defined XASH_ANDROID || defined XASH_IOS || defined XASH_NSWITCH #define XASH_MOBILE_PLATFORM 1 #endif diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index f3b9762a..de508625 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -61,6 +61,7 @@ DEFINES = [ 'XASH_WIN32', 'XASH_WIN64', 'XASH_X86', +'XASH_NSWITCH', ] def configure(conf): @@ -92,6 +93,8 @@ def configure(conf): buildos = "haiku" elif conf.env.XASH_SERENITY: buildos = "serenityos" + elif conf.env.XASH_NSWITCH: + buildos = "nswitch" 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") @@ -104,7 +107,7 @@ def configure(conf): else: buildarch = "i386" elif conf.env.XASH_ARM and conf.env.XASH_64BIT: - buildarch = "arm64" + buildarch = "aarch64" elif conf.env.XASH_ARM: buildarch = "armv" if conf.env.XASH_ARMv8: diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index b9ce398f..c39a08eb 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -30,6 +30,8 @@ ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16, 25: 19 } # minimal API le ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21 ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets +NSWITCH_ENVVARS = ['DEVKITPRO'] + # This class does support ONLY r10e and r19c/r20 NDK class Android: ctx = None # waf context @@ -348,14 +350,99 @@ class Android: ldflags += ['-march=armv5te'] return ldflags -def options(opt): - android = opt.add_option_group('Android options') - android.add_option('--android', action='store', dest='ANDROID_OPTS', default=None, - help='enable building for android, format: --android=,,, example: --android=armeabi-v7a-hard,4.9,9') +class NintendoSwitch: + ctx = None # waf context + arch = "aarch64" + dkp_dir = None + portlibs_dir = None + dka64_dir = None + libnx_dir = None - magx = opt.add_option_group('MotoMAGX options') - magx.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, - help = 'enable targetting for MotoMAGX phones [default: %default]') + def __init__(self, ctx): + self.ctx = ctx + + for i in NSWITCH_ENVVARS: + self.dkp_dir = os.getenv(i) + if self.dkp_dir != None: + break + else: + ctx.fatal('Set %s environment variable pointing to the DEVKITPRO home!' % + ' or '.join(NSWITCH_ENVVARS)) + + self.dkp_dir = os.path.abspath(self.dkp_dir) + + self.dka64_dir = os.path.join(self.dkp_dir, 'devkitA64') + if not os.path.exists(self.dka64_dir): + ctx.fatal('devkitA64 not found in `%s`. Install devkitA64!' % self.dka64_dir) + + self.libnx_dir = os.path.join(self.dkp_dir, 'libnx') + if not os.path.exists(self.libnx_dir): + ctx.fatal('libnx not found in `%s`. Install libnx!' % self.libnx_dir) + + self.portlibs_dir = os.path.join(self.dkp_dir, 'portlibs', 'switch') + if not os.path.exists(self.portlibs_dir): + ctx.fatal('No Switch libraries found in `%s`!' % self.portlibs_dir) + + def gen_toolchain_prefix(self): + return 'aarch64-none-elf-' + + def gen_gcc_toolchain_path(self): + return os.path.join(self.dka64_dir, 'bin', self.gen_toolchain_prefix()) + + def cc(self): + return self.gen_gcc_toolchain_path() + 'gcc' + + def cxx(self): + return self.gen_gcc_toolchain_path() + 'g++' + + def strip(self): + return self.gen_gcc_toolchain_path() + 'strip' + + def pkgconfig(self): + # counter-intuitively, this motherfucker is in portlibs/switch/bin + return os.path.join(self.portlibs_dir, 'bin', self.gen_toolchain_prefix() + 'pkg-config') + + def cflags(self, cxx = False): + cflags = [] + # arch flags + cflags += ['-D__SWITCH__', '-march=armv8-a+crc+crypto', '-mtune=cortex-a57', '-mtp=soft', '-ftls-model=local-exec', '-fPIE'] + # help the linker out + cflags += ['-ffunction-sections', '-fdata-sections'] + # base include dirs + cflags += ['-isystem %s/include' % self.libnx_dir, '-I%s/include' % self.portlibs_dir] + if cxx: + # while these are supported, they could fuck up the crappy dynamic linker + cflags += ['-fno-exceptions', '-fno-rtti'] + # the game wants GNU extensions + cflags += ['-std=gnu++17', '-D_GNU_SOURCE'] + else: + cflags += ['-std=gnu11', '-D_GNU_SOURCE'] + return cflags + + # they go before object list + def linkflags(self): + linkflags = ['-fPIE', '-specs=%s/switch.specs' % self.libnx_dir] + # libsolder only supports sysv hashes and we need to build everything with -rdynamic + linkflags += ['-Wl,--hash-style=sysv', '-rdynamic'] + # avoid pulling in and exposing mesa's internals, that crashes it for some god forsaken reason + linkflags += ['-Wl,--exclude-libs=libglapi.a', '-Wl,--exclude-libs=libdrm_nouveau.a'] + return linkflags + + def ldflags(self): + # system libraries implicitly require math and C++ standard library + ldflags = ['-lm', '-lstdc++'] + return ldflags + +def options(opt): + xc = opt.add_option_group('Cross compile options') + xc.add_option('--android', action='store', dest='ANDROID_OPTS', default=None, + help='enable building for android, format: --android=,,, example: --android=armeabi-v7a-hard,4.9,9') + xc.add_option('--enable-magx', action='store_true', dest='MAGX', default=False, + help='enable building for Motorola MAGX [default: %default]') + xc.add_option('--enable-msvc-wine', action='store_true', dest='MSVC_WINE', default=False, + help='enable building with MSVC using Wine [default: %default]') + xc.add_option('--nswitch', action='store_true', dest='NSWITCH', default = False, + help ='enable building for Nintendo Switch [default: %default]') def configure(conf): if conf.options.ANDROID_OPTS: @@ -389,18 +476,42 @@ def configure(conf): conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK/')) conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK/')) conf.msg('... ld flags', ' '.join(android.ldflags()).replace(android.ndk_home, '$NDK/')) - - # conf.env.ANDROID_OPTS = android - conf.env.DEST_OS2 = 'android' elif conf.options.MAGX: # useless to change toolchain path, as toolchain meant to be placed in this path toolchain_path = '/opt/toolchains/motomagx/arm-eabi2/lib/' conf.env.INCLUDES_MAGX = [toolchain_path + i for i in ['ezx-z6/include', 'qt-2.3.8/include']] conf.env.LIBPATH_MAGX = [toolchain_path + i for i in ['ezx-z6/lib', 'qt-2.3.8/lib']] conf.env.LINKFLAGS_MAGX = ['-Wl,-rpath-link=' + i for i in conf.env.LIBPATH_MAGX] + elif conf.options.MSVC_WINE: + try: + toolchain_path = conf.environ['MSVC_WINE_PATH'] + except KeyError: + conf.fatal('Set MSVC_WINE_PATH environment variable to the MSVC toolchain root!') + + conf.environ['CC'] = conf.environ['CXX'] = os.path.join(toolchain_path, 'bin', conf.env.MSVC_TARGETS[0], 'cl') + conf.environ['LINK_CXX'] = os.path.join(toolchain_path, 'bin', conf.env.MSVC_TARGETS[0], 'link') + conf.environ['AR'] = os.path.join(toolchain_path, 'bin', conf.env.MSVC_TARGETS[0], 'lib') + conf.environ['WINRC'] = os.path.join(toolchain_path, 'bin', conf.env.MSVC_TARGETS[0], 'rc') + conf.env.DEST_OS = 'win32' + conf.env.DEST_CPU = conf.env.MSVC_TARGETS[0] + conf.env.COMPILER_CXX = conf.env.COMPILER_CC = 'msvc' + elif conf.options.NSWITCH: + conf.nswitch = nswitch = NintendoSwitch(conf) + conf.environ['CC'] = nswitch.cc() + conf.environ['CXX'] = nswitch.cxx() + conf.environ['STRIP'] = nswitch.strip() + conf.env.PKGCONFIG = nswitch.pkgconfig() + conf.env.CFLAGS += nswitch.cflags() + conf.env.CXXFLAGS += nswitch.cflags(True) + conf.env.LINKFLAGS += nswitch.linkflags() + conf.env.LDFLAGS += nswitch.ldflags() + conf.env.HAVE_M = True + conf.env.LIB_M = ['m'] + conf.env.DEST_OS = 'nswitch' conf.env.MAGX = conf.options.MAGX - MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android' }) + conf.env.MSVC_WINE = conf.options.MSVC_WINE + MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android', '__SWITCH__' : 'nswitch' }) for k in c_config.MACRO_TO_DESTOS: MACRO_TO_DESTOS[k] = c_config.MACRO_TO_DESTOS[k] # ordering is important c_config.MACRO_TO_DESTOS = MACRO_TO_DESTOS @@ -433,11 +544,17 @@ compiler_cxx_configure = getattr(compiler_cxx, 'configure') compiler_c_configure = getattr(compiler_c, 'configure') def patch_compiler_cxx_configure(conf): - compiler_cxx_configure(conf) + if not conf.env.MSVC_WINE: + compiler_cxx_configure(conf) + else: + conf.load('msvc', funs='no_autodetect') post_compiler_cxx_configure(conf) def patch_compiler_c_configure(conf): - compiler_c_configure(conf) + if not conf.env.MSVC_WINE: + compiler_c_configure(conf) + else: + conf.load('msvc', funs='no_autodetect') post_compiler_c_configure(conf) setattr(compiler_cxx, 'configure', patch_compiler_cxx_configure) diff --git a/wscript b/wscript index c4f85fae..28f80df5 100644 --- a/wscript +++ b/wscript @@ -74,8 +74,10 @@ def configure(conf): conf.load('msvs msdev strip_on_install') if conf.env.DEST_OS == 'android': - conf.options.GOLDSRC = False + conf.options.GOLDSRC = conf.env.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified + elif conf.env.DEST_OS == 'nswitch': + conf.options.GOLDSRC = conf.env.GOLDSRC = False if conf.env.MAGX: enforce_pic = False @@ -148,6 +150,13 @@ def configure(conf): cflags += conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags) cxxflags += conf.filter_cxxflags(compiler_optional_flags, cflags) + # on the Switch, allow undefined symbols by default, which is needed for libsolder to work + # additionally, shared libs are linked without libc + if conf.env.DEST_OS == 'nswitch': + linkflags.remove('-Wl,--no-undefined') + conf.env.append_unique('LINKFLAGS_cshlib', ['-nostdlib', '-nostartfiles']) + conf.env.append_unique('LINKFLAGS_cxxshlib', ['-nostdlib', '-nostartfiles']) + conf.env.append_unique('CFLAGS', cflags) conf.env.append_unique('CXXFLAGS', cxxflags) conf.env.append_unique('LINKFLAGS', linkflags) From c6da23892ff5cd297e1cbf75d68b0f172245a94b Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 8 Feb 2023 00:53:45 +0100 Subject: [PATCH 290/298] nswitch: do not link libstdc++ to game libraries --- scripts/waifulib/xcompile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index c39a08eb..e407c603 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -429,8 +429,9 @@ class NintendoSwitch: return linkflags def ldflags(self): - # system libraries implicitly require math and C++ standard library - ldflags = ['-lm', '-lstdc++'] + # NOTE: shared libraries should be built without standard libs, so that they could import their contents from the NRO, + # but executables, including the SDL2 sanity check, will generally require libstdc++ and libm, which we will add manually + ldflags = [] # ['-lm', '-lstdc++'] return ldflags def options(opt): From b01237f698ea3bb5b61365dd1c5e439c49d5f3bd Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 8 Feb 2023 01:01:26 +0100 Subject: [PATCH 291/298] scripts: revert the arm64->aarch64 change --- cmake/LibraryNaming.cmake | 2 +- contrib/iZarif/premake5.lua | 2 +- contrib/iZarif/xash.lua | 2 +- scripts/waifulib/library_naming.py | 2 +- scripts/waifulib/xcompile.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index feae5b70..156ab672 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -79,7 +79,7 @@ elseif(XASH_X86) set(BUILDARCH "i386") endif() elseif(XASH_ARM AND XASH_64BIT) - set(BUILDARCH "aarch64") + set(BUILDARCH "arm64") elseif(XASH_ARM) set(BUILDARCH "armv") if(XASH_ARMv8) diff --git a/contrib/iZarif/premake5.lua b/contrib/iZarif/premake5.lua index 55e438ea..91817da5 100644 --- a/contrib/iZarif/premake5.lua +++ b/contrib/iZarif/premake5.lua @@ -55,7 +55,7 @@ newoption{trigger = "lto", description = "Enable Link Time Optimization", defaul newoption{trigger = "arch", description = "Destination arch", default = xash.get_arch(), allowed = { {"amd64", ""}, {"x86", ""}, - {"aarch64", ""}, + {"arm64", ""}, {"armv8_32l", ""}, {"armv7l", ""}, {"armv6l", ""}, diff --git a/contrib/iZarif/xash.lua b/contrib/iZarif/xash.lua index a94febb3..0388602d 100644 --- a/contrib/iZarif/xash.lua +++ b/contrib/iZarif/xash.lua @@ -89,7 +89,7 @@ function m.get_arch() arch = "x86" elseif m.is_cxx_symbol_defined("XASH_ARM", {"build.h"}, {"public"}) then if m.is_cxx_symbol_defined("XASH_64BIT", {"build.h"}, {"public"}) then - arch = "aarch64" + arch = "arm64" else arch = "armv" diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index de508625..3709bc76 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -107,7 +107,7 @@ def configure(conf): else: buildarch = "i386" elif conf.env.XASH_ARM and conf.env.XASH_64BIT: - buildarch = "aarch64" + buildarch = "arm64" elif conf.env.XASH_ARM: buildarch = "armv" if conf.env.XASH_ARMv8: diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index e407c603..51d8ec87 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -352,7 +352,7 @@ class Android: class NintendoSwitch: ctx = None # waf context - arch = "aarch64" + arch = "arm64" dkp_dir = None portlibs_dir = None dka64_dir = None From 0c1868f17e14dfd4cd7e7d40b8eaf1adba4f7c90 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 8 Feb 2023 19:39:29 +0100 Subject: [PATCH 292/298] readme: include nswitch build instructions --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 3f7e36a6..6bd77f0e 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,39 @@ schroot --chroot jessie -- cmake --build build-in-chroot TODO +## Nintendo Switch + +### Prerequisites + +1. Set up [`dkp-pacman`](https://devkitpro.org/wiki/devkitPro_pacman). +2. Install dependency packages: +``` +sudo dkp-pacman -S switch-dev dkp-toolchain-vars switch-mesa switch-libdrm_nouveau switch-sdl2 +``` +3. Make sure the `DEVKITPRO` environment variable is set to the devkitPro SDK root: +``` +export DEVKITPRO=/opt/devkitpro +``` +4. Install libsolder: +``` +source $DEVKITPRO/switchvars.sh +git clone https://github.com/fgsfdsfgs/libsolder.git +make -C libsolder install +``` + +### Building using CMake +``` +mkdir build && cd build +aarch64-none-elf-cmake -G"Unix Makefiles" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE="$DEVKITPRO/portlibs/switch/share/SolderShim.cmake" .. +make -j +``` + +### Building using waf +``` +./waf configure -T release --nswitch +./waf build +``` + ## Other platforms Building on other Unix-like platforms (e.g. FreeBSD) is supported. From d11f853464ee5d951e25ce9d0eea001780b92196 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:42:23 +0500 Subject: [PATCH 293/298] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6bd77f0e..8797f054 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ git clone --recursive https://github.com/FWGS/hlsdk-portable # Build Instructions -## Windows +## Windows x86. ### Prerequisites @@ -131,7 +131,7 @@ cmake -G "Visual Studio 16 2019" -A Win32 -B build After the configuration step, `HLSDK-PORTABLE.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there. -## Windows. Using Microsoft Visual Studio 6 +## Windows x86. Using Microsoft Visual Studio 6 Microsoft Visual Studio 6 is very old, but if you still have it installed, you can use it to build this hlsdk. There are no project files, but two `.bat` files, for server and client libraries. They require variable **MSVCDir** to be set to the installation path of Visual Studio: @@ -142,7 +142,7 @@ cd dlls && compile.bat && cd ../cl_dll && compile.bat `hl.dll` and `client.dll` will appear in `dlls/` and `cl_dll/` diretories. The libraries built with msvc6 should be compatible with Windows XP. -## Linux. Using Steam Runtime in chroot +## Linux x86. Portable steam-compatible build using Steam Runtime in chroot ### Prerequisites @@ -168,7 +168,7 @@ schroot --chroot steamrt_scout_i386 -- cmake -B build-in-steamrt -S . schroot --chroot steamrt_scout_i386 -- cmake --build build-in-steamrt ``` -## Linux. Build without Steam Runtime +## Linux x86. Portable steam-compatible build without Steam Runtime ### Prerequisites @@ -190,7 +190,7 @@ cmake .. -DCMAKE_C_FLAGS="-static-libstdc++ -static-libgcc" ``` To ensure portability it's still better to build using Steam Runtime or another chroot of some older distro. -## Linux. Build in your own chroot +## Linux x86. Portable steam-compatible build in your own chroot ### Prerequisites @@ -272,11 +272,11 @@ make -j ## Other platforms -Building on other Unix-like platforms (e.g. FreeBSD) is supported. +Building on other architectures (e.g x86_64 or arm) and POSIX-compliant OSes (e.g. FreeBSD) is supported. ### Prerequisites -Install C and C++ compilers (like gcc or clang), cmake and make (or gmake) +Install C and C++ compilers (like gcc or clang), cmake and make. ### Building From fa2925482818517fa8cb0b7948bf470c378491e3 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 25 Feb 2023 22:44:58 +0100 Subject: [PATCH 294/298] psvita support --- cmake/LibraryNaming.cmake | 3 + public/build.h | 7 +- scripts/waifulib/compiler_optimizations.py | 28 +++++-- scripts/waifulib/library_naming.py | 3 + scripts/waifulib/xcompile.py | 96 ++++++++++++++++++++-- wscript | 11 ++- 6 files changed, 132 insertions(+), 16 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 156ab672..3c2b8968 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -43,6 +43,7 @@ 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) check_symbol_exists(XASH_NSWITCH "build.h" XASH_NSWITCH) +check_symbol_exists(XASH_PSVITA "build.h" XASH_PSVITA) unset(CMAKE_REQUIRED_INCLUDES) # engine/common/build.c @@ -66,6 +67,8 @@ elseif(XASH_SERENITY) set(BUILDOS "serenityos") elseif(XASH_NSWITCH) set(BUILDOS "nswitch") +elseif(XASH_PSVITA) + set(BUILDOS "psvita") else() message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") endif() diff --git a/public/build.h b/public/build.h index 521e4675..4e4fe110 100644 --- a/public/build.h +++ b/public/build.h @@ -80,6 +80,7 @@ For more information, please refer to #undef XASH_WIN64 #undef XASH_X86 #undef XASH_NSWITCH +#undef XASH_PSVITA //================================================================ // @@ -101,6 +102,10 @@ For more information, please refer to #define XASH_NSWITCH 1 #define XASH_LITTLE_ENDIAN 1 #define XASH_POSIX 1 +#elif defined __vita__ + #define XASH_PSVITA 1 + #define XASH_LITTLE_ENDIAN 1 + #define XASH_POSIX 1 #elif defined(__linux__) #define XASH_LINUX 1 #if defined(__ANDROID__) @@ -139,7 +144,7 @@ For more information, please refer to #error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" #endif -#if defined XASH_ANDROID || defined XASH_IOS || defined XASH_NSWITCH +#if defined XASH_ANDROID || defined XASH_IOS || defined XASH_NSWITCH || defined XASH_PSVITA #define XASH_MOBILE_PLATFORM 1 #endif diff --git a/scripts/waifulib/compiler_optimizations.py b/scripts/waifulib/compiler_optimizations.py index e964c812..688c6f55 100644 --- a/scripts/waifulib/compiler_optimizations.py +++ b/scripts/waifulib/compiler_optimizations.py @@ -30,7 +30,7 @@ compiler_optimizations.CFLAGS['gottagofast'] = { } ''' -VALID_BUILD_TYPES = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] +VALID_BUILD_TYPES = ['fastnative', 'fast', 'release', 'debug', 'sanitize', 'msan', 'none'] LINKFLAGS = { 'common': { @@ -38,9 +38,14 @@ LINKFLAGS = { 'gcc': ['-Wl,--no-undefined'], 'owcc': ['-Wl,option stack=512k'] }, + 'msan': { + 'clang': ['-fsanitize=memory', '-pthread'], + 'default': ['NO_MSAN_HERE'] + }, 'sanitize': { 'clang': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'], 'gcc': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'], + 'msvc': ['/SAFESEH:NO'] }, 'debug': { 'msvc': ['/INCREMENTAL', '/SAFESEH:NO'] @@ -50,7 +55,7 @@ LINKFLAGS = { CFLAGS = { 'common': { # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP - 'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT', '/MP', '/Zc:__cplusplus'], 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden', '-fno-threadsafe-statics'], 'gcc': ['-g', '-fvisibility=hidden'], 'owcc': ['-fno-short-enum', '-ffloat-store', '-g3'] @@ -80,16 +85,16 @@ CFLAGS = { 'owcc': ['-O0', '-fno-omit-frame-pointer', '-funwind-tables', '-fno-omit-leaf-frame-pointer'], 'default': ['-O0'] }, + 'msan': { + 'clang': ['-O2', '-g', '-fno-omit-frame-pointer', '-fsanitize=memory', '-pthread'], + 'default': ['NO_MSAN_HERE'] + }, 'sanitize': { - 'msvc': ['/Od', '/RTC1', '/Zi'], - 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address', '-pthread'], + 'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'], + 'gcc': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'], 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'], 'default': ['-O0'] }, - 'nooptimize': { - 'msvc': ['/Od', '/Zi'], - 'default': ['-O0'] - } } LTO_CFLAGS = { @@ -164,4 +169,11 @@ def get_optimization_flags(conf): if conf.options.POLLY: cflags += conf.get_flags_by_compiler(POLLY_CFLAGS, conf.env.COMPILER_CC) + if conf.env.DEST_OS == 'nswitch' and conf.options.BUILD_TYPE == 'debug': + # enable remote debugger + cflags.append('-DNSWITCH_DEBUG') + elif conf.env.DEST_OS == 'psvita': + # this optimization is broken in vitasdk + cflags.append('-fno-optimize-sibling-calls') + return cflags, linkflags diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 3709bc76..b8985c92 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -62,6 +62,7 @@ DEFINES = [ 'XASH_WIN64', 'XASH_X86', 'XASH_NSWITCH', +'XASH_PSVITA', ] def configure(conf): @@ -95,6 +96,8 @@ def configure(conf): buildos = "serenityos" elif conf.env.XASH_NSWITCH: buildos = "nswitch" + elif conf.env.XASH_PSVITA: + buildos = "psvita" 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") diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 51d8ec87..483ef2b3 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -32,6 +32,8 @@ ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets NSWITCH_ENVVARS = ['DEVKITPRO'] +PSVITA_ENVVARS = ['VITASDK'] + # This class does support ONLY r10e and r19c/r20 NDK class Android: ctx = None # waf context @@ -399,7 +401,7 @@ class NintendoSwitch: return self.gen_gcc_toolchain_path() + 'strip' def pkgconfig(self): - # counter-intuitively, this motherfucker is in portlibs/switch/bin + # counter-intuitively, this motherfucker is in $DEVKITPRO/portlibs/switch/bin return os.path.join(self.portlibs_dir, 'bin', self.gen_toolchain_prefix() + 'pkg-config') def cflags(self, cxx = False): @@ -410,10 +412,8 @@ class NintendoSwitch: cflags += ['-ffunction-sections', '-fdata-sections'] # base include dirs cflags += ['-isystem %s/include' % self.libnx_dir, '-I%s/include' % self.portlibs_dir] + # the game wants GNU extensions if cxx: - # while these are supported, they could fuck up the crappy dynamic linker - cflags += ['-fno-exceptions', '-fno-rtti'] - # the game wants GNU extensions cflags += ['-std=gnu++17', '-D_GNU_SOURCE'] else: cflags += ['-std=gnu11', '-D_GNU_SOURCE'] @@ -434,6 +434,75 @@ class NintendoSwitch: ldflags = [] # ['-lm', '-lstdc++'] return ldflags +class PSVita: + ctx = None # waf context + arch ='armeabi-v7a-hard' + vitasdk_dir = None + + def __init__(self, ctx): + self.ctx = ctx + + for i in PSVITA_ENVVARS: + self.vitasdk_dir = os.getenv(i) + if self.vitasdk_dir != None: + break + else: + ctx.fatal('Set %s environment variable pointing to the VitaSDK directory!' % + ' or '.join(PSVITA_ENVVARS)) + + def gen_toolchain_prefix(self): + return 'arm-vita-eabi-' + + def gen_gcc_toolchain_path(self): + return os.path.join(self.vitasdk_dir, 'bin', self.gen_toolchain_prefix()) + + def cc(self): + return self.gen_gcc_toolchain_path() + 'gcc' + + def cxx(self): + return self.gen_gcc_toolchain_path() + 'g++' + + def strip(self): + return self.gen_gcc_toolchain_path() + 'strip' + + def ar(self): + return self.gen_gcc_toolchain_path() + 'ar' + + def pkgconfig(self): + return self.gen_gcc_toolchain_path() + 'pkg-config' + + def cflags(self, cxx = False): + cflags = [] + # arch flags + cflags += ['-D__vita__', '-mtune=cortex-a9', '-mfpu=neon'] + # necessary linker flags + cflags += ['-Wl,-q', '-Wl,-z,nocopyreloc'] + # this optimization is broken in vitasdk + cflags += ['-fno-optimize-sibling-calls'] + # disable some ARM bullshit + cflags += ['-fsigned-char', '-fno-short-enums', '-Wno-attributes'] + # base include dir + cflags += ['-isystem %s/arm-vita-eabi/include' % self.vitasdk_dir] + # SDL include dir + cflags += ['-I%s/arm-vita-eabi/include/SDL2' % self.vitasdk_dir] + # the game wants GNU extensions + if cxx: + cflags += ['-std=gnu++17', '-D_GNU_SOURCE'] + else: + cflags += ['-std=gnu11', '-D_GNU_SOURCE'] + return cflags + + # they go before object list + def linkflags(self): + linkflags = ['-Wl,--hash-style=sysv', '-Wl,-q', '-Wl,-z,nocopyreloc', '-mtune=cortex-a9', '-mfpu=neon'] + # enforce no-short-enums again + linkflags += ['-Wl,-no-enum-size-warning', '-fno-short-enums'] + return linkflags + + def ldflags(self): + ldflags = [] + return ldflags + def options(opt): xc = opt.add_option_group('Cross compile options') xc.add_option('--android', action='store', dest='ANDROID_OPTS', default=None, @@ -444,6 +513,8 @@ def options(opt): help='enable building with MSVC using Wine [default: %default]') xc.add_option('--nswitch', action='store_true', dest='NSWITCH', default = False, help ='enable building for Nintendo Switch [default: %default]') + xc.add_option('--psvita', action='store_true', dest='PSVITA', default = False, + help ='enable building for PlayStation Vita [default: %default]') def configure(conf): if conf.options.ANDROID_OPTS: @@ -509,10 +580,25 @@ def configure(conf): conf.env.HAVE_M = True conf.env.LIB_M = ['m'] conf.env.DEST_OS = 'nswitch' + elif conf.options.PSVITA: + conf.psvita = psvita = PSVita(conf) + conf.environ['CC'] = psvita.cc() + conf.environ['CXX'] = psvita.cxx() + conf.environ['STRIP'] = psvita.strip() + conf.environ['AR'] = psvita.ar() + conf.env.PKGCONFIG = psvita.pkgconfig() + conf.env.CFLAGS += psvita.cflags() + conf.env.CXXFLAGS += psvita.cflags(True) + conf.env.LINKFLAGS += psvita.linkflags() + conf.env.LDFLAGS += psvita.ldflags() + conf.env.HAVE_M = True + conf.env.LIB_M = ['m'] + conf.env.VRTLD = ['vrtld'] + conf.env.DEST_OS = 'psvita' conf.env.MAGX = conf.options.MAGX conf.env.MSVC_WINE = conf.options.MSVC_WINE - MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android', '__SWITCH__' : 'nswitch' }) + MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android', '__SWITCH__' : 'nswitch', '__vita__' : 'psvita' }) for k in c_config.MACRO_TO_DESTOS: MACRO_TO_DESTOS[k] = c_config.MACRO_TO_DESTOS[k] # ordering is important c_config.MACRO_TO_DESTOS = MACRO_TO_DESTOS diff --git a/wscript b/wscript index 28f80df5..f125a186 100644 --- a/wscript +++ b/wscript @@ -76,7 +76,7 @@ def configure(conf): if conf.env.DEST_OS == 'android': conf.options.GOLDSRC = conf.env.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified - elif conf.env.DEST_OS == 'nswitch': + elif conf.env.DEST_OS in ['nswitch', 'psvita']: conf.options.GOLDSRC = conf.env.GOLDSRC = False if conf.env.MAGX: @@ -150,12 +150,19 @@ def configure(conf): cflags += conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags) cxxflags += conf.filter_cxxflags(compiler_optional_flags, cflags) - # on the Switch, allow undefined symbols by default, which is needed for libsolder to work + # on the Switch and the PSVita, allow undefined symbols by default, + # which is needed for the dynamic loaders to work # additionally, shared libs are linked without libc if conf.env.DEST_OS == 'nswitch': linkflags.remove('-Wl,--no-undefined') conf.env.append_unique('LINKFLAGS_cshlib', ['-nostdlib', '-nostartfiles']) conf.env.append_unique('LINKFLAGS_cxxshlib', ['-nostdlib', '-nostartfiles']) + elif conf.env.DEST_OS == 'psvita': + linkflags.remove('-Wl,--no-undefined') + conf.env.append_unique('CFLAGS_cshlib', ['-fPIC']) + conf.env.append_unique('CXXFLAGS_cxxshlib', ['-fPIC', '-fno-use-cxa-atexit']) + conf.env.append_unique('LINKFLAGS_cshlib', ['-nostdlib', '-Wl,--unresolved-symbols=ignore-all']) + conf.env.append_unique('LINKFLAGS_cxxshlib', ['-nostdlib', '-Wl,--unresolved-symbols=ignore-all']) conf.env.append_unique('CFLAGS', cflags) conf.env.append_unique('CXXFLAGS', cxxflags) From ad6fb5fe075667fcb5c2cb907898420e9a4827d6 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 2 Mar 2023 17:09:09 +0300 Subject: [PATCH 295/298] Fix crash on older GoldSource versions that didn't have m_rawinput cvar (#357) --- cl_dll/input_goldsource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index 615cb3d6..89408423 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -386,7 +386,7 @@ void IN_SetMouseMode(bool enable) if (mouseparmsvalid) restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0); - m_bRawInput = m_rawinput->value != 0; + m_bRawInput = m_rawinput && m_rawinput->value != 0; if(m_bRawInput) { #if USE_SDL2 @@ -788,7 +788,7 @@ void GoldSourceInput::IN_GetMouseDelta( int *pOutX, int *pOutY) bool lockEntered = MouseThread_ActiveLock_Enter(); - m_bRawInput = m_rawinput->value != 0; + m_bRawInput = m_rawinput && m_rawinput->value != 0; if(m_bRawInput && !isMouseRelative) { @@ -1573,7 +1573,7 @@ void GoldSourceInput::IN_Init (void) #if _WIN32 m_rawinput = gEngfuncs.pfnGetCvarPointer("m_rawinput"); - m_bRawInput = m_rawinput->value != 0; + m_bRawInput = m_rawinput && m_rawinput->value != 0; m_bMouseThread = gEngfuncs.CheckParm ("-mousethread", NULL ) != NULL; m_mousethread_sleep = gEngfuncs.pfnRegisterVariable ( "m_mousethread_sleep", "1", FCVAR_ARCHIVE ); // default to less than 1000 Hz From a98ed47403202007abea0e91f97da863f7f413f1 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 9 Mar 2023 15:42:16 +0100 Subject: [PATCH 296/298] cmake: fix psvita builds --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d0a981..add3771f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,10 @@ else() add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H) endif() +if(VITA) + add_compile_options(-fno-use-cxa-atexit) +endif() + check_include_file("tgmath.h" HAVE_TGMATH_H) if(HAVE_TGMATH_H) if(NOT MSVC) From 6b43f5af255eb93579928bafdba08d7fb84bfbc5 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 9 Mar 2023 18:38:13 +0100 Subject: [PATCH 297/298] scripts: waf: psvita: remove fsigned-char and GNU_SOURCE --- scripts/waifulib/xcompile.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 483ef2b3..08e90228 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -480,16 +480,11 @@ class PSVita: # this optimization is broken in vitasdk cflags += ['-fno-optimize-sibling-calls'] # disable some ARM bullshit - cflags += ['-fsigned-char', '-fno-short-enums', '-Wno-attributes'] + cflags += ['-fno-short-enums', '-Wno-attributes'] # base include dir cflags += ['-isystem %s/arm-vita-eabi/include' % self.vitasdk_dir] # SDL include dir cflags += ['-I%s/arm-vita-eabi/include/SDL2' % self.vitasdk_dir] - # the game wants GNU extensions - if cxx: - cflags += ['-std=gnu++17', '-D_GNU_SOURCE'] - else: - cflags += ['-std=gnu11', '-D_GNU_SOURCE'] return cflags # they go before object list From b351c7ac5dd7e7fec441c056592ac09191dd2a7f Mon Sep 17 00:00:00 2001 From: fgsfds Date: Fri, 10 Mar 2023 23:11:25 +0100 Subject: [PATCH 298/298] docs: add psvita instructions to README --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 8797f054..e1fbcccf 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,32 @@ make -j ./waf build ``` +## PlayStation Vita + +### Prerequisites + +1. Set up [VitaSDK](https://vitasdk.org/). +2. Install [vita-rtld](https://github.com/fgsfdsfgs/vita-rtld): + ``` + git clone https://github.com/fgsfdsfgs/vita-rtld.git && cd vita-rtld + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 install + ``` + +### Building with waf: +``` +./waf configure -T release --psvita +./waf build +``` + +### Building with CMake: +``` +mkdir build && cd build +cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="$VITASDK/share/vita.toolchain.cmake" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE="$VITASDK/share/vrtld_shim.cmake" .. +make -j +``` + ## Other platforms Building on other architectures (e.g x86_64 or arm) and POSIX-compliant OSes (e.g. FreeBSD) is supported.