mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- properly un-count faded out decals without involving the Destroy method.
This commit is contained in:
parent
97e3e858a1
commit
9dec214c15
3 changed files with 16 additions and 0 deletions
|
@ -76,6 +76,7 @@ void DDecalFader::Tick ()
|
||||||
}
|
}
|
||||||
else if (Level->maptime >= TimeToEndDecay)
|
else if (Level->maptime >= TimeToEndDecay)
|
||||||
{
|
{
|
||||||
|
TheDecal->Expired(); // for impact decal bookkeeping.
|
||||||
TheDecal->Destroy (); // remove the decal
|
TheDecal->Destroy (); // remove the decal
|
||||||
Destroy (); // remove myself
|
Destroy (); // remove myself
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -666,6 +666,8 @@ DBaseDecal *DBaseDecal::CloneSelf (const FDecalTemplate *tpl, double ix, double
|
||||||
|
|
||||||
void DImpactDecal::CheckMax ()
|
void DImpactDecal::CheckMax ()
|
||||||
{
|
{
|
||||||
|
static int SpawnCounter;
|
||||||
|
|
||||||
if (++Level->ImpactDecalCount >= cl_maxdecals)
|
if (++Level->ImpactDecalCount >= cl_maxdecals)
|
||||||
{
|
{
|
||||||
DThinker *thinker = Level->FirstThinker (STAT_AUTODECAL);
|
DThinker *thinker = Level->FirstThinker (STAT_AUTODECAL);
|
||||||
|
@ -683,6 +685,17 @@ void DImpactDecal::CheckMax ()
|
||||||
//
|
//
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DImpactDecal::Expired()
|
||||||
|
{
|
||||||
|
Level->ImpactDecalCount--;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
DImpactDecal *DImpactDecal::StaticCreate (FLevelLocals *Level, const char *name, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color)
|
DImpactDecal *DImpactDecal::StaticCreate (FLevelLocals *Level, const char *name, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color)
|
||||||
{
|
{
|
||||||
if (cl_maxdecals > 0)
|
if (cl_maxdecals > 0)
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
|
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
virtual void Expired() {} // For thinkers that can remove their decal. For impact decal bookkeeping.
|
||||||
FTextureID StickToWall(side_t *wall, double x, double y, F3DFloor * ffloor);
|
FTextureID StickToWall(side_t *wall, double x, double y, F3DFloor * ffloor);
|
||||||
double GetRealZ (const side_t *wall) const;
|
double GetRealZ (const side_t *wall) const;
|
||||||
void SetShade (uint32_t rgb);
|
void SetShade (uint32_t rgb);
|
||||||
|
@ -71,6 +72,7 @@ public:
|
||||||
static DImpactDecal *StaticCreate(FLevelLocals *Level, const FDecalTemplate *tpl, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
static DImpactDecal *StaticCreate(FLevelLocals *Level, const FDecalTemplate *tpl, const DVector3 &pos, side_t *wall, F3DFloor * ffloor, PalEntry color = 0);
|
||||||
|
|
||||||
void BeginPlay ();
|
void BeginPlay ();
|
||||||
|
void Expired() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DBaseDecal *CloneSelf(const FDecalTemplate *tpl, double x, double y, double z, side_t *wall, F3DFloor * ffloor) const;
|
DBaseDecal *CloneSelf(const FDecalTemplate *tpl, double x, double y, double z, side_t *wall, F3DFloor * ffloor) const;
|
||||||
|
|
Loading…
Reference in a new issue