mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 21:31:03 +00:00
Add a workaround for possible rounding errors in calculations of
sintable and radarang. sintable[512] was different in a 32-bit build. From-SVN: r8796
This commit is contained in:
parent
b54a6e0565
commit
3610609659
1 changed files with 2 additions and 2 deletions
|
@ -1667,14 +1667,14 @@ static int32_t engineLoadTables(void)
|
||||||
reciptable[i] = divscale30(2048, i+2048);
|
reciptable[i] = divscale30(2048, i+2048);
|
||||||
|
|
||||||
for (i=0; i<=512; i++)
|
for (i=0; i<=512; i++)
|
||||||
sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD));
|
sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD) + 0.0001f);
|
||||||
for (i=513; i<1024; i++)
|
for (i=513; i<1024; i++)
|
||||||
sintable[i] = sintable[1024-i];
|
sintable[i] = sintable[1024-i];
|
||||||
for (i=1024; i<2048; i++)
|
for (i=1024; i<2048; i++)
|
||||||
sintable[i] = -sintable[i-1024];
|
sintable[i] = -sintable[i-1024];
|
||||||
|
|
||||||
for (i=0; i<640; i++)
|
for (i=0; i<640; i++)
|
||||||
radarang[i] = (int16_t)(atanf(((float)(640-i)-0.5f) * (1.f/160.f)) * (-64.f * (1.f/BANG2RAD)));
|
radarang[i] = (int16_t)(atanf(((float)(640-i)-0.5f) * (1.f/160.f)) * (-64.f * (1.f/BANG2RAD)) + 0.0001f);
|
||||||
for (i=0; i<640; i++)
|
for (i=0; i<640; i++)
|
||||||
radarang[1279-i] = -radarang[i];
|
radarang[1279-i] = -radarang[i];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue