abolished a need to pass world as parametre

+ simply changing the single variable (ingame.world) will update all the renderer's behaviour
+ somehow my git changelogs are exploding
This commit is contained in:
minjaesong
2018-10-05 23:40:03 +09:00
parent 5641910036
commit 83fd44df4c
36 changed files with 344 additions and 268 deletions

View File

@@ -74,7 +74,12 @@ object IngameRenderer {
uiListToDraw = uisToDraw
}
init(world)
init()
BlocksDrawer.world = world
LightmapRenderer.setWorld(world)
FeaturesDrawer.world = world
this.player = player
@@ -389,7 +394,7 @@ object IngameRenderer {
}
private fun init(world: GameWorldExtension) {
private fun init() {
if (!initDone) {
batch = SpriteBatch()
camera = OrthographicCamera(widthf, heightf)
@@ -402,11 +407,6 @@ object IngameRenderer {
initDone = true
}
BlocksDrawer.world = world
LightmapRenderer.setWorld(world)
FeaturesDrawer.world = world
}
private fun clearBuffer() {