Skip to content

Commit

Permalink
Add explicit conversion from double->int->byte
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo27 committed Sep 20, 2020
1 parent f38be3d commit 1eb1137
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/kotlin/rhmodding/bread/model/bccad/BCCAD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1eb1137

Please sign in to comment.