From 5f462c1ebcd6b379e67b5e681cce80f41540fcde Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Fri, 17 Aug 2018 17:08:40 +0300 Subject: PINK: implemented skipString method in Archive --- engines/pink/archive.cpp | 5 +++++ engines/pink/archive.h | 1 + engines/pink/objects/module.cpp | 2 +- engines/pink/objects/pages/page.cpp | 2 +- engines/pink/pink.cpp | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp index 5d67bc42f5..cc92704637 100644 --- a/engines/pink/archive.cpp +++ b/engines/pink/archive.cpp @@ -305,6 +305,11 @@ Common::String Archive::readString() { return Common::String(buffer, len); } +void Archive::skipString() { + byte len = _readStream->readByte(); + _readStream->skip(len); +} + 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 5ce7ff2ba7..34eba9426b 100644 --- a/engines/pink/archive.h +++ b/engines/pink/archive.h @@ -49,6 +49,7 @@ public: uint16 readWORD() { return _readStream->readUint16LE(); } Common::String readString(); + void skipString(); Object *readObject(); diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp index 50a256db81..c6a72cc6b7 100644 --- a/engines/pink/objects/module.cpp +++ b/engines/pink/objects/module.cpp @@ -45,7 +45,7 @@ void Module::load(Archive &archive) { archive.mapObject(this); NamedObject::deserialize(archive); - archive.readString(); // skip directory + archive.skipString(); // skip directory _invMgr.deserialize(archive); _pages.deserialize(archive); diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp index 337f65ef0e..e980dd2b57 100644 --- a/engines/pink/objects/pages/page.cpp +++ b/engines/pink/objects/pages/page.cpp @@ -35,7 +35,7 @@ void Page::load(Archive &archive) { debugC(6, kPinkDebugLoadingObjects, "Page load"); archive.mapObject(this); NamedObject::deserialize(archive); - archive.readString(); //skip directory + archive.skipString(); //skip directory _actors.deserialize(archive); } diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp index 64121b6699..636342186f 100644 --- a/engines/pink/pink.cpp +++ b/engines/pink/pink.cpp @@ -168,8 +168,8 @@ void PinkEngine::pauseEngine(void *engine, bool pause) { } void PinkEngine::load(Archive &archive) { - archive.readString(); - archive.readString(); + archive.skipString(); + archive.skipString(); _modules.deserialize(archive); } -- cgit v1.2.3