PINK: implemented skipString method in Archive

This commit is contained in:
Andrei Prykhodko 2018-08-17 17:08:40 +03:00
parent 78c2bb6a6a
commit 5f462c1ebc
5 changed files with 10 additions and 4 deletions

View File

@ -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());

View File

@ -49,6 +49,7 @@ public:
uint16 readWORD() { return _readStream->readUint16LE(); }
Common::String readString();
void skipString();
Object *readObject();

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}