renderFront is fixed

This commit is contained in:
minjaesong
2017-10-14 02:48:52 +09:00
parent d225ed9e5f
commit 676be82f7f
3 changed files with 21 additions and 9 deletions

View File

@@ -397,26 +397,28 @@ object BlocksDrawer {
renderUsingBuffer(TERRAIN, batch.projectionMatrix)
}
@Deprecated("It's broken right now; don't use it")
// FIXME biatch
fun renderFront(batch: SpriteBatch, drawWires: Boolean) {
// blend mul
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
Gdx.gl.glEnable(GL20.GL_BLEND)
Gdx.gl.glBlendFunc(GL20.GL_DST_COLOR, GL20.GL_ONE_MINUS_SRC_ALPHA)
drawTiles(TERRAIN, true) // blendmul tiles
renderUsingBuffer(TERRAIN, batch.projectionMatrix)
if (drawWires) {
drawTiles(WIRE, false)
renderUsingBuffer(WIRE, batch.projectionMatrix)
}
// blend normal
Gdx.gl.glEnable(GL20.GL_TEXTURE_2D)
Gdx.gl.glEnable(GL20.GL_BLEND)
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
if (drawWires) {
drawTiles(WIRE, false)
renderUsingBuffer(WIRE, batch.projectionMatrix)
}
}
private val tileDrawLightThreshold = 2f / LightmapRenderer.MUL
@@ -522,6 +524,9 @@ object BlocksDrawer {
if (isBlendMul(thisTile)) {
writeToBuffer(mode, x - for_x_start, y - for_y_start, thisTileX, thisTileY)
}
else {
writeToBuffer(mode, x - for_x_start, y - for_y_start, 0, 0)
}
}
else {
// do NOT add "if (!isBlendMul(thisTile))"!