Browse Source

Fixed D3D9 build.

reattiva 9 years ago
parent
commit
e253afe756
2 changed files with 14 additions and 0 deletions
  1. 10 0
      Source/Urho3D/Graphics/Material.cpp
  2. 4 0
      Source/Urho3D/Graphics/View.cpp

+ 10 - 0
Source/Urho3D/Graphics/Material.cpp

@@ -132,8 +132,10 @@ StringHash ParseTextureTypeName(String name)
         return TextureCube::GetTypeStatic();
         return TextureCube::GetTypeStatic();
     else if (name == "texture3d")
     else if (name == "texture3d")
         return Texture3D::GetTypeStatic();
         return Texture3D::GetTypeStatic();
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
     else if (name == "texturearray")
     else if (name == "texturearray")
         return Texture2DArray::GetTypeStatic();
         return Texture2DArray::GetTypeStatic();
+#endif
 
 
     return 0;
     return 0;
 }
 }
@@ -322,8 +324,10 @@ bool Material::BeginLoadXML(Deserializer& source)
 
 
                     if (type == Texture3D::GetTypeStatic())
                     if (type == Texture3D::GetTypeStatic())
                         cache->BackgroundLoadResource<Texture3D>(name, true, this);
                         cache->BackgroundLoadResource<Texture3D>(name, true, this);
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
                     else if (type == Texture2DArray::GetTypeStatic())
                     else if (type == Texture2DArray::GetTypeStatic())
                         cache->BackgroundLoadResource<Texture2DArray>(name, true, this);
                         cache->BackgroundLoadResource<Texture2DArray>(name, true, this);
+#endif
                     else
                     else
 #endif
 #endif
                         cache->BackgroundLoadResource<TextureCube>(name, true, this);
                         cache->BackgroundLoadResource<TextureCube>(name, true, this);
@@ -383,8 +387,10 @@ bool Material::BeginLoadJSON(Deserializer& source)
 
 
                     if (type == Texture3D::GetTypeStatic())
                     if (type == Texture3D::GetTypeStatic())
                         cache->BackgroundLoadResource<Texture3D>(name, true, this);
                         cache->BackgroundLoadResource<Texture3D>(name, true, this);
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
                     else if (type == Texture2DArray::GetTypeStatic())
                     else if (type == Texture2DArray::GetTypeStatic())
                         cache->BackgroundLoadResource<Texture2DArray>(name, true, this);
                         cache->BackgroundLoadResource<Texture2DArray>(name, true, this);
+#endif
                     else
                     else
 #endif
 #endif
                         cache->BackgroundLoadResource<TextureCube>(name, true, this);
                         cache->BackgroundLoadResource<TextureCube>(name, true, this);
@@ -463,8 +469,10 @@ bool Material::Load(const XMLElement& source)
 
 
                 if (type == Texture3D::GetTypeStatic())
                 if (type == Texture3D::GetTypeStatic())
                     SetTexture(unit, cache->GetResource<Texture3D>(name));
                     SetTexture(unit, cache->GetResource<Texture3D>(name));
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
                 else if (type == Texture2DArray::GetTypeStatic())
                 else if (type == Texture2DArray::GetTypeStatic())
                     SetTexture(unit, cache->GetResource<Texture2DArray>(name));
                     SetTexture(unit, cache->GetResource<Texture2DArray>(name));
+#endif
                 else
                 else
 #endif
 #endif
                     SetTexture(unit, cache->GetResource<TextureCube>(name));
                     SetTexture(unit, cache->GetResource<TextureCube>(name));
@@ -601,8 +609,10 @@ bool Material::Load(const JSONValue& source)
 
 
                 if (type == Texture3D::GetTypeStatic())
                 if (type == Texture3D::GetTypeStatic())
                     SetTexture(unit, cache->GetResource<Texture3D>(textureName));
                     SetTexture(unit, cache->GetResource<Texture3D>(textureName));
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
                 else if (type == Texture2DArray::GetTypeStatic())
                 else if (type == Texture2DArray::GetTypeStatic())
                     SetTexture(unit, cache->GetResource<Texture2DArray>(textureName));
                     SetTexture(unit, cache->GetResource<Texture2DArray>(textureName));
+#endif
                 else
                 else
 #endif
 #endif
                     SetTexture(unit, cache->GetResource<TextureCube>(textureName));
                     SetTexture(unit, cache->GetResource<TextureCube>(textureName));

+ 4 - 0
Source/Urho3D/Graphics/View.cpp

@@ -3067,8 +3067,10 @@ Texture* View::FindNamedTexture(const String& name, bool isRenderTarget, bool is
         texture = cache->GetExistingResource<TextureCube>(name);
         texture = cache->GetExistingResource<TextureCube>(name);
     if (!texture)
     if (!texture)
         texture = cache->GetExistingResource<Texture3D>(name);
         texture = cache->GetExistingResource<Texture3D>(name);
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
     if (!texture)
     if (!texture)
         texture = cache->GetExistingResource<Texture2DArray>(name);
         texture = cache->GetExistingResource<Texture2DArray>(name);
+#endif
     if (texture)
     if (texture)
         return texture;
         return texture;
 
 
@@ -3086,8 +3088,10 @@ Texture* View::FindNamedTexture(const String& name, bool isRenderTarget, bool is
 
 
             if (type == Texture3D::GetTypeStatic())
             if (type == Texture3D::GetTypeStatic())
                 return cache->GetResource<Texture3D>(name);
                 return cache->GetResource<Texture3D>(name);
+#if defined(URHO3D_OPENGL) || defined(URHO3D_D3D11)
             else if (type == Texture2DArray::GetTypeStatic())
             else if (type == Texture2DArray::GetTypeStatic())
                 return cache->GetResource<Texture2DArray>(name);
                 return cache->GetResource<Texture2DArray>(name);
+#endif
             else
             else
 #endif
 #endif
                 return cache->GetResource<TextureCube>(name);
                 return cache->GetResource<TextureCube>(name);