diff --git a/vphysics_jolt/cbase.h b/vphysics_jolt/cbase.h index 5e5ef88..4aeeb1f 100644 --- a/vphysics_jolt/cbase.h +++ b/vphysics_jolt/cbase.h @@ -13,8 +13,10 @@ #include "tier0/logging.h" #endif -#ifdef GAME_SDK2013 +#if defined( GAME_SDK2013 ) #include "compat/compat_sdk2013.h" +#elif defined( GAME_ASW ) +#include "compat/compat_asw.h" #endif #include "compat/branch_overrides.h" diff --git a/vphysics_jolt/compat/compat_asw.h b/vphysics_jolt/compat/compat_asw.h new file mode 100644 index 0000000..e619c18 --- /dev/null +++ b/vphysics_jolt/compat/compat_asw.h @@ -0,0 +1,49 @@ + +#pragma once + +#include "memalloc.h" + +#define DevAssert( ... ) +#define DevAssertMsg( ... ) +#define AssertMsg_Internal( ... ) + +template< typename A, typename B, typename C > +[[nodiscard]] constexpr A clamp( const A val, const B minVal, const C maxVal ) +{ + return MIN( MAX( val, minVal ), maxVal ); +} + +template< typename T > +[[nodiscard]] constexpr T Min( const T valMin, const T valMax ) +{ + return valMin < valMax ? valMin : valMax; +} + +template< typename T > +[[nodiscard]] constexpr T Max( const T valMin, const T valMax ) +{ + return valMin > valMax ? valMin : valMax; +} + +template< typename T > +[[nodiscard]] constexpr T Clamp( const T val, const T minVal, const T maxVal ) +{ + return Min( Max( val, minVal ), maxVal ); +} + +constexpr bool V_isdigit( char c ) +{ + return c >= '0' && c <= '9'; +} + +inline void MemAlloc_Free( void *pMemBlock ) +{ + g_pMemAlloc->Free( pMemBlock ); +} + +enum PlayerContactState_t +{ + PLAYER_CONTACT_PHYSICS = 1, + PLAYER_CONTACT_GAMEOBJECT = 2, +}; + diff --git a/vphysics_jolt/vphysics_jolt_inc.vpc b/vphysics_jolt/vphysics_jolt_inc.vpc index 09e659c..ad06f66 100644 --- a/vphysics_jolt/vphysics_jolt_inc.vpc +++ b/vphysics_jolt/vphysics_jolt_inc.vpc @@ -20,6 +20,14 @@ $Configuration $Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)" $Create/UsePCHThroughFile "cbase.h" } + + $Linker + { + // For Alien Swarm, we don't get the ability to build our own tier1 or mathlib + // which means we need to be compatible with the .libs provided built for + // ancient Visual Studio. + $AdditionalDependencies "$BASE legacy_stdio_definitions.lib" [$GAME_ASW] + } } $Project "$PROJNAME"