From 8dd34921945ea0ce7f77e6c71ec5fbafaeb77622 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 11 Jul 2009 15:00:40 +0000 Subject: SCI: don't let TimerSongIterator loop forever, and don't immediately signal completion when starting it. This fixes a sync issue with the departing spaceship at the start of SQ4CD (after the intro). svn-id: r42385 --- engines/sci/engine/ksound.cpp | 1 - engines/sci/sfx/iterator.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/sci') 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/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; } -- cgit v1.2.3 From 848b9cda03ce5417ea2c89612fc411699643ff9c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 11 Jul 2009 16:07:14 +0000 Subject: If we fail to auto-detect either the volume or the map version, set the one to be equal to the other svn-id: r42386 --- engines/sci/resource.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/sci') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index a0aa40bcd5..b425c23876 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]); -- cgit v1.2.3 From 4f0888b8b65531c71c7aefafd9dda0d662a0dfc1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 11 Jul 2009 17:25:49 +0000 Subject: Removed the version parameter from GfxResManager svn-id: r42387 --- engines/sci/gfx/gfx_resmgr.cpp | 5 +++-- engines/sci/gfx/gfx_resmgr.h | 4 +--- engines/sci/gfx/operations.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index 9e9a8d2d13..f4c5fdf0dd 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -49,12 +49,13 @@ 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; 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 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 f714ab0245..2c536912b3 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -423,7 +423,7 @@ int gfxop_init(int version, GfxState *state, gfx_options_t *options, ResourceMan state->driver = new GfxDriver(xfact, yfact, bpp); - 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)); -- cgit v1.2.3 From f0892cdcbef2dff7a9f072d2bb7df42aa3d44a14 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 11 Jul 2009 19:00:56 +0000 Subject: Some work on QFG1VGA (looks like a mix of SCI1 and SCI1.1) svn-id: r42393 --- engines/sci/gfx/gfx_resmgr.cpp | 5 +++++ engines/sci/resource.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index f4c5fdf0dd..4a3c79feef 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -57,6 +57,11 @@ GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, Resource _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(); } else if (_version == SCI_VERSION_1_1) { diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index b425c23876..d99f9f0771 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -537,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) { @@ -721,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 @@ -801,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 -- cgit v1.2.3 From 116d2254119476f58b6b135b7a06a207f38fb5d0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 11 Jul 2009 19:38:41 +0000 Subject: Changed an incorrect warning back to scidprintf - the relevant message is for testing only svn-id: r42394 --- engines/sci/engine/said.cpp | 2 +- engines/sci/engine/said.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci') 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; } -- cgit v1.2.3