Exemple #1
0
//Hlavni nacitaci funkce. Pri nezdaru vrati false a program nebude pokracovat
bool DataStore::LoadEFCDS()
{
    bool success = true;

    success = LoadTextureData() && LoadModelData() && LoadSkyboxData();

    return success;
}
Exemple #2
0
void Storage::Load()
{
    LoadMapData();
    LoadTextureData();
    LoadModelData();
    LoadSkyboxData();

    PrepareDynamicStorages();
}
Exemple #3
0
void ImportMaterialData (MaterialData* data, const MaterialInfo& info) {
	static auto loadDataIfFilenameIsValid = [](const std::string& directory, const std::string& filename) {
		if (filename == "") return TextureData { };
		return LoadTextureData(directory + filename);
	};

	data->diffuseData = loadDataIfFilenameIsValid(info.directory,  info.diffuseTextureFilename);
	data->normalData = loadDataIfFilenameIsValid(info.directory, info.normalTextureFilename);
	data->specularData = loadDataIfFilenameIsValid(info.directory, info.specularTextureFilename);
}
bool DxStdMtl2::CreateAndLoadEffectData()
{
	ResetDXStates();

	if(IsDxMaterialEnabled(map))
	{
		bool useLPRT;
		TCHAR filename[MAX_PATH];
		_tcscpy(filename,GetCOREInterface()->GetDir(APP_PLUGCFG_DIR));
		_tcscat(filename,"\\DXDisplay.ini");

		useLPRT = GetPrivateProfileInt(_T("Settings"),_T("LPRTEnabled"),0,filename) ? true : false;
			
		if(!pd3dDevice)
			pd3dDevice = GetDevice();

		if(!pd3dDevice)
			return false;

		if(pEffectParser)
		{
			pEffectParser->DestroyParser();
			pEffectParser = NULL;
		}

		elementContainer.DeleteAllElements();

		UpdateSceneLights();
		DWORD numberOfPSinst = 0;
		
		//lets make sure we get the correct code for the GFX card..
		IHLSLCodeGenerator::CodeVersion code = GetPixelShaderSupport(pd3dDevice,numberOfPSinst);

		if(code == IHLSLCodeGenerator::PS_1_X)
			return false;

		IHLSLCodeGenerator * codeGen = IHLSLCodeGenerator::GetHLSLCodeGenerator();

		Tab<INode*> lights;
		for(int j=0;j<sceneLights.Count();j++){
			INode * Light = sceneLights[j]->GetLightNode();
			lights.Append(1, &Light);
		}

		TCHAR * effectString = codeGen->GenerateEffectFile(map,lights,code,bTransparency,numberOfPSinst,useLPRT);

		if(!pEffectParser)
			CreateEffectParser();
		if(pEffectParser && effectString){
			pEffectParser->SetUseLPRT(useLPRT);
			pEffectParser->LoadEffect(pd3dDevice,this,effectString,false,true);
			pEffectParser->ParseEffectFile(pd3dDevice,NULL,this);
			PatchInLightNodes();
			LoadTextureData(codeGen);
		}
		delete codeGen;

		IRenderMesh * rm = mpMeshCache->GetActiveRenderMesh(m_CurCache);
		if(rm) rm->Invalidate();

		GetCOREInterface()->ForceCompleteRedraw(FALSE);

	}

	return true;
}