- remove some obsolete code from decal rendering.

- avoid rebinding the same texture multiple times, as there's considerable overhead in the texture manager.
- check gl_sort_textures only once per scene, not per draw list.
This commit is contained in:
Christoph Oelckers 2014-08-30 15:34:14 +02:00
commit 12160bd29c
7 changed files with 50 additions and 30 deletions

View file

@ -349,11 +349,15 @@ void GLWall::DrawDecal(DBaseDecal *decal)
//==========================================================================
void GLWall::DoDrawDecals()
{
DBaseDecal *decal = seg->sidedef->AttachedDecals;
while (decal)
if (seg->sidedef && seg->sidedef->AttachedDecals)
{
DrawDecal(decal);
decal = decal->WallNext;
gl_SetFog(lightlevel, rellight + getExtraLight(), &Colormap, false);
DBaseDecal *decal = seg->sidedef->AttachedDecals;
while (decal)
{
DrawDecal(decal);
decal = decal->WallNext;
}
}
}