diff options
-rw-r--r-- | engines/sci/engine/ksound.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/said.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/said.y | 2 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.cpp | 10 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.h | 4 | ||||
-rw-r--r-- | engines/sci/gfx/operations.cpp | 2 | ||||
-rw-r--r-- | engines/sci/resource.cpp | 19 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/he/logic_he.cpp | 4 |
9 files changed, 34 insertions, 14 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 4ba8971397..95c2eaab1d 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -823,7 +823,6 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) { sampleLen = s->_sound.startAudio(65535, number); // Also create iterator, that will fire SI_FINISHED event, when the sound is done playing s->_sound.sfx_add_song(build_timeriterator(s, sampleLen), 0, handle, number); - PUT_SEL32V(obj, signal, sampleLen); } else { if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) { warning("Could not open song number %d", number); diff --git a/engines/sci/engine/said.cpp b/engines/sci/engine/said.cpp index a6a3ee1405..921fa4e599 100644 --- a/engines/sci/engine/said.cpp +++ b/engines/sci/engine/said.cpp @@ -2314,7 +2314,7 @@ static int augment_match_expression_p(parse_tree_node_t *saidt, int augment_pos, } - warning("augment_match_expression_p(): Generic failure"); + scidprintf("augment_match_expression_p(): Generic failure\n"); return 0; } diff --git a/engines/sci/engine/said.y b/engines/sci/engine/said.y index 9fde2fddd0..c1c8424cb5 100644 --- a/engines/sci/engine/said.y +++ b/engines/sci/engine/said.y @@ -670,7 +670,7 @@ static int augment_match_expression_p(parse_tree_node_t *saidt, int augment_pos, } - scidprintf("Generic failure\n"); + scidprintf("augment_match_expression_p(): Generic failure\n"); return 0; } diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index ac48b74559..b8c005b620 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -49,12 +49,18 @@ struct param_struct { GfxDriver *driver; }; -GfxResManager::GfxResManager(int version, gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager) : - _version(version), _options(options), _driver(driver), _resManager(resManager), +GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager) : + _options(options), _driver(driver), _resManager(resManager), _lockCounter(0), _tagLockCounter(0), _staticPalette(0) { gfxr_init_static_palette(); _portBounds = Common::Rect(0, 10, 320, 200); // default value, with a titlebar of 10px + _version = resManager->_volVersion; + + // Workaround for QFG1 VGA (has SCI 1.1 view data with SCI 1 compression) + if (_version == SCI_VERSION_1 && !strcmp(((SciEngine*)g_engine)->getGameID(), "qfg1")) { + _version = SCI_VERSION_1_1; + } if (!_resManager->isVGA()) { _staticPalette = gfx_sci0_pic_colors->getref(); diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h index 8230e84aa0..fc4e0b3d6f 100644 --- a/engines/sci/gfx/gfx_resmgr.h +++ b/engines/sci/gfx/gfx_resmgr.h @@ -90,9 +90,7 @@ typedef Common::HashMap<int, gfx_resource_t *> IntResMap; /** Graphics resource manager */ class GfxResManager { public: - GfxResManager(int version, gfx_options_t *options, - GfxDriver *driver, ResourceManager *resManager); - + GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager); ~GfxResManager(); /** diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 057f28b56f..77b887778b 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -424,7 +424,7 @@ int gfxop_init(int version, GfxState *state, state->driver = new GfxDriver(xfact, yfact, mode); - state->gfxResMan = new GfxResManager(version, state->options, state->driver, resManager); + state->gfxResMan = new GfxResManager(state->options, state->driver, resManager); gfxop_set_clip_zone(state, gfx_rect(0, 0, 320, 200)); diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index a0aa40bcd5..d99f9f0771 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -470,6 +470,15 @@ ResourceManager::ResourceManager(int version, int maxMemory) { } else { _mapVersion = detectMapVersion(); _volVersion = detectVolVersion(); + if (_volVersion == 0 && _mapVersion > 0) { + warning("Volume version not detected, but map version has been detected. Setting volume version to map version"); + _volVersion = _mapVersion; + } + + if (_mapVersion == 0 && _volVersion > 0) { + warning("Map version not detected, but volume version has been detected. Setting map version to volume version"); + _mapVersion = _volVersion; + } } debug("Using resource map version %d %s", _mapVersion, versionNames[_mapVersion]); debug("Using volume version %d %s", _volVersion, versionNames[_volVersion]); @@ -528,6 +537,12 @@ ResourceManager::ResourceManager(int version, int maxMemory) { } } + // Workaround for QFG1 VGA (has SCI 1.1 view data with SCI 1 compression) + if (version == SCI_VERSION_1 && !strcmp(((SciEngine*)g_engine)->getGameID(), "qfg1")) { + debug("Resmgr: Detected QFG1 VGA"); + _isVGA = true; + } + _sciVersion = version; // temporary version printout - should be reworked later switch (_sciVersion) { @@ -712,7 +727,7 @@ int ResourceManager::detectMapVersion() { } } if (file.isOpen() == false) { - warning("Failed to open resource map file"); + error("Failed to open resource map file"); return SCI_VERSION_AUTODETECT; } // detection @@ -792,7 +807,7 @@ int ResourceManager::detectVolVersion() { } } if (file.isOpen() == false) { - warning("Failed to open volume file"); + error("Failed to open volume file"); return SCI_VERSION_AUTODETECT; } // SCI0 volume format: {wResId wPacked+4 wUnpacked wCompression} = 8 bytes diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 6c5706a8c1..dc2979abda 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -1173,7 +1173,9 @@ TimerSongIterator::TimerSongIterator(int delta) int TimerSongIterator::nextCommand(byte *buf, int *result) { if (_delta) { - return _delta; + int d = _delta; + _delta = 0; + return d; } return SI_FINISHED; } diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index a095622173..a24f4d4665 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -357,8 +357,8 @@ int32 LogicHErace::op_1140(int32 *args) { const double scalarProduct = x * args[0] + y * args[1]; // Finally compute the projection of (arg2,arg3) onto (arg0,arg1) - double projX = args[0] - 2 * scalarProduct * args[2]; - double projY = args[1] - 2 * scalarProduct * args[3]; + double projX = args[0] - 2 * scalarProduct * x; + double projY = args[1] - 2 * scalarProduct * y; projX = projX * 20.0 / 23.0; // FIXME: Why is this here? |