- fixed: Sector_SetPortal did not set the portal's alpha value.

SVN r2996 (trunk)
This commit is contained in:
Christoph Oelckers 2010-11-07 23:37:03 +00:00
parent 9278375064
commit ad18c7396e
1 changed files with 13 additions and 5 deletions

View File

@ -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 // plane: 0=floor, 1=ceiling, 2=both
if (plane > 0) 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 (plane == 2 || plane == 0)
{ {
if (sector->FloorSkyBox == NULL) sector->FloorSkyBox = portal; 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 y1 = (line->v1->y + line->v2->y) >> 1;
fixed_t x2 = (lines[i].v1->x + lines[i].v2->x) >> 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 y2 = (lines[i].v1->y + lines[i].v2->y) >> 1;
fixed_t alpha = Scale (lines[i].args[4], OPAQUE, 255);
AStackPoint *anchor = Spawn<AStackPoint>(x1, y1, 0, NO_REPLACE); AStackPoint *anchor = Spawn<AStackPoint>(x1, y1, 0, NO_REPLACE);
AStackPoint *reference = Spawn<AStackPoint>(x2, y2, 0, NO_REPLACE); AStackPoint *reference = Spawn<AStackPoint>(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;) for (int s=-1; (s = P_FindSectorFromTag(sectortag,s)) >= 0;)
{ {
SetPortal(&sectors[s], plane, reference); SetPortal(&sectors[s], plane, reference, alpha);
} }
for (int j=0;j<numlines;j++) for (int j=0;j<numlines;j++)
@ -995,13 +1003,13 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int alpha)
{ {
if (lines[i].args[0] == 0) if (lines[i].args[0] == 0)
{ {
SetPortal(lines[i].frontsector, plane, reference); SetPortal(lines[i].frontsector, plane, reference, alpha);
} }
else else
{ {
for (int s=-1; (s = P_FindSectorFromTag(lines[i].args[0],s)) >= 0;) for (int s=-1; (s = P_FindSectorFromTag(lines[i].args[0],s)) >= 0;)
{ {
SetPortal(&sectors[s], plane, reference); SetPortal(&sectors[s], plane, reference, alpha);
} }
} }
} }