diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index f6abef928..d24afb35a 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -113,20 +113,6 @@ void InputState::ClearAllInput() } -//========================================================================== -// -// -// -//========================================================================== - -TArray callbacks; - -void(*timerSetCallback(void(*callback)(void)))(void) -{ - callbacks.Push(callback); - return nullptr; -} - //========================================================================== // // @@ -159,8 +145,6 @@ int32_t handleevents(void) setsizeneeded = false; } - for (auto cb : callbacks) cb(); - I_StartFrame(); I_StartTic(); return 0; diff --git a/source/core/inputstate.h b/source/core/inputstate.h index a0e7f52a6..22f0d5c24 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -60,7 +60,5 @@ public: extern InputState inputState; -void (*timerSetCallback(void (*callback)(void)))(void); - void CONTROL_GetInput(ControlInfo* info); int32_t handleevents(void); diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 4c9524e5d..00842c587 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -65,11 +65,12 @@ static void Menu_DrawBackground(const DVector2 &origin) static void Menu_DrawCursor(double x, double y, double scale, bool right) { + int mclock = I_GetBuildTime(); const int frames = isRR() ? 16 : 7; int picnum; - if (!right) picnum = TILE_SPINNINGNUKEICON + ((gameclock >> 3) % frames); - else picnum = TILE_SPINNINGNUKEICON + frames - 1 - ((frames - 1 + (gameclock >> 3)) % frames); - int light = int(224 + 31 * sin(gameclock / 20.)); + if (!right) picnum = TILE_SPINNINGNUKEICON + ((mclock >> 3) % frames); + else picnum = TILE_SPINNINGNUKEICON + frames - 1 - ((frames - 1 + (mclock >> 3)) % frames); + int light = int(224 + 31 * sin(mclock / 20.)); PalEntry pe(255, light, light, light); DrawTexture(twod, tileGetTexture(picnum), x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_Color, pe, DTA_CenterOffsetRel, true, TAG_DONE); } @@ -153,7 +154,8 @@ class DukeMainMenu : public DukeListMenu DrawTexture(twod, tileGetTexture(TILE_INGAMEDUKETHREEDEE), x, origin.Y + 29, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_CenterOffsetRel, true, TAG_DONE); if (PLUTOPAK) { - int light = 224 + 31 * sin(gameclock / 40.); + int mclock = I_GetBuildTime(); + int light = 224 + 31 * sin(mclock / 40.); PalEntry pe(255, light, light, light); DrawTexture(twod, tileGetTexture(TILE_PLUTOPAKSPRITE + 2), x + 100, origin.Y + 36, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, pe, DTA_CenterOffsetRel, true, TAG_DONE); } @@ -186,7 +188,8 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double oxpos, dou else if (state == NIT_SelectedState) { trans = 0; - int light = 224 + 31 * sin(gameclock / 20.); + int mclock = I_GetBuildTime(); + int light = 224 + 31 * sin(mclock / 20.); pe = PalEntry(255, light, light, light); } else @@ -346,8 +349,9 @@ static int GetPlayerColor(int color) void GameInterface::DrawPlayerSprite(const DVector2& origin, bool onteam) { + int mclock = I_GetBuildTime(); int color = TRANSLATION(Translation_Remap, playercolor2lookup(playercolor)); - int tile = isRR() ? 3845 + 36 - ((((8 - (gameclock >> 4))) & 7) * 5) : 1441 - ((((4 - (gameclock >> 4))) & 3) * 5); + int tile = isRR() ? 3845 + 36 - ((((8 - (mclock >> 4))) & 7) * 5) : 1441 - ((((4 - (mclock >> 4))) & 3) * 5); auto tex = tileGetTexture(tile); if (!tex) return; double x = origin.X + 260, y = origin.Y + tex->GetDisplayHeight() * (isRR()? 0.25 : 0.5); diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 66e02cad2..33fbcb991 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -353,7 +353,7 @@ void S_Update(void) } listener.ListenerObject = ud.camerasprite == -1 ? nullptr : &sprite[ud.camerasprite]; soundEngine->SetListener(listener); - soundEngine->UpdateSounds(gameclock); + soundEngine->UpdateSounds(totalclock); } diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index 2db86aeec..09f266a63 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -604,7 +604,7 @@ void DoUpdateSounds(void) soundEngine->SetListener(listener); UpdateAmbients(); - soundEngine->UpdateSounds(gameclock); + soundEngine->UpdateSounds(totalclock); } //==========================================================================