diff --git a/engines/saga2/band.cpp b/engines/saga2/band.cpp index d8868f8d0e5..21d0b3fce4b 100644 --- a/engines/saga2/band.cpp +++ b/engines/saga2/band.cpp @@ -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()); diff --git a/engines/saga2/band.h b/engines/saga2/band.h index fd3a3e4e771..8a0fbdef501 100644 --- a/engines/saga2/band.h +++ b/engines/saga2/band.h @@ -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;