mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
renderFront is fixed
This commit is contained in:
@@ -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))"!
|
||||
|
||||
Reference in New Issue
Block a user