colour code is now ARGB instead of RGBA

This commit is contained in:
minjaesong
2018-07-27 03:51:15 +09:00
parent 2cc9f0ba8c
commit 55bdaef897
5 changed files with 94 additions and 99 deletions

51
.idea/workspace.xml generated
View File

@@ -8,13 +8,8 @@
<component name="ChangeListManager">
<list default="true" id="22c5bc80-996c-4846-b173-7dc8c2096fe3" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/FontTestGDX/demotext.txt" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/demotext.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/lib/TerrarumSansBitmap.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" beforeDir="false" afterPath="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_bulgarian_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_serbian_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/assets/cyrilic_variable.tga" beforeDir="false" afterPath="$PROJECT_DIR$/assets/cyrilic_variable.tga" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -34,8 +29,8 @@
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="588">
<caret line="722" column="30" lean-forward="true" selection-start-line="722" selection-start-column="30" selection-end-line="722" selection-end-column="30" />
<state relative-caret-position="393">
<caret line="197" column="25" lean-forward="true" selection-start-line="197" selection-start-column="25" selection-end-line="197" selection-end-column="25" />
</state>
</provider>
</entry>
@@ -53,11 +48,11 @@
</split-first>
<split-second>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="FontTestGDX.kt" pinned="false" current-in-tab="false">
<file leaf-file-name="FontTestGDX.kt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="491">
<caret line="126" column="20" lean-forward="true" selection-start-line="126" selection-start-column="20" selection-end-line="126" selection-end-column="20" />
<state relative-caret-position="244">
<caret line="61" column="19" lean-forward="true" selection-start-line="61" selection-start-column="19" selection-end-line="61" selection-end-column="19" />
<folding>
<element signature="e#48#162#0" expanded="true" />
</folding>
@@ -65,11 +60,11 @@
</provider>
</entry>
</file>
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="true">
<file leaf-file-name="GameFontBase.kt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="499">
<caret line="273" lean-forward="true" selection-start-line="273" selection-end-line="273" />
<state relative-caret-position="460">
<caret line="270" column="5" lean-forward="true" selection-start-line="270" selection-start-column="5" selection-end-line="270" selection-end-column="5" />
</state>
</provider>
</entry>
@@ -78,7 +73,7 @@
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="514">
<caret line="67" column="58" selection-start-line="67" selection-start-column="58" selection-end-line="67" selection-end-column="58" />
<caret line="67" column="78" selection-start-line="67" selection-start-column="78" selection-end-line="67" selection-end-column="78" />
</state>
</provider>
</entry>
@@ -150,9 +145,9 @@
<option value="$PROJECT_DIR$/LICENSE.md" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/slick2d/GameFontBase.kt" />
<option value="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" />
<option value="$PROJECT_DIR$/FontTestGDX/demotext.txt" />
<option value="$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt" />
<option value="$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt" />
</list>
</option>
</component>
@@ -693,27 +688,27 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="491">
<caret line="126" column="20" lean-forward="true" selection-start-line="126" selection-start-column="20" selection-end-line="126" selection-end-column="20" />
<folding>
<element signature="e#48#162#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/FontTestGDX/demotext.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="514">
<caret line="67" column="58" selection-start-line="67" selection-start-column="58" selection-end-line="67" selection-end-column="58" />
<caret line="67" column="78" selection-start-line="67" selection-start-column="78" selection-end-line="67" selection-end-column="78" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/net/torvald/terrarumsansbitmap/gdx/GameFontBase.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="499">
<caret line="273" lean-forward="true" selection-start-line="273" selection-end-line="273" />
<state relative-caret-position="460">
<caret line="270" column="5" lean-forward="true" selection-start-line="270" selection-start-column="5" selection-end-line="270" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/FontTestGDX/src/FontTestGDX.kt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="244">
<caret line="61" column="19" lean-forward="true" selection-start-line="61" selection-start-column="19" selection-end-line="61" selection-end-column="19" />
<folding>
<element signature="e#48#162#0" expanded="true" />
</folding>
</state>
</provider>
</entry>

View File

@@ -63,9 +63,9 @@ Multilingual brackets; these are the most basic things, right?
Fixed-width numbers, because number-crunching matters
􏀏ᚱ􏄏ᛂ􏈏ᚴ􏌏ᛋ􏐏ᛂ􏔏ᛋ􏘏ᛏ􏜏ᛋ􏠏ᚮ􏤏ᚾ􏨏ᛔ􏬏ᚢ􏰏ᛏ􏴏ᛚ􏸏ᚮ􏼏ᛋ􎼏᛬􍼏ᚱ􌼏ᛂ􋼏ᚴ􊼏ᛋ􉼏ᛋ􈼏ᚢ􇼏ᚼ􆼏ᚾ􅼏ᚢ􄼏ᛘ􃼏ᚢ􂼏ᛚ􁼏ᚾ􀼏ᛏ􀼟ᚮ􀼯᛬􀼿ᛏ􀽏ᚮ􀽟ᛋ􀽯ᛁ􀽿ᚮ􀾏ᚵ􀾟ᛂ􀾯ᚢ􀾿ᛏ􀿏ᚮ􀿟ᚱ􀿯ᛘ􀿿ᛔ􀻿ᚱ􀷿ᛂ􀳿ᚴ􀯿ᛋ􀫿ᛏ􀧿᛭􀣿ᛋ􀟿ᚢ􀛿ᚼ􀗿ᚾ􀓿ᚢ􀏿ᛋ􀋿ᛘ􀇿ᚮ􀃿ᛁ􁃿ᚵ􂃿ᚾ􃃿ᛁ􄃿ᛂ􅃿ᛏ􆃿ᚮ􇃿ᛑ􈃿᛭􉃿ᚵ􊃿ᛂ􋃿ᚢ􌃿ᛏ􍃿ᚮ􎃿ᚱ􀀀
􏼀ᚱ􏼐ᛂ􏼠ᚴ􏼰ᛋ􏽀ᛂ􏽐ᛋ􏽠ᛏ􏽰ᛋ􏾀ᚮ􏾐ᚾ􏾠ᛔ􏾰ᚢ􏿀ᛏ􏿐ᛚ􏿠ᚮ􏿰ᛋ􏻰᛬􏷰ᚱ􏳰ᛂ􏯰ᚴ􏫰ᛋ􏧰ᛋ􏣰ᚢ􏟰ᚼ􏛰ᚾ􏗰ᚢ􏓰ᛘ􏏰ᚢ􏋰ᛚ􏇰ᚾ􏃰ᛏ􏃱ᚮ􏃲᛬􏃳ᛏ􏃴ᚮ􏃵ᛋ􏃶ᛁ􏃷ᚮ􏃸ᚵ􏃹ᛂ􏃺ᚢ􏃻ᛏ􏃼ᚮ􏃽ᚱ􏃾ᛘ􏃿ᛔ􏃯ᚱ􏃟ᛂ􏃏ᚴ􏂿ᛋ􏂯ᛏ􏂟᛭􏂏ᛋ􏁿ᚢ􏁯ᚼ􏁟ᚾ􏁏ᚢ􏀿ᛋ􏀯ᛘ􏀟ᚮ􏀏ᛁ􏄏ᚵ􏈏ᚾ􏌏ᛁ􏐏ᛂ􏔏ᛏ􏘏ᚮ􏜏ᛑ􏠏᛭􏤏ᚵ􏨏ᛂ􏬏ᚢ􏰏ᛏ􏴏ᚮ􏸏ᚱ􀀀
Colour-code that supports 65535 opaque or semi-transparent colours via 4 bit RGBA
Colour-code that supports 65535 opaque or semi-transparent colours via 4 bit ARGB
󿿹Гномът Доцьо приключи спящ в шейна за жаби󿿸 (Bulgarian)
󿿺Љубазни фењерџија чађавог лица хоће да ми покаже штос󿿸 (Serbian)

View File

@@ -33,7 +33,67 @@ class FontTestGDX : Game() {
println("START")
val l = intArrayOf(0xF00F,
val l = intArrayOf(0xFF00,
0xFF10,
0xFF20,
0xFF30,
0xFF40,
0xFF50,
0xFF60,
0xFF70,
0xFF80,
0xFF90,
0xFFA0,
0xFFB0,
0xFFC0,
0xFFD0,
0xFFE0,
0xFFF0,
0xFEF0,
0xFDF0,
0xFCF0,
0xFBF0,
0xFAF0,
0xF9F0,
0xF8F0,
0xF7F0,
0xF6F0,
0xF5F0,
0xF4F0,
0xF3F0,
0xF2F0,
0xF1F0,
0xF0F0,
0xF0F1,
0xF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0

View File

@@ -190,10 +190,10 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
if (colourBuffer.containsKey(codePoint))
return colourBuffer[codePoint]!!
val r = codePoint.and(0xF000).ushr(12)
val g = codePoint.and(0x0F00).ushr(8)
val b = codePoint.and(0x00F0).ushr(4)
val a = codePoint.and(0x000F)
val a = codePoint.and(0xF000).ushr(12)
val r = codePoint.and(0x0F00).ushr(8)
val g = codePoint.and(0x00F0).ushr(4)
val b = codePoint.and(0x000F)
val col = Color(r.shl(28) or r.shl(24) or g.shl(20) or g.shl(16) or b.shl(12) or b.shl(8) or a.shl(4) or a)
@@ -778,7 +778,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
}
fun toColorCode(rgba4444: Int): String = GameFontBase.toColorCode(rgba4444)
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a)
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = GameFontBase.toColorCode(r, g, b, a)
val noColorCode = toColorCode(0x0000)
val charsetOverrideNormal = Character.toChars(CHARSET_OVERRIDE_NULL)
@@ -834,8 +834,8 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
val charsetOverrideNormal = Character.toChars(CHARSET_OVERRIDE_NULL)
val charsetOverrideBulgarian = Character.toChars(CHARSET_OVERRIDE_BG_BG)
val charsetOverrideSerbian = Character.toChars(CHARSET_OVERRIDE_SR_SR)
fun toColorCode(rgba4444: Int): String = Character.toChars(0x100000 + rgba4444).toColCode()
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(r.shl(12) or g.shl(8) or b.shl(4) or a)
fun toColorCode(argb4444: Int): String = Character.toChars(0x100000 + argb4444).toColCode()
fun toColorCode(r: Int, g: Int, b: Int, a: Int = 0x0F): String = toColorCode(a.shl(12) or r.shl(8) or g.shl(4) or b)
private fun CharArray.toColCode(): String = "${this[0]}${this[1]}"
val noColorCode = toColorCode(0x0000)