skybox will now scaled properly according to screen zoom

Former-commit-id: 619bfcad7bd14313d8f94c291350ddb5bb9684b4
Former-commit-id: c42d41c7e32a2c44cffc7d1450fa550d7d5c32f7
This commit is contained in:
Song Minjae
2016-12-30 02:22:10 +09:00
parent cb6e18c1c5
commit 061c15d241
2 changed files with 7 additions and 5 deletions

View File

@@ -283,7 +283,6 @@ constructor() : BasicGameState() {
blendNormal()
// FIXME skybox is not scaled at all
drawSkybox(worldDrawFrameBuffer.graphics)

View File

@@ -29,8 +29,6 @@ object WeatherMixer {
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)
// Weather indices
@@ -84,10 +82,15 @@ object WeatherMixer {
val skyColourFill = GradientFill(
0f, 0f,
getGradientColour(skyboxColourMap, 0, timeNow),
0f, Terrarum.HEIGHT.toFloat(),
0f, Terrarum.HEIGHT / Terrarum.ingame.screenZoom,
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
val gradCol = getGradientColour(lightColourMap, 0, timeNow)