本文整理汇总了C++中FArchive::IsStoring方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::IsStoring方法的具体用法?C++ FArchive::IsStoring怎么用?C++ FArchive::IsStoring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArchive
的用法示例。
在下文中一共展示了FArchive::IsStoring方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeAll
void DThinker::SerializeAll (FArchive &arc, bool hubLoad, bool noStorePlayers)
{
DThinker *thinker;
if (arc.IsStoring () && noStorePlayers)
{
thinker = FirstThinker;
while (thinker)
{
// Don't store player mobjs.
if (!(thinker->IsKindOf(RUNTIME_CLASS(AActor)) &&
static_cast<AActor *>(thinker)->type == MT_PLAYER))
{
arc << (BYTE)1;
arc << thinker;
}
thinker = thinker->m_Next;
}
arc << (BYTE)0;
}
else if (arc.IsStoring ())
{
thinker = FirstThinker;
while (thinker)
{
arc << (BYTE)1;
arc << thinker;
thinker = thinker->m_Next;
}
arc << (BYTE)0;
}
else
{
if (hubLoad || noStorePlayers)
DestroyMostThinkers ();
else
DestroyAllThinkers ();
BYTE more;
arc >> more;
while (more)
{
DThinker *thinker;
arc >> thinker;
arc >> more;
}
// killough 3/26/98: Spawn icon landings:
P_SpawnBrainTargets ();
}
}
示例2: P_SerializePlayers
//
// P_ArchivePlayers
//
void P_SerializePlayers (FArchive &arc)
{
size_t i;
if (arc.IsStoring ())
{
for (i = 0; i < players.size(); i++)
arc << (int)players[i].playerstate;
}
else
{
int playerstate = (playerstate_t)0;
for (i = 0; i < players.size(); i++)
{
arc >> playerstate;
players[i].playerstate = (playerstate_t)playerstate;
}
}
for (i = 0; i < players.size(); i++)
{
if (players[i].ingame())
players[i].Serialize (arc);
}
}
示例3: Serialize
void DPlat::Serialize (FArchive &arc)
{
Super::Serialize (arc);
if (arc.IsStoring ())
{
arc << m_Speed
<< m_Low
<< m_High
<< m_Wait
<< m_Count
<< m_Status
<< m_OldStatus
<< m_Crush
<< m_Tag
<< m_Type;
}
else
{
arc >> m_Speed
>> m_Low
>> m_High
>> m_Wait
>> m_Count
>> m_Status
>> m_OldStatus
>> m_Crush
>> m_Tag
>> m_Type;
}
}
示例4: SerializeAll
void DThinker::SerializeAll (FArchive &arc, bool hubLoad)
{
DThinker *thinker;
if (arc.IsStoring ())
{
thinker = FirstThinker;
while (thinker)
{
arc << (BYTE)1;
arc << thinker;
thinker = thinker->m_Next;
}
arc << (BYTE)0;
}
else
{
if (hubLoad)
DestroyMostThinkers ();
else
DestroyAllThinkers ();
BYTE more;
arc >> more;
while (more)
{
DThinker *thinker;
arc >> thinker;
arc >> more;
}
// killough 3/26/98: Spawn icon landings:
P_SpawnBrainTargets ();
}
}
示例5: Serialize
void DGlow::Serialize (FArchive &arc)
{
Super::Serialize (arc);
if (arc.IsStoring ())
arc << m_Direction << m_MaxLight << m_MinLight;
else
arc >> m_Direction >> m_MaxLight >> m_MinLight;
}
示例6:
void DGlow2::Serialize (FArchive &arc)
{
Super::Serialize (arc);
if (arc.IsStoring ())
arc << m_End << m_MaxTics << m_OneShot << m_Start << m_Tics;
else
arc >> m_End >> m_MaxTics >> m_OneShot >> m_Start >> m_Tics;
}
示例7: Serialize
void DSectorEffect::Serialize (FArchive &arc)
{
Super::Serialize (arc);
if (arc.IsStoring ())
arc << m_Sector;
else
arc >> m_Sector;
}
示例8: Serialize
void MapThing::Serialize (FArchive &arc)
{
if (arc.IsStoring ())
{
arc << thingid << x << y << z << angle << type << flags;
}
else
{
arc >> thingid >> x >> y >> z >> angle >> type >> flags;
}
}
示例9: P_SerializeRNGState
void P_SerializeRNGState (FArchive &arc)
{
if (arc.IsStoring ())
{
arc << prndindex;
}
else
{
arc >> prndindex;
}
}
示例10: Serialize
void Serialize(FArchive & arc)
{
arc << xpos << ypos << draw;
if (arc.IsStoring())
{
TexMan.WriteTexture(arc, texturenum);
}
else
{
texturenum = TexMan.ReadTexture(arc);
}
}
示例11: Serialize
void MapThing::Serialize (FArchive &arc)
{
if (arc.IsStoring ())
{
arc << thingid << x << y << z << angle << type << flags << special
<< args[0] << args[1] << args[2] << args[3] << args[4];
}
else
{
arc >> thingid >> x >> y >> z >> angle >> type >> flags >> special
>> args[0] >> args[1] >> args[2] >> args[3] >> args[4];
}
}
示例12: P_SerializePlayers
//
// P_ArchivePlayers
//
void P_SerializePlayers (FArchive &arc, bool skipload)
{
BYTE numPlayers, numPlayersNow;
int i;
// Count the number of players present right now.
for (numPlayersNow = 0, i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
{
++numPlayersNow;
}
}
if (arc.IsStoring())
{
// Record the number of players in this save.
arc << numPlayersNow;
// Record each player's name, followed by their data.
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
{
arc.WriteString (players[i].userinfo.GetName());
players[i].Serialize (arc);
}
}
}
else
{
arc << numPlayers;
// If there is only one player in the game, they go to the
// first player present, no matter what their name.
if (numPlayers == 1)
{
ReadOnePlayer (arc, skipload);
}
else
{
ReadMultiplePlayers (arc, numPlayers, numPlayersNow, skipload);
}
if (!skipload && numPlayersNow > numPlayers)
{
SpawnExtraPlayers ();
}
// Redo pitch limits, since the spawned player has them at 0.
players[consoleplayer].SendPitchLimits();
}
}
示例13: Serialize
void AScriptedMarine::Serialize (FArchive &arc)
{
Super::Serialize (arc);
if (arc.IsStoring ())
{
arc.WriteSprite (SpriteOverride);
}
else
{
SpriteOverride = arc.ReadSprite ();
}
arc << CurrentWeapon;
}
示例14: G_SerializeHub
static void G_SerializeHub(FArchive & arc)
{
int i=hubdata.Size();
arc << i;
if (i>0)
{
if (arc.IsStoring()) arc.Write(&hubdata[0], i * sizeof(wbstartstruct_t));
else
{
hubdata.Resize(i);
arc.Read(&hubdata[0], i * sizeof(wbstartstruct_t));
}
}
else hubdata.Clear();
}
示例15: P_SerializePolyobjs
void P_SerializePolyobjs (FArchive &arc)
{
int i;
FPolyObj *po;
if (arc.IsStoring ())
{
int seg = ASEG_POLYOBJS;
arc << seg << po_NumPolyobjs;
for(i = 0, po = polyobjs; i < po_NumPolyobjs; i++, po++)
{
arc << po->tag << po->angle << po->StartSpot.x <<
po->StartSpot.y << po->interpolation;
}
}
else
{
int data;
angle_t angle;
fixed_t deltaX, deltaY;
arc << data;
if (data != ASEG_POLYOBJS)
I_Error ("Polyobject marker missing");
arc << data;
if (data != po_NumPolyobjs)
{
I_Error ("UnarchivePolyobjs: Bad polyobj count");
}
for (i = 0, po = polyobjs; i < po_NumPolyobjs; i++, po++)
{
arc << data;
if (data != po->tag)
{
I_Error ("UnarchivePolyobjs: Invalid polyobj tag");
}
arc << angle;
po->RotatePolyobj (angle);
arc << deltaX << deltaY << po->interpolation;
deltaX -= po->StartSpot.x;
deltaY -= po->StartSpot.y;
po->MovePolyobj (deltaX, deltaY, true);
}
}
}