Fix Altas type (should be Atlas). Fix srawable -> drawable (#1639)

This commit is contained in:
philippeitis 2020-01-09 10:17:33 -08:00 committed by Yair Morgenstern
parent 9776029376
commit bc83be1441
2 changed files with 7 additions and 7 deletions

View File

@ -120,7 +120,7 @@ class UncivGame(
fun loadGame(gameInfo:GameInfo){ fun loadGame(gameInfo:GameInfo){
this.gameInfo = gameInfo this.gameInfo = gameInfo
ImageGetter.ruleset = gameInfo.ruleSet ImageGetter.ruleset = gameInfo.ruleSet
ImageGetter.refreshAltas() ImageGetter.refreshAtlas()
worldScreen = WorldScreen(gameInfo.getPlayerToViewAs()) worldScreen = WorldScreen(gameInfo.getPlayerToViewAs())
setWorldScreen() setWorldScreen()
} }
@ -144,7 +144,7 @@ class UncivGame(
override fun resume() { override fun resume() {
super.resume() super.resume()
if(!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually if(!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually
ImageGetter.refreshAltas() ImageGetter.refreshAtlas()
// This is to solve a rare problem - // This is to solve a rare problem -
// Sometimes, resume() is called and the gameInfo doesn't have any civilizations. // Sometimes, resume() is called and the gameInfo doesn't have any civilizations.

View File

@ -38,7 +38,7 @@ object ImageGetter {
fun setTextureRegionDrawables(){ fun setTextureRegionDrawables(){
textureRegionDrawables.clear() textureRegionDrawables.clear()
// These are the srawables from the base game // These are the drawables from the base game
for(region in atlas.regions){ for(region in atlas.regions){
val drawable =TextureRegionDrawable(region) val drawable =TextureRegionDrawable(region)
textureRegionDrawables[region.name] = drawable textureRegionDrawables[region.name] = drawable
@ -46,9 +46,9 @@ object ImageGetter {
// These are from the mods // These are from the mods
for(mod in ruleset.mods){ for(mod in ruleset.mods){
val modAltasFile = Gdx.files.local("mods/$mod/game.atlas") val modAtlasFile = Gdx.files.local("mods/$mod/game.atlas")
if (modAltasFile.exists()) { if (modAtlasFile.exists()) {
val modAtlas = TextureAtlas(modAltasFile) val modAtlas = TextureAtlas(modAtlasFile)
for (region in modAtlas.regions) { for (region in modAtlas.regions) {
val drawable = TextureRegionDrawable(region) val drawable = TextureRegionDrawable(region)
textureRegionDrawables[region.name] = drawable textureRegionDrawables[region.name] = drawable
@ -57,7 +57,7 @@ object ImageGetter {
} }
} }
fun refreshAltas() { fun refreshAtlas() {
atlas.dispose() // To avoid OutOfMemory exceptions atlas.dispose() // To avoid OutOfMemory exceptions
atlas = TextureAtlas("game.atlas") atlas = TextureAtlas("game.atlas")
setTextureRegionDrawables() setTextureRegionDrawables()