aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-26 21:41:41 +0000
committerFilippos Karapetis2009-10-26 21:41:41 +0000
commit7e0f8a9af9b78c43f73879118cbfe6f20731a71f (patch)
tree138119a32d4b2544186b4b68e0e5c5dd65a219e8 /engines/sci
parent5672f353dd795aac9bec4f4b65b342d402fcad1f (diff)
downloadscummvm-rg350-7e0f8a9af9b78c43f73879118cbfe6f20731a71f.tar.gz
scummvm-rg350-7e0f8a9af9b78c43f73879118cbfe6f20731a71f.tar.bz2
scummvm-rg350-7e0f8a9af9b78c43f73879118cbfe6f20731a71f.zip
Added proper detection and handling of transitive SCI1-SCI1.1 games, like PQ1 VGA. These used SCI1 resources and compression with a SCI1.1 kernel (thanks to waltervn's observations)
svn-id: r45420
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp4
-rw-r--r--engines/sci/resource.cpp8
3 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index c2db6fc793..76dda57518 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -197,7 +197,7 @@ int _reset_graphics_input(EngineState *s) {
} else {
resource = s->resMan->findResource(ResourceId(kResourceTypePalette, 999), 1);
if (resource) {
- if (getSciVersion() < SCI_VERSION_1_1)
+ if (s->resMan->getViewType() != kViewVga11)
s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal1(999, resource->data, resource->size));
else
s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal11(999, resource->data, resource->size));
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 90aaaad091..967b80b889 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -90,7 +90,7 @@ void GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pi
error("calculatePic(): pic number %d not found", nr);
if (need_unscaled) {
- if (getSciVersion() == SCI_VERSION_1_1)
+ if (_resMan->getViewType() == kViewVga11)
gfxr_draw_pic11(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _staticPalette, _portBounds);
else
gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resMan->getViewType(), _staticPalette, _portBounds);
@@ -99,7 +99,7 @@ void GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pi
if (scaled_pic && scaled_pic->undithered_buffer)
memcpy(scaled_pic->visual_map->index_data, scaled_pic->undithered_buffer, scaled_pic->undithered_buffer_size);
- if (getSciVersion() == SCI_VERSION_1_1)
+ if (_resMan->getViewType() == kViewVga11)
gfxr_draw_pic11(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _staticPalette, _portBounds);
else
gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resMan->getViewType(), _staticPalette, _portBounds);
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 743ee27165..493c56560a 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1629,6 +1629,14 @@ void ResourceManager::detectSciVersion() {
}
}
+ // Check for transitive SCI1/SCI1.1 games, like PQ1 here
+ // If the game has any heap file (here we check for heap file 0), then
+ // it definitely uses a SCI1.1 kernel
+ if (testResource(ResourceId(kResourceTypeHeap, 0))) {
+ s_sciVersion = SCI_VERSION_1_1;
+ return;
+ }
+
switch (_mapVersion) {
case kResVersionSci0Sci1Early:
if (_viewType == kViewVga) {