Skip to content

Commit

Permalink
port: scale gun swivel only when mouse aiming
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Aug 14, 2023
1 parent c3fb50c commit 4d52a8e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/game/bondmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,8 +1842,14 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
x = g_Vars.currentplayer->speedtheta * 0.3f + g_Vars.currentplayer->gunextraaimx;
y = -g_Vars.currentplayer->speedverta * 0.1f + g_Vars.currentplayer->gunextraaimy;
#else
const f32 xscale = 320.f / (f32)videoGetWidth();
const f32 yscale = 240.f / (f32)videoGetHeight();
f32 xscale, yscale;
if (movedata.freelookdx || movedata.freelookdy) {
xscale = 320.f / (f32)videoGetWidth();
yscale = 240.f / (f32)videoGetHeight();
} else {
xscale = 1.f;
yscale = 1.f;
}
x = g_Vars.currentplayer->speedtheta * 0.3f * xscale + g_Vars.currentplayer->gunextraaimx;
y = -g_Vars.currentplayer->speedverta * 0.1f * yscale + g_Vars.currentplayer->gunextraaimy;
#endif
Expand Down

0 comments on commit 4d52a8e

Please sign in to comment.