un-hardcode fog config

This commit is contained in:
2023-08-17 21:17:28 +10:00
parent 2c5547320d
commit d045560ef5
7 changed files with 218 additions and 63 deletions

View File

@ -1,6 +1,8 @@
package gay.pizza.CavesOfJolk
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g3d.Attribute
import com.badlogic.gdx.graphics.g3d.Attributes
import com.badlogic.gdx.math.MathUtils
import com.badlogic.gdx.math.Vector2
import ktx.math.div
@ -58,3 +60,7 @@ fun Color.mix(rhs: Color, x: Float) = Color(
MathUtils.lerp(this.g, rhs.g, x),
MathUtils.lerp(this.b, rhs.b, x),
MathUtils.lerp(this.a, rhs.a, x))
//FIXME: find some way to get rid of these warnings
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "UNCHECKED_CAST")
fun <T: Attribute> Attributes.get(type: Long) = get(type) as? T