remove unnecessary cast from MakeLightTable
Also changed the c-style cast to static_cast with appropriate type for destination.
This commit is contained in:
parent
949cb713d3
commit
8dbbdcca0d
1 changed files with 3 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue