From 52d1aaaaf29c4be6165b2807f9147b5c83d5aa7a Mon Sep 17 00:00:00 2001 From: "voi..om" Date: Wed, 12 Oct 2011 22:23:48 +0000 Subject: [PATCH] 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 --- engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java index 0b0540cd8..843e12f2a 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java +++ b/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);