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

View File

@ -22,7 +22,7 @@ android {
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 28 targetSdkVersion 28
versionCode 190 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 // 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("NewGame")
displayTutorials("TileLayout") displayTutorials("TileLayout")
update()
createNextTurnButton() // needs civ table to be positioned
val tileToCenterOn: Vector2 = val tileToCenterOn: Vector2 =
when { when {
@ -85,7 +86,6 @@ class WorldScreen : CameraStageBaseScreen() {
else -> Vector2.Zero else -> Vector2.Zero
} }
tileMapHolder.setCenterPosition(tileToCenterOn) tileMapHolder.setCenterPosition(tileToCenterOn)
createNextTurnButton() // needs civ table to be positioned
} }
// This is private so that we will set the shouldUpdate to true instead. // 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) { override fun render(delta: Float) {
if(shouldUpdate){ // This is so that updates happen in the MAIN THREAD, where there is a GL Context, if(shouldUpdate){ // This is so that updates happen in the MAIN THREAD, where there is a GL Context,
if(currentPlayerCiv!=gameInfo.getCurrentPlayerCivilization()){ if(currentPlayerCiv!=gameInfo.getCurrentPlayerCivilization()){
@ -301,4 +301,3 @@ class WorldScreen : CameraStageBaseScreen() {
} }
} }