本文整理汇总了C++中LList::EmptyAndDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ LList::EmptyAndDelete方法的具体用法?C++ LList::EmptyAndDelete怎么用?C++ LList::EmptyAndDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LList
的用法示例。
在下文中一共展示了LList::EmptyAndDelete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadLanguages
void LanguageTable::LoadLanguages()
{
//
// Clear out all known languages
m_languages.EmptyAndDelete();
//
// Explore the data/language directory, looking for languages
LList<char *> *files = g_fileSystem->ListArchive( "data/language/", "*.txt", false );
for( int i = 0; i < files->Size(); ++i )
{
char *thisFile = files->GetData(i);
Language *lang = new Language();
snprintf( lang->m_name, sizeof(lang->m_name), thisFile );
lang->m_name[ sizeof(lang->m_name) - 1 ] = '\0';
for( char *curName = lang->m_name; *curName; curName++ )
{
if( *curName == '.' )
{
*curName = '\0';
break;
}
}
strcpy( lang->m_caption, lang->m_name );
snprintf( lang->m_path, sizeof(lang->m_path), "data/language/%s", thisFile );
lang->m_path[ sizeof(lang->m_path) - 1 ] = '\0';
LoadLanguageCaption( lang );
if( m_onlyDefaultLanguageSelectable && stricmp( m_defaultLanguage, lang->m_name ) != 0 )
{
lang->m_selectable = false;
}
else
{
lang->m_selectable = true;
}
m_languages.PutData( lang );
AppDebugOut( "Found language '%s' with caption '%s' in '%s'\n",
lang->m_name,
lang->m_caption,
lang->m_path );
}
files->EmptyAndDelete();
delete files;
}
示例2: ParseArchives
void FileSystem::ParseArchives( const char *_dir, const char *_filter )
{
LList<char *> *results = ListDirectory( _dir, _filter, false );
for( int i = 0; i < results->Size(); ++i )
{
char fullFilename[512];
snprintf( fullFilename, sizeof(fullFilename), "%s%s", _dir, results->GetData( i ) );
fullFilename[ sizeof(fullFilename) - 1 ] = '\0';
ParseArchive( fullFilename );
}
results->EmptyAndDelete();
delete results;
}
示例3: AppAssert
const char *FindCaseInsensitive( char *_fullPath )
{
AppAssert(strlen(_fullPath) < PATH_MAX);
static char pathSoFar[PATH_MAX];
pathSoFar[0] = '\0';
while (true) {
char *delimiter;
// Skip to the next / or end-of-string
for (delimiter = (char *)_fullPath; *delimiter && *delimiter != '/'; delimiter++);
char component[PATH_MAX];
AppAssert ( strlen(_fullPath) < PATH_MAX );
strcpy( component, _fullPath );
component[delimiter - _fullPath] = '\0';
// Search for a match
LList<char *> *matches = ListDirectory( pathSoFar, component, true );
bool found = false;
if (matches->Size() > 0) {
strcpy(pathSoFar, matches->GetData( 0 ));
found = true;
}
matches->EmptyAndDelete();
// Failed to find a match, just return the original
if (!found)
return _fullPath;
// Got to the end of the path, return it
if (!*delimiter)
return pathSoFar;
_fullPath = delimiter + 1;
}
}
示例4: EclShutdown
void EclShutdown ()
{
windows.EmptyAndDelete();
}
示例5: Render
//.........这里部分代码省略.........
bool timeFlashEffect = (fmodf( GetHighResTime() * 2, 1.0f ) > 0.55f);
UnicodeString caption;
RGBAColour captionColour(255,255,255,255);
if( GetHighResTime() - m_damageTimer < 10.0f &&
rocket->m_state != EscapeRocket::StateExploding )
{
char damage[256];
sprintf( damage, "%d%%", int(rocket->m_damage) );
caption = LANGUAGEPHRASE("multiwinia_rr_status_c");
caption.ReplaceStringFlag( L'T', damage );
captionColour.Set(255,0,0,255);
if( timeFlashEffect ) captionColour.a *= 0.5f;
}
else if( rocket->m_state == EscapeRocket::StateCountdown )
{
char captionC[256];
sprintf( captionC, "%d", (int)rocket->m_countdown + 1 );
caption = captionC;
mainCaptionH *= 4;
}
else if( rocket->m_state == EscapeRocket::StateFlight )
{
caption = LANGUAGEPHRASE("multiwinia_rr_status_d" );
mainCaptionH *= 1.5f;
if( timeFlashEffect ) captionColour.a *= 0.25f;
}
else if( rocket->m_state == EscapeRocket::StateExploding )
{
caption = LANGUAGEPHRASE("multiwinia_rr_status_e" );
if( timeFlashEffect ) captionColour.a *= 0.25f;
}
else if( fuelPercent >= 1.0f && darwiniansInside < 5 )
{
caption = LANGUAGEPHRASE("multiwinia_rr_status_b");
if( timeFlashEffect ) captionColour.a *= 0.25f;
}
else if( rocket->m_refuelRate < 0.05f && fuelPercent < 0.01f )
{
caption = LANGUAGEPHRASE("multiwinia_rr_status_a");
if( timeFlashEffect ) captionColour.a *= 0.25f;
}
else if( fuelPercent < 1.0f )
{
char captionC[256];
sprintf( captionC, "%2.1f%%", fuelPercent * 100 );
caption = LANGUAGEPHRASE("multiwinia_rr_status_f");
caption.ReplaceStringFlag( L'T', captionC );
captionColour.a *= 0.75f;
}
//
// Render our caption
if( caption.Length() )
{
LList<UnicodeString *> *wrapped = WordWrapText( caption, 1000, mainCaptionH, false, false );
for( int i = 0; i < wrapped->Size(); ++i )
{
UnicodeString *thisString = wrapped->GetData(i);
glColor4ub( captionColour.a, captionColour.a, captionColour.a, 0 );
g_titleFont.SetRenderOutline(true);
g_titleFont.DrawText2DCentre( m_x + m_w/2, mainCaptionY, mainCaptionH, *thisString );
glColor4ubv( captionColour.GetData() );
g_titleFont.SetRenderOutline(false);
g_titleFont.DrawText2DCentre( m_x + m_w/2, mainCaptionY, mainCaptionH, *thisString );
mainCaptionY += mainCaptionH;
mainCaptionY += mainCaptionG;
}
wrapped->EmptyAndDelete();
delete wrapped;
}
//
// White border
glColor4f( 1.0f, 1.0f, 1.0f, 0.2f );
glBegin( GL_LINE_LOOP );
glVertex2f( m_x, m_y );
glVertex2f( m_x + m_w, m_y );
glVertex2f( m_x + m_w, m_y + h );
glVertex2f( m_x, m_y + h );
glEnd();
glShadeModel( GL_FLAT );
}
示例6: EclShutdown
void EclShutdown ()
{
windows.EmptyAndDelete();
dirtyrects.EmptyAndDelete();
}