game.png is no longer a special boy

This commit is contained in:
Yair Morgenstern 2023-12-31 16:22:12 +02:00
parent 9fcb6860b7
commit b3cdd4fbab
4 changed files with 5 additions and 10 deletions

View File

@ -1 +1 @@
[AbsoluteUnits,Construction,EasterEggs,Flags,NationIcons,PolicyIcons,ReligionIcons,Skin,Tech,Tilesets,UnitPromotionIcons]
[AbsoluteUnits,Construction,EasterEggs,Flags,NationIcons,PolicyIcons,ReligionIcons,Skin,Tech,Tilesets,UnitPromotionIcons,game]

View File

@ -4,6 +4,7 @@ package com.unciv.build
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.tools.texturepacker.TexturePacker
import com.badlogic.gdx.utils.Json
import com.unciv.build.AndroidImagePacker.packImages
import java.io.File
import java.nio.file.Files
import java.nio.file.attribute.BasicFileAttributes
@ -84,7 +85,6 @@ object AndroidImagePacker {
atlasList += packFileName
packImagesIfOutdated(defaultSettings, file, output, packFileName)
}
atlasList.remove("game")
val listFile = File("$output${File.separator}Atlases.json")
if (atlasList.isEmpty()) listFile.delete()
else listFile.writeText(atlasList.sorted().joinToString(",","[","]"))

View File

@ -58,8 +58,6 @@ object ImageGetter {
fun resetAtlases() {
atlases.values.forEach { it.dispose() }
atlases.clear()
atlas = TextureAtlas("game.atlas")
atlases["game"] = atlas
}
fun reloadImages() = setNewRuleset(ruleset)
@ -68,11 +66,6 @@ object ImageGetter {
fun setNewRuleset(ruleset: Ruleset) {
ImageGetter.ruleset = ruleset
textureRegionDrawables.clear()
// These are the drawables from the base game
for (region in atlas.regions) {
val drawable = TextureRegionDrawable(region)
textureRegionDrawables[region.name] = drawable
}
// Load base (except game.atlas which is already loaded)
loadModAtlases("", Gdx.files.internal(""))

View File

@ -90,9 +90,11 @@ internal object ImagePacker {
val atlasList = mutableListOf<String>()
for ((file, packFileName) in imageFolders(input)) {
atlasList += packFileName
defaultSettings.filterMag = if (file.endsWith("Icons"))
Texture.TextureFilter.Linear
else Texture.TextureFilter.MipMapLinearLinear
packImagesIfOutdated(defaultSettings, file, output, packFileName)
}
atlasList.remove("game")
val listFile = File("$output${File.separator}Atlases.json")
if (atlasList.isEmpty()) listFile.delete()
else listFile.writeText(atlasList.sorted().joinToString(",","[","]"))