mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
WIP collision solver, colour-codes in game fonts
Former-commit-id: 0bb85999176d89956398bbcc24e1b33cacd3e87c Former-commit-id: 0ef0c1ac9b88f8fe42a7439fee69a8d4792be96a
This commit is contained in:
@@ -59,16 +59,16 @@ class Col216 : LimitedColours {
|
||||
|
||||
private fun assertRaw(i: Int) {
|
||||
if (i >= COLOUR_RANGE_SIZE || i < 0) {
|
||||
println("i: " + i.toString())
|
||||
System.err.println("Illegal colour input: $i")
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
||||
private fun assertRGB(r: Int, g: Int, b: Int) {
|
||||
if (r !in 0..MAX_STEP || g !in 0..MAX_STEP || b !in 0..MAX_STEP) {
|
||||
println("r: " + r.toString())
|
||||
println("g: " + g.toString())
|
||||
println("b: " + b.toString())
|
||||
System.err.println("Illegal colour input for channel r: $r")
|
||||
System.err.println("Illegal colour input for channel g: $g")
|
||||
System.err.println("Illegal colour input for channel b: $b")
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,17 +111,17 @@ class Col4096 : LimitedColours {
|
||||
|
||||
private fun assertRaw(i: Int) {
|
||||
if (i > 0xFFFF || i < 0) {
|
||||
println("i: " + i.toString())
|
||||
System.err.println("Illegal colour input: $i")
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
||||
private fun assertARGB(a: Int, r: Int, g: Int, b: Int) {
|
||||
if (a !in 0..16 || r !in 0..16 || g !in 0..16 || b !in 0..16) {
|
||||
println("a: " + a.toString())
|
||||
println("r: " + r.toString())
|
||||
println("g: " + g.toString())
|
||||
println("b: " + b.toString())
|
||||
System.err.println("Illegal colour input for channel a: $a")
|
||||
System.err.println("Illegal colour input for channel r: $r")
|
||||
System.err.println("Illegal colour input for channel g: $g")
|
||||
System.err.println("Illegal colour input for channel b: $b")
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user