diff options
-rw-r--r-- | engines/sword25/kernel/outputpersistenceblock.cpp | 7 | ||||
-rw-r--r-- | engines/sword25/kernel/outputpersistenceblock.h | 1 | ||||
-rw-r--r-- | engines/sword25/script/luascript.cpp | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index 811ca983dc..b81f3c1bbe 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -79,6 +79,13 @@ void OutputPersistenceBlock::write(const Common::String &string) { rawWrite(string.c_str(), string.size()); } +void OutputPersistenceBlock::write(Common::Array<byte> &value) { + writeMarker(BLOCK_MARKER); + + write((uint)value.size()); + rawWrite(&value[0], value.size()); +} + void OutputPersistenceBlock::write(const void *bufferPtr, size_t size) { writeMarker(BLOCK_MARKER); diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index 3ece0175af..a7b0673f6f 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -49,6 +49,7 @@ public: void write(float value); void write(bool value); void write(const Common::String &string); + void write(Common::Array<byte> &value); void write(const void *bufferPtr, size_t size); const void *getData() const { diff --git a/engines/sword25/script/luascript.cpp b/engines/sword25/script/luascript.cpp index 4144a6a9e2..4ed4a158f9 100644 --- a/engines/sword25/script/luascript.cpp +++ b/engines/sword25/script/luascript.cpp @@ -423,7 +423,7 @@ bool LuaScriptEngine::persist(OutputPersistenceBlock &writer) { pluto_persist(_state, chunkwriter, &chunkData); // Persistenzdaten in den Writer schreiben. - writer.write(&chunkData[0], chunkData.size()); + writer.write(chunkData); // Die beiden Tabellen vom Stack nehmen. lua_pop(_state, 2); |