diff options
author | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
---|---|---|
committer | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
commit | 00279659b22cbd5db739d5351e83a9fc2a2ae408 (patch) | |
tree | 497f06f46820043cbdf1725652b8f0073223e24a /engines/scumm/he | |
parent | d932df79bed5aac97e17c0920a5e75cb5ce733ee (diff) | |
parent | d1628feb761acc9f4607f64de3eb620fea53bcc9 (diff) | |
download | scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.gz scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.bz2 scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
video/qt_decoder.cpp
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/script_v80he.cpp | 39 | ||||
-rw-r--r-- | engines/scumm/he/script_v90he.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/he/sound_he.cpp | 20 | ||||
-rw-r--r-- | engines/scumm/he/sprite_he.cpp | 7 |
4 files changed, 52 insertions, 17 deletions
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index 9711f6415b..eb62b650a4 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -25,6 +25,7 @@ #include "common/archive.h" #include "common/config-file.h" #include "common/config-manager.h" +#include "common/macresman.h" #include "common/savefile.h" #include "common/str.h" @@ -158,19 +159,41 @@ void ScummEngine_v80he::o80_readConfigFile() { memcpy(section, "BluesTreasureHunt-Disc2\0", 24); } - Common::ConfigFile ConfFile; - if (!strcmp((char *)filename + r, "map.ini")) - ConfFile.loadFromFile((const char *)filename + r); - else - ConfFile.loadFromSaveFile((const char *)filename + r); + if (!strcmp((const char *)filename, "map (i)")) { + // Mac resource fork config file + // (as used by only mustard mac for map data?) + Common::MacResManager resFork; + + if (!resFork.open((const char *)filename) || !resFork.hasResFork()) + error("Could not open '%s'", filename); + + Common::String prefResName = Common::String::format("Pref:%s.%s", (const char *)section, (const char *)option); + Common::SeekableReadStream *res = resFork.getResource(prefResName); + + if (res) { + // The string is inside the resource as a pascal string + byte length = res->readByte(); + for (byte i = 0; i < length; i++) + entry += (char)res->readByte(); + + delete res; + } + } else { + // Normal Windows INI files + Common::ConfigFile confFile; + if (!strcmp((char *)filename + r, "map.ini")) + confFile.loadFromFile((const char *)filename + r); + else + confFile.loadFromSaveFile((const char *)filename + r); + + confFile.getKey((const char *)option, (const char *)section, entry); + } byte subOp = fetchScriptByte(); switch (subOp) { case 43: // HE 100 case 6: // number - ConfFile.getKey((const char *)option, (const char *)section, entry); - if (!strcmp((char *)option, "Benchmark")) push(2); else @@ -178,8 +201,6 @@ void ScummEngine_v80he::o80_readConfigFile() { break; case 77: // HE 100 case 7: // string - ConfFile.getKey((const char *)option, (const char *)section, entry); - writeVar(0, 0); len = resStrLen((const byte *)entry.c_str()); data = defineArray(0, kStringArray, 0, 0, 0, len); diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 877f8b239d..0beebdb7a1 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -2373,6 +2373,9 @@ void ScummEngine_v90he::o90_kernelSetFunctions() { case 2001: _logicHE->dispatch(args[1], num - 2, (int32 *)&args[2]); break; + case 201102: + // Used in puttzoo iOS + break; default: error("o90_kernelSetFunctions: default case %d (param count %d)", args[0], num); } diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 5c15a85929..85e2a2f1dd 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -770,24 +770,30 @@ void SoundHE::startHETalkSound(uint32 offset) { if (ConfMan.getBool("speech_mute")) return; - assert(_sfxFile); - if (!_sfxFile->isOpen()) { + if (_sfxFilename.empty()) { // This happens in the Pajama Sam's Lost & Found demo, on the // main menu screen, so don't make it a fatal error. - warning("startHETalkSound: Speech file is not open"); + warning("startHETalkSound: Speech file is not found"); return; } + ScummFile file; + if (!_vm->openFile(file, _sfxFilename)) { + warning("startHETalkSound: Could not open speech file %s", _sfxFilename.c_str()); + return; + } + file.setEnc(_sfxFileEncByte); + _sfxMode |= 2; _vm->_res->nukeResource(rtSound, 1); - _sfxFile->seek(offset + 4, SEEK_SET); - size = _sfxFile->readUint32BE(); - _sfxFile->seek(offset, SEEK_SET); + file.seek(offset + 4, SEEK_SET); + size = file.readUint32BE(); + file.seek(offset, SEEK_SET); _vm->_res->createResource(rtSound, 1, size); ptr = _vm->getResourceAddress(rtSound, 1); - _sfxFile->read(ptr, size); + file.read(ptr, size); int channel = (_vm->VAR_TALK_CHANNEL != 0xFF) ? _vm->VAR(_vm->VAR_TALK_CHANNEL) : 0; addSoundToQueue2(1, 0, channel, 0); diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp index 081110c7cd..ec69ae11b4 100644 --- a/engines/scumm/he/sprite_he.cpp +++ b/engines/scumm/he/sprite_he.cpp @@ -33,7 +33,12 @@ namespace Scumm { -Sprite::Sprite(ScummEngine_v90he *vm) : _vm(vm) { +Sprite::Sprite(ScummEngine_v90he *vm) + : + _vm(vm), + _spriteGroups(0), + _spriteTable(0), + _activeSpritesTable(0) { } Sprite::~Sprite() { |