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
3.0
voi..om 13 years ago
parent f50266590d
commit a824f45efb
  1. 5
      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);

Loading…
Cancel
Save