Skip to content

Commit

Permalink
fix angle adjusment in Mix_SetPosition
Browse files Browse the repository at this point in the history
Backported from mainstream: libsdl-org/SDL_mixer@502f4e2
  • Loading branch information
Wohlstand committed Feb 18, 2021
1 parent 1182125 commit ff4ce93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/effect_position.c
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,9 @@ int SDLCALLCC Mix_SetPosition(int channel, Sint16 angle, Uint8 distance)
if (f == NULL)
return(0);

angle = SDL_abs(angle) % 360; /* make angle between 0 and 359. */
/* make angle between 0 and 359. */
angle %= 360;
if (angle < 0) angle += 360;

Mix_LockAudio();
args = get_position_arg(channel);
Expand Down

0 comments on commit ff4ce93

Please sign in to comment.