aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/archive.cpp24
-rw-r--r--engines/pink/archive.h20
-rw-r--r--engines/pink/objects/pages/game_page.cpp4
3 files changed, 12 insertions, 36 deletions
diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp
index 58dc584cf8..13b2008b74 100644
--- a/engines/pink/archive.cpp
+++ b/engines/pink/archive.cpp
@@ -317,30 +317,6 @@ Common::String Archive::readString() {
return Common::String(buffer, len);
}
-byte Archive::readByte() {
- return _readStream->readByte();
-}
-
-uint32 Archive::readDWORD() {
- return _readStream->readUint32LE();
-}
-
-uint16 Archive::readWORD() {
- return _readStream->readUint16LE();
-}
-
-void Archive::writeByte(byte val) {
- return _writeStream->writeByte(val);
-}
-
-void Archive::writeDWORD(uint32 val) {
- _writeStream->writeUint32LE(val);
-}
-
-void Archive::writeWORD(uint16 val) {
- _writeStream->writeUint16LE(val);
-}
-
void Archive::writeString(const Common::String &string) {
_writeStream->writeByte(string.size());
_writeStream->write(string.c_str(), string.size());
diff --git a/engines/pink/archive.h b/engines/pink/archive.h
index d0665ea519..2f32388c43 100644
--- a/engines/pink/archive.h
+++ b/engines/pink/archive.h
@@ -42,22 +42,22 @@ public:
Archive(Common::SeekableReadStream *stream);
Archive(Common::WriteStream *stream);
- Common::SeekableReadStream *getReadStream() { return _readStream; }
- Common::WriteStream *getWriteStream() { return _writeStream; };
-
void mapObject(Object *obj);
int readCount();
- byte readByte();
- uint32 readDWORD();
- uint16 readWORD();
+ byte readByte() { return _readStream->readByte(); }
+ uint32 readDWORD() { return _readStream->readUint32LE(); }
+ uint16 readWORD() { return _readStream->readUint16LE(); }
- void writeByte(byte val);
- void writeDWORD(uint32 val);
- void writeWORD(uint16 val);
+ Common::String readString();
Object *readObject();
- Common::String readString();
+
+ void write(const void *dataPtr, uint32 dataSize) { _writeStream->write(dataPtr, dataSize); }
+ void writeByte(byte val) { _writeStream->writeByte(val); }
+ void writeDWORD(uint32 val) { _writeStream->writeUint32LE(val); }
+ void writeWORD(uint16 val) { _writeStream->writeUint16LE(val); }
+
void writeString(const Common::String &string);
private:
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 9ddcffd6d4..8ab1b0a077 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -172,13 +172,13 @@ void GamePage::saveState(Archive &archive) {
if (this == _module->getPage()) {
saveStateToMem();
archive.writeDWORD(_memFile->size());
- archive.getWriteStream()->write(_memFile->getData(), _memFile->size());
+ archive.write(_memFile->getData(), _memFile->size());
delete _memFile;
_memFile = nullptr;
} else {
if (_memFile != nullptr) {
archive.writeDWORD(_memFile->size());
- archive.getWriteStream()->write(_memFile->getData(), _memFile->size());
+ archive.write(_memFile->getData(), _memFile->size());
} else {
archive.writeDWORD(0);
}