Rendering performance improvements - much smoother scrolling!

This commit is contained in:
Yair Morgenstern
2019-02-27 20:17:27 +02:00
parent 199b0c16ec
commit 3432f9b8c1
5 changed files with 13 additions and 3 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 207
versionName "2.13.7"
versionCode 208
versionName "2.13.8"
}
// Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -13,6 +13,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo) : TileGroup(
init {
isTransform=false // performance helper - nothing here is rotated or scaled
addActor(yieldGroup)
if (city.location == tileInfo.position) {
populationImage = ImageGetter.getImage("StatIcons/City_Center_(Civ6).png")

View File

@ -1,6 +1,7 @@
package com.unciv.ui.tilegroups
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.scenes.scene2d.Actor
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.ui.Image
@ -51,7 +52,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
addCircleImage()
addFogImage(groupSize)
addCrosshairImage()
isTransform = false
isTransform=false // performance helper - nothing here is rotated or scaled
}
@ -287,6 +288,11 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
addActor(image)
}
}
override fun draw(batch: Batch?, parentAlpha: Float) {
super.draw(batch, parentAlpha)
}
private fun updateTileColor(isViewable: Boolean) {

View File

@ -6,6 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.Group
class IconCircleGroup(size:Float, val image: Actor): Group(){
val circle = ImageGetter.getCircle().apply { setSize(size, size) }
init {
isTransform=false // performance helper - nothing here is rotated or scaled
setSize(size, size)
addActor(circle)
image.setSize(size * 0.75f, size * 0.75f)

View File

@ -28,6 +28,8 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
if (unit.health < 100) { // add health bar
addActor(ImageGetter.getHealthBar(unit.health.toFloat(), 100f, size))
}
isTransform=false // performance helper - nothing here is rotated or scaled
}
fun getBackgroundImageForUnit(unit: MapUnit): Image {