From 6b2ebdd4444e85ccdfd2f9c6d9f10ecda9fb9429 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Sat, 31 Aug 2019 20:44:02 +0900 Subject: [PATCH] Fix input, fix menu crash --- source/exhumed/src/exhumed.cpp | 10 +++++++--- source/exhumed/src/menu.cpp | 10 ++++++++-- source/exhumed/src/player.cpp | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index c4f7ef078..25f6ec4f7 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -534,7 +534,7 @@ short nClockVal; short fps; short nRedTicks; short lastlevel; -short bInMove; +volatile short bInMove; short nAlarmTicks; short nButtonColor; short nEnergyChan; @@ -705,9 +705,12 @@ void bail2dos(const char *fmt, ...) void faketimerhandler() { - if (!(totalclock & 3) && !bInMove && moveframes < 4) { + if ((totalclock < ototalclock + 4) || bInMove) + return; + ototalclock += 4; + + if (moveframes < 4) moveframes++; - } PlayerInterruptKeys(); } @@ -2111,6 +2114,7 @@ main_loc_D: } else { + CONTROL_BindsEnabled = 1; // Section B if (!nCDTrackLength && !nFreeze && !nNetPlayerCount) { diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 974ff0d48..d0c5b9b3b 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -300,7 +300,7 @@ void menu_DoPlasma() tilesiz[kTile4093].y = kPlasmaHeight; nSmokeTop = 40 - tilesiz[kExhumedLogo].y / 2; - nSmokeBottom = 40 - tilesiz[kExhumedLogo].y / 2 + tilesiz[kExhumedLogo].y - 1; + nSmokeBottom = nSmokeTop + tilesiz[kExhumedLogo].y - 1; //uint32_t t = time(0) << 16; //uint32_t t2 = time(0) | t; @@ -443,13 +443,19 @@ void menu_DoPlasma() for (int j = 0; j < 5; j++) { int pB = plasma_B[j]; + + if ((plasma_C[j]>>16) <= nSmokeLeft) + plasma_C[j] = nSmokeLeft<<16; + else if ((plasma_C[j]>>16) >= nSmokeRight) + plasma_C[j] = nSmokeRight<<16; + int pC = plasma_C[j]; uint8_t *ptr3 = (uint8_t*)(waloff[kExhumedLogo] + ((pC >> 16) - nSmokeLeft) * tilesiz[kExhumedLogo].y); plasma_C[j] += plasma_B[j]; - if (pB > 0 && (plasma_C[j] >> 16) >= nSmokeRight || pB < 0 && (plasma_C[j] >> 16) <= nSmokeLeft) + if ((pB > 0 && (plasma_C[j] >> 16) >= nSmokeRight) || (pB < 0 && (plasma_C[j] >> 16) <= nSmokeLeft)) { int esi = plasma_A[j]; plasma_B[j] = -plasma_B[j]; diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 8bccda714..900de6567 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -150,6 +150,7 @@ void PlayerInterruptKeys() } memset(&info, 0, sizeof(ControlInfo)); // this is done within CONTROL_GetInput() anyway + CONTROL_ProcessBinds(); CONTROL_GetInput(&info); info.dyaw *= (lMouseSens >> 1) + 1;