no stuttering zoom (inefficient)

This commit is contained in:
minjaesong
2019-08-12 03:04:16 +09:00
parent d8d095c0a2
commit e8b2b04c62
3 changed files with 26 additions and 13 deletions

View File

@@ -250,11 +250,17 @@ object IngameRenderer : Disposable {
aTex.bind(1)
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0) // so that batch that comes next will bind any tex to it
batch.inUse {
blendNormal(batch)
batch.shader = shaderBlendGlow
shaderBlendGlow.setUniformi("tex1", 1)
batch.draw(rgbTex, 0f, 0f, rgbTex.width * zoom, rgbTex.height * zoom)
batch.draw(rgbTex,
-0.5f * rgbTex.width * zoom + 0.5f * rgbTex.width,
-0.5f * rgbTex.height * zoom + 0.5f * rgbTex.height,
rgbTex.width * zoom,
rgbTex.height * zoom
)
}
@@ -268,8 +274,12 @@ object IngameRenderer : Disposable {
batch.inUse {
blendNormal(batch)
batch.shader = null
batch.draw(rgbTex, 0f, 0f, rgbTex.width * zoom, rgbTex.height * zoom)
batch.draw(rgbTex,
-0.5f * rgbTex.width * zoom + 0.5f * rgbTex.width,
-0.5f * rgbTex.height * zoom + 0.5f * rgbTex.height,
rgbTex.width * zoom,
rgbTex.height * zoom
)
// indicator
batch.color = Color.RED
@@ -291,8 +301,12 @@ object IngameRenderer : Disposable {
batch.inUse {
blendNormal(batch)
batch.shader = null
batch.draw(aTex, 0f, 0f, aTex.width * zoom, aTex.height * zoom)
batch.draw(aTex,
-0.5f * aTex.width * zoom + 0.5f * aTex.width,
-0.5f * aTex.height * zoom + 0.5f * aTex.height,
aTex.width * zoom,
aTex.height * zoom
)
// indicator
batch.color = Color.WHITE

View File

@@ -21,7 +21,7 @@ class UIScreenZoom : UICanvas(
override var width = AppLoader.fontGame.getWidth(zoomText)
override var height = AppLoader.fontGame.lineHeight.toInt()
override var openCloseTime = 0.3f
override var openCloseTime = 0.2f
override val mouseUp = false