Browse Source

engine: check if client.dll linked to SDL2.dll (#37)

pull/2/head
Alibek Omarov 6 years ago
parent
commit
0579ecd30f
  1. 1
      common/port.h
  2. 17
      engine/client/cl_game.c
  3. 2
      engine/client/client.h

1
common/port.h

@ -145,6 +145,7 @@ GNU General Public License for more details. @@ -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

17
engine/client/cl_game.c

@ -3952,6 +3952,23 @@ qboolean CL_LoadProgs( const char *name ) @@ -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;

2
engine/client/client.h

@ -482,6 +482,8 @@ typedef struct @@ -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…
Cancel
Save