working subtiling (for atlas size 2048)

This commit is contained in:
minjaesong
2024-08-23 00:06:14 +09:00
parent 5c1c526128
commit 657ab2b2be
3 changed files with 38 additions and 15 deletions

View File

@@ -883,14 +883,19 @@ internal object BlocksDrawer {
}
val baseXY = tilenumInAtlas.map { Point2i(
it % (App.tileMaker.TILES_IN_X * 2),
it / (App.tileMaker.TILES_IN_X * 2),
(it / (App.tileMaker.TILES_IN_X * 2)).let {
if (it % 2 == 1) it + 1 else it
},
) }
// apply variants
return (baseXY zip variants).map { (base, va) -> Point2i(
base.x + va / 2,
base.y + va % 2,
) }
) }.also {
// println("Base: $base")
// println("Tiles: $it")
}
}
private fun Int.reorientSubtileUsingFliprotIdx(fliprotIndex: Int): Int {