Change define to if statement

This commit is contained in:
Magnus Norddahl 2016-12-25 06:00:18 +01:00
parent ced7bdf94a
commit ea92b95483
1 changed files with 16 additions and 15 deletions

View File

@ -805,7 +805,8 @@ static void ProcessWallWorker(
double xmagnitude = 1.0; double xmagnitude = 1.0;
#if !defined(NO_DYNAMIC_SWLIGHTS) if (r_dynlights)
{
for (int x = x1; x < x2; x++, light += rw_lightstep) for (int x = x1; x < x2; x++, light += rw_lightstep)
{ {
int y1 = uwal[x]; int y1 = uwal[x];
@ -821,13 +822,14 @@ static void ProcessWallWorker(
WallSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, xmagnitude, rw_pic, getcol); WallSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, xmagnitude, rw_pic, getcol);
Draw1Column(x, y1, y2, sampler, draw1column); Draw1Column(x, y1, y2, sampler, draw1column);
} }
#else NetUpdate();
return;
}
// Calculate where 4 column alignment begins and ends: // Calculate where 4 column alignment begins and ends:
int aligned_x1 = clamp((x1 + 3) / 4 * 4, x1, x2); int aligned_x1 = clamp((x1 + 3) / 4 * 4, x1, x2);
int aligned_x2 = clamp(x2 / 4 * 4, x1, x2); int aligned_x2 = clamp(x2 / 4 * 4, x1, x2);
double xmagnitude = 1.0;
// First unaligned columns: // First unaligned columns:
for (int x = x1; x < aligned_x1; x++, light += rw_lightstep) for (int x = x1; x < aligned_x1; x++, light += rw_lightstep)
{ {
@ -956,7 +958,6 @@ static void ProcessWallWorker(
WallSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, xmagnitude, rw_pic, getcol); WallSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, xmagnitude, rw_pic, getcol);
Draw1Column(x, y1, y2, sampler, draw1column); Draw1Column(x, y1, y2, sampler, draw1column);
} }
#endif
NetUpdate(); NetUpdate();
} }