Теперь тайлы соединяются!
This commit is contained in:
parent
d5b20c9bda
commit
c045a699d4
@ -46,8 +46,8 @@ fun main() {
|
|||||||
var y = 0
|
var y = 0
|
||||||
|
|
||||||
for (tile in Starbound.tilesAccess.values) {
|
for (tile in Starbound.tilesAccess.values) {
|
||||||
chunkA!!.background[x, y + 1] = tile
|
//chunkA!!.background[x, y + 1] = tile
|
||||||
chunkA!!.background[x++, y] = tile
|
//chunkA!!.background[x++, y] = tile
|
||||||
|
|
||||||
if (x >= 31) {
|
if (x >= 31) {
|
||||||
x = 0
|
x = 0
|
||||||
@ -59,8 +59,8 @@ fun main() {
|
|||||||
y = 0
|
y = 0
|
||||||
|
|
||||||
for (tile in Starbound.tilesAccess.values) {
|
for (tile in Starbound.tilesAccess.values) {
|
||||||
chunkB.foreground[x, y + 1] = tile
|
//chunkB.foreground[x, y + 1] = tile
|
||||||
chunkB.foreground[x++, y] = tile
|
//chunkB.foreground[x++, y] = tile
|
||||||
|
|
||||||
if (x > 31) {
|
if (x > 31) {
|
||||||
x = 0
|
x = 0
|
||||||
@ -76,6 +76,12 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (x in 0 .. 31) {
|
||||||
|
for (y in 0 .. 31) {
|
||||||
|
chunkB.foreground[x, y] = tile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (x in 4 .. 8) {
|
for (x in 4 .. 8) {
|
||||||
for (y in 4 .. 8) {
|
for (y in 4 .. 8) {
|
||||||
chunkA!!.foreground[x, y] = null as TileDefinition?
|
chunkA!!.foreground[x, y] = null as TileDefinition?
|
||||||
|
@ -42,7 +42,7 @@ class ClientWorld(val client: StarboundClient, seed: Long = 0L) : World<ClientWo
|
|||||||
right = right,
|
right = right,
|
||||||
bottom = bottom,
|
bottom = bottom,
|
||||||
|
|
||||||
renderer = ChunkRenderer(client.gl, chunk)
|
renderer = ChunkRenderer(client.gl, chunk, this)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import ru.dbotthepony.kstarbound.math.Vector2f
|
|||||||
import ru.dbotthepony.kstarbound.util.Color
|
import ru.dbotthepony.kstarbound.util.Color
|
||||||
import ru.dbotthepony.kstarbound.util.formatBytesShort
|
import ru.dbotthepony.kstarbound.util.formatBytesShort
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
|
import kotlin.math.roundToInt
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
class StarboundClient : AutoCloseable {
|
class StarboundClient : AutoCloseable {
|
||||||
@ -211,7 +212,7 @@ class StarboundClient : AutoCloseable {
|
|||||||
|
|
||||||
val runtime = Runtime.getRuntime()
|
val runtime = Runtime.getRuntime()
|
||||||
|
|
||||||
gl.font.render("FPS: %.2f".format(averageFramesPerSecond), scale = 0.4f)
|
gl.font.render("FPS: ${(averageFramesPerSecond * 100f).toInt() / 100f}", scale = 0.4f)
|
||||||
gl.font.render("Mem: ${formatBytesShort(runtime.totalMemory() - runtime.freeMemory())}", x = viewportWidth.toFloat(), scale = 0.4f, alignX = TextAlignX.RIGHT)
|
gl.font.render("Mem: ${formatBytesShort(runtime.totalMemory() - runtime.freeMemory())}", x = viewportWidth.toFloat(), scale = 0.4f, alignX = TextAlignX.RIGHT)
|
||||||
|
|
||||||
GLFW.glfwSwapBuffers(window)
|
GLFW.glfwSwapBuffers(window)
|
||||||
|
@ -43,7 +43,7 @@ class TileLayerList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list.sortBy {
|
list.sortBy {
|
||||||
// унарный минус для инвентирования порядка (сначала маленькие, потом большие)
|
// унарный минус для инвентирования порядка (сначала большие, потом маленькие)
|
||||||
return@sortBy -it.zPos
|
return@sortBy -it.zPos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user