added launcher, still need custom launcher to work.

oh and changed the buildnum to something better
This commit is contained in:
EnderZip
2021-09-19 09:35:10 +07:00
parent d7a981392e
commit 0f2710630c
23 changed files with 2500 additions and 187 deletions

View File

@@ -1 +1,2 @@
devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln
devtools\bin\vpc.exe /hl2mp +everything +coolsource /mksln everything.sln
pause

View File

@@ -1275,7 +1275,7 @@ void CConPanel::PaintBackground()
int wide = GetWide();
char ver[ 100 ];
Q_snprintf(ver, sizeof( ver ), "CoolSource Engine %i (%s)", PROTOCOL_VERSION, __TIMESTAMP__ );
Q_snprintf(ver, sizeof( ver ), "CoolSource Engine %i (%s)", PROTOCOL_VERSION, __DATE__ );
wchar_t unicode[ 200 ];
g_pVGuiLocalize->ConvertANSIToUnicode( ver, unicode, sizeof( unicode ) );

BIN
launcher/RCa01748 Normal file

Binary file not shown.

BIN
launcher/arrow.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

37
launcher/ifilesystem.h Normal file
View File

@@ -0,0 +1,37 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#ifndef IFILESYSTEM_H
#define IFILESYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "interface.h"
class IFileSystem;
//-----------------------------------------------------------------------------
// Loads, unloads the file system DLL
//-----------------------------------------------------------------------------
bool FileSystem_LoadFileSystemModule( void );
void FileSystem_UnloadFileSystemModule( void );
CSysModule * FileSystem_LoadModule( const char* path );
void FileSystem_UnloadModule( CSysModule *pModule );
bool FileSystem_Init( );
void FileSystem_Shutdown( void );
// Sets the file system search path based on the game directory
bool FileSystem_SetGameDirectory( char const* pGameDir );
extern IFileSystem *g_pFileSystem;
#endif // IFILESYSTEM_H

1321
launcher/launcher.cpp Normal file

File diff suppressed because it is too large Load Diff

81
launcher/launcher.rc Normal file
View File

@@ -0,0 +1,81 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_NODROP CURSOR "nodrop.cur"
//IDC_POINTER2 CURSOR "POINTER2.cur"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "res\coollauncher.ico"
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

129
launcher/launcher.vpc Normal file
View File

@@ -0,0 +1,129 @@
//-----------------------------------------------------------------------------
// LAUNCHER.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR ".."
$Macro OUTBINDIR "$SRCDIR\..\game"
$Include "$SRCDIR\vpc_scripts\source_exe_base.vpc"
// Must be built explicitly as "default" in order to build a compliant submittable Disc.
// Renames will not work.
$Macro OUTBINNAME "default"
$Macro OUTBINNAME "hl2_osx" [$OSXALL]
$Macro OUTBINNAME "hl2_linux" [$LINUXALL]
$Configuration
{
$General
{
$AdditionalProjectDependencies "$BASE;togl" [$OSXALL]
}
$Compiler
{
//$PreprocessorDefinitions "$BASE;LAUNCHERONLY"
$PreprocessorDefinitions "$BASE;fopen=dont_use_fopen"
$ForceIncludes " "
}
$Linker
{
$AdditionalDependencies "$BASE shlwapi.lib winmm.lib wsock32.lib odbc32.lib odbccp32.lib $SRCDIR\dx9sdk\lib\dinput8.lib $SRCDIR\dx9sdk\lib\ddraw.lib" [$WIN32]
$EnableLargeAddresses "Support Addresses Larger Than 2 Gigabytes (/LARGEADDRESSAWARE)" [$WIN32]
$FixedBaseAddress "Generate a relocation section (/FIXED:NO)" [$WIN32]
$SystemLibraries "iconv" [$OSXALL]
$SystemFrameworks "Carbon;AppKit;OpenGL;IOKit" [$OSXALL]
// We run from the ./game dir, but want to look in the ./game/bin directory when loading libraries.
// To dump rpath/runpath of a library, use "chrpath --list blah.so" or "objdump -x blah.so" or "readelf -d bin/launcher.so"
$GCC_ExtraLinkerFlags "-Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,'$$ORIGIN' -L/usr/lib32 -L/usr/lib" [$LINUXALL]
}
$PreBuildEvent [$WIN32]
{
$CommandLine "if EXIST $OUTBINDIR\coolsource.exe for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\coolsource.exe$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \
"set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \
"if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \
"$CRCCHECK"
}
$PostBuildEvent [$X360]
{
// inherit and add
$CommandLine "$BASE" \
"call $SRCDIR\vpc_scripts\valve_xbcp_wrapper.cmd $(TargetDir)$(TargetName).xex xE:\Valve\default.xex" "\n"
}
}
$Configuration "Debug"
{
$Linker
{
$AdditionalDependencies "$BASE Xonlined.lib" [$X360]
}
}
$Configuration "Release"
{
$Linker
{
$AdditionalDependencies "$BASE Xonline.lib" [$X360]
}
}
$Project "launcher"
{
$Folder "Source Files"
{
$File "$SRCDIR\public\filesystem_init.cpp"
$File "launcher.cpp"
$File "reslistgenerator.cpp"
$File "launcher.rc"
}
$Folder "Header Files"
{
$File "$SRCDIR\public\tier0\basetypes.h"
$File "$SRCDIR\public\tier0\commonmacros.h"
$File "$SRCDIR\public\tier0\dbg.h"
$File "$SRCDIR\common\engine_launcher_api.h"
$File "$SRCDIR\public\tier0\fasttimer.h"
$File "$SRCDIR\public\appframework\IAppSystem.h"
$File "$SRCDIR\public\tier0\icommandline.h"
$File "ifilesystem.h"
$File "$SRCDIR\public\vgui\IHTML.h"
$File "$SRCDIR\public\vgui\IImage.h"
$File "$SRCDIR\public\tier1\interface.h"
$File "$SRCDIR\public\vgui\ISurface.h"
$File "$SRCDIR\public\vgui\KeyCode.h"
$File "$SRCDIR\public\tier0\mem.h"
$File "$SRCDIR\public\tier0\memalloc.h"
$File "$SRCDIR\public\vgui\MouseCode.h"
$File "$SRCDIR\public\tier0\platform.h"
$File "$SRCDIR\public\tier0\protected_things.h"
$File "reslistgenerator.h"
$File "$SRCDIR\public\string_t.h"
$File "$SRCDIR\public\tier1\strtools.h"
$File "$SRCDIR\public\tier0\vcr_shared.h"
$File "$SRCDIR\public\tier0\vcrmode.h"
$File "$SRCDIR\public\mathlib\vector2d.h"
$File "$SRCDIR\public\vgui\VGUI.h"
$File "$SRCDIR\public\vstdlib\vstdlib.h"
}
$folder "Link Libraries"
{
$Lib appframework
$Lib tier2
$Lib tier3
$Implib steam_api
$ImpLib togl [!$IS_LIB_PROJECT && $GL]
$ImpLib SDL2 [$SDL]
}
}

