mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
tree foliage tiles
This commit is contained in:
Binary file not shown.
BIN
assets/mods/basegame/blocks/72.tga
LFS
Normal file
BIN
assets/mods/basegame/blocks/72.tga
LFS
Normal file
Binary file not shown.
@@ -10,12 +10,12 @@
|
|||||||
"32";"32";"32";"BLOCK_DIRT";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"DIRT";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"DIRT,NATURAL"
|
"32";"32";"32";"BLOCK_DIRT";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"DIRT";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"DIRT,NATURAL"
|
||||||
"33";"32";"32";"BLOCK_GRASS";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
"33";"32";"32";"BLOCK_GRASS";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
"34";"34";"34";"BLOCK_GRASSWALL";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
"34";"34";"34";"BLOCK_GRASSWALL";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"35";"35";"35";"BLOCK_FOLIAGE_GREEN";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"35";"35";"35";"BLOCK_FOLIAGE_GREEN";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"36";"36";"36";"BLOCK_FOLIAGE_LIME";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"36";"36";"36";"BLOCK_FOLIAGE_LIME";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"37";"37";"37";"BLOCK_FOLIAGE_GOLD";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"37";"37";"37";"BLOCK_FOLIAGE_GOLD";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"38";"38";"38";"BLOCK_FOLIAGE_RED";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"38";"38";"38";"BLOCK_FOLIAGE_RED";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"39";"39";"39";"BLOCK_FOLIAGE_ICEBLUE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"39";"39";"39";"BLOCK_FOLIAGE_ICEBLUE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
#"40";"40";"40";"BLOCK_FOLIAGE_PURPLE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"LEAVES,NATURAL"
|
#"40";"40";"40";"BLOCK_FOLIAGE_PURPLE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"1400";"GRSS";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"GRASS,NATURAL"
|
||||||
"48";"48";"48";"BLOCK_PLANK_NORMAL";"0.1252";"0.1252";"0.1252";"0.1252";"16";"740";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
"48";"48";"48";"BLOCK_PLANK_NORMAL";"0.1252";"0.1252";"0.1252";"0.1252";"16";"740";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
||||||
"49";"49";"49";"BLOCK_PLANK_EBONY";"0.1252";"0.1252";"0.1252";"0.1252";"19";"1200";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
"49";"49";"49";"BLOCK_PLANK_EBONY";"0.1252";"0.1252";"0.1252";"0.1252";"19";"1200";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
||||||
"50";"50";"50";"BLOCK_PLANK_BIRCH";"0.1252";"0.1252";"0.1252";"0.1252";"15";"670";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
"50";"50";"50";"BLOCK_PLANK_BIRCH";"0.1252";"0.1252";"0.1252";"0.1252";"15";"670";"WOOD";"1";"1";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"WOOD"
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
"65";"65";"65";"BLOCK_TRUNK_EBONY";"0.0312";"0.0312";"0.0312";"0.0312";"19";"1200";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
"65";"65";"65";"BLOCK_TRUNK_EBONY";"0.0312";"0.0312";"0.0312";"0.0312";"19";"1200";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
||||||
"66";"66";"66";"BLOCK_TRUNK_BIRCH";"0.0312";"0.0312";"0.0312";"0.0312";"15";"670";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
"66";"66";"66";"BLOCK_TRUNK_BIRCH";"0.0312";"0.0312";"0.0312";"0.0312";"15";"670";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
||||||
"67";"67";"67";"BLOCK_TRUNK_ROSEWOOD";"0.0312";"0.0312";"0.0312";"0.0312";"17";"900";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
"67";"67";"67";"BLOCK_TRUNK_ROSEWOOD";"0.0312";"0.0312";"0.0312";"0.0312";"17";"900";"WOOD";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,NATURAL"
|
||||||
|
"72";"72";"72";"BLOCK_FOLIAGE_NORMAL";"0.0312";"0.0312";"0.0312";"0.0312";"16";"740";"GRSS";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,LEAVES,NATURAL"
|
||||||
|
#"73";"73";"73";"BLOCK_FOLIAGE_EBONY";"0.0312";"0.0312";"0.0312";"0.0312";"19";"1200";"GRSS";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,LEAVES,NATURAL"
|
||||||
|
#"74";"74";"74";"BLOCK_FOLIAGE_BIRCH";"0.0312";"0.0312";"0.0312";"0.0312";"15";"670";"GRSS";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,LEAVES,NATURAL"
|
||||||
|
#"75";"75";"75";"BLOCK_FOLIAGE_ROSEWOOD";"0.0312";"0.0312";"0.0312";"0.0312";"17";"900";"GRSS";"0";"0";"N/A";"0";"0";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"TREE,LEAVES,NATURAL"
|
||||||
"80";"80";"80";"BLOCK_SAND";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
"80";"80";"80";"BLOCK_SAND";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
||||||
"81";"81";"81";"BLOCK_SAND_WHITE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
"81";"81";"81";"BLOCK_SAND_WHITE";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
||||||
"82";"82";"82";"BLOCK_SAND_RED";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
"82";"82";"82";"BLOCK_SAND_RED";"0.1252";"0.1252";"0.1252";"0.1252";"24";"2400";"SAND";"1";"0";"0";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.06";"SAND,NATURAL,WARM"
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 13 and column 2.
|
@@ -264,6 +264,7 @@ internal object BlocksDrawer {
|
|||||||
private lateinit var wallStickerTiles: Array<Int>
|
private lateinit var wallStickerTiles: Array<Int>
|
||||||
private lateinit var connectMutualTiles: Array<Int>
|
private lateinit var connectMutualTiles: Array<Int>
|
||||||
private lateinit var connectSelfTiles: Array<Int>
|
private lateinit var connectSelfTiles: Array<Int>
|
||||||
|
private lateinit var treeTiles: Array<Int>
|
||||||
|
|
||||||
internal fun rebuildInternalPrecalculations() {
|
internal fun rebuildInternalPrecalculations() {
|
||||||
if (App.IS_DEVELOPMENT_BUILD) {
|
if (App.IS_DEVELOPMENT_BUILD) {
|
||||||
@@ -294,6 +295,11 @@ internal object BlocksDrawer {
|
|||||||
connectSelfTiles = BlockCodex.blockProps.filter { (id, prop) ->
|
connectSelfTiles = BlockCodex.blockProps.filter { (id, prop) ->
|
||||||
isConnectSelf(id) && !id.startsWith("virt:") && id != Block.NULL
|
isConnectSelf(id) && !id.startsWith("virt:") && id != Block.NULL
|
||||||
}.map { world.tileNameToNumberMap[it.key] ?: throw NullPointerException("No tilenumber for ${it.key} exists") }.sorted().toTypedArray()
|
}.map { world.tileNameToNumberMap[it.key] ?: throw NullPointerException("No tilenumber for ${it.key} exists") }.sorted().toTypedArray()
|
||||||
|
|
||||||
|
treeTiles = BlockCodex.blockProps.filter { (id, prop) ->
|
||||||
|
isTreeTile(id) && !id.startsWith("virt:") && id != Block.NULL
|
||||||
|
}.map { world.tileNameToNumberMap[it.key] ?: throw NullPointerException("No tilenumber for ${it.key} exists") }.sorted().toTypedArray()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -351,6 +357,9 @@ internal object BlocksDrawer {
|
|||||||
/*else if (mode == FLUID) {
|
/*else if (mode == FLUID) {
|
||||||
getNearbyTilesInfoFluids(x, y)
|
getNearbyTilesInfoFluids(x, y)
|
||||||
}*/
|
}*/
|
||||||
|
else if (treeTiles.binarySearch(thisTile) >= 0) {
|
||||||
|
getNearbyTilesInfoTrees(x, y, mode)
|
||||||
|
}
|
||||||
else if (platformTiles.binarySearch(thisTile) >= 0) {
|
else if (platformTiles.binarySearch(thisTile) >= 0) {
|
||||||
getNearbyTilesInfoPlatform(x, y)
|
getNearbyTilesInfoPlatform(x, y)
|
||||||
}
|
}
|
||||||
@@ -487,7 +496,20 @@ internal object BlocksDrawer {
|
|||||||
|
|
||||||
var ret = 0
|
var ret = 0
|
||||||
for (i in nearbyTiles.indices) {
|
for (i in nearbyTiles.indices) {
|
||||||
if (BlockCodex[nearbyTiles[i]].isSolidForTileCnx) {
|
if (BlockCodex[nearbyTiles[i]].isSolidForTileCnx && isConnectMutual(nearbyTiles[i])) {
|
||||||
|
ret += (1 shl i) // add 1, 2, 4, 8 for i = 0, 1, 2, 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getNearbyTilesInfoTrees(x: Int, y: Int, mode: Int): Int {
|
||||||
|
val nearbyTiles: List<ItemID> = getNearbyTilesPos(x, y).map { world.getTileFrom(mode, it.x, it.y) }
|
||||||
|
|
||||||
|
var ret = 0
|
||||||
|
for (i in nearbyTiles.indices) {
|
||||||
|
if (isTreeTile(nearbyTiles[i])) {
|
||||||
ret += (1 shl i) // add 1, 2, 4, 8 for i = 0, 1, 2, 3
|
ret += (1 shl i) // add 1, 2, 4, 8 for i = 0, 1, 2, 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -813,11 +835,12 @@ internal object BlocksDrawer {
|
|||||||
fun getRenderEndX(): Int = clampWTile(getRenderStartX() + (WorldCamera.width / TILE_SIZE) + 2)
|
fun getRenderEndX(): Int = clampWTile(getRenderStartX() + (WorldCamera.width / TILE_SIZE) + 2)
|
||||||
fun getRenderEndY(): Int = clampHTile(getRenderStartY() + (WorldCamera.height / TILE_SIZE) + 2)
|
fun getRenderEndY(): Int = clampHTile(getRenderStartY() + (WorldCamera.height / TILE_SIZE) + 2)
|
||||||
|
|
||||||
fun isConnectSelf(b: ItemID): Boolean = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_SELF
|
fun isConnectSelf(b: ItemID) = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_SELF
|
||||||
fun isConnectMutual(b: ItemID): Boolean = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_MUTUAL
|
fun isConnectMutual(b: ItemID) = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_MUTUAL
|
||||||
fun isWallSticker(b: ItemID): Boolean = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_WALL_STICKER
|
fun isWallSticker(b: ItemID) = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_WALL_STICKER
|
||||||
fun isPlatform(b: ItemID): Boolean = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_WALL_STICKER_CONNECT_SELF
|
fun isPlatform(b: ItemID) = App.tileMaker.getRenderTag(b).connectionType == CreateTileAtlas.RenderTag.CONNECT_WALL_STICKER_CONNECT_SELF
|
||||||
//fun isBlendMul(b: Int): Boolean = TILES_BLEND_MUL.contains(b)
|
//fun isBlendMul(b: Int) = TILES_BLEND_MUL.contains(b)
|
||||||
|
fun isTreeTile(b: ItemID) = BlockCodex[b].hasTag("TREE")
|
||||||
|
|
||||||
fun tileInCamera(x: Int, y: Int) =
|
fun tileInCamera(x: Int, y: Int) =
|
||||||
x >= WorldCamera.x.div(TILE_SIZE) && y >= WorldCamera.y.div(TILE_SIZE) &&
|
x >= WorldCamera.x.div(TILE_SIZE) && y >= WorldCamera.y.div(TILE_SIZE) &&
|
||||||
|
|||||||
BIN
work_files/graphics/occlusion.kra
LFS
Normal file
BIN
work_files/graphics/occlusion.kra
LFS
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user