bool CToolFrameworkClient::Init()
{
	factorylist_t list;
	FactoryList_Retrieve( list );

	m_pTools = ( IClientEngineTools * )list.appSystemFactory( VCLIENTENGINETOOLS_INTERFACE_VERSION, NULL );
	return ( m_pTools != NULL );
}
Пример #2
0
//-----------------------------------------------------------------------------
// Purpose: get the IVEngineServer, we need this for the PVS functions
//-----------------------------------------------------------------------------
bool CWorldLights::Init()
{
	factorylist_t factories;
	FactoryList_Retrieve(factories);
 
	if((g_pEngineServer = (IVEngineServer*)factories.appSystemFactory(INTERFACEVERSION_VENGINESERVER, NULL)) == NULL)
		return false;
 
	return true;
}
Пример #3
0
bool CToolFrameworkServer::Init()
{
	factorylist_t list;
	FactoryList_Retrieve( list );

	// Latch onto internal interface
	m_pTools = ( IServerEngineTools * )list.engineFactory( VSERVERENGINETOOLS_INTERFACE_VERSION, NULL );

	if ( !m_pTools && !engine->IsDedicatedServer() )
	{
		return false;
	}

	return true;
}
Пример #4
0
factorylist_t GetFactories()
{
	CSigScan::sigscan_dllfunc = Sys_GetFactory("server.dll");

	if(!CSigScan::GetDllMemInfo())
	{
		gLua->Error("Could not get access to factories.");
	}

	CSigScan sigscanFactories;
	sigscanFactories.Init((unsigned char *)"\x8B\x44\x24\x04\x8B\x0D\xC0\x33\x6D\x10\x8B\x15\xC4\x33\x6D\x10\x89\x08\x8B\x0D\xC8\x33\x6D\x10\x89\x50\x04\x89\x48\x08\xC3", "xxxxxx????xx????xxxx????xxxxxxx", 31);

	if(!sigscanFactories.is_set)
	{
		gLua->Error("Could not get access to factories.");
	}

	FactoryList_Retrieve = (void (*)(factorylist_t &))sigscanFactories.sig_addr;

	factorylist_t factories;
	FactoryList_Retrieve(factories);

	return factories;
}
Пример #5
0
bool ShaderEditorHandler::Init()
{
	factorylist_t factories;
	FactoryList_Retrieve( factories );

#ifdef SOURCE_2006
	ConVar *pCVarDev = cvar->FindVar( "developer" );
	bool bShowPrimDebug = pCVarDev != NULL && pCVarDev->GetInt() != 0;
#else
	ConVarRef devEnabled( "developer", true );
	bool bShowPrimDebug = devEnabled.GetInt() != 0;
#endif

	bool bCreateEditor = ( CommandLine() != NULL ) && ( CommandLine()->FindParm( "-shaderedit" ) != 0 );
	SEDIT_SKYMASK_MODE iEnableSkymask = SKYMASK_OFF;

#ifdef SHADEREDITOR_FORCE_ENABLED
	bCreateEditor = true;
	iEnableSkymask = SKYMASK_QUARTER;
#endif

	char modulePath[MAX_PATH*4];
#ifdef SWARM_DLL
	Q_snprintf( modulePath, sizeof( modulePath ), "%s/bin/shadereditor_swarm.dll\0", engine->GetGameDirectory() );
#elif SOURCE_2006
	Q_snprintf( modulePath, sizeof( modulePath ), "%s/bin/shadereditor_2006.dll\0", engine->GetGameDirectory() );
#elif SOURCE_2013
	Q_snprintf( modulePath, sizeof( modulePath ), "%s/bin/shadereditor_2013.dll\0", engine->GetGameDirectory() );
#else
	Q_snprintf( modulePath, sizeof( modulePath ), "%s/bin/shadereditor_2007.dll\0", engine->GetGameDirectory() );
#endif
	shaderEditorModule = Sys_LoadModule( modulePath );
	if ( shaderEditorModule )
	{
		CreateInterfaceFn shaderEditorDLLFactory = Sys_GetFactory( shaderEditorModule );
		shaderEdit = shaderEditorDLLFactory ? ((IVShaderEditor *) shaderEditorDLLFactory( SHADEREDIT_INTERFACE_VERSION, NULL )) : NULL;

		if ( !shaderEdit )
		{
			Warning( "Unable to pull IVShaderEditor interface.\n" );
		}
		else if ( !shaderEdit->Init( factories.appSystemFactory, gpGlobals, sEditMRender,
				bCreateEditor, bShowPrimDebug, iEnableSkymask ) )
		{
			Warning( "Cannot initialize IVShaderEditor.\n" );
			shaderEdit = NULL;
		}
	}
	else
	{
		Warning( "Cannot load shadereditor.dll from %s!\n", modulePath );
	}

	m_bReady = shaderEdit != NULL;

	RegisterCallbacks();
	RegisterViewRenderCallbacks();

	if ( IsReady() )
	{
		shaderEdit->PrecacheData();
	}

	return true;
}