Skip to content

Commit 26d3af4

Browse files
committed
Transfer sector tinting
1 parent b469ac9 commit 26d3af4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/r_bsp.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ static void R_Subsector(int num)
532532
sector_t tempsec; // killough 03/07/98: deep water hack
533533
sector_t *sector = sub->sector;
534534
sector_t *heightsec;
535+
sector_t *floorlightsec;
536+
sector_t *ceilinglightsec;
535537
int floorlightlevel; // killough 03/16/98: set floor lightlevel
536538
int ceilinglightlevel; // killough 04/11/98
537539
int count = sub->numlines;
@@ -543,6 +545,8 @@ static void R_Subsector(int num)
543545
// killough 03/08/98, 04/04/98: Deep water/fake ceiling effect
544546
frontsector = R_FakeFlat(sector, &tempsec, &floorlightlevel, &ceilinglightlevel, false);
545547
heightsec = frontsector->heightsec;
548+
floorlightsec = frontsector->floorlightsec;
549+
ceilinglightsec = frontsector->ceilinglightsec;
546550

547551
floorplane = (frontsector->interpfloorheight < viewz // killough 03/07/98
548552
|| (heightsec && heightsec->ceilingpic == skyflatnum) ?
@@ -552,7 +556,7 @@ static void R_Subsector(int num)
552556
floorlightlevel, // killough 03/16/98
553557
frontsector->floorxoffset, // killough 03/07/98
554558
frontsector->flooryoffset,
555-
(heightsec ? heightsec : frontsector)) : NULL);
559+
(floorlightsec ? floorlightsec : (heightsec ? heightsec : frontsector))) : NULL);
556560

557561
ceilingplane = (frontsector->interpceilingheight > viewz
558562
|| frontsector->ceilingpic == skyflatnum
@@ -563,7 +567,7 @@ static void R_Subsector(int num)
563567
ceilinglightlevel, // killough 04/11/98
564568
frontsector->ceilingxoffset, // killough 03/07/98
565569
frontsector->ceilingyoffset,
566-
(heightsec ? heightsec : frontsector)) : NULL);
570+
(ceilinglightsec ? ceilinglightsec : (heightsec ? heightsec : frontsector))) : NULL);
567571

568572
// killough 09/18/98: Fix underwater slowdown, by passing real sector
569573
// instead of fake one. Improve sprite lighting by basing sprite

0 commit comments

Comments
 (0)