[Scummvm-tracker] [ScummVM :: Bugs] #15016: COMMON: macresman.cpp (i think) interferes with "Mass Add"

ScummVM :: Bugs trac at scummvm.org
Thu Nov 7 15:42:23 UTC 2024


#15016: COMMON: macresman.cpp (i think) interferes with "Mass Add"
----------------------------+------------------------
Reporter:  raziel-          |       Owner:  (none)
    Type:  defect           |      Status:  new
Priority:  normal           |   Component:  --Unset--
 Version:                   |  Resolution:
Keywords:  director engine  |        Game:
----------------------------+------------------------
Comment (by raziel-):

 @sev-

 Ok, please bear with me as i need to understand what is happening where
 (not that i'd be able to fix it, but information and stuff)

 in common/macresman.cpp, line 170++

 {{{
 SeekableReadStream
 *MacResManager::openAppleDoubleWithAppleOrOSXNaming(Archive& archive,
 const Path &fileName) {
         SeekableReadStream *stream =
 archive.createReadStreamForMember(constructAppleDoubleName(fileName));
         if (stream)
                 return stream;

         const ArchiveMemberPtr archiveMember =
 archive.getMember(fileName);
         const Common::FSNode *plainFsNode = dynamic_cast<const
 Common::FSNode *>(archiveMember.get());

         // Try finding __MACOSX
         Common::StringArray components = (plainFsNode ?
 plainFsNode->getPath() : fileName).splitComponents();
         if (components.empty() || components[components.size() -
 1].empty())
                 return nullptr;
         for (int i = components.size() - 1; i >= 0; i--) {
                 Common::StringArray newComponents;
                 int j;
                 for (j = 0; j < i; j++)
                         newComponents.push_back(components[j]);
                 newComponents.push_back("__MACOSX");
                 for (; j < (int) components.size() - 1; j++)
                         newComponents.push_back(components[j]);
                 newComponents.push_back("._" + components[(int)
 components.size() - 1]);

                 Common::Path newPath =
 Common::Path::joinComponents(newComponents);
                 stream = archive.createReadStreamForMember(newPath);

                 if (!stream) {
                         Common::FSNode fsn(newPath);
                         if (fsn.exists()) {
                                 stream = fsn.createReadStream();
                         }
                 }

                 if (stream) {
                         bool appleDouble = (stream->readUint32BE() ==
 0x00051607);
                         stream->seek(0);

                         if (appleDouble) {
                                 return stream;
                         }
                 }
                 delete stream;
         }

         return nullptr;
 }
 }}}

 This is the only place in the code where {{{__MACOSX}}} is used to look
 for something...and being "pushed back" (to the current path, i guess?)

 While it *does* work, since it *is* added * but in front* of my path, like
 {{{__MACOSX/Games:}}}, which obviously doesn't exist (Games: is a
 partition).

 Iiuc (and i sure doesn't) that is part of a path that should probably go
 *after* the main search path?
 Or even at the end of the current path that is used to look for game
 files?

 But it doesn't.
 How do i make that partial path appear at then end of my current search
 path?

 NB:
 I have absolutely no idea how MacOS works...is that {{{__MACOSX}}} some
 special directory where games place their data files?

 Please help

 Thank you very much
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/15016#comment:6>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list