[Scummvm-cvs-logs] SF.net SVN: scummvm:[40565] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu May 14 20:55:30 CEST 2009


Revision: 40565
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40565&view=rev
Author:   thebluegr
Date:     2009-05-14 18:55:30 +0000 (Thu, 14 May 2009)

Log Message:
-----------
Added the EGA version of Longbow, and partially reverted my previous commit. SCI1 EGA games should *really* be working now

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2009-05-14 17:50:09 UTC (rev 40564)
+++ scummvm/trunk/engines/sci/detection.cpp	2009-05-14 18:55:30 UTC (rev 40565)
@@ -405,6 +405,22 @@
 		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},

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-05-14 17:50:09 UTC (rev 40564)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-05-14 18:55:30 UTC (rev 40565)
@@ -43,7 +43,7 @@
 
 	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 @@
 	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");

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-14 17:50:09 UTC (rev 40564)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-14 18:55:30 UTC (rev 40565)
@@ -261,7 +261,7 @@
 }
 
 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 @@
 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 @@
 
 	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 @@
 	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 @@
 	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 @@
 
 			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 @@
 
 			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) {

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-05-14 17:50:09 UTC (rev 40564)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-05-14 18:55:30 UTC (rev 40565)
@@ -226,7 +226,8 @@
 	// 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;
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list