Exemplo n.º 1
0
//-----------------------------------------------------------------------------
// Pre-init
//-----------------------------------------------------------------------------
bool CVConfigApp::PreInit()
{
	if ( !BaseClass::PreInit() )
		return false;

	// Create a window to capture messages
	CreateMessageWindow();

	// Make sure we're using the proper environment variable
	ConvertObsoleteVConfigRegistrySetting( GAMEDIR_TOKEN );

	FileSystem_SetErrorMode( FS_ERRORMODE_AUTO );

	// We only want to use the gameinfo.txt that is in the bin\vconfig directory.
	char dirName[MAX_PATH];
	Q_strncpy( dirName, GetBaseDirectory(), sizeof( dirName ) );
	Q_AppendSlash( dirName, sizeof( dirName ) );
	Q_strncat( dirName, "vconfig", sizeof( dirName ), COPY_ALL_CHARACTERS );

	if ( !SetupSearchPaths( dirName, true, true ) )
	{
		::MessageBox( NULL, "Error", "Unable to initialize file system\n", MB_OK );
		return false;
	}

	// Load our configs
	if ( g_ConfigManager.LoadConfigs() == false )
	{
		::MessageBox( NULL, "Error", "Unable to load configuration file\n", MB_OK );
		return false;
	}

	// Parse them for internal use
	if ( ParseConfigs() == false )
	{
		::MessageBox( NULL, "Error", "Unable to parse configuration file\n", MB_OK );
		return false;
	}

	// Start looking for file updates
	UpdateConfigsStatus_Init();

	// the "base dir" so we can scan mod name
	g_pFullFileSystem->AddSearchPath( GetBaseDirectory(), VCONFIG_MAIN_PATH_ID );	

	// the main platform dir
	g_pFullFileSystem->AddSearchPath( "platform","PLATFORM", PATH_ADD_TO_HEAD );

	return true;
}
Exemplo n.º 2
0
//-----------------------------------------------------------------------------
// Create necessary interfaces
//-----------------------------------------------------------------------------
bool CSteamApplication::Create()
{
	FileSystem_SetErrorMode( FS_ERRORMODE_AUTO );

	char pFileSystemDLL[MAX_PATH];
	if ( FileSystem_GetFileSystemDLLName( pFileSystemDLL, MAX_PATH, m_bSteam ) != FS_OK )
		return false;
	
	FileSystem_SetupSteamInstallPath();

	// Add in the cvar factory
	AppModule_t cvarModule = LoadModule( VStdLib_GetICVarFactory() );
	AddSystem( cvarModule, CVAR_INTERFACE_VERSION );

	AppModule_t fileSystemModule = LoadModule( pFileSystemDLL );
	m_pFileSystem = (IFileSystem*)AddSystem( fileSystemModule, FILESYSTEM_INTERFACE_VERSION );
	if ( !m_pFileSystem )
	{
		Error( "Unable to load %s", pFileSystemDLL );
		return false;
	}

	return true;
}