[WIP] Lilypad working

+ shader integration
This commit is contained in:
octarine-noise
2021-05-11 16:18:58 +02:00
parent 835bf45f13
commit a917d5b3db
12 changed files with 126 additions and 31 deletions

View File

@@ -50,13 +50,13 @@ fun tuftQuadSingle(size: Double, height: Double, flipU: Boolean) =
)
.mirrorUV(flipU, false)
fun tuftModelSet(shapes: Array<TuftShapeKey>, overrideColor: Color?, spriteGetter: (Int) -> TextureAtlasSprite) =
fun tuftModelSet(shapes: Array<TuftShapeKey>, tintIndex: Int, spriteGetter: (Int) -> TextureAtlasSprite) =
shapes.mapIndexed { idx, shape ->
listOf(
tuftQuadSingle(shape.size, shape.height, shape.flipU1),
tuftQuadSingle(shape.size, shape.height, shape.flipU2).rotate(rot(UP))
).map { it.move(shape.offset) }
.map { it.colorAndIndex(overrideColor) }
.map { it.colorIndex(tintIndex) }
.map { it.sprite(spriteGetter(idx)) }
}