From e250c47a089c77aa1adf89cf40b1fcdc59ba5d57 Mon Sep 17 00:00:00 2001 From: Rena4ka Date: Tue, 22 Apr 2014 03:55:57 -0700 Subject: [PATCH] Fixed constantly mipmap generation Fixed bug when setting MinFilter with mipmapping after generating mipmaps causes jME to update image data every frame. --- jme3-core/src/main/java/com/jme3/texture/Texture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/texture/Texture.java b/jme3-core/src/main/java/com/jme3/texture/Texture.java index 925f49df7..3f4ac3231 100644 --- a/jme3-core/src/main/java/com/jme3/texture/Texture.java +++ b/jme3-core/src/main/java/com/jme3/texture/Texture.java @@ -339,7 +339,7 @@ public abstract class Texture implements CloneableSmartAsset, Savable, Cloneable "minificationFilter can not be null."); } this.minificationFilter = minificationFilter; - if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired()) { + if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired() && !image.hasMipmaps()) { image.setNeedGeneratedMipmaps(); } } @@ -631,4 +631,4 @@ public abstract class Texture implements CloneableSmartAsset, Savable, Cloneable } -} \ No newline at end of file +}