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

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7174 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 07f9cf0d23
commit b774630160
  1. 9
      engine/src/core/com/jme3/asset/TextureKey.java
  2. 6
      engine/src/core/com/jme3/scene/Spatial.java

@ -77,6 +77,7 @@ public class TextureKey extends AssetKey<Texture> {
return true; return true;
} }
@Override
public Object createClonedInstance(Object asset){ public Object createClonedInstance(Object asset){
Texture tex = (Texture) asset; Texture tex = (Texture) asset;
return tex.createSimpleClone(); return tex.createSimpleClone();
@ -140,6 +141,14 @@ public class TextureKey extends AssetKey<Texture> {
this.generateMips = generateMips; 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{ public void write(JmeExporter ex) throws IOException{
super.write(ex); super.write(ex);
OutputCapsule oc = ex.getCapsule(this); OutputCapsule oc = ex.getCapsule(this);

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

Loading…
Cancel
Save