mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Changed FDoorAnimation deletion so that the array takes care of it. The
original destructor approach would have necessitated a lot more supporting code to work as intended. SVN r91 (trunk)
This commit is contained in:
parent
763efb3682
commit
6de9e9a433
3 changed files with 28 additions and 22 deletions
|
@ -1,4 +1,6 @@
|
|||
May 9, 2006 (Changes by Graf Zahl)
|
||||
- Changed FDoorAnimation deletion so that the array takes care of it. This
|
||||
eliminates some complications with the requirements a destructor has.
|
||||
- Fixed: Skin definitions were never freed.
|
||||
- Fixed: Names in terrain definitions were never freed. Replacing them with
|
||||
FNames would have been a good idea anyway.
|
||||
|
|
|
@ -478,33 +478,41 @@ void P_SpawnDoorRaiseIn5Mins (sector_t *sec)
|
|||
|
||||
// Strife's animated doors. Based on Doom's unused sliding doors, but slightly different.
|
||||
|
||||
TArray<FDoorAnimation> DoorAnimations;
|
||||
|
||||
FDoorAnimation::~FDoorAnimation()
|
||||
class DeletingDoorArray : public TArray<FDoorAnimation>
|
||||
{
|
||||
if (TextureFrames != NULL)
|
||||
public:
|
||||
~DeletingDoorArray()
|
||||
{
|
||||
delete [] TextureFrames;
|
||||
TextureFrames = NULL;
|
||||
for(unsigned i=0;i<Size();i++)
|
||||
{
|
||||
FDoorAnimation *ani = &((*this)[i]);
|
||||
if (ani->TextureFrames != NULL)
|
||||
{
|
||||
delete [] ani->TextureFrames;
|
||||
ani->TextureFrames = NULL;
|
||||
}
|
||||
if (ani->OpenSound != NULL)
|
||||
{
|
||||
delete [] ani->OpenSound;
|
||||
ani->OpenSound = NULL;
|
||||
}
|
||||
if (ani->CloseSound != NULL)
|
||||
{
|
||||
delete [] ani->CloseSound;
|
||||
ani->CloseSound = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OpenSound != NULL)
|
||||
{
|
||||
delete [] OpenSound;
|
||||
OpenSound = NULL;
|
||||
}
|
||||
if (CloseSound != NULL)
|
||||
{
|
||||
delete [] CloseSound;
|
||||
CloseSound = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DeletingDoorArray DoorAnimations;
|
||||
|
||||
// EV_SlidingDoor : slide a door horizontally
|
||||
// (animate midtexture, then set noblocking line)
|
||||
//
|
||||
|
||||
//
|
||||
// Return index into "DoorAnimatinos" array for which door type to use
|
||||
// Return index into "DoorAnimations" array for which door type to use
|
||||
//
|
||||
static int P_FindSlidingDoorType (int picnum)
|
||||
{
|
||||
|
|
|
@ -578,12 +578,8 @@ struct FDoorAnimation
|
|||
int NumTextureFrames;
|
||||
char *OpenSound;
|
||||
char *CloseSound;
|
||||
|
||||
~FDoorAnimation();
|
||||
};
|
||||
|
||||
extern TArray<FDoorAnimation> DoorAnimations;
|
||||
|
||||
void P_ParseAnimatedDoor ();
|
||||
|
||||
class DAnimatedDoor : public DMovingCeiling
|
||||
|
|
Loading…
Reference in a new issue