diff --git a/rehlds/HLTV/DemoPlayer/msvc/DemoPlayer.vcxproj b/rehlds/HLTV/DemoPlayer/msvc/DemoPlayer.vcxproj
index 022084d..8a6bd55 100644
--- a/rehlds/HLTV/DemoPlayer/msvc/DemoPlayer.vcxproj
+++ b/rehlds/HLTV/DemoPlayer/msvc/DemoPlayer.vcxproj
@@ -155,7 +155,7 @@
MaxSpeed
true
true
- HOOK_HLTV;HLTV;WIN32;NDEBUG;_WINDOWS;_USRDLL;DEMOPLAYER_MODULE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitiHOOons)
+ HLTV;WIN32;NDEBUG;_WINDOWS;_USRDLL;DEMOPLAYER_MODULE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitiHOOons)
precompiled.h
$(ProjectDir)\..\src;$(ProjectDir)\..\..\;$(ProjectDir)\..\..\..\;$(ProjectDir)\..\..\..\common;$(ProjectDir)\..\..\..\engine;$(ProjectDir)\..\..\..\public;$(ProjectDir)\..\..\..\public\rehlds;$(ProjectDir)\..\..\..\pm_shared;%(AdditionalIncludeDirectories)
MultiThreaded
diff --git a/rehlds/HLTV/DemoPlayer/src/DemoPlayer.h b/rehlds/HLTV/DemoPlayer/src/DemoPlayer.h
index cdb4ce1..8cdd2df 100644
--- a/rehlds/HLTV/DemoPlayer/src/DemoPlayer.h
+++ b/rehlds/HLTV/DemoPlayer/src/DemoPlayer.h
@@ -35,7 +35,7 @@
#include "vmodes.h"
#include "cdll_int.h"
#include "IDemoPlayer.h"
-#include "IEngineWrapper.h"
+#include "IEngineWrapperEx.h"
#include "BaseSystemModule.h"
#include "ObjectDictionary.h"
diff --git a/rehlds/HLTV/DemoPlayer/src/IEngineWrapperEx.h b/rehlds/HLTV/DemoPlayer/src/IEngineWrapperEx.h
new file mode 100644
index 0000000..5babe3b
--- /dev/null
+++ b/rehlds/HLTV/DemoPlayer/src/IEngineWrapperEx.h
@@ -0,0 +1,77 @@
+/*
+*
+* 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
+*
+* In addition, as a special exception, the author gives permission to
+* link the code of this program with the Half-Life Game Engine ("HL
+* Engine") and Modified Game Libraries ("MODs") developed by Valve,
+* L.L.C ("Valve"). You must obey the GNU General Public License in all
+* respects for all of the code used other than the HL Engine and MODs
+* from Valve. If you modify this file, you may extend this exception
+* to your version of the file, but you are not obligated to do so. If
+* you do not wish to do so, delete this exception statement from your
+* version.
+*
+*/
+
+#pragma once
+
+#include "event_args.h"
+#include "vmodes.h"
+#include "cdll_int.h"
+
+class IBaseSystem;
+class ISystemModule;
+
+// TODO: common/IEngineWrapper.h
+class IEngineWrapperEx {
+public:
+ virtual ~IEngineWrapperEx() {}
+
+ virtual bool Init(IBaseSystem *system, int serial, char *name) = 0;
+ virtual void RunFrame(double time) = 0;
+ virtual void ReceiveSignal(ISystemModule *module, unsigned int signal, void *data) = 0;
+ virtual void ExecuteCommand(int commandID, char *commandLine) = 0;
+ virtual void RegisterListener(ISystemModule *module) = 0;
+ virtual void RemoveListener(ISystemModule *module) = 0;
+
+ virtual IBaseSystem *GetSystem() = 0;
+
+ virtual int GetSerial() = 0;
+ virtual char *GetStatusLine() = 0;
+ virtual char *GetType() = 0;
+ virtual char *GetName() = 0;
+
+ virtual int GetState() = 0;
+ virtual int GetVersion() = 0;
+ virtual void ShutDown() = 0;
+
+ virtual bool GetViewOrigin(float *origin) = 0;
+ virtual bool GetViewAngles(float *angles) = 0;
+ virtual int GetTraceEntity() = 0;
+ virtual float GetCvarFloat(char *szName) = 0;
+ virtual char *GetCvarString(char *szName) = 0;
+ virtual void SetCvar(char *szName, char *szValue) = 0;
+ virtual void Cbuf_AddText(char *text) = 0;
+ virtual void DemoUpdateClientData(client_data_t *cdat) = 0;
+ virtual void CL_QueueEvent(int flags, int index, float delay, event_args_t *pargs) = 0;
+ virtual void HudWeaponAnim(int iAnim, int body) = 0;
+ virtual void CL_DemoPlaySound(int channel, char *sample, float attenuation, float volume, int flags, int pitch) = 0;
+ virtual void ClientDLL_ReadDemoBuffer(int size, unsigned char *buffer) = 0;
+};
+
+using IEngineWrapper = IEngineWrapperEx;
+
+#define ENGINEWRAPPER_INTERFACE_VERSION "enginewrapper001"
diff --git a/rehlds/build.gradle b/rehlds/build.gradle
index 9cd8b09..4a4cc16 100644
--- a/rehlds/build.gradle
+++ b/rehlds/build.gradle
@@ -166,7 +166,7 @@ void setupToolchain(NativeBinarySpec b) {
if (useGcc) {
// Produce code optimized for the most common IA32/AMD64/EM64T processors.
// As new processors are deployed in the marketplace, the behavior of this option will change.
- cfg.compilerOptions.args '-mtune=generic', '-Wno-write-strings'
+ cfg.compilerOptions.args '-mtune=generic', '-Wno-write-strings', '-msse3'
} else {
cfg.compilerOptions.args '-Qoption,cpp,--treat_func_as_string_literal_cpp', '-fno-rtti'
}
diff --git a/rehlds/common/IEngineWrapper.h b/rehlds/common/IEngineWrapper.h
index c43baa3..0a58d4c 100644
--- a/rehlds/common/IEngineWrapper.h
+++ b/rehlds/common/IEngineWrapper.h
@@ -35,28 +35,10 @@
class IBaseSystem;
class ISystemModule;
-class IEngineWrapper {
+class IEngineWrapper: virtual public ISystemModule {
public:
virtual ~IEngineWrapper() {}
- virtual bool Init(IBaseSystem *system, int serial, char *name) = 0;
- virtual void RunFrame(double time) = 0;
- virtual void ReceiveSignal(ISystemModule *module, unsigned int signal, void *data) = 0;
- virtual void ExecuteCommand(int commandID, char *commandLine) = 0;
- virtual void RegisterListener(ISystemModule *module) = 0;
- virtual void RemoveListener(ISystemModule *module) = 0;
-
- virtual IBaseSystem *GetSystem() = 0;
-
- virtual int GetSerial() = 0;
- virtual char *GetStatusLine() = 0;
- virtual char *GetType() = 0;
- virtual char *GetName() = 0;
-
- virtual int GetState() = 0;
- virtual int GetVersion() = 0;
- virtual void ShutDown() = 0;
-
virtual bool GetViewOrigin(float *origin) = 0;
virtual bool GetViewAngles(float *angles) = 0;
virtual int GetTraceEntity() = 0;
diff --git a/rehlds/engine/mathlib.cpp b/rehlds/engine/mathlib.cpp
index 7f44e63..107c3cd 100644
--- a/rehlds/engine/mathlib.cpp
+++ b/rehlds/engine/mathlib.cpp
@@ -81,6 +81,7 @@ inline void xmm2vec(vec_t *v, const __m128 m)
_mm_store_ss(v + 2, _mm_shuffle_ps(m, m, 0x02));
}
+FUNC_TARGET("sse4.1")
inline __m128 dotProduct3D(__m128 v1, __m128 v2)
{
if (cpuinfo.sse4_1)
diff --git a/rehlds/public/rehlds/crc32c.cpp b/rehlds/public/rehlds/crc32c.cpp
index ac33355..669fc81 100644
--- a/rehlds/public/rehlds/crc32c.cpp
+++ b/rehlds/public/rehlds/crc32c.cpp
@@ -115,10 +115,12 @@ uint32 crc32c_t_nosse(uint32 iCRC, const uint8 *buf, int len) {
return crc;
}
+FUNC_TARGET("sse4.2")
uint32 crc32c_t8_sse(uint32 iCRC, uint8 u8) {
return _mm_crc32_u8(iCRC, u8);
}
+FUNC_TARGET("sse4.2")
uint32 crc32c_t_sse(uint32 iCRC, const uint8 *buf, unsigned int len) {
uint32 crc32cval = iCRC;
unsigned int i = 0;
diff --git a/rehlds/public/rehlds/osconfig.h b/rehlds/public/rehlds/osconfig.h
index db7a0f5..0e31743 100644
--- a/rehlds/public/rehlds/osconfig.h
+++ b/rehlds/public/rehlds/osconfig.h
@@ -111,6 +111,7 @@
#define ALIGN16 __declspec(align(16))
#define NORETURN __declspec(noreturn)
#define FORCE_STACK_ALIGN
+ #define FUNC_TARGET(x)
#define __builtin_bswap16 _byteswap_ushort
#define __builtin_bswap32 _byteswap_ulong
@@ -160,9 +161,13 @@
#define FORCE_STACK_ALIGN __attribute__((force_align_arg_pointer))
#if defined __INTEL_COMPILER
+ #define FUNC_TARGET(x)
+
#define __builtin_bswap16 _bswap16
#define __builtin_bswap32 _bswap
#define __builtin_bswap64 _bswap64
+#else
+ #define FUNC_TARGET(x) __attribute__((target(x)))
#endif // __INTEL_COMPILER
//inline bool SOCKET_FIONBIO(SOCKET s, int m) { return (ioctl(s, FIONBIO, (int*)&m) == 0); }
diff --git a/rehlds/public/strtools.h b/rehlds/public/strtools.h
index e856681..60784ff 100644
--- a/rehlds/public/strtools.h
+++ b/rehlds/public/strtools.h
@@ -171,8 +171,8 @@ size_t Q_strlcat(char (&dest)[N], const char *src)
if (srclen > size)
srclen = size;
- Q_memcpy(dst + dstlen, src, srclen);
- dst[dstlen + srclen] = '\0';
+ Q_memcpy(dest + dstlen, src, srclen);
+ dest[dstlen + srclen] = '\0';
return dstlen + srclen;
}
diff --git a/shared_gcc.gradle b/shared_gcc.gradle
index 2426a19..66072f8 100644
--- a/shared_gcc.gradle
+++ b/shared_gcc.gradle
@@ -16,7 +16,11 @@ rootProject.ext.createGccConfig = { boolean release, BinaryKind binKind ->
//intelExtensions: false,
//asmBlocks: true,
- positionIndependentCode: false
+ positionIndependentCode: false,
+
+ extraDefines: [
+ '_GLIBCXX_USE_CXX11_ABI': 0,
+ ]
),
linkerOptions: new GccToolchainConfig.LinkerOptions(
@@ -41,7 +45,11 @@ rootProject.ext.createGccConfig = { boolean release, BinaryKind binKind ->
noBuiltIn: true,
//intelExtensions: false,
- //asmBlocks: true
+ //asmBlocks: true,
+
+ extraDefines: [
+ '_GLIBCXX_USE_CXX11_ABI': 0,
+ ]
),
linkerOptions: new GccToolchainConfig.LinkerOptions(