2
0
Эх сурвалжийг харах

* TextureKey.equals() now takes into account flip Y flag

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7174 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
sha..rd 14 жил өмнө
parent
commit
b774630160

+ 9 - 0
engine/src/core/com/jme3/asset/TextureKey.java

@@ -77,6 +77,7 @@ public class TextureKey extends AssetKey<Texture> {
         return true;
     }
 
+    @Override
     public Object createClonedInstance(Object asset){
         Texture tex = (Texture) asset;
         return tex.createSimpleClone();
@@ -140,6 +141,14 @@ public class TextureKey extends AssetKey<Texture> {
         this.generateMips = generateMips;
     }
 
+    @Override
+    public boolean equals(Object other){
+        if (!(other instanceof TextureKey)){
+            return false;
+        }
+        return super.equals(other) && isFlipY() == ((TextureKey)other).isFlipY();
+    }
+
     public void write(JmeExporter ex) throws IOException{
         super.write(ex);
         OutputCapsule oc = ex.getCapsule(this);

+ 4 - 2
engine/src/core/com/jme3/scene/Spatial.java

@@ -102,8 +102,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
      * Refresh flag types
      */
     protected static final int RF_TRANSFORM = 0x01, // need light resort + combine transforms
-            RF_BOUND = 0x02,
-            RF_LIGHTLIST = 0x04; // changes in light lists
+                               RF_BOUND = 0x02,
+                               RF_LIGHTLIST = 0x04; // changes in light lists
+    
     protected CullHint cullHint = CullHint.Inherit;
     /** 
      * Spatial's bounding volume relative to the world.
@@ -163,6 +164,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
         this.name = name;
     }
 
+
     /**
      * Indicate that the transform of this spatial has changed and that
      * a refresh is required.