From bdc53ed7b074222298f592ae95bce5065abe5084 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 21 Sep 2020 18:41:56 +1000 Subject: [PATCH] - Exhumed: Standardise horizon on 100 and remove backend extern'd `polymostcenterhoriz` variable. --- source/build/include/polymost.h | 2 -- source/build/src/engine.cpp | 1 - source/build/src/polymost.cpp | 4 ++-- source/exhumed/src/exhumed.cpp | 5 ++--- source/exhumed/src/player.cpp | 18 +++++++++--------- source/exhumed/src/view.cpp | 9 ++------- source/exhumed/src/view.h | 1 - 7 files changed, 15 insertions(+), 25 deletions(-) diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index 41c151db6..22b8e912f 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -45,8 +45,6 @@ enum { extern float curpolygonoffset; -extern int32_t polymostcenterhoriz; - extern int16_t globalpicnum; #define POLYMOST_CHOOSE_FOG_PAL(fogpal, pal) \ diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 7be582938..46bddc0a5 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -48,7 +48,6 @@ int32_t r_rortexture = 0; int32_t r_rortexturerange = 0; int32_t r_rorphase = 0; int32_t mdtims, omdtims; -int32_t polymostcenterhoriz = 100; float fcosglobalang, fsinglobalang; float fxdim, fydim, fydimen, fviewingrange; diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 42df205bd..fab984e89 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -2484,7 +2484,7 @@ void polymost_drawrooms() ghalfy = (float)(ydimen>>1); grhalfxdown10 = 1.f/(ghalfx*1024.f); ghoriz = FixedToFloat(qglobalhoriz); - ghorizcorrect = FixedToFloat((100-polymostcenterhoriz)*divscale16(xdimenscale, viewingrange)); + ghorizcorrect = FixedToFloat(divscale16(xdimenscale, viewingrange)); GLInterface.SetShadeInterpolate(hw_shadeinterpolate); @@ -2884,7 +2884,7 @@ void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang ghalfy = (float)(ydimen>>1); grhalfxdown10 = 1.f/(ghalfx*1024.f); ghoriz = FixedToFloat(qglobalhoriz); - ghorizcorrect = FixedToFloat((100-polymostcenterhoriz)*divscale16(xdimenscale, viewingrange)); + ghorizcorrect = FixedToFloat(divscale16(xdimenscale, viewingrange)); resizeglcheck(); if (r_yshearing) { diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 7c3ff7485..5b91880a0 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -425,8 +425,8 @@ void GameInterface::Ticker() { bLockPan = false; bPlayerPan = false; - //PlayerList[nLocalPlayer].q16horiz = IntToFixed(92); - nDestVertPan[nLocalPlayer] = IntToFixed(92); + //PlayerList[nLocalPlayer].q16horiz = IntToFixed(100); + nDestVertPan[nLocalPlayer] = IntToFixed(100); } if (localInput.actions & SB_TURNAROUND) { @@ -528,7 +528,6 @@ void GameInterface::app_init() TileFiles.SetBackup(); - InitView(); InitFX(); seq_LoadSequences(); InitStatus(); diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index f13651971..ac62afe90 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -437,8 +437,8 @@ void RestartPlayer(short nPlayer) nYDamage[nPlayer] = 0; nXDamage[nPlayer] = 0; - PlayerList[nPlayer].q16horiz = IntToFixed(92); - nDestVertPan[nPlayer] = IntToFixed(92); + PlayerList[nPlayer].q16horiz = IntToFixed(100); + nDestVertPan[nPlayer] = IntToFixed(100); nBreathTimer[nPlayer] = 90; nTauntTimer[nPlayer] = RandomSize(3) + 3; @@ -539,7 +539,7 @@ void StartDeathSeq(int nPlayer, int nVal) StopFiringWeapon(nPlayer); - PlayerList[nPlayer].q16horiz = IntToFixed(92); + PlayerList[nPlayer].q16horiz = IntToFixed(100); oeyelevel[nPlayer] = eyelevel[nPlayer] = -14080; nPlayerInvisible[nPlayer] = 0; dVertPan[nPlayer] = 15; @@ -1036,7 +1036,7 @@ void FuncPlayer(int a, int nDamage, int nRun) PlayerList[nPlayer].q16angle = IntToFixed(GetAngleToSprite(nPlayerSprite, nSpiritSprite) & kAngleMask); sprite[nPlayerSprite].ang = FixedToInt(PlayerList[nPlayer].q16angle); - PlayerList[nPlayer].q16horiz = IntToFixed(92); + PlayerList[nPlayer].q16horiz = IntToFixed(100); lPlayerXVel = 0; lPlayerYVel = 0; @@ -1054,7 +1054,7 @@ void FuncPlayer(int a, int nDamage, int nRun) StopLocalSound(); InitSpiritHead(); - nDestVertPan[nPlayer] = IntToFixed(92); + nDestVertPan[nPlayer] = IntToFixed(100); if (currentLevel->levelNumber == 11) { @@ -1091,7 +1091,7 @@ void FuncPlayer(int a, int nDamage, int nRun) } if (zVelB > 512 && !bLockPan) { - nDestVertPan[nPlayer] = IntToFixed(92); + nDestVertPan[nPlayer] = IntToFixed(100); } } @@ -1192,7 +1192,7 @@ void FuncPlayer(int a, int nDamage, int nRun) loc_1AB8E: if (!bPlayerPan && !bLockPan) { - fixed_t nPanVal = IntToFixed(spr_z - sprite[nPlayerSprite].z) / 32 + IntToFixed(92); + fixed_t nPanVal = IntToFixed(spr_z - sprite[nPlayerSprite].z) / 32 + IntToFixed(100); if (nPanVal < 0) { nPanVal = 0; @@ -2791,7 +2791,7 @@ loc_1BD2E: } else { - if (PlayerList[nPlayer].q16horiz < IntToFixed(92)) + if (PlayerList[nPlayer].q16horiz < IntToFixed(100)) { PlayerList[nPlayer].q16horiz = IntToFixed(91); eyelevel[nPlayer] -= (dVertPan[nPlayer] << 8); @@ -2803,7 +2803,7 @@ loc_1BD2E: { PlayerList[nPlayer].q16horiz = IntToFixed(199); } - else if (PlayerList[nPlayer].q16horiz <= IntToFixed(92)) + else if (PlayerList[nPlayer].q16horiz <= IntToFixed(100)) { if (!(SectFlag[sprite[nPlayerSprite].sectnum] & kSectUnderwater)) { diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index d47302a17..5c2f399da 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -120,11 +120,6 @@ void viewRestoreInterpolations(void) //Stick at end of drawscreen for (; i>=0; i--) *curipos[i] = bakipos[i]; } -void InitView() -{ - polymostcenterhoriz = 92; -} - // NOTE - not to be confused with Ken's analyzesprites() static void analyzesprites() { @@ -297,7 +292,7 @@ void DrawView(double smoothRatio, bool sceneonly) { if (nSnakeCam >= 0 && !sceneonly) { - pan = IntToFixed(92); + pan = IntToFixed(100); viewz = playerZ; } else @@ -321,7 +316,7 @@ void DrawView(double smoothRatio, bool sceneonly) -2000 * Sin(inita), 4, 0, 0, CLIPMASK1); - pan = IntToFixed(92); + pan = IntToFixed(100); viewz = playerZ; } diff --git a/source/exhumed/src/view.h b/source/exhumed/src/view.h index 7343a51cd..56e3deef7 100644 --- a/source/exhumed/src/view.h +++ b/source/exhumed/src/view.h @@ -27,7 +27,6 @@ extern short bSubTitles; extern short besttarget; extern short bCamera; -void InitView(); void DrawStatusBar(); void DrawView(double smoothRatio, bool sceneonly = false); void ResetView();