From b774630160944959421b74a13101d052ae034715 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sun, 3 Apr 2011 19:54:26 +0000 Subject: [PATCH] * TextureKey.equals() now takes into account flip Y flag git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7174 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/asset/TextureKey.java | 9 +++++++++ engine/src/core/com/jme3/scene/Spatial.java | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/asset/TextureKey.java b/engine/src/core/com/jme3/asset/TextureKey.java index d3d778df6..8f8757051 100644 --- a/engine/src/core/com/jme3/asset/TextureKey.java +++ b/engine/src/core/com/jme3/asset/TextureKey.java @@ -77,6 +77,7 @@ public class TextureKey extends AssetKey { return true; } + @Override public Object createClonedInstance(Object asset){ Texture tex = (Texture) asset; return tex.createSimpleClone(); @@ -140,6 +141,14 @@ public class TextureKey extends AssetKey { 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); diff --git a/engine/src/core/com/jme3/scene/Spatial.java b/engine/src/core/com/jme3/scene/Spatial.java index 9eb61ba0f..f82c39cf3 100644 --- a/engine/src/core/com/jme3/scene/Spatial.java +++ b/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.