From 81eab1a9d108beabe477bc052aa1b219f36812ed Mon Sep 17 00:00:00 2001 From: jakewestrip Date: Wed, 28 Apr 2021 21:19:03 +1000 Subject: [PATCH] Ports: Remove SDL Timer replacement in MilkyTracker --- .../patches/SDLTimerToLibCoreTimer.patch | 65 ------------------- .../patches/SetTrackerLinks.patch | 2 +- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 Ports/milkytracker/patches/SDLTimerToLibCoreTimer.patch diff --git a/Ports/milkytracker/patches/SDLTimerToLibCoreTimer.patch b/Ports/milkytracker/patches/SDLTimerToLibCoreTimer.patch deleted file mode 100644 index 3320e9eee2..0000000000 --- a/Ports/milkytracker/patches/SDLTimerToLibCoreTimer.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- MilkyTracker-1.03.00/src/tracker/sdl/SDL_Main.cpp 2021-04-27 15:17:42.529000000 +1000 -+++ MilkyTracker-1.03.00/src/tracker/sdl/SDL_Main.cpp 2021-04-27 15:17:42.529000000 +1000 -@@ -68,6 +68,8 @@ - - #include - #include "SDL_KeyTranslation.h" -+ -+#include - // ---------------------------- Tracker includes ---------------------------- - #include "PPUI.h" - #include "DisplayDevice_SDL.h" -@@ -83,7 +85,7 @@ - #endif - // -------------------------------------------------------------------------- - --static SDL_TimerID timer; -+RefPtr m_timer; - - // Tracker globals - static PPScreen* myTrackerScreen = NULL; -@@ -163,11 +165,11 @@ - SDLUserEventMidiKeyUp, - }; - --static Uint32 SDLCALL timerCallback(Uint32 interval, void* param) -+static void timerCallback() - { - if (!myTrackerScreen || !myTracker || !ticking) - { -- return interval; -+ return; - } - - SDL_UserEvent ev; -@@ -219,8 +221,6 @@ - //PPEvent myEvent(eRMouseRepeat, &p, sizeof(PPPoint)); - //RaiseEventSerialized(&myEvent); - } -- -- return interval; - } - - #ifdef HAVE_LIBRTMIDI -@@ -834,7 +834,12 @@ - #endif - - // Try to create timer -- timer = SDL_AddTimer(20, timerCallback, NULL); -+ m_timer = Core::Timer::construct(); -+ m_timer->on_timeout = [&]() { -+ timerCallback(); -+ }; -+ m_timer->set_interval(20); -+ m_timer->start(); - - // Start capturing text input events - SDL_StartTextInput(); -@@ -1033,7 +1038,6 @@ - } - - ticking = false; -- SDL_RemoveTimer(timer); - - globalMutex->lock(); - #ifdef HAVE_LIBRTMIDI diff --git a/Ports/milkytracker/patches/SetTrackerLinks.patch b/Ports/milkytracker/patches/SetTrackerLinks.patch index 1e9edce673..be7ef6566d 100644 --- a/Ports/milkytracker/patches/SetTrackerLinks.patch +++ b/Ports/milkytracker/patches/SetTrackerLinks.patch @@ -4,7 +4,7 @@ set(INSTALL_DEST ${CMAKE_INSTALL_BINDIR}) endif() -+target_link_libraries(tracker -lSDL2 -lgui -lipc -lm -lcore) ++target_link_libraries(tracker -lSDL2 -lgui -lipc -lm) +set(INSTALL_DEST bin) + install(TARGETS tracker DESTINATION ${INSTALL_DEST})