From dab5ba26e47c4cba688f59f17a91657e0d9d57e7 Mon Sep 17 00:00:00 2001 From: tupoy-ya Date: Mon, 30 Dec 2024 18:41:36 +0500 Subject: [PATCH] fix(Build): Fix ssemath for non gcc compilers. fix(Vscript): Move default parameter to header. --- public/mathlib/ssemath.h | 27 +++++++++++++++++++++++++++ vscript/vscript_bindings_base.cpp | 2 +- vscript/vscript_bindings_base.h | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/public/mathlib/ssemath.h b/public/mathlib/ssemath.h index 834da75b..356714bc 100644 --- a/public/mathlib/ssemath.h +++ b/public/mathlib/ssemath.h @@ -3140,4 +3140,31 @@ FORCEINLINE int BoxOnPlaneSideSIMD( const fltx4& emins, const fltx4& emaxs, cons return sides[0]; } + +// Some convenience operator overloads, which are just aliasing the functions above. +// Unneccessary on 360, as you already have them from xboxmath.h +// Componentwise add +#ifndef COMPILER_GCC + +FORCEINLINE fltx4 operator+=( fltx4 &a, FLTX4 b ) +{ + a = AddSIMD( a, b ); + return a; +} + +FORCEINLINE fltx4 operator-=( fltx4 &a, FLTX4 b ) +{ + a = SubSIMD( a, b ); + return a; +} + + +FORCEINLINE fltx4 operator*=( fltx4 &a, FLTX4 b ) +{ + a = MulSIMD( a, b ); + return a; +} + +#endif + #endif // _ssemath_h diff --git a/vscript/vscript_bindings_base.cpp b/vscript/vscript_bindings_base.cpp index 33b644d1..06a0af74 100644 --- a/vscript/vscript_bindings_base.cpp +++ b/vscript/vscript_bindings_base.cpp @@ -330,7 +330,7 @@ void CScriptKeyValues::ScriptSetBool( bool bValue ) // constructors -CScriptKeyValues::CScriptKeyValues( KeyValues *pKeyValues = NULL ) +CScriptKeyValues::CScriptKeyValues( KeyValues *pKeyValues ) { if (pKeyValues == NULL) { diff --git a/vscript/vscript_bindings_base.h b/vscript/vscript_bindings_base.h index 2629aada..03862405 100644 --- a/vscript/vscript_bindings_base.h +++ b/vscript/vscript_bindings_base.h @@ -20,7 +20,7 @@ class CScriptKeyValues { public: - CScriptKeyValues( KeyValues *pKeyValues ); + CScriptKeyValues( KeyValues *pKeyValues = NULL ); ~CScriptKeyValues( ); HSCRIPT ScriptFindKey( const char *pszName );