当前位置: 首页>>代码示例>>C++>>正文


C++ CUtlSymbolTable类代码示例

本文整理汇总了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 );
    }
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:17,代码来源:SoundEmitterSystem.cpp

示例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;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:17,代码来源:utlsymbol.cpp

示例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;
        }
    }
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:28,代码来源:SoundEmitterSystem.cpp

示例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;
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:29,代码来源:AnimationController.cpp

示例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 );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:9,代码来源:materialpatch.cpp

示例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;
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:14,代码来源:cdll_util.cpp

示例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
    }
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:17,代码来源:decals.cpp

示例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 );
    }
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:14,代码来源:mod.cpp

示例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();
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:18,代码来源:AnimationController.cpp

示例10:

char const *CBugReporter::GetSeverity( int index )
{
    if ( index < 0 || index >= m_Severity.Count() )
        return "<<Invalid>>";

    return m_BugStrings.String( m_Severity[ index ] );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:7,代码来源:bugreporter_public.cpp

示例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());
    }
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:35,代码来源:Button.cpp

示例12: Clear

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CDecalEmitterSystem::Clear()
{
    m_DecalFileNames.RemoveAll();
    m_Decals.Purge();
    m_AllDecals.Purge();
    m_GameMaterialTranslation.Purge();
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:10,代码来源:decals.cpp

示例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 );
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:28,代码来源:AnimationController.cpp

示例14: PlayButtonReleasedSound

void Button::PlayButtonReleasedSound()
{
    // check for playing a transition sound
    if ( m_sReleasedSoundName != UTL_INVAL_SYMBOL )
    {
        surface()->PlaySound( g_ButtonSoundNames.String( m_sReleasedSoundName ) );
    }
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:8,代码来源:Button.cpp

示例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);
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:12,代码来源:AnimationController.cpp


注:本文中的CUtlSymbolTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。