Ejemplo n.º 1
0
bool TC_Shutdown(void)
{
	c_num_textures=0;
	FreeAllTextures();
		
	return FALSE;
}
//-----------------------------------------------------------------------------
// Purpose: Loads textures from all texture files.
//-----------------------------------------------------------------------------
void CTextureSystem::LoadAllGraphicsFiles(void)
{
	FreeAllTextures();

	// For each game config...
	// dvs: Disabled for single-config running.
	//for (int nConfig = 0; nConfig < Options.configs.GetGameConfigCount(); nConfig++)
	{
		//CGameConfig *pConfig = Options.configs.GetGameConfig(nConfig);
		CGameConfig *pConfig = g_pGameConfig;

		// Create a new texture context with the WADs and materials for that config.
		TextureContext_t *pContext = AddTextureContext();

		// Bind it to this config.
		pContext->pConfig = pConfig;

		// Create a group to hold all the textures for this context.
		pContext->pAllGroup = new CTextureGroup("All Textures");
		pContext->Groups.AddToTail(pContext->pAllGroup);

		HammerFileSystem_SetGame(pConfig->m_szGameExeDir, pConfig->m_szModDir);

		// Set the new context as the active context.
		m_pActiveContext = pContext;

		// Load the textures for all WAD files set in this config.
		// Only do this for configs that use WAD textures.
		if (pConfig->GetTextureFormat() == tfWAD3)
		{
			LoadWADFiles(pConfig);
		}

		// Load the materials for this config.
		// Do this unconditionally so that we get necessary editor materials.
		LoadMaterials(pConfig);

		m_pActiveContext->pAllGroup->Sort();
	}
}
Ejemplo n.º 3
0
TextureManager::~TextureManager()
{
    FreeAllTextures( true );
}
//-----------------------------------------------------------------------------
// Purpose: Shuts down the texture system.
//-----------------------------------------------------------------------------
void CTextureSystem::ShutDown(void)
{
	CWADTexture::ShutDown();
	CMaterial::ShutDown();
	FreeAllTextures();
}