cleanup: move PLATFORM_N64 preprocessor checks for fov zoom into a separate macro to reduce clutter

This commit is contained in:
Phnod committed 2023-09-01 09:48:53 -04:00
1 parent 917209cb65
commit 5033c096a2
5 files changed
+17 -43

No files matched your search

+3 -9
View File
@@ -239,15 +239,9 @@ void bgunReset(void)
g_Vars.currentplayer->gunammooff = 0;
g_Vars.currentplayer->gunsightoff = GUNSIGHTREASON_NOTAIMING;
#ifdef PLATFORM_N64
g_Vars.currentplayer->gunzoomfovs[0] = 15;
g_Vars.currentplayer->gunzoomfovs[1] = 60;
g_Vars.currentplayer->gunzoomfovs[2] = 30;
#else
g_Vars.currentplayer->gunzoomfovs[0] = 15 * g_PlayerFovZoomMultiplier;
g_Vars.currentplayer->gunzoomfovs[1] = 60 * g_PlayerFovZoomMultiplier;
g_Vars.currentplayer->gunzoomfovs[2] = 30 * g_PlayerFovZoomMultiplier;
#endif
g_Vars.currentplayer->gunzoomfovs[0] = ADJUST_ZOOM_FOV(15);
g_Vars.currentplayer->gunzoomfovs[1] = ADJUST_ZOOM_FOV(60);
g_Vars.currentplayer->gunzoomfovs[2] = ADJUST_ZOOM_FOV(30);
if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) {
g_Weapons[WEAPON_EYESPY]->name = L_GUN_061; // "DrugSpy"
+2 -8
View File
@@ -1705,15 +1705,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
}
#endif
#ifdef PLATFORM_N64
if (eraserfov < 2) {
eraserfov = 2;
if (eraserfov < ADJUST_ZOOM_FOV(2)) {
eraserfov = ADJUST_ZOOM_FOV(2);
}
#else
if (eraserfov < 2 * g_PlayerFovZoomMultiplier) {
eraserfov = 2 * g_PlayerFovZoomMultiplier;
}
#endif
g_Vars.currentplayer->gunzoomfovs[1] = eraserfov;
+1 -5
View File
@@ -2377,11 +2377,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl)
if (fovy == 0 || fovy == 60.0f) {
fovy = 1;
} else {
#ifdef PLATFORM_N64
fovy = 60.0f / fovy + 1;
#else
fovy = 60.0f / fovy * g_PlayerFovZoomMultiplier;
#endif
fovy = 60.0f / ADJUST_ZOOM_FOV(fovy);
}
sprintf(zoomtext, "%s %s%s%4.2fX", arrows, "", "", fovy);
+5 -21
View File
@@ -209,11 +209,7 @@ f32 currentPlayerGetGunZoomFov(void)
if (weapon) {
f32 fov = weapon->aimsettings->zoomfov;
#ifdef PLATFORM_N64
return fov;
#else
return fov * g_PlayerFovZoomMultiplier;
#endif
return ADJUST_ZOOM_FOV(fov);
}
return 0;
@@ -244,15 +240,9 @@ void currentPlayerZoomOut(f32 fovpersec)
g_Vars.currentplayer->gunzoomfovs[index] *= 1.0f + amount * 0.1f;
#if PLATFORM_N64
if (g_Vars.currentplayer->gunzoomfovs[index] > 60) {
g_Vars.currentplayer->gunzoomfovs[index] = 60;
if (g_Vars.currentplayer->gunzoomfovs[index] > ADJUST_ZOOM_FOV(60)) {
g_Vars.currentplayer->gunzoomfovs[index] = ADJUST_ZOOM_FOV(60);
}
#else
if (g_Vars.currentplayer->gunzoomfovs[index] > 60 * g_PlayerFovZoomMultiplier) {
g_Vars.currentplayer->gunzoomfovs[index] = 60 * g_PlayerFovZoomMultiplier;
}
#endif
}
}
@@ -281,15 +271,9 @@ void currentPlayerZoomIn(f32 fovpersec)
g_Vars.currentplayer->gunzoomfovs[index] /= 1 + amount * 0.1f;
#ifdef PLATFORM_N64
if (g_Vars.currentplayer->gunzoomfovs[index] < 2) {
g_Vars.currentplayer->gunzoomfovs[index] = 2;
if (g_Vars.currentplayer->gunzoomfovs[index] < ADJUST_ZOOM_FOV(2)) {
g_Vars.currentplayer->gunzoomfovs[index] = ADJUST_ZOOM_FOV(2);
}
#else
if (g_Vars.currentplayer->gunzoomfovs[index] < 2 * g_PlayerFovZoomMultiplier) {
g_Vars.currentplayer->gunzoomfovs[index] = 2 * g_PlayerFovZoomMultiplier;
}
#endif
}
}
+6
View File
@@ -538,4 +538,10 @@ extern s32 g_PlayerFovAffectsZoom;
extern f32 g_PlayerFovZoomMultiplier;
#endif
#ifdef PLATFORM_N64
#define ADJUST_ZOOM_FOV(x) (x)
#else
#define ADJUST_ZOOM_FOV(x) ((x) * g_PlayerFovZoomMultiplier)
#endif
#endif