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; bIsTF2 = true;
} }
if ( Q_stricmp( COM_GetModDirectory(), "cstrike" ) == 0 )
{
return false;
}
if ( bIsTF2 && IsPC() ) if ( bIsTF2 && IsPC() )
return false; 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!!! // memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"
#ifdef CSS_ENHANCED_EXECUTABLE
#define DEFAULT_HL2_GAMEDIR "cstrike"
#else
#define DEFAULT_HL2_GAMEDIR "hl2" #define DEFAULT_HL2_GAMEDIR "hl2"
#endif
#if defined( USE_SDL ) #if defined( USE_SDL )
extern void* CreateSDLMgr(); extern void* CreateSDLMgr();
@ -419,7 +423,7 @@ void CLogAllFiles::Init()
// game directory has not been established yet, must derive ourselves // game directory has not been established yet, must derive ourselves
char path[MAX_PATH]; 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 ); Q_FixSlashes( path );
#ifdef WIN32 #ifdef WIN32
Q_strlower( path ); Q_strlower( path );
@ -818,7 +822,7 @@ bool CSourceAppSystemGroup::PreInit()
if ( IsPC() ) if ( IsPC() )
{ {
// This will get called multiple times due to being here, but only the first one will do anything // 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 // This will also get called each time, but will actually fix up the command line as needed
reslistgenerator->SetupCommandLine(); reslistgenerator->SetupCommandLine();
@ -1267,6 +1271,11 @@ DLL_EXPORT int LauncherMain( int argc, char **argv )
CommandLine()->CreateCmdLine( argc, argv ); CommandLine()->CreateCmdLine( argc, argv );
#endif #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 // No -dxlevel or +mat_hdr_level allowed on POSIX
#ifdef POSIX #ifdef POSIX
CommandLine()->RemoveParm( "-dxlevel" ); CommandLine()->RemoveParm( "-dxlevel" );

View file

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

View file

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

View file

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