2
0
Эх сурвалжийг харах

Merge pull request #723 from sgrenier/next

Terrain test updates
Steve Grenier 13 жил өмнө
parent
commit
38930d3edb

+ 3 - 1
gameplay/src/Container.cpp

@@ -167,7 +167,9 @@ void Container::addControls(Theme* theme, Properties* properties)
         }
         else
         {
-            GP_ERROR("Failed to create control; unrecognized control name '%s'.", controlName.c_str());
+            // Ignore - not a valid control name.
+            // This used to fail, but I see no reason to hard fail here (this also fixes not being able
+            // to set padding on containers).
         }
 
         // Add the new control to the form.

+ 3 - 3
gameplay/src/TerrainPatch.cpp

@@ -482,15 +482,15 @@ bool TerrainPatch::updateMaterial()
 
         // Set material parameter bindings
         material->getParameter("u_worldViewProjectionMatrix")->bindValue(_terrain, &Terrain::getWorldViewProjectionMatrix);
-        if (!_terrain->_normalMap)
+        if (_terrain->_normalMap)
+            material->getParameter("u_normalMap")->setValue(_terrain->_normalMap);
+        else
             material->getParameter("u_normalMatrix")->bindValue(_terrain, &Terrain::getNormalMatrix);
         material->getParameter("u_ambientColor")->bindValue(this, &TerrainPatch::getAmbientColor);
         material->getParameter("u_lightColor")->bindValue(this, &TerrainPatch::getLightColor);
         material->getParameter("u_lightDirection")->bindValue(this, &TerrainPatch::getLightDirection);
         if (_layers.size() > 0)
             material->getParameter("u_samplers")->setValue((const Texture::Sampler**)&_samplers[0], (unsigned int)_samplers.size());
-        if (_terrain->_normalMap)
-            material->getParameter("u_normalMap")->setValue(_terrain->_normalMap);
 
         if (_terrain->isFlagSet(Terrain::DEBUG_PATCHES))
         {