2
0
Эх сурвалжийг харах

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
voi..om 14 жил өмнө
parent
commit
a824f45efb

+ 3 - 2
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);