more inlining and minor performance tweaks on LightmapRenderer

This commit is contained in:
minjaesong
2017-06-12 04:04:54 +09:00
parent 980c92f213
commit 12c6f6fd04
15 changed files with 171 additions and 220 deletions

View File

@@ -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,

View File

@@ -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()
}

View File

@@ -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()
}