From ad18c7396eda3ca245559e7676ac542b32c67a0b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Nov 2010 23:37:03 +0000 Subject: [PATCH] - fixed: Sector_SetPortal did not set the portal's alpha value. SVN r2996 (trunk) --- src/p_spec.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 631662641..0ba2f01d8 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -938,16 +938,23 @@ void P_SetupPortals() } } -inline void SetPortal(sector_t *sector, int plane, AStackPoint *portal) +inline void SetPortal(sector_t *sector, int plane, AStackPoint *portal, fixed_t alpha) { // plane: 0=floor, 1=ceiling, 2=both if (plane > 0) { - if (sector->CeilingSkyBox == NULL) sector->CeilingSkyBox = portal; + if (sector->CeilingSkyBox == NULL) + { + sector->CeilingSkyBox = portal; + if (sector->GetAlpha(sector_t::ceiling) == OPAQUE) + sector->SetAlpha(sector_t::ceiling, alpha); + } } if (plane == 2 || plane == 0) { if (sector->FloorSkyBox == NULL) sector->FloorSkyBox = portal; + if (sector->GetAlpha(sector_t::floor) == OPAQUE) + sector->SetAlpha(sector_t::floor, alpha); } } @@ -967,6 +974,7 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int alpha) fixed_t y1 = (line->v1->y + line->v2->y) >> 1; fixed_t x2 = (lines[i].v1->x + lines[i].v2->x) >> 1; fixed_t y2 = (lines[i].v1->y + lines[i].v2->y) >> 1; + fixed_t alpha = Scale (lines[i].args[4], OPAQUE, 255); AStackPoint *anchor = Spawn(x1, y1, 0, NO_REPLACE); AStackPoint *reference = Spawn(x2, y2, 0, NO_REPLACE); @@ -981,7 +989,7 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int alpha) for (int s=-1; (s = P_FindSectorFromTag(sectortag,s)) >= 0;) { - SetPortal(§ors[s], plane, reference); + SetPortal(§ors[s], plane, reference, alpha); } for (int j=0;j= 0;) { - SetPortal(§ors[s], plane, reference); + SetPortal(§ors[s], plane, reference, alpha); } } }