v0.9.1: slightly improved android performance on warm start

This commit is contained in:
Evan Debenham
2020-11-24 18:02:38 -05:00
parent 9c75859126
commit 2b6de19995
4 changed files with 37 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.desktop;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
@@ -154,6 +155,16 @@ public class DesktopPlatformSupport extends PlatformSupport {
}
setupFontGenerators(pageSize, systemfont);
}
@Override
public void reloadGenerators() {
if (packer != null) {
for (PixmapPacker.Page p : packer.getPages()) {
p.getTexture().dispose();
p.updateTexture(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest, false);
}
}
}
private static Pattern asianMatcher = Pattern.compile("\\p{InHangul_Syllables}|" +
"\\p{InCJK_Unified_Ideographs}|\\p{InCJK_Symbols_and_Punctuation}|\\p{InHalfwidth_and_Fullwidth_Forms}|" +