From be6e0d87d706d9e981f42bc8220b540e0e6aac73 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 10 Sep 2020 19:56:13 +1000 Subject: [PATCH] Revert "- SW: Attempt at making vehicle movement work nicely while uninterpolated." This reverts commit 28a3ef131ffcc85733162d2a78d770aedfafa346. I mostly added this to visualise an attempt at how I've attempted to make the vehicles work with unsynchronised input. I don't wish for this to be committed to the main branch as it's a net negative. --- source/sw/src/interpso.cpp | 17 ++++++++--------- source/sw/src/player.cpp | 16 ++-------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/source/sw/src/interpso.cpp b/source/sw/src/interpso.cpp index ecb9d9e8c..0926f7ce5 100644 --- a/source/sw/src/interpso.cpp +++ b/source/sw/src/interpso.cpp @@ -191,11 +191,6 @@ void so_setinterpolationtics(SECTOR_OBJECTp sop, int16_t locktics) interp->lasttic = locktics; } -static inline bool so_nointerpolations(short track) -{ - return !cl_syncinput && (track >= SO_TURRET_MGUN && track <= SO_VEHICLE); -} - void so_updateinterpolations(void) // Stick at beginning of domovethings { int32_t i; @@ -207,7 +202,8 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings for (sop = SectorObject, interp = so_interpdata; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++) { - if (SO_EMPTY(sop) || so_nointerpolations(sop->track)) + bool skip = !cl_syncinput && (sop->track == SO_TURRET); + if (SO_EMPTY(sop) || skip) continue; if (interp->tic < interp->lasttic) interp->tic += synctics; @@ -245,7 +241,8 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b for (sop = SectorObject, interp = so_interpdata; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++) { - if (SO_EMPTY(sop) || so_nointerpolations(sop->track)) + bool skip = !cl_syncinput && (sop->track == SO_TURRET); + if (SO_EMPTY(sop) || skip) continue; for (i = 0; i < interp->numinterpolations; i++) @@ -271,7 +268,8 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b for (sop = SectorObject, interp = so_interpdata; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++) { - if (SO_EMPTY(sop) || so_nointerpolations(sop->track)) + bool skip = !cl_syncinput && (sop->track == SO_TURRET); + if (SO_EMPTY(sop) || skip) continue; // Check if interpolation has been explicitly disabled @@ -331,7 +329,8 @@ void so_restoreinterpolations(void) // Stick at end of drawscree for (sop = SectorObject, interp = so_interpdata; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++) { - if (SO_EMPTY(sop) || so_nointerpolations(sop->track)) + bool skip = !cl_syncinput && (sop->track == SO_TURRET); + if (SO_EMPTY(sop) || skip) continue; for (i = 0, data = interp->data; i < interp->numinterpolations; i++, data++) diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 9ed83d99c..297967f07 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1669,11 +1669,6 @@ DoPlayerTurnVehicle(PLAYERp pp, fixed_t q16avel, int z, int floor_dist) sprite[pp->PlayerSprite].ang = FixedToInt(pp->q16ang); } } - - if (!cl_syncinput) - { - OperateSectorObject(pp->sop, FixedToInt(pp->q16ang), pp->oposx + mulscale16(pp->posx - pp->oposx, smoothratio), pp->oposy + mulscale16(pp->posy - pp->oposy, smoothratio)); - } } void @@ -3049,10 +3044,7 @@ DoPlayerMoveVehicle(PLAYERp pp) } save_sectnum = pp->cursectnum; - if (cl_syncinput) - { - OperateSectorObject(pp->sop, FixedToInt(pp->q16ang), MAXSO, MAXSO); - } + OperateSectorObject(pp->sop, FixedToInt(pp->q16ang), MAXSO, MAXSO); pp->cursectnum = pp->sop->op_main_sector; // for speed floor_dist = labs(z - pp->sop->floor_loz); @@ -3156,11 +3148,7 @@ DoPlayerMoveVehicle(PLAYERp pp) } } - if (cl_syncinput) - { - OperateSectorObject(pp->sop, FixedToInt(pp->q16ang), pp->posx, pp->posy); - } - + OperateSectorObject(pp->sop, FixedToInt(pp->q16ang), pp->posx, pp->posy); pp->cursectnum = save_sectnum; // for speed if (!cl_syncinput)