mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-06-15 10:04:05 +09:00
little diagnose print
This commit is contained in:
@@ -55,10 +55,11 @@ class PixmapRegionPack(
|
||||
init {
|
||||
if (!xySwapped) {
|
||||
regions = Array<Pixmap>(horizontalCount * verticalCount, {
|
||||
val region = Pixmap(tileW, tileH, Pixmap.Format.RGBA8888)
|
||||
val rx = (it % horizontalCount * (tileW + hGap)) + hFrame // pixel, not index
|
||||
val ry = (it / horizontalCount * (tileH + vGap)) + vFrame // pixel, not index
|
||||
|
||||
val region = Pixmap(tileW, tileH, Pixmap.Format.RGBA8888)
|
||||
|
||||
/*region.setColor(Color.WHITE)
|
||||
region.drawPixmap(pixmap, 0, 0,
|
||||
rx * (tileW + hGap),
|
||||
@@ -71,9 +72,6 @@ class PixmapRegionPack(
|
||||
|
||||
//println(region.pixels.capacity())
|
||||
|
||||
//val bytesBucket = ByteArray(4 * tileW * tileH)
|
||||
//var bytesBucketHead = 0
|
||||
|
||||
for (y in 0 until tileH) {
|
||||
//println("${pixmap.width * pixmap.height * 4} ==? ${pixmap.pixels.capacity()}")
|
||||
|
||||
@@ -86,9 +84,25 @@ class PixmapRegionPack(
|
||||
|
||||
pixmap.pixels.position(offsetY + offsetX)
|
||||
pixmap.pixels.get(bytesBuffer, 0, bytesBuffer.size)
|
||||
|
||||
// test print bytesbuffer
|
||||
bytesBuffer.forEachIndexed { index, it ->
|
||||
if (index % 4 == 3) {
|
||||
if (it == 255.toByte()) print("█") else print("·")
|
||||
}
|
||||
}
|
||||
println()
|
||||
|
||||
region.pixels.put(bytesBuffer)
|
||||
}
|
||||
|
||||
|
||||
println()
|
||||
|
||||
//val region = Pixmap(5, 20, Pixmap.Format.RGBA8888)
|
||||
//region.pixels.rewind()
|
||||
//region.pixels.put(byteArrayOf(-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1,-1,-1,0,-1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