mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
more inlining and minor performance tweaks on LightmapRenderer
This commit is contained in:
@@ -150,8 +150,7 @@ class BasicDebugInfoWindow : UICanvas {
|
||||
" (${Terrarum.ingame!!.world.time.getFormattedTime()})")
|
||||
printLineColumn(g, 2, 6, "Mass $ccG${player?.mass}")
|
||||
|
||||
printLineColumn(g, 2, 7, "grounded $ccG${player?.grounded}")
|
||||
printLineColumn(g, 2, 8, "noClip $ccG${player?.noClip}")
|
||||
printLineColumn(g, 2, 7, "noClip $ccG${player?.noClip}")
|
||||
|
||||
|
||||
drawHistogram(g, LightmapRenderer.histogram,
|
||||
|
||||
@@ -17,7 +17,7 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas {
|
||||
override var openCloseTime: Millisec = 0
|
||||
|
||||
private var ELuptimer = 9999 // to make the light turned off by default
|
||||
private val ELuptime = 5000
|
||||
private val ELuptime = 4000
|
||||
private var ELon = false
|
||||
|
||||
private var atlas = SpriteSheet(ModMgr.getPath("basegame", "gui/basic_meter_atlas.tga"), width, height)
|
||||
@@ -99,7 +99,7 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas {
|
||||
|
||||
if (player != null) {
|
||||
val playerPos = player.tilewiseHitbox
|
||||
lightLevel = (LightmapRenderer.getLight(playerPos.canonicalX.toInt(), playerPos.canonicalY.toInt()) ?:
|
||||
lightLevel = (LightmapRenderer.getLight(playerPos.centeredX.toInt(), playerPos.centeredY.toInt()) ?:
|
||||
Terrarum.ingame!!.world.globalLight
|
||||
).normaliseToColour()
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas {
|
||||
override var openCloseTime: Millisec = 0
|
||||
|
||||
private var ELuptimer = 9999 // to make the light turned off by default
|
||||
private val ELuptime = 5000
|
||||
private val ELuptime = 4000
|
||||
private var ELon = false
|
||||
|
||||
private var atlas = SpriteSheet(ModMgr.getPath("basegame", "gui/watchface_atlas.tga"), width, height)
|
||||
@@ -71,7 +71,7 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas {
|
||||
|
||||
if (player != null) {
|
||||
val playerPos = player.tilewiseHitbox
|
||||
lightLevel = (LightmapRenderer.getLight(playerPos.canonicalX.toInt(), playerPos.canonicalY.toInt()) ?:
|
||||
lightLevel = (LightmapRenderer.getLight(playerPos.centeredX.toInt(), playerPos.centeredY.toInt()) ?:
|
||||
Terrarum.ingame!!.world.globalLight
|
||||
).normaliseToColour()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user