- fixed all the missed level references in the decal thinkers.

This commit is contained in:
Christoph Oelckers 2019-01-28 02:07:46 +01:00
parent 472a1118dd
commit aee8851643
1 changed files with 13 additions and 13 deletions

View File

@ -1184,11 +1184,11 @@ void DDecalFader::Tick ()
} }
else else
{ {
if (level.maptime < TimeToStartDecay || bglobal.freeze) if (Level->maptime < TimeToStartDecay || bglobal.freeze)
{ {
return; return;
} }
else if (level.maptime >= TimeToEndDecay) else if (Level->maptime >= TimeToEndDecay)
{ {
TheDecal->Destroy (); // remove the decal TheDecal->Destroy (); // remove the decal
Destroy (); // remove myself Destroy (); // remove myself
@ -1199,7 +1199,7 @@ void DDecalFader::Tick ()
StartTrans = TheDecal->Alpha; StartTrans = TheDecal->Alpha;
} }
int distanceToEnd = TimeToEndDecay - level.maptime; int distanceToEnd = TimeToEndDecay - Level->maptime;
int fadeDistance = TimeToEndDecay - TimeToStartDecay; int fadeDistance = TimeToEndDecay - TimeToStartDecay;
TheDecal->Alpha = StartTrans * distanceToEnd / fadeDistance; TheDecal->Alpha = StartTrans * distanceToEnd / fadeDistance;
} }
@ -1271,11 +1271,11 @@ void DDecalStretcher::Tick ()
Destroy (); Destroy ();
return; return;
} }
if (level.maptime < TimeToStart || bglobal.freeze) if (Level->maptime < TimeToStart || bglobal.freeze)
{ {
return; return;
} }
if (level.maptime >= TimeToStop) if (Level->maptime >= TimeToStop)
{ {
if (bStretchX) if (bStretchX)
{ {
@ -1295,7 +1295,7 @@ void DDecalStretcher::Tick ()
StartY = TheDecal->ScaleY; StartY = TheDecal->ScaleY;
} }
int distance = level.maptime - TimeToStart; int distance = Level->maptime - TimeToStart;
int maxDistance = TimeToStop - TimeToStart; int maxDistance = TimeToStop - TimeToStart;
if (bStretchX) if (bStretchX)
{ {
@ -1339,7 +1339,7 @@ void DDecalSlider::Tick ()
Destroy (); Destroy ();
return; return;
} }
if (level.maptime < TimeToStart || bglobal.freeze) if (Level->maptime < TimeToStart || bglobal.freeze)
{ {
return; return;
} }
@ -1349,7 +1349,7 @@ void DDecalSlider::Tick ()
/*StartX = TheDecal->LeftDistance;*/ /*StartX = TheDecal->LeftDistance;*/
StartY = TheDecal->Z; StartY = TheDecal->Z;
} }
if (level.maptime >= TimeToStop) if (Level->maptime >= TimeToStop)
{ {
/*TheDecal->LeftDistance = StartX + DistX;*/ /*TheDecal->LeftDistance = StartX + DistX;*/
TheDecal->Z = StartY + DistY; TheDecal->Z = StartY + DistY;
@ -1357,7 +1357,7 @@ void DDecalSlider::Tick ()
return; return;
} }
int distance = level.maptime - TimeToStart; int distance = Level->maptime - TimeToStart;
int maxDistance = TimeToStop - TimeToStart; int maxDistance = TimeToStop - TimeToStart;
/*TheDecal->LeftDistance = StartX + DistX * distance / maxDistance);*/ /*TheDecal->LeftDistance = StartX + DistX * distance / maxDistance);*/
TheDecal->Z = StartY + DistY * distance / maxDistance; TheDecal->Z = StartY + DistY * distance / maxDistance;
@ -1407,11 +1407,11 @@ void DDecalColorer::Tick ()
} }
else else
{ {
if (level.maptime < TimeToStartDecay || bglobal.freeze) if (Level->maptime < TimeToStartDecay || bglobal.freeze)
{ {
return; return;
} }
else if (level.maptime >= TimeToEndDecay) else if (Level->maptime >= TimeToEndDecay)
{ {
TheDecal->SetShade (GoalColor); TheDecal->SetShade (GoalColor);
Destroy (); // remove myself Destroy (); // remove myself
@ -1425,12 +1425,12 @@ void DDecalColorer::Tick ()
return; return;
} }
} }
if (level.maptime & 0) if (Level->maptime & 0)
{ // Changing the shade can be expensive, so don't do it too often. { // Changing the shade can be expensive, so don't do it too often.
return; return;
} }
int distance = level.maptime - TimeToStartDecay; int distance = Level->maptime - TimeToStartDecay;
int maxDistance = TimeToEndDecay - TimeToStartDecay; int maxDistance = TimeToEndDecay - TimeToStartDecay;
int r = StartColor.r + Scale (GoalColor.r - StartColor.r, distance, maxDistance); int r = StartColor.r + Scale (GoalColor.r - StartColor.r, distance, maxDistance);
int g = StartColor.g + Scale (GoalColor.g - StartColor.g, distance, maxDistance); int g = StartColor.g + Scale (GoalColor.g - StartColor.g, distance, maxDistance);