mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-23 17:25:24 +01:00
engine: check if client.dll linked to SDL2.dll (#37)
This commit is contained in:
parent
b5d9bf5dc8
commit
0579ecd30f
@ -145,6 +145,7 @@ GNU General Public License for more details.
|
||||
#include <windows.h>
|
||||
#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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user