mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
skybox will now scaled properly according to screen zoom
Former-commit-id: 619bfcad7bd14313d8f94c291350ddb5bb9684b4 Former-commit-id: c42d41c7e32a2c44cffc7d1450fa550d7d5c32f7
This commit is contained in:
@@ -283,7 +283,6 @@ constructor() : BasicGameState() {
|
|||||||
blendNormal()
|
blendNormal()
|
||||||
|
|
||||||
|
|
||||||
// FIXME skybox is not scaled at all
|
|
||||||
drawSkybox(worldDrawFrameBuffer.graphics)
|
drawSkybox(worldDrawFrameBuffer.graphics)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ object WeatherMixer {
|
|||||||
|
|
||||||
lateinit var mixedWeather: BaseModularWeather
|
lateinit var mixedWeather: BaseModularWeather
|
||||||
|
|
||||||
private var skyBoxCurrent = Rectangle(0f, 0f, Terrarum.WIDTH.toFloat(), Terrarum.HEIGHT.toFloat())
|
|
||||||
private var skyBoxNext = Rectangle(0f, 0f, Terrarum.WIDTH.toFloat(), Terrarum.HEIGHT.toFloat())
|
|
||||||
val globalLightNow = Color(0)
|
val globalLightNow = Color(0)
|
||||||
|
|
||||||
// Weather indices
|
// Weather indices
|
||||||
@@ -84,10 +82,15 @@ object WeatherMixer {
|
|||||||
val skyColourFill = GradientFill(
|
val skyColourFill = GradientFill(
|
||||||
0f, 0f,
|
0f, 0f,
|
||||||
getGradientColour(skyboxColourMap, 0, timeNow),
|
getGradientColour(skyboxColourMap, 0, timeNow),
|
||||||
0f, Terrarum.HEIGHT.toFloat(),
|
0f, Terrarum.HEIGHT / Terrarum.ingame.screenZoom,
|
||||||
getGradientColour(skyboxColourMap, 1, timeNow)
|
getGradientColour(skyboxColourMap, 1, timeNow)
|
||||||
)
|
)
|
||||||
g.fill(skyBoxCurrent, skyColourFill)
|
g.fill(Rectangle(
|
||||||
|
0f, 0f,
|
||||||
|
Terrarum.WIDTH / Terrarum.ingame.screenZoom,
|
||||||
|
Terrarum.HEIGHT / Terrarum.ingame.screenZoom),
|
||||||
|
skyColourFill
|
||||||
|
)
|
||||||
|
|
||||||
// calculate global light
|
// calculate global light
|
||||||
val gradCol = getGradientColour(lightColourMap, 0, timeNow)
|
val gradCol = getGradientColour(lightColourMap, 0, timeNow)
|
||||||
|
|||||||
Reference in New Issue
Block a user