From 5aa6177b50133a63d3f5dabd6060f7a5e2c0830b Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 14 Jul 2017 02:36:00 +0900 Subject: [PATCH] added texture filter control for gdx (whether it has some effect or not) --- src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt | 7 ++++--- src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt index 6b87290..c02ea84 100644 --- a/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt +++ b/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt @@ -64,7 +64,7 @@ import java.util.zip.GZIPInputStream * * Created by minjaesong on 2017-06-15. */ -class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Boolean = false) : BitmapFont() { +class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Boolean = false, val minFilter: Texture.TextureFilter = Texture.TextureFilter.Nearest, val magFilter: Texture.TextureFilter = Texture.TextureFilter.Nearest) : BitmapFont() { private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT) private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT @@ -120,8 +120,8 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo private fun isArmenian(c: Char) = c.toInt() in codeRange[SHEET_HAYEREN_VARW] private fun isKartvelian(c: Char) = c.toInt() in codeRange[SHEET_KARTULI_VARW] private fun isIPA(c: Char) = c.toInt() in codeRange[SHEET_IPA_VARW] - private fun isColourCodeHigh(c: Char) = c.toInt() in 0b110110_1111000000..0b110110_1111111111 - private fun isColourCodeLow(c: Char) = c.toInt() in 0b110111_0000000000..0b110111_1111111111 + private fun isColourCodeHigh(c: Char) = c.toInt() in 0b110110_1111000000..0b110110_1111111111 // only works with JVM (which uses UTF-16 internally) + private fun isColourCodeLow(c: Char) = c.toInt() in 0b110111_0000000000..0b110111_1111111111 // only works with JVM (which uses UTF-16 internally) private fun isLatinExtAdd(c: Char) = c.toInt() in 0x1E00..0x1EFF @@ -333,6 +333,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo } else throw IllegalArgumentException("[TerrarumSansBitmap] Unknown sheet index: $index") + texRegPack.texture.setFilter(minFilter, magFilter) sheetsPack.add(texRegPack) diff --git a/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt b/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt index 6f05cf5..9a80c21 100644 --- a/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt +++ b/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt @@ -154,8 +154,8 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false) : Font { private fun isArmenian(c: Char) = c.toInt() in codeRange[SHEET_HAYEREN_VARW] private fun isKartvelian(c: Char) = c.toInt() in codeRange[SHEET_KARTULI_VARW] private fun isIPA(c: Char) = c.toInt() in codeRange[SHEET_IPA_VARW] - private fun isColourCodeHigh(c: Char) = c.toInt() in 0b110110_1111000000..0b110110_1111111111 - private fun isColourCodeLow(c: Char) = c.toInt() in 0b110111_0000000000..0b110111_1111111111 + private fun isColourCodeHigh(c: Char) = c.toInt() in 0b110110_1111000000..0b110110_1111111111 // only works with JVM (which uses UTF-16 internally) + private fun isColourCodeLow(c: Char) = c.toInt() in 0b110111_0000000000..0b110111_1111111111 // only works with JVM (which uses UTF-16 internally) private fun isLatinExtAdd(c: Char) = c.toInt() in 0x1E00..0x1EFF