diff options
-rw-r--r-- | engines/pink/archive.h | 10 | ||||
-rw-r--r-- | engines/pink/utils.h | 1 | ||||
-rw-r--r-- | engines/pink/walk/walk_location.cpp | 4 | ||||
-rw-r--r-- | engines/pink/walk/walk_location.h | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/engines/pink/archive.h b/engines/pink/archive.h index 9ca1c29951..57ee78dc62 100644 --- a/engines/pink/archive.h +++ b/engines/pink/archive.h @@ -23,7 +23,7 @@ #ifndef PINK_ARCHIVE_H #define PINK_ARCHIVE_H -#include <common/array.h> +#include "utils.h" #include <engines/pink/object.h> namespace Common { @@ -83,6 +83,14 @@ inline Archive &operator>>(Archive &archive, uint32 &num){ return archive; } +inline Archive &operator>>(Archive &archive, StringArray &array){ + uint32 size = archive.readCount(); + array.resize(size); + for (uint i = 0; i < size; ++i) { + array[i] = archive.readString(); + } + return archive; +} } // End of namespace Pink diff --git a/engines/pink/utils.h b/engines/pink/utils.h index 82fb39d38a..feb164c771 100644 --- a/engines/pink/utils.h +++ b/engines/pink/utils.h @@ -33,6 +33,7 @@ namespace Pink { using ObArray = Common::Array<Object*>; using ModulesArray = Common::Array<NamedObject*>; using PagesArray = Common::Array<GamePage*>; + using StringArray = Common::Array<Common::String>; } #endif diff --git a/engines/pink/walk/walk_location.cpp b/engines/pink/walk/walk_location.cpp index 239c69faba..7bf19eae6e 100644 --- a/engines/pink/walk/walk_location.cpp +++ b/engines/pink/walk/walk_location.cpp @@ -25,7 +25,5 @@ void Pink::WalkLocation::deserialize(Pink::Archive &archive) { NamedObject::deserialize(archive); - // serialize string array - //intro has zero, so skip - assert(archive.readCount() == 0); + archive >> _neighbors; } diff --git a/engines/pink/walk/walk_location.h b/engines/pink/walk/walk_location.h index 0ad5adf055..da96a14dfd 100644 --- a/engines/pink/walk/walk_location.h +++ b/engines/pink/walk/walk_location.h @@ -24,6 +24,7 @@ #include <engines/pink/object.h> #include <common/array.h> +#include <engines/pink/utils.h> namespace Pink { @@ -32,8 +33,7 @@ public: virtual void deserialize(Archive &archive); private: - - + StringArray _neighbors; }; } // End of namespace Pink |