[Scummvm-cvs-logs] scummvm master -> ddd83da48bb0aea037b9f199490b359e2d7a97e7

clone2727 clone2727 at gmail.com
Tue Jun 28 19:57:35 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ddd83da48b MOHAWK: Add archive functions to get type/id lists


Commit: ddd83da48bb0aea037b9f199490b359e2d7a97e7
    https://github.com/scummvm/scummvm/commit/ddd83da48bb0aea037b9f199490b359e2d7a97e7
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-06-28T10:54:14-07:00

Commit Message:
MOHAWK: Add archive functions to get type/id lists

This will be needed for CarmenTQ

Changed paths:
    engines/mohawk/resource.cpp
    engines/mohawk/resource.h



diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp
index df8271d..9b39692 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
 
diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h
index d4e91e0..f2ead7a 100644
--- a/engines/mohawk/resource.h
+++ b/engines/mohawk/resource.h
@@ -148,6 +148,9 @@ public:
 	uint16 findResourceID(uint32 tag, const Common::String &resName) const;
 	Common::String getName(uint32 tag, uint16 id) const;
 
+	Common::Array<uint32> getResourceTypeList() const;
+	Common::Array<uint16> getResourceIDList(uint32 type) const;
+
 protected:
 	Common::SeekableReadStream *_stream;
 






More information about the Scummvm-git-logs mailing list