[COMMITTED] Backward compatibility for Savable

Loading spatials saved before adding StippleState throws ArrayIndexOutOfException.

Index: src/com/jme/scene/Spatial.java
--- src/com/jme/scene/Spatial.java   (revision 4138)
+++ src/com/jme/scene/Spatial.java   (working copy)
@@ -49,6 +49,7 @@
 import com.jme.renderer.Camera;
 import com.jme.renderer.Renderer;
 import com.jme.scene.state.RenderState;
+import com.jme.scene.state.RenderState.StateType;
 import com.jme.system.DisplaySystem;
 import com.jme.util.export.InputCapsule;
 import com.jme.util.export.JMEExporter;
@@ -1067,7 +1068,7 @@
         if (savs == null)
             renderStateList = null;
         else {
-            renderStateList = new RenderState[savs.length];
+            renderStateList = new RenderState[StateType.values().length];
             for (int x = 0; x < savs.length; x++) {
                 renderStateList[x] = (RenderState) savs[x];

i didn't test it yet but it seems like a good idea.

thanks for looking into that mulova.

Agreed. I also experienced problems with .jbin after a recent upgrade because of this, but I reconverted all my .jbin.

I am ok with this.

(Let's remember that unserialization readers must be considered constructors. Anytime we modify a constructor, we need to review the reader).