fix crashes

This commit is contained in:
DBotThePony 2022-10-08 00:57:49 +07:00
parent b93faa77b7
commit f14b6a809e
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -236,12 +236,12 @@ sealed class AbstractSkinElement {
u1: Float,
v1: Float,
) {
val intColor = color?.toRGBA() ?: 0
val intColor = color?.toARGB() ?: 0
val matrix = pose.last().pose()
builder.vertex(matrix, x, y + height, z).uv(u0, v1).also { if (color != null) it.color(intColor) }.endVertex()
builder.vertex(matrix, x + width, y + height, z).uv(u1, v1).also { if (color != null) it.color(intColor) }.endVertex()
builder.vertex(matrix, x + width, y, z).uv(u1, v0).also { if (color != null) it.color(intColor) }.endVertex()
builder.vertex(matrix, x, y, z).uv(u0, v0).also { if (color != null) it.color(intColor) }.endVertex()
builder.vertex(matrix, x, y + height, z).also { if (color != null) it.color(intColor) }.uv(u0, v1).endVertex()
builder.vertex(matrix, x + width, y + height, z).also { if (color != null) it.color(intColor) }.uv(u1, v1).endVertex()
builder.vertex(matrix, x + width, y, z).also { if (color != null) it.color(intColor) }.uv(u1, v0).endVertex()
builder.vertex(matrix, x, y, z).also { if (color != null) it.color(intColor) }.uv(u0, v0).endVertex()
}
@JvmOverloads
@ -303,7 +303,7 @@ sealed class AbstractSkinElement {
width: Float = this.width,
height: Float = this.height,
z: Float = 0f,
color: RGBAColor? = null,
color: RGBAColor = RGBAColor.WHITE,
winding: UVWindingOrder = this.winding,
) {
uploadOnto(pose, builder, x, y, width, height, z, color, winding)