Jelajahi Sumber

- do not store useless reference to image in TextureAtlas

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9050 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 tahun lalu
induk
melakukan
1d742f1d07
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 4 4
      engine/src/tools/jme3tools/optimize/TextureAtlas.java

+ 4 - 4
engine/src/tools/jme3tools/optimize/TextureAtlas.java

@@ -437,14 +437,14 @@ public class TextureAtlas {
 
         public TextureAtlasTile location;
         public Node child[];
-        public Image image;
+        public boolean occupied;
 
         public Node(int x, int y, int width, int height) {
             location = new TextureAtlasTile(x, y, width, height);
             child = new Node[2];
             child[0] = null;
             child[1] = null;
-            image = null;
+            occupied = false;
         }
 
         public boolean isLeaf() {
@@ -462,7 +462,7 @@ public class TextureAtlas {
 
                 return child[1].insert(image);
             } else {
-                if (this.image != null) {
+                if (occupied) {
                     return null; // occupied
                 }
 
@@ -471,7 +471,7 @@ public class TextureAtlas {
                 }
 
                 if (image.getWidth() == location.getWidth() && image.getHeight() == location.getHeight()) {
-                    this.image = image; // perfect fit
+                    occupied = true; // perfect fit
                     return this;
                 }