loadlost: preloading game screenshots

This commit is contained in:
minjaesong
2023-07-11 21:11:19 +09:00
parent 173f99f87d
commit c5659e2833
5 changed files with 51 additions and 4 deletions

View File

@@ -512,6 +512,8 @@ class UIItemPlayerCells(
lateinit var worldUUID: UUID; private set
private val savegameStatus: Int
internal val pixmapManual: Pixmap?
internal val pixmapAuto: Pixmap?
init {
App.savegamePlayers[playerUUID]!!.loadable().getFile(SAVEGAMEINFO)?.bytes?.let {
@@ -533,6 +535,8 @@ class UIItemPlayerCells(
val savegamePair = SavegameCollectionPair(App.savegamePlayers[playerUUID], App.savegameWorlds[worldUUID])
savegameStatus = savegamePair.status
pixmapManual = savegamePair.getManualSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
pixmapAuto = savegamePair.getAutoSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
}
private fun parseDuration(seconds: Long): String {
@@ -696,6 +700,8 @@ class UIItemPlayerCells(
override fun dispose() {
sprite?.texture?.dispose()
pixmapManual?.dispose()
pixmapAuto?.dispose()
}