diff options
author | Bastien Bouclet | 2018-07-10 19:03:09 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-07-10 19:09:30 +0200 |
commit | e105c2a78ae14a0b3c6645fe98db98f3c299f13f (patch) | |
tree | 0a882e4cdea019535f8a11b16d4cf3b3cd71eef0 /engines/mohawk/resource.cpp | |
parent | 204060d1f0b88a5e1d4cb2010a76080281e3a327 (diff) | |
download | scummvm-rg350-e105c2a78ae14a0b3c6645fe98db98f3c299f13f.tar.gz scummvm-rg350-e105c2a78ae14a0b3c6645fe98db98f3c299f13f.tar.bz2 scummvm-rg350-e105c2a78ae14a0b3c6645fe98db98f3c299f13f.zip |
MOHAWK: RIVEN: Fix off-by-one ids in ospit for the 25th localized versions
Fixes Trac#10620.
Diffstat (limited to 'engines/mohawk/resource.cpp')
-rw-r--r-- | engines/mohawk/resource.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index ea44ca7879..e8e382ad00 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -154,6 +154,25 @@ Common::Array<uint16> Archive::getResourceIDList(uint32 type) const { return idList; } +void Archive::offsetResourceIDs(uint32 type, uint16 startId, int16 increment) { + if (!_types.contains(type)) { + return; + } + + const ResourceMap &oldResMap = _types[type]; + ResourceMap newResMap; + + for (ResourceMap::const_iterator it = oldResMap.begin(); it != oldResMap.end(); it++) { + if (it->_key >= startId) { + newResMap[it->_key + increment] = it->_value; + } else { + newResMap[it->_key] = it->_value; + } + } + + _types[type] = newResMap; +} + // Mohawk Archive code struct FileTableEntry { |