csgo-2018-source/tier0/vatoms.cpp

28 lines
865 B
C++
Raw Permalink Normal View History

2021-07-25 12:11:47 +08:00
//========== Copyright <20> Valve Corporation, All rights reserved. ========
// NOTE: DO NOT INCLUDE vatoms.h, we don't want to rebuild tier0 every time
// the header changes.
//
#include "tier0/platform.h"
#include "tier0/dbg.h"
#include "tier0/memdbgon.h"
PLATFORM_INTERFACE void** GetVAtom( int nAtomIndex );
static void* g_atoms[16] = {NULL}; // all pointers must be initialized to NULL
void** GetVAtom( int nAtomIndex )
{
if( uint( nAtomIndex ) >= ARRAYSIZE( g_atoms ) )
{
ConMsg (
"*******************************************************************\n"
" *** ERROR *** \n"
"VATOM index %d out of range, recompile tier0 with larger atom table\n"
"*******************************************************************\n",
nAtomIndex );
return NULL;
}
return &g_atoms[nAtomIndex];
}