unsafeptr is now byte-aligned

This commit is contained in:
minjaesong
2022-04-06 20:54:58 +09:00
parent d958683365
commit 97633eba46
4 changed files with 51 additions and 49 deletions

View File

@@ -1,5 +1,7 @@
package net.torvald.terrarum.modulebasegame.gameactors
import net.torvald.terrarum.gameactors.ActorMovingPlatform
/**
* Created by minjaesong on 2022-03-02.
*/

View File

@@ -82,11 +82,11 @@ internal object LightmapHDRMap : Disposable {
operator fun invoke() {
THE_LUT.forEachIndexed { i, f ->
ptr.setFloat(4L * i, f)
ptr.setFloat(i.toLong(), f)
}
}
inline operator fun get(index: Int) = ptr.getFloat(4L * index)
inline operator fun get(index: Int) = ptr.getFloat(index.toLong())
val lastIndex = THE_LUT.lastIndex
val size = lastIndex + 1