- sorting draw items by light level no longer makes sense so remove all corresponding code from dicmp.

This commit is contained in:
Christoph Oelckers 2014-08-24 13:10:45 +02:00
parent bf03d02228
commit a903cbe12e

View file

@ -794,7 +794,6 @@ static int __cdecl dicmp (const void *a, const void *b)
{ {
const GLDrawItem * di[2]; const GLDrawItem * di[2];
FMaterial * tx[2]; FMaterial * tx[2];
int lights[2];
int clamp[2]; int clamp[2];
//colormap_t cm[2]; //colormap_t cm[2];
di[0]=(const GLDrawItem *)a; di[0]=(const GLDrawItem *)a;
@ -808,7 +807,6 @@ static int __cdecl dicmp (const void *a, const void *b)
{ {
GLFlat * f=&sortinfo->flats[di[i]->index]; GLFlat * f=&sortinfo->flats[di[i]->index];
tx[i]=f->gltexture; tx[i]=f->gltexture;
lights[i]=f->lightlevel;
clamp[i] = 0; clamp[i] = 0;
} }
break; break;
@ -817,7 +815,6 @@ static int __cdecl dicmp (const void *a, const void *b)
{ {
GLWall * w=&sortinfo->walls[di[i]->index]; GLWall * w=&sortinfo->walls[di[i]->index];
tx[i]=w->gltexture; tx[i]=w->gltexture;
lights[i]=w->lightlevel;
clamp[i] = w->flags & 3; clamp[i] = w->flags & 3;
} }
break; break;
@ -826,16 +823,14 @@ static int __cdecl dicmp (const void *a, const void *b)
{ {
GLSprite * s=&sortinfo->sprites[di[i]->index]; GLSprite * s=&sortinfo->sprites[di[i]->index];
tx[i]=s->gltexture; tx[i]=s->gltexture;
lights[i]=s->lightlevel; clamp[i] = 3;
clamp[i] = 4;
} }
break; break;
case GLDIT_POLY: break; case GLDIT_POLY: break;
} }
} }
if (tx[0]!=tx[1]) return tx[0]-tx[1]; if (tx[0]!=tx[1]) return tx[0]-tx[1];
if (clamp[0]!=clamp[1]) return clamp[0]-clamp[1]; // clamping forces different textures. return clamp[0]-clamp[1]; // clamping forces different textures.
return lights[0]-lights[1];
} }