aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/resource.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-28 13:54:14 -0400
committerMatthew Hoops2011-06-28 13:54:14 -0400
commitddd83da48bb0aea037b9f199490b359e2d7a97e7 (patch)
tree8c5af29f3bb3af0de44904895d37781c15449066 /engines/mohawk/resource.cpp
parentcc818b444c454d2f8978655d5c29f379cbe21376 (diff)
downloadscummvm-rg350-ddd83da48bb0aea037b9f199490b359e2d7a97e7.tar.gz
scummvm-rg350-ddd83da48bb0aea037b9f199490b359e2d7a97e7.tar.bz2
scummvm-rg350-ddd83da48bb0aea037b9f199490b359e2d7a97e7.zip
MOHAWK: Add archive functions to get type/id lists
This will be needed for CarmenTQ
Diffstat (limited to 'engines/mohawk/resource.cpp')
-rw-r--r--engines/mohawk/resource.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp
index df8271dc5a..9b39692958 100644
--- a/engines/mohawk/resource.cpp
+++ b/engines/mohawk/resource.cpp
@@ -131,6 +131,28 @@ Common::String Archive::getName(uint32 tag, uint16 id) const {
return resMap[id].name;
}
+Common::Array<uint32> Archive::getResourceTypeList() const {
+ Common::Array<uint32> typeList;
+
+ for (TypeMap::const_iterator it = _types.begin(); it != _types.end(); it++)
+ typeList.push_back(it->_key);
+
+ return typeList;
+}
+
+Common::Array<uint16> Archive::getResourceIDList(uint32 type) const {
+ Common::Array<uint16> idList;
+
+ if (!_types.contains(type))
+ return idList;
+
+ const ResourceMap &resMap = _types[type];
+
+ for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++)
+ idList.push_back(it->_key);
+
+ return idList;
+}
// Mohawk Archive code