mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-20 04:26:03 +08:00
Revert "Remove tier1 lib/code. It's implemented by tier0 now and exported."
This reverts commit 4fd0ac35ed
.
This commit is contained in:
42
tier1/rangecheckedvar.cpp
Normal file
42
tier1/rangecheckedvar.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "mathlib/mathlib.h"
|
||||
#include "rangecheckedvar.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
bool g_bDoRangeChecks = true;
|
||||
|
||||
|
||||
static int g_nDisables = 0;
|
||||
|
||||
|
||||
CDisableRangeChecks::CDisableRangeChecks()
|
||||
{
|
||||
if ( !ThreadInMainThread() )
|
||||
return;
|
||||
g_nDisables++;
|
||||
g_bDoRangeChecks = false;
|
||||
}
|
||||
|
||||
|
||||
CDisableRangeChecks::~CDisableRangeChecks()
|
||||
{
|
||||
if ( !ThreadInMainThread() )
|
||||
return;
|
||||
Assert( g_nDisables > 0 );
|
||||
--g_nDisables;
|
||||
if ( g_nDisables == 0 )
|
||||
{
|
||||
g_bDoRangeChecks = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user