mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
monitor adjustment screen, changed "calibrate" to "adjust" (NOT the STRING_ID of langpack)
Former-commit-id: ffae41e5876e54e2e0aedb5a93092db8e8f75d01 Former-commit-id: 65883b385a205d47b76c60f18a91186c2be922b2
This commit is contained in:
@@ -20,16 +20,16 @@ object LightmapRenderer {
|
||||
val overscan_open: Int = Math.min(32, 256f.div(TilePropCodex.getProp(TileNameCode.AIR).opacity and 0xFF).toFloat().ceil())
|
||||
val overscan_opaque: Int = Math.min(8, 256f.div(TilePropCodex.getProp(TileNameCode.STONE).opacity and 0xFF).toFloat().ceil())
|
||||
|
||||
private val LIGHTMAP_WIDTH = Terrarum.game.ZOOM_MIN.inv().times(Terrarum.WIDTH)
|
||||
private val LIGHTMAP_WIDTH = Terrarum.ingame.ZOOM_MIN.inv().times(Terrarum.WIDTH)
|
||||
.div(MapDrawer.TILE_SIZE).ceil() + overscan_open * 2 + 3
|
||||
private val LIGHTMAP_HEIGHT = Terrarum.game.ZOOM_MIN.inv().times(Terrarum.HEIGHT)
|
||||
private val LIGHTMAP_HEIGHT = Terrarum.ingame.ZOOM_MIN.inv().times(Terrarum.HEIGHT)
|
||||
.div(MapDrawer.TILE_SIZE).ceil() + overscan_open * 2 + 3
|
||||
|
||||
/**
|
||||
* 8-Bit RGB values
|
||||
*/
|
||||
private val lightmap: Array<IntArray> = Array(LIGHTMAP_HEIGHT) { IntArray(LIGHTMAP_WIDTH) }
|
||||
private val lanternMap = ArrayList<Lantern>(Terrarum.game.ACTORCONTAINER_INITIAL_SIZE * 4)
|
||||
private val lanternMap = ArrayList<Lantern>(Terrarum.ingame.ACTORCONTAINER_INITIAL_SIZE * 4)
|
||||
|
||||
private val AIR = TileNameCode.AIR
|
||||
|
||||
@@ -171,7 +171,7 @@ object LightmapRenderer {
|
||||
|
||||
// scan for luminous actors and store their lighting info to the lanterns
|
||||
lanternMap.clear()
|
||||
Terrarum.game.actorContainer.forEach { it ->
|
||||
Terrarum.ingame.actorContainer.forEach { it ->
|
||||
if (it is Luminous && it is Visible) {
|
||||
// put lanterns to the area the luminantBox is occupying
|
||||
for (lightBox in it.lightBoxList) {
|
||||
@@ -228,11 +228,11 @@ object LightmapRenderer {
|
||||
|
||||
private fun calculate(x: Int, y: Int, doNotCalculateAmbient: Boolean): Int {
|
||||
var lightLevelThis: Int = 0
|
||||
val thisTerrain = Terrarum.game.map.getTileFromTerrain(x, y)
|
||||
val thisWall = Terrarum.game.map.getTileFromWall(x, y)
|
||||
val thisTerrain = Terrarum.ingame.map.getTileFromTerrain(x, y)
|
||||
val thisWall = Terrarum.ingame.map.getTileFromWall(x, y)
|
||||
val thisTileLuminosity = TilePropCodex.getProp(thisTerrain).luminosity
|
||||
val thisTileOpacity = TilePropCodex.getProp(thisTerrain).opacity
|
||||
val sunLight = Terrarum.game.map.globalLight
|
||||
val sunLight = Terrarum.ingame.map.globalLight
|
||||
|
||||
// MIX TILE
|
||||
// open air
|
||||
@@ -315,8 +315,8 @@ object LightmapRenderer {
|
||||
var x = this_x_start
|
||||
while (x < this_x_end) {
|
||||
// smoothing enabled
|
||||
if (Terrarum.game.screenZoom >= 1
|
||||
&& Terrarum.gameConfig.getAsBoolean("smoothlighting") ?: false) {
|
||||
if (Terrarum.ingame.screenZoom >= 1
|
||||
&& Terrarum.gameConfig.getAsBoolean("smoothlighting") ?: false) {
|
||||
|
||||
val thisLightLevel = getLight(x, y) ?: 0
|
||||
|
||||
@@ -333,10 +333,10 @@ object LightmapRenderer {
|
||||
|
||||
g.color = Color(0)
|
||||
g.fillRect(
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round().toFloat(),
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round().toFloat(),
|
||||
((TSIZE * Terrarum.game.screenZoom).ceil() * zeroLevelCounter).toFloat(),
|
||||
(TSIZE * Terrarum.game.screenZoom).ceil().toFloat()
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round().toFloat(),
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round().toFloat(),
|
||||
((TSIZE * Terrarum.ingame.screenZoom).ceil() * zeroLevelCounter).toFloat(),
|
||||
(TSIZE * Terrarum.ingame.screenZoom).ceil().toFloat()
|
||||
)
|
||||
|
||||
x += zeroLevelCounter - 1
|
||||
@@ -382,12 +382,12 @@ object LightmapRenderer {
|
||||
g.color = Color(colourMapItoL[iy * 2 + ix].rgb30ClampTo24())
|
||||
|
||||
g.fillRect(
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round()
|
||||
+ ix * TSIZE / 2 * Terrarum.game.screenZoom,
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round()
|
||||
+ iy * TSIZE / 2 * Terrarum.game.screenZoom,
|
||||
(TSIZE * Terrarum.game.screenZoom / 2).ceil().toFloat(),
|
||||
(TSIZE * Terrarum.game.screenZoom / 2).ceil().toFloat()
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round()
|
||||
+ ix * TSIZE / 2 * Terrarum.ingame.screenZoom,
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round()
|
||||
+ iy * TSIZE / 2 * Terrarum.ingame.screenZoom,
|
||||
(TSIZE * Terrarum.ingame.screenZoom / 2).ceil().toFloat(),
|
||||
(TSIZE * Terrarum.ingame.screenZoom / 2).ceil().toFloat()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -408,10 +408,10 @@ object LightmapRenderer {
|
||||
|
||||
g.color = Color((getLight(x, y) ?: 0).rgb30ClampTo24())
|
||||
g.fillRect(
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round().toFloat(),
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).round().toFloat(),
|
||||
((TSIZE * Terrarum.game.screenZoom).ceil() * sameLevelCounter).toFloat(),
|
||||
(TSIZE * Terrarum.game.screenZoom).ceil().toFloat()
|
||||
(x.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round().toFloat(),
|
||||
(y.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).round().toFloat(),
|
||||
((TSIZE * Terrarum.ingame.screenZoom).ceil() * sameLevelCounter).toFloat(),
|
||||
(TSIZE * Terrarum.ingame.screenZoom).ceil().toFloat()
|
||||
)
|
||||
|
||||
x += sameLevelCounter - 1
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.*
|
||||
* Created by minjaesong on 16-01-19.
|
||||
*/
|
||||
object MapCamera {
|
||||
val map: GameMap = Terrarum.game.map;
|
||||
val map: GameMap = Terrarum.ingame.map;
|
||||
|
||||
var cameraX = 0
|
||||
private set
|
||||
@@ -229,10 +229,10 @@ object MapCamera {
|
||||
)
|
||||
|
||||
fun update(gc: GameContainer, delta_t: Int) {
|
||||
val player = Terrarum.game.player
|
||||
val player = Terrarum.ingame.player
|
||||
|
||||
renderWidth = FastMath.ceil(Terrarum.WIDTH / Terrarum.game.screenZoom) // div, not mul
|
||||
renderHeight = FastMath.ceil(Terrarum.HEIGHT / Terrarum.game.screenZoom)
|
||||
renderWidth = FastMath.ceil(Terrarum.WIDTH / Terrarum.ingame.screenZoom) // div, not mul
|
||||
renderHeight = FastMath.ceil(Terrarum.HEIGHT / Terrarum.ingame.screenZoom)
|
||||
|
||||
// position - (WH / 2)
|
||||
cameraX = Math.round(FastMath.clamp(
|
||||
@@ -425,13 +425,13 @@ object MapCamera {
|
||||
}
|
||||
|
||||
private fun drawTile(mode: Int, tilewisePosX: Int, tilewisePosY: Int, sheetX: Int, sheetY: Int) {
|
||||
if (Terrarum.game.screenZoom == 1f) {
|
||||
if (Terrarum.ingame.screenZoom == 1f) {
|
||||
tilesetBook[mode].renderInUse(
|
||||
FastMath.floor((tilewisePosX * TSIZE).toFloat()), FastMath.floor((tilewisePosY * TSIZE).toFloat()), sheetX, sheetY)
|
||||
} else {
|
||||
tilesetBook[mode].getSprite(
|
||||
sheetX, sheetY).drawEmbedded(
|
||||
Math.round(tilewisePosX.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).toFloat(), Math.round(tilewisePosY.toFloat() * TSIZE.toFloat() * Terrarum.game.screenZoom).toFloat(), FastMath.ceil(TSIZE * Terrarum.game.screenZoom).toFloat(), FastMath.ceil(TSIZE * Terrarum.game.screenZoom).toFloat())
|
||||
Math.round(tilewisePosX.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).toFloat(), Math.round(tilewisePosY.toFloat() * TSIZE.toFloat() * Terrarum.ingame.screenZoom).toFloat(), FastMath.ceil(TSIZE * Terrarum.ingame.screenZoom).toFloat(), FastMath.ceil(TSIZE * Terrarum.ingame.screenZoom).toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ object MapDrawer {
|
||||
val colTemp_cold = colTempLinearFunc(onscreen_cold_tiles / onscreen_tiles_cap)
|
||||
val colTemp_warm = colTempLinearFunc(-(onscreen_warm_tiles / onscreen_tiles_cap))
|
||||
colTemp = colTemp_warm + colTemp_cold - ENV_COLTEMP_NOON
|
||||
val zoom = Terrarum.game.screenZoom
|
||||
val zoom = Terrarum.ingame.screenZoom
|
||||
|
||||
g.color = getColourFromMap(colTemp)
|
||||
//g.color = getColourFromMap(3022)
|
||||
|
||||
Reference in New Issue
Block a user