Minor optimizations.

- Only retrieve song information String[] when needed.
- Don't try to load glyphs if Unicode metadata is disabled.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-08 12:03:39 -05:00
parent f6eac71643
commit db4ca5f1d5
4 changed files with 23 additions and 10 deletions

View File

@@ -500,6 +500,9 @@ public class Utils {
* @param osu the OsuFile
*/
public static void loadGlyphs(OsuFile osu) {
if (!Options.useUnicodeMetadata())
return;
boolean glyphsAdded = false;
if (!osu.titleUnicode.isEmpty() && !loadedGlyphs.contains(osu.titleUnicode)) {
Utils.FONT_LARGE.addGlyphs(osu.titleUnicode);
@@ -515,7 +518,7 @@ public class Utils {
loadedGlyphs.add(osu.artistUnicode);
glyphsAdded = true;
}
if (glyphsAdded && Options.useUnicodeMetadata()) {
if (glyphsAdded) {
try {
Utils.FONT_LARGE.loadGlyphs();
Utils.FONT_MEDIUM.loadGlyphs();