- all thinker serializers done.
This commit is contained in:
parent
a5000ead4c
commit
ab43e0c8cb
27 changed files with 561 additions and 653 deletions
|
|
@ -56,7 +56,7 @@
|
|||
#include "t_script.h"
|
||||
#include "i_system.h"
|
||||
#include "w_wad.h"
|
||||
#include "farchive.h"
|
||||
#include "serializer.h"
|
||||
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -81,10 +81,14 @@ END_POINTERS
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DFsSection::Serialize(FArchive &ar)
|
||||
void DFsSection::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(ar);
|
||||
ar << type << start_index << end_index << loop_index << next;
|
||||
Super::Serialize(arc);
|
||||
arc("type", type)
|
||||
("start_index", start_index)
|
||||
("end_index", end_index)
|
||||
("loop_index", loop_index)
|
||||
("next", next);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include "i_system.h"
|
||||
#include "doomerrors.h"
|
||||
#include "doomstat.h"
|
||||
#include "farchive.h"
|
||||
#include "serializer.h"
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
@ -187,18 +187,23 @@ void DFsScript::Destroy()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DFsScript::Serialize(FArchive &arc)
|
||||
void DFsScript::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
// don't save a reference to the global script
|
||||
if (parent == global_script) parent = NULL;
|
||||
if (parent == global_script) parent = nullptr;
|
||||
|
||||
arc << data << scriptnum << len << parent << trigger << lastiftrue;
|
||||
for(int i=0; i< SECTIONSLOTS; i++) arc << sections[i];
|
||||
for(int i=0; i< VARIABLESLOTS; i++) arc << variables[i];
|
||||
for(int i=0; i< MAXSCRIPTS; i++) arc << children[i];
|
||||
arc("data", data)
|
||||
("scriptnum", scriptnum)
|
||||
("len", len)
|
||||
("parent", parent)
|
||||
("trigger", trigger)
|
||||
("lastiftrue", lastiftrue)
|
||||
.Array("sections", sections, SECTIONSLOTS)
|
||||
.Array("variables", variables, VARIABLESLOTS)
|
||||
.Array("children", children, MAXSCRIPTS);
|
||||
|
||||
if (parent == NULL) parent = global_script;
|
||||
if (parent == nullptr) parent = global_script;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -338,12 +343,17 @@ void DRunningScript::Destroy()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DRunningScript::Serialize(FArchive &arc)
|
||||
void DRunningScript::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
|
||||
arc << script << save_point << wait_type << wait_data << prev << next << trigger;
|
||||
for(int i=0; i< VARIABLESLOTS; i++) arc << variables[i];
|
||||
arc("script", script)
|
||||
("save_point", save_point)
|
||||
("wait_type", wait_type)
|
||||
("wait_data", wait_data)
|
||||
("prev", prev)
|
||||
("next", next)
|
||||
("trigger", trigger)
|
||||
.Array("variables", variables, VARIABLESLOTS);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -416,10 +426,13 @@ void DFraggleThinker::Destroy()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DFraggleThinker::Serialize(FArchive &arc)
|
||||
void DFraggleThinker::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << LevelScript << RunningScripts << SpawnedThings << nocheckposition;
|
||||
arc("levelscript", LevelScript)
|
||||
("runningscripts", RunningScripts)
|
||||
("spawnedthings", SpawnedThings)
|
||||
("nocheckposition", nocheckposition);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ public:
|
|||
|
||||
void GetValue(svalue_t &result);
|
||||
void SetValue(const svalue_t &newvalue);
|
||||
void Serialize(FArchive &ar);
|
||||
void Serialize(FSerializer &ar);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -238,7 +238,7 @@ public:
|
|||
next = NULL;
|
||||
}
|
||||
|
||||
void Serialize(FArchive &ar);
|
||||
void Serialize(FSerializer &ar);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ public:
|
|||
|
||||
DFsScript();
|
||||
void Destroy();
|
||||
void Serialize(FArchive &ar);
|
||||
void Serialize(FSerializer &ar);
|
||||
|
||||
DFsVariable *NewVariable(const char *name, int vtype);
|
||||
void NewFunction(const char *name, void (FParser::*handler)());
|
||||
|
|
@ -652,7 +652,7 @@ class DRunningScript : public DObject
|
|||
public:
|
||||
DRunningScript(AActor *trigger=NULL, DFsScript *owner = NULL, int index = 0) ;
|
||||
void Destroy();
|
||||
void Serialize(FArchive &arc);
|
||||
void Serialize(FSerializer &arc);
|
||||
|
||||
TObjPtr<DFsScript> script;
|
||||
|
||||
|
|
@ -689,7 +689,7 @@ public:
|
|||
void Destroy();
|
||||
|
||||
|
||||
void Serialize(FArchive & arc);
|
||||
void Serialize(FSerializer & arc);
|
||||
void Tick();
|
||||
size_t PropagateMark();
|
||||
size_t PointerSubstitution (DObject *old, DObject *notOld);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
#include "t_script.h"
|
||||
#include "a_pickups.h"
|
||||
#include "farchive.h"
|
||||
#include "serializer.h"
|
||||
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -306,10 +306,15 @@ void DFsVariable::SetValue(const svalue_t &newvalue)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DFsVariable::Serialize(FArchive & ar)
|
||||
void DFsVariable::Serialize(FSerializer & ar)
|
||||
{
|
||||
Super::Serialize(ar);
|
||||
ar << Name << type << string << actor << value.i << next;
|
||||
ar("name", Name)
|
||||
("type", type)
|
||||
("string", string)
|
||||
("actor", actor)
|
||||
("value", value.i)
|
||||
("next", next);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue