本文整理汇总了C++中CUtlSymbolTable类的典型用法代码示例。如果您正苦于以下问题:C++ CUtlSymbolTable类的具体用法?C++ CUtlSymbolTable怎么用?C++ CUtlSymbolTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUtlSymbolTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WaveTrace
void WaveTrace( char const *wavname, char const *funcname )
{
if ( IsX360() && !IsDebug() )
{
return;
}
static CUtlSymbolTable s_WaveTrace;
// Make sure we only show the message once
if ( UTL_INVAL_SYMBOL == s_WaveTrace.Find( wavname ) )
{
DevMsg( "%s directly referenced wave %s (should use game_sounds.txt system instead)\n",
funcname, wavname );
s_WaveTrace.AddString( wavname );
}
}
示例2: offsetof
bool CUtlSymbolTable::CLess::operator()( const CStringPoolIndex &i1, const CStringPoolIndex &i2 ) const
{
// Need to do pointer math because CUtlSymbolTable is used in CUtlVectors, and hence
// can be arbitrarily moved in memory on a realloc. Yes, this is portable. In reality,
// right now at least, because m_LessFunc is the first member of CUtlRBTree, and m_Lookup
// is the first member of CUtlSymbolTabke, this == pTable
CUtlSymbolTable *pTable = (CUtlSymbolTable *)( (byte *)this - offsetof(CUtlSymbolTable::CTree, m_LessFunc) ) - offsetof(CUtlSymbolTable, m_Lookup );
const char* str1 = (i1 == INVALID_STRING_INDEX) ? pTable->m_pUserSearchString :
pTable->StringFromIndex( i1 );
const char* str2 = (i2 == INVALID_STRING_INDEX) ? pTable->m_pUserSearchString :
pTable->StringFromIndex( i2 );
if ( !pTable->m_bInsensitive )
return strcmp( str1, str2 ) < 0;
else
return strcmpi( str1, str2 ) < 0;
}
示例3: LogPrecache
void LogPrecache( char const *soundname )
{
if ( !m_bLogPrecache )
return;
// Make sure we only show the message once
if ( UTL_INVAL_SYMBOL != m_PrecachedScriptSounds.Find( soundname ) )
return;
if (m_hPrecacheLogFile == FILESYSTEM_INVALID_HANDLE)
{
StartLog();
}
m_PrecachedScriptSounds.AddString( soundname );
if (m_hPrecacheLogFile != FILESYSTEM_INVALID_HANDLE)
{
filesystem->Write("\"", 1, m_hPrecacheLogFile);
filesystem->Write(soundname, Q_strlen(soundname), m_hPrecacheLogFile);
filesystem->Write("\"\n", 2, m_hPrecacheLogFile);
}
else
{
Warning( "Disabling precache logging due to file i/o problem!!!\n" );
m_bLogPrecache = false;
}
}
示例4: BaseClass
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
AnimationController::AnimationController(Panel *parent) : BaseClass(parent, NULL)
{
m_hSizePanel = 0;
m_nScreenBounds[ 0 ] = m_nScreenBounds[ 1 ] = -1;
m_nScreenBounds[ 2 ] = m_nScreenBounds[ 3 ] = -1;
m_bAutoReloadScript = false;
// always invisible
SetVisible(false);
SetProportional(true);
// get the names of common types
m_sPosition = g_ScriptSymbols.AddString("position");
m_sSize = g_ScriptSymbols.AddString("size");
m_sFgColor = g_ScriptSymbols.AddString("fgcolor");
m_sBgColor = g_ScriptSymbols.AddString("bgcolor");
m_sXPos = g_ScriptSymbols.AddString("xpos");
m_sYPos = g_ScriptSymbols.AddString("ypos");
m_sWide = g_ScriptSymbols.AddString("wide");
m_sTall = g_ScriptSymbols.AddString("tall");
m_flCurrentTime = 0.0f;
}
示例5: AddNewTranslation
void AddNewTranslation( const char *pOriginalMaterialName, const char *pNewMaterialName )
{
NameTranslationLookup_t newEntry;
newEntry.m_OriginalFileName = s_SymbolTable.AddString( pOriginalMaterialName );
newEntry.m_PatchFileName = s_SymbolTable.AddString( pNewMaterialName );
s_MapPatchedMatToOriginalMat.Insert( newEntry );
}
示例6: AddOrMarkPrecached
//-----------------------------------------------------------------------------
// Purpose: mark or add
// Input : *pEntity -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CPrecacheOtherList::AddOrMarkPrecached( const char *pClassname )
{
CUtlSymbol sym = m_list.Find( pClassname );
if ( sym.IsValid() )
return false;
m_list.AddString( pClassname );
return true;
}
示例7: LevelInitPreEntity
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CDecalEmitterSystem::LevelInitPreEntity()
{
// Precache all entries
int c = m_AllDecals.Count();
for ( int i = 0 ; i < c; i++ )
{
DecalListEntry& e = m_AllDecals[ i ];
#if defined( CLIENT_DLL )
e.precache_index = effects->Draw_DecalIndexFromName( (char *)m_DecalFileNames.String( e.name ) );
#else
e.precache_index = engine->PrecacheDecal( m_DecalFileNames.String( e.name ) );
#endif
}
}
示例8: SetGameDir
void CMod::SetGameDir( const char *dir )
{
CUtlSymbol lookup;
lookup = g_GameDirTable.Find( dir );
if ( lookup != UTL_INVAL_SYMBOL )
{
gamedir = lookup;
}
else
{
gamedir = g_GameDirTable.AddString( dir );
}
}
示例9: RunCmd_SetString
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void AnimationController::RunCmd_SetString( PostedMessage_t &msg )
{
Panel *panel = FindSiblingByName(g_ScriptSymbols.String(msg.event));
Assert(panel != NULL);
if (!panel)
return;
KeyValues *inputData = new KeyValues(g_ScriptSymbols.String(msg.variable));
inputData->SetString(g_ScriptSymbols.String(msg.variable), g_ScriptSymbols.String(msg.variable2));
if (!panel->SetInfo(inputData))
{
// Assert(!("Unhandlable var in AnimationController::SetValue())"));
}
inputData->deleteThis();
}
示例10:
char const *CBugReporter::GetSeverity( int index )
{
if ( index < 0 || index >= m_Severity.Count() )
return "<<Invalid>>";
return m_BugStrings.String( m_Severity[ index ] );
}
示例11: OnMousePressed
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void Button::OnMousePressed(MouseCode code)
{
if (!IsEnabled())
return;
if (!IsMouseClickEnabled(code))
return;
if (_activationType == ACTIVATE_ONPRESSED)
{
DoClick();
return;
}
// play activation sound
if (m_sDepressedSoundName != UTL_INVAL_SYMBOL)
{
surface()->PlaySound(g_ButtonSoundNames.String(m_sDepressedSoundName));
}
if (IsUseCaptureMouseEnabled() && _activationType == ACTIVATE_ONPRESSEDANDRELEASED)
{
{
RequestFocus();
SetSelected(true);
Repaint();
}
// lock mouse input to going to this button
input()->SetMouseCapture(GetVPanel());
}
}
示例12: Clear
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CDecalEmitterSystem::Clear()
{
m_DecalFileNames.RemoveAll();
m_Decals.Purge();
m_AllDecals.Purge();
m_GameMaterialTranslation.Purge();
}
示例13: SetScriptFile
//-----------------------------------------------------------------------------
// Purpose: Sets which script file to use
//-----------------------------------------------------------------------------
bool AnimationController::SetScriptFile( VPANEL sizingPanel, const char *fileName, bool wipeAll /*=false*/ )
{
m_hSizePanel = sizingPanel;
if ( wipeAll )
{
// clear the current script
m_Sequences.RemoveAll();
m_ScriptFileNames.RemoveAll();
CancelAllAnimations();
}
// Store off this filename for reloading later on (if we don't have it already)
UtlSymId_t sFilename = g_ScriptSymbols.AddString( fileName );
if ( m_ScriptFileNames.Find( sFilename ) == m_ScriptFileNames.InvalidIndex() )
{
m_ScriptFileNames.AddToTail( sFilename );
}
UpdateScreenSize();
// load the new script file
return LoadScriptFile( fileName );
}
示例14: PlayButtonReleasedSound
void Button::PlayButtonReleasedSound()
{
// check for playing a transition sound
if ( m_sReleasedSoundName != UTL_INVAL_SYMBOL )
{
surface()->PlaySound( g_ButtonSoundNames.String( m_sReleasedSoundName ) );
}
}
示例15: RunCmd_StopAnimation
//-----------------------------------------------------------------------------
// Purpose: a posted message to stop animations of a specific type
//-----------------------------------------------------------------------------
void AnimationController::RunCmd_StopAnimation(PostedMessage_t &msg)
{
Panel *panel = FindSiblingByName(g_ScriptSymbols.String(msg.event));
Assert(panel != NULL);
if (!panel)
return;
RemoveQueuedAnimationByType(panel, msg.variable, msg.seqName);
}