- changed light color calculation for textured automap.

- add some crash prevention code for some rare maps where normal nodes can be misidentified as GL nodes.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@920 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2010-08-28 18:00:36 +00:00
parent cc17cdc975
commit e51f8dab9f
2 changed files with 24 additions and 1 deletions

View file

@ -398,6 +398,25 @@ static void PrepareSegs()
// count the segs
memset(segcount, 0, numsides * sizeof(int));
// set up the extra data in case the map was loaded with regular node that might pass as GL nodes.
if (glsegextras == NULL)
{
glsegextras = new glsegextra_t[numsegs];
for(int i=0;i<numsegs;i++)
{
glsegextras[i].PartnerSeg = DWORD_MAX;
}
for (int i=0; i<numsubsectors; i++)
{
int seg = int(subsectors[i].firstline-segs);
for(DWORD j=0;j<subsectors[i].numlines;j++)
{
glsegextras[j+seg].Subsector = &subsectors[i];
}
}
}
for(int i=0;i<numsegs;i++)
{
seg_t *seg = &segs[i];

View file

@ -569,7 +569,11 @@ void FGLRenderer::FillSimplePoly(FTexture *texture, FVector2 *points, int npoint
FColormap cm;
cm = colormap;
gl_SetColor(lightlevel, 0, &cm,1.0f);
lightlevel = gl_CalcLightLevel(lightlevel, 0, true);
PalEntry pe = gl_CalcLightColor(lightlevel, cm.LightColor, cm.blendfactor);
gl.Color3ub(pe.r, pe.g, pe.b);
if (!gltexture->Bind(cm.colormap))
{
return;