- added new sector type 90 which designates a sector that is being used as a cubemapped skybox, in case someone wants to make one of those without using an actual sky for this.

This commit is contained in:
Christoph Oelckers 2016-04-14 13:22:15 +02:00
commit a0a530945d
4 changed files with 118 additions and 22 deletions

View file

@ -583,7 +583,23 @@ void GLWall::CheckTexturePosition()
if ((uplft.v == 0.f && uprgt.v == 0.f && lolft.v <= 1.f && lorgt.v <= 1.f) ||
(uplft.v >= 0.f && uprgt.v >= 0.f && lolft.v == 1.f && lorgt.v == 1.f))
{
flags|=GLT_CLAMPY;
flags |= GLT_CLAMPY;
}
// Check if this is marked as a skybox and if so, do the same for x.
// This intentionally only tests the seg's frontsector.
if (seg->frontsector->special == GLSector_Skybox)
{
sub = (float)xs_FloorToInt(uplft.u);
uplft.u -= sub;
uprgt.u -= sub;
lolft.u -= sub;
lorgt.u -= sub;
if ((uplft.u == 0.f && lolft.u == 0.f && uprgt.u <= 1.f && lorgt.u <= 1.f) ||
(uplft.u >= 0.f && lolft.u >= 0.f && uprgt.u == 1.f && lorgt.u == 1.f))
{
flags |= GLT_CLAMPX;
}
}
}
@ -604,6 +620,7 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg,
GLSeg glsave=glseg;
float flh=ceilingrefheight-floorrefheight;
int texpos;
BYTE savedflags = flags;
switch (_type)
{
@ -636,16 +653,17 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg,
}
else
{
CheckTexturePosition();
// Add this wall to the render list
sector_t * sec = sub? sub->sector : seg->frontsector;
CheckTexturePosition();
// Add this wall to the render list
sector_t * sec = sub ? sub->sector : seg->frontsector;
if (sec->e->XFloor.lightlist.Size()==0 || gl_fixedcolormap) PutWall(false);
else SplitWall(sec, false);
}
glseg=glsave;
flags&=~GLT_CLAMPY;
glseg = glsave;
flags = savedflags;
}
@ -837,11 +855,11 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
}
else
{
flags&=~GLT_CLAMPX;
flags &= ~GLT_CLAMPX;
}
if (!wrap)
{
flags|=GLT_CLAMPY;
flags |= GLT_CLAMPY;
}
}
if (mirrory)
@ -1330,7 +1348,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
sector_t * segback;
#ifdef _DEBUG
if (seg->linedef - lines == 904)
if (seg->linedef - lines < 4)
{
int a = 0;
}