mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- fixed: Sector_SetPortal did not set the portal's alpha value.
SVN r2996 (trunk)
This commit is contained in:
parent
9278375064
commit
ad18c7396e
1 changed files with 13 additions and 5 deletions
|
@ -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<AStackPoint>(x1, y1, 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;)
|
||||
{
|
||||
SetPortal(§ors[s], plane, reference);
|
||||
SetPortal(§ors[s], plane, reference, alpha);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
SetPortal(lines[i].frontsector, plane, reference);
|
||||
SetPortal(lines[i].frontsector, plane, reference, alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int s=-1; (s = P_FindSectorFromTag(lines[i].args[0],s)) >= 0;)
|
||||
{
|
||||
SetPortal(§ors[s], plane, reference);
|
||||
SetPortal(§ors[s], plane, reference, alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue