mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
tree impl test; falling blocks won't destroy transparent blocks
This commit is contained in:
Binary file not shown.
@@ -10,9 +10,9 @@ uniform sampler2D u_texture;
|
||||
|
||||
|
||||
// "steps" of R, G and B. Must be integer && equal or greater than 2
|
||||
uniform float rcount = 64.0;
|
||||
uniform float rcount = 32.0;
|
||||
uniform float gcount = 64.0;
|
||||
uniform float bcount = 64.0;
|
||||
uniform float bcount = 32.0;
|
||||
uniform float acount = 1.0;
|
||||
|
||||
int bayer[14 * 14] = int[](131,187,8,78,50,18,134,89,155,102,29,95,184,73,22,86,113,171,142,105,34,166,9,60,151,128,40,110,168,137,45,28,64,188,82,54,124,189,80,13,156,56,7,61,186,121,154,6,108,177,24,100,38,176,93,123,83,148,96,17,88,133,44,145,69,161,139,72,30,181,115,27,163,47,178,65,164,14,120,48,5,127,153,52,190,58,126,81,116,21,106,77,173,92,191,63,99,12,76,144,4,185,37,149,192,39,135,23,117,31,170,132,35,172,103,66,129,79,3,97,57,159,70,141,53,94,114,20,49,158,19,146,169,122,183,11,104,180,2,165,152,87,182,118,91,42,67,25,84,147,43,85,125,68,16,136,71,10,193,112,160,138,51,111,162,26,194,46,174,107,41,143,33,74,1,101,195,15,75,140,109,90,32,62,157,98,167,119,179,59,36,130,175,55,0,150);
|
||||
@@ -53,6 +53,7 @@ void main(void) {
|
||||
|
||||
vec2 entry = mod(gl_FragCoord.xy, vec2(bayerSize, bayerSize));
|
||||
|
||||
gl_FragColor = nearestColour(inColor + spread * (bayer[int(entry.y) * int(bayerSize) + int(entry.x)] / bayerDivider - 0.5));
|
||||
vec4 outColor = nearestColour(inColor + spread * (bayer[int(entry.y) * int(bayerSize) + int(entry.x)] / bayerDivider - 0.5));
|
||||
|
||||
gl_FragColor = outColor;
|
||||
}
|
||||
Binary file not shown.
BIN
assets/mods/basegame/blocks/65.tga
LFS
Normal file
BIN
assets/mods/basegame/blocks/65.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/blocks/66.tga
LFS
Normal file
BIN
assets/mods/basegame/blocks/66.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/blocks/67.tga
LFS
Normal file
BIN
assets/mods/basegame/blocks/67.tga
LFS
Normal file
Binary file not shown.
@@ -18,10 +18,10 @@
|
||||
"49";"49";"BLOCK_PLANK_EBONY";"0.1252";"0.1252";"0.1252";"0.1252";"19";"1200";"WOOD";"1";"0";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"50";"50";"BLOCK_PLANK_BIRCH";"0.1252";"0.1252";"0.1252";"0.1252";"15";"670";"WOOD";"1";"0";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"51";"51";"BLOCK_PLANK_BLOODROSE";"0.1252";"0.1252";"0.1252";"0.1252";"17";"900";"WOOD";"1";"0";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"64";"64";"BLOCK_TRUNK_NORMAL";"0.1252";"0.1252";"0.1252";"0.1252";"16";"740";"WOOD";"1";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"65";"65";"BLOCK_TRUNK_EBONY";"0.1252";"0.1252";"0.1252";"0.1252";"19";"1200";"WOOD";"1";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"66";"66";"BLOCK_TRUNK_BIRCH";"0.1252";"0.1252";"0.1252";"0.1252";"15";"670";"WOOD";"1";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"67";"67";"BLOCK_TRUNK_BLOODROSE";"0.1252";"0.1252";"0.1252";"0.1252";"17";"900";"WOOD";"1";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"64";"64";"BLOCK_TRUNK_NORMAL";"0.1252";"0.1252";"0.1252";"0.1252";"16";"740";"WOOD";"0";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"65";"65";"BLOCK_TRUNK_EBONY";"0.1252";"0.1252";"0.1252";"0.1252";"19";"1200";"WOOD";"0";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"66";"66";"BLOCK_TRUNK_BIRCH";"0.1252";"0.1252";"0.1252";"0.1252";"15";"670";"WOOD";"0";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"67";"67";"BLOCK_TRUNK_BLOODROSE";"0.1252";"0.1252";"0.1252";"0.1252";"17";"900";"WOOD";"0";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"80";"80";"BLOCK_SAND";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"81";"81";"BLOCK_SAND_WHITE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
"82";"82";"BLOCK_SAND_RED";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A"
|
||||
|
||||
|
@@ -101,7 +101,7 @@ object DefaultConfig {
|
||||
|
||||
|
||||
// "fancy" graphics settings
|
||||
jsonObject.addProperty("fxdither", true)
|
||||
jsonObject.addProperty("fxretro", false)
|
||||
//jsonObject.addProperty("fx3dlut", false)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user