本文整理汇总了C++中FArchive::WriteCount方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::WriteCount方法的具体用法?C++ FArchive::WriteCount怎么用?C++ FArchive::WriteCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArchive
的用法示例。
在下文中一共展示了FArchive::WriteCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteTexture
void FTextureManager::WriteTexture (FArchive &arc, int picnum)
{
FTexture *pic;
if (picnum < 0)
{
arc.WriteName(NULL);
return;
}
else if ((size_t)picnum >= Textures.Size())
{
pic = Textures[0].Texture;
}
else
{
pic = Textures[picnum].Texture;
}
if(strncmp(pic->Name, FONT_CHAR_NAME, 6) != 0)
arc.WriteName (pic->Name);
else
{
FString cname;
cname.Format("%s:%s", static_cast<FFontTexture*>(pic)->SourceFont->GetName(), pic->Name+6);
arc.WriteName (cname);
}
arc.WriteCount (pic->UseType);
}
示例2: Serialize
void DSpotState::Serialize(FArchive &arc)
{
Super::Serialize(arc);
if (arc.IsStoring())
{
arc.WriteCount(SpotLists.Size());
for(unsigned i = 0; i < SpotLists.Size(); i++)
{
SpotLists[i]->Serialize(arc);
}
}
else
{
unsigned c = arc.ReadCount();
SpotLists.Resize(c);
for(unsigned i = 0; i < SpotLists.Size(); i++)
{
SpotLists[i] = new FSpotList;
SpotLists[i]->Serialize(arc);
}
}
}
示例3: SerializeChain
void DBaseDecal::SerializeChain (FArchive &arc, DBaseDecal **first)
{
DWORD numInChain;
DBaseDecal *fresh;
DBaseDecal **firstptr = first;
if (arc.IsLoading ())
{
numInChain = arc.ReadCount ();
while (numInChain--)
{
arc << fresh;
*firstptr = fresh;
fresh->WallPrev = firstptr;
firstptr = &fresh->WallNext;
}
}
else
{
numInChain = 0;
fresh = *firstptr;
while (fresh != NULL)
{
fresh = fresh->WallNext;
++numInChain;
}
arc.WriteCount (numInChain);
fresh = *firstptr;
while (numInChain--)
{
arc << fresh;
fresh = fresh->WallNext;
}
}
}
示例4: SerializeUserVars
void DObject::SerializeUserVars(FArchive &arc)
{
#if 0
PSymbolTable *symt;
FName varname;
DWORD count, j;
int *varloc = NULL;
symt = &GetClass()->Symbols;
if (arc.IsStoring())
{
// Write all user variables.
for (; symt != NULL; symt = symt->ParentSymbolTable)
{
for (unsigned i = 0; i < symt->Symbols.Size(); ++i)
{
PSymbol *sym = symt->Symbols[i];
if (sym->SymbolType == SYM_Variable)
{
PSymbolVariable *var = static_cast<PSymbolVariable *>(sym);
if (var->bUserVar)
{
count = var->ValueType.Type == VAL_Array ? var->ValueType.size : 1;
varloc = (int *)(reinterpret_cast<BYTE *>(this) + var->offset);
arc << var->SymbolName;
arc.WriteCount(count);
for (j = 0; j < count; ++j)
{
arc << varloc[j];
}
}
}
}
}
// Write terminator.
varname = NAME_None;
arc << varname;
}
else
{
// Read user variables until 'None' is encountered.
arc << varname;
while (varname != NAME_None)
{
PSymbol *sym = symt->FindSymbol(varname, true);
DWORD wanted = 0;
if (sym != NULL && sym->SymbolType == SYM_Variable)
{
PSymbolVariable *var = static_cast<PSymbolVariable *>(sym);
if (var->bUserVar)
{
wanted = var->ValueType.Type == VAL_Array ? var->ValueType.size : 1;
varloc = (int *)(reinterpret_cast<BYTE *>(this) + var->offset);
}
}
count = arc.ReadCount();
for (j = 0; j < MIN(wanted, count); ++j)
{
arc << varloc[j];
}
if (wanted < count)
{
// Ignore remaining values from archive.
for (; j < count; ++j)
{
int foo;
arc << foo;
}
}
arc << varname;
}
}
#endif
}