remove unnecessary cast from MakeLightTable

Also changed the c-style cast to static_cast with appropriate type for destination.
This commit is contained in:
ephphatha 2021-07-09 00:05:20 +10:00 committed by Anders Jenbo
commit 8dbbdcca0d

View file

@ -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));
}
}
}