mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
R_RenderSegLoop: fix FINETANGENT sometimes going out of bounds
This commit is contained in:
parent
32ed5fe4ae
commit
e5d51d5a31
1 changed files with 2 additions and 1 deletions
|
|
@ -1451,7 +1451,8 @@ static void R_RenderSegLoop (void)
|
||||||
//SoM: Calculate offsets for Thick fake floors.
|
//SoM: Calculate offsets for Thick fake floors.
|
||||||
// calculate texture offset
|
// calculate texture offset
|
||||||
angle = (rw_centerangle + xtoviewangle[viewssnum][rw_x])>>ANGLETOFINESHIFT;
|
angle = (rw_centerangle + xtoviewangle[viewssnum][rw_x])>>ANGLETOFINESHIFT;
|
||||||
texturecolumn = rw_offset-FixedMul(FINETANGENT(angle),rw_distance);
|
// Mask 4095 to guarantee this index is within bounds
|
||||||
|
texturecolumn = rw_offset-FixedMul(FINETANGENT(angle & 4095),rw_distance);
|
||||||
|
|
||||||
if (oldtexturecolumn != -1) {
|
if (oldtexturecolumn != -1) {
|
||||||
rw_bottomtexturemid += FixedMul(rw_bottomtextureslide, oldtexturecolumn-texturecolumn);
|
rw_bottomtexturemid += FixedMul(rw_bottomtextureslide, oldtexturecolumn-texturecolumn);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue