mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- removed all portal fudging that was necessary to make thing based portals work the same as line based portals. Using an actor flag on the skybox thing the visplane code now checks what kind of portal is used and uses the proper logic accordingly. As a result the "Portals" compatibility flag no longer exists.
SVN r3072 (trunk)
This commit is contained in:
parent
e27179afd0
commit
e46183d836
6 changed files with 1 additions and 89 deletions
|
@ -90,7 +90,6 @@ static FCompatOption Options[] =
|
|||
{ "resetplayerspeed", 0, BCOMPATF_RESETPLAYERSPEED },
|
||||
{ "vileghosts", 0, BCOMPATF_VILEGHOSTS },
|
||||
{ "ignoreteleporttags", 0, BCOMPATF_BADTELEPORTERS },
|
||||
{ "oldportals", 0, BCOMPATF_BADPORTALS },
|
||||
|
||||
// list copied from g_mapinfo.cpp
|
||||
{ "shorttex", COMPATF_SHORTTEX, 0 },
|
||||
|
@ -284,12 +283,6 @@ void CheckCompatibility(MapData *map)
|
|||
ib_compatflags = 0;
|
||||
ii_compatparams = -1;
|
||||
}
|
||||
else if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATPORTAL))
|
||||
{
|
||||
ii_compatflags = 0;
|
||||
ib_compatflags = BCOMPATF_BADPORTALS;
|
||||
ii_compatparams = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
map->GetChecksum(md5.Bytes);
|
||||
|
|
|
@ -174,7 +174,6 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize)
|
|||
else if(sc.Compare("Extended")) iwad->flags |= GI_MENUHACK_EXTENDED;
|
||||
else if(sc.Compare("Shorttex")) iwad->flags |= GI_COMPATSHORTTEX;
|
||||
else if(sc.Compare("Stairs")) iwad->flags |= GI_COMPATSTAIRS;
|
||||
else if(sc.Compare("Portals")) iwad->flags |= GI_COMPATPORTAL;
|
||||
else sc.ScriptError(NULL);
|
||||
}
|
||||
while (sc.CheckString(","));
|
||||
|
|
1
src/gi.h
1
src/gi.h
|
@ -47,7 +47,6 @@
|
|||
#define GI_COMPATPOLY1 0x00000040 // Hexen's MAP36 needs old polyobject drawing
|
||||
#define GI_COMPATPOLY2 0x00000080 // so does HEXDD's MAP47
|
||||
#define GI_NOTEXTCOLOR 0x00000100 // Chex Quest 3 would have everything green
|
||||
#define GI_COMPATPORTAL 0x00000200 // Urban Brawl relies on the old portal code
|
||||
|
||||
#include "gametype.h"
|
||||
|
||||
|
|
|
@ -921,39 +921,6 @@ static bool SpreadCeilingPortal(AStackPoint *pt, fixed_t alpha, sector_t *sector
|
|||
return fail;
|
||||
}
|
||||
|
||||
static bool SpreadFloorPortal(AStackPoint *pt, fixed_t alpha, sector_t *sector)
|
||||
{
|
||||
bool fail = false;
|
||||
sector->validcount = validcount;
|
||||
for(int i=0; i<sector->linecount; i++)
|
||||
{
|
||||
line_t *line = sector->lines[i];
|
||||
sector_t *backsector = sector == line->frontsector? line->backsector : line->frontsector;
|
||||
if (line->backsector == line->frontsector) continue;
|
||||
if (backsector == NULL) { fail = true; continue; }
|
||||
if (backsector->validcount == validcount) continue;
|
||||
if (backsector->FloorSkyBox == pt) continue;
|
||||
|
||||
// Check if the backside would map to the same visplane
|
||||
if (backsector->FloorSkyBox != NULL) { fail = true; continue; }
|
||||
if (backsector->floorplane != sector->ceilingplane) { fail = true; continue; }
|
||||
if (backsector->lightlevel != sector->lightlevel) { fail = true; continue; }
|
||||
if (backsector->GetTexture(sector_t::floor) != sector->GetTexture(sector_t::floor)) { fail = true; continue; }
|
||||
if (backsector->GetXOffset(sector_t::floor) != sector->GetXOffset(sector_t::floor)) { fail = true; continue; }
|
||||
if (backsector->GetYOffset(sector_t::floor) != sector->GetYOffset(sector_t::floor)) { fail = true; continue; }
|
||||
if (backsector->GetXScale(sector_t::floor) != sector->GetXScale(sector_t::floor)) { fail = true; continue; }
|
||||
if (backsector->GetYScale(sector_t::floor) != sector->GetYScale(sector_t::floor)) { fail = true; continue; }
|
||||
if (backsector->GetAngle(sector_t::floor) != sector->GetAngle(sector_t::floor)) { fail = true; continue; }
|
||||
if (SpreadFloorPortal(pt, alpha, backsector)) { fail = true; continue; }
|
||||
}
|
||||
if (!fail)
|
||||
{
|
||||
sector->FloorSkyBox = pt;
|
||||
sector->SetAlpha(sector_t::floor, alpha);
|
||||
}
|
||||
return fail;
|
||||
}
|
||||
|
||||
void P_SetupPortals()
|
||||
{
|
||||
TThinkerIterator<AStackPoint> it;
|
||||
|
@ -974,51 +941,6 @@ void P_SetupPortals()
|
|||
pt->special1 = 0;
|
||||
points.Push(pt);
|
||||
}
|
||||
|
||||
// Maps using undefined portal hacks may not benefit from portal optimizations.
|
||||
if (ib_compatflags & BCOMPATF_BADPORTALS) return;
|
||||
|
||||
for(unsigned i=0;i<points.Size(); i++)
|
||||
{
|
||||
if (points[i]->special1 == 0 && points[i]->Mate != NULL)
|
||||
{
|
||||
for(unsigned j=1;j<points.Size(); j++)
|
||||
{
|
||||
if (points[j]->special1 == 0 && points[j]->Mate != NULL && points[i]->GetClass() == points[j]->GetClass())
|
||||
{
|
||||
fixed_t deltax1 = points[i]->Mate->x - points[i]->x;
|
||||
fixed_t deltay1 = points[i]->Mate->y - points[i]->y;
|
||||
fixed_t deltax2 = points[j]->Mate->x - points[j]->x;
|
||||
fixed_t deltay2 = points[j]->Mate->y - points[j]->y;
|
||||
|
||||
if (deltax1 == deltax2 && deltay1 == deltay2)
|
||||
{
|
||||
if (points[j]->Sector->FloorSkyBox == points[j]->Mate)
|
||||
points[j]->Sector->FloorSkyBox = points[i]->Mate;
|
||||
|
||||
if (points[j]->Sector->CeilingSkyBox == points[j]->Mate)
|
||||
points[j]->Sector->CeilingSkyBox = points[i]->Mate;
|
||||
|
||||
points[j]->special1 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
validcount++;
|
||||
// Some fudging to preserve an unintended 'portal bleeding' effect caused by incomplete checks in the rendering code.
|
||||
// Due to the addition of linedef-based portals this effect no longer works.
|
||||
for(int i=0;i<numsectors; i++)
|
||||
{
|
||||
if (sectors[i].CeilingSkyBox != NULL && sectors[i].CeilingSkyBox->bAlways && sectors[i].validcount != validcount)
|
||||
{
|
||||
SpreadCeilingPortal(barrier_cast<AStackPoint*>(sectors[i].CeilingSkyBox), sectors[i].GetAlpha(sector_t::ceiling), §ors[i]);
|
||||
}
|
||||
if (sectors[i].FloorSkyBox != NULL && sectors[i].FloorSkyBox->bAlways && sectors[i].validcount != validcount)
|
||||
{
|
||||
SpreadFloorPortal(barrier_cast<AStackPoint*>(sectors[i].FloorSkyBox), sectors[i].GetAlpha(sector_t::floor), §ors[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetPortal(sector_t *sector, int plane, AStackPoint *portal, fixed_t alpha)
|
||||
|
|
|
@ -584,7 +584,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl
|
|||
check->viewz == stacked_viewz &&
|
||||
(
|
||||
// headache inducing logic... :(
|
||||
(ib_compatflags & BCOMPATF_BADPORTALS) ||
|
||||
(!(skybox->flags & MF_JUSTATTACKED)) ||
|
||||
(
|
||||
check->alpha == alpha &&
|
||||
(alpha == 0 || // if alpha is > 0 everything needs to be checked
|
||||
|
|
|
@ -26,7 +26,6 @@ IWad
|
|||
Game = "Doom"
|
||||
Config = "UrbanBrawl"
|
||||
Mapinfo = "mapinfo/urbanbrawl.txt"
|
||||
Compatibility = "Portals"
|
||||
MustContain = "MAP01", "AD2LIB"
|
||||
BannerColors = "a8 a8 00", "a8 00 00"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue