Browse Source

remove unnecessary cast from MakeLightTable

Also changed the c-style cast to static_cast with appropriate type for destination.
pull/2327/head
ephphatha 5 years ago committed by Anders Jenbo
parent
commit
8dbbdcca0d
  1. 7
      Source/lighting.cpp

7
Source/lighting.cpp

@ -919,10 +919,9 @@ void MakeLightTable()
for (int i = 0; i < 8; i++) {
for (int k = 0; k < 16; k++) {
for (int l = 0; l < 16; l++) {
double fs = (BYTE)sqrt((double)(8 * l - j) * (8 * l - j) + (8 * k - i) * (8 * k - i));
fs += fs < 0 ? -0.5 : 0.5;
lightblock[j * 8 + i][k][l] = fs;
int a = (8 * l - j);
int b = (8 * k - i);
lightblock[j * 8 + i][k][l] = static_cast<uint8_t>(sqrt(a * a + b * b));
}
}
}

Loading…
Cancel
Save