BIN
launcher/nodrop.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
launcher/res/launcher.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,523 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// Defines the entry point for the application.
//
//===========================================================================//
#include "reslistgenerator.h"
#include "filesystem.h"
#include "tier1/utlrbtree.h"
#include "tier1/fmtstr.h"
#include "characterset.h"
#include "tier1/utlstring.h"
#include "tier1/utlvector.h"
#include "tier1/utlbuffer.h"
#include "tier0/icommandline.h"
#include "tier1/KeyValues.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
bool SaveResList( const CUtlRBTree< CUtlString, int > &list, char const *pchFileName, char const *pchSearchPath )
{
FileHandle_t fh = g_pFullFileSystem->Open( pchFileName, "wt", pchSearchPath );
if ( fh != FILESYSTEM_INVALID_HANDLE )
{
for ( int i = list.FirstInorder(); i != list.InvalidIndex(); i = list.NextInorder( i ) )
{
g_pFullFileSystem->Write( list[ i ].String(), Q_strlen( list[ i ].String() ), fh );
g_pFullFileSystem->Write( "\n", 1, fh );
}
g_pFullFileSystem->Close( fh );
return true;
}
return false;
}
void LoadResList( CUtlRBTree< CUtlString, int > &list, char const *pchFileName, char const *pchSearchPath )
{
CUtlBuffer buffer( 0, 0, CUtlBuffer::TEXT_BUFFER );
if ( !g_pFullFileSystem->ReadFile( pchFileName, pchSearchPath, buffer ) )
{
// does not exist
return;
}
characterset_t breakSet;
CharacterSetBuild( &breakSet, "" );
// parse reslist
char szToken[ MAX_PATH ];
for ( ;; )
{
int nTokenSize = buffer.ParseToken( &breakSet, szToken, sizeof( szToken ) );
if ( nTokenSize <= 0 )
{
break;
}
Q_strlower( szToken );
Q_FixSlashes( szToken );
// Ensure filename has "quotes" around it
CUtlString s;
if ( szToken[ 0 ] == '\"' )
{
Assert( Q_strlen( szToken ) > 2 );
Assert( szToken[ Q_strlen( szToken ) - 1 ] == '\"' );
s = szToken;
}
else
{
s = CFmtStr( "\"%s\"", szToken );
}
int idx = list.Find( s );
if ( idx == list.InvalidIndex() )
{
list.Insert( s );
}
}
}
static bool ReslistLogLessFunc( CUtlString const &pLHS, CUtlString const &pRHS )
{
return CaselessStringLessThan( pLHS.Get(), pRHS.Get() );
}
void SortResList( char const *pchFileName, char const *pchSearchPath )
{
CUtlRBTree< CUtlString, int > sorted( 0, 0, ReslistLogLessFunc );
LoadResList( sorted, pchFileName, pchSearchPath );
// Now write it back out
SaveResList( sorted, pchFileName, pchSearchPath );
}
void MergeResLists( CUtlVector< CUtlString > &fileNames, char const *pchOutputFile, char const *pchSearchPath )
{
CUtlRBTree< CUtlString, int > sorted( 0, 0, ReslistLogLessFunc );
for ( int i = 0; i < fileNames.Count(); ++i )
{
LoadResList( sorted, fileNames[ i ].String(), pchSearchPath );
}
// Now write it back out
SaveResList( sorted, pchOutputFile, pchSearchPath );
}
class CWorkItem
{
public:
CWorkItem()
{
}
CUtlString m_sSubDir;
CUtlString m_sAddCommands;
};
class CResListGenerator: public IResListGenerator
{
public:
enum
{
STATE_BUILDINGRESLISTS = 0,
STATE_GENERATINGCACHES,
};
CResListGenerator();
virtual void Init( char const *pchBaseDir, char const *pchGameDir );
virtual bool IsActive();
virtual void Shutdown();
virtual void Collate();
virtual void SetupCommandLine();
virtual bool ShouldContinue();
private:
bool InitCommandFile( char const *pchGameDir, char const *pchCommandFile );
void LoadMapList( char const *pchGameDir, CUtlVector< CUtlString > &vecMaps, char const *pchMapFile );
void CollateFiles( char const *pchResListFilename );
bool m_bInitialized;
bool m_bActive;
CUtlString m_sBaseDir;
CUtlString m_sGameDir;
CUtlString m_sFullGamePath;
CUtlString m_sFinalDir;
CUtlString m_sWorkingDir;
CUtlString m_sBaseCommandLine;
CUtlString m_sOriginalCommandLine;
CUtlString m_sInitialStartMap;
int m_nCurrentWorkItem;
CUtlVector< CWorkItem > m_WorkItems;
CUtlVector< CUtlString > m_MapList;
int m_nCurrentState;
};
static CResListGenerator g_ResListGenerator;
IResListGenerator *reslistgenerator = &g_ResListGenerator;
CResListGenerator::CResListGenerator() :
m_bInitialized( false ),
m_bActive( false ),
m_nCurrentWorkItem( 0 ),
m_nCurrentState( STATE_BUILDINGRESLISTS )
{
MEM_ALLOC_CREDIT();
m_sFinalDir = "reslists";
m_sWorkingDir = "reslists_work";
}
void CResListGenerator::CollateFiles( char const *pchResListFilename )
{
CUtlVector< CUtlString > vecReslists;
for ( int i = 0; i < m_WorkItems.Count(); ++i )
{
char fn[ MAX_PATH ];
Q_snprintf( fn, sizeof( fn ), "%s\\%s\\%s\\%s", m_sFullGamePath.String(), m_sWorkingDir.String(), m_WorkItems[ i ].m_sSubDir.String(), pchResListFilename );
vecReslists.AddToTail( fn );
}
MergeResLists( vecReslists, CFmtStr( "%s\\%s\\%s", m_sFullGamePath.String(), m_sFinalDir.String(), pchResListFilename ), "GAME" );
}
void CResListGenerator::Init( char const *pchBaseDir, char const *pchGameDir )
{
if ( IsX360() )
{
// not used or supported
return;
}
// Because we have to call this inside the first Apps "PreInit", we need only Init on the very first call
if ( m_bInitialized )
{
return;
}
m_bInitialized = true;
m_sBaseDir = pchBaseDir;
m_sGameDir = pchGameDir;
char path[MAX_PATH];
Q_snprintf( path, sizeof(path), "%s/%s", m_sBaseDir.String(), m_sGameDir.String() );
Q_FixSlashes( path );
Q_strlower( path );
m_sFullGamePath = path;
const char *pchCommandFile = NULL;
if ( CommandLine()->CheckParm( "-makereslists", &pchCommandFile ) && pchCommandFile )
{
// base path setup, now can get and parse command file
InitCommandFile( path, pchCommandFile );
}
}
void CResListGenerator::Shutdown()
{
if ( !m_bActive )
return;
}
bool CResListGenerator::IsActive()
{
return m_bInitialized && m_bActive;
}
void CResListGenerator::Collate()
{
char szDir[MAX_PATH];
V_snprintf( szDir, sizeof( szDir ), "%s\\%s", m_sFullGamePath.String(), m_sFinalDir.String() );
g_pFullFileSystem->CreateDirHierarchy( szDir, "GAME" );
// Now create the collated/merged data
CollateFiles( "all.lst" );
CollateFiles( "engine.lst" );
for ( int i = 0 ; i < m_MapList.Count(); ++i )
{
CollateFiles( CFmtStr( "%s.lst", m_MapList[ i ].String() ) );
}
}
void CResListGenerator::SetupCommandLine()
{
if ( !m_bActive )
return;
switch ( m_nCurrentState )
{
case STATE_BUILDINGRESLISTS:
{
Assert( m_nCurrentWorkItem < m_WorkItems.Count() );
const CWorkItem &work = m_WorkItems[ m_nCurrentWorkItem ];
// Clean the working dir
char szWorkingDir[ 512 ];
Q_snprintf( szWorkingDir, sizeof( szWorkingDir ), "%s\\%s", m_sWorkingDir.String(), work.m_sSubDir.String() );
char szFullWorkingDir[MAX_PATH];
V_snprintf( szFullWorkingDir, sizeof( szFullWorkingDir ), "%s\\%s", m_sFullGamePath.String(), szWorkingDir );
g_pFullFileSystem->CreateDirHierarchy( szFullWorkingDir, "GAME" );
// Preserve startmap
char const *pszStartMap = NULL;
CommandLine()->CheckParm( "-startmap", &pszStartMap );
char szMap[ MAX_PATH ] = { 0 };
if ( pszStartMap )
{
Q_strncpy( szMap, pszStartMap, sizeof( szMap ) );
}
// Prepare stuff
// Reset command line based on current state
char szCmd[ 512 ];
Q_snprintf( szCmd, sizeof( szCmd ), "%s %s %s -reslistdir %s", m_sOriginalCommandLine.String(), m_sBaseCommandLine.String(), work.m_sAddCommands.String(), szWorkingDir );
Warning( "Reslists: Setting command line:\n'%s'\n", szCmd );
CommandLine()->CreateCmdLine( szCmd );
// Never rebuild caches by default, inly do it in STATE_GENERATINGCACHES
CommandLine()->AppendParm( "-norebuildaudio", NULL );
if ( szMap[ 0 ] )
{
CommandLine()->AppendParm( "-startmap", szMap );
}
}
break;
case STATE_GENERATINGCACHES:
{
Collate();
// Prepare stuff
// Reset command line based on current state
char szCmd[ 512 ];
Q_snprintf( szCmd, sizeof( szCmd ), "%s -reslistdir %s -rebuildaudio", m_sOriginalCommandLine.String(), m_sFinalDir.String());
Warning( "Caches: Setting command line:\n'%s'\n", szCmd );
CommandLine()->CreateCmdLine( szCmd );
CommandLine()->RemoveParm( "-norebuildaudio" );
CommandLine()->RemoveParm( "-makereslists" );
++m_nCurrentState;
}
break;
}
}
bool CResListGenerator::ShouldContinue()
{
if ( !m_bActive )
return false;
bool bContinueAdvancing = false;
do
{
switch ( m_nCurrentState )
{
default:
break;
case STATE_BUILDINGRESLISTS:
{
CommandLine()->RemoveParm( "-startmap" );
// Advance to next time
++m_nCurrentWorkItem;
if ( m_nCurrentWorkItem >= m_WorkItems.Count())
{
// Will stay in the loop
++m_nCurrentState;
bContinueAdvancing = true;
}
else
{
return true;
}
}
break;
case STATE_GENERATINGCACHES:
{
return true;
}
break;
}
} while ( bContinueAdvancing );
return false;
}
void CResListGenerator::LoadMapList( char const *pchGameDir, CUtlVector< CUtlString > &vecMaps, char const *pchMapFile )
{
char fullpath[ 512 ];
Q_snprintf( fullpath, sizeof( fullpath ), "%s/%s", pchGameDir, pchMapFile );
// Load them in
CUtlBuffer buf( 0, 0, CUtlBuffer::TEXT_BUFFER );
if ( g_pFullFileSystem->ReadFile( fullpath, "GAME", buf ) )
{
char szMap[ MAX_PATH ];
while ( true )
{
buf.GetLine( szMap, sizeof( szMap ) );
if ( !szMap[ 0 ] )
break;
// Strip trailing CR/LF chars
int len = Q_strlen( szMap );
while ( len >= 1 && ( szMap[ len - 1 ] == '\n' || szMap[ len - 1 ] == '\r' ) )
{
szMap[ len - 1 ] = 0;
len = Q_strlen( szMap );
}
CUtlString newMap;
newMap = szMap;
vecMaps.AddToTail( newMap );
}
}
else
{
Error( "Unable to maplist file %s\n", fullpath );
}
}
bool CResListGenerator::InitCommandFile( char const *pchGameDir, char const *pchCommandFile )
{
if ( *pchCommandFile == '+' ||
*pchCommandFile == '-' )
{
Msg( "falling back to legacy reslists system\n" );
return false;
}
char fullpath[ 512 ];
Q_snprintf( fullpath, sizeof( fullpath ), "%s/%s", pchGameDir, pchCommandFile );
CUtlBuffer buf;
if ( !g_pFullFileSystem->ReadFile( fullpath, "GAME", buf ) )
{
Error( "Unable to load '%s'\n", fullpath );
return false;
}
KeyValues *kv = new KeyValues( "reslists" );
if ( !kv->LoadFromBuffer( "reslists", (const char *)buf.Base() ) )
{
Error( "Unable to parse keyvalues from '%s'\n", fullpath );
kv->deleteThis();
return false;
}
CUtlString sMapListFile = kv->GetString( "maplist", "maplist.txt" );
LoadMapList( pchGameDir, m_MapList, sMapListFile );
if ( m_MapList.Count() <= 0 )
{
Error( "Maplist file '%s' empty or missing!!!\n", sMapListFile.String() );
kv->deleteThis();
return false;
}
char const *pszSolo = NULL;
if ( CommandLine()->CheckParm( "+map", &pszSolo ) && pszSolo )
{
m_MapList.Purge();
CUtlString newMap;
newMap = pszSolo;
m_MapList.AddToTail( newMap );
}
m_nCurrentWorkItem = CommandLine()->ParmValue( "-startstage", 0 );
char const *pszStartMap = NULL;
CommandLine()->CheckParm( "-startmap", &pszStartMap );
if ( pszStartMap )
{
m_sInitialStartMap = pszStartMap;
}
CommandLine()->RemoveParm( "-startstage" );
CommandLine()->RemoveParm( "-makereslists" );
CommandLine()->RemoveParm( "-reslistdir" );
CommandLine()->RemoveParm( "-norebuildaudio" );
CommandLine()->RemoveParm( "-startmap" );
m_sOriginalCommandLine = CommandLine()->GetCmdLine();
// Add it back in for first map
if ( pszStartMap )
{
CommandLine()->AppendParm( "-startmap", m_sInitialStartMap.String() );
}
m_sBaseCommandLine = kv->GetString( "basecommandline", "" );
m_sFinalDir = kv->GetString( "finaldir", m_sFinalDir.String() );
m_sWorkingDir = kv->GetString( "workdir", m_sWorkingDir.String() );
int i = 0;
do
{
char sz[ 32 ];
Q_snprintf( sz, sizeof( sz ), "%i", i );
KeyValues *subKey = kv->FindKey( sz, false );
if ( !subKey )
break;
CWorkItem work;
work.m_sSubDir = subKey->GetString( "subdir", "" );
work.m_sAddCommands = subKey->GetString( "addcommands", "" );
if ( work.m_sSubDir.Length() > 0 )
{
m_WorkItems.AddToTail( work );
}
else
{
Error( "%s: failed to specify 'subdir' for item %s\n", fullpath, sz );
}
++i;
} while ( true );
m_bActive = m_WorkItems.Count() > 0;
m_nCurrentWorkItem = clamp( m_nCurrentWorkItem, 0, m_WorkItems.Count() - 1 );
bool bCollate = CommandLine()->CheckParm( "-collate" ) ? true : false;
if ( bCollate )
{
Collate();
m_bActive = false;
exit( -1 );
}
kv->deleteThis();
/*
if ( m_bActive )
{
// Wipe console log
g_pFullFileSystem->RemoveFile( "console.log", "GAME" );
}
*/
return m_bActive;
}

View File

@@ -0,0 +1,32 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// Defines the entry point for the application.
//
//===========================================================================//
#ifndef RESLISTGENERATOR_H
#define RESLISTGENERATOR_H
#ifdef _WIN32
#pragma once
#endif
class IResListGenerator
{
public:
virtual void Init( char const *pchBaseDir, char const *pchGameDir ) = 0;
virtual void Shutdown() = 0;
virtual bool IsActive() = 0;
virtual void SetupCommandLine() = 0;
virtual bool ShouldContinue() = 0;
};
extern IResListGenerator *reslistgenerator;
#endif // RESLISTGENERATOR_H

17
launcher/resource.h Normal file
View File

@@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by launcher.rc
//
#define IDC_NODROP 106
#define IDI_ICON1 111
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

3
launcher/xbox/xbox.def Normal file
View File

@@ -0,0 +1,3 @@
LIBRARY launcher_360.dll
EXPORTS
LauncherMain @1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,186 +1,191 @@
//-----------------------------------------------------------------------------
// PROJECTS.VGC
//
// Project Configurations for all Source(TM) Projects
//-----------------------------------------------------------------------------
/////////////////////////
// Project definitions //
/////////////////////////
$Project "captioncompiler"
{
"utils\captioncompiler\captioncompiler.vpc" [$WIN32]
}
$Project "client"
{
"game\client\client_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\client\client_episodic.vpc" [($WIN32||$POSIX) && $EPISODIC]
"game\client\client_hl2.vpc" [($WIN32||$POSIX) && $HL2]
"game\client\client_sdk.vpc" [($WIN32||$POSIX) && $SDK]
}
$Project "fgdlib"
{
"fgdlib\fgdlib.vpc" [$WIN32]
}
$Project "game_shader_dx9"
{
"materialsystem\stdshaders\game_shader_dx9_hl2mp.vpc" [$HL2MP]
}
$Project "glview"
{
"utils\glview\glview.vpc" [$WIN32]
}
$Project "height2normal"
{
"utils\height2normal\height2normal.vpc" [$WIN32]
}
$Project "server"
{
"game\server\server_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\server\server_episodic.vpc" [($WIN32||$POSIX) && $EPISODIC]
"game\server\server_hl2.vpc" [($WIN32||$POSIX) && $HL2]
"game\server\server_sdk.vpc" [($WIN32||$POSIX) && $SDK]
}
$Project "mathlib"
{
"mathlib\mathlib.vpc" [$WINDOWS||$X360||$POSIX]
}
$Project "motionmapper"
{
"utils\motionmapper\motionmapper.vpc" [$WIN32]
}
$Project "phonemeextractor"
{
"utils\phonemeextractor\phonemeextractor.vpc" [$WIN32]
}
$Project "raytrace"
{
"raytrace\raytrace.vpc" [$WIN32||$X360||$POSIX]
}
$Project "qc_eyes"
{
"utils\qc_eyes\qc_eyes.vpc" [$WIN32]
}
$Project "serverplugin_empty"
{
"utils\serverplugin_sample\serverplugin_empty.vpc" [$WIN32||$POSIX]
}
$Project "shaderapidx9"
{
"materialsystem\shaderapidx9\shaderapidx9.vpc"
}
$Project "tgadiff"
{
"utils\tgadiff\tgadiff.vpc" [$WIN32]
}
$Project "tier1"
{
"tier1\tier1.vpc" [$WINDOWS || $X360||$POSIX]
}
$Project "vbsp"
{
"utils\vbsp\vbsp.vpc" [$WIN32]
}
$Project "vgui_controls"
{
"vgui2\vgui_controls\vgui_controls.vpc" [$WIN32||$X360||$POSIX]
}
$Project "vice"
{
"utils\vice\vice.vpc" [$WIN32]
}
$Project "vrad_dll"
{
"utils\vrad\vrad_dll.vpc" [$WIN32]
}
$Project "vrad_launcher"
{
"utils\vrad_launcher\vrad_launcher.vpc" [$WIN32]
}
$Project "vtf2tga"
{
"utils\vtf2tga\vtf2tga.vpc" [$WIN32]
}
$Project "vtfdiff"
{
"utils\vtfdiff\vtfdiff.vpc" [$WIN32]
}
$Project "vvis_dll"
{
"utils\vvis\vvis_dll.vpc" [$WIN32]
}
$Project "vvis_launcher"
{
"utils\vvis_launcher\vvis_launcher.vpc" [$WIN32]
}
$Project "vpklib"
{
"vpklib/vpklib.vpc" [$WIN32]
}
$Project "vtf"
{
"vtf/vtf.vpc" [$WIN32]
}
$Project "engine"
{
"engine/engine.vpc" [$WIN32]
}
$Project "materialsystem"
{
"materialsystem/materialsystem.vpc" [$WIN32]
}
$Project "studiorender"
{
"studiorender\studiorender.vpc" [$WIN32]
}
$Project "filesystem_stdio"
{
"filesystem/filesystem_stdio.vpc" [$WIN32]
}
$Project "filesystem_steam"
{
"filesystem/filesystem_steam.vpc" [$WIN32]
}
$Project "bsppack"
{
"utils\bsppack\bsppack.vpc" [$WIN32]
}
$Project "bspzip"
{
"utils\bspzip\bspzip.vpc" [$WIN32]
//-----------------------------------------------------------------------------
// PROJECTS.VGC
//
// Project Configurations for all Source(TM) Projects
//-----------------------------------------------------------------------------
/////////////////////////
// Project definitions //
/////////////////////////
$Project "captioncompiler"
{
"utils\captioncompiler\captioncompiler.vpc" [$WIN32]
}
$Project "client"
{
"game\client\client_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\client\client_episodic.vpc" [($WIN32||$POSIX) && $EPISODIC]
"game\client\client_hl2.vpc" [($WIN32||$POSIX) && $HL2]
"game\client\client_sdk.vpc" [($WIN32||$POSIX) && $SDK]
}
$Project "fgdlib"
{
"fgdlib\fgdlib.vpc" [$WIN32]
}
$Project "game_shader_dx9"
{
"materialsystem\stdshaders\game_shader_dx9_hl2mp.vpc" [$HL2MP]
}
$Project "glview"
{
"utils\glview\glview.vpc" [$WIN32]
}
$Project "coolsource" //this is the launcher
{
"launcher\launcher.vpc"
}
$Project "height2normal"
{
"utils\height2normal\height2normal.vpc" [$WIN32]
}
$Project "server"
{
"game\server\server_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\server\server_episodic.vpc" [($WIN32||$POSIX) && $EPISODIC]
"game\server\server_hl2.vpc" [($WIN32||$POSIX) && $HL2]
"game\server\server_sdk.vpc" [($WIN32||$POSIX) && $SDK]
}
$Project "mathlib"
{
"mathlib\mathlib.vpc" [$WINDOWS||$X360||$POSIX]
}
$Project "motionmapper"
{
"utils\motionmapper\motionmapper.vpc" [$WIN32]
}
$Project "phonemeextractor"
{
"utils\phonemeextractor\phonemeextractor.vpc" [$WIN32]
}
$Project "raytrace"
{
"raytrace\raytrace.vpc" [$WIN32||$X360||$POSIX]
}
$Project "qc_eyes"
{
"utils\qc_eyes\qc_eyes.vpc" [$WIN32]
}
$Project "serverplugin_empty"
{
"utils\serverplugin_sample\serverplugin_empty.vpc" [$WIN32||$POSIX]
}
$Project "shaderapidx9"
{
"materialsystem\shaderapidx9\shaderapidx9.vpc"
}
$Project "tgadiff"
{
"utils\tgadiff\tgadiff.vpc" [$WIN32]
}
$Project "tier1"
{
"tier1\tier1.vpc" [$WINDOWS || $X360||$POSIX]
}
$Project "vbsp"
{
"utils\vbsp\vbsp.vpc" [$WIN32]
}
$Project "vgui_controls"
{
"vgui2\vgui_controls\vgui_controls.vpc" [$WIN32||$X360||$POSIX]
}
$Project "vice"
{
"utils\vice\vice.vpc" [$WIN32]
}
$Project "vrad_dll"
{
"utils\vrad\vrad_dll.vpc" [$WIN32]
}
$Project "vrad_launcher"
{
"utils\vrad_launcher\vrad_launcher.vpc" [$WIN32]
}
$Project "vtf2tga"
{
"utils\vtf2tga\vtf2tga.vpc" [$WIN32]
}
$Project "vtfdiff"
{
"utils\vtfdiff\vtfdiff.vpc" [$WIN32]
}
$Project "vvis_dll"
{
"utils\vvis\vvis_dll.vpc" [$WIN32]
}
$Project "vvis_launcher"
{
"utils\vvis_launcher\vvis_launcher.vpc" [$WIN32]
}
$Project "vpklib"
{
"vpklib/vpklib.vpc" [$WIN32]
}
$Project "vtf"
{
"vtf/vtf.vpc" [$WIN32]
}
$Project "engine"
{
"engine/engine.vpc" [$WIN32]
}
$Project "materialsystem"
{
"materialsystem/materialsystem.vpc" [$WIN32]
}
$Project "studiorender"
{
"studiorender\studiorender.vpc" [$WIN32]
}
$Project "filesystem_stdio"
{
"filesystem/filesystem_stdio.vpc" [$WIN32]
}
$Project "filesystem_steam"
{
"filesystem/filesystem_steam.vpc" [$WIN32]
}
$Project "bsppack"
{
"utils\bsppack\bsppack.vpc" [$WIN32]
}
$Project "bspzip"
{
"utils\bspzip\bspzip.vpc" [$WIN32]
}

View File

@@ -0,0 +1,84 @@
@echo off
setlocal
set valveTmpFileFromVS2005=%1%
set valveTmpFileFromVS2005=%valveTmpFileFromVS2005:\\=\%
set valveChangelistName="Visual Studio Auto Checkout"
:: // Make sure we have 2 args
if .%2.==.. (
echo *** [valve_p4_edit] Error calling command! No file specified for checkout!
echo *** Usage: valve_p4_edit.cmd file srcdir ["changelist name"]
echo *** The changelist name is optional. If present, must be quoted. By default it's %valveChangelistName%.
endlocal
exit /b 1
)
if [%3] NEQ [] (
set valveChangelistName=%3
)
:: // Fallback to old functionality and just change file attribs
if NOT "%VALVE_NO_AUTO_P4%"=="" (
echo [valve_p4_edit] VALVE_NO_AUTO_P4 defined. Changing file attribs only!
if EXIST %valveTmpFileFromVS2005% (
attrib -r %valveTmpFileFromVS2005%
)
endlocal
exit /b 0
)
rem // :: // First check if file exists
rem // if NOT EXIST %valveTmpFileFromVS2005% (
rem // :: // File does not exist
rem // rem // echo [valve_p4_edit] %valveTmpFileFromVS2005% does not exist! Skipping p4 edit command.
rem // endlocal
rem // exit /b 0
rem // )
rem //
rem // :: // Check if file is read-only (NOTE: If the file is writable, we don't call p4!)
rem // dir /b /ar %valveTmpFileFromVS2005% >nul 2>&1
rem // if NOT %ERRORLEVEL%==0 (
rem // rem // echo [valve_p4_edit] %valveTmpFileFromVS2005% is already writable. Not calling p4 edit.
rem // endlocal
rem // exit /b 0
rem // )
:: // Put 360 bins into their own changelist
for /f %%A in ('echo %valveTmpFileFromVS2005% ^| find /i "360"') do set valveTmpIs360=%%A
if NOT "%valveTmpIs360%"=="" (
set valveChangelistName="360 Visual Studio Auto Checkout"
)
for /f %%A in ('echo %valveTmpFileFromVS2005% ^| find /i "launcher_main"') do set valveTmpIs360=%%A
if NOT "%valveTmpIs360%"=="" (
set valveChangelistName="360 Visual Studio Auto Checkout"
)
set valveP4EditCall=%2\devtools\bin\valve_p4_edit_to_changelist.cmd %valveTmpFileFromVS2005% %valveChangelistName%
if "%VALVE_WAIT_ON_P4%"=="" (
:: // The file exists and is read-only, so change the file attrib and spawn the Perforce checkout asynchronously
if EXIST %valveTmpFileFromVS2005% attrib -r %valveTmpFileFromVS2005%
start /b cmd /c %valveP4EditCall% EXIT
rem // (NOTE: The EXIT arg is needed because we're using the start command to launch the cmd!)
) ELSE (
:: // Do not use attrib -r if we're doing synchronous p4 edit. If this fails, we want to throw an error below
call %valveP4EditCall%
)
:: // Make sure file is writable if it exists
if NOT EXIST %valveTmpFileFromVS2005% goto End
dir /b /a-r %valveTmpFileFromVS2005% >nul 2>&1
if NOT %ERRORLEVEL%==0 (
:: // Return with an error to stop the build!
echo *** [valve_p4_edit] Error! %valveTmpFileFromVS2005% is not writable!
endlocal
exit /b 1
)
:End
endlocal
exit /b 0

View File

@@ -0,0 +1,52 @@
#!/usr/bin/perl -w
use Data::Dumper;
use FindBin;
use Cwd qw(getcwd abs_path);
use File::Basename;
use lib "$FindBin::Bin/../devtools/lib";
use P4Run;
use strict;
die "Usage: $0 <file>\n" unless @ARGV;
my $path = shift @ARGV;
my $dir = abs_path(dirname($path));
my $file = "$dir/".basename($path);
if ($ENV{VALVE_NO_AUTO_P4})
{
print "VALVE_NO_AUTO_P4 Set. Making $file writable\n";
if ($^O eq 'MSWin32')
{
system('attrib', '-r', $file);
}
else
{
open(my $fh, "<", $file);
my $perm = (stat($fh))[2] | 0220;
chmod $perm, $fh;
}
}
else
{
my $desc = $^O eq 'MSWin32' ? 'Visual Studio Auto Checkout' : 'GCC Auto Checkout';
$desc = '360 Visual Studio Auto Checkout' if $file =~ /_360|launcher_main|default.xex/;
my $change = P4Run::FindChange($desc) || P4Run::NewChange($desc);
die "Failed to create Change List: $desc\n" unless $change;
my ($stat) = P4Run('fstat', $file);
if ($stat)
{
print "Opening $file for edit in CL#$change ($desc)\n";
P4Run('edit', '-c', $change, $file);
}
else
{
print "Adding new file $file to CL#$change ($desc)\n";
open(my $fh, ">", $file); close($fh);
P4Run('add', '-c', $change, '-t', 'xbinary', $file);
unlink($file);
}
}
warn "$file is not writable\n" if (-e $file && ! -w $file);
exit 0;

View File

@@ -0,0 +1,28 @@
@echo off
setlocal
:: // If they've disabled xbcp, then don't use it.
if NOT "%VALVE_NO_XBCP%"=="" (
echo [valve_xbcp_wrapper] VALVE_NO_XBCP defined. Avoiding the copy.
endlocal
exit /b 0
)
set localFilename=%1
set remoteFilename=%2
"%XEDK%\bin\win32\xbcp" /y /t "%localFilename%" "%remoteFilename%"
if %ERRORLEVEL%==1 (
echo XBCP failed. If you don't have an X360 but want to compile its sources, define VALVE_NO_XBCP.
del /q %1%
exit 1
)
:End
endlocal
exit /b 0