Ну как бы я после этого
code: int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physicsFactory, CGlobalVarsBase *pGlobals )
{
InitCRTMemDebug();
MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f );
// Hook up global variables
gpGlobals = pGlobals;
ConnectTier1Libraries( &appSystemFactory, 1 );
ConnectTier2Libraries( &appSystemFactory, 1 );
ConnectTier3Libraries( &appSystemFactory, 1 );
g_SteamAPIContext.Init();
// We aren't happy unless we get all of our interfaces.
// please don't collapse this into one monolithic boolean expression (impossible to debug)
if ( (engine = (IVEngineClient *)appSystemFactory( VENGINE_CLIENT_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (modelrender = (IVModelRender *)appSystemFactory( VENGINE_HUDMODEL_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (effects = (IVEfx *)appSystemFactory( VENGINE_EFFECTS_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (enginetrace = (IEngineTrace *)appSystemFactory( INTERFACEVERSION_ENGINETRACE_CLIENT, NULL )) == NULL )
return false;
if ( (render = (IVRenderView *)appSystemFactory( VENGINE_RENDERVIEW_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (debugoverlay = (IVDebugOverlay *)appSystemFactory( VDEBUG_OVERLAY_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (datacache = (IDataCache*)appSystemFactory(DATACACHE_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( !mdlcache )
return false;
if ( (modelinfo = (IVModelInfoClient *)appSystemFactory(VMODELINFO_CLIENT_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( (enginevgui = (IEngineVGui *)appSystemFactory(VENGINE_VGUI_VERSION, NULL )) == NULL )
return false;
if ( (networkstringtable = (INetworkStringTableContainer *)appSystemFactory(INTERFACENAME_NETWORKSTRINGTABLECLIENT,NULL)) == NULL )
return false;
if ( (partition = (ISpatialPartition *)appSystemFactory(INTERFACEVERSION_SPATIALPARTITION, NULL)) == NULL )
return false;
if ( (shadowmgr = (IShadowMgr *)appSystemFactory(ENGINE_SHADOWMGR_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (staticpropmgr = (IStaticPropMgrClient *)appSystemFactory(INTERFACEVERSION_STATICPROPMGR_CLIENT, NULL)) == NULL )
return false;
if ( (enginesound = (IEngineSound *)appSystemFactory(IENGINESOUND_CLIENT_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (filesystem = (IFileSystem *)appSystemFactory(FILESYSTEM_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (random = (IUniformRandomStream *)appSystemFactory(VENGINE_CLIENT_RANDOM_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (gameuifuncs = (IGameUIFuncs * )appSystemFactory( VENGINE_GAMEUIFUNCS_VERSION, NULL )) == NULL )
return false;
if ( (gameeventmanager = (IGameEventManager2 *)appSystemFactory(INTERFACEVERSION_GAMEEVENTSMANAGER2,NULL)) == NULL )
return false;
if ( (soundemitterbase = (ISoundEmitterSystemBase *)appSystemFactory(SOUNDEMITTERSYSTEM_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (inputsystem = (IInputSystem *)appSystemFactory(INPUTSYSTEM_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( IsPC() && (avi = (IAvi *)appSystemFactory(AVI_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (bik = (IBik *)appSystemFactory(BIK_INTERFACE_VERSION, NULL)) == NULL )
return false;
if ( (scenefilecache = (ISceneFileCache *)appSystemFactory( SCENE_FILE_CACHE_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( IsX360() && (xboxsystem = (IXboxSystem *)appSystemFactory( XBOXSYSTEM_INTERFACE_VERSION, NULL )) == NULL )
return false;
if ( IsX360() && (matchmaking = (IMatchmaking *)appSystemFactory( VENGINE_MATCHMAKING_VERSION, NULL )) == NULL )
return false;
#ifndef _XBOX
if ( ( gamestatsuploader = (IUploadGameStats *)appSystemFactory( INTERFACEVERSION_UPLOADGAMESTATS, NULL )) == NULL )
return false;
#endif
if (!g_pMatSystemSurface)
return false;
factorylist_t factories;
factories.appSystemFactory = appSystemFactory;
factories.physicsFactory = physicsFactory;
FactoryList_Store( factories );
// Yes, both the client and game .dlls will try to Connect, the soundemittersystem.dll will handle this gracefully
if ( !soundemitterbase->Connect( appSystemFactory ) )
{
return false;
}
if ( CommandLine()->FindParm( "-textmode" ) )
g_bTextMode = true;
if ( CommandLine()->FindParm( "-makedevshots" ) )
g_MakingDevShots = true;
// Not fatal if the material system stub isn't around.
materials_stub = (IMaterialSystemStub*)appSystemFactory( MATERIAL_SYSTEM_STUB_INTERFACE_VERSION, NULL );
if( !g_pMaterialSystemHardwareConfig )
return false;
// Hook up the gaussian random number generator
s_GaussianRandomStream.AttachToStream( random );
// Initialize the console variables.
ConVar_Register( FCVAR_CLIENTDLL );
g_pcv_ThreadMode = g_pCVar->FindVar( "host_thread_mode" );
if (!Initializer::InitializeAllObjects())
return false;
if (!ParticleMgr()->Init(MAX_TOTAL_PARTICLES, materials))
return false;
if (!VGui_Startup( appSystemFactory ))
return false;
vgui::VGui_InitMatSysInterfacesList( "ClientDLL", &appSystemFactory, 1 );
// Add the client systems.
// Client Leaf System has to be initialized first, since DetailObjectSystem uses it
IGameSystem::Add( GameStringSystem() );
IGameSystem::Add( SoundEmitterSystem() );
IGameSystem::Add( ToolFrameworkClientSystem() );
IGameSystem::Add( ClientLeafSystem() );
IGameSystem::Add( DetailObjectSystem() );
IGameSystem::Add( ViewportClientSystem() );
IGameSystem::Add( ClientEffectPrecacheSystem() );
IGameSystem::Add( g_pClientShadowMgr );
IGameSystem::Add( g_pColorCorrectionMgr ); // NOTE: This must happen prior to ClientThinkList (color correction is updated there)
IGameSystem::Add( ClientThinkList() );
IGameSystem::Add( ClientSoundscapeSystem() );
IGameSystem::Add( PerfVisualBenchmark() );
#if defined( CLIENT_DLL ) && defined( COPY_CHECK_STRESSTEST )
IGameSystem::Add( GetPredictionCopyTester() );
#endif
modemanager->Init( );
g_pClientMode->InitViewport();
gHUD.Init();
g_pClientMode->Init();
if ( !IGameSystem::InitAllSystems() )
return false;
g_pClientMode->Enable();
if ( !view )
{
view = ( IViewRender * )&g_DefaultViewRender;
}
view->Init();
vieweffects->Init();
C_BaseTempEntity::PrecacheTempEnts();
input->Init_All();
VGui_CreateGlobalPanels();
InitSmokeFogOverlay();
// Register user messages..
CUserMessageRegister::RegisterAll();
ClientVoiceMgr_Init();
// Embed voice status icons inside chat element
{
vgui::VPANEL parent = enginevgui->GetPanel( PANEL_CLIENTDLL );
GetClientVoiceMgr()->Init( &g_VoiceStatusHelper, parent );
}
if ( !PhysicsDLLInit( physicsFactory ) )
return false;
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetEntitySaveRestoreBlockHandler() );
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetPhysSaveRestoreBlockHandler() );
g_pGameSaveRestoreBlockSet->AddBlockHandler( GetViewEffectsRestoreBlockHandler() );
ClientWorldFactoryInit();
C_BaseAnimating::InitBoneSetupThreadPool();
return true;
}
Пишу это
code:KeyValues *pkvMount = new KeyValues( "addmount" );
if ( pkvMount->LoadFromFile( filesystem, "scripts/addmount.txt" ) );
{
while ( pkvMount )
{
const char *pszMountName = pkvMount->GetName();
KeyValues *pkvSearchPath = pkvMount->FindKey( "searchpath" );
KeyValues *pkvAppID = pkvMount->FindKey( "appid" );
if ( pszMountName && pkvSearchPath && pkvAppID )
{
const char *pszMountPath = pkvSearch->GetString();
int nMountID = pkvAppID->GetInt();
filesystem->AddSearchPath( pszMounthPath, "GAME" );
filesystem->MountSteamContent( nMountID );
}
pkvMount = pkvMount->GetNextKey();
}
}
Она ругаеться на первый if и после if {