mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Add light fading to FadeFakeFloor
* Declare P_RemoveLighting in header for p_spec.c use
This commit is contained in:
parent
4ca38dc8a1
commit
0049f904c0
3 changed files with 16 additions and 1 deletions
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
* \param sector The sector to remove effects from.
|
||||
*/
|
||||
static void P_RemoveLighting(sector_t *sector)
|
||||
void P_RemoveLighting(sector_t *sector)
|
||||
{
|
||||
if (sector->lightingdata)
|
||||
{
|
||||
|
|
13
src/p_spec.c
13
src/p_spec.c
|
@ -7453,6 +7453,12 @@ static void P_ResetFakeFloorFader(ffloor_t *rover, fade_t *data, boolean finaliz
|
|||
fadingdata->exactalpha);
|
||||
rover->alpha = fadingdata->alpha;
|
||||
|
||||
if (fadingdata->dolighting)
|
||||
{
|
||||
P_RemoveLighting(§ors[rover->secnum]);
|
||||
§ors[rover->secnum].lightlevel = rover->target->lightlevel; // \todo get fade light level destvalue
|
||||
}
|
||||
|
||||
P_RemoveThinker(&fadingdata->thinker);
|
||||
}
|
||||
|
||||
|
@ -7729,6 +7735,13 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor
|
|||
// find any existing thinkers and remove them, then replace with new data
|
||||
P_ResetFakeFloorFader(rover, d, false);
|
||||
|
||||
// Set a separate thinker for shadow fading
|
||||
if (dolighting && !(rover->flags & FF_NOSHADE))
|
||||
P_FadeLightBySector(§ors[rover->secnum],
|
||||
rover->target->lightlevel, // (shadowlight - targetlight) * destvalue/256 // \todo get fade light level destvalue
|
||||
FixedFloor(FixedDiv(abs(d->destvalue - d->alpha), d->speed))/FRACUNIT,
|
||||
true, exactalpha);
|
||||
|
||||
P_AddThinker(&d->thinker);
|
||||
}
|
||||
|
||||
|
|
|
@ -154,6 +154,8 @@ typedef struct
|
|||
#define FASTDARK 15
|
||||
#define SLOWDARK 35
|
||||
|
||||
void P_RemoveLighting(sector_t *sector);
|
||||
|
||||
void T_FireFlicker(fireflicker_t *flick);
|
||||
fireflicker_t *P_SpawnAdjustableFireFlicker(sector_t *minsector, sector_t *maxsector, INT32 length);
|
||||
void T_LightningFlash(lightflash_t *flash);
|
||||
|
|
Loading…
Reference in a new issue