本文整理汇总了C++中idLinkList::Num方法的典型用法代码示例。如果您正苦于以下问题:C++ idLinkList::Num方法的具体用法?C++ idLinkList::Num怎么用?C++ idLinkList::Num使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idLinkList
的用法示例。
在下文中一共展示了idLinkList::Num方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
/*
================
idEvent::Save
================
*/
void idEvent::Save( idSaveGame *savefile ) {
char *str;
int i, size;
idEvent *event;
byte *dataPtr;
bool validTrace;
const char *format;
savefile->WriteInt( EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL ) {
savefile->WriteInt( event->time );
savefile->WriteString( event->eventdef->GetName() );
savefile->WriteString( event->typeinfo->classname );
savefile->WriteObject( event->object );
savefile->WriteInt( event->eventdef->GetArgSize() );
format = event->eventdef->GetArgFormat();
for ( i = 0, size = 0; i < event->eventdef->GetNumArgs(); ++i) {
dataPtr = &event->data[ event->eventdef->GetArgOffset( i ) ];
switch( format[ i ] ) {
case D_EVENT_FLOAT :
savefile->WriteFloat( *reinterpret_cast<float *>( dataPtr ) );
size += sizeof( float );
break;
case D_EVENT_INTEGER :
case D_EVENT_ENTITY :
case D_EVENT_ENTITY_NULL :
savefile->WriteInt( *reinterpret_cast<int *>( dataPtr ) );
size += sizeof( int );
break;
case D_EVENT_VECTOR :
savefile->WriteVec3( *reinterpret_cast<idVec3 *>( dataPtr ) );
size += sizeof( idVec3 );
break;
case D_EVENT_TRACE :
validTrace = *reinterpret_cast<bool *>( dataPtr );
savefile->WriteBool( validTrace );
size += sizeof( bool );
if ( validTrace ) {
size += sizeof( trace_t );
const trace_t &t = *reinterpret_cast<trace_t *>( dataPtr + sizeof( bool ) );
SaveTrace( savefile, t );
if ( t.c.material ) {
size += MAX_STRING_LEN;
str = reinterpret_cast<char *>( dataPtr + sizeof( bool ) + sizeof( trace_t ) );
savefile->Write( str, MAX_STRING_LEN );
}
}
break;
default:
break;
}
}
assert( size == event->eventdef->GetArgSize() );
event = event->eventNode.Next();
}
}
示例2: Save
/*
================
idEvent::Save
================
*/
void idEvent::Save( idSaveGame *savefile ) {
idEvent *event;
savefile->WriteInt( EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL ) {
savefile->WriteInt( event->time );
savefile->WriteString( event->eventdef->GetName() );
savefile->WriteString( event->typeinfo->classname );
savefile->WriteObject( event->object );
savefile->WriteInt( event->eventdef->GetArgSize() );
savefile->Write( event->data, event->eventdef->GetArgSize() );
event = event->eventNode.Next();
}
}
示例3: WriteDebugInfo
void idEvent::WriteDebugInfo( void ) {
idEvent *event;
int count = 0;
idFile *FH = fileSystem->OpenFileAppend( "idEvents.txt" );
FH->Printf( "Num Events = %d\n", EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL ) {
count++;
FH->Printf( "%d. %d - %s - %s - %s\n", count, event->time, event->eventdef->GetName(), event->typeinfo->classname, event->object->GetClassname() );
event = event->eventNode.Next();
}
FH->Printf( "\n\n" );
fileSystem->CloseFile( FH );
}
示例4: Save
/*
================
idEvent::Save
================
*/
void idEvent::Save( idSaveGame* savefile )
{
char* str;
int i, size;
idEvent* event;
byte* dataPtr;
bool validTrace;
const char* format;
// RB: for missing D_EVENT_STRING
idStr s;
// RB end
savefile->WriteInt( EventQueue.Num() );
event = EventQueue.Next();
while( event != NULL )
{
savefile->WriteInt( event->time );
savefile->WriteString( event->eventdef->GetName() );
savefile->WriteString( event->typeinfo->classname );
savefile->WriteObject( event->object );
savefile->WriteInt( event->eventdef->GetArgSize() );
format = event->eventdef->GetArgFormat();
for( i = 0, size = 0; i < event->eventdef->GetNumArgs(); ++i )
{
dataPtr = &event->data[ event->eventdef->GetArgOffset( i ) ];
switch( format[ i ] )
{
case D_EVENT_FLOAT :
savefile->WriteFloat( *reinterpret_cast<float*>( dataPtr ) );
// RB: 64 bit fix, changed sizeof( float ) to sizeof( intptr_t )
size += sizeof( intptr_t );
// RB end
break;
case D_EVENT_INTEGER :
// RB: 64 bit fix, changed sizeof( int ) to sizeof( intptr_t )
savefile->WriteInt( *reinterpret_cast<int*>( dataPtr ) );
size += sizeof( intptr_t );
break;
// RB end
case D_EVENT_ENTITY :
case D_EVENT_ENTITY_NULL :
// RB: 64 bit fix, changed alignment to sizeof( intptr_t )
reinterpret_cast< idEntityPtr<idEntity> * >( dataPtr )->Save( savefile );
size += sizeof( intptr_t );
// RB end
break;
case D_EVENT_VECTOR :
savefile->WriteVec3( *reinterpret_cast<idVec3*>( dataPtr ) );
// RB: 64 bit fix, changed sizeof( int ) to E_EVENT_SIZEOF_VEC
size += E_EVENT_SIZEOF_VEC;
// RB end
break;
#if 1
// RB: added missing D_EVENT_STRING case
case D_EVENT_STRING :
s.Clear();
s.Append( reinterpret_cast<char*>( dataPtr ) );
savefile->WriteString( s );
//size += s.Length();
size += MAX_STRING_LEN;
break;
// RB end
#endif
case D_EVENT_TRACE :
validTrace = *reinterpret_cast<bool*>( dataPtr );
savefile->WriteBool( validTrace );
size += sizeof( bool );
if( validTrace )
{
size += sizeof( trace_t );
const trace_t& t = *reinterpret_cast<trace_t*>( dataPtr + sizeof( bool ) );
SaveTrace( savefile, t );
if( t.c.material )
{
size += MAX_STRING_LEN;
str = reinterpret_cast<char*>( dataPtr + sizeof( bool ) + sizeof( trace_t ) );
savefile->Write( str, MAX_STRING_LEN );
}
}
break;
default:
break;
}
}
assert( size == ( int )event->eventdef->GetArgSize() );
event = event->eventNode.Next();
}
// Save the Fast EventQueue
savefile->WriteInt( FastEventQueue.Num() );
event = FastEventQueue.Next();
while( event != NULL )
{
//.........这里部分代码省略.........