From baba9d6b4756ef77dbd5b1de5fa78260ee522f08 Mon Sep 17 00:00:00 2001 From: "sky..om" Date: Sat, 31 Dec 2011 00:26:42 +0000 Subject: [PATCH] Fix to TerrainGrid: only clone the grid's material to child quad if it doesn't have a material of its own git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8970 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java index f50aabfd6..502702eff 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java @@ -147,7 +147,8 @@ public class TerrainGrid extends TerrainQuad { log.log(Level.FINE, "Loaded TerrainQuad {0} from HeightMapGrid", q.getName()); } else if (gridTileLoader != null) { q = gridTileLoader.getTerrainQuadAt(quadCell); - q.setMaterial(material.clone()); + // only clone the material to the quad if it doesn't have a material of its own + if(q.getMaterial()==null) q.setMaterial(material.clone()); log.log(Level.FINE, "Loaded TerrainQuad {0} from TerrainQuadGrid", q.getName()); } }