mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
different randomising for different layers
This commit is contained in:
@@ -34,7 +34,7 @@ class OregenAutotiling(world: GameWorld, seed: Long, val tilingModes: HashMap<It
|
|||||||
Worldgen.threadExecutor.join()
|
Worldgen.threadExecutor.join()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getHashCoord(x: Int, y: Int, mod: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), mod.toLong()) fmod mod.toLong()).toInt()
|
private fun getHashCoord(x: Int, y: Int, mod: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1073)).toLong()) fmod mod.toLong()).toInt()
|
||||||
|
|
||||||
private fun draw(x: Int) {
|
private fun draw(x: Int) {
|
||||||
for (y in 0 until world.height) {
|
for (y in 0 until world.height) {
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ internal object BlocksDrawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun getHashCoord(x: Int, y: Int, mod: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), mod.toLong()) fmod mod.toLong()).toInt()
|
private fun getHashCoord(x: Int, y: Int, mod: Int, layer: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1+layer)).toLong()) fmod mod.toLong()).toInt()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Autotiling; writes to buffer. Actual draw code must be called after this operation.
|
* Autotiling; writes to buffer. Actual draw code must be called after this operation.
|
||||||
@@ -355,7 +355,7 @@ internal object BlocksDrawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var hash = if ((mode == WALL || mode == TERRAIN) && !BlockCodex[world.tileNumberToNameMap[thisTile.toLong()]].hasTag("NORANDTILE"))
|
var hash = if ((mode == WALL || mode == TERRAIN) && !BlockCodex[world.tileNumberToNameMap[thisTile.toLong()]].hasTag("NORANDTILE"))
|
||||||
getHashCoord(x, y, 8)
|
getHashCoord(x, y, 8, mode)
|
||||||
else 0
|
else 0
|
||||||
|
|
||||||
// draw a tile
|
// draw a tile
|
||||||
|
|||||||
Reference in New Issue
Block a user