adding 'kind flag' to the savegame format so the file can be determined if it contains player or world data

This commit is contained in:
minjaesong
2022-12-04 16:09:07 +09:00
parent 400cdd5b3c
commit b2479028af
7 changed files with 62 additions and 16 deletions

View File

@@ -62,6 +62,7 @@ class WorldSavingThread(
override fun save() {
disk.saveMode = 2 * isAuto.toInt() // no quick
disk.saveKind = VDSaveKind.WORLD_DATA
if (hasThumbnail) {
while (!IngameRenderer.fboRGBexportedLatch) {
@@ -224,6 +225,7 @@ class PlayerSavingThread(
override fun save() {
disk.saveMode = 2 * isAuto.toInt() // no quick
disk.saveKind = VDSaveKind.PLAYER_DATA
disk.capacity = 0L
WriteSavegame.saveProgress = 0f

View File

@@ -140,9 +140,12 @@ class QuickSingleplayerWorldSavingThread(
}
disk.saveKind = VDSaveKind.WORLD_DATA
skimmer.rewriteDirectories()
skimmer.injectDiskCRC(disk.hashCode())
skimmer.setSaveMode(1 + 2 * isAuto.toInt())
skimmer.setSaveKind(VDSaveKind.WORLD_DATA)
printdbg(this, "Game saved with size of ${outFile.length()} bytes")