From ddd83da48bb0aea037b9f199490b359e2d7a97e7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Jun 2011 13:54:14 -0400 Subject: MOHAWK: Add archive functions to get type/id lists This will be needed for CarmenTQ --- engines/mohawk/resource.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'engines/mohawk/resource.cpp') 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 Archive::getResourceTypeList() const { + Common::Array typeList; + + for (TypeMap::const_iterator it = _types.begin(); it != _types.end(); it++) + typeList.push_back(it->_key); + + return typeList; +} + +Common::Array Archive::getResourceIDList(uint32 type) const { + Common::Array 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 -- cgit v1.2.3