From c10b70cb6143a217d4247bc3d4fbfe803c96a7eb Mon Sep 17 00:00:00 2001 From: Velaron Date: Thu, 9 Jun 2022 22:19:56 +0300 Subject: [PATCH] game_launch: explicitly check for SDL2 on win32 platforms --- game_launch/game.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/game_launch/game.cpp b/game_launch/game.cpp index e9ad83c9..347f1973 100644 --- a/game_launch/game.cpp +++ b/game_launch/game.cpp @@ -26,6 +26,7 @@ GNU General Public License for more details. #include // execve #elif XASH_WIN32 #define XASHLIB "xash.dll" +#define SDL2LIB "SDL2.dll" #define dlerror() GetStringLastError() #include // CommandLineToArgvW #include // _execve @@ -98,6 +99,15 @@ static const char *GetStringLastError() static void Sys_LoadEngine( void ) { +#if XASH_WIN32 + HMODULE hSdl; + + if ( ( hSdl = LoadLibraryEx( SDL2LIB, NULL, LOAD_LIBRARY_AS_DATAFILE ) ) == NULL ) + Xash_Error("Unable to load the " SDL2LIB ": %s", dlerror() ); + else + FreeLibrary( hSdl ); +#endif + if(( hEngine = LoadLibrary( XASHLIB )) == NULL ) { Xash_Error("Unable to load the " XASHLIB ": %s", dlerror() );