tree impl test; falling blocks won't destroy transparent blocks

This commit is contained in:
minjaesong
2019-07-31 01:38:27 +09:00
parent d37f431144
commit d767dc1dbf
12 changed files with 32 additions and 16 deletions

View File

@@ -101,7 +101,7 @@ object DefaultConfig {
// "fancy" graphics settings
jsonObject.addProperty("fxdither", true)
jsonObject.addProperty("fxretro", false)
//jsonObject.addProperty("fx3dlut", false)

View File

@@ -39,7 +39,7 @@ object PostProcessor : Disposable {
private val debugUI = BasicDebugInfoWindow()
private var functionRowHelper = Texture(Gdx.files.internal("assets/graphics/function_row_help.png"))
private val functionRowHelper = Texture(Gdx.files.internal("assets/graphics/function_row_help.png"))
init {
AppLoader.disposableSingletonsPool.add(this)
@@ -48,6 +48,7 @@ object PostProcessor : Disposable {
override fun dispose() {
batch.dispose()
shapeRenderer.dispose()
functionRowHelper.dispose()
try {
lutTex.dispose()
}
@@ -117,7 +118,7 @@ object PostProcessor : Disposable {
private fun postShader(projMat: Matrix4, fbo: FrameBuffer) {
val shader: ShaderProgram? =
if (AppLoader.getConfigBoolean("fxdither"))
if (AppLoader.getConfigBoolean("fxretro"))
AppLoader.shaderHicolour
else
AppLoader.shaderPassthruRGB

View File

@@ -24,6 +24,10 @@ class BlockProp {
var viscosity: Int = 0
var colour: Int = 0
/** isSolid is NOT SAME AS !isOpaqueis
* Like, don't ever use this vars to tell this block should be removed by water or something,
* because PLANTS ARE ACTORS, TREES ARE BLOCKS, stupid myself!
*/
var isSolid: Boolean = false
//var isClear: Boolean = false
var isPlatform: Boolean = false

View File

@@ -194,7 +194,7 @@ object WorldSimulator {
for (y in updateYTo downTo updateYFrom) {
val currentTile = world.getTileFromTerrain(x, y)
val prop = BlockCodex[currentTile]
val isSolid = prop.isSolid
val isAir = currentTile == Block.AIR
val support = prop.maxSupport
val isFallable = support != -1
@@ -211,10 +211,10 @@ object WorldSimulator {
fallableStackProcessed = true
}
else if (isSolid) {
else if (!isAir) {
fallDownCounter = 0
}
else if (!isSolid && !isFallable && fallDownCounter < FALLABLE_MAX_FALL_SPEED) {
else if (!isFallable && fallDownCounter < FALLABLE_MAX_FALL_SPEED) {
fallDownCounter += 1
}
}

View File

@@ -160,7 +160,8 @@ internal object BlocksDrawer {
private val connectLut16 = intArrayOf(0,2,0,2,4,6,4,6,0,2,0,2,4,6,4,6,8,10,8,10,12,14,12,14,8,10,8,10,12,14,12,14,0,2,0,2,4,6,4,6,0,2,0,2,4,6,4,6,8,10,8,10,12,14,12,14,8,10,8,10,12,14,12,14,1,3,1,3,5,7,5,7,1,3,1,3,5,7,5,7,9,11,9,11,13,15,13,15,9,11,9,11,13,15,13,15,1,3,1,3,5,7,5,7,1,3,1,3,5,7,5,7,9,11,9,11,13,15,13,15,9,11,9,11,13,15,13,15,0,2,0,2,4,6,4,6,0,2,0,2,4,6,4,6,8,10,8,10,12,14,12,14,8,10,8,10,12,14,12,14,0,2,0,2,4,6,4,6,0,2,0,2,4,6,4,6,8,10,8,10,12,14,12,14,8,10,8,10,12,14,12,14,1,3,1,3,5,7,5,7,1,3,1,3,5,7,5,7,9,11,9,11,13,15,13,15,9,11,9,11,13,15,13,15,1,3,1,3,5,7,5,7,1,3,1,3,5,7,5,7,9,11,9,11,13,15,13,15,9,11,9,11,13,15,13,15)
init {
assert(256 == connectLut47.size && 256 == connectLut16.size)
assert(256 == connectLut47.size)
assert(256 == connectLut16.size)
}
/**