Browse Source

engine: ensure that we loading same client library

pull/2/head
Alibek Omarov 6 years ago
parent
commit
5af6506d86
  1. 2
      engine/client/cl_game.c
  2. 4
      engine/client/cl_main.c
  3. 2
      engine/client/cl_scrn.c
  4. 4
      engine/client/vgui/vgui_draw.c
  5. 2
      engine/client/vgui/vgui_draw.h
  6. 4
      engine/common/filesystem.c

2
engine/client/cl_game.c

@ -3950,7 +3950,7 @@ qboolean CL_LoadProgs( const char *name ) @@ -3950,7 +3950,7 @@ qboolean CL_LoadProgs( const char *name )
// NOTE: important stuff!
// vgui must startup BEFORE loading client.dll to avoid get error ERROR_NOACESS
// during LoadLibrary
VGui_Startup( gameui.globals->scrWidth, gameui.globals->scrHeight );
VGui_Startup( name, gameui.globals->scrWidth, gameui.globals->scrHeight );
clgame.hInstance = COM_LoadLibrary( name, false, false );
if( !clgame.hInstance ) return false;

4
engine/client/cl_main.c

@ -2980,7 +2980,11 @@ void CL_Init( void ) @@ -2980,7 +2980,11 @@ void CL_Init( void )
// IN_TouchInit();
Con_LoadHistory();
#ifdef XASH_INTERNAL_GAMELIBS
if( !CL_LoadProgs( "client" ) )
#else
if( !CL_LoadProgs( va( "%s/%s", GI->dll_path, SI.clientlib)))
#endif
Host_Error( "can't initialize %s: %s\n", SI.clientlib, COM_GetLibraryError() );
cls.initialized = true;

2
engine/client/cl_scrn.c

@ -731,7 +731,7 @@ void SCR_VidInit( void ) @@ -731,7 +731,7 @@ void SCR_VidInit( void )
gameui.globals->scrHeight = refState.height;
}
VGui_Startup( refState.width, refState.height );
VGui_Startup( NULL, refState.width, refState.height ); // initialized already, so pass NULL
CL_ClearSpriteTextures(); // now all hud sprites are invalid

4
engine/client/vgui/vgui_draw.c

@ -218,7 +218,7 @@ VGui_Startup @@ -218,7 +218,7 @@ VGui_Startup
Load vgui_support library and call VGui_Startup
================
*/
void VGui_Startup( int width, int height )
void VGui_Startup( const char *clientlib, int width, int height )
{
static qboolean failed = false;
@ -238,7 +238,7 @@ void VGui_Startup( int width, int height ) @@ -238,7 +238,7 @@ void VGui_Startup( int width, int height )
VGui_FillAPIFromRef( &vgui, &ref.dllFuncs );
#ifdef XASH_INTERNAL_GAMELIBS
s_pVGuiSupport = COM_LoadLibrary( "client", false, false );
s_pVGuiSupport = COM_LoadLibrary( clientlib, false, false );
if( s_pVGuiSupport )
{

2
engine/client/vgui/vgui_draw.h

@ -25,7 +25,7 @@ extern "C" { @@ -25,7 +25,7 @@ extern "C" {
//
// vgui_draw.c
//
void VGui_Startup( int width, int height );
void VGui_Startup( const char *clientlib, int width, int height );
void VGui_Shutdown( void );
void VGui_Paint();
void VGui_RunFrame();

4
engine/common/filesystem.c

@ -1544,8 +1544,8 @@ void FS_LoadGameInfo( const char *rootfolder ) @@ -1544,8 +1544,8 @@ void FS_LoadGameInfo( const char *rootfolder )
}
if( !Sys_GetParmFromCmdLine( "-clientlib", SI.clientlib ) )
{
#ifdef __ANDROID__
Q_strncpy( SI.clientlib, CLIENTDLL, sizeof( SI.clientlib ) );
#ifdef XASH_INTERNAL_GAMELIBS
Q_strncpy( SI.clientlib, "client", sizeof( SI.clientlib ) );
#else
Q_strncpy( SI.clientlib, GI->client_lib, sizeof( SI.clientlib ) );
#endif

Loading…
Cancel
Save