Slightly reorder cases for legibility. (decreasing order instead of random).

This commit is contained in:
Ragnvald Maartmann-Moe IV 2004-02-15 19:55:59 +00:00
parent 2d2173dc4e
commit e43129316b

View file

@ -242,7 +242,7 @@ static void
R_BuildLightMap_1 (msurface_t *surf)
{
byte *dest;
int maps, size, smax, tmax, i, j, stride;
int maps, size, stride, smax, tmax, i, j;
unsigned int scale;
unsigned int *bl;
@ -291,14 +291,6 @@ R_BuildLightMap_1 (msurface_t *surf)
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
switch (gl_overbright->int_val) {
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = smax; j; j--) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
}
}
break;
case 2:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = smax; j; j--) {
@ -307,6 +299,14 @@ R_BuildLightMap_1 (msurface_t *surf)
}
}
break;
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = smax; j; j--) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
}
}
break;
default:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = smax; j; j--) {
@ -322,7 +322,7 @@ static void
R_BuildLightMap_3 (msurface_t *surf)
{
byte *dest;
int maps, size, smax, tmax, i, j, stride;
int maps, size, stride, smax, tmax, i, j;
unsigned int scale;
unsigned int *bl;
@ -370,18 +370,6 @@ R_BuildLightMap_3 (msurface_t *surf)
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
switch (gl_overbright->int_val) {
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
}
}
break;
case 2:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
@ -394,6 +382,18 @@ R_BuildLightMap_3 (msurface_t *surf)
}
}
break;
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
}
}
break;
default:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
@ -461,19 +461,6 @@ R_BuildLightMap_4 (msurface_t *surf)
+ (surf->light_t * BLOCK_WIDTH + surf->light_s) * lightmap_bytes;
switch (gl_overbright->int_val) {
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = 0;
}
}
break;
case 2:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
@ -487,6 +474,19 @@ R_BuildLightMap_4 (msurface_t *surf)
}
}
break;
case 1:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = min ((*bl >> 9) + (*bl >> 10), 255);
bl++;
*dest++ = 0;
}
}
break;
default:
for (i = 0; i < tmax; i++, dest += stride) {
for (j = 0; j < smax; j++) {