mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- added new serializers to several classes and moved the old ones to the dump file.
This commit is contained in:
parent
d24aa5dec9
commit
7edf4c1afc
21 changed files with 334 additions and 115 deletions
|
@ -583,7 +583,7 @@ public:
|
|||
void Destroy ();
|
||||
~AActor ();
|
||||
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
void PostSerialize();
|
||||
|
||||
|
@ -990,7 +990,7 @@ public:
|
|||
double Speed;
|
||||
double FloatSpeed;
|
||||
|
||||
WORD sprite; // used to find patch_t and flip value
|
||||
int sprite; // used to find patch_t and flip value
|
||||
BYTE frame; // sprite frame to draw
|
||||
DVector2 Scale; // Scaling values; 1 is normal size
|
||||
FRenderStyle RenderStyle; // Style to draw this actor with
|
||||
|
|
|
@ -438,6 +438,8 @@ template<class T> inline void GC::Mark(TObjPtr<T> &obj)
|
|||
GC::Mark(&obj.o);
|
||||
}
|
||||
|
||||
#define DECLARE_OLD_SERIAL virtual void Serialize(FArchive &arc);
|
||||
|
||||
class DObject
|
||||
{
|
||||
public:
|
||||
|
@ -467,7 +469,7 @@ public:
|
|||
inline bool IsA (const PClass *type) const;
|
||||
|
||||
void SerializeUserVars(FArchive &arc);
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
|
||||
void SerializeUserVars(FSerializer &arc);
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
|
|
|
@ -1781,7 +1781,7 @@ public:
|
|||
|
||||
DLightLevel(sector_t * s,int destlevel,int speed);
|
||||
void Serialize(FArchive &arc);
|
||||
void Serialize(FArchive &arc);
|
||||
//void Serialize(FArchive &arc);
|
||||
void Tick ();
|
||||
void Destroy() { Super::Destroy(); m_Sector->lightingdata=NULL; }
|
||||
};
|
||||
|
|
|
@ -29,7 +29,8 @@ public:
|
|||
void Tick ();
|
||||
void SetWeapon (EMarineWeapon);
|
||||
void SetSprite (PClassActor *source);
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
|
||||
int CurrentWeapon;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "portal.h"
|
||||
#include "d_player.h"
|
||||
#include "p_maputl.h"
|
||||
#include "serializer.h"
|
||||
#include "g_shared/a_pickups.h"
|
||||
|
||||
// Include all the other Doom stuff here to reduce compile time
|
||||
|
|
|
@ -21,19 +21,14 @@ static FRandom pr_m_fireshotgun2 ("SMarineFireSSG");
|
|||
|
||||
IMPLEMENT_CLASS (AScriptedMarine)
|
||||
|
||||
void AScriptedMarine::Serialize(FArchive &arc)
|
||||
void AScriptedMarine::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
|
||||
if (arc.IsStoring ())
|
||||
{
|
||||
arc.WriteSprite (SpriteOverride);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpriteOverride = arc.ReadSprite ();
|
||||
}
|
||||
arc << CurrentWeapon;
|
||||
auto def = (AScriptedMarine*)GetDefault();
|
||||
|
||||
arc.Sprite("spriteoverride", SpriteOverride, &def->SpriteOverride)
|
||||
("currentweapon", CurrentWeapon, def->CurrentWeapon);
|
||||
}
|
||||
|
||||
void AScriptedMarine::Activate (AActor *activator)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "d_player.h"
|
||||
#include "a_morph.h"
|
||||
#include "p_spec.h"
|
||||
#include "serializer.h"
|
||||
|
||||
// Include all the other Heretic stuff here to reduce compile time
|
||||
#include "a_chicken.cpp"
|
||||
|
|
|
@ -866,16 +866,18 @@ class ARainTracker : public AInventory
|
|||
{
|
||||
DECLARE_CLASS (ARainTracker, AInventory)
|
||||
public:
|
||||
void Serialize(FArchive &arc);
|
||||
AActor *Rain1, *Rain2;
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
TObjPtr<AActor> Rain1, Rain2;
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (ARainTracker)
|
||||
|
||||
void ARainTracker::Serialize(FArchive &arc)
|
||||
void ARainTracker::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << Rain1 << Rain2;
|
||||
arc("rain1", Rain1)
|
||||
("rain2", Rain2);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -64,19 +64,21 @@ class AHeresiarch : public AActor
|
|||
{
|
||||
DECLARE_CLASS (AHeresiarch, AActor)
|
||||
public:
|
||||
const PClass *StopBall;
|
||||
PClassActor *StopBall;
|
||||
DAngle BallAngle;
|
||||
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
void Die (AActor *source, AActor *inflictor, int dmgflags);
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (AHeresiarch)
|
||||
|
||||
void AHeresiarch::Serialize(FArchive &arc)
|
||||
void AHeresiarch::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << StopBall << BallAngle;
|
||||
arc("stopball", StopBall)
|
||||
("ballangle", BallAngle);
|
||||
}
|
||||
|
||||
void AHeresiarch::Die (AActor *source, AActor *inflictor, int dmgflags)
|
||||
|
@ -105,10 +107,13 @@ public:
|
|||
DAngle AngleOffset;
|
||||
DAngle OldAngle;
|
||||
|
||||
void Serialize(FArchive &arc)
|
||||
DECLARE_OLD_SERIAL
|
||||
|
||||
void Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << AngleOffset << OldAngle;
|
||||
arc("angleoffset", AngleOffset)
|
||||
("oldangle", OldAngle);
|
||||
}
|
||||
|
||||
bool SpecialBlastHandling (AActor *source, double strength)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "r_utility.h"
|
||||
#include "p_maputl.h"
|
||||
#include "p_spec.h"
|
||||
#include "serializer.h"
|
||||
|
||||
// Include all the Hexen stuff here to reduce compile time
|
||||
#include "a_bats.cpp"
|
||||
|
|
|
@ -22,7 +22,8 @@ class AThrustFloor : public AActor
|
|||
DECLARE_CLASS (AThrustFloor, AActor)
|
||||
HAS_OBJECT_POINTERS
|
||||
public:
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
|
||||
void Activate (AActor *activator);
|
||||
void Deactivate (AActor *activator);
|
||||
|
@ -34,10 +35,10 @@ IMPLEMENT_POINTY_CLASS (AThrustFloor)
|
|||
DECLARE_POINTER (DirtClump)
|
||||
END_POINTERS
|
||||
|
||||
void AThrustFloor::Serialize(FArchive &arc)
|
||||
void AThrustFloor::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << DirtClump;
|
||||
arc("dirtclump", DirtClump);
|
||||
}
|
||||
|
||||
void AThrustFloor::Activate (AActor *activator)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "farchive.h"
|
||||
#include "a_pickups.h"
|
||||
#include "d_player.h"
|
||||
#include "serializer.h"
|
||||
|
||||
#define MAULATORTICS (25*35)
|
||||
|
||||
|
@ -79,10 +80,10 @@ void AMinotaurFriend::BeginPlay ()
|
|||
StartTime = -1;
|
||||
}
|
||||
|
||||
void AMinotaurFriend::Serialize(FArchive &arc)
|
||||
void AMinotaurFriend::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << StartTime;
|
||||
arc("starttime", StartTime);
|
||||
}
|
||||
|
||||
void AMinotaurFriend::Die (AActor *source, AActor *inflictor, int dmgflags)
|
||||
|
|
|
@ -23,7 +23,8 @@ public:
|
|||
void Die (AActor *source, AActor *inflictor, int dmgflags);
|
||||
bool OkayToSwitchTarget (AActor *other);
|
||||
void BeginPlay ();
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
};
|
||||
|
||||
#endif //__RAVENSHARED_H__
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "g_level.h"
|
||||
#include "d_player.h"
|
||||
#include "farchive.h"
|
||||
#include "serializer.h"
|
||||
|
||||
|
||||
IMPLEMENT_CLASS (AArmor)
|
||||
|
@ -21,10 +22,17 @@ IMPLEMENT_CLASS (AHexenArmor)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ABasicArmor::Serialize(FArchive &arc)
|
||||
void ABasicArmor::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType << ActualSaveAmount;
|
||||
auto def = (ABasicArmor *)GetDefault();
|
||||
arc("savepercent", SavePercent, def->SavePercent)
|
||||
("bonuscount", BonusCount, def->BonusCount)
|
||||
("maxabsorb", MaxAbsorb, def->MaxAbsorb)
|
||||
("maxfullabsorb", MaxFullAbsorb, def->MaxFullAbsorb)
|
||||
("absorbcount", AbsorbCount, def->AbsorbCount)
|
||||
("armortype", ArmorType, def->ArmorType)
|
||||
("actualsaveamount", ActualSaveAmount, def->ActualSaveAmount);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -192,11 +200,15 @@ void ABasicArmor::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ABasicArmorPickup::Serialize(FArchive &arc)
|
||||
void ABasicArmorPickup::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << SavePercent << SaveAmount << MaxAbsorb << MaxFullAbsorb;
|
||||
arc << DropTime;
|
||||
|
||||
auto def = (ABasicArmorPickup *)GetDefault();
|
||||
arc("savepercent", SavePercent, def->SavePercent)
|
||||
("saveamount", SaveAmount, def->SaveAmount)
|
||||
("maxabsorb", MaxAbsorb, def->MaxAbsorb)
|
||||
("maxfullabsorb", MaxFullAbsorb, def->MaxFullAbsorb);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -274,11 +286,17 @@ bool ABasicArmorPickup::Use (bool pickup)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ABasicArmorBonus::Serialize(FArchive &arc)
|
||||
void ABasicArmorBonus::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << SavePercent << SaveAmount << MaxSaveAmount << BonusCount << BonusMax
|
||||
<< MaxAbsorb << MaxFullAbsorb;
|
||||
auto def = (ABasicArmorBonus *)GetDefault();
|
||||
arc("savepercent", SavePercent, def->SavePercent)
|
||||
("saveamount", SaveAmount, def->SaveAmount)
|
||||
("maxsaveamount", MaxSaveAmount, def->MaxSaveAmount)
|
||||
("bonuscount", BonusCount, def->BonusCount)
|
||||
("bonusmax", BonusMax, def->BonusMax)
|
||||
("maxabsorb", MaxAbsorb, def->MaxAbsorb)
|
||||
("maxfullabsorb", MaxFullAbsorb, def->MaxFullAbsorb);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -371,13 +389,12 @@ bool ABasicArmorBonus::Use (bool pickup)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AHexenArmor::Serialize(FArchive &arc)
|
||||
void AHexenArmor::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << Slots[0] << Slots[1] << Slots[2] << Slots[3]
|
||||
<< Slots[4]
|
||||
<< SlotsIncrement[0] << SlotsIncrement[1] << SlotsIncrement[2]
|
||||
<< SlotsIncrement[3];
|
||||
auto def = (AHexenArmor *)GetDefault();
|
||||
arc.Array("slots", Slots, def->Slots, 5, true)
|
||||
.Array("slotsincrement", SlotsIncrement, def->SlotsIncrement, 4);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "farchive.h"
|
||||
#include "d_player.h"
|
||||
#include "p_spec.h"
|
||||
#include "serializer.h"
|
||||
|
||||
static FRandom pr_restore ("RestorePos");
|
||||
|
||||
|
@ -89,10 +90,12 @@ IMPLEMENT_CLASS (AAmmo)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AAmmo::Serialize(FArchive &arc)
|
||||
void AAmmo::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << BackpackAmount << BackpackMaxAmount;
|
||||
auto def = (AAmmo*)GetDefault();
|
||||
arc("backpackamount", BackpackAmount, def->BackpackAmount)
|
||||
("backpackmaxamount", BackpackMaxAmount, def->BackpackMaxAmount);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -514,10 +517,21 @@ void AInventory::Tick ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AInventory::Serialize(FArchive &arc)
|
||||
void AInventory::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << Owner << Amount << MaxAmount << RespawnTics << ItemFlags << Icon << PickupSound << SpawnPointClass;
|
||||
|
||||
auto def = (AInventory*)GetDefault();
|
||||
arc("owner", Owner)
|
||||
("amount", Amount, def->Amount)
|
||||
("maxamount", MaxAmount, def->MaxAmount)
|
||||
("interhubamount", InterHubAmount, def->InterHubAmount)
|
||||
("respawntics", RespawnTics, def->RespawnTics)
|
||||
("itemflags", ItemFlags, def->ItemFlags)
|
||||
("icon", Icon, def->Icon)
|
||||
("pickupsound", PickupSound, def->PickupSound)
|
||||
("spawnpointclass", SpawnPointClass, def->SpawnPointClass)
|
||||
("droptime", DropTime, def->DropTime);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -1809,10 +1823,11 @@ bool AHealthPickup::Use (bool pickup)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AHealthPickup::Serialize(FArchive &arc)
|
||||
void AHealthPickup::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << autousemode;
|
||||
auto def = (AHealthPickup*)GetDefault();
|
||||
arc("autousemode", autousemode, def->autousemode);
|
||||
}
|
||||
|
||||
// Backpack -----------------------------------------------------------------
|
||||
|
@ -1823,10 +1838,11 @@ void AHealthPickup::Serialize(FArchive &arc)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ABackpackItem::Serialize(FArchive &arc)
|
||||
void ABackpackItem::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << bDepleted;
|
||||
auto def = (ABackpackItem*)GetDefault();
|
||||
arc("bdepleted", bDepleted, def->bDepleted);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -153,7 +153,8 @@ class AInventory : public AActor
|
|||
HAS_OBJECT_POINTERS
|
||||
public:
|
||||
virtual void Touch (AActor *toucher);
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
|
||||
virtual void MarkPrecacheSounds() const;
|
||||
virtual void BeginPlay ();
|
||||
|
@ -185,7 +186,7 @@ public:
|
|||
int RespawnTics; // Tics from pickup time to respawn time
|
||||
FTextureID Icon; // Icon to show on status bar or HUD
|
||||
int DropTime; // Countdown after dropping
|
||||
const PClass *SpawnPointClass; // For respawning like Heretic's mace
|
||||
PClassActor *SpawnPointClass; // For respawning like Heretic's mace
|
||||
|
||||
DWORD ItemFlags;
|
||||
PClassActor *PickupFlash; // actor to spawn as pickup flash
|
||||
|
@ -254,7 +255,8 @@ class AAmmo : public AInventory
|
|||
{
|
||||
DECLARE_CLASS_WITH_META(AAmmo, AInventory, PClassAmmo)
|
||||
public:
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
AInventory *CreateCopy (AActor *other);
|
||||
bool HandlePickup (AInventory *item);
|
||||
PClassActor *GetParentAmmo () const;
|
||||
|
@ -311,7 +313,8 @@ public:
|
|||
bool bAltFire; // Set when this weapon's alternate fire is used.
|
||||
|
||||
virtual void MarkPrecacheSounds() const;
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual bool ShouldStay ();
|
||||
virtual void AttachToOwner (AActor *other);
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
|
@ -395,7 +398,8 @@ class AWeaponGiver : public AWeapon
|
|||
|
||||
public:
|
||||
bool TryPickup(AActor *&toucher);
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
|
||||
double DropAmmoFactor;
|
||||
};
|
||||
|
@ -431,7 +435,8 @@ class AHealthPickup : public AInventory
|
|||
public:
|
||||
int autousemode;
|
||||
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual AInventory *CreateTossable ();
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
|
@ -451,7 +456,8 @@ class ABasicArmor : public AArmor
|
|||
{
|
||||
DECLARE_CLASS (ABasicArmor, AArmor)
|
||||
public:
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual void Tick ();
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
|
@ -471,7 +477,8 @@ class ABasicArmorPickup : public AArmor
|
|||
{
|
||||
DECLARE_CLASS (ABasicArmorPickup, AArmor)
|
||||
public:
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual bool Use (bool pickup);
|
||||
|
||||
|
@ -486,7 +493,8 @@ class ABasicArmorBonus : public AArmor
|
|||
{
|
||||
DECLARE_CLASS (ABasicArmorBonus, AArmor)
|
||||
public:
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual bool Use (bool pickup);
|
||||
|
||||
|
@ -505,7 +513,8 @@ class AHexenArmor : public AArmor
|
|||
{
|
||||
DECLARE_CLASS (AHexenArmor, AArmor)
|
||||
public:
|
||||
virtual void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
virtual void Serialize(FSerializer &arc);
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual AInventory *CreateTossable ();
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
|
@ -533,7 +542,7 @@ class APuzzleItem : public AInventory
|
|||
{
|
||||
DECLARE_CLASS_WITH_META(APuzzleItem, AInventory, PClassPuzzleItem)
|
||||
public:
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
bool ShouldStay ();
|
||||
bool Use (bool pickup);
|
||||
bool HandlePickup (AInventory *item);
|
||||
|
@ -555,7 +564,8 @@ class ABackpackItem : public AInventory
|
|||
{
|
||||
DECLARE_CLASS (ABackpackItem, AInventory)
|
||||
public:
|
||||
void Serialize(FArchive &arc);
|
||||
DECLARE_OLD_SERIAL
|
||||
void Serialize(FSerializer &arc);
|
||||
bool HandlePickup (AInventory *item);
|
||||
AInventory *CreateCopy (AActor *other);
|
||||
AInventory *CreateTossable ();
|
||||
|
|
|
@ -20,12 +20,6 @@ void PClassPuzzleItem::DeriveData(PClass *newclass)
|
|||
|
||||
IMPLEMENT_CLASS(APuzzleItem)
|
||||
|
||||
void APuzzleItem::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << PuzzleItemNumber;
|
||||
}
|
||||
|
||||
bool APuzzleItem::HandlePickup (AInventory *item)
|
||||
{
|
||||
// Can't carry more than 1 of each puzzle item in coop netplay
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "g_level.h"
|
||||
#include "d_net.h"
|
||||
#include "farchive.h"
|
||||
#include "serializer.h"
|
||||
|
||||
#define BONUSADD 6
|
||||
|
||||
|
@ -73,28 +74,45 @@ void PClassWeapon::ReplaceClassRef(PClass *oldclass, PClass *newclass)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AWeapon::Serialize(FArchive &arc)
|
||||
void AWeapon::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << WeaponFlags
|
||||
<< AmmoType1 << AmmoType2
|
||||
<< AmmoGive1 << AmmoGive2
|
||||
<< MinAmmo1 << MinAmmo2
|
||||
<< AmmoUse1 << AmmoUse2
|
||||
<< Kickback
|
||||
<< YAdjust
|
||||
<< UpSound << ReadySound
|
||||
<< SisterWeaponType
|
||||
<< ProjectileType << AltProjectileType
|
||||
<< SelectionOrder
|
||||
<< MoveCombatDist
|
||||
<< Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon
|
||||
<< bAltFire
|
||||
<< ReloadCounter
|
||||
<< BobStyle << BobSpeed << BobRangeX << BobRangeY
|
||||
<< FOVScale
|
||||
<< Crosshair
|
||||
<< MinSelAmmo1 << MinSelAmmo2;
|
||||
auto def = (AWeapon*)GetDefault();
|
||||
arc("weaponflags", WeaponFlags, def->WeaponFlags)
|
||||
("ammogive1", AmmoGive1, def->AmmoGive1)
|
||||
("ammogive2", AmmoGive2, def->AmmoGive2)
|
||||
("minammo1", MinAmmo1, def->MinAmmo1)
|
||||
("minammo2", MinAmmo2, def->MinAmmo2)
|
||||
("ammouse1", AmmoUse1, def->AmmoUse1)
|
||||
("ammouse2", AmmoUse2, def->AmmoUse2)
|
||||
("kickback", Kickback, Kickback)
|
||||
("yadjust", YAdjust, def->YAdjust)
|
||||
("upsound", UpSound, def->UpSound)
|
||||
("readysound", ReadySound, def->ReadySound)
|
||||
("selectionorder", SelectionOrder, def->SelectionOrder)
|
||||
("ammo1", Ammo1)
|
||||
("ammo2", Ammo2)
|
||||
("sisterweapon", SisterWeapon)
|
||||
("givenasmorphweapon", GivenAsMorphWeapon, def->GivenAsMorphWeapon)
|
||||
("altfire", bAltFire, def->bAltFire)
|
||||
("reloadcounter", ReloadCounter, def->ReloadCounter)
|
||||
("bobstyle", BobStyle, def->BobStyle)
|
||||
("bobspeed", BobSpeed, def->BobSpeed)
|
||||
("bobrangex", BobRangeX, def->BobRangeX)
|
||||
("bobrangey", BobRangeY, def->BobRangeY)
|
||||
("fovscale", FOVScale, def->FOVScale)
|
||||
("crosshair", Crosshair, def->Crosshair)
|
||||
("minselammo1", MinSelAmmo1, def->MinSelAmmo1)
|
||||
("minselammo2", MinSelAmmo2, def->MinSelAmmo2);
|
||||
/* these can never change
|
||||
("ammotype1", AmmoType1, def->AmmoType1)
|
||||
("ammotype2", AmmoType2, def->AmmoType2)
|
||||
("sisterweapontype", SisterWeaponType, def->SisterWeaponType)
|
||||
("projectiletype", ProjectileType, def->ProjectileType)
|
||||
("altprojectiletype", AltProjectileType, def->AltProjectileType)
|
||||
("movecombatdist", MoveCombatDist, def->MoveCombatDist)
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -737,10 +755,11 @@ FState *AWeapon::GetStateForButtonName (FName button)
|
|||
|
||||
IMPLEMENT_CLASS(AWeaponGiver)
|
||||
|
||||
void AWeaponGiver::Serialize(FArchive &arc)
|
||||
void AWeaponGiver::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << DropAmmoFactor;
|
||||
auto def = (AWeaponGiver *)GetDefault();
|
||||
arc("dropammofactor", DropAmmoFactor, def->DropAmmoFactor);
|
||||
}
|
||||
|
||||
bool AWeaponGiver::TryPickup(AActor *&toucher)
|
||||
|
|
|
@ -431,7 +431,7 @@ FSerializer &FSerializer::Terrain(const char *key, int &terrain, int *def)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FSerializer &FSerializer::Sprite(const char *key, uint16_t &spritenum, uint16_t *def)
|
||||
FSerializer &FSerializer::Sprite(const char *key, int32_t &spritenum, int32_t *def)
|
||||
{
|
||||
if (isWriting())
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
const char *GetOutput(unsigned *len = nullptr);
|
||||
FSerializer &Args(const char *key, int *args, int *defargs, int special);
|
||||
FSerializer &Terrain(const char *key, int &terrain, int *def = nullptr);
|
||||
FSerializer &Sprite(const char *key, uint16_t &spritenum, uint16_t *def);
|
||||
FSerializer &Sprite(const char *key, int32_t &spritenum, int32_t *def);
|
||||
FSerializer &StringPtr(const char *key, const char *&charptr); // This only retrieves the address but creates no permanent copy of the string.
|
||||
bool isReading() const
|
||||
{
|
||||
|
|
194
src/zzz_old.cpp
194
src/zzz_old.cpp
|
@ -1,5 +1,8 @@
|
|||
#ifdef COMMON_STUFF
|
||||
|
||||
#include "a_doomglobal.h"
|
||||
#include "ravenshared.h"
|
||||
|
||||
// For NULL states, which aren't owned by any actor, the owner
|
||||
// is recorded as AActor with the following state. AActor should
|
||||
// never actually have this many states of its own, so this
|
||||
|
@ -699,29 +702,178 @@ void DObject::Serialize(FArchive &arc)
|
|||
}
|
||||
|
||||
|
||||
class DLightLevel : public DLighting
|
||||
{
|
||||
DECLARE_CLASS(DLightLevel, DLighting)
|
||||
|
||||
unsigned char destlevel;
|
||||
unsigned char speed;
|
||||
|
||||
DLightLevel() {}
|
||||
|
||||
public:
|
||||
|
||||
DLightLevel(sector_t * s, int destlevel, int speed);
|
||||
void Serialize(FArchive &arc);
|
||||
void Serialize(FSerializer &arc);
|
||||
void Tick();
|
||||
void Destroy() { Super::Destroy(); m_Sector->lightingdata = NULL; }
|
||||
};
|
||||
|
||||
void DLightLevel::Serialize(FArchive &arc)
|
||||
void AScriptedMarine::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << destlevel << speed;
|
||||
if (arc.IsLoading()) m_Sector->lightingdata = this;
|
||||
|
||||
if (arc.IsStoring())
|
||||
{
|
||||
arc.WriteSprite(SpriteOverride);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpriteOverride = arc.ReadSprite();
|
||||
}
|
||||
arc << CurrentWeapon;
|
||||
}
|
||||
|
||||
|
||||
class AHeresiarch : public AActor
|
||||
{
|
||||
DECLARE_CLASS(AHeresiarch, AActor)
|
||||
public:
|
||||
PClassActor *StopBall;
|
||||
DAngle BallAngle;
|
||||
|
||||
DECLARE_OLD_SERIAL
|
||||
};
|
||||
|
||||
void AHeresiarch::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << StopBall << BallAngle;
|
||||
}
|
||||
|
||||
class ASorcBall : public AActor
|
||||
{
|
||||
DECLARE_CLASS(ASorcBall, AActor)
|
||||
public:
|
||||
DAngle AngleOffset;
|
||||
DAngle OldAngle;
|
||||
|
||||
DECLARE_OLD_SERIAL
|
||||
};
|
||||
|
||||
void ASorcBall::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << AngleOffset << OldAngle;
|
||||
}
|
||||
|
||||
class AThrustFloor : public AActor
|
||||
{
|
||||
DECLARE_CLASS(AThrustFloor, AActor)
|
||||
public:
|
||||
DECLARE_OLD_SERIAL
|
||||
|
||||
TObjPtr<AActor> DirtClump;
|
||||
};
|
||||
|
||||
void AThrustFloor::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << DirtClump;
|
||||
}
|
||||
|
||||
void AMinotaurFriend::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << StartTime;
|
||||
}
|
||||
|
||||
class ARainTracker : public AInventory
|
||||
{
|
||||
DECLARE_CLASS(ARainTracker, AInventory)
|
||||
public:
|
||||
DECLARE_OLD_SERIAL
|
||||
TObjPtr<AActor> Rain1, Rain2;
|
||||
};
|
||||
|
||||
void ARainTracker::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << Rain1 << Rain2;
|
||||
}
|
||||
|
||||
void AInventory::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << Owner << Amount << MaxAmount << RespawnTics << ItemFlags << Icon << PickupSound << SpawnPointClass;
|
||||
}
|
||||
|
||||
void AHealthPickup::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << autousemode;
|
||||
}
|
||||
|
||||
void AAmmo::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << BackpackAmount << BackpackMaxAmount;
|
||||
}
|
||||
|
||||
void AWeapon::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << WeaponFlags
|
||||
<< AmmoType1 << AmmoType2
|
||||
<< AmmoGive1 << AmmoGive2
|
||||
<< MinAmmo1 << MinAmmo2
|
||||
<< AmmoUse1 << AmmoUse2
|
||||
<< Kickback
|
||||
<< YAdjust
|
||||
<< UpSound << ReadySound
|
||||
<< SisterWeaponType
|
||||
<< ProjectileType << AltProjectileType
|
||||
<< SelectionOrder
|
||||
<< MoveCombatDist
|
||||
<< Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon
|
||||
<< bAltFire
|
||||
<< ReloadCounter
|
||||
<< BobStyle << BobSpeed << BobRangeX << BobRangeY
|
||||
<< FOVScale
|
||||
<< Crosshair
|
||||
<< MinSelAmmo1 << MinSelAmmo2;
|
||||
}
|
||||
|
||||
void ABackpackItem::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << bDepleted;
|
||||
}
|
||||
|
||||
void AWeaponGiver::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << DropAmmoFactor;
|
||||
}
|
||||
|
||||
void ABasicArmor::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType << ActualSaveAmount;
|
||||
}
|
||||
|
||||
void ABasicArmorPickup::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << SavePercent << SaveAmount << MaxAbsorb << MaxFullAbsorb;
|
||||
arc << DropTime;// in inventory!
|
||||
}
|
||||
|
||||
void ABasicArmorBonus::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << SavePercent << SaveAmount << MaxSaveAmount << BonusCount << BonusMax
|
||||
<< MaxAbsorb << MaxFullAbsorb;
|
||||
}
|
||||
|
||||
void AHexenArmor::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << Slots[0] << Slots[1] << Slots[2] << Slots[3]
|
||||
<< Slots[4]
|
||||
<< SlotsIncrement[0] << SlotsIncrement[1] << SlotsIncrement[2]
|
||||
<< SlotsIncrement[3];
|
||||
}
|
||||
|
||||
void APuzzleItem::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
arc << PuzzleItemNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue