示例#1
0
void AppGUI::Initialise(const std::vector<std::string>& engineNames,
                               int selectedEngine)
{
    m_scene.SetPostMap(m_selectedMap);
    m_engineAmount = engineNames.size();

    m_cache->PostMapSelected.Set(m_selectedMap);
    m_cache->EngineSelected.Set(selectedEngine);

    m_cache->Engines.Set(engineNames);
    m_cache->Lights.Set(GetLightNames());
    m_cache->Meshes.Set(GetMeshNames());
    m_cache->Shaders.Set(GetShaderNames());
    m_cache->PostMaps.Set(GetPostMapNames());
    m_cache->Waters.Set(GetWaterNames());
    m_cache->Emitters.Set(GetEmitterNames());
    m_cache->Textures.Set(GetTextureNames());
    m_cache->Terrains.Set(GetTerrainNames());

    m_cache->Camera[CAMERA_FORWARD_SPD].SetUpdated(
        m_camera.GetForwardSpeed());

    m_cache->Camera[CAMERA_ROTATION_SPD].SetUpdated(
        m_camera.GetRotationSpeed());

    m_cache->Post[POST_CAUSTIC_SPEED].SetUpdated(
        m_data.caustics->GetSpeed());

    m_data.post->Write(*m_cache);
}
示例#2
0
bool CStaticMesh::Reload()
{
	ClearTextures();
	Unload();
	
	FILE* modelFile = NULL;

	fopen_s(&modelFile, m_FileName.c_str(), "rb");
	
	if(modelFile == NULL)
	{
		return false;
	}

	uint16 tmp = 0;

	//Read Header
	fread(&tmp, sizeof(uint16), 1, modelFile);

	if(tmp != 0xCACA)
	{
		//header was not present, file type not valid
		fclose(modelFile);
		return false;
	}
		
	//Extract Mesh from File
	if(!ExtractMesh(modelFile))
	{
		ClearTextures();
		Unload();
		fclose(modelFile);
		return false;
	}

	//Extract Bounding Box and Sphere from File
	if(!GetBoundingBoxAndSphere(modelFile))
	{
		ClearTextures();
		Unload();
		fclose(modelFile);
		return false;
	}

	fclose(modelFile);

	if(!GetRenderableObjectTechnique())
	{
		ClearTextures();
		Unload();
		return false;
	}

	GetTextureNames();

	return true;
}