- another fix in deserialization of TerrainGrid

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8685 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 666ff483a4
commit 6c3f896604
  1. 10
      engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java

@ -238,7 +238,7 @@ public class TerrainGrid extends TerrainQuad {
public TerrainGrid() { public TerrainGrid() {
} }
private void initData(){ private void initData() {
int maxVisibleSize = size; int maxVisibleSize = size;
this.quarterSize = maxVisibleSize >> 2; this.quarterSize = maxVisibleSize >> 2;
this.quadSize = (maxVisibleSize + 1) >> 1; this.quadSize = (maxVisibleSize + 1) >> 1;
@ -452,9 +452,11 @@ public class TerrainGrid extends TerrainQuad {
offsetAmount = c.readFloat("offsetAmount", 0); offsetAmount = c.readFloat("offsetAmount", 0);
terrainQuadGrid = (TerrainQuadGrid) c.readSavable("terrainQuadGrid", null); terrainQuadGrid = (TerrainQuadGrid) c.readSavable("terrainQuadGrid", null);
initData(); initData();
terrainQuadGrid.setSize(this.size); if (terrainQuadGrid != null) {
terrainQuadGrid.setPatchSize(this.patchSize); terrainQuadGrid.setSize(this.size);
terrainQuadGrid.setQuadSize(this.quadSize); terrainQuadGrid.setPatchSize(this.patchSize);
terrainQuadGrid.setQuadSize(this.quadSize);
}
} }
@Override @Override

Loading…
Cancel
Save