It only happens with the installed APK if USB debugging is enabled on the device.
I know this isn’t a critical problem by any stretch, as it’s the odd case where this will be an issue, but if there is a way of resolving it, that would be really cool.
Hopefully the debug mode being enabled will give someone a clue as to what is causes the problem when loading bitmap fonts.
I wonder if it has something to do with the way BitmapFontLoader accesses the material definition. It does it like so:
[java]
MaterialDef spriteMat = (MaterialDef) assetManager.loadAsset(new AssetKey(“Common/MatDefs/Misc/Unshaded.j3md”));
Material mat = new Material(spriteMat);
[/java]
When, in most cases, (at least I do it this way):
[java]
Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
[/java]
Is it possible that the asset key isn’t translated the same due to the debug mode being enabled?
I think this was fixed in head but not in trunk maybe. The issue is/was with how the loader reads the files and it seems that when there is a line feed on the last line then (on android) a null line is returned. The old code used available() to see if there was more stream to read which is an improper use of available().
@pspeed said:
I think this was fixed in head but not in trunk maybe. The issue is/was with how the loader reads the files and it seems that when there is a line feed on the last line then (on android) a null line is returned. The old code used available() to see if there was more stream to read which is an improper use of available().
Oh cool… Ok! This is good news. I’m gonna go take a look at how this is being done now.
@pspeed said:
It was ready() that it was using before:
http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-plugins/com/jme3/font/plugins/BitmapFontLoader.java