From 88eab9d1f94c2b2b149030002d4df61bb1a9ea14 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 19 Sep 2016 15:07:53 +0200 Subject: [PATCH] - And another batch of serializers. --- src/d_dehacked.cpp | 6 +- src/d_dehacked.h | 3 +- src/d_player.h | 3 +- src/dsectoreffect.cpp | 10 +- src/dsectoreffect.h | 6 +- src/g_heretic/a_hereticmisc.cpp | 1 - src/g_heretic/a_hereticweaps.cpp | 5 +- src/g_hexen/a_clericholy.cpp | 5 +- src/g_hexen/a_magestaff.cpp | 5 +- src/g_shared/a_artifacts.cpp | 44 +++-- src/g_shared/a_artifacts.h | 18 +- src/g_shared/a_camera.cpp | 19 +- src/g_shared/a_morph.cpp | 21 ++- src/g_shared/a_movingcamera.cpp | 28 ++- src/g_shared/a_sharedglobal.h | 6 +- src/g_shared/a_soundsequence.cpp | 9 +- src/g_strife/a_strifeglobal.h | 3 +- src/g_strife/a_strifestuff.cpp | 2 +- src/g_strife/a_strifeweapons.cpp | 5 +- src/p_user.cpp | 44 +++-- src/s_advsound.cpp | 10 +- src/zzz_old.cpp | 301 +++++++++++++++++++++++++++++++ 22 files changed, 456 insertions(+), 98 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index dfa4f56f0..9e068b596 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -69,7 +69,7 @@ #include "i_system.h" #include "doomerrors.h" #include "p_effect.h" -#include "farchive.h" +#include "serializer.h" #include "vmbuilder.h" // [SO] Just the way Randy said to do it :) @@ -3198,8 +3198,8 @@ PClassActor *ADehackedPickup::DetermineType () return NULL; } -void ADehackedPickup::Serialize(FArchive &arc) +void ADehackedPickup::Serialize(FSerializer &arc) { Super::Serialize(arc); - arc << droppedbymonster; + arc("droppedbymonster", droppedbymonster); } diff --git a/src/d_dehacked.h b/src/d_dehacked.h index 4418f4f09..e256718b6 100644 --- a/src/d_dehacked.h +++ b/src/d_dehacked.h @@ -48,7 +48,8 @@ public: bool TryPickup (AActor *&toucher); void PlayPickupSound (AActor *toucher); void DoPickupSpecial (AActor *toucher); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); private: PClassActor *DetermineType (); AInventory *RealPickup; diff --git a/src/d_player.h b/src/d_player.h index deec3f61d..989b28691 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -102,7 +102,8 @@ class APlayerPawn : public AActor DECLARE_CLASS_WITH_META(APlayerPawn, AActor, PClassPlayerPawn) HAS_OBJECT_POINTERS public: - virtual void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); virtual void PostBeginPlay(); virtual void Tick(); diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index ed8eb3327..78e00e6b0 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -28,7 +28,7 @@ #include "p_3dmidtex.h" #include "r_data/r_interpolate.h" #include "statnums.h" -#include "farchive.h" +#include "serializer.h" #include "doomstat.h" IMPLEMENT_CLASS (DSectorEffect) @@ -64,10 +64,10 @@ DSectorEffect::DSectorEffect (sector_t *sector) m_Sector = sector; } -void DSectorEffect::Serialize(FArchive &arc) +void DSectorEffect::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << m_Sector; + arc("sector", m_Sector); } IMPLEMENT_POINTY_CLASS (DMover) @@ -90,10 +90,10 @@ void DMover::Destroy() Super::Destroy(); } -void DMover::Serialize(FArchive &arc) +void DMover::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << interpolation; + arc("interpolation", interpolation); } void DMover::StopInterpolation(bool force) diff --git a/src/dsectoreffect.h b/src/dsectoreffect.h index 775bca9ac..6008cb63f 100644 --- a/src/dsectoreffect.h +++ b/src/dsectoreffect.h @@ -10,7 +10,8 @@ class DSectorEffect : public DThinker public: DSectorEffect (sector_t *sector); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); void Destroy(); sector_t *GetSector() const { return m_Sector; } @@ -32,7 +33,8 @@ protected: private: protected: DMover (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); void Destroy(); }; diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 199b3f1c4..36969f6e7 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -14,7 +14,6 @@ #include "templates.h" #include "r_data/r_translate.h" #include "doomstat.h" -#include "farchive.h" #include "d_player.h" #include "a_morph.h" #include "p_spec.h" diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index dd6231288..34c77d316 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -1142,10 +1142,11 @@ class APhoenixRod : public AWeapon { DECLARE_CLASS (APhoenixRod, AWeapon) public: - void Serialize(FArchive &arc) + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << FlameCount; + arc("flamecount", FlameCount); } int FlameCount; // for flamethrower duration }; diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index 7c8e8f8e7..6a840edb5 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -31,10 +31,11 @@ class ACWeapWraithverge : public AClericWeapon { DECLARE_CLASS (ACWeapWraithverge, AClericWeapon) public: - void Serialize(FArchive &arc) + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << CHolyCount; + arc("cholycount", CHolyCount); } PalEntry GetBlend () { diff --git a/src/g_hexen/a_magestaff.cpp b/src/g_hexen/a_magestaff.cpp index 9ad303179..c05206d32 100644 --- a/src/g_hexen/a_magestaff.cpp +++ b/src/g_hexen/a_magestaff.cpp @@ -29,10 +29,11 @@ class AMWeapBloodscourge : public AMageWeapon { DECLARE_CLASS (AMWeapBloodscourge, AMageWeapon) public: - void Serialize(FArchive &arc) + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << MStaffCount; + arc("mstaffcount", MStaffCount); } PalEntry GetBlend () { diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 76426f554..77e5cede6 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -19,7 +19,7 @@ #include "g_level.h" #include "doomstat.h" #include "v_palette.h" -#include "farchive.h" +#include "serializer.h" #include "r_utility.h" #include "r_data/colormaps.h" @@ -101,12 +101,15 @@ bool APowerupGiver::Use (bool pickup) // //=========================================================================== -void APowerupGiver::Serialize(FArchive &arc) +void APowerupGiver::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << PowerupType; - arc << EffectTics << BlendColor << Mode; - arc << Strength; + auto def = (APowerupGiver*)GetDefault(); + arc("poweruptype", PowerupType, def->PowerupType) + ("effecttics", EffectTics, def->EffectTics) + ("blendcolor", BlendColor, def->BlendColor) + ("mode", Mode, def->Mode) + ("strength", Strength, def->Strength); } // Powerup ------------------------------------------------------------------- @@ -136,11 +139,14 @@ void APowerup::Tick () // //=========================================================================== -void APowerup::Serialize(FArchive &arc) +void APowerup::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << EffectTics << BlendColor << Mode; - arc << Strength; + auto def = (APowerup*)GetDefault(); + arc("effecttics", EffectTics, def->EffectTics) + ("blendcolor", BlendColor, def->BlendColor) + ("mode", Mode, def->Mode) + ("strength", Strength, def->Strength); } //=========================================================================== @@ -901,10 +907,11 @@ IMPLEMENT_CLASS (APowerTorch) // //=========================================================================== -void APowerTorch::Serialize(FArchive &arc) +void APowerTorch::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << NewTorch << NewTorchDelta; + arc("newtorch", NewTorch) + ("newtorchdelta", NewTorchDelta); } //=========================================================================== @@ -963,10 +970,10 @@ IMPLEMENT_CLASS (APowerFlight) // //=========================================================================== -void APowerFlight::Serialize(FArchive &arc) +void APowerFlight::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << HitCenterFrame; + arc("hitcenterframe", HitCenterFrame); } //=========================================================================== @@ -1217,10 +1224,10 @@ IMPLEMENT_CLASS (APowerSpeed) // //=========================================================================== -void APowerSpeed::Serialize(FArchive &arc) +void APowerSpeed::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << SpeedFlags; + arc("speedflags", SpeedFlags); } //=========================================================================== @@ -1899,11 +1906,14 @@ IMPLEMENT_CLASS(APowerMorph) // //=========================================================================== -void APowerMorph::Serialize(FArchive &arc) +void APowerMorph::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << PlayerClass << MorphStyle << MorphFlash << UnMorphFlash; - arc << Player; + arc("playerclass", PlayerClass) + ("morphstyle", MorphStyle) + ("morphflash", MorphFlash) + ("unmorphflash", UnMorphFlash) + ("player", Player); } //=========================================================================== diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index d742c2df4..97aaad0d3 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -16,7 +16,8 @@ public: virtual bool HandlePickup (AInventory *item); virtual AInventory *CreateCopy (AActor *other); virtual AInventory *CreateTossable (); - virtual void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); virtual void OwnerDied (); virtual bool GetNoTeleportFreeze(); virtual PalEntry GetBlend (); @@ -51,7 +52,8 @@ class APowerupGiver : public AInventory DECLARE_CLASS_WITH_META (APowerupGiver, AInventory, PClassPowerupGiver) public: virtual bool Use (bool pickup); - virtual void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); PClassActor *PowerupType; @@ -121,7 +123,8 @@ class APowerTorch : public APowerLightAmp { DECLARE_CLASS (APowerTorch, APowerLightAmp) public: - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); protected: void DoEffect (); int NewTorch, NewTorchDelta; @@ -132,7 +135,8 @@ class APowerFlight : public APowerup DECLARE_CLASS (APowerFlight, APowerup) public: bool DrawPowerup (int x, int y); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); protected: void InitEffect (); @@ -155,7 +159,8 @@ class APowerSpeed : public APowerup DECLARE_CLASS (APowerSpeed, APowerup) protected: void DoEffect (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); double GetSpeedFactor(); public: int SpeedFlags; @@ -272,7 +277,8 @@ class APowerMorph : public APowerup { DECLARE_CLASS( APowerMorph, APowerup ) public: - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + virtual void Serialize(FSerializer &arc); void SetNoCallUndoMorph() { bNoCallUndoMorph = true; } FNameNoInit PlayerClass, MorphFlash, UnMorphFlash; diff --git a/src/g_shared/a_camera.cpp b/src/g_shared/a_camera.cpp index 58eb3e114..b8f4730ad 100644 --- a/src/g_shared/a_camera.cpp +++ b/src/g_shared/a_camera.cpp @@ -36,7 +36,7 @@ #include "info.h" #include "a_sharedglobal.h" #include "p_local.h" -#include "farchive.h" +#include "serializer.h" #include "math/cmath.h" /* @@ -55,7 +55,8 @@ public: void PostBeginPlay (); void Tick (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); protected: DAngle Center; DAngle Acc; @@ -65,10 +66,13 @@ protected: IMPLEMENT_CLASS (ASecurityCamera) -void ASecurityCamera::Serialize(FArchive &arc) +void ASecurityCamera::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << Center << Acc << Delta << Range; + arc("center", Center) + ("acc", Acc) + ("delta", Delta) + ("range", Range); } void ASecurityCamera::PostBeginPlay () @@ -114,17 +118,18 @@ public: void PostBeginPlay (); void Tick (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); protected: DAngle MaxPitchChange; }; IMPLEMENT_CLASS (AAimingCamera) -void AAimingCamera::Serialize(FArchive &arc) +void AAimingCamera::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << MaxPitchChange; + arc("maxpitchchange", MaxPitchChange); } void AAimingCamera::PostBeginPlay () diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index b8c5096c0..46ae5cac7 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -11,9 +11,10 @@ #include "a_morph.h" #include "doomstat.h" #include "g_level.h" -#include "farchive.h" +#include "serializer.h" #include "p_enemy.h" #include "d_player.h" +#include "r_data/sprites.h" static FRandom pr_morphmonst ("MorphMonster"); @@ -634,10 +635,16 @@ int AMorphProjectile::DoSpecialDamage (AActor *target, int damage, FName damaget return -1; } -void AMorphProjectile::Serialize(FArchive &arc) +void AMorphProjectile::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << PlayerClass << MonsterClass << Duration << MorphStyle << MorphFlash << UnMorphFlash; + auto def = (AMorphProjectile*)GetDefault(); + arc("playerclass", PlayerClass, def->PlayerClass) + ("monsterclass", MonsterClass, def->MonsterClass) + ("duration", Duration, def->Duration) + ("morphstyle", MorphStyle, def->MorphStyle) + ("morphflash", MorphFlash, def->MorphFlash) + ("unmorphflash", UnMorphFlash, def->UnMorphFlash); } @@ -647,10 +654,14 @@ IMPLEMENT_POINTY_CLASS (AMorphedMonster) DECLARE_POINTER (UnmorphedMe) END_POINTERS -void AMorphedMonster::Serialize(FArchive &arc) +void AMorphedMonster::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << UnmorphedMe << UnmorphTime << MorphStyle << MorphExitFlash << FlagsSave; + arc("unmorphedme", UnmorphedMe) + ("unmorphtime", UnmorphTime) + ("morphstyle", MorphStyle) + ("morphexitflash", MorphExitFlash) + ("flagsave", FlagsSave); } void AMorphedMonster::Destroy () diff --git a/src/g_shared/a_movingcamera.cpp b/src/g_shared/a_movingcamera.cpp index c18e6c483..72ceef268 100644 --- a/src/g_shared/a_movingcamera.cpp +++ b/src/g_shared/a_movingcamera.cpp @@ -37,7 +37,7 @@ #include "p_local.h" #include "p_lnspec.h" #include "doomstat.h" -#include "farchive.h" +#include "serializer.h" /* == InterpolationPoint: node along a camera's path @@ -60,7 +60,8 @@ public: AInterpolationPoint *ScanForLoop (); void FormChain (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); TObjPtr Next; }; @@ -69,10 +70,10 @@ IMPLEMENT_POINTY_CLASS (AInterpolationPoint) DECLARE_POINTER (Next) END_POINTERS -void AInterpolationPoint::Serialize(FArchive &arc) +void AInterpolationPoint::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << Next; + arc("next", Next); } void AInterpolationPoint::BeginPlay () @@ -166,7 +167,8 @@ protected: virtual bool Interpolate (); virtual void NewNode (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); bool bActive, bJustStepped; TObjPtr PrevNode, CurrNode; @@ -179,10 +181,15 @@ IMPLEMENT_POINTY_CLASS (APathFollower) DECLARE_POINTER (CurrNode) END_POINTERS -void APathFollower::Serialize(FArchive &arc) +void APathFollower::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << bActive << bJustStepped << PrevNode << CurrNode << Time << HoldTime; + arc("active", bActive) + ("juststepped", bJustStepped) + ("prevnode", PrevNode) + ("currnode", CurrNode) + ("time", Time) + ("holdtime", HoldTime); } // Interpolate between p2 and p3 along a Catmull-Rom spline @@ -577,7 +584,8 @@ class AMovingCamera : public APathFollower public: void PostBeginPlay (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); protected: bool Interpolate (); @@ -588,10 +596,10 @@ IMPLEMENT_POINTY_CLASS (AMovingCamera) DECLARE_POINTER (Activator) END_POINTERS -void AMovingCamera::Serialize(FArchive &arc) +void AMovingCamera::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << Activator; + arc("activator", Activator); } void AMovingCamera::PostBeginPlay () diff --git a/src/g_shared/a_sharedglobal.h b/src/g_shared/a_sharedglobal.h index b4a5fbbf7..1a03c6767 100644 --- a/src/g_shared/a_sharedglobal.h +++ b/src/g_shared/a_sharedglobal.h @@ -194,7 +194,8 @@ class AMorphProjectile : public AActor DECLARE_CLASS (AMorphProjectile, AActor) public: int DoSpecialDamage (AActor *target, int damage, FName damagetype); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); FNameNoInit PlayerClass, MonsterClass, MorphFlash, UnMorphFlash; int Duration, MorphStyle; @@ -206,7 +207,8 @@ class AMorphedMonster : public AActor HAS_OBJECT_POINTERS public: void Tick (); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); void Die (AActor *source, AActor *inflictor, int dmgflags); void Destroy (); diff --git a/src/g_shared/a_soundsequence.cpp b/src/g_shared/a_soundsequence.cpp index c1b9ced78..d824b9678 100644 --- a/src/g_shared/a_soundsequence.cpp +++ b/src/g_shared/a_soundsequence.cpp @@ -65,7 +65,7 @@ #include "s_sound.h" #include "m_random.h" #include "s_sndseq.h" -#include "farchive.h" +#include "serializer.h" // SoundSequenceSlot -------------------------------------------------------- @@ -74,7 +74,8 @@ class ASoundSequenceSlot : public AActor DECLARE_CLASS (ASoundSequenceSlot, AActor) HAS_OBJECT_POINTERS public: - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); TObjPtr Sequence; }; @@ -89,10 +90,10 @@ END_POINTERS // //========================================================================== -void ASoundSequenceSlot::Serialize(FArchive &arc) +void ASoundSequenceSlot::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << Sequence; + arc("sequence", Sequence); } // SoundSequence ------------------------------------------------------------ diff --git a/src/g_strife/a_strifeglobal.h b/src/g_strife/a_strifeglobal.h index 58974e41e..30a14e91b 100644 --- a/src/g_strife/a_strifeglobal.h +++ b/src/g_strife/a_strifeglobal.h @@ -55,7 +55,8 @@ class ASigil : public AWeapon public: bool HandlePickup (AInventory *item); AInventory *CreateCopy (AActor *other); - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); bool SpecialDropAction (AActor *dropper); static int GiveSigilPiece (AActor *daPlayer); void BeginPlay(); diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 4533016ec..ad6bbe133 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -18,7 +18,7 @@ #include "templates.h" #include "d_event.h" #include "v_font.h" -#include "farchive.h" +#include "serializer.h" #include "p_spec.h" #include "portal.h" diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index de03e6049..be3c3bf2b 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -753,10 +753,11 @@ void ASigil::BeginPlay() // //============================================================================ -void ASigil::Serialize(FArchive &arc) +void ASigil::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << NumPieces << DownPieces; + arc("numpieces", NumPieces) + ("downpieces", DownPieces); } //============================================================================ diff --git a/src/p_user.cpp b/src/p_user.cpp index 25bdd70aa..bfefca466 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -53,6 +53,7 @@ #include "d_net.h" #include "gstrings.h" #include "farchive.h" +#include "serializer.h" #include "r_renderer.h" #include "d_player.h" #include "r_utility.h" @@ -631,29 +632,32 @@ END_POINTERS IMPLEMENT_CLASS (APlayerChunk) -void APlayerPawn::Serialize(FArchive &arc) +void APlayerPawn::Serialize(FSerializer &arc) { Super::Serialize (arc); + auto def = (APlayerPawn*)GetDefault(); - arc << JumpZ - << MaxHealth - << RunHealth - << SpawnMask - << ForwardMove1 - << ForwardMove2 - << SideMove1 - << SideMove2 - << ScoreIcon - << InvFirst - << InvSel - << MorphWeapon - << DamageFade - << PlayerFlags - << FlechetteType; - arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed; - arc << UseRange; - arc << AirCapacity; - arc << ViewHeight; + arc("jumpz", JumpZ, def->JumpZ) + ("maxhealth", MaxHealth, def->MaxHealth) + ("runhealth", RunHealth, def->RunHealth) + ("spawnmask", SpawnMask, def->SpawnMask) + ("forwardmove1", ForwardMove1, def->ForwardMove1) + ("forwardmove2", ForwardMove2, def->ForwardMove2) + ("sidemove1", SideMove1, def->SideMove1) + ("sidemove2", SideMove2, def->SideMove2) + ("scoreicon", ScoreIcon, def->ScoreIcon) + ("invfirst", InvFirst) + ("invsel", InvSel) + ("morphweapon", MorphWeapon, def->MorphWeapon) + ("damagefade", DamageFade, def->DamageFade) + ("playerflags", PlayerFlags, def->PlayerFlags) + ("flechettetype", FlechetteType, def->FlechetteType) + ("gruntspeed", GruntSpeed, def->GruntSpeed) + ("fallingscreammin", FallingScreamMinSpeed, def->FallingScreamMinSpeed) + ("fallingscreammaxn", FallingScreamMaxSpeed, def->FallingScreamMaxSpeed) + ("userange", UseRange, def->UseRange) + ("aircapacity", AirCapacity, def->AirCapacity) + ("viewheight", ViewHeight, def->ViewHeight); } //=========================================================================== diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 0c57288f9..c390e6797 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -50,7 +50,7 @@ #include "d_netinf.h" #include "i_system.h" #include "d_player.h" -#include "farchive.h" +#include "serializer.h" // MACROS ------------------------------------------------------------------ @@ -2102,7 +2102,8 @@ class AAmbientSound : public AActor { DECLARE_CLASS (AAmbientSound, AActor) public: - void Serialize(FArchive &arc); + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); void MarkPrecacheSounds () const; void BeginPlay (); @@ -2125,10 +2126,11 @@ IMPLEMENT_CLASS (AAmbientSound) // //========================================================================== -void AAmbientSound::Serialize(FArchive &arc) +void AAmbientSound::Serialize(FSerializer &arc) { Super::Serialize (arc); - arc << bActive << NextCheck; + arc("active", bActive) + ("nextcheck", NextCheck); } //========================================================================== diff --git a/src/zzz_old.cpp b/src/zzz_old.cpp index 37486164f..82e59cbb8 100644 --- a/src/zzz_old.cpp +++ b/src/zzz_old.cpp @@ -1,8 +1,11 @@ #ifdef COMMON_STUFF #include "a_doomglobal.h" +#include "a_hexenglobal.h" +#include "a_strifeglobal.h" #include "ravenshared.h" #include "a_weaponpiece.h" +#include "d_dehacked.h" // For NULL states, which aren't owned by any actor, the owner // is recorded as AActor with the following state. AActor should @@ -1037,6 +1040,304 @@ void AWeaponPiece::Serialize(FArchive &arc) arc << WeaponClass << FullWeapon << PieceValue; } +void DSectorEffect::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << m_Sector; +} + +void DMover::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << interpolation; +} + +class AAmbientSound : public AActor +{ + DECLARE_CLASS(AAmbientSound, AActor) +public: + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); + + void MarkPrecacheSounds() const; + void BeginPlay(); + void Tick(); + void Activate(AActor *activator); + void Deactivate(AActor *activator); + +protected: + bool bActive; +private: + void SetTicker(struct FAmbientSound *ambient); + int NextCheck; +}; + +void AAmbientSound::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << bActive << NextCheck; +} + +class AInterpolationPoint : public AActor +{ + DECLARE_CLASS(AInterpolationPoint, AActor) + HAS_OBJECT_POINTERS +public: + void BeginPlay(); + void HandleSpawnFlags(); + void Tick() {} // Nodes do no thinking + AInterpolationPoint *ScanForLoop(); + void FormChain(); + + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); + + TObjPtr Next; +}; + +class APathFollower : public AActor +{ + DECLARE_CLASS(APathFollower, AActor) + HAS_OBJECT_POINTERS +public: + void BeginPlay(); + void PostBeginPlay(); + void Tick(); + void Activate(AActor *activator); + void Deactivate(AActor *activator); +protected: + double Splerp(double p1, double p2, double p3, double p4); + double Lerp(double p1, double p2); + virtual bool Interpolate(); + virtual void NewNode(); + + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); + + bool bActive, bJustStepped; + TObjPtr PrevNode, CurrNode; + float Time; // Runs from 0.0 to 1.0 between CurrNode and CurrNode->Next + int HoldTime; +}; + +void AInterpolationPoint::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << Next; +} + +void APathFollower::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << bActive << bJustStepped << PrevNode << CurrNode << Time << HoldTime; +} + +class AMovingCamera : public APathFollower +{ + DECLARE_CLASS(AMovingCamera, APathFollower) + HAS_OBJECT_POINTERS +public: + void PostBeginPlay(); + + DECLARE_OLD_SERIAL + void Serialize(FSerializer &arc); +protected: + bool Interpolate(); + + TObjPtr Activator; +}; + +void AMovingCamera::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << Activator; +} + +void AMorphProjectile::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << PlayerClass << MonsterClass << Duration << MorphStyle << MorphFlash << UnMorphFlash; +} + +void AMorphedMonster::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << UnmorphedMe << UnmorphTime << MorphStyle << MorphExitFlash << FlagsSave; +} + +void ADehackedPickup::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << droppedbymonster; +} + +class ASoundSequenceSlot : public AActor +{ + DECLARE_CLASS(ASoundSequenceSlot, AActor) + HAS_OBJECT_POINTERS +public: + DECLARE_OLD_SERIAL + + TObjPtr Sequence; +}; + +void ASoundSequenceSlot::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << Sequence; +} + +void APlayerPawn::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + + arc << JumpZ + << MaxHealth + << RunHealth + << SpawnMask + << ForwardMove1 + << ForwardMove2 + << SideMove1 + << SideMove2 + << ScoreIcon + << InvFirst + << InvSel + << MorphWeapon + << DamageFade + << PlayerFlags + << FlechetteType; + arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed; + arc << UseRange; + arc << AirCapacity; + arc << ViewHeight; +} + +class APhoenixRod : public AWeapon +{ + DECLARE_CLASS(APhoenixRod, AWeapon) +public: + DECLARE_OLD_SERIAL + int FlameCount; // for flamethrower duration +}; + +void APhoenixRod::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << FlameCount; +} + +class ACWeapWraithverge : public AClericWeapon +{ + DECLARE_CLASS(ACWeapWraithverge, AClericWeapon) +public: + void Serialize(FArchive &arc); + BYTE CHolyCount; +}; + +void ACWeapWraithverge::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << CHolyCount; +} + +class AMWeapBloodscourge : public AMageWeapon +{ + DECLARE_CLASS(AMWeapBloodscourge, AMageWeapon) +public: + void Serialize(FArchive &arc); + BYTE MStaffCount; +}; + +void AMWeapBloodscourge::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << MStaffCount; +} + +void ASigil::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << NumPieces << DownPieces; +} + +class ASecurityCamera : public AActor +{ + DECLARE_CLASS(ASecurityCamera, AActor) +public: + void PostBeginPlay(); + void Tick(); + + void Serialize(FArchive &arc); +protected: + DAngle Center; + DAngle Acc; + DAngle Delta; + DAngle Range; +}; + +void ASecurityCamera::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << Center << Acc << Delta << Range; +} + + +class AAimingCamera : public ASecurityCamera +{ + DECLARE_CLASS(AAimingCamera, ASecurityCamera) +public: + void PostBeginPlay(); + void Tick(); + + void Serialize(FArchive &arc); +protected: + DAngle MaxPitchChange; +}; + +void AAimingCamera::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << MaxPitchChange; +} + +void APowerupGiver::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << PowerupType; + arc << EffectTics << BlendColor << Mode; + arc << Strength; +} +void APowerup::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << EffectTics << BlendColor << Mode; + arc << Strength; +} + +void APowerTorch::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << NewTorch << NewTorchDelta; +} + +void APowerFlight::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << HitCenterFrame; +} + +void APowerSpeed::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << SpeedFlags; +} + +void APowerMorph::Serialize(FArchive &arc) +{ + Super::Serialize(arc); + arc << PlayerClass << MorphStyle << MorphFlash << UnMorphFlash; + arc << Player; +} #endif \ No newline at end of file