From b907791558d8819fd80f67fb08f8a123d1c7ea9b Mon Sep 17 00:00:00 2001 From: nukeykt Date: Thu, 28 May 2020 00:22:58 +0900 Subject: [PATCH] Blood: input code improvements Repairs interpolation issues introduced in 96c9ca657ea349e01edef46fe4fda8fd75d90906 as reported in https://forum.zdoom.org/viewtopic.php?f=340&t=69009 --- source/blood/src/blood.cpp | 2 ++ source/blood/src/controls.cpp | 2 +- source/blood/src/controls.h | 2 +- source/blood/src/network.cpp | 4 +--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index f78d80bef..46b67eff5 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1224,6 +1224,8 @@ RESTART: gBufferJitter = 0; while (totalclock >= gNetFifoClock && ready2send) { + gNetInput = gInput; + gInput = {}; netGetInput(); gNetFifoClock += 4; while (gNetFifoHead[myconnectindex]-gNetFifoTail > gBufferJitter && !gStartNewGame && !gQuitGame) diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index 9c78f6c48..64fd25ae0 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -GINPUT gInput; +GINPUT gInput, gNetInput; bool bSilentAim = false; int iTurnCount = 0; diff --git a/source/blood/src/controls.h b/source/blood/src/controls.h index 47d32d23d..b8f7faa64 100644 --- a/source/blood/src/controls.h +++ b/source/blood/src/controls.h @@ -103,7 +103,7 @@ struct GINPUT #pragma pack(pop) -extern GINPUT gInput; +extern GINPUT gInput, gNetInput; extern bool bSilentAim; extern fix16_t gViewLook, gViewAngle; diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index 4d83d3a23..f9de77768 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -734,10 +734,8 @@ void netGetInput(void) for (int p = connecthead; p >= 0; p = connectpoint2[p]) if (gNetFifoHead[myconnectindex]-200 > gNetFifoHead[p]) return; - ctrlGetInput(); GINPUT &input = gFifoInput[gNetFifoHead[myconnectindex]&255][myconnectindex]; - input = gInput; - gInput = {}; + input = gNetInput; gNetFifoHead[myconnectindex]++; if (gGameOptions.nGameType == 0 || numplayers == 1) {