From 4be1d2be1e0f0b0bd717686e27aa7e9141bcca83 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 20 May 2012 19:56:39 +0000 Subject: [PATCH] * AndroidImageInfo now supports getting notification when the bitmap has been successfully uploaded to GL * AndroidAudioRenderer no longer prints silly debug messages git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9409 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../android/com/jme3/asset/AndroidImageInfo.java | 13 ++++++++++++- .../jme3/audio/android/AndroidAudioRenderer.java | 4 ---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/engine/src/android/com/jme3/asset/AndroidImageInfo.java b/engine/src/android/com/jme3/asset/AndroidImageInfo.java index 1b5c796e1..f62d7b8b3 100644 --- a/engine/src/android/com/jme3/asset/AndroidImageInfo.java +++ b/engine/src/android/com/jme3/asset/AndroidImageInfo.java @@ -7,6 +7,8 @@ import com.jme3.texture.Image; import com.jme3.texture.Image.Format; import java.io.IOException; import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; /** * AndroidImageInfo is set in a jME3 image via the {@link Image#setEfficentData(java.lang.Object) } @@ -18,6 +20,8 @@ import java.io.InputStream; */ public class AndroidImageInfo { + private static final Logger logger = Logger.getLogger(AndroidImageInfo.class.getName()); + protected AssetInfo assetInfo; protected Bitmap bitmap; protected Format format; @@ -40,7 +44,14 @@ public class AndroidImageInfo { return bitmap; } - + public void notifyBitmapUploaded() { + // Default function is to recycle the bitmap. + if (bitmap != null && !bitmap.isRecycled()) { + bitmap.recycle(); + bitmap = null; + logger.log(Level.INFO, "Bitmap was deleted. "); + } + } public Format getFormat(){ return format; diff --git a/engine/src/android/com/jme3/audio/android/AndroidAudioRenderer.java b/engine/src/android/com/jme3/audio/android/AndroidAudioRenderer.java index 662e74cc7..ebe3973f5 100644 --- a/engine/src/android/com/jme3/audio/android/AndroidAudioRenderer.java +++ b/engine/src/android/com/jme3/audio/android/AndroidAudioRenderer.java @@ -88,8 +88,6 @@ public class AndroidAudioRenderer implements AudioRenderer, @Override public void updateSourceParam(AudioNode src, AudioParam param) { - // logger.log(Level.INFO, "updateSourceParam " + param); - if (audioDisabled) { return; } @@ -195,7 +193,6 @@ public class AndroidAudioRenderer implements AudioRenderer, @Override public void updateListenerParam(Listener listener, ListenerParam param) { - // logger.log(Level.INFO, "updateListenerParam " + param); if (audioDisabled) { return; } @@ -203,7 +200,6 @@ public class AndroidAudioRenderer implements AudioRenderer, switch (param) { case Position: listenerPosition.set(listener.getLocation()); - break; case Rotation: Vector3f dir = listener.getDirection();