mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-26 13:11:29 +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)
|
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: Skin definitions were never freed.
|
||||||
- Fixed: Names in terrain definitions were never freed. Replacing them with
|
- Fixed: Names in terrain definitions were never freed. Replacing them with
|
||||||
FNames would have been a good idea anyway.
|
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.
|
// Strife's animated doors. Based on Doom's unused sliding doors, but slightly different.
|
||||||
|
|
||||||
TArray<FDoorAnimation> DoorAnimations;
|
class DeletingDoorArray : public TArray<FDoorAnimation>
|
||||||
|
|
||||||
FDoorAnimation::~FDoorAnimation()
|
|
||||||
{
|
{
|
||||||
if (TextureFrames != NULL)
|
public:
|
||||||
|
~DeletingDoorArray()
|
||||||
{
|
{
|
||||||
delete [] TextureFrames;
|
for(unsigned i=0;i<Size();i++)
|
||||||
TextureFrames = NULL;
|
{
|
||||||
|
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;
|
DeletingDoorArray DoorAnimations;
|
||||||
OpenSound = NULL;
|
|
||||||
}
|
|
||||||
if (CloseSound != NULL)
|
|
||||||
{
|
|
||||||
delete [] CloseSound;
|
|
||||||
CloseSound = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// EV_SlidingDoor : slide a door horizontally
|
// EV_SlidingDoor : slide a door horizontally
|
||||||
// (animate midtexture, then set noblocking line)
|
// (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)
|
static int P_FindSlidingDoorType (int picnum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -578,12 +578,8 @@ struct FDoorAnimation
|
||||||
int NumTextureFrames;
|
int NumTextureFrames;
|
||||||
char *OpenSound;
|
char *OpenSound;
|
||||||
char *CloseSound;
|
char *CloseSound;
|
||||||
|
|
||||||
~FDoorAnimation();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern TArray<FDoorAnimation> DoorAnimations;
|
|
||||||
|
|
||||||
void P_ParseAnimatedDoor ();
|
void P_ParseAnimatedDoor ();
|
||||||
|
|
||||||
class DAnimatedDoor : public DMovingCeiling
|
class DAnimatedDoor : public DMovingCeiling
|
||||||
|
|
Loading…
Reference in a new issue