- Update to ZDoom r2613

* addition of textured automap. (not active for GL renderer yet!)



git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@909 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2010-08-27 17:42:01 +00:00
parent 2934a611c9
commit af753ebe37
58 changed files with 2040 additions and 2253 deletions

View file

@ -36,6 +36,7 @@
#include "i_system.h"
#include "p_lnspec.h"
#include "p_setup.h"
#include "r_main.h"
#include "r_plane.h"
@ -112,6 +113,8 @@ TArray<size_t> WallMirrors;
static FNodeBuilder::FLevel PolyNodeLevel;
static FNodeBuilder PolyNodeBuilder(PolyNodeLevel);
static subsector_t *InSubsector;
CVAR (Bool, r_drawflat, false, 0) // [RH] Don't texture segs?
@ -167,10 +170,11 @@ static cliprange_t solidsegs[MAXWIDTH/2+2];
//
//==========================================================================
void R_ClipWallSegment (int first, int last, bool solid)
bool R_ClipWallSegment (int first, int last, bool solid)
{
cliprange_t *next, *start;
int i, j;
bool res = false;
// Find the first range that touches the range
// (adjacent pixels are touching).
@ -180,6 +184,7 @@ void R_ClipWallSegment (int first, int last, bool solid)
if (first < start->first)
{
res = true;
if (last <= start->first)
{
// Post is entirely visible (above start).
@ -205,7 +210,7 @@ void R_ClipWallSegment (int first, int last, bool solid)
next->last = last;
}
}
return;
return true;
}
// There is a fragment above *start.
@ -220,7 +225,7 @@ void R_ClipWallSegment (int first, int last, bool solid)
// Bottom contained in start?
if (last <= start->last)
return;
return res;
next = start;
while (last >= (next+1)->first)
@ -257,6 +262,31 @@ crunch:
newend = start+i;
}
}
return true;
}
bool R_CheckClipWallSegment (int first, int last)
{
cliprange_t *start;
// Find the first range that touches the range
// (adjacent pixels are touching).
start = solidsegs;
while (start->last < first)
start++;
if (first < start->first)
{
return true;
}
// Bottom contained in start?
if (last > start->last)
{
return true;
}
return false;
}
@ -626,6 +656,10 @@ void R_AddLine (seg_t *line)
if (line->linedef == NULL)
{
if (R_CheckClipWallSegment (WallSX1, WallSX2))
{
InSubsector->flags |= SSECF_DRAWN;
}
return;
}
@ -792,6 +826,16 @@ void R_AddLine (seg_t *line)
// Reject empty lines used for triggers and special events.
// Identical floor and ceiling on both sides, identical light levels
// on both sides, and no middle texture.
// When using GL nodes, do a clipping test for these lines so we can
// mark their subsectors as visible for automap texturing.
if (hasglnodes && !(InSubsector->flags & SSECF_DRAWN))
{
if (R_CheckClipWallSegment(WallSX1, WallSX2))
{
InSubsector->flags |= SSECF_DRAWN;
}
}
return;
}
}
@ -827,7 +871,10 @@ void R_AddLine (seg_t *line)
#endif
}
R_ClipWallSegment (WallSX1, WallSX2, solid);
if (R_ClipWallSegment (WallSX1, WallSX2, solid))
{
InSubsector->flags |= SSECF_DRAWN;
}
}
@ -1096,12 +1143,21 @@ void R_Subsector (subsector_t *sub)
sector_t tempsec; // killough 3/7/98: deep water hack
int floorlightlevel; // killough 3/16/98: set floor lightlevel
int ceilinglightlevel; // killough 4/11/98
bool outersubsector;
if (InSubsector != NULL)
{ // InSubsector is not NULL. This means we are rendering from a mini-BSP.
outersubsector = false;
}
else
{
outersubsector = true;
InSubsector = sub;
}
#if 0
#ifdef RANGECHECK
if (sub - subsectors >= (ptrdiff_t)numsubsectors)
if (outersubsector && sub - subsectors >= (ptrdiff_t)numsubsectors)
I_Error ("R_Subsector: ss %ti with numss = %i", sub - subsectors, numsubsectors);
#endif
#endif
assert(sub->sector != NULL);
@ -1109,6 +1165,10 @@ void R_Subsector (subsector_t *sub)
if (sub->polys)
{ // Render the polyobjs in the subsector first
R_AddPolyobjs(sub);
if (outersubsector)
{
InSubsector = NULL;
}
return;
}
@ -1190,12 +1250,16 @@ void R_Subsector (subsector_t *sub)
while (count--)
{
if (!line->bPolySeg)
if (!outersubsector || line->sidedef == NULL || !(line->sidedef->Flags & WALLF_POLYOBJ))
{
R_AddLine (line);
}
line++;
}
if (outersubsector)
{
InSubsector = NULL;
}
}
//