mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
trying bytebuf and FloatVector
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package net.torvald.terrarum.blockproperties
|
||||
|
||||
import jdk.incubator.vector.FloatVector
|
||||
import net.torvald.gdx.graphics.Cvec
|
||||
import net.torvald.gdx.graphics.VectorArray.Companion.NULLVEC
|
||||
import net.torvald.random.XXHash32
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
@@ -22,7 +24,7 @@ class BlockProp {
|
||||
var shadeColB = 0f
|
||||
var shadeColA = 0f
|
||||
|
||||
lateinit var opacity: Cvec
|
||||
lateinit var opacity: FloatVector
|
||||
|
||||
fun getOpacity(channel: Int) = when (channel) {
|
||||
0 -> shadeColR
|
||||
@@ -54,12 +56,12 @@ class BlockProp {
|
||||
internal var baseLumColG = 0f // base value used to calculate dynamic luminosity
|
||||
internal var baseLumColB = 0f // base value used to calculate dynamic luminosity
|
||||
internal var baseLumColA = 0f // base value used to calculate dynamic luminosity
|
||||
internal val baseLumCol = Cvec(0)
|
||||
internal var baseLumCol: FloatVector = NULLVEC
|
||||
//var lumColR = 0f // memoised value of dynamic luminosity
|
||||
//var lumColG = 0f // memoised value of dynamic luminosity
|
||||
//var lumColB = 0f // memoised value of dynamic luminosity
|
||||
//var lumColA = 0f // memoised value of dynamic luminosity
|
||||
internal val _lumCol = Cvec(0)
|
||||
internal var _lumCol: FloatVector = NULLVEC
|
||||
// X- and Y-value must be treated properly beforehand! (use GameWorld.coerceXY())
|
||||
fun getLumCol(x: Int, y: Int) = if (dynamicLuminosityFunction == 0) {
|
||||
baseLumCol
|
||||
|
||||
Reference in New Issue
Block a user