mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
weather only change on titlescreen
This commit is contained in:
@@ -205,7 +205,7 @@ object IngameRenderer : Disposable {
|
|||||||
actorsRenderOverlay: List<ActorWithBody>,
|
actorsRenderOverlay: List<ActorWithBody>,
|
||||||
particlesContainer : CircularArray<ParticleBase>,
|
particlesContainer : CircularArray<ParticleBase>,
|
||||||
player: ActorWithBody? = null,
|
player: ActorWithBody? = null,
|
||||||
uiContainer: UIContainer? = null
|
uiContainer: UIContainer? = null,
|
||||||
) {
|
) {
|
||||||
renderingActorsCount = (actorsRenderBehind.size) +
|
renderingActorsCount = (actorsRenderBehind.size) +
|
||||||
(actorsRenderMiddle.size) +
|
(actorsRenderMiddle.size) +
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
actorGamer = player
|
actorGamer = player
|
||||||
forceAddActor(player)
|
forceAddActor(player)
|
||||||
|
|
||||||
|
WeatherMixer.internalReset()
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyToggler.forceSet(Input.Keys.Q, false)
|
KeyToggler.forceSet(Input.Keys.Q, false)
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
//ReadWorld.readWorldAndSetNewWorld(Terrarum.ingame!! as TerrarumIngame, reader)
|
//ReadWorld.readWorldAndSetNewWorld(Terrarum.ingame!! as TerrarumIngame, reader)
|
||||||
val world = ReadSimpleWorld(reader, file)
|
val world = ReadSimpleWorld(reader, file)
|
||||||
demoWorld = world
|
demoWorld = world
|
||||||
demoWorld.worldTime.timeDelta = 0//60
|
demoWorld.worldTime.timeDelta = 440 // a year = 6 minutes
|
||||||
printdbg(this, "Demo world loaded")
|
printdbg(this, "Demo world loaded")
|
||||||
}
|
}
|
||||||
catch (e: IOException) {
|
catch (e: IOException) {
|
||||||
@@ -281,9 +281,14 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val updateScreen = { delta: Float ->
|
private val updateScreen = { delta: Float ->
|
||||||
demoWorld.globalLight = WeatherMixer.globalLightNow
|
// TODO: desynched weather and time-of-day change
|
||||||
|
|
||||||
|
val forcedTime = 39693
|
||||||
|
// demoWorld.globalLight = WeatherMixer.globalLightNow
|
||||||
|
demoWorld.globalLight = WeatherMixer.getGlobalLightOfTime(demoWorld, forcedTime)
|
||||||
demoWorld.updateWorldTime(delta)
|
demoWorld.updateWorldTime(delta)
|
||||||
WeatherMixer.update(delta, cameraPlayer, demoWorld)
|
// WeatherMixer.update(delta, cameraPlayer, demoWorld)
|
||||||
|
WeatherMixer.forceTimeAt = forcedTime
|
||||||
cameraPlayer.update(delta)
|
cameraPlayer.update(delta)
|
||||||
|
|
||||||
// worldcamera update AFTER cameraplayer in this case; the other way is just an exception for actual ingame SFX
|
// worldcamera update AFTER cameraplayer in this case; the other way is just an exception for actual ingame SFX
|
||||||
|
|||||||
@@ -57,6 +57,18 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
|
|
||||||
// TODO to save from GL overhead, store lightmap to array; use GdxColorMap
|
// TODO to save from GL overhead, store lightmap to array; use GdxColorMap
|
||||||
|
|
||||||
|
var forceTimeAt: Int? = null
|
||||||
|
|
||||||
|
override fun loadFromSave(s0: Long, s1: Long) {
|
||||||
|
super.loadFromSave(s0, s1)
|
||||||
|
internalReset()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun internalReset() {
|
||||||
|
globalLightOverridden = false
|
||||||
|
forceTimeAt = null
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
weatherList = HashMap<String, ArrayList<BaseModularWeather>>()
|
weatherList = HashMap<String, ArrayList<BaseModularWeather>>()
|
||||||
|
|
||||||
@@ -146,7 +158,7 @@ internal object WeatherMixer : RNGConsumer {
|
|||||||
|
|
||||||
|
|
||||||
// we will not care for nextSkybox for now
|
// we will not care for nextSkybox for now
|
||||||
val timeNow = world.worldTime.TIME_T.toInt() % WorldTime.DAY_LENGTH
|
val timeNow = (forceTimeAt ?: world.worldTime.TIME_T.toInt()) % WorldTime.DAY_LENGTH
|
||||||
val skyboxColourMap = currentWeather.skyboxGradColourMap
|
val skyboxColourMap = currentWeather.skyboxGradColourMap
|
||||||
|
|
||||||
// calculate global light
|
// calculate global light
|
||||||
|
|||||||
Reference in New Issue
Block a user