qzdoom/src/dobjtype.h
Randy Heit 8fcf93d65a - Merged a lot of these static destructor-only structs into regular
functions added to the exit chain with atterm so that they can be called
  in a deterministic order and not whatever order the linker decides to put
  them in.
- Fixed: DCajunMaster did not free its getspawned.
- Fixed: P_FreeLevelData() did not free ACS scripts.
- Fixed: Level snapshots were not freed at exit.
- Fixed: The save/load menu list was not freed at exit.
- Fixed: FCompressedMemFile needs a destructor to free the m_ImplodedBuffer.
- Fixed: G_DoLoadGame() did not free the engine string.
- Fixed: M_ReadSaveStrings() did not free the engine string.
- Fixed: Processing DEM_SAVEGAME did not free the pathname string.
- Added a check for truncated flats to FFlatTexture::MakeTexture() because
  Heretic's F_SKY1 is only four bytes long.
- Added a dump of the offending state to the "Cannot find state..." diagnostic.
- Fixed: FCompressedFile did not initialize m_Mode in its default constructor.
- Fixed: Heretic and Hexen status bars did not initialize ArtiRefresh.
- Fixed: PNGHandle destructor should use delete[] to free TextChunks.


SVN r111 (trunk)
2006-05-12 03:14:40 +00:00

61 lines
1.7 KiB
C

#ifndef DOBJTYPE_H
#define DOBJTYPE_H
#ifndef __DOBJECT_H__
#error You must #include "dobject.h" to get dobjtype.h
#endif
struct PClass
{
static void StaticInit ();
static void StaticShutdown ();
static void StaticFreeData (PClass *type);
// Per-class information -------------------------------------
FName TypeName; // this class's name
unsigned int Size; // this class's size
PClass *ParentClass; // the class this class derives from
const size_t *Pointers; // object pointers defined by this class *only*
const size_t *FlatPointers; // object pointers defined by this class and all its superclasses; not initialized by default
FActorInfo *ActorInfo;
PClass *HashNext;
FMetaTable Meta;
BYTE *Defaults;
bool bRuntimeClass; // class was defined at run-time, not compile-time
unsigned short ClassIndex;
void (*ConstructNative)(void *);
// The rest are all functions and static data ----------------
void InsertIntoHash ();
DObject *CreateNew () const;
PClass *CreateDerivedClass (FName name, unsigned int size);
void BuildFlatPointers ();
// Returns true if this type is an ancestor of (or same as) the passed type.
bool IsAncestorOf (const PClass *ti) const
{
while (ti)
{
if (this == ti)
return true;
ti = ti->ParentClass;
}
return false;
}
inline bool IsDescendantOf (const PClass *ti) const
{
return ti->IsAncestorOf (this);
}
static const PClass *FindClass (const char *name);
static const PClass *FindClass (FName name);
static TArray<PClass *> m_Types;
static TArray<PClass *> m_RuntimeActors;
enum { HASH_SIZE = 256 };
static PClass *TypeHash[HASH_SIZE];
};
#endif