From a824f45efb334cf396506280445b5a9863297c78 Mon Sep 17 00:00:00 2001 From: "voi..om" Date: Wed, 19 Oct 2011 01:10:49 +0000 Subject: [PATCH] optimize GC performance while creating keys for the BitmapText cache git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8459 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java index 843e12f2a..1e77506a0 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java +++ b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java @@ -195,13 +195,14 @@ public class RenderDeviceJme implements RenderDevice { RenderFontJme jmeFont = (RenderFontJme) font; - BitmapText text = textCacheLastFrame.get(font+str+color); + String key = font+str+color.getColorString(); + BitmapText text = textCacheLastFrame.get(key); if (text == null) { text = jmeFont.createText(); text.setText(str); text.updateLogicalState(0); } - textCacheCurrentFrame.put(font+str+color, text); + textCacheCurrentFrame.put(key, text); niftyMat.setColor("Color", convertColor(color, tempColor)); niftyMat.setBoolean("UseTex", true);