initial
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// ----------------------------------------- //
|
||||
// File generated by VPC //
|
||||
// ----------------------------------------- //
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\hammer_launcher\main.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\hammer_launcher\main.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\hammer_launcher\main.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
BIN
hammer_launcher/hammer_launcher.ico
Normal file
BIN
hammer_launcher/hammer_launcher.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
72
hammer_launcher/hammer_launcher.rc
Normal file
72
hammer_launcher/hammer_launcher.rc
Normal file
@@ -0,0 +1,72 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_HAMMER_LAUNCHER ICON DISCARDABLE "hammer_launcher.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
44
hammer_launcher/hammer_launcher.vpc
Normal file
44
hammer_launcher/hammer_launcher.vpc
Normal file
@@ -0,0 +1,44 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// HAMMER_LAUNCHER.VPC
|
||||
//
|
||||
// Project Script
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$Macro SRCDIR ".."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
$Macro OUTBINNAME "hammer"
|
||||
|
||||
$Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc"
|
||||
|
||||
$Configuration
|
||||
{
|
||||
$Compiler
|
||||
{
|
||||
$AdditionalOptions "/EHa"
|
||||
}
|
||||
|
||||
$Linker [$WIN32]
|
||||
{
|
||||
$EnableLargeAddresses "Support Addresses Larger Than 2 Gigabytes (/LARGEADDRESSAWARE)"
|
||||
}
|
||||
}
|
||||
|
||||
$Project "Hammer_launcher"
|
||||
{
|
||||
$Folder "Source Files"
|
||||
{
|
||||
-$File "$SRCDIR\public\tier0\memoverride.cpp"
|
||||
$File "main.cpp"
|
||||
}
|
||||
|
||||
$Folder "Resources"
|
||||
{
|
||||
$File "hammer_launcher.rc"
|
||||
}
|
||||
|
||||
$Folder "Link Libraries"
|
||||
{
|
||||
$Lib "$SRCDIR\lib\public\appframework"
|
||||
$Lib "$SRCDIR\lib\common\Steam"
|
||||
}
|
||||
}
|
||||
13
hammer_launcher/hammer_launcher.vpc.vpc_cache
Normal file
13
hammer_launcher/hammer_launcher.vpc.vpc_cache
Normal file
@@ -0,0 +1,13 @@
|
||||
"vpc_cache"
|
||||
{
|
||||
"CacheVersion" "1"
|
||||
"win32"
|
||||
{
|
||||
"CRCFile" "hammer_launcher.vcxproj.vpc_crc"
|
||||
"OutputFiles"
|
||||
{
|
||||
"0" "hammer_launcher.vcxproj"
|
||||
"1" "hammer_launcher.vcxproj.filters"
|
||||
}
|
||||
}
|
||||
}
|
||||
233
hammer_launcher/main.cpp
Normal file
233
hammer_launcher/main.cpp
Normal file
@@ -0,0 +1,233 @@
|
||||
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose: Launcher for hammer, which is sitting in its own DLL
|
||||
//
|
||||
//===========================================================================//
|
||||
|
||||
#include <windows.h>
|
||||
#include <eh.h>
|
||||
#include "appframework/AppFramework.h"
|
||||
#include "ihammer.h"
|
||||
#include "tier0/dbg.h"
|
||||
#include "vstdlib/cvar.h"
|
||||
#include "filesystem.h"
|
||||
#include "materialsystem/imaterialsystem.h"
|
||||
#include "istudiorender.h"
|
||||
#include "filesystem_init.h"
|
||||
#include "datacache/idatacache.h"
|
||||
#include "datacache/imdlcache.h"
|
||||
#include "vphysics_interface.h"
|
||||
#include "vgui/ivgui.h"
|
||||
#include "vgui/isurface.h"
|
||||
#include "inputsystem/iinputsystem.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "SteamWriteMinidump.h"
|
||||
#include "p4lib/ip4.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Global systems
|
||||
//-----------------------------------------------------------------------------
|
||||
IHammer *g_pHammer;
|
||||
IFileSystem *g_pFileSystem;
|
||||
|
||||
extern "C" void WriteMiniDumpUsingExceptionInfo
|
||||
(
|
||||
unsigned int uStructuredExceptionCode,
|
||||
struct _EXCEPTION_POINTERS * pExceptionInfo
|
||||
)
|
||||
{
|
||||
// TODO: dynamically set the minidump comment from contextual info about the crash (i.e current VPROF node)?
|
||||
SteamWriteMiniDumpUsingExceptionInfoWithBuildId( uStructuredExceptionCode, pExceptionInfo, 0 );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The application object
|
||||
//-----------------------------------------------------------------------------
|
||||
class CHammerApp : public CAppSystemGroup
|
||||
{
|
||||
public:
|
||||
// Methods of IApplication
|
||||
virtual bool Create( );
|
||||
virtual bool PreInit( );
|
||||
virtual int Main( );
|
||||
virtual void PostShutdown();
|
||||
virtual void Destroy();
|
||||
|
||||
private:
|
||||
int MainLoop();
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the application object
|
||||
//-----------------------------------------------------------------------------
|
||||
CHammerApp g_ApplicationObject;
|
||||
DEFINE_WINDOWED_APPLICATION_OBJECT_GLOBALVAR( g_ApplicationObject );
|
||||
|
||||
static CSimpleWindowsLoggingListener s_SimpleWindowsLoggingListener;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Create all singleton systems
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CHammerApp::Create()
|
||||
{
|
||||
LoggingSystem_PushLoggingState();
|
||||
LoggingSystem_RegisterLoggingListener( &s_SimpleWindowsLoggingListener );
|
||||
|
||||
// Save some memory so engine/hammer isn't so painful
|
||||
CommandLine()->AppendParm( "-disallowhwmorph", NULL );
|
||||
|
||||
IAppSystem *pSystem;
|
||||
|
||||
// Add in the cvar factory
|
||||
AppModule_t cvarModule = LoadModule( VStdLib_GetICVarFactory() );
|
||||
pSystem = AddSystem( cvarModule, CVAR_INTERFACE_VERSION );
|
||||
if ( !pSystem )
|
||||
return false;
|
||||
|
||||
bool bSteam;
|
||||
char pFileSystemDLL[MAX_PATH];
|
||||
if ( FileSystem_GetFileSystemDLLName( pFileSystemDLL, MAX_PATH, bSteam ) != FS_OK )
|
||||
return false;
|
||||
|
||||
FileSystem_SetupSteamInstallPath();
|
||||
|
||||
AppModule_t fileSystemModule = LoadModule( pFileSystemDLL );
|
||||
g_pFileSystem = (IFileSystem*)AddSystem( fileSystemModule, FILESYSTEM_INTERFACE_VERSION );
|
||||
|
||||
AppSystemInfo_t appSystems[] =
|
||||
{
|
||||
{ "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION },
|
||||
{ "inputsystem.dll", INPUTSYSTEM_INTERFACE_VERSION },
|
||||
{ "studiorender.dll", STUDIO_RENDER_INTERFACE_VERSION },
|
||||
{ "vphysics.dll", VPHYSICS_INTERFACE_VERSION },
|
||||
{ "datacache.dll", DATACACHE_INTERFACE_VERSION },
|
||||
{ "datacache.dll", MDLCACHE_INTERFACE_VERSION },
|
||||
{ "datacache.dll", STUDIO_DATA_CACHE_INTERFACE_VERSION },
|
||||
{ "vguimatsurface.dll", VGUI_SURFACE_INTERFACE_VERSION },
|
||||
{ "vgui2.dll", VGUI_IVGUI_INTERFACE_VERSION },
|
||||
{ "p4lib.dll", P4_INTERFACE_VERSION },
|
||||
{ "hammer_dll.dll", INTERFACEVERSION_HAMMER },
|
||||
{ "", "" } // Required to terminate the list
|
||||
};
|
||||
|
||||
AppSystemInfo_t appSystemsNoP4[] =
|
||||
{
|
||||
{ "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION },
|
||||
{ "inputsystem.dll", INPUTSYSTEM_INTERFACE_VERSION },
|
||||
{ "studiorender.dll", STUDIO_RENDER_INTERFACE_VERSION },
|
||||
{ "vphysics.dll", VPHYSICS_INTERFACE_VERSION },
|
||||
{ "datacache.dll", DATACACHE_INTERFACE_VERSION },
|
||||
{ "datacache.dll", MDLCACHE_INTERFACE_VERSION },
|
||||
{ "datacache.dll", STUDIO_DATA_CACHE_INTERFACE_VERSION },
|
||||
{ "vguimatsurface.dll", VGUI_SURFACE_INTERFACE_VERSION },
|
||||
{ "vgui2.dll", VGUI_IVGUI_INTERFACE_VERSION },
|
||||
{ "hammer_dll.dll", INTERFACEVERSION_HAMMER },
|
||||
{ "", "" } // Required to terminate the list
|
||||
};
|
||||
|
||||
if ( !AddSystems( CommandLine()->FindParm( "-nop4" ) ? appSystemsNoP4 : appSystems ) )
|
||||
return false;
|
||||
|
||||
// Connect to interfaces loaded in AddSystems that we need locally
|
||||
g_pMaterialSystem = (IMaterialSystem*)FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION );
|
||||
g_pHammer = (IHammer*)FindSystem( INTERFACEVERSION_HAMMER );
|
||||
g_pDataCache = (IDataCache*)FindSystem( DATACACHE_INTERFACE_VERSION );
|
||||
g_pInputSystem = (IInputSystem*)FindSystem( INPUTSYSTEM_INTERFACE_VERSION );
|
||||
p4 = ( IP4 * )FindSystem( P4_INTERFACE_VERSION );
|
||||
|
||||
// This has to be done before connection.
|
||||
g_pMaterialSystem->SetShaderAPI( "shaderapidx9.dll" );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CHammerApp::Destroy()
|
||||
{
|
||||
LoggingSystem_PopLoggingState();
|
||||
|
||||
g_pFileSystem = NULL;
|
||||
g_pMaterialSystem = NULL;
|
||||
g_pDataCache = NULL;
|
||||
g_pHammer = NULL;
|
||||
g_pInputSystem = NULL;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Init, shutdown
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CHammerApp::PreInit( )
|
||||
{
|
||||
if ( !g_pHammer->InitSessionGameConfig( GetVProjectCmdLineValue() ) )
|
||||
return false;
|
||||
|
||||
bool bDone = false;
|
||||
do
|
||||
{
|
||||
CFSSteamSetupInfo steamInfo;
|
||||
steamInfo.m_pDirectoryName = g_pHammer->GetDefaultModFullPath();
|
||||
steamInfo.m_bOnlyUseDirectoryName = true;
|
||||
steamInfo.m_bToolsMode = true;
|
||||
steamInfo.m_bSetSteamDLLPath = true;
|
||||
steamInfo.m_bSteam = g_pFileSystem->IsSteam();
|
||||
if ( FileSystem_SetupSteamEnvironment( steamInfo ) != FS_OK )
|
||||
{
|
||||
MessageBox( NULL, "Failed to setup steam environment.", "Error", MB_OK );
|
||||
return false;
|
||||
}
|
||||
|
||||
CFSMountContentInfo fsInfo;
|
||||
fsInfo.m_pFileSystem = g_pFileSystem;
|
||||
fsInfo.m_bToolsMode = true;
|
||||
fsInfo.m_pDirectoryName = steamInfo.m_GameInfoPath;
|
||||
if ( !fsInfo.m_pDirectoryName )
|
||||
{
|
||||
Error( "FileSystem_LoadFileSystemModule: no -defaultgamedir or -game specified." );
|
||||
}
|
||||
|
||||
if ( FileSystem_MountContent( fsInfo ) == FS_OK )
|
||||
{
|
||||
bDone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
char str[512];
|
||||
Q_snprintf( str, sizeof( str ), "%s", FileSystem_GetLastErrorString() );
|
||||
MessageBox( NULL, str, "Warning", MB_OK );
|
||||
|
||||
if ( g_pHammer->RequestNewConfig() == REQUEST_QUIT )
|
||||
return false;
|
||||
}
|
||||
|
||||
FileSystem_AddSearchPath_Platform( fsInfo.m_pFileSystem, steamInfo.m_GameInfoPath );
|
||||
|
||||
} while (!bDone);
|
||||
|
||||
// Required to run through the editor
|
||||
g_pMaterialSystem->EnableEditorMaterials();
|
||||
|
||||
// needed for VGUI model rendering
|
||||
g_pMaterialSystem->SetAdapter( 0, MATERIAL_INIT_ALLOCATE_FULLSCREEN_TEXTURE );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CHammerApp::PostShutdown()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// main application
|
||||
//-----------------------------------------------------------------------------
|
||||
int CHammerApp::Main( )
|
||||
{
|
||||
return g_pHammer->MainLoop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
23
hammer_launcher/resource.h
Normal file
23
hammer_launcher/resource.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by hammer_launcher.rc
|
||||
//
|
||||
#define IDI_HAMMER_LAUNCHER 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user