mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
COMPOSER: Load book config from MacBinary
This commit is contained in:
parent
2bd777c926
commit
3e12c9ddc2
@ -24,6 +24,7 @@
|
||||
#include "common/savefile.h"
|
||||
#include "common/system.h"
|
||||
#include "common/textconsole.h"
|
||||
#include "common/macresman.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
@ -65,6 +66,14 @@ bool INIFile::loadFromFile(const String &filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool INIFile::loadFromFileOrDataFork(const String &filename) {
|
||||
SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(filename);
|
||||
if (file)
|
||||
return loadFromStream(*file);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool INIFile::loadFromSaveFile(const String &filename) {
|
||||
assert(g_system);
|
||||
SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||
|
@ -106,6 +106,7 @@ public:
|
||||
void clear();
|
||||
|
||||
bool loadFromFile(const String &filename); /*!< Load configuration from a file. */
|
||||
bool loadFromFileOrDataFork(const String &filename); /*!< Load configuration from a file in MacBinary format. */
|
||||
bool loadFromSaveFile(const String &filename); /*!< Load configuration from a save file. */
|
||||
bool loadFromStream(SeekableReadStream &stream); /*!< Load configuration from a @ref SeekableReadStream. */
|
||||
bool saveToFile(const String &filename); /*!< Save the current configuration to a file. */
|
||||
|
@ -54,12 +54,12 @@ bool ComposerEngine::loadDetectedConfigFile(Common::INIFile &configFile) const {
|
||||
const ADGameFileDescription *res = _gameDescription->desc.filesDescriptions;
|
||||
while (res->fileName != nullptr) {
|
||||
if (res->fileType == GAME_CONFIGFILE) {
|
||||
return configFile.loadFromFile(res->fileName);
|
||||
return configFile.loadFromFileOrDataFork(res->fileName);
|
||||
}
|
||||
res++;
|
||||
}
|
||||
// default config file name
|
||||
return configFile.loadFromFile("book.ini") || configFile.loadFromFile("book.mac");
|
||||
return configFile.loadFromFileOrDataFork("book.ini") || configFile.loadFromFileOrDataFork("book.mac");
|
||||
}
|
||||
|
||||
} // End of namespace Composer
|
||||
|
Loading…
Reference in New Issue
Block a user