mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
new skybox drawing wip
This commit is contained in:
@@ -660,8 +660,8 @@ internal object BlocksDrawer {
|
||||
var tilesInVertical = -1; private set
|
||||
|
||||
fun resize(screenW: Int, screenH: Int) {
|
||||
tilesInHorizontal = (screenW.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
tilesInVertical = (screenH.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
tilesInHorizontal = (AppLoader.screenWf / TILE_SIZE).ceilInt() + 1
|
||||
tilesInVertical = (AppLoader.screenHf / TILE_SIZE).ceilInt() + 1
|
||||
|
||||
val oldTH = (oldScreenW.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
val oldTV = (oldScreenH.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
@@ -687,9 +687,9 @@ internal object BlocksDrawer {
|
||||
|
||||
tilesQuad.setVertices(floatArrayOf( // WARNING! not ususal quads; TexCoords of Y is flipped
|
||||
0f, 0f, 0f, 1f, 1f, 1f, 1f, 0f, 0f,
|
||||
screenW.toFloat(), 0f, 0f, 1f, 1f, 1f, 1f, 1f, 0f,
|
||||
screenW.toFloat(), screenH.toFloat(), 0f, 1f, 1f, 1f, 1f, 1f, 1f,
|
||||
0f, screenH.toFloat(), 0f, 1f, 1f, 1f, 1f, 0f, 1f
|
||||
AppLoader.screenWf, 0f, 0f, 1f, 1f, 1f, 1f, 1f, 0f,
|
||||
AppLoader.screenWf, AppLoader.screenHf, 0f, 1f, 1f, 1f, 1f, 1f, 1f,
|
||||
0f, AppLoader.screenHf, 0f, 1f, 1f, 1f, 1f, 0f, 1f
|
||||
))
|
||||
tilesQuad.setIndices(shortArrayOf(0, 1, 2, 2, 3, 0))
|
||||
}
|
||||
|
||||
@@ -756,8 +756,8 @@ object LightmapRenderer {
|
||||
|
||||
// copied from BlocksDrawer, duh!
|
||||
// FIXME 'lightBuffer' is not zoomable in this way
|
||||
val tilesInHorizontal = (screenW.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
val tilesInVertical = (screenH.toFloat() / TILE_SIZE).ceilInt() + 1
|
||||
val tilesInHorizontal = (AppLoader.screenWf / TILE_SIZE).ceilInt() + 1
|
||||
val tilesInVertical = (AppLoader.screenHf / TILE_SIZE).ceilInt() + 1
|
||||
|
||||
LIGHTMAP_WIDTH = (Terrarum.ingame?.ZOOM_MINIMUM ?: 1f).inv().times(AppLoader.screenW).div(TILE_SIZE).ceil() + overscan_open * 2 + 3
|
||||
LIGHTMAP_HEIGHT = (Terrarum.ingame?.ZOOM_MINIMUM ?: 1f).inv().times(AppLoader.screenH).div(TILE_SIZE).ceil() + overscan_open * 2 + 3
|
||||
|
||||
Reference in New Issue
Block a user