本文整理汇总了C++中idList类的典型用法代码示例。如果您正苦于以下问题:C++ idList类的具体用法?C++ idList怎么用?C++ idList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了idList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ParseIndex
/*
================
idAASFileLocal::ParseIndex
================
*/
bool idAASFileLocal::ParseIndex( idLexer &src, idList<aasIndex_t> &indexes )
{
int numIndexes, i;
aasIndex_t index;
numIndexes = src.ParseInt();
indexes.Resize( numIndexes );
if ( !src.ExpectTokenString( "{" ) )
{
return false;
}
for ( i = 0; i < numIndexes; i++ )
{
src.ParseInt();
src.ExpectTokenString( "(" );
index = src.ParseInt();
src.ExpectTokenString( ")" );
indexes.Append( index );
}
if ( !src.ExpectTokenString( "}" ) )
{
return false;
}
return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:30,代码来源:AASFile.cpp
示例2: GetSaveGameList
/*
===============
idSessionLocal::GetSaveGameList
===============
*/
void idSessionLocal::GetSaveGameList( idStrList &fileList, idList<fileTIME_T> &fileTimes ) {
int i;
idFileList *files;
// NOTE: no fs_game_base for savegames
idStr game = cvarSystem->GetCVarString( "fs_game" );
if( game.Length() ) {
files = fileSystem->ListFiles( "savegames", ".save", false, false, game );
} else {
files = fileSystem->ListFiles( "savegames", ".save" );
}
fileList = files->GetList();
fileSystem->FreeFileList( files );
for ( i = 0; i < fileList.Num(); i++ ) {
ID_TIME_T timeStamp;
fileSystem->ReadFile( "savegames/" + fileList[i], NULL, &timeStamp );
fileList[i].StripLeading( '/' );
fileList[i].StripFileExtension();
fileTIME_T ft;
ft.index = i;
ft.timeStamp = timeStamp;
fileTimes.Append( ft );
}
fileTimes.Sort( idListSaveGameCompare );
}
开发者ID:anonreclaimer,项目名称:morpheus,代码行数:35,代码来源:Session_menu.cpp
示例3:
/*
========================
idMenuScreen_Shell_MatchSettings::idMenuDataSource_MatchSettings::GetMapName
========================
*/
void idMenuScreen_Shell_MatchSettings::idMenuDataSource_MatchSettings::GetMapName( int index, idStr & name ) {
idLobbyBase & lobby = session->GetActivePlatformLobbyBase();
const idMatchParameters & matchParameters = lobby.GetMatchParms();
name = "#str_swf_filter_random";
if ( matchParameters.gameMap >= 0 ) {
const idList< mpMap_t > maps = common->GetMapList();
name = idLocalization::GetString( maps[ idMath::ClampInt( 0, maps.Num() - 1, matchParameters.gameMap ) ].mapName );
}
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:14,代码来源:MenuScreen_Shell_MatchSettings.cpp
示例4: ParseInOutStruct
/*
========================
ParseInOutStruct
========================
*/
void ParseInOutStruct( idLexer & src, int attribType, idList< inOutVariable_t > & inOutVars ) {
src.ExpectTokenString( "{" );
while( !src.CheckTokenString( "}" ) ) {
inOutVariable_t var;
idToken token;
src.ReadToken( &token );
var.type = token;
src.ReadToken( &token );
var.nameCg = token;
if ( !src.CheckTokenString( ":" ) ) {
src.SkipUntilString( ";" );
continue;
}
src.ReadToken( &token );
var.nameGLSL = token;
src.ExpectTokenString( ";" );
// convert the type
for ( int i = 0; typeConversion[i].typeCG != NULL; i++ ) {
if ( var.type.Cmp( typeConversion[i].typeCG ) == 0 ) {
var.type = typeConversion[i].typeGLSL;
break;
}
}
// convert the semantic to a GLSL name
for ( int i = 0; attribsPC[i].semantic != NULL; i++ ) {
if ( ( attribsPC[i].flags & attribType ) != 0 ) {
if ( var.nameGLSL.Cmp( attribsPC[i].semantic ) == 0 ) {
var.nameGLSL = attribsPC[i].glsl;
break;
}
}
}
// check if it was defined previously
var.declareInOut = true;
for ( int i = 0; i < inOutVars.Num(); i++ ) {
if ( var.nameGLSL == inOutVars[i].nameGLSL ) {
var.declareInOut = false;
break;
}
}
inOutVars.Append( var );
}
src.ExpectTokenString( ";" );
}
开发者ID:MWisBest,项目名称:idTech4Prime,代码行数:58,代码来源:RenderProgs_GLSL.cpp
示例5: FromSides
/*
============
idBrush::FromSides
============
*/
bool idBrush::FromSides( idList<idBrushSide*>& sideList )
{
int i;
for( i = 0; i < sideList.Num(); i++ )
{
sides.Append( sideList[i] );
}
sideList.Clear();
return CreateWindings();
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:18,代码来源:Brush.cpp
示例6: LeaderboardLocal_Init
/*
=====================================
LeaderboardLocal_Init
=====================================
*/
void LeaderboardLocal_Init()
{
const idList< mpMap_t > maps = common->GetMapList();
const char** gameModes = NULL;
const char** gameModesDisplay = NULL;
int numModes = game->GetMPGameModes( &gameModes, &gameModesDisplay );
// Iterate through all the available maps, and generate leaderboard Defs, and IDs for each.
for( int mapIdx = 0; mapIdx < maps.Num(); mapIdx++ )
{
for( int modeIdx = 0; modeIdx < numModes; modeIdx++ )
{
// Check the supported modes on the map.
if( maps[ mapIdx ].supportedModes & BIT( modeIdx ) )
{
const columnGameMode_t gamemode = gameMode_columnDefs[ modeIdx ];
// Generate a Leaderboard ID for the map/mode
int boardID = LeaderboardLocal_GetID( mapIdx, modeIdx );
// Create and Register the leaderboard with the sys_stats registered Leaderboards
leaderboardDefinition_t* newLeaderboardDef = Sys_CreateLeaderboardDef( boardID,
gamemode.numColumns,
gamemode.columnDef,
gamemode.rankOrder,
gamemode.supportsAttachments,
gamemode.checkAgainstCurrent );
#ifndef USE_STEAM_API
// Set the leaderboard name.
const char* mapname = idLocalization::GetString( maps[ mapIdx ].mapName );
newLeaderboardDef->boardName.Format( "%s %s", mapname, gamemode.abrevName );
#endif
// sanity check.
if( Sys_FindLeaderboardDef( boardID ) != newLeaderboardDef )
{
idLib::Error( "Leaderboards_Init leaderboard creation failed" );
}
}
}
}
}
开发者ID:Anthony-Gaudino,项目名称:OpenTechBFG,代码行数:56,代码来源:Leaderboards.cpp
示例7: lists
/*
========================
idLobby::RemoveSessionUsersByIDList
This is the choke point for removing users from a session.
It will handle all the housekeeping of removing from various platform lists (xsession user tracking, etc).
Called from both host and client.
========================
*/
void idLobby::RemoveSessionUsersByIDList( idList< lobbyUserID_t > & usersToRemoveByID ) {
assert( lobbyBackend != NULL || usersToRemoveByID.Num() == 0 );
for ( int i = 0; i < usersToRemoveByID.Num(); i++ ) {
for ( int u = 0; u < GetNumLobbyUsers(); u++ ) {
lobbyUser_t * user = GetLobbyUser( u );
if ( user->IsDisconnected() ) {
// User already disconnected from session but not removed from the list.
// This will happen when users are removed during the game.
continue;
}
if ( user->lobbyUserID == usersToRemoveByID[i] ) {
if ( lobbyType == TYPE_GAME ) {
idLib::Printf( "NET: %s left the game.\n", user->gamertag );
} else if ( lobbyType == TYPE_PARTY ) {
idLib::Printf( "NET: %s left the party.\n", user->gamertag );
}
UnregisterUser( user );
// Save the user so we can still get his gamertag, which may be needed for
// a disconnection HUD message.
SaveDisconnectedUser( *user );
FreeUser( user );
break;
}
}
}
if ( usersToRemoveByID.Num() > 0 && IsHost() ) {
if ( lobbyBackend != NULL ) {
lobbyBackend->UpdateLobbySkill( GetAverageSessionLevel() );
}
// If we are the host, send a message to all peers with a list of users who have disconnected
byte buffer[ idPacketProcessor::MAX_MSG_SIZE ];
idBitMsg msg( buffer, sizeof( buffer ) );
msg.WriteByte( usersToRemoveByID.Num() );
for ( int i = 0; i < usersToRemoveByID.Num(); i++ ) {
usersToRemoveByID[i].WriteToMsg( msg );
}
for ( int p = 0; p < peers.Num(); p++ ) {
QueueReliableMessage( p, RELIABLE_USER_DISCONNECTED, msg.GetReadData(), msg.GetSize() );
}
}
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:58,代码来源:sys_lobby_users.cpp
示例8: LittleLong
bool idRenderModelBSP29NonMap::Load( idList<byte>& buffer, idSkinTranslation* skinTranslation ) {
type = MOD_BRUSH29_NON_MAP;
tr.currentModel = this;
bsp29_dheader_t* header = ( bsp29_dheader_t* )buffer.Ptr();
int version = LittleLong( header->version );
if ( version != BSP29_VERSION ) {
common->FatalError( "Mod_LoadBrush29Model: %s has wrong version number (%i should be %i)", name, version, BSP29_VERSION );
}
// swap all the lumps
byte* mod_base = ( byte* )header;
for ( int i = 0; i < ( int )sizeof ( bsp29_dheader_t ) / 4; i++ ) {
( ( int* )header )[ i ] = LittleLong( ( ( int* )header )[ i ] );
}
// load into heap
idBsp29LoadHelper loader( name, mod_base );
loader.LoadVertexes( &header->lumps[ BSP29LUMP_VERTEXES ] );
loader.LoadEdges( &header->lumps[ BSP29LUMP_EDGES ] );
loader.LoadSurfedges( &header->lumps[ BSP29LUMP_SURFEDGES ] );
loader.LoadPlanes( &header->lumps[ BSP29LUMP_PLANES ] );
loader.LoadLighting( &header->lumps[ BSP29LUMP_LIGHTING ] );
loader.LoadTextures( &header->lumps[ BSP29LUMP_TEXTURES ] );
loader.LoadTexinfo( &header->lumps[ BSP29LUMP_TEXINFO ] );
loader.LoadFaces( &header->lumps[ BSP29LUMP_FACES ] );
delete[] loader.planes;
brush29nm_lightdata = loader.lightdata;
brush29nm_numtextures = loader.numtextures;
brush29nm_textures = loader.textures;
brush29nm_numtexinfo = loader.numtexinfo;
brush29nm_texinfo = loader.texinfo;
brush29nm_textureInfos = loader.textureInfos;
brush29nm_numsurfaces = loader.numsurfaces;
brush29nm_surfaces = loader.surfaces;
if ( GGameType & GAME_Hexen2 ) {
loader.LoadSubmodelsH2( &header->lumps[ BSP29LUMP_MODELS ] );
} else {
loader.LoadSubmodelsQ1( &header->lumps[ BSP29LUMP_MODELS ] );
}
q1_numframes = 2; // regular and alternate animation
//
// set up the submodels
//
mbrush29_submodel_t* bm = loader.submodels;
brush29nm_firstmodelsurface = bm->firstface;
brush29nm_nummodelsurfaces = bm->numfaces;
VectorCopy( bm->maxs, q1_maxs );
VectorCopy( bm->mins, q1_mins );
q1_radius = RadiusFromBounds( q1_mins, q1_maxs );
delete[] loader.submodels;
return true;
}
开发者ID:janisl,项目名称:jlquake,代码行数:60,代码来源:RenderModelBSP29NonMap.cpp
示例9: SetListHeadings
/*
========================
idMenuWidget_NavBar::SetListHeadings
========================
*/
void idMenuWidget_NavBar::SetListHeadings( idList< idStr >& list )
{
headings.Clear();
for( int index = 0; index < list.Num(); ++index )
{
headings.Append( list[ index ] );
}
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:13,代码来源:MenuWidget_NavBar.cpp
示例10: SetHeadingInfo
/*
========================
idMenuWidget_LobbyList::SetHeadingInfo
========================
*/
void idMenuWidget_LobbyList::SetHeadingInfo( idList< idStr >& list )
{
headings.Clear();
for( int index = 0; index < list.Num(); ++index )
{
headings.Append( list[ index ] );
}
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:13,代码来源:MenuWidget_LobbyList.cpp
示例11: ClearTraceModelCache
/*
===============
idClipModel::ClearTraceModelCache
===============
*/
void idClipModel::ClearTraceModelCache()
{
traceModelCache.DeleteContents( true );
traceModelCache_Unsaved.DeleteContents( true );
traceModelHash.Free();
traceModelHash_Unsaved.Free();
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:12,代码来源:Clip.cpp
示例12: InitScriptEvents
/*
================
DialogScriptEditor::InitScriptEvents
================
*/
void DialogScriptEditor::InitScriptEvents( void ) {
int index;
idParser src;
idToken token;
idStr whiteSpace;
scriptEventInfo_t info;
if( !src.LoadFile( "script/doom_events.script" ) ) {
return;
}
scriptEvents.Clear();
while( src.ReadToken( &token ) ) {
if( token == "scriptEvent" ) {
src.GetLastWhiteSpace( whiteSpace );
index = whiteSpace.Find( "//" );
if( index != -1 ) {
info.help = whiteSpace.Right( whiteSpace.Length() - index );
info.help.Remove( '\r' );
info.help.Replace( "\n", "\r\n" );
} else {
info.help = "";
}
src.ExpectTokenType( TT_NAME, 0, &token );
info.parms = token;
src.ExpectTokenType( TT_NAME, 0, &token );
info.name = token;
src.ExpectTokenString( "(" );
info.parms += " " + info.name + "(";
while( src.ReadToken( &token ) && token != ";" ) {
info.parms.Append( " " + token );
}
scriptEvents.Append( info );
}
}
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:39,代码来源:DialogScriptEditor.cpp
示例13: FreeTraceModel
/*
===============
idClipModel::FreeTraceModel
===============
*/
void idClipModel::FreeTraceModel( int traceModelIndex )
{
int realTraceModelIndex = traceModelIndex & ~TRACE_MODEL_SAVED;
// Check which cache we are using.
if( traceModelIndex & TRACE_MODEL_SAVED )
{
if( realTraceModelIndex < 0 || realTraceModelIndex >= traceModelCache.Num() || traceModelCache[realTraceModelIndex]->refCount <= 0 )
{
gameLocal.Warning( "idClipModel::FreeTraceModel: tried to free uncached trace model" );
return;
}
traceModelCache[realTraceModelIndex]->refCount--;
}
else
{
if( realTraceModelIndex < 0 || realTraceModelIndex >= traceModelCache_Unsaved.Num() || traceModelCache_Unsaved[realTraceModelIndex]->refCount <= 0 )
{
gameLocal.Warning( "idClipModel::FreeTraceModel: tried to free uncached trace model" );
return;
}
traceModelCache_Unsaved[realTraceModelIndex]->refCount--;
}
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:34,代码来源:Clip.cpp
示例14: EndLevelLoad
/*
=================
idRenderModelManagerLocal::EndLevelLoad
=================
*/
void idRenderModelManagerLocal::EndLevelLoad() {
common->Printf( "----- idRenderModelManagerLocal::EndLevelLoad -----\n" );
int start = Sys_Milliseconds();
insideLevelLoad = false;
int purgeCount = 0;
int keepCount = 0;
int loadCount = 0;
// purge any models not touched
for ( int i = 0 ; i < models.Num() ; i++ ) {
idRenderModel *model = models[i];
if ( !model->IsLevelLoadReferenced() && model->IsLoaded() && model->IsReloadable() ) {
// common->Printf( "purging %s\n", model->Name() );
purgeCount++;
R_CheckForEntityDefsUsingModel( model );
model->PurgeModel();
} else {
// common->Printf( "keeping %s\n", model->Name() );
keepCount++;
}
}
// purge unused triangle surface memory
R_PurgeTriSurfData( frameData );
// load any new ones
for ( int i = 0 ; i < models.Num() ; i++ ) {
idRenderModel *model = models[i];
if ( model->IsLevelLoadReferenced() && !model->IsLoaded() && model->IsReloadable() ) {
loadCount++;
model->LoadModel();
if ( ( loadCount & 15 ) == 0 ) {
session->PacifierUpdate();
}
}
}
// _D3XP added this
int end = Sys_Milliseconds();
common->Printf( "%5i models purged from previous level, ", purgeCount );
common->Printf( "%5i models kept.\n", keepCount );
if ( loadCount ) {
common->Printf( "%5i new models loaded in %5.1f seconds\n", loadCount, (end-start) * 0.001 );
}
common->Printf( "---------------------------------------------------\n" );
}
开发者ID:galek,项目名称:fhDOOM,代码行数:64,代码来源:ModelManager.cpp
示例15: Sys_ClearEvents
/*
================
Sys_ClearEvents
================
*/
void Sys_ClearEvents() {
SDL_Event ev;
while (SDL_PollEvent(&ev))
;
kbd_polls.SetNum(0, false);
mouse_polls.SetNum(0, false);
}
开发者ID:svdijk,项目名称:dhewm3,代码行数:14,代码来源:events.cpp
示例16: TryWait
/*
========================
idParallelJobList_Threads::TryWait
========================
*/
bool idParallelJobList_Threads::TryWait()
{
if( jobList.Num() == 0 || signalJobCount[signalJobCount.Num() - 1].GetValue() <= 0 )
{
Wait();
return true;
}
return false;
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:14,代码来源:ParallelJobList.cpp
示例17: Sys_InitInput
/*
=================
Sys_InitInput
=================
*/
void Sys_InitInput() {
kbd_polls.SetGranularity(64);
mouse_polls.SetGranularity(64);
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
in_kbd.SetModified();
}
开发者ID:Edgarins29,项目名称:Doom3,代码行数:14,代码来源:events.cpp
示例18: RemoveModel
/*
=================
idRenderModelManagerLocal::RemoveModel
=================
*/
void idRenderModelManagerLocal::RemoveModel( idRenderModel* model )
{
int index = models.FindIndex( model );
if( index != -1 )
{
hash.RemoveIndex( hash.GenerateKey( model->Name(), false ), index );
models.RemoveIndex( index );
}
}
开发者ID:LucasCampos,项目名称:RBDOOM-3-BFG,代码行数:14,代码来源:ModelManager.cpp
示例19: SaveTraceModels
/*
===============
idClipModel::SaveTraceModels
===============
*/
void idClipModel::SaveTraceModels( idSaveGame *savefile ) {
int i;
savefile->WriteInt( traceModelCache.Num() );
for( i = 0; i < traceModelCache.Num(); i++ ) {
trmCache_t *entry = traceModelCache[i];
savefile->WriteTraceModel( entry->trm );
savefile->WriteFloat( entry->volume );
savefile->WriteVec3( entry->centerOfMass );
savefile->WriteMat3( entry->inertiaTensor );
}
}
开发者ID:revelator,项目名称:Revelation-Engine,代码行数:16,代码来源:Clip.cpp
示例20: Sys_InitInput
/*
=================
Sys_InitInput
=================
*/
void Sys_InitInput() {
kbd_polls.SetGranularity(64);
mouse_polls.SetGranularity(64);
#if !SDL_VERSION_ATLEAST(2, 0, 0)
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
#endif
in_kbd.SetModified();
}
开发者ID:svdijk,项目名称:dhewm3,代码行数:16,代码来源:events.cpp
注:本文中的idList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论