From 9d6f36bf59647e2e5399fb0df7b34a16ffd32221 Mon Sep 17 00:00:00 2001 From: turanszkij Date: Sun, 29 May 2016 16:33:48 +0200 Subject: [PATCH] material cleanup --- WickedEngine/wiLoader.cpp | 10 ---------- WickedEngine/wiLoader.h | 21 +++++---------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/WickedEngine/wiLoader.cpp b/WickedEngine/wiLoader.cpp index 13f70e08a..5e42db714 100644 --- a/WickedEngine/wiLoader.cpp +++ b/WickedEngine/wiLoader.cpp @@ -190,8 +190,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st currentMat->refMapName=ss.str(); currentMat->refMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str()); } - if(currentMat->refMap!=0) - currentMat->hasRefMap = true; break; case 'n': { @@ -202,8 +200,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st currentMat->normalMapName=ss.str(); currentMat->normalMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str()); } - if(currentMat->normalMap!=0) - currentMat->hasNormalMap = true; break; case 't': { @@ -214,8 +210,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st currentMat->textureName=ss.str(); currentMat->texture = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str()); } - if(currentMat->texture!=0) - currentMat->hasTexture=true; file>>currentMat->premultipliedTexture; break; case 'D': @@ -227,8 +221,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st currentMat->displacementMapName=ss.str(); currentMat->displacementMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str()); } - if(currentMat->displacementMap!=0) - currentMat->hasDisplacementMap=true; break; case 'S': { @@ -239,8 +231,6 @@ void LoadWiMaterialLibrary(const string& directory, const string& name, const st currentMat->specularMapName=ss.str(); currentMat->specularMap = (Texture2D*)wiResourceManager::GetGlobal()->add(ss.str()); } - if(currentMat->specularMap!=0) - currentMat->hasSpecularMap=true; break; case 'a': file>>currentMat->alpha; diff --git a/WickedEngine/wiLoader.h b/WickedEngine/wiLoader.h index 55ccc684f..c0355e8ff 100644 --- a/WickedEngine/wiLoader.h +++ b/WickedEngine/wiLoader.h @@ -98,25 +98,20 @@ struct Material string name; XMFLOAT3 diffuseColor; - bool hasRefMap; string refMapName; wiGraphicsTypes::Texture2D* refMap; - bool hasTexture; string textureName; wiGraphicsTypes::Texture2D* texture; bool premultipliedTexture; BLENDMODE blendFlag; - bool hasNormalMap; string normalMapName; wiGraphicsTypes::Texture2D* normalMap; - bool hasDisplacementMap; string displacementMapName; wiGraphicsTypes::Texture2D* displacementMap; - bool hasSpecularMap; string specularMapName; wiGraphicsTypes::Texture2D* specularMap; @@ -144,28 +139,22 @@ struct Material name=newName; diffuseColor = XMFLOAT3(1,1,1); - hasRefMap=false; refMapName=""; - refMap=0; + refMap = nullptr; - hasTexture=false; textureName=""; - texture=0; + texture = nullptr; premultipliedTexture=false; blendFlag=BLENDMODE::BLENDMODE_ALPHA; - hasNormalMap=false; normalMapName=""; - normalMap=0; + normalMap = nullptr; - hasDisplacementMap=false; displacementMapName=""; - displacementMap=0; + displacementMap = nullptr; - - hasSpecularMap=false; specularMapName=""; - specularMap=0; + specularMap = nullptr; subsurface_scattering=toonshading=water=false; alpha=1.0f;