Added launcher for CS:S Enhanced

This commit is contained in:
unknown 2024-09-15 22:05:45 +02:00
parent 4ceda5d415
commit 4954862ff0
5 changed files with 47 additions and 14 deletions

View file

@ -2378,6 +2378,11 @@ bool CL_ShouldLoadBackgroundLevel( const CCommand &args )
bIsTF2 = true;
}
if ( Q_stricmp( COM_GetModDirectory(), "cstrike" ) == 0 )
{
return false;
}
if ( bIsTF2 && IsPC() )
return false;

View file

@ -91,7 +91,11 @@ int MessageBox( HWND hWnd, const char *message, const char *header, unsigned uTy
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#ifdef CSS_ENHANCED_EXECUTABLE
#define DEFAULT_HL2_GAMEDIR "cstrike"
#else
#define DEFAULT_HL2_GAMEDIR "hl2"
#endif
#if defined( USE_SDL )
extern void* CreateSDLMgr();
@ -419,7 +423,7 @@ void CLogAllFiles::Init()
// game directory has not been established yet, must derive ourselves
char path[MAX_PATH];
Q_snprintf( path, sizeof(path), "%s/%s", GetBaseDirectory(), CommandLine()->ParmValue( "-game", "hl2" ) );
Q_snprintf( path, sizeof(path), "%s/%s", GetBaseDirectory(), CommandLine()->ParmValue( "-game", DEFAULT_HL2_GAMEDIR ) );
Q_FixSlashes( path );
#ifdef WIN32
Q_strlower( path );
@ -818,7 +822,7 @@ bool CSourceAppSystemGroup::PreInit()
if ( IsPC() )
{
// This will get called multiple times due to being here, but only the first one will do anything
reslistgenerator->Init( GetBaseDirectory(), CommandLine()->ParmValue( "-game", "hl2" ) );
reslistgenerator->Init( GetBaseDirectory(), CommandLine()->ParmValue( "-game", DEFAULT_HL2_GAMEDIR ) );
// This will also get called each time, but will actually fix up the command line as needed
reslistgenerator->SetupCommandLine();
@ -1267,6 +1271,11 @@ DLL_EXPORT int LauncherMain( int argc, char **argv )
CommandLine()->CreateCmdLine( argc, argv );
#endif
#ifdef CSS_ENHANCED_EXECUTABLE
CommandLine()->AppendParm( "-game", DEFAULT_HL2_GAMEDIR );
CommandLine()->AppendParm( "-defaultgamedir", DEFAULT_HL2_GAMEDIR );
#endif
// No -dxlevel or +mat_hdr_level allowed on POSIX
#ifdef POSIX
CommandLine()->RemoveParm( "-dxlevel" );

View file

@ -48,6 +48,9 @@ def build(bld):
install_path = bld.env.LIBDIR
if 'cstrike' == bld.options.GAMES:
defines += ['CSS_ENHANCED_EXECUTABLE']
bld.shlib(
source = source,
target = PROJECT_NAME,

View file

@ -4,6 +4,7 @@
//
//=====================================================================================//
#include "tier1/strtools.h"
#if defined( _WIN32 ) && !defined( _X360 )
#include <windows.h>
#include <stdio.h>

View file

@ -30,6 +30,21 @@ def build(bld):
source += ['launcher_main.rc']
install_path = bld.env.BINDIR
if 'cstrike' == bld.options.GAMES:
bld(
source = source,
target = 'css_enhanced',
name = 'css_enhanced',
features = 'c cxx cxxprogram',
includes = includes,
defines = defines + ['CSS_ENHANCED_EXECUTABLE'],
use = libs,
install_path = install_path,
subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count()
)
else:
bld(
source = source,
target = PROJECT_NAME,