mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-03-12 14:11:51 +09:00
typewriter: faster typing sound, backspace is working again
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarumtypewriterbitmap.gdx
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.Batch
|
||||
@@ -206,9 +207,13 @@ class TerrarumTypewriterBitmap(
|
||||
val codeStartX = cellX + binaryCodeOffset
|
||||
val codeStartY = cellY
|
||||
|
||||
val width = (0..4).fold(0) { acc, y -> acc or ((pixmap.getPixel(codeStartX, codeStartY + y).and(255) != 0).toInt() shl y) }
|
||||
var width = (0..4).fold(0) { acc, y -> acc or ((pixmap.getPixel(codeStartX, codeStartY + y).and(255) != 0).toInt() shl y) }
|
||||
val isLowHeight = (pixmap.getPixel(codeStartX, codeStartY + 5).and(255) != 0)
|
||||
|
||||
if (code in 0xF2000..0xF3FFF && code and 127 == Input.Keys.BACKSPACE) {
|
||||
width *= -1
|
||||
}
|
||||
|
||||
// Keming machine parameters
|
||||
val kerningBit1 = pixmap.getPixel(codeStartX, codeStartY + 6).tagify()
|
||||
val kerningBit2 = pixmap.getPixel(codeStartX, codeStartY + 7).tagify()
|
||||
|
||||
Reference in New Issue
Block a user