aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorTravis Howell2009-07-11 22:58:29 +0000
committerTravis Howell2009-07-11 22:58:29 +0000
commit6e45d0c4aee7d129d6f68013c3f09e8a7087f552 (patch)
tree735b1bbcd41595735c88154d42333783bc1ef728 /engines/sci
parente3398c0cc73999524e92774fb889a0d22eea552b (diff)
parent116d2254119476f58b6b135b7a06a207f38fb5d0 (diff)
downloadscummvm-rg350-6e45d0c4aee7d129d6f68013c3f09e8a7087f552.tar.gz
scummvm-rg350-6e45d0c4aee7d129d6f68013c3f09e8a7087f552.tar.bz2
scummvm-rg350-6e45d0c4aee7d129d6f68013c3f09e8a7087f552.zip
Merged revisions 42382,42385-42387,42393-42394 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk ........ r42382 | Kirben | 2009-07-11 22:23:42 +1000 (Sat, 11 Jul 2009) | 1 line Fix pinball type mini game in Putt-Putt Enters The Race. ........ r42385 | wjpalenstijn | 2009-07-12 01:00:40 +1000 (Sun, 12 Jul 2009) | 3 lines 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). ........ r42386 | thebluegr | 2009-07-12 02:07:14 +1000 (Sun, 12 Jul 2009) | 1 line If we fail to auto-detect either the volume or the map version, set the one to be equal to the other ........ r42387 | thebluegr | 2009-07-12 03:25:49 +1000 (Sun, 12 Jul 2009) | 1 line Removed the version parameter from GfxResManager ........ r42393 | thebluegr | 2009-07-12 05:00:56 +1000 (Sun, 12 Jul 2009) | 1 line Some work on QFG1VGA (looks like a mix of SCI1 and SCI1.1) ........ r42394 | thebluegr | 2009-07-12 05:38:41 +1000 (Sun, 12 Jul 2009) | 1 line Changed an incorrect warning back to scidprintf - the relevant message is for testing only ........ svn-id: r42397
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/ksound.cpp1
-rw-r--r--engines/sci/engine/said.cpp2
-rw-r--r--engines/sci/engine/said.y2
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp10
-rw-r--r--engines/sci/gfx/gfx_resmgr.h4
-rw-r--r--engines/sci/gfx/operations.cpp2
-rw-r--r--engines/sci/resource.cpp19
-rw-r--r--engines/sci/sfx/iterator.cpp4
8 files changed, 32 insertions, 12 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;
}