Solved #413 probable (ANR trying to load super-huge autosave game) by disabling the update() in the initialize, instead setting shouldUpdate to true by default so it'll update in the rendering thread

This commit is contained in:
Yair Morgenstern
2019-01-14 21:57:09 +02:00
parent 53c5c6d5ab
commit ee278586e7
3 changed files with 8 additions and 9 deletions

View File

@ -12,7 +12,7 @@ Made with LibGDX on Android Studio
# What's been implemented?
* Map tiles, resources and improvements
* Map tiles (including water), resources and improvements
* Units and movement
* Cities, production and buildings
* Population and Specialists
@ -20,12 +20,12 @@ Made with LibGDX on Android Studio
* Combat and barbarians
* Promotions and combat modifiers
* Other civilizations, diplomacy and trade
* Hotseat multiplayer
# What's next?
* UI+UX improvements (suggestions welcome!)
* Water tiles!
* Map editor
## So, does it work?

View File

@ -22,7 +22,7 @@ android {
minSdkVersion 14
targetSdkVersion 28
versionCode 190
versionName "2.11.8"
versionName "2.12.0"
}
// Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -76,7 +76,8 @@ class WorldScreen : CameraStageBaseScreen() {
displayTutorials("NewGame")
displayTutorials("TileLayout")
update()
createNextTurnButton() // needs civ table to be positioned
val tileToCenterOn: Vector2 =
when {
@ -85,7 +86,6 @@ class WorldScreen : CameraStageBaseScreen() {
else -> Vector2.Zero
}
tileMapHolder.setCenterPosition(tileToCenterOn)
createNextTurnButton() // needs civ table to be positioned
}
// This is private so that we will set the shouldUpdate to true instead.
@ -261,7 +261,7 @@ class WorldScreen : CameraStageBaseScreen() {
}
}
var shouldUpdate=false
var shouldUpdate=true
override fun render(delta: Float) {
if(shouldUpdate){ // This is so that updates happen in the MAIN THREAD, where there is a GL Context,
if(currentPlayerCiv!=gameInfo.getCurrentPlayerCivilization()){
@ -300,5 +300,4 @@ class WorldScreen : CameraStageBaseScreen() {
super.render(delta)
}
}
}