fog: fix color not clearing anymore

When you went in water the blue color never cleared
This commit is contained in:
Moritz Zwerger 2025-03-06 23:16:21 +01:00
parent 8e80d91494
commit a998fcd989
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -76,9 +76,9 @@ class FogManager(
return
}
save()
this.options = options
state.revision++
save()
context.camera.matrix.invalidate()
}
@ -98,7 +98,7 @@ class FogManager(
state.end = interpolateLinear(progress, interpolation.end, options?.end ?: 0.0f)
val sourceColor = interpolation.color ?: options?.color ?: Colors.TRANSPARENT
val targetColor = options?.color ?: RGBColor(sourceColor.red, sourceColor.green, sourceColor.blue, 0x00)
val targetColor = options?.color ?: Colors.TRANSPARENT
var color: RGBColor? = interpolateSine(progress, sourceColor, targetColor)
if (color == Colors.TRANSPARENT) {
color = null