Clear Procedural Texture Generator values

Hey all, anyone have any problems with this patch:


Index: ProceduralTextureGenerator.java
--- ProceduralTextureGenerator.java Base (BASE)
+++ ProceduralTextureGenerator.java Locally Modified (Based On LOCAL)
@@ -236,6 +236,13 @@
     textureList.add(tile);
   }
 
+  public void clearTextures() {
+      for ( TextureTile tile : textureList ) {
+          tile.imageData = null;
+      }
+      textureList.clear();
+  }

   /**
    * <code>setHeightMap</code> sets the input heightmap to use
    * for the texture generation.



And This one...


Index: ProceduralSplatTextureGenerator.java
--- ProceduralSplatTextureGenerator.java Base (BASE)
+++ ProceduralSplatTextureGenerator.java Locally Modified (Based On LOCAL)
@@ -197,4 +197,10 @@
    public BufferedImage getSplatTexture(int index) {
       return splatTextures.get(index);
    }
+       
+        public void clearTextures() {
+            super.clearTextures();
+            splatMaps.clear();
+            splatTextures.clear();
 }
+}



It's simply so that these procedural texture generators can be reused with different settings...

Possibly - although havent looked at the implementation for yonks …



? issue - can splatmaps be null or is that because in on jme 1.0

the splatmaps are initialized at object creation, so setting them to null would require catches later; probably better just to clear them…

Would someone mind applying the above and this patch:


Index: build.xml
--- build.xml Base (BASE)
+++ build.xml Locally Modified (Based On LOCAL)
@@ -56,7 +56,7 @@
 
    <target name="run-testchooser" depends="compile-test" description="Runs the TestChooser">
       <java classname="jmetest.TestChooser" fork="true" classpathref="classpath">
-         <jvmarg value=  "-Djava.library.path=${libs}/jogl/native/windows_i586;${libs}/lwjgl/native/linux;${libs}/lwjgl/native/macosx;${libs}/lwjgl/native/win32;${libs}/swt/linux;${libs}/swt/macosx-carbon;${libs}/swt/macosx-cocoa;${libs}/swt/windows"/>
+         <jvmarg value=  "-Djava.library.path=${libs}/jogl/native/windows_amd64;${libs}/jogl/native/macosx;${libs}/jogl/native/linux_i586;${libs}/jogl/native/linux_amd64;${libs}/jogl/native/windows_i586;${libs}/lwjgl/native/linux;${libs}/lwjgl/native/macosx;${libs}/lwjgl/native/win32;${libs}/swt/linux;${libs}/swt/macosx-carbon;${libs}/swt/macosx-cocoa;${libs}/swt/windows"/>
       </java>
    </target>
 


(This patch just updates the jogl natives in the build.xml document...)

I am having an issue with NetBeans SVN and need to wipe my copy...

Commited, r4070.

thanx nymon :slight_smile: