aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
authorAndrei Prykhodko2018-08-17 17:08:40 +0300
committerAndrei Prykhodko2018-08-17 17:14:15 +0300
commit5f462c1ebcd6b379e67b5e681cce80f41540fcde (patch)
tree8fff1091d7621e2dee632a510e2691dbca39a735 /engines/pink
parent78c2bb6a6a56841bace632d4f66617d51a3c1f0f (diff)
downloadscummvm-rg350-5f462c1ebcd6b379e67b5e681cce80f41540fcde.tar.gz
scummvm-rg350-5f462c1ebcd6b379e67b5e681cce80f41540fcde.tar.bz2
scummvm-rg350-5f462c1ebcd6b379e67b5e681cce80f41540fcde.zip
PINK: implemented skipString method in Archive
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/archive.cpp5
-rw-r--r--engines/pink/archive.h1
-rw-r--r--engines/pink/objects/module.cpp2
-rw-r--r--engines/pink/objects/pages/page.cpp2
-rw-r--r--engines/pink/pink.cpp4
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);
}