new param 'frameDelta' on every render() function

This commit is contained in:
minjaesong
2024-01-04 16:38:58 +09:00
parent f2ecb109e6
commit f54a2133f9
116 changed files with 374 additions and 348 deletions

View File

@@ -567,7 +567,7 @@ internal object WeatherMixer : RNGConsumer {
/**
* Sub-portion of IngameRenderer. You are not supposed to directly deal with this.
*/
internal fun render(camera: OrthographicCamera, batch: FlippingSpriteBatch, world: GameWorld) {
internal fun render(frameDelta: Float, camera: OrthographicCamera, batch: FlippingSpriteBatch, world: GameWorld) {
solarElev = if (forceSolarElev != null)
forceSolarElev!!
else if (forceTimeAt != null)
@@ -576,7 +576,7 @@ internal object WeatherMixer : RNGConsumer {
world.worldTime.solarElevationDeg
drawSkybox(camera, batch, world)
drawClouds(batch, world)
drawClouds(frameDelta, batch, world)
batch.color = Color.WHITE
}
@@ -598,7 +598,7 @@ internal object WeatherMixer : RNGConsumer {
* Dependent on the `drawSkybox(camera, batch, world)` for the `cloudDrawColour`
*
*/
private fun drawClouds(batch: SpriteBatch, world: GameWorld) {
private fun drawClouds(frameDelta: Float, batch: SpriteBatch, world: GameWorld) {
val currentWeather = world.weatherbox.currentWeather
val timeNow = (forceTimeAt ?: world.worldTime.TIME_T.toInt()) % WorldTime.DAY_LENGTH
@@ -617,7 +617,7 @@ internal object WeatherMixer : RNGConsumer {
val shadiness = (1.0 / cosh(altOfSolarRay * 0.5)).toFloat().coerceAtLeast(if (altOfSolarRay < 0) 0.6666f else 0f)
// printdbg(this, "cloudY=${-it.posY}\tsolarElev=$solarElev\trayAlt=$altOfSolarRay\tshady=$shadiness")
it.render(batch as UnpackedColourSpriteBatch, cloudDrawColour.toGdxColor(), shadiness)
it.render(frameDelta, batch as UnpackedColourSpriteBatch, cloudDrawColour.toGdxColor(), shadiness)
}
}
}

View File

@@ -28,6 +28,6 @@ abstract class WeatherObject : Disposable {
var flagToDespawn = false
abstract fun update()
abstract fun render(batch: SpriteBatch, offsetX: Float, offsetY: Float)
abstract fun render(frameDelta: Float, batch: SpriteBatch, offsetX: Float, offsetY: Float)
}

View File

@@ -86,7 +86,7 @@ class WeatherObjectCloud(
return java.lang.Float.intBitsToFloat(hi)
}
fun render(batch: UnpackedColourSpriteBatch, cloudDrawColour0: Color, shadiness: Float) {
fun render(frameDelta: Float, batch: UnpackedColourSpriteBatch, cloudDrawColour0: Color, shadiness: Float) {
val sc = screenCoord
// printdbg(this, "gamma: (${rgbGamma}, ${aGamma}) index: ($rgbGammaIndex, $aGammaIndex)")
@@ -107,7 +107,7 @@ class WeatherObjectCloud(
* X/Y position is a bottom-centre point of the image
* Shader must be prepared prior to the render() call
*/
override fun render(batch: SpriteBatch, offsetX: Float, offsetY: Float) {
override fun render(frameDelta: Float, batch: SpriteBatch, offsetX: Float, offsetY: Float) {
throw UnsupportedOperationException()
}