[Scummvm-git-logs] scummvm master -> 029462f3b3dfa05cc1eb785cd9c80a030d32b81e
bluegr
noreply at scummvm.org
Wed Aug 16 15:22:34 UTC 2023
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:
029462f3b3 STARK: Fixes bug #14482 Texture mods with unusual names not loading
Commit: 029462f3b3dfa05cc1eb785cd9c80a030d32b81e
https://github.com/scummvm/scummvm/commit/029462f3b3dfa05cc1eb785cd9c80a030d32b81e
Author: gordonfreeman01 (5954931+gordonfreeman01 at users.noreply.github.com)
Date: 2023-08-16T18:22:30+03:00
Commit Message:
STARK: Fixes bug #14482 Texture mods with unusual names not loading
Changed paths:
engines/stark/resources/textureset.cpp
diff --git a/engines/stark/resources/textureset.cpp b/engines/stark/resources/textureset.cpp
index 30cb0b69cd6..81cf77d65e3 100644
--- a/engines/stark/resources/textureset.cpp
+++ b/engines/stark/resources/textureset.cpp
@@ -140,6 +140,8 @@ Gfx::TextureSet *TextureSet::readOverrideDdsArchive() {
for (Common::ArchiveMemberList::const_iterator it = files.begin(); it != files.end(); it++) {
const Common::String &name = (*it)->getName();
+ debugC(kDebugModding, "Attempting to load texture %s", name.c_str());
+
Common::SeekableReadStream *ddsStream = (*it)->createReadStream();
if (!ddsStream) {
warning("Unable to open %s for reading in %s", (*it)->getName().c_str(), archiveName.c_str());
@@ -169,6 +171,15 @@ Gfx::TextureSet *TextureSet::readOverrideDdsArchive() {
// used by the models.
Common::String textureName = Common::String(name.c_str(), name.size() - 4);
+ // Fix for loading one of Emma's textures in mods caused by inconsistent zip filename encoding
+ // The original game uses a 1 byte character (\xe6 which is ae in CP1252)
+ // \x91 is ae in CP437 and CP850 which is used by some compression utilities
+ // \xc3\xa6 is the UTF-8 2-byte representation
+ // Both get converted to the game's original encoding here
+ if (textureName == "pupp\x91r" || textureName == "pupp\xc3\xa6r") {
+ textureName = "pupp\xe6r";
+ }
+
textureSet->addTexture(textureName + ".bmp", texture);
delete ddsStream;
More information about the Scummvm-git-logs
mailing list