mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
title screen renders well
This commit is contained in:
@@ -1,10 +1,25 @@
|
||||
package net.torvald.terrarum
|
||||
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
|
||||
object CreditSingleton {
|
||||
|
||||
val contents = """Terrarum
|
||||
val contents =
|
||||
Lang["CREDITS_PROGRAMMER"] + "\n\nTorvald (minjaesong)\n\n" +
|
||||
Lang["CREDITS_ARTIST_PLURAL"] + "\n\nTorvald (minjaesong)\nRoundworld (leedonggeun)\"" +
|
||||
"""
|
||||
|
||||
Copyright (C) 2013-2017 Minjaesong (Torvald)
|
||||
|
||||
|
||||
|
||||
Copyright Informations
|
||||
|
||||
|
||||
|
||||
|
||||
Terrarum
|
||||
|
||||
Copyright (C) 2013-2017 Torvald (minjaesong)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -696,6 +696,7 @@ inline fun FrameBuffer.inAction(camera: OrthographicCamera?, batch: SpriteBatch?
|
||||
batch?.projectionMatrix = camera?.combined
|
||||
action(this)
|
||||
this.end()
|
||||
camera?.setToOrtho(true, Terrarum.WIDTH.toFloat(), Terrarum.HEIGHT.toFloat())
|
||||
}
|
||||
|
||||
fun Float.round(): Float {
|
||||
|
||||
@@ -119,7 +119,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
private var blurWriteBuffer = lightmapFboA
|
||||
private var blurReadBuffer = lightmapFboB
|
||||
|
||||
private val minimumIntroTime = 1.0f
|
||||
private val minimumIntroTime = 2.0f
|
||||
private var deltaCounter = 0f
|
||||
|
||||
override fun render(delta: Float) {
|
||||
@@ -150,6 +150,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
}
|
||||
}
|
||||
else {
|
||||
demoWorld.globalLight = WeatherMixer.globalLightNow
|
||||
demoWorld.updateWorldTime(delta)
|
||||
WeatherMixer.update(delta, cameraPlayer)
|
||||
cameraPlayer.update(delta)
|
||||
@@ -167,8 +168,8 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
|
||||
|
||||
// render and blur lightmap
|
||||
//processBlur(LightmapRenderer.DRAW_FOR_RGB)
|
||||
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE)
|
||||
processBlur(LightmapRenderer.DRAW_FOR_RGB)
|
||||
//camera.setToOrtho(true, Terrarum.WIDTH.toFloat(), Terrarum.HEIGHT.toFloat())
|
||||
|
||||
// render world
|
||||
batch.inUse {
|
||||
@@ -220,6 +221,30 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
BlocksDrawer.renderFront(batch, false)
|
||||
FeaturesDrawer.drawEnvOverlay(batch)
|
||||
|
||||
|
||||
// draw lightmap //
|
||||
setCameraPosition(0f, 0f)
|
||||
batch.shader = Terrarum.shaderBayer
|
||||
batch.shader.setUniformf("rcount", 64f)
|
||||
batch.shader.setUniformf("gcount", 64f)
|
||||
batch.shader.setUniformf("bcount", 64f) // de-banding
|
||||
val lightTex = blurWriteBuffer.colorBufferTexture
|
||||
lightTex.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear)
|
||||
blendMul()
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(lightTex,
|
||||
0f, 0f,
|
||||
lightTex.width * Ingame.lightmapDownsample, lightTex.height * Ingame.lightmapDownsample
|
||||
)
|
||||
|
||||
batch.shader = null
|
||||
|
||||
|
||||
// move camera back to its former position
|
||||
// using custom code for camera; this is obscure and tricky
|
||||
camera.position.set(WorldCamera.gdxCamX, WorldCamera.gdxCamY, 0f) // make camara work
|
||||
camera.update()
|
||||
batch.projectionMatrix = camera.combined
|
||||
}
|
||||
|
||||
private fun renderMenus() {
|
||||
@@ -268,6 +293,12 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
|
||||
uiMenu.UI.resize(Terrarum.WIDTH, Terrarum.HEIGHT)
|
||||
uiMenu.setPosition(0, UIStartMenu.menubarOffY)
|
||||
}
|
||||
|
||||
lightmapFboA.dispose()
|
||||
lightmapFboA = FrameBuffer(lightFBOformat, Terrarum.WIDTH.div(Ingame.lightmapDownsample.toInt()), Terrarum.HEIGHT.div(Ingame.lightmapDownsample.toInt()), false)
|
||||
lightmapFboB.dispose()
|
||||
lightmapFboB = FrameBuffer(lightFBOformat, Terrarum.WIDTH.div(Ingame.lightmapDownsample.toInt()), Terrarum.HEIGHT.div(Ingame.lightmapDownsample.toInt()), false)
|
||||
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
|
||||
@@ -23,7 +23,7 @@ class UIStartMenu : UICanvas() {
|
||||
|
||||
|
||||
override var width: Int = 240
|
||||
override var height: Int = 40 * menuLabels.size.plus(1)
|
||||
override var height: Int = 36 * menuLabels.size.plus(1)
|
||||
override var openCloseTime = 0f
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user