misc: Add compat defines for Alien Swarm

This commit is contained in:
Joshua Ashton 2022-09-02 10:59:04 +01:00
parent b01f9f5c0c
commit d923d9a5b5
3 changed files with 60 additions and 1 deletions

View File

@ -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"

View File

@ -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,
};

View File

@ -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"