Update to ZDoom r2448:

- addition of and changes for new polyobject code.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@846 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2010-07-23 14:32:07 +00:00
parent 0dcbdf347b
commit 76780fd5b1
25 changed files with 1347 additions and 889 deletions

View file

@ -58,6 +58,7 @@
#include "am_map.h"
#include "a_artifacts.h"
#include "po_man.h"
struct AMColor
{
@ -177,6 +178,10 @@ CVAR (Color, am_ovthingcolor_friend, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE);
CVAR(Int, am_showsubsector, -1, 0);
// Disable the ML_DONTDRAW line flag if x% of all lines in a map are flagged with it
// (To counter annoying mappers who think they are smart by making the automap unusable)
bool am_showallenabled;
@ -1614,6 +1619,64 @@ static bool AM_CheckSecret(line_t *line)
}
//=============================================================================
//
// Polyobject debug stuff
//
//=============================================================================
void AM_drawSeg(seg_t *seg, const AMColor &color)
{
mline_t l;
l.a.x = seg->v1->x >> FRACTOMAPBITS;
l.a.y = seg->v1->y >> FRACTOMAPBITS;
l.b.x = seg->v2->x >> FRACTOMAPBITS;
l.b.y = seg->v2->y >> FRACTOMAPBITS;
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
{
AM_rotatePoint (&l.a.x, &l.a.y);
AM_rotatePoint (&l.b.x, &l.b.y);
}
AM_drawMline(&l, color);
}
void AM_showSS()
{
if (am_showsubsector >= 0 && am_showsubsector < numsubsectors)
{
AMColor yellow;
yellow.FromRGB(255,255,0);
AMColor red;
red.FromRGB(255,0,0);
subsector_t *sub = &subsectors[am_showsubsector];
for(unsigned int i=0;i<sub->numlines;i++)
{
AM_drawSeg(&segs[sub->firstline+i], yellow);
}
PO_LinkToSubsectors();
for(int i=0;i<po_NumPolyobjs;i++)
{
FPolyObj *po = &polyobjs[i];
FPolyNode *pnode = po->subsectorlinks;
while (pnode != NULL)
{
if (pnode->subsector == sub)
{
for(unsigned j=0;j<pnode->segs.Size();j++)
{
AM_drawSeg(&pnode->segs[j], red);
}
}
pnode = pnode->snext;
}
}
}
}
//=============================================================================
//
// Determines visible lines, draws them.
@ -2166,6 +2229,8 @@ void AM_Drawer ()
AM_drawCrosshair(XHairColor);
AM_drawMarks();
AM_showSS();
}
//=============================================================================