module UI now has margin; game update will drop consecutive updates if its try count is exhausted (reduced lag after window move/resize)

This commit is contained in:
minjaesong
2017-09-15 01:40:12 +09:00
parent d00c58ba80
commit c086722f35
6 changed files with 31 additions and 5 deletions

View File

@@ -190,9 +190,15 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
else {
// async update
updateDeltaCounter += delta
var updateTries = 0
while (updateDeltaCounter >= updateRate) {
updateScreen(delta)
updateDeltaCounter -= updateRate
updateTries++
if (updateTries >= Terrarum.UPDATE_CATCHUP_MAX_TRIES) {
break
}
}
// render? just do it anyway