port: make the reverse pitch option affect mouselook

This commit is contained in:
fgsfds committed 2023-09-14 20:41:19 +02:00
1 parent 53e881b75e
commit 78ff5683ce
3 files changed
+12 -3

No files matched your search

+6 -3
View File
@@ -741,13 +741,13 @@ void eyespyProcessInput(bool allowbuttons)
} else if (controlmode <= CONTROLMODE_14) {
aimpressed = c1buttons & (R_TRIG);
shootpressed = c1buttons & Z_TRIG;
#ifdef PLATFORM_N64
#ifdef PLATFORM_N64
exitpressed = (c1buttons | c2buttons) & A_BUTTON;
activatepressed = (c1buttons | c2buttons) & B_BUTTON;
#else
#else
exitpressed = (c1buttons | c2buttons) & (BUTTON_WPNBACK | BUTTON_RADIAL);
activatepressed = (c1buttons | c2buttons) & (BUTTON_CANCEL_USE | BUTTON_ACCEPT_USE);
#endif
#endif
} else {
if (controlmode >= CONTROLMODE_23) {
aimpressed = c1buttons & Z_TRIG;
@@ -913,6 +913,9 @@ void eyespyProcessInput(bool allowbuttons)
if (mdx || mdy) {
mdx *= g_Vars.lvupdate60freal;
mdy *= g_Vars.lvupdate60freal;
if (g_Vars.currentplayerstats && !optionsGetForwardPitch(g_Vars.currentplayerstats->mpindex)) {
mdy = -mdy;
}
g_Vars.currentplayer->eyespy->theta += mdx * 1.5f;
// hold aim to move up and down, release to look up and down
if (aimpressed) {
+3
View File
@@ -706,6 +706,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
inputMouseGetScaledDelta(&movedata.freelookdx, &movedata.freelookdy);
allowmcross = (g_PlayerMouseAimMode == MOUSEAIM_CLASSIC) &&
(movedata.freelookdx || movedata.freelookdy || g_Vars.currentplayer->swivelpos[0] || g_Vars.currentplayer->swivelpos[1]);
if (movedata.invertpitch) {
movedata.freelookdy = -movedata.freelookdy;
}
}
#endif
+3
View File
@@ -3602,6 +3602,9 @@ void playerTick(bool arg0)
mdy *= 48.f;
mdx = (mdx < -128.f) ? -128.f : (mdx > 127.f) ? 127.f : mdx;
mdy = (mdy < -128.f) ? -128.f : (mdy > 127.f) ? 127.f : mdy;
if (g_Vars.currentplayerstats && !optionsGetForwardPitch(g_Vars.currentplayerstats->mpindex)) {
mdy = -mdy;
}
sp178 += mdy * LVUPDATE60FREAL() * 0.00025f;
sp174 -= mdx * LVUPDATE60FREAL() * 0.00025f;
}