From 8f61aa757c88ae68c463ae2f85055057b8b3f154 Mon Sep 17 00:00:00 2001 From: "bre..ns" Date: Thu, 10 Nov 2011 17:02:54 +0000 Subject: [PATCH] fixed terrain editor errors git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8636 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../terraineditor/TerrainEditorController.java | 6 ++++-- .../terraineditor/TerrainEditorTopComponent.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java index 843027eab..1cea207fd 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java @@ -344,12 +344,14 @@ public class TerrainEditorController implements NodeListener { return null; } - private Float doGetTextureScale(int layer) { + protected Float doGetTextureScale(int layer) { Terrain terrain = (Terrain) getTerrain(null); if (terrain == null) return 1f; MatParam matParam = null; matParam = terrain.getMaterial().getParam("DiffuseMap_"+layer+"_scale"); + if (matParam == null) + return -1f; return (Float) matParam.getValue(); } @@ -1017,7 +1019,7 @@ public class TerrainEditorController implements NodeListener { return -1; } - private int doGetNumUsedTextures() { + protected int doGetNumUsedTextures() { Terrain terrain = (Terrain) getTerrain(null); if (terrain == null) return 0; diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java index ea3eddf51..20b83a65e 100644 --- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java +++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java @@ -131,7 +131,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce private CreateTerrainWizardAction terrainWizard; private SkyboxWizardAction skyboxWizard; private JmeSpatial selectedSpat; - private TerrainNodeListener terrainDeletedNodeListener; + //private TerrainNodeListener terrainDeletedNodeListener; private boolean availableNormalTextures; private HelpCtx ctx = new HelpCtx("sdk.terrain_editor"); private DDSPreview ddsPreview; @@ -1012,8 +1012,8 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce request.setToolNode(new Node("TerrainEditorToolNode")); SceneApplication.getApplication().openScene(request); - terrainDeletedNodeListener = new TerrainNodeListener(); - editorController.enableTextureButtons(); + //terrainDeletedNodeListener = new TerrainNodeListener(); + //editorController.enableTextureButtons(); } @@ -1022,7 +1022,7 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce if (request.equals(sentRequest)) { currentRequest = request; - Logger.getLogger(TerrainEditorTopComponent.class.getName()).finer("Terrain sceneRequested " + request.getWindowTitle()); + //Logger.getLogger(TerrainEditorTopComponent.class.getName()).finer("Terrain sceneRequested " + request.getWindowTitle()); setSceneInfo(currentRequest.getJmeNode(), true); @@ -1033,7 +1033,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce if (terrain != null) { // add the terrain root save node - // ugh! wtf, why is this fixing the material problem? ((Node) terrain).setMaterial(terrain.getMaterial()); // it appears when loading the actual applied material on the terrain // does not reflect the material that we get from the terrain. @@ -1048,9 +1047,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce toolController.cleanup(); } - //for (int i=0; i