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

@ -0,0 +1,37 @@
package gay.pizza.CavesOfJolk
import com.badlogic.gdx.graphics.g3d.attributes.IntAttribute
class CustomIntAttribute private constructor(type: Long, value: Int): IntAttribute(type, value)
{
enum class FogModes(private val value: Int)
{
Distance(0),
Depth(1);
fun toInt() = value
}
enum class FogTypes(private val value: Int)
{
Original(0),
Linear(1),
Smooth(2),
InvSquare(3),
Exp(4),
Exp2(5);
fun toInt() = value
}
companion object
{
const val FogModeAlias = "fogMode"
val FogMode = register(FogModeAlias)
fun createFogMode(value: FogModes) = CustomIntAttribute(FogMode, value.toInt())
const val FogTypeAlias = "fogType"
val FogType = register(FogTypeAlias)
fun createFogType(value: FogTypes) = CustomIntAttribute(FogType, value.toInt())
}
}