TArrays to TObjPtr

- Made the 2 TArrays into a class called DActorModelData.
- Removed the skinindex and now just uses one index
- Replaced a bunch of nullptr for modelDef checking with NAME_None
- Added some garbage cleanup to A_ChangeModel itself, as well as removing memory of modelData that is no longer needed
- Attempted serialize code, putting up for review
This commit is contained in:
Shiny Metagross 2022-06-30 00:12:06 -07:00 committed by Christoph Oelckers
commit e827e9b086
6 changed files with 83 additions and 26 deletions

View file

@ -158,6 +158,7 @@ CVAR (Int, cl_bloodtype, 0, CVAR_ARCHIVE);
// CODE --------------------------------------------------------------------
IMPLEMENT_CLASS(DActorModelData, false, false);
IMPLEMENT_CLASS(AActor, false, true)
IMPLEMENT_POINTERS_START(AActor)
@ -374,7 +375,9 @@ void AActor::Serialize(FSerializer &arc)
("viewpos", ViewPos)
A("lightlevel", LightLevel)
A("userlights", UserLights)
A("WorldOffset", WorldOffset);
A("WorldOffset", WorldOffset)
A("modelData", modelData)
A("modelDef", modelDef);
SerializeTerrain(arc, "floorterrain", floorterrain, &def->floorterrain);
SerializeArgs(arc, "args", args, def->args, special);
@ -1353,6 +1356,20 @@ bool AActor::Massacre ()
return false;
}
//----------------------------------------------------------------------------
//
// Serialize DActorModelData
//
//----------------------------------------------------------------------------
void DActorModelData::Serialize(FSerializer& arc)
{
Super::Serialize(arc);
arc ("modelIDs", modelIDs)
("skinIDs", skinIDs)
("hasModel", hasModel);
}
//----------------------------------------------------------------------------
//
// PROC P_ExplodeMissile