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); } } }