diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 5b91880a0..ce830df61 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -421,19 +421,6 @@ void GameInterface::Ticker() } } - if (localInput.actions & SB_CENTERVIEW) - { - bLockPan = false; - bPlayerPan = false; - //PlayerList[nLocalPlayer].q16horiz = IntToFixed(100); - nDestVertPan[nLocalPlayer] = IntToFixed(100); - } - if (localInput.actions & SB_TURNAROUND) - { - // todo - } - - sPlayerInput[nLocalPlayer].xVel = lPlayerXVel; sPlayerInput[nLocalPlayer].yVel = lPlayerYVel; // make weapon selection persist until it gets used up. @@ -446,6 +433,11 @@ void GameInterface::Ticker() sPlayerInput[nLocalPlayer].actions = localInput.actions; if (oldactions & SB_CENTERVIEW) sPlayerInput[nLocalPlayer].actions |= SB_CENTERVIEW; + if (cl_syncinput) + { + ;// To be completed... + } + Ra[nLocalPlayer].nTarget = besttarget; lLocalCodes = 0; diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index 7a6f61bfe..f0d7aa368 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -193,12 +193,17 @@ static void processMovement(ControlInfo* const hidInput) localInput.q16avel += tempinput.q16avel; localInput.q16horz += tempinput.q16horz; - if (!cl_syncinput && !nFreeze) + if (!cl_syncinput) { Player* pPlayer = &PlayerList[nLocalPlayer]; - applylook(&pPlayer->q16angle, &pPlayer->q16look_ang, &pPlayer->q16rotscrnang, &pPlayer->spin, tempinput.q16avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust, false); - sethorizon(&pPlayer->q16horiz, tempinput.q16horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); + if (!nFreeze) + { + applylook(&pPlayer->q16angle, &pPlayer->q16look_ang, &pPlayer->q16rotscrnang, &pPlayer->spin, tempinput.q16avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust, false); + sethorizon(&pPlayer->q16horiz, tempinput.q16horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); + } + + playerProcessHelpers(&pPlayer->q16angle, &pPlayer->angAdjust, &pPlayer->angTarget, &pPlayer->q16horiz, &pPlayer->horizAdjust, &pPlayer->horizTarget, scaleAdjust); } } diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index ac62afe90..6a914ef67 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -438,7 +438,6 @@ void RestartPlayer(short nPlayer) nXDamage[nPlayer] = 0; PlayerList[nPlayer].q16horiz = IntToFixed(100); - nDestVertPan[nPlayer] = IntToFixed(100); nBreathTimer[nPlayer] = 90; nTauntTimer[nPlayer] = RandomSize(3) + 3; @@ -1033,10 +1032,11 @@ void FuncPlayer(int a, int nDamage, int nRun) { if (nTotalPlayers <= 1) { - PlayerList[nPlayer].q16angle = IntToFixed(GetAngleToSprite(nPlayerSprite, nSpiritSprite) & kAngleMask); - sprite[nPlayerSprite].ang = FixedToInt(PlayerList[nPlayer].q16angle); + auto ang = GetAngleToSprite(nPlayerSprite, nSpiritSprite) & kAngleMask; + playerSetAngle(&PlayerList[nPlayer].q16angle, &PlayerList[nPlayer].angTarget, ang); + sprite[nPlayerSprite].ang = ang; - PlayerList[nPlayer].q16horiz = IntToFixed(100); + playerSetHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizTarget, 100); lPlayerXVel = 0; lPlayerYVel = 0; @@ -1054,15 +1054,15 @@ void FuncPlayer(int a, int nDamage, int nRun) StopLocalSound(); InitSpiritHead(); - nDestVertPan[nPlayer] = IntToFixed(100); + playerSetHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizTarget, 100); if (currentLevel->levelNumber == 11) { - nDestVertPan[nPlayer] += IntToFixed(46); + playerAddHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizAdjust, 46); } else { - nDestVertPan[nPlayer] += IntToFixed(11); + playerAddHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizAdjust, 11); } } } @@ -1091,7 +1091,7 @@ void FuncPlayer(int a, int nDamage, int nRun) } if (zVelB > 512 && !bLockPan) { - nDestVertPan[nPlayer] = IntToFixed(100); + playerSetHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizTarget, 100); } } @@ -1190,19 +1190,9 @@ void FuncPlayer(int a, int nDamage, int nRun) } loc_1AB8E: - if (!bPlayerPan && !bLockPan) + if (cl_syncinput) { - fixed_t nPanVal = IntToFixed(spr_z - sprite[nPlayerSprite].z) / 32 + IntToFixed(100); - - if (nPanVal < 0) { - nPanVal = 0; - } - else if (nPanVal > IntToFixed(183)) - { - nPanVal = IntToFixed(183); - } - - nDestVertPan[nPlayer] = nPanVal; + ;// To be completed. } playerX -= sprite[nPlayerSprite].x; @@ -2793,15 +2783,16 @@ loc_1BD2E: { if (PlayerList[nPlayer].q16horiz < IntToFixed(100)) { - PlayerList[nPlayer].q16horiz = IntToFixed(91); + playerSetHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizTarget, 100); eyelevel[nPlayer] -= (dVertPan[nPlayer] << 8); } else { - PlayerList[nPlayer].q16horiz += IntToFixed(dVertPan[nPlayer]); - if (PlayerList[nPlayer].q16horiz >= IntToFixed(200)) + playerAddHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizAdjust, dVertPan[nPlayer]); + + if (PlayerList[nPlayer].q16horiz > gi->playerHorizMax()) { - PlayerList[nPlayer].q16horiz = IntToFixed(199); + playerSetHoriz(&PlayerList[nPlayer].q16horiz, &PlayerList[nPlayer].horizTarget, gi->playerHorizMax()); } else if (PlayerList[nPlayer].q16horiz <= IntToFixed(100)) { diff --git a/source/exhumed/src/player.h b/source/exhumed/src/player.h index 2e07b0e29..ca0925093 100644 --- a/source/exhumed/src/player.h +++ b/source/exhumed/src/player.h @@ -75,6 +75,8 @@ struct Player fixed_t oq16look_ang, q16look_ang; fixed_t oq16rotscrnang, q16rotscrnang; fixed_t spin; + fixed_t angTarget, horizTarget; + double angAdjust, horizAdjust; vec3_t opos; }; diff --git a/source/exhumed/src/ramses.cpp b/source/exhumed/src/ramses.cpp index 0e5ec0e04..f3a2f2647 100644 --- a/source/exhumed/src/ramses.cpp +++ b/source/exhumed/src/ramses.cpp @@ -209,7 +209,7 @@ void DoSpiritHead() { static short dimSectCount = 0; - PlayerList[0].q16horiz += (nDestVertPan[0] - PlayerList[0].q16horiz) / 4; + PlayerList[0].q16horiz += PlayerList[0].q16horiz / 4; TileFiles.InvalidateTile(kTileRamsesWorkTile); int totalclock = leveltime * 4; diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index 5c2f399da..c17d7b82d 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -36,7 +36,6 @@ short bSubTitles = true; int zbob; -fixed_t nDestVertPan[kMaxPlayers] = { 0 }; short dVertPan[kMaxPlayers]; int nCamerax; int nCameray; @@ -497,7 +496,6 @@ static SavegameHelper sgh("view", SV(viewz), SV(enemy), SV(nEnemyPal), - SA(nDestVertPan), SA(dVertPan), SA(nQuake), SV(g_interpolationCnt), diff --git a/source/exhumed/src/view.h b/source/exhumed/src/view.h index 56e3deef7..c537bd99a 100644 --- a/source/exhumed/src/view.h +++ b/source/exhumed/src/view.h @@ -39,7 +39,6 @@ void viewDoInterpolations(int smoothRatio); void viewUpdateInterpolations(void); void viewRestoreInterpolations(void); -extern fixed_t nDestVertPan[]; extern short dVertPan[]; extern short nQuake[]; extern int nCamerax;