From 176b31b4a2d5360351f50ff37d86b8b2e7d4a205 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 24 Apr 2018 05:50:10 +0300 Subject: [PATCH] Fix wrong max edicts clamp. Add game_dll_linux and game_dll_osx to gameinfo.txt. Fix crash in R_ChangeVideoSettings --- engine/client/cl_main.c | 2 +- engine/client/cl_scrn.c | 7 +++++-- engine/common/filesystem.c | 10 +++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 778b1800..34d21e7a 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2786,7 +2786,7 @@ void CL_Init( void ) COM_ResetLibraryError(); if( !CL_LoadProgs( va( "%s/%s", GI->dll_path, SI.clientlib))) - Host_Error( "can't initialize client.dll\n" ); + Host_Error( "can't initialize %s: %s\n", SI.clientlib, COM_GetLibraryError() ); cls.initialized = true; cl.maxclients = 1; // allow to drawing player in menu diff --git a/engine/client/cl_scrn.c b/engine/client/cl_scrn.c index aad870ac..aa0d84c5 100644 --- a/engine/client/cl_scrn.c +++ b/engine/client/cl_scrn.c @@ -691,8 +691,11 @@ void SCR_VidInit( void ) memset( &clgame.centerPrint, 0, sizeof( clgame.centerPrint )); // update screen sizes for menu - gameui.globals->scrWidth = glState.width; - gameui.globals->scrHeight = glState.height; + if( gameui.globals ) + { + gameui.globals->scrWidth = glState.width; + gameui.globals->scrHeight = glState.height; + } VGui_Startup( glState.width, glState.height ); diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 81acf773..d2f22e71 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -930,9 +930,17 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo ) if( Q_strlen( GameInfo->dll_path )) FS_Printf( f, "dllpath\t\t\"%s\"\n", GameInfo->dll_path ); + if( Q_strlen( GameInfo->game_dll )) FS_Printf( f, "gamedll\t\t\"%s\"\n", GameInfo->game_dll ); + if( Q_strlen( GameInfo->game_dll_linux )) + FS_Printf( f, "gamedll_linux\t\t\"%s\"\n", GameInfo->game_dll_linux ); + + if( Q_strlen( GameInfo->game_dll_osx )) + FS_Printf( f, "gamedll_osx\t\t\"%s\"\n", GameInfo->game_dll_osx ); + + if( Q_strlen( GameInfo->iconpath )) FS_Printf( f, "icon\t\t\"%s\"\n", GameInfo->iconpath ); @@ -1125,7 +1133,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool else if( !Q_stricmp( token, isGameInfo ? "max_edicts" : "edicts" )) { pfile = COM_ParseFile( pfile, token ); - GameInfo->max_edicts = bound( 600, Q_atoi( token ), 4096 ); + GameInfo->max_edicts = bound( 600, Q_atoi( token ), MAX_EDICTS ); } // only for gameinfo else if( isGameInfo )