SAGA2: Use CHUNK macros in saveBands

This commit is contained in:
a/ 2021-08-06 16:12:06 +09:00
parent 57bac4ff9a
commit 8347351b13
2 changed files with 9 additions and 12 deletions

View File

@ -77,7 +77,7 @@ int32 BandList::archiveSize(void) {
return size;
}
void BandList::write(Common::OutSaveFile *out) {
void BandList::write(Common::MemoryWriteStreamDynamic *out) {
int16 bandCount = 0;
// Count the active bands
@ -199,17 +199,14 @@ Band *getBandAddress(BandID id) {
void initBands(void) {
}
void saveBands(Common::OutSaveFile *out) {
void saveBands(Common::OutSaveFile *outS) {
debugC(2, kDebugSaveload, "Saving Bands");
int32 archiveBufSize;
archiveBufSize = g_vm->_bandList->archiveSize();
out->write("BAND", 4);
out->writeUint32LE(archiveBufSize);
outS->write("BAND", 4);
CHUNK_BEGIN;
g_vm->_bandList->write(out);
CHUNK_END;
}
void loadBands(Common::InSaveFile *in, int32 chunkSize) {
@ -301,7 +298,7 @@ int32 Band::archiveSize(void) {
+ sizeof(ObjectID) * memberCount; // members' ID's
}
void Band::write(Common::OutSaveFile *out) {
void Band::write(Common::MemoryWriteStreamDynamic *out) {
// Store the leader's ID
out->writeUint16LE(leader->thisID());

View File

@ -51,7 +51,7 @@ Band *getBandAddress(BandID id);
// Initialize the band list
void initBands(void);
void saveBands(Common::OutSaveFile *out);
void saveBands(Common::OutSaveFile *outS);
void loadBands(Common::InSaveFile *in, int32 chunkSize);
// Cleanup the band list
void cleanupBands(void);
@ -82,7 +82,7 @@ public:
// in a buffer
int32 archiveSize(void);
void write(Common::OutSaveFile *out);
void write(Common::MemoryWriteStreamDynamic *out);
// Place a Band from the inactive list into the active
// list.
@ -133,7 +133,7 @@ public:
// buffer
int32 archiveSize(void);
void write(Common::OutSaveFile *out);
void write(Common::MemoryWriteStreamDynamic *out);
Actor *getLeader(void) {
return leader;