- moved dumpactors CCMD out of dobject.cpp.

This commit is contained in:
Christoph Oelckers 2020-04-11 19:23:35 +02:00
parent cf51508ce6
commit 933c1f6403
2 changed files with 43 additions and 45 deletions

View file

@ -34,17 +34,14 @@
#include <stdlib.h> #include <stdlib.h>
#include "dobject.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "actor.h"
#include "doomstat.h" // Ideally, DObjects can be used independant of Doom.
#include "d_player.h" // See p_user.cpp to find out why this doesn't work.
#include "c_dispatch.h" #include "c_dispatch.h"
#include "dsectoreffect.h"
#include "serializer.h" #include "serializer.h"
#include "vm.h" #include "vm.h"
#include "g_levellocals.h"
#include "types.h" #include "types.h"
#include "i_time.h" #include "i_time.h"
#include "printf.h"
//========================================================================== //==========================================================================
// //
@ -68,46 +65,6 @@ _DECLARE_TI(DObject)
// This bit is needed in the playsim - but give it a less crappy name. // This bit is needed in the playsim - but give it a less crappy name.
DEFINE_FIELD_BIT(DObject,ObjectFlags, bDestroyed, OF_EuthanizeMe) DEFINE_FIELD_BIT(DObject,ObjectFlags, bDestroyed, OF_EuthanizeMe)
//==========================================================================
//
//
//
//==========================================================================
CCMD (dumpactors)
{
const char *const filters[32] =
{
"0:All", "1:Doom", "2:Heretic", "3:DoomHeretic", "4:Hexen", "5:DoomHexen", "6:Raven", "7:IdRaven",
"8:Strife", "9:DoomStrife", "10:HereticStrife", "11:DoomHereticStrife", "12:HexenStrife",
"13:DoomHexenStrife", "14:RavenStrife", "15:NotChex", "16:Chex", "17:DoomChex", "18:HereticChex",
"19:DoomHereticChex", "20:HexenChex", "21:DoomHexenChex", "22:RavenChex", "23:NotStrife", "24:StrifeChex",
"25:DoomStrifeChex", "26:HereticStrifeChex", "27:NotHexen", "28:HexenStrifeChex", "29:NotHeretic",
"30:NotDoom", "31:All",
};
Printf("%u object class types total\nActor\tEd Num\tSpawnID\tFilter\tSource\n", PClass::AllClasses.Size());
for (unsigned int i = 0; i < PClass::AllClasses.Size(); i++)
{
PClass *cls = PClass::AllClasses[i];
PClassActor *acls = ValidateActor(cls);
if (acls != NULL)
{
auto ainfo = acls->ActorInfo();
Printf("%s\t%i\t%i\t%s\t%s\n",
acls->TypeName.GetChars(), ainfo->DoomEdNum,
ainfo->SpawnID, filters[ainfo->GameFilter & 31],
acls->SourceLumpName.GetChars());
}
else if (cls != NULL)
{
Printf("%s\tn/a\tn/a\tn/a\tEngine (not an actor type)\tSource: %s\n", cls->TypeName.GetChars(), cls->SourceLumpName.GetChars());
}
else
{
Printf("Type %i is not an object class\n", i);
}
}
}
//========================================================================== //==========================================================================
// //

View file

@ -1141,3 +1141,44 @@ CCMD(idmus)
} }
} }
//==========================================================================
//
//
//
//==========================================================================
CCMD(dumpactors)
{
const char* const filters[32] =
{
"0:All", "1:Doom", "2:Heretic", "3:DoomHeretic", "4:Hexen", "5:DoomHexen", "6:Raven", "7:IdRaven",
"8:Strife", "9:DoomStrife", "10:HereticStrife", "11:DoomHereticStrife", "12:HexenStrife",
"13:DoomHexenStrife", "14:RavenStrife", "15:NotChex", "16:Chex", "17:DoomChex", "18:HereticChex",
"19:DoomHereticChex", "20:HexenChex", "21:DoomHexenChex", "22:RavenChex", "23:NotStrife", "24:StrifeChex",
"25:DoomStrifeChex", "26:HereticStrifeChex", "27:NotHexen", "28:HexenStrifeChex", "29:NotHeretic",
"30:NotDoom", "31:All",
};
Printf("%u object class types total\nActor\tEd Num\tSpawnID\tFilter\tSource\n", PClass::AllClasses.Size());
for (unsigned int i = 0; i < PClass::AllClasses.Size(); i++)
{
PClass* cls = PClass::AllClasses[i];
PClassActor* acls = ValidateActor(cls);
if (acls != NULL)
{
auto ainfo = acls->ActorInfo();
Printf("%s\t%i\t%i\t%s\t%s\n",
acls->TypeName.GetChars(), ainfo->DoomEdNum,
ainfo->SpawnID, filters[ainfo->GameFilter & 31],
acls->SourceLumpName.GetChars());
}
else if (cls != NULL)
{
Printf("%s\tn/a\tn/a\tn/a\tEngine (not an actor type)\tSource: %s\n", cls->TypeName.GetChars(), cls->SourceLumpName.GetChars());
}
else
{
Printf("Type %i is not an object class\n", i);
}
}
}