From d566524499b7b961539d5be2ee94864a26d11db8 Mon Sep 17 00:00:00 2001 From: fogobogo Date: Tue, 11 Jan 2022 20:51:49 +0100 Subject: [PATCH] cmake build fixes this brings the cmake branch in line with commit 8e551bb287668c285a41206cf10f1a3197887ca2 from the main branch. This adds a few boons, most notably it allows compiling on Linux with SDL2 instead of SDL. That also allows for mouse support and can now be run without X, which is mostly interesting in case you want to play some Wagic on say, a Raspberry Pi. --- projects/mtg/CMakeLists.txt | 1 + projects/mtg/src/SDLmain.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/mtg/CMakeLists.txt b/projects/mtg/CMakeLists.txt index 491fae3e3..55e68a6f5 100644 --- a/projects/mtg/CMakeLists.txt +++ b/projects/mtg/CMakeLists.txt @@ -109,6 +109,7 @@ set(MTG_generic_src src/WFont.cpp src/WGui.cpp src/WResourceManager.cpp + src/WParsedInt.cpp ) set(MTG_network_src src/NetworkPlayer.cpp) diff --git a/projects/mtg/src/SDLmain.cpp b/projects/mtg/src/SDLmain.cpp index ccef4a68c..280feec58 100644 --- a/projects/mtg/src/SDLmain.cpp +++ b/projects/mtg/src/SDLmain.cpp @@ -155,9 +155,8 @@ public: return -1; } -#ifdef __EMSCRIPTEN__ - emscripten_set_main_loop(SdlApp::OneIter, 60, 1); -#else + SDL_Event Event; + while(Running) { if (g_engine) @@ -180,7 +179,6 @@ public: } } OnCleanup(); -#endif return 0; }