mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 22:14:05 +09:00
new param 'frameDelta' on every render() function
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user