diff --git a/common/port.h b/common/port.h index 54aa4e86..310e34c6 100644 --- a/common/port.h +++ b/common/port.h @@ -145,6 +145,7 @@ GNU General Public License for more details. #include #undef HSPRITE + #define OS_LIB_PREFIX "" #define OS_LIB_EXT "dll" #define MENUDLL "menu"ARCH_SUFFIX"." OS_LIB_EXT #define CLIENTDLL "client"ARCH_SUFFIX"." OS_LIB_EXT diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index 2986f4e5..bbff79b7 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -3952,6 +3952,23 @@ qboolean CL_LoadProgs( const char *name ) // during LoadLibrary VGui_Startup( name, gameui.globals->scrWidth, gameui.globals->scrHeight ); + // a1ba: we need to check if client.dll has direct dependency on SDL2 + // and if so, disable relative mouse mode +#if XASH_WIN32 + if( ( clgame.client_dll_uses_sdl = COM_CheckLibraryDirectDependency( name, OS_LIB_PREFIX "SDL2." OS_LIB_EXT, false ) ) ) + { + Con_Printf( S_NOTE "client.dll uses SDL2 for mouse input\n" ); + } + else + { + Con_Printf( S_NOTE "client.dll uses Windows API for mouse input\n" ); + } +#else + // this doesn't mean other platforms uses SDL2 in any case + // it just helps input code to stay platform-independent + clgame.client_dll_uses_sdl = true; +#endif + clgame.hInstance = COM_LoadLibrary( name, false, false ); if( !clgame.hInstance ) return false; diff --git a/engine/client/client.h b/engine/client/client.h index fe5e7725..89b0d2aa 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -482,6 +482,8 @@ typedef struct efrag_t *free_efrags; // linked efrags cl_entity_t viewent; // viewmodel + + qboolean client_dll_uses_sdl; } clgame_static_t; typedef struct