From bd503213578f3335fac9ef75403479ca422e5adf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 8 Aug 2008 16:16:40 +0000 Subject: [PATCH] - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. SVN r1131 (trunk) --- docs/rh-log.txt | 1 + src/g_shared/a_sharedglobal.h | 18 ----------- src/namedef.h | 3 ++ src/p_buildmap.cpp | 12 ++----- src/p_mobj.cpp | 8 ++--- src/p_spec.cpp | 32 ++++--------------- src/s_advsound.cpp | 22 +++++++++++-- wadsrc/static/actors/shared/sharedmisc.txt | 28 ++++++++++++++++ wadsrc/static/actors/shared/soundsequence.txt | 8 +++++ 9 files changed, 70 insertions(+), 62 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 28f21ceaf..4b8847189 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ August 8, 2008 (Changes by Graf Zahl) +- Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. diff --git a/src/g_shared/a_sharedglobal.h b/src/g_shared/a_sharedglobal.h index d23e67d65..15e511917 100644 --- a/src/g_shared/a_sharedglobal.h +++ b/src/g_shared/a_sharedglobal.h @@ -78,24 +78,6 @@ private: DImpactDecal(); }; -class AAmbientSound : public AActor -{ - DECLARE_STATELESS_ACTOR (AAmbientSound, AActor) -public: - void Serialize (FArchive &arc); - - void BeginPlay (); - void Tick (); - void Activate (AActor *activator); - void Deactivate (AActor *activator); - -protected: - bool bActive; -private: - void SetTicker (struct AmbientSound *ambient); - int NextCheck; -}; - class ATeleportFog : public AActor { DECLARE_ACTOR (ATeleportFog, AActor) diff --git a/src/namedef.h b/src/namedef.h index 42a151554..8d7a503f5 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -52,6 +52,9 @@ xx(DoorCreak) xx(DoorMetal2) xx(Wind) +xx(PointPusher) +xx(PointPuller) + xx(BulletPuff) xx(StrifePuff) xx(MaulerPuff) diff --git a/src/p_buildmap.cpp b/src/p_buildmap.cpp index db3e9889b..3850983e4 100644 --- a/src/p_buildmap.cpp +++ b/src/p_buildmap.cpp @@ -787,20 +787,12 @@ static void Decrypt (void *to_, const void *from_, int len, int key) class ACustomSprite : public AActor { - DECLARE_ACTOR (ACustomSprite, AActor); + DECLARE_CLASS (ACustomSprite, AActor); public: void BeginPlay (); }; -FState ACustomSprite::States[] = -{ - S_NORMAL (TNT1, 'A', -1, NULL, NULL) -}; - -IMPLEMENT_ACTOR (ACustomSprite, Any, 9988, 0) - PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY) - PROP_SpawnState (0) -END_DEFAULTS +IMPLEMENT_CLASS (ACustomSprite) void ACustomSprite::BeginPlay () { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e8441253c..5c15f15a7 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3899,13 +3899,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) { mthing->args[0] = mthing->type - 14000; mthing->type = 14065; - i = RUNTIME_CLASS(AAmbientSound); - } - else - { - // find which type to spawn - i = DoomEdMap.FindType (mthing->type); } + // find which type to spawn + i = DoomEdMap.FindType (mthing->type); if (i == NULL) { diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 480e826b0..8cbd03235 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -1626,26 +1626,6 @@ void P_SetSectorFriction (int tag, int amount, bool alterFlag) // types 1 & 2 is the sector containing the MT_PUSH/MT_PULL Thing. -class APointPusher : public AActor -{ - DECLARE_STATELESS_ACTOR (APointPusher, AActor) -}; - -IMPLEMENT_STATELESS_ACTOR (APointPusher, Any, 5001, 0) - PROP_Flags (MF_NOBLOCKMAP) - PROP_RenderFlags (RF_INVISIBLE) -END_DEFAULTS - -class APointPuller : public AActor -{ - DECLARE_STATELESS_ACTOR (APointPuller, AActor) -}; - -IMPLEMENT_STATELESS_ACTOR (APointPuller, Any, 5002, 0) - PROP_Flags (MF_NOBLOCKMAP) - PROP_RenderFlags (RF_INVISIBLE) -END_DEFAULTS - #define PUSH_FACTOR 7 ///////////////////////////// @@ -1742,7 +1722,7 @@ void DPusher::Tick () if ((speed > 0) && (P_CheckSight (thing, m_Source, 1))) { angle_t pushangle = R_PointToAngle2 (thing->x, thing->y, sx, sy); - if (m_Source->IsA (RUNTIME_CLASS(APointPusher))) + if (m_Source->GetClass()->TypeName == NAME_PointPusher) pushangle += ANG180; // away pushangle >>= ANGLETOFINESHIFT; thing->momx += FixedMul (speed, finecosine[pushangle]); @@ -1838,8 +1818,8 @@ AActor *P_GetPushThing (int s) thing = sec->thinglist; while (thing && - !thing->IsA (RUNTIME_CLASS(APointPusher)) && - !thing->IsA (RUNTIME_CLASS(APointPuller))) + thing->GetClass()->TypeName != NAME_PointPusher && + thing->GetClass()->TypeName != NAME_PointPuller) { thing = thing->snext; } @@ -1889,10 +1869,12 @@ static void P_SpawnPushers () while ( (thing = iterator.Next ()) ) { - if (thing->IsA (RUNTIME_CLASS(APointPuller)) || - thing->IsA (RUNTIME_CLASS(APointPusher))) + if (thing->GetClass()->TypeName == NAME_PointPusher || + thing->GetClass()->TypeName == NAME_PointPuller) + { new DPusher (DPusher::p_push, l->args[3] ? l : NULL, l->args[2], 0, thing, thing->Sector - sectors); + } } } break; diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index b834dea21..975d30ef1 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -1842,9 +1842,25 @@ CCMD (playersounds) // AAmbientSound implementation --------------------------------------------- -IMPLEMENT_STATELESS_ACTOR (AAmbientSound, Any, 14065, 0) - PROP_Flags (MF_NOBLOCKMAP|MF_NOSECTOR) -END_DEFAULTS +class AAmbientSound : public AActor +{ + DECLARE_CLASS (AAmbientSound, AActor) +public: + void Serialize (FArchive &arc); + + void BeginPlay (); + void Tick (); + void Activate (AActor *activator); + void Deactivate (AActor *activator); + +protected: + bool bActive; +private: + void SetTicker (struct AmbientSound *ambient); + int NextCheck; +}; + +IMPLEMENT_CLASS (AAmbientSound) void AAmbientSound::Serialize (FArchive &arc) { diff --git a/wadsrc/static/actors/shared/sharedmisc.txt b/wadsrc/static/actors/shared/sharedmisc.txt index 3a6438812..b20326018 100644 --- a/wadsrc/static/actors/shared/sharedmisc.txt +++ b/wadsrc/static/actors/shared/sharedmisc.txt @@ -62,6 +62,20 @@ ACTOR MapSpotGravity : MapSpot 9013 -NOGRAVITY } +// Point Pushers --------------------------------------------------- + +ACTOR PointPusher 5001 +{ + +NOBLOCKMAP + +INVISIBLE +} + +ACTOR PointPuller 5002 +{ + +NOBLOCKMAP + +INVISIBLE +} + // Bloody gibs ------------------------------------------------------------- ACTOR RealGibs @@ -90,3 +104,17 @@ ACTOR Gibs : RealGibs 24 SpawnID 146 ClearFlags } + +// Needed for loading Build maps --------------------------------------- + +ACTOR CustomSprite 9988 native +{ + +NOBLOCKMAP + +NOGRAVITY + States + { + Spawn: + TNT1 A -1 + Stop + } +} diff --git a/wadsrc/static/actors/shared/soundsequence.txt b/wadsrc/static/actors/shared/soundsequence.txt index 523e97d4d..d4df59f39 100644 --- a/wadsrc/static/actors/shared/soundsequence.txt +++ b/wadsrc/static/actors/shared/soundsequence.txt @@ -1,4 +1,12 @@ +ACTOR AmbientSound 14065 native +{ + +NOBLOCKMAP + +NOSECTOR + +DONTSPLASH +} + + // Heretic Sound sequences ----------------------------------------------------------- ACTOR HereticSoundSequence1 : SoundSequence 1200