mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-26 03:51:46 +00:00
fix modular overflow/underflow in djui_hud_set_rotation_interpolated
This commit is contained in:
parent
d53d20c11c
commit
6150b2722f
1 changed files with 2 additions and 1 deletions
|
|
@ -234,7 +234,8 @@ void djui_hud_set_rotation(s16 rotation, f32 pivotX, f32 pivotY) {
|
|||
}
|
||||
|
||||
void djui_hud_set_rotation_interpolated(s32 prevRotation, f32 prevPivotX, f32 prevPivotY, s32 rotation, f32 pivotX, f32 pivotY) {
|
||||
sRotation.rotationDiff = ((rotation - prevRotation) * 180.f) / 0x8000;
|
||||
f32 normalizedDiff = ((rotation - prevRotation + 0x8000) & 0xFFFF) - 0x8000; // Fix modular overflow/underflow
|
||||
sRotation.rotationDiff = (normalizedDiff * 180.f) / 0x8000;
|
||||
sRotation.prevPivotX = prevPivotX;
|
||||
sRotation.prevPivotY = prevPivotY;
|
||||
sRotation.rotation = (rotation * 180.f) / 0x8000;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue