mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t.
- Grouped the sector plane texture transformation options into a separate structure and replaced all access to them with wrapper functions. SVN r1033 (trunk)
This commit is contained in:
parent
4a1cb412f1
commit
0e6e1da970
14 changed files with 249 additions and 201 deletions
|
@ -1,3 +1,8 @@
|
|||
June 14, 2008 (Changes by Graf Zahl)
|
||||
- Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t.
|
||||
- Grouped the sector plane texture transformation values into a separate
|
||||
structure and replaced all access to them with wrapper functions.
|
||||
|
||||
June 12, 2008
|
||||
- Add environment 255, 255 as a way to get the software underwater effect in
|
||||
any zone you want.
|
||||
|
|
|
@ -376,10 +376,10 @@ static void LoadSectors (sectortype *bsec)
|
|||
sec->floorplane.ic = FRACUNIT;
|
||||
sprintf (tnam, "BTIL%04d", LittleShort(bsec->floorpicnum));
|
||||
sec->floorpic = TexMan.GetTexture (tnam, FTexture::TEX_Build);
|
||||
sec->floor_xscale = (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT;
|
||||
sec->floor_yscale = (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT;
|
||||
sec->floor_xoffs = (bsec->floorxpanning << FRACBITS) + (32 << FRACBITS);
|
||||
sec->floor_yoffs = bsec->floorypanning << FRACBITS;
|
||||
sec->SetXScale(sector_t::floor, (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT);
|
||||
sec->SetYScale(sector_t::floor, (bsec->floorstat & 8) ? FRACUNIT*2 : FRACUNIT);
|
||||
sec->SetXOffset(sector_t::floor, (bsec->floorxpanning << FRACBITS) + (32 << FRACBITS));
|
||||
sec->SetYOffset(sector_t::floor, bsec->floorypanning << FRACBITS);
|
||||
sec->FloorLight = SHADE2LIGHT (bsec->floorshade);
|
||||
sec->FloorFlags = SECF_ABSLIGHTING;
|
||||
|
||||
|
@ -394,10 +394,10 @@ static void LoadSectors (sectortype *bsec)
|
|||
sky1texture = sky2texture = sec->ceilingpic;
|
||||
sec->ceilingpic = skyflatnum;
|
||||
}
|
||||
sec->ceiling_xscale = (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT;
|
||||
sec->ceiling_yscale = (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT;
|
||||
sec->ceiling_xoffs = (bsec->ceilingxpanning << FRACBITS) + (32 << FRACBITS);
|
||||
sec->ceiling_yoffs = bsec->ceilingypanning << FRACBITS;
|
||||
sec->SetXScale(sector_t::ceiling, (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT);
|
||||
sec->SetYScale(sector_t::ceiling, (bsec->ceilingstat & 8) ? FRACUNIT*2 : FRACUNIT);
|
||||
sec->SetXOffset(sector_t::ceiling, (bsec->ceilingxpanning << FRACBITS) + (32 << FRACBITS));
|
||||
sec->SetYOffset(sector_t::ceiling, bsec->ceilingypanning << FRACBITS);
|
||||
sec->CeilingLight = SHADE2LIGHT (bsec->ceilingshade);
|
||||
sec->CeilingFlags = SECF_ABSLIGHTING;
|
||||
|
||||
|
@ -414,30 +414,30 @@ static void LoadSectors (sectortype *bsec)
|
|||
|
||||
if (bsec->floorstat & 4)
|
||||
{
|
||||
sec->floor_angle = ANGLE_90;
|
||||
sec->floor_xscale = -sec->floor_xscale;
|
||||
sec->SetAngle(sector_t::floor, ANGLE_90);
|
||||
sec->SetXScale(sector_t::floor, -sec->GetXScale(sector_t::floor));
|
||||
}
|
||||
if (bsec->floorstat & 16)
|
||||
{
|
||||
sec->floor_xscale = -sec->floor_xscale;
|
||||
sec->SetXScale(sector_t::floor, -sec->GetXScale(sector_t::floor));
|
||||
}
|
||||
if (bsec->floorstat & 32)
|
||||
{
|
||||
sec->floor_yscale = -sec->floor_yscale;
|
||||
sec->SetYScale(sector_t::floor, -sec->GetYScale(sector_t::floor));
|
||||
}
|
||||
|
||||
if (bsec->ceilingstat & 4)
|
||||
{
|
||||
sec->ceiling_angle = ANGLE_90;
|
||||
sec->floor_yscale = -sec->floor_yscale;
|
||||
sec->SetAngle(sector_t::ceiling, ANGLE_90);
|
||||
sec->SetYScale(sector_t::ceiling, -sec->GetYScale(sector_t::ceiling));
|
||||
}
|
||||
if (bsec->ceilingstat & 16)
|
||||
{
|
||||
sec->ceiling_xscale = -sec->ceiling_xscale;
|
||||
sec->SetXScale(sector_t::ceiling, -sec->GetXScale(sector_t::ceiling));
|
||||
}
|
||||
if (bsec->ceilingstat & 32)
|
||||
{
|
||||
sec->ceiling_yscale = -sec->ceiling_yscale;
|
||||
sec->SetYScale(sector_t::ceiling, -sec->GetYScale(sector_t::ceiling));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -512,7 +512,7 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec)
|
|||
}
|
||||
|
||||
sides[i].TexelLength = walls[i].xrepeat * 8;
|
||||
sides[i].Light = SHADE2LIGHT(walls[i].shade);
|
||||
sides[i].SetLight(SHADE2LIGHT(walls[i].shade));
|
||||
sides[i].Flags = WALLF_ABSLIGHTING;
|
||||
sides[i].RightSide = walls[i].point2;
|
||||
sides[walls[i].point2].LeftSide = i;
|
||||
|
|
|
@ -2160,8 +2160,8 @@ FUNC(LS_Sector_SetCeilingPanning)
|
|||
|
||||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
sectors[secnum].ceiling_xoffs = xofs;
|
||||
sectors[secnum].ceiling_yoffs = yofs;
|
||||
sectors[secnum].SetXOffset(sector_t::ceiling, xofs);
|
||||
sectors[secnum].SetYOffset(sector_t::ceiling, yofs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2175,8 +2175,8 @@ FUNC(LS_Sector_SetFloorPanning)
|
|||
|
||||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
sectors[secnum].floor_xoffs = xofs;
|
||||
sectors[secnum].floor_yoffs = yofs;
|
||||
sectors[secnum].SetXOffset(sector_t::floor, xofs);
|
||||
sectors[secnum].SetYOffset(sector_t::floor, yofs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2196,9 +2196,9 @@ FUNC(LS_Sector_SetCeilingScale)
|
|||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
if (xscale)
|
||||
sectors[secnum].ceiling_xscale = xscale;
|
||||
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
|
||||
if (yscale)
|
||||
sectors[secnum].ceiling_yscale = yscale;
|
||||
sectors[secnum].SetYScale(sector_t::ceiling, arg2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2216,9 +2216,9 @@ FUNC(LS_Sector_SetFloorScale2)
|
|||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
if (arg1)
|
||||
sectors[secnum].floor_xscale = arg1;
|
||||
sectors[secnum].SetXScale(sector_t::floor, arg1);
|
||||
if (arg2)
|
||||
sectors[secnum].floor_yscale = arg2;
|
||||
sectors[secnum].SetXScale(sector_t::floor, arg1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2236,9 +2236,9 @@ FUNC(LS_Sector_SetCeilingScale2)
|
|||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
if (arg1)
|
||||
sectors[secnum].ceiling_xscale = arg1;
|
||||
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
|
||||
if (arg2)
|
||||
sectors[secnum].ceiling_yscale = arg2;
|
||||
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2258,9 +2258,9 @@ FUNC(LS_Sector_SetFloorScale)
|
|||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
if (xscale)
|
||||
sectors[secnum].floor_xscale = xscale;
|
||||
sectors[secnum].SetXScale(sector_t::floor, arg1);
|
||||
if (yscale)
|
||||
sectors[secnum].floor_yscale = yscale;
|
||||
sectors[secnum].SetXScale(sector_t::floor, arg1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2274,8 +2274,8 @@ FUNC(LS_Sector_SetRotation)
|
|||
|
||||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
{
|
||||
sectors[secnum].floor_angle = floor;
|
||||
sectors[secnum].ceiling_angle = ceiling;
|
||||
sectors[secnum].SetAngle(sector_t::floor, floor);
|
||||
sectors[secnum].SetAngle(sector_t::ceiling, ceiling);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -311,13 +311,8 @@ void P_SerializeWorld (FArchive &arc)
|
|||
<< sec->stairlock
|
||||
<< sec->prevsec
|
||||
<< sec->nextsec
|
||||
<< sec->floor_xoffs << sec->floor_yoffs
|
||||
<< sec->ceiling_xoffs << sec->ceiling_yoffs
|
||||
<< sec->floor_xscale << sec->floor_yscale
|
||||
<< sec->ceiling_xscale << sec->ceiling_yscale
|
||||
<< sec->floor_angle << sec->ceiling_angle
|
||||
<< sec->base_ceiling_angle << sec->base_ceiling_yoffs
|
||||
<< sec->base_floor_angle << sec->base_floor_yoffs
|
||||
<< sec->planes[sector_t::floor]
|
||||
<< sec->planes[sector_t::ceiling]
|
||||
<< sec->heightsec
|
||||
<< sec->bottommap << sec->midmap << sec->topmap
|
||||
<< sec->gravity
|
||||
|
@ -428,6 +423,13 @@ FArchive &operator<< (FArchive &arc, side_t::part &p)
|
|||
return arc;
|
||||
}
|
||||
|
||||
FArchive &operator<< (FArchive &arc, sector_t::splane &p)
|
||||
{
|
||||
arc << p.xform.xoffs << p.xform.yoffs << p.xform.xscale << p.xform.yscale
|
||||
<< p.xform.angle << p.xform.base_yoffs << p.xform.base_angle;
|
||||
return arc;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Thinkers
|
||||
|
|
|
@ -1210,10 +1210,10 @@ void P_LoadSectors (MapData * map)
|
|||
ss->prevsec = -1; // stair retriggering until build completes
|
||||
|
||||
// killough 3/7/98:
|
||||
ss->floor_xscale = FRACUNIT; // [RH] floor and ceiling scaling
|
||||
ss->floor_yscale = FRACUNIT;
|
||||
ss->ceiling_xscale = FRACUNIT;
|
||||
ss->ceiling_yscale = FRACUNIT;
|
||||
ss->SetXScale(sector_t::floor, FRACUNIT); // [RH] floor and ceiling scaling
|
||||
ss->SetYScale(sector_t::floor, FRACUNIT);
|
||||
ss->SetXScale(sector_t::ceiling, FRACUNIT);
|
||||
ss->SetYScale(sector_t::ceiling, FRACUNIT);
|
||||
|
||||
ss->heightsec = NULL; // sector used to get floor and ceiling height
|
||||
// killough 3/7/98: end changes
|
||||
|
|
|
@ -803,12 +803,12 @@ void DWallLightTransfer::DoTransfer (BYTE lightlevel, int target, BYTE flags)
|
|||
|
||||
if (flags & WLF_SIDE1 && line->sidenum[0]!=NO_SIDE)
|
||||
{
|
||||
sides[line->sidenum[0]].Light = lightlevel;
|
||||
sides[line->sidenum[0]].SetLight(lightlevel);
|
||||
}
|
||||
|
||||
if (flags & WLF_SIDE2 && line->sidenum[1]!=NO_SIDE)
|
||||
{
|
||||
sides[line->sidenum[1]].Light = lightlevel;
|
||||
sides[line->sidenum[1]].SetLight(lightlevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1150,13 +1150,13 @@ void DScroller::Tick ()
|
|||
break;
|
||||
|
||||
case sc_floor: // killough 3/7/98: Scroll floor texture
|
||||
sectors[m_Affectee].floor_xoffs += dx;
|
||||
sectors[m_Affectee].floor_yoffs += dy;
|
||||
sectors[m_Affectee].AddXOffset(sector_t::floor, dx);
|
||||
sectors[m_Affectee].AddYOffset(sector_t::floor, dy);
|
||||
break;
|
||||
|
||||
case sc_ceiling: // killough 3/7/98: Scroll ceiling texture
|
||||
sectors[m_Affectee].ceiling_xoffs += dx;
|
||||
sectors[m_Affectee].ceiling_yoffs += dy;
|
||||
sectors[m_Affectee].AddXOffset(sector_t::ceiling, dx);
|
||||
sectors[m_Affectee].AddYOffset(sector_t::ceiling, dy);
|
||||
break;
|
||||
|
||||
// [RH] Don't actually carry anything here. That happens later.
|
||||
|
|
|
@ -204,6 +204,11 @@ struct UDMFParser
|
|||
return FLOAT2FIXED(CheckFloat(key));
|
||||
}
|
||||
|
||||
angle_t CheckAngle(const char *key)
|
||||
{
|
||||
return angle_t(CheckFloat(key) * ANGLE_90 / 90.);
|
||||
}
|
||||
|
||||
bool CheckBool(const char *key)
|
||||
{
|
||||
if (sc.TokenType == TK_True) return true;
|
||||
|
@ -724,7 +729,7 @@ struct UDMFParser
|
|||
break;
|
||||
|
||||
case NAME_light:
|
||||
sd->Light = CheckInt(key);
|
||||
sd->SetLight(CheckInt(key));
|
||||
break;
|
||||
|
||||
case NAME_lightabsolute:
|
||||
|
@ -767,10 +772,10 @@ struct UDMFParser
|
|||
|
||||
memset(sec, 0, sizeof(*sec));
|
||||
sec->lightlevel = 160;
|
||||
sec->floor_xscale = FRACUNIT; // [RH] floor and ceiling scaling
|
||||
sec->floor_yscale = FRACUNIT;
|
||||
sec->ceiling_xscale = FRACUNIT;
|
||||
sec->ceiling_yscale = FRACUNIT;
|
||||
sec->SetXScale(sector_t::floor, FRACUNIT); // [RH] floor and ceiling scaling
|
||||
sec->SetYScale(sector_t::floor, FRACUNIT);
|
||||
sec->SetXScale(sector_t::ceiling, FRACUNIT);
|
||||
sec->SetYScale(sector_t::ceiling, FRACUNIT);
|
||||
sec->oldspecial = !!(sec->special&SECRET_MASK);
|
||||
sec->thinglist = NULL;
|
||||
sec->touching_thinglist = NULL; // phares 3/14/98
|
||||
|
@ -835,43 +840,43 @@ struct UDMFParser
|
|||
if (namespace_bits & (Zd|Zdt)) switch(key)
|
||||
{
|
||||
case NAME_Xpanningfloor:
|
||||
sec->floor_xoffs = CheckFixed(key);
|
||||
sec->SetXOffset(sector_t::floor, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Ypanningfloor:
|
||||
sec->floor_yoffs = CheckFixed(key);
|
||||
sec->SetYOffset(sector_t::floor, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Xpanningceiling:
|
||||
sec->ceiling_xoffs = CheckFixed(key);
|
||||
sec->SetXOffset(sector_t::ceiling, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Ypanningceiling:
|
||||
sec->ceiling_yoffs = CheckFixed(key);
|
||||
sec->SetYOffset(sector_t::ceiling, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Xscalefloor:
|
||||
sec->floor_xscale = CheckFixed(key);
|
||||
sec->SetXScale(sector_t::floor, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Yscalefloor:
|
||||
sec->floor_yscale = CheckFixed(key);
|
||||
sec->SetYScale(sector_t::floor, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Xscaleceiling:
|
||||
sec->ceiling_xscale = CheckFixed(key);
|
||||
sec->SetXScale(sector_t::ceiling, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Yscaleceiling:
|
||||
sec->ceiling_yscale = CheckFixed(key);
|
||||
sec->SetYScale(sector_t::ceiling, CheckFixed(key));
|
||||
break;
|
||||
|
||||
case NAME_Rotationfloor:
|
||||
sec->floor_angle = CheckFixed(key);
|
||||
sec->SetAngle(sector_t::floor, CheckAngle(key));
|
||||
break;
|
||||
|
||||
case NAME_Rotationceiling:
|
||||
sec->ceiling_angle = CheckFixed(key);
|
||||
sec->SetAngle(sector_t::ceiling, CheckAngle(key));
|
||||
break;
|
||||
|
||||
case NAME_Lightfloor:
|
||||
|
|
|
@ -456,13 +456,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
|
|||
if ((underwater && !back) || doorunderwater)
|
||||
{ // head-below-floor hack
|
||||
tempsec->floorpic = diffTex ? sec->floorpic : s->floorpic;
|
||||
tempsec->floor_xoffs = s->floor_xoffs;
|
||||
tempsec->floor_yoffs = s->floor_yoffs;
|
||||
tempsec->floor_xscale = s->floor_xscale;
|
||||
tempsec->floor_yscale = s->floor_yscale;
|
||||
tempsec->floor_angle = s->floor_angle;
|
||||
tempsec->base_floor_angle = s->base_floor_angle;
|
||||
tempsec->base_floor_yoffs = s->base_floor_yoffs;
|
||||
tempsec->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
|
||||
|
||||
tempsec->ceilingplane = s->floorplane;
|
||||
tempsec->ceilingplane.FlipVert ();
|
||||
|
@ -473,24 +467,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
|
|||
tempsec->floorplane.FlipVert ();
|
||||
tempsec->floorplane.ChangeHeight (+1);
|
||||
tempsec->ceilingpic = tempsec->floorpic;
|
||||
tempsec->ceiling_xoffs = tempsec->floor_xoffs;
|
||||
tempsec->ceiling_yoffs = tempsec->floor_yoffs;
|
||||
tempsec->ceiling_xscale = tempsec->floor_xscale;
|
||||
tempsec->ceiling_yscale = tempsec->floor_yscale;
|
||||
tempsec->ceiling_angle = tempsec->floor_angle;
|
||||
tempsec->base_ceiling_angle = tempsec->base_floor_angle;
|
||||
tempsec->base_ceiling_yoffs = tempsec->base_floor_yoffs;
|
||||
tempsec->planes[sector_t::ceiling].xform = tempsec->planes[sector_t::floor].xform;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempsec->ceilingpic = diffTex ? s->floorpic : s->ceilingpic;
|
||||
tempsec->ceiling_xoffs = s->ceiling_xoffs;
|
||||
tempsec->ceiling_yoffs = s->ceiling_yoffs;
|
||||
tempsec->ceiling_xscale = s->ceiling_xscale;
|
||||
tempsec->ceiling_yscale = s->ceiling_yscale;
|
||||
tempsec->ceiling_angle = s->ceiling_angle;
|
||||
tempsec->base_ceiling_angle = s->base_ceiling_angle;
|
||||
tempsec->base_ceiling_yoffs = s->base_ceiling_yoffs;
|
||||
tempsec->planes[sector_t::ceiling].xform = s->planes[sector_t::ceiling].xform;
|
||||
}
|
||||
|
||||
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
|
||||
|
@ -521,23 +503,13 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
|
|||
|
||||
tempsec->ceilingpic = diffTex ? sec->ceilingpic : s->ceilingpic;
|
||||
tempsec->floorpic = s->ceilingpic;
|
||||
tempsec->floor_xoffs = tempsec->ceiling_xoffs = s->ceiling_xoffs;
|
||||
tempsec->floor_yoffs = tempsec->ceiling_yoffs = s->ceiling_yoffs;
|
||||
tempsec->floor_xscale = tempsec->ceiling_xscale = s->ceiling_xscale;
|
||||
tempsec->floor_yscale = tempsec->ceiling_yscale = s->ceiling_yscale;
|
||||
tempsec->floor_angle = tempsec->ceiling_angle = s->ceiling_angle;
|
||||
tempsec->base_floor_angle = tempsec->base_ceiling_angle = s->base_ceiling_angle;
|
||||
tempsec->base_floor_yoffs = tempsec->base_ceiling_yoffs = s->base_ceiling_yoffs;
|
||||
tempsec->planes[sector_t::ceiling].xform = tempsec->planes[sector_t::floor].xform = s->planes[sector_t::ceiling].xform;
|
||||
|
||||
if (s->floorpic != skyflatnum)
|
||||
{
|
||||
tempsec->ceilingplane = sec->ceilingplane;
|
||||
tempsec->floorpic = s->floorpic;
|
||||
tempsec->floor_xoffs = s->floor_xoffs;
|
||||
tempsec->floor_yoffs = s->floor_yoffs;
|
||||
tempsec->floor_xscale = s->floor_xscale;
|
||||
tempsec->floor_yscale = s->floor_yscale;
|
||||
tempsec->floor_angle = s->floor_angle;
|
||||
tempsec->planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
|
||||
}
|
||||
|
||||
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
|
||||
|
@ -782,10 +754,10 @@ void R_AddLine (seg_t *line)
|
|||
|| curline->sidedef->GetTexture(side_t::mid) != 0
|
||||
|
||||
// killough 3/7/98: Take flats offsets into account:
|
||||
|| backsector->floor_xoffs != frontsector->floor_xoffs
|
||||
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + backsector->base_floor_yoffs)
|
||||
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|
||||
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|
||||
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|
||||
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
|
||||
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|
||||
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
|
||||
|
||||
|| backsector->FloorLight != frontsector->FloorLight
|
||||
|| backsector->CeilingLight != frontsector->CeilingLight
|
||||
|
@ -796,14 +768,14 @@ void R_AddLine (seg_t *line)
|
|||
|| backsector->ColorMap != frontsector->ColorMap
|
||||
|
||||
// [RH] and scaling
|
||||
|| backsector->floor_xscale != frontsector->floor_xscale
|
||||
|| backsector->floor_yscale != frontsector->floor_yscale
|
||||
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|
||||
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|
||||
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|
||||
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|
||||
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|
||||
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
|
||||
|
||||
// [RH] and rotation
|
||||
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|
||||
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|
||||
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|
||||
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
|
||||
)
|
||||
{
|
||||
solid = false;
|
||||
|
@ -1078,11 +1050,11 @@ void R_Subsector (subsector_t *sub)
|
|||
frontsector->sky & PL_SKYFLAT ? frontsector->sky :
|
||||
frontsector->ceilingpic,
|
||||
ceilinglightlevel + r_actualextralight, // killough 4/11/98
|
||||
frontsector->ceiling_xoffs, // killough 3/7/98
|
||||
frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs,
|
||||
frontsector->ceiling_xscale,
|
||||
frontsector->ceiling_yscale,
|
||||
frontsector->ceiling_angle + frontsector->base_ceiling_angle,
|
||||
frontsector->GetXOffset(sector_t::ceiling), // killough 3/7/98
|
||||
frontsector->GetYOffset(sector_t::ceiling), // killough 3/7/98
|
||||
frontsector->GetXScale(sector_t::ceiling),
|
||||
frontsector->GetYScale(sector_t::ceiling),
|
||||
frontsector->GetAngle(sector_t::ceiling),
|
||||
frontsector->CeilingSkyBox
|
||||
) : NULL;
|
||||
|
||||
|
@ -1103,11 +1075,11 @@ void R_Subsector (subsector_t *sub)
|
|||
frontsector->sky & PL_SKYFLAT ? frontsector->sky :
|
||||
frontsector->floorpic,
|
||||
floorlightlevel + r_actualextralight, // killough 3/16/98
|
||||
frontsector->floor_xoffs, // killough 3/7/98
|
||||
frontsector->floor_yoffs + frontsector->base_floor_yoffs,
|
||||
frontsector->floor_xscale,
|
||||
frontsector->floor_yscale,
|
||||
frontsector->floor_angle + frontsector->base_floor_angle,
|
||||
frontsector->GetXOffset(sector_t::floor), // killough 3/7/98
|
||||
frontsector->GetYOffset(sector_t::floor), // killough 3/7/98
|
||||
frontsector->GetXScale(sector_t::floor),
|
||||
frontsector->GetYScale(sector_t::floor),
|
||||
frontsector->GetAngle(sector_t::floor),
|
||||
frontsector->FloorSkyBox
|
||||
) : NULL;
|
||||
|
||||
|
|
132
src/r_defs.h
132
src/r_defs.h
|
@ -319,6 +319,20 @@ struct extsector_t
|
|||
void Serialize(FArchive &arc);
|
||||
};
|
||||
|
||||
struct FTransform
|
||||
{
|
||||
// killough 3/7/98: floor and ceiling texture offsets
|
||||
fixed_t xoffs, yoffs;
|
||||
|
||||
// [RH] floor and ceiling texture scales
|
||||
fixed_t xscale, yscale;
|
||||
|
||||
// [RH] floor and ceiling texture rotation
|
||||
angle_t angle;
|
||||
|
||||
// base values
|
||||
fixed_t base_angle, base_yoffs;
|
||||
};
|
||||
|
||||
struct sector_t
|
||||
{
|
||||
|
@ -347,6 +361,102 @@ struct sector_t
|
|||
DInterpolation *SetInterpolation(int position, bool attach);
|
||||
void StopInterpolation(int position);
|
||||
|
||||
enum
|
||||
{
|
||||
floor,
|
||||
ceiling
|
||||
};
|
||||
|
||||
struct splane
|
||||
{
|
||||
FTransform xform;
|
||||
};
|
||||
|
||||
|
||||
splane planes[2];
|
||||
|
||||
void SetXOffset(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.xoffs = o;
|
||||
}
|
||||
|
||||
void AddXOffset(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.xoffs += o;
|
||||
}
|
||||
|
||||
fixed_t GetXOffset(int pos) const
|
||||
{
|
||||
return planes[pos].xform.xoffs;
|
||||
}
|
||||
|
||||
void SetYOffset(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.yoffs = o;
|
||||
}
|
||||
|
||||
void AddYOffset(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.yoffs += o;
|
||||
}
|
||||
|
||||
fixed_t GetYOffset(int pos, bool addbase = true) const
|
||||
{
|
||||
if (!addbase)
|
||||
{
|
||||
return planes[pos].xform.yoffs;
|
||||
}
|
||||
else
|
||||
{
|
||||
return planes[pos].xform.yoffs + planes[pos].xform.base_yoffs;
|
||||
}
|
||||
}
|
||||
|
||||
void SetXScale(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.xscale = o;
|
||||
}
|
||||
|
||||
fixed_t GetXScale(int pos) const
|
||||
{
|
||||
return planes[pos].xform.xscale;
|
||||
}
|
||||
|
||||
void SetYScale(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.yscale = o;
|
||||
}
|
||||
|
||||
fixed_t GetYScale(int pos) const
|
||||
{
|
||||
return planes[pos].xform.yscale;
|
||||
}
|
||||
|
||||
void SetAngle(int pos, angle_t o)
|
||||
{
|
||||
planes[pos].xform.angle = o;
|
||||
}
|
||||
|
||||
angle_t GetAngle(int pos, bool addbase = true) const
|
||||
{
|
||||
if (!addbase)
|
||||
{
|
||||
return planes[pos].xform.angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
return planes[pos].xform.angle + planes[pos].xform.base_angle;
|
||||
}
|
||||
}
|
||||
|
||||
void SetBase(int pos, fixed_t y, angle_t o)
|
||||
{
|
||||
planes[pos].xform.base_yoffs = y;
|
||||
planes[pos].xform.base_angle = o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Member variables
|
||||
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
fixed_t CenterCeiling () const { return ceilingplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
|
@ -358,20 +468,6 @@ struct sector_t
|
|||
// [RH] give floor and ceiling even more properties
|
||||
FDynamicColormap *ColorMap; // [RH] Per-sector colormap
|
||||
|
||||
// killough 3/7/98: floor and ceiling texture offsets
|
||||
fixed_t floor_xoffs, floor_yoffs;
|
||||
fixed_t ceiling_xoffs, ceiling_yoffs;
|
||||
|
||||
// [RH] floor and ceiling texture scales
|
||||
fixed_t floor_xscale, floor_yscale;
|
||||
fixed_t ceiling_xscale, ceiling_yscale;
|
||||
|
||||
// [RH] floor and ceiling texture rotation
|
||||
angle_t floor_angle, ceiling_angle;
|
||||
|
||||
fixed_t base_ceiling_angle, base_ceiling_yoffs;
|
||||
fixed_t base_floor_angle, base_floor_yoffs;
|
||||
|
||||
BYTE FloorLight, CeilingLight;
|
||||
BYTE FloorFlags, CeilingFlags;
|
||||
int floorpic, ceilingpic;
|
||||
|
@ -456,6 +552,9 @@ struct sector_t
|
|||
extsector_t * e; // This stores data that requires construction/destruction. Such data must not be copied by R_FakeFlat.
|
||||
};
|
||||
|
||||
FArchive &operator<< (FArchive &arc, sector_t::splane &p);
|
||||
|
||||
|
||||
struct ReverbContainer;
|
||||
struct zone_t
|
||||
{
|
||||
|
@ -504,6 +603,11 @@ struct side_t
|
|||
|
||||
int GetLightLevel (bool foggy, int baselight) const;
|
||||
|
||||
void SetLight(SWORD l)
|
||||
{
|
||||
Light = l;
|
||||
}
|
||||
|
||||
int GetTexture(int which) const
|
||||
{
|
||||
return textures[which].texture;
|
||||
|
|
|
@ -583,16 +583,8 @@ void DSectorScrollInterpolation::Destroy()
|
|||
|
||||
void DSectorScrollInterpolation::UpdateInterpolation()
|
||||
{
|
||||
if (!ceiling)
|
||||
{
|
||||
oldx = sector->floor_xoffs;
|
||||
oldy = sector->floor_yoffs;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldx = sector->ceiling_xoffs;
|
||||
oldy = sector->ceiling_yoffs;
|
||||
}
|
||||
oldx = sector->GetXOffset(ceiling);
|
||||
oldy = sector->GetYOffset(ceiling, false);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -603,16 +595,8 @@ void DSectorScrollInterpolation::UpdateInterpolation()
|
|||
|
||||
void DSectorScrollInterpolation::Restore()
|
||||
{
|
||||
if (!ceiling)
|
||||
{
|
||||
sector->floor_xoffs = bakx;
|
||||
sector->floor_yoffs = baky;
|
||||
}
|
||||
else
|
||||
{
|
||||
sector->ceiling_xoffs = bakx;
|
||||
sector->ceiling_yoffs = baky;
|
||||
}
|
||||
sector->SetXOffset(ceiling, bakx);
|
||||
sector->SetYOffset(ceiling, bakx);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -623,25 +607,11 @@ void DSectorScrollInterpolation::Restore()
|
|||
|
||||
void DSectorScrollInterpolation::Interpolate(fixed_t smoothratio)
|
||||
{
|
||||
fixed_t *px;
|
||||
fixed_t *py;
|
||||
bakx = sector->GetXOffset(ceiling);
|
||||
baky = sector->GetYOffset(ceiling, false);
|
||||
|
||||
if (!ceiling)
|
||||
{
|
||||
px = §or->floor_xoffs;
|
||||
py = §or->floor_yoffs;
|
||||
}
|
||||
else
|
||||
{
|
||||
px = §or->ceiling_xoffs;
|
||||
py = §or->ceiling_yoffs;
|
||||
}
|
||||
|
||||
bakx = *px;
|
||||
baky = *py;
|
||||
|
||||
*px = oldx + FixedMul(bakx - oldx, smoothratio);
|
||||
*py = oldy + FixedMul(baky - oldy, smoothratio);
|
||||
sector->SetXOffset(ceiling, oldx + FixedMul(bakx - oldx, smoothratio));
|
||||
sector->SetYOffset(ceiling, oldy + FixedMul(baky - oldy, smoothratio));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -1683,16 +1683,6 @@ bool R_AlignFlat (int linenum, int side, int fc)
|
|||
dist = -dist;
|
||||
}
|
||||
|
||||
if (fc)
|
||||
{
|
||||
sec->base_ceiling_angle = 0-angle;
|
||||
sec->base_ceiling_yoffs = dist & ((1<<(FRACBITS+8))-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sec->base_floor_angle = 0-angle;
|
||||
sec->base_floor_yoffs = dist & ((1<<(FRACBITS+8))-1);
|
||||
}
|
||||
|
||||
sec->SetBase(fc, dist & ((1<<(FRACBITS+8))-1), 0-angle);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1300,11 +1300,11 @@ void RP_AddLine (seg_t *line)
|
|||
|| curline->sidedef->GetTexture(side_t::mid) != 0
|
||||
|
||||
// killough 3/7/98: Take flats offsets into account:
|
||||
|| backsector->floor_xoffs != frontsector->floor_xoffs
|
||||
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + backsector->base_floor_yoffs)
|
||||
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|
||||
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|
||||
|
||||
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|
||||
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
|
||||
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|
||||
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
|
||||
|
||||
|| backsector->FloorLight != frontsector->FloorLight
|
||||
|| backsector->CeilingLight != frontsector->CeilingLight
|
||||
|| backsector->FloorFlags != frontsector->FloorFlags
|
||||
|
@ -1314,14 +1314,14 @@ void RP_AddLine (seg_t *line)
|
|||
|| backsector->ColorMap != frontsector->ColorMap
|
||||
|
||||
// [RH] and scaling
|
||||
|| backsector->floor_xscale != frontsector->floor_xscale
|
||||
|| backsector->floor_yscale != frontsector->floor_yscale
|
||||
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|
||||
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|
||||
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|
||||
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|
||||
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|
||||
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
|
||||
|
||||
// [RH] and rotation
|
||||
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|
||||
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|
||||
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|
||||
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
|
||||
)
|
||||
{
|
||||
solid = false;
|
||||
|
|
|
@ -1268,8 +1268,8 @@ void R_NewWall (bool needlights)
|
|||
|| backsector->floorpic != frontsector->floorpic
|
||||
|
||||
// killough 3/7/98: Add checks for (x,y) offsets
|
||||
|| backsector->floor_xoffs != frontsector->floor_xoffs
|
||||
|| (backsector->floor_yoffs + backsector->base_floor_yoffs) != (frontsector->floor_yoffs + frontsector->base_floor_yoffs)
|
||||
|| backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor)
|
||||
|| backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor)
|
||||
|
||||
// killough 4/15/98: prevent 2s normals
|
||||
// from bleeding through deep water
|
||||
|
@ -1281,10 +1281,10 @@ void R_NewWall (bool needlights)
|
|||
// [RH] Add checks for colormaps
|
||||
|| backsector->ColorMap != frontsector->ColorMap
|
||||
|
||||
|| backsector->floor_xscale != frontsector->floor_xscale
|
||||
|| backsector->floor_yscale != frontsector->floor_yscale
|
||||
|| backsector->GetXScale(sector_t::floor) != frontsector->GetXScale(sector_t::floor)
|
||||
|| backsector->GetYScale(sector_t::floor) != frontsector->GetYScale(sector_t::floor)
|
||||
|
||||
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|
||||
|| backsector->GetAngle(sector_t::floor) != frontsector->GetAngle(sector_t::floor)
|
||||
|
||||
|| (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
|
||||
;
|
||||
|
@ -1297,8 +1297,8 @@ void R_NewWall (bool needlights)
|
|||
|| backsector->ceilingpic != frontsector->ceilingpic
|
||||
|
||||
// killough 3/7/98: Add checks for (x,y) offsets
|
||||
|| backsector->ceiling_xoffs != frontsector->ceiling_xoffs
|
||||
|| (backsector->ceiling_yoffs + backsector->base_ceiling_yoffs) != (frontsector->ceiling_yoffs + frontsector->base_ceiling_yoffs)
|
||||
|| backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling)
|
||||
|| backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling)
|
||||
|
||||
// killough 4/15/98: prevent 2s normals
|
||||
// from bleeding through fake ceilings
|
||||
|
@ -1310,10 +1310,10 @@ void R_NewWall (bool needlights)
|
|||
// [RH] Add check for colormaps
|
||||
|| backsector->ColorMap != frontsector->ColorMap
|
||||
|
||||
|| backsector->ceiling_xscale != frontsector->ceiling_xscale
|
||||
|| backsector->ceiling_yscale != frontsector->ceiling_yscale
|
||||
|| backsector->GetXScale(sector_t::ceiling) != frontsector->GetXScale(sector_t::ceiling)
|
||||
|| backsector->GetYScale(sector_t::ceiling) != frontsector->GetYScale(sector_t::ceiling)
|
||||
|
||||
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|
||||
|| backsector->GetAngle(sector_t::ceiling) != frontsector->GetAngle(sector_t::ceiling)
|
||||
|
||||
|| (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
|
||||
);
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 1028
|
||||
#define MINSAVEVER 1033
|
||||
|
||||
#if SVN_REVISION_NUMBER < MINSAVEVER
|
||||
// Never write a savegame with a version lower than what we need
|
||||
|
|
Loading…
Reference in a new issue