From 1eb1137f738282e23f8d0151a510eac3128b4339 Mon Sep 17 00:00:00 2001 From: chrislo27 Date: Sat, 19 Sep 2020 23:20:25 -0700 Subject: [PATCH] Add explicit conversion from double->int->byte --- .../rhmodding/bread/model/bccad/BCCAD.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/rhmodding/bread/model/bccad/BCCAD.kt b/src/main/kotlin/rhmodding/bread/model/bccad/BCCAD.kt index ee3d59f..654ad54 100644 --- a/src/main/kotlin/rhmodding/bread/model/bccad/BCCAD.kt +++ b/src/main/kotlin/rhmodding/bread/model/bccad/BCCAD.kt @@ -125,12 +125,12 @@ class BCCAD : IDataModel { .putFloat(rotation) .put((if (flipX) 1 else 0).toByte()) .put((if (flipY) 1 else 0).toByte()) - .put((multColor.red * 255).toByte()) - .put((multColor.green * 255).toByte()) - .put((multColor.blue * 255).toByte()) - .put((screenColor.red * 255).toByte()) - .put((screenColor.green * 255).toByte()) - .put((screenColor.blue * 255).toByte()) + .put((multColor.red * 255).toInt().toByte()) + .put((multColor.green * 255).toInt().toByte()) + .put((multColor.blue * 255).toInt().toByte()) + .put((screenColor.red * 255).toInt().toByte()) + .put((screenColor.green * 255).toInt().toByte()) + .put((screenColor.blue * 255).toInt().toByte()) .put(opacity.toByte()) repeat(12) { bytes.put(unknownData[it]) @@ -165,9 +165,9 @@ class BCCAD : IDataModel { .putFloat(stretchX) .putFloat(stretchY) .putFloat(rotation) - .put((color.red * 255).toByte()) - .put((color.green * 255).toByte()) - .put((color.blue * 255).toByte()) + .put((color.red * 255).toInt().toByte()) + .put((color.green * 255).toInt().toByte()) + .put((color.blue * 255).toInt().toByte()) .put(0.toByte()) .put(unknown1) .put(unknown2)