IACSystem *IACFile::FindSystem(GeoPoint &pos, double deviation) { IACSystem *pIACSystem = NULL; pIACSystem = FindSystem((IACSystems &)m_pressure, pos, deviation); if (NULL == pIACSystem) { pIACSystem = FindSystem((IACSystems &)m_frontal, pos, deviation); if (NULL == pIACSystem) { pIACSystem = FindSystem((IACSystems &)m_tropical, pos, deviation); } } return pIACSystem; }
//----------------------------------------------------------------------------- // Create the application object //----------------------------------------------------------------------------- bool CIHVTestApp::Create() { AppSystemInfo_t appSystems[] = { { "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION }, { "datacache.dll", DATACACHE_INTERFACE_VERSION }, { "studiorender.dll", STUDIO_RENDER_INTERFACE_VERSION }, { "datacache.dll", MDLCACHE_INTERFACE_VERSION }, { "vphysics.dll", VPHYSICS_INTERFACE_VERSION }, { "", "" } // Required to terminate the list }; MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f ); if ( !AddSystems( appSystems ) ) return false; g_pFileSystem = ( IFileSystem * )FindSystem( FILESYSTEM_INTERFACE_VERSION ); g_pMaterialSystem = (IMaterialSystem*)FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION ); g_pStudioRender = (IStudioRender*)FindSystem( STUDIO_RENDER_INTERFACE_VERSION ); g_pMDLCache = (IMDLCache*)FindSystem( MDLCACHE_INTERFACE_VERSION ); if ( !g_pFileSystem || !g_pMaterialSystem || !g_pStudioRender || !g_pMDLCache ) { DisplayError( "Unable to load required library interfaces!" ); return false; } #if defined( _X360 ) // vxconsole - true will block (legacy behavior) XBX_InitConsoleMonitor( false ); #endif const char* pDLLName; if ( CommandLine()->CheckParm( "-null" ) ) { g_bUseEmptyShader = true; pDLLName = "shaderapiempty.dll"; } else { pDLLName = "shaderapidx9.dll"; } #if defined( _X360 ) g_pFileSystem->LoadModule( pDLLName ); #endif g_pMaterialSystem->SetShaderAPI( pDLLName ); return true; }
//----------------------------------------------------------------------------- // The application object //----------------------------------------------------------------------------- bool CSFMGenApp::Create() { SpewOutputFunc( SpewStdout ); AppSystemInfo_t appSystems[] = { { "vstdlib.dll", PROCESS_UTILS_INTERFACE_VERSION }, { "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION }, { "p4lib.dll", P4_INTERFACE_VERSION }, { "datacache.dll", DATACACHE_INTERFACE_VERSION }, { "datacache.dll", MDLCACHE_INTERFACE_VERSION }, { "studiorender.dll", STUDIO_RENDER_INTERFACE_VERSION }, { "vphysics.dll", VPHYSICS_INTERFACE_VERSION }, { "soundemittersystem.dll", SOUNDEMITTERSYSTEM_INTERFACE_VERSION }, { "", "" } // Required to terminate the list }; AddSystems( appSystems ); IMaterialSystem *pMaterialSystem = reinterpret_cast< IMaterialSystem * >( FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION ) ); if ( !pMaterialSystem ) { Error( "// ERROR: Unable to connect to material system interface!\n" ); return false; } pMaterialSystem->SetShaderAPI( "shaderapiempty.dll" ); SetupDefaultFlexController(); return true; }
//----------------------------------------------------------------------------- // Create all singleton systems //----------------------------------------------------------------------------- bool CMaterialSystemTestApp::Create() { SpewOutputFunc( SpewFunc ); AppSystemInfo_t appSystems[] = { { "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION }, // Required to terminate the list { "", "" } }; if ( !AddSystems( appSystems ) ) return false; IMaterialSystem *pMaterialSystem = (IMaterialSystem*)FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION ); if ( !pMaterialSystem ) { Warning( "CMaterialSystemTestApp::Create: Unable to connect to necessary interface!\n" ); return false; } bool bIsVistaOrHigher = false; OSVERSIONINFO info; info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if ( GetVersionEx( &info ) ) { bIsVistaOrHigher = info.dwMajorVersion >= 6; } const char *pShaderDLL = CommandLine()->ParmValue( "-shaderdll" ); if ( !pShaderDLL ) { pShaderDLL = "shaderapidx10.dll"; } if ( !bIsVistaOrHigher && !Q_stricmp( pShaderDLL, "shaderapidx10.dll" ) ) { pShaderDLL = "shaderapidx9.dll"; } pMaterialSystem->SetShaderAPI( pShaderDLL ); return true; }
//----------------------------------------------------------------------------- // The application object //----------------------------------------------------------------------------- bool CDmxEditApp::Create() { SpewOutputFunc( SpewStdout ); AppSystemInfo_t appSystems[] = { { "vstdlib.dll", PROCESS_UTILS_INTERFACE_VERSION }, { "materialsystem.dll", MATERIAL_SYSTEM_INTERFACE_VERSION }, { "p4lib.dll", P4_INTERFACE_VERSION }, { "", "" } // Required to terminate the list }; AddSystems( appSystems ); IMaterialSystem *pMaterialSystem = reinterpret_cast< IMaterialSystem * >( FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION ) ); if ( !pMaterialSystem ) { Error( "// ERROR: Unable to connect to material system interface!\n" ); return false; } pMaterialSystem->SetShaderAPI( "shaderapiempty.dll" ); return true; }
//----------------------------------------------------------------------------- // Create all singleton systems //----------------------------------------------------------------------------- bool CHLModelViewerApp::Create() { SpewOutputFunc( HLMVSpewFunc ); g_dxlevel = CommandLine()->ParmValue( "-dx", 0 ); g_bOldFileDialogs = ( CommandLine()->FindParm( "-olddialogs" ) != 0 ); AppSystemInfo_t appSystems[] = { { "materialsystem.dll", MATERIAL_SYSTEM_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 }, { "soundemittersystem.dll", SOUNDEMITTERSYSTEM_INTERFACE_VERSION }, { "soundsystem.dll", SOUNDSYSTEM_INTERFACE_VERSION }, { "", "" } // Required to terminate the list }; if ( !AddSystems( appSystems ) ) return false; g_pFileSystem = (IFileSystem*)FindSystem( FILESYSTEM_INTERFACE_VERSION ); g_pMaterialSystem = (IMaterialSystem*)FindSystem( MATERIAL_SYSTEM_INTERFACE_VERSION ); g_pMaterialSystemHardwareConfig = (IMaterialSystemHardwareConfig*)FindSystem( MATERIALSYSTEM_HARDWARECONFIG_INTERFACE_VERSION ); g_pStudioRender = (IStudioRender*)FindSystem( STUDIO_RENDER_INTERFACE_VERSION ); g_pDataCache = (IDataCache*)FindSystem( DATACACHE_INTERFACE_VERSION ); g_pMDLCache = (IMDLCache*)FindSystem( MDLCACHE_INTERFACE_VERSION ); g_pStudioDataCache = (IStudioDataCache*)FindSystem( STUDIO_DATA_CACHE_INTERFACE_VERSION ); physcollision = (IPhysicsCollision *)FindSystem( VPHYSICS_COLLISION_INTERFACE_VERSION ); physprop = (IPhysicsSurfaceProps *)FindSystem( VPHYSICS_SURFACEPROPS_INTERFACE_VERSION ); g_pSoundEmitterBase = (ISoundEmitterSystemBase *)FindSystem( SOUNDEMITTERSYSTEM_INTERFACE_VERSION ); g_pSoundSystem = (ISoundSystem *)FindSystem( SOUNDSYSTEM_INTERFACE_VERSION ); if ( !g_pFileSystem || !physprop || !physcollision || !g_pMaterialSystem || !g_pStudioRender || !g_pMDLCache || !g_pDataCache ) { Error("Unable to load required library interface!\n"); } const char *pShaderDLL = CommandLine()->ParmValue("-shaderdll"); if(!pShaderDLL) { pShaderDLL = "shaderapidx9.dll"; } g_pMaterialSystem->SetShaderAPI( pShaderDLL ); g_Factory = GetFactory(); return true; }