Nifty RenderDeviceJme Bugfix: When we cache BitmapText instances to speed up text rendering we need to make sure that we take the font and the color into account as well! When we cache BitmapText instances only using the actual "text" it is possible that the exact same text - when it is rendered in different fonts - will be used from the cache (and then using the wrong font!) This has now been fixed.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8386 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
voi..om 13 years ago
parent 5feebef7c5
commit 52d1aaaaf2
  1. 4
      engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java

@ -195,13 +195,13 @@ public class RenderDeviceJme implements RenderDevice {
RenderFontJme jmeFont = (RenderFontJme) font;
BitmapText text = textCacheLastFrame.get(str);
BitmapText text = textCacheLastFrame.get(font+str+color);
if (text == null) {
text = jmeFont.createText();
text.setText(str);
text.updateLogicalState(0);
}
textCacheCurrentFrame.put(str, text);
textCacheCurrentFrame.put(font+str+color, text);
niftyMat.setColor("Color", convertColor(color, tempColor));
niftyMat.setBoolean("UseTex", true);

Loading…
Cancel
Save