aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-14 18:55:30 +0000
committerFilippos Karapetis2009-05-14 18:55:30 +0000
commit97bdf32a5974ba1a0504156ad2c4eb7403187a15 (patch)
tree54c1e891cb9dcf6ca81b3203eb07e227d9b3168f
parentd5e1ca4630d0f8694f059a06ab06155108a7e435 (diff)
downloadscummvm-rg350-97bdf32a5974ba1a0504156ad2c4eb7403187a15.tar.gz
scummvm-rg350-97bdf32a5974ba1a0504156ad2c4eb7403187a15.tar.bz2
scummvm-rg350-97bdf32a5974ba1a0504156ad2c4eb7403187a15.zip
Added the EGA version of Longbow, and partially reverted my previous commit. SCI1 EGA games should *really* be working now
svn-id: r40565
-rw-r--r--engines/sci/detection.cpp16
-rw-r--r--engines/sci/engine/game.cpp4
-rw-r--r--engines/sci/engine/kgraphics.cpp16
-rw-r--r--engines/sci/sci.cpp3
4 files changed, 28 insertions, 11 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 342a50f14f..3f908836d6 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -405,6 +405,22 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION(1, 000, 510)
},
+ // Conquests of the Longbow EGA - English DOS
+ {{"longbow", "EGA", {
+ {"resource.map", 0, "7676ec9f08967d7a9a7724f5170456e0", 6261},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 718161},
+ {"resource.001", 0, "3c3735caa34fa3f261a9552831bb43ed", 705680},
+ {"resource.002", 0, "7025b87e735b1df3f0e9488a621f4333", 700633},
+ {"resource.003", 0, "eaca7933e8e56bea22b42f7fd5d7a8a7", 686510},
+ {"resource.004", 0, "b7bb35c027bb424ecefcd122768e5e60", 705631},
+ {"resource.005", 0, "58942b1aa6d6ffeb66e9f8897fd4435f", 469243},
+ {"resource.006", 0, "8c767b3939add63d11274065e46aad04", 713158},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0},
+ GF_FOR_SCI1_510_OR_LATER | GF_SCI1_EGA,
+ SCI_VERSION_AUTODETECT,
+ SCI_VERSION(1, 000, 510)
+ },
+
// Conquests of the Longbow - English DOS Demo
{{"longbow", "", {
{"resource.map", 0, "cbc5cb73341de1bff1b1e20a640af220", 588},
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index cb70395ac7..998c06b9c2 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -43,7 +43,7 @@ static int _init_vocabulary(EngineState *s) { // initialize vocabulary and relat
sciprintf("Initializing vocabulary\n");
- if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && vocab_get_words(s->resmgr, s->_parserWords)) {
+ if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA && vocab_get_words(s->resmgr, s->_parserWords)) {
vocab_get_suffixes(s->resmgr, s->_parserSuffixes);
if (vocab_get_branches(s->resmgr, s->_parserBranches))
// Now build a GNF grammar out of this
@@ -550,7 +550,7 @@ int game_init(EngineState *s) {
s->successor = NULL; // No successor
s->_statusBarText.clear(); // Status bar is blank
s->status_bar_foreground = 0;
- s->status_bar_background = s->resmgr->_sciVersion >= SCI_VERSION_01_VGA ? 255 : 15;
+ s->status_bar_background = (s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) ? 255 : 15;
SystemString *str = &s->sys_strings->strings[SYS_STRING_PARSER_BASE];
str->name = strdup("parser-base");
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 1da0c48f7f..660cc310ba 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -261,7 +261,7 @@ void graph_restore_box(EngineState *s, reg_t handle) {
}
PaletteEntry get_pic_color(EngineState *s, int color) {
- if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA)
+ if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA)
return s->ega_colors[color].visual;
if (color == -1 || color == 255) // -1 occurs in Eco Quest 1. Not sure if this is the best approach, but it seems to work
@@ -278,7 +278,7 @@ PaletteEntry get_pic_color(EngineState *s, int color) {
static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int control) {
gfx_color_t retval;
- if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) {
+ if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA) {
retval = s->ega_colors[(color >=0 && color < 16)? color : 0];
gfxop_set_color(s->gfx_state, &retval, (color < 0) ? -1 : retval.visual.r, retval.visual.g, retval.visual.b,
(color == -1) ? 255 : 0, priority, control);
@@ -482,7 +482,7 @@ reg_t kGraph(EngineState *s, int funct_nr, int argc, reg_t *argv) {
case K_GRAPH_GET_COLORS_NR:
- return make_reg(0, (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) ? 0x10 : 0x100);
+ return make_reg(0, s->resmgr->_sciVersion < SCI_VERSION_01_VGA ? 0x10 : 0x100);
break;
case K_GRAPH_DRAW_LINE: {
@@ -2484,7 +2484,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) {
bgcolor.mask = 0;
if (SKPV_OR_ALT(8 + argextra, 255) >= 0) {
- if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA)
+ if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA)
bgcolor.visual = get_pic_color(s, SKPV_OR_ALT(8 + argextra, 15));
else
bgcolor.visual = get_pic_color(s, SKPV_OR_ALT(8 + argextra, 255));
@@ -2509,7 +2509,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) {
black.alpha = 0;
black.control = -1;
black.priority = -1;
- lWhite.visual = get_pic_color(s, (s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) ? 15 : 255);
+ lWhite.visual = get_pic_color(s, s->resmgr->_sciVersion < SCI_VERSION_01_VGA ? 15 : 255);
lWhite.mask = GFX_MASK_VISUAL;
lWhite.alpha = 0;
lWhite.priority = -1;
@@ -3178,10 +3178,10 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) {
temp = KP_SINT(argv[argpt++]);
SCIkdebug(SCIkGRAPHICS, "Display: set_color(%d)\n", temp);
- if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && temp >= 0 && temp <= 15)
+ if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA) && temp >= 0 && temp <= 15)
color0 = (s->ega_colors[temp]);
else
- if ((s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) && temp >= 0 && temp < 256) {
+ if (s->resmgr->_sciVersion >= SCI_VERSION_01_VGA && temp >= 0 && temp < 256) {
color0.visual = get_pic_color(s, temp);
color0.mask = GFX_MASK_VISUAL;
} else
@@ -3195,7 +3195,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) {
temp = KP_SINT(argv[argpt++]);
SCIkdebug(SCIkGRAPHICS, "Display: set_bg_color(%d)\n", temp);
- if ((s->resmgr->_sciVersion < SCI_VERSION_01_VGA || s->flags & GF_SCI1_EGA) && temp >= 0 && temp <= 15)
+ if (s->resmgr->_sciVersion < SCI_VERSION_01_VGA && temp >= 0 && temp <= 15)
bg_color = s->ega_colors[temp];
else
if ((s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) && temp >= 0 && temp <= 256) {
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 6c6dd7356c..85f16f9902 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -226,7 +226,8 @@ Common::Error SciEngine::run() {
// Default config ends
#endif
- if (gfxop_init(_resmgr->_sciVersion, &gfx_state, &gfx_options, _resmgr)) {
+ int resVersion = !(getFlags() & GF_SCI1_EGA) ? _resmgr->_sciVersion : SCI_VERSION_01;
+ if (gfxop_init(resVersion, &gfx_state, &gfx_options, _resmgr)) {
fprintf(stderr, "Graphics initialization failed. Aborting...\n");
return Common::kUnknownError;
}