mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-12-06 18:18:23 +00:00
Revert tier1 changes
This commit is contained in:
parent
19e59dc14c
commit
1659dbf892
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -22,7 +22,6 @@
|
|||||||
#include "tier0/vprof_telemetry.h"
|
#include "tier0/vprof_telemetry.h"
|
||||||
#include <Color.h>
|
#include <Color.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cstdlib>
|
|
||||||
#include "tier0/dbg.h"
|
#include "tier0/dbg.h"
|
||||||
#include "tier0/mem.h"
|
#include "tier0/mem.h"
|
||||||
#include "utlbuffer.h"
|
#include "utlbuffer.h"
|
||||||
@ -462,9 +461,9 @@ void KeyValues::Init()
|
|||||||
|
|
||||||
m_bHasEscapeSequences = false;
|
m_bHasEscapeSequences = false;
|
||||||
m_bEvaluateConditionals = true;
|
m_bEvaluateConditionals = true;
|
||||||
m_bLocalStorage = false;
|
|
||||||
|
|
||||||
m_pStringTable = NULL;
|
// for future proof
|
||||||
|
memset( unused, 0, sizeof(unused) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -529,10 +528,7 @@ void KeyValues::ChainKeyValue( KeyValues* pChain )
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
const char *KeyValues::GetName( void ) const
|
const char *KeyValues::GetName( void ) const
|
||||||
{
|
{
|
||||||
if ( m_bLocalStorage )
|
return s_pfGetStringForSymbol( m_iKeyName );
|
||||||
return m_pStringTable->GetStringForSymbol( m_iKeyName );
|
|
||||||
else
|
|
||||||
return s_pfGetStringForSymbol( m_iKeyName );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -1005,9 +1001,7 @@ KeyValues *KeyValues::FindKey(const char *keyName, bool bCreate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// lookup the symbol for the search string
|
// lookup the symbol for the search string
|
||||||
HKeySymbol iSearchStr = m_bLocalStorage
|
HKeySymbol iSearchStr = s_pfGetSymbolForString( searchStr, bCreate );
|
||||||
? m_pStringTable->GetSymbolForString( searchStr, bCreate )
|
|
||||||
: s_pfGetSymbolForString( searchStr, bCreate );
|
|
||||||
|
|
||||||
if ( iSearchStr == INVALID_KEY_SYMBOL )
|
if ( iSearchStr == INVALID_KEY_SYMBOL )
|
||||||
{
|
{
|
||||||
@ -1386,8 +1380,15 @@ float KeyValues::GetFloat( const char *keyName, float defaultValue )
|
|||||||
switch ( dat->m_iDataType )
|
switch ( dat->m_iDataType )
|
||||||
{
|
{
|
||||||
case TYPE_STRING:
|
case TYPE_STRING:
|
||||||
return std::strtof(dat->m_sValue, nullptr);
|
return (float)atof(dat->m_sValue);
|
||||||
case TYPE_FLOAT:
|
case TYPE_WSTRING:
|
||||||
|
#ifdef WIN32
|
||||||
|
return (float) _wtof(dat->m_wsValue); // no wtof
|
||||||
|
#else
|
||||||
|
Assert( !"impl me" );
|
||||||
|
return 0.0;
|
||||||
|
#endif
|
||||||
|
case TYPE_FLOAT:
|
||||||
return dat->m_flValue;
|
return dat->m_flValue;
|
||||||
case TYPE_INT:
|
case TYPE_INT:
|
||||||
return (float)dat->m_iValue;
|
return (float)dat->m_iValue;
|
||||||
@ -1729,18 +1730,7 @@ void KeyValues::SetFloat( const char *keyName, float value )
|
|||||||
|
|
||||||
void KeyValues::SetName( const char * setName )
|
void KeyValues::SetName( const char * setName )
|
||||||
{
|
{
|
||||||
if ( m_bLocalStorage )
|
m_iKeyName = s_pfGetSymbolForString( setName, true );
|
||||||
m_iKeyName = m_pStringTable->GetSymbolForString( setName );
|
|
||||||
else
|
|
||||||
m_iKeyName = s_pfGetSymbolForString( setName, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool KeyValues::IsUsingLocalStorage() const
|
|
||||||
{
|
|
||||||
return m_bLocalStorage != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user