mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 13:04:05 +09:00
writing savemode to the savegame binary
This commit is contained in:
@@ -301,6 +301,11 @@ removefile:
|
||||
}
|
||||
}
|
||||
|
||||
fun setSaveMode(bits: Int) {
|
||||
fa.seek(49L)
|
||||
fa.writeByte(bits)
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// THESE ARE METHODS TO SUPPORT ON-LINE MODIFICATION //
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
@@ -64,7 +64,10 @@ Version 254 is a customised version of TEVD tailored to be used as a savegame fo
|
||||
Int8 0xFE
|
||||
Int8 Disk properties flag 1
|
||||
0th bit: readonly
|
||||
Int8[15] Extra info bytes
|
||||
Int8 Save type
|
||||
0th bit: unset - full save; set - quick save
|
||||
1st bit: set - generated by autosave
|
||||
Int8[14] Extra info bytes
|
||||
Unit8[236] Rest of the long disk name (268 bytes total)
|
||||
|
||||
(Header size: 300 bytes)
|
||||
@@ -127,6 +130,9 @@ class VirtualDisk(
|
||||
var isReadOnly: Boolean
|
||||
set(value) { extraInfoBytes[0] = (extraInfoBytes[0] and 0xFE.toByte()) or value.toBit() }
|
||||
get() = capacity == 0L || (extraInfoBytes.size > 0 && extraInfoBytes[0].and(1) == 1.toByte())
|
||||
var saveMode: Int
|
||||
set(value) { extraInfoBytes[1] = value.toByte() }
|
||||
get() = extraInfoBytes[1].toUint()
|
||||
fun getDiskNameString(charset: Charset) = diskName.toCanonicalString(charset)
|
||||
val root: DiskEntry
|
||||
get() = entries[0]!!
|
||||
|
||||
Reference in New Issue
Block a user