fluids to their own block layer

This commit is contained in:
minjaesong
2023-10-10 05:33:40 +09:00
parent caffdbf861
commit 26936fde09
12 changed files with 199 additions and 54 deletions

View File

@@ -66,11 +66,7 @@ class BlockLayerI16I8 (val width: Int, val height: Int) : BlockLayer {
override fun unsafeToBytes(x: Int, y: Int): ByteArray {
val offset = BYTES_PER_BLOCK * (y * width + x)
val lsb = ptr[offset]
val msb = ptr[offset + 1]
val placement = ptr[offset + 2]
return byteArrayOf(msb, lsb, placement)
return byteArrayOf(ptr[offset + 1], ptr[offset + 0], ptr[offset + 2])
}
internal fun unsafeSetTile(x: Int, y: Int, tile: Int, placement: Int) {