- Fixed: Because PClass is a child of DObject now, attempts to serialize them get caught by
the DObject serialization template. Therefore, FArchive::SerializeObject() needs to be able to handle them specially from other objects. SVN r3924 (scripting)
This commit is contained in:
parent
e7168b3a51
commit
80782d7e5e
3 changed files with 21 additions and 21 deletions
|
|
@ -1024,13 +1024,28 @@ FArchive &FArchive::SerializePointer (void *ptrbase, BYTE **ptr, DWORD elemSize)
|
|||
|
||||
FArchive &FArchive::SerializeObject (DObject *&object, PClass *type)
|
||||
{
|
||||
if (IsStoring ())
|
||||
{
|
||||
return WriteObject (object);
|
||||
if (!type->IsDescendantOf(RUNTIME_CLASS(PClass)))
|
||||
{ // a regular object
|
||||
if (IsStoring())
|
||||
{
|
||||
return WriteObject(object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ReadObject(object, type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return ReadObject (object, type);
|
||||
{ // a class object
|
||||
if (IsStoring())
|
||||
{
|
||||
UserWriteClass((PClass *)object);
|
||||
}
|
||||
else
|
||||
{
|
||||
UserReadClass(object);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1493,19 +1508,6 @@ void FArchive::UserReadClass (PClass *&type)
|
|||
}
|
||||
}
|
||||
|
||||
FArchive &operator<< (FArchive &arc, PClass *&info)
|
||||
{
|
||||
if (arc.IsStoring ())
|
||||
{
|
||||
arc.UserWriteClass (info);
|
||||
}
|
||||
else
|
||||
{
|
||||
arc.UserReadClass (info);
|
||||
}
|
||||
return arc;
|
||||
}
|
||||
|
||||
FArchive &operator<< (FArchive &arc, sector_t *&sec)
|
||||
{
|
||||
return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue