[Scummvm-cvs-logs] SF.net SVN: scummvm: [22425] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri May 12 17:07:54 CEST 2006


Revision: 22425
Author:   lordhoto
Date:     2006-05-12 16:57:53 -0700 (Fri, 12 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22425&view=rev

Log Message:
-----------
- little cleanups
- adds kyra3 dummies

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.h
    scummvm/trunk/engines/kyra/module.mk
    scummvm/trunk/engines/kyra/plugin.cpp
    scummvm/trunk/engines/kyra/resource.cpp
    scummvm/trunk/engines/kyra/seqplayer.cpp
    scummvm/trunk/engines/kyra/sound_adlib.cpp
    scummvm/trunk/engines/kyra/staticres.cpp

Added Paths:
-----------
    scummvm/trunk/engines/kyra/kyra3.cpp
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/kyra.h	2006-05-12 23:57:53 UTC (rev 22425)
@@ -56,13 +56,14 @@
 	GF_SPANISH	= 1 <<  7,
 	GF_ITALIAN	= 1 <<  8,
 	// other languages here
-	GF_LNGUNK	= 1 << 16,
+	GF_LNGUNK	= 1 << 16,	// also used for multi language in kyra3
 	GF_AMIGA	= 1 << 17	// this is no special version flag yet!
 };
 
 enum {
 	GI_KYRA1 = 0,
-	GI_KYRA2 = 1
+	GI_KYRA2 = 1,
+	GI_KYRA3 = 2
 };
 
 // TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
@@ -1008,6 +1009,19 @@
 	int go();
 };
 
+#ifdef ENABLE_KYRA3
+// maybe overload KyraEngine_v2 later
+class KyraEngine_v3 : public KyraEngine {
+public:
+	KyraEngine_v3(OSystem *system);
+	~KyraEngine_v3();
+
+	int setupGameFlags() { return 0; }
+	
+	int go();
+};
+#endif
+
 } // End of namespace Kyra
 
 #endif

Added: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp	                        (rev 0)
+++ scummvm/trunk/engines/kyra/kyra3.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -0,0 +1,68 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL $
+ * $Id $
+ *
+ */
+
+#ifdef ENABLE_KYRA3
+#include "kyra/kyra.h"
+#include "kyra/screen.h"
+#include "kyra/wsamovie.h"
+
+#include "common/system.h"
+
+namespace Kyra {
+KyraEngine_v3::KyraEngine_v3(OSystem *system) : KyraEngine(system) {
+}
+
+KyraEngine_v3::~KyraEngine_v3() {
+}
+
+int KyraEngine_v3::go() {
+	_screen->_curPage = 0;
+	_screen->clearPage(0);
+	
+	byte *pal = new byte[768];
+	assert(pal);
+	memset(pal, 0, sizeof(byte)*768);
+	
+	/*Movie *logo = createWSAMovie();
+	logo->open("REVENGE.WSA", 1, pal);
+	
+	pal[0] = pal[1] = pal[2] = 0;
+	
+	_screen->setScreenPalette(pal);
+	
+	// XXX
+	
+	logo->_x = logo->_y = 0;
+	logo->_drawPage = 0;
+	for (int i = 0; i < 64; ++i) {
+		uint32 nextRun = _system->getMillis() + 3 * _tickLength;
+		logo->displayFrame(i);
+		_screen->updateScreen();
+		delayUntil(nextRun);
+	}*/
+	
+	delete [] pal;
+
+	return 0;
+}
+}
+#endif // ENABLE_KYRA3


Property changes on: scummvm/trunk/engines/kyra/kyra3.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id,URL
Name: svn:eol-style
   + native

Modified: scummvm/trunk/engines/kyra/module.mk
===================================================================
--- scummvm/trunk/engines/kyra/module.mk	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/module.mk	2006-05-12 23:57:53 UTC (rev 22425)
@@ -6,6 +6,7 @@
 	gui.o \
 	items.o \
 	kyra.o \
+	kyra3.o \
 	plugin.o \
 	resource.o \
 	saveload.o \

Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/plugin.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -94,13 +94,21 @@
 	{ 0, 0, 0, 0, 0, 0 }
 };
 
+const GameSettings kyra3_games[] = {
+#ifdef ENABLE_KYRA3
+	{ "kyra3", "The Legend of Kyrandia: Book Three",
+	GI_KYRA3, GF_LNGUNK, "3833ff312757b8e6147f464cca0a6587", "ONETIME.PAK" },
+#endif
+	{ 0, 0, 0, 0, 0, 0 }
+};
+
 // Keep list of different supported games
 const PlainGameDescriptor kyra_list[] = {
 	{ "kyra1", "The Legend of Kyrandia" },
 #ifdef ENABLE_KYRA2
 	{ "kyra2", "The Hand of Fate" },
 #endif
-#if 0
+#ifdef ENABLE_KYRA3
 	{ "kyra3", "The Legend of Kyrandia: Book Three" },
 #endif
 	{ 0, 0 }
@@ -198,6 +206,14 @@
 
 		if (isFound)
 			break;
+		
+		for (g = kyra3_games; g->gameid; g++) {
+			if (scumm_stricmp(file->displayName().c_str(), g->checkFile) == 0)
+				isFound = true;
+		}
+
+		if (isFound)
+			break;
 	}
 
 	if (file == fslist.end())
@@ -229,7 +245,16 @@
 				detectedGames.push_back(dg);
 			}
 		}
+		
+		for (g = kyra3_games; g->gameid; g++) {
+			if (strcmp(g->md5sum, (char *)md5str) == 0) {
+				DetectedGame dg(*g, convertKyraLang(g->features), convertKyraPlatform(g->features));
+				dg.updateDesc(getKyraVersion(g->features));
 
+				detectedGames.push_back(dg);
+			}
+		}
+
 		if (detectedGames.empty()) {
 			printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
 
@@ -251,6 +276,10 @@
 		*engine = new KyraEngine_v1(syst);
 	} else if (!scumm_stricmp("kyra2", gameid)) {
 		*engine = new KyraEngine_v2(syst);
+#ifdef ENABLE_KYRA3
+	} else if (!scumm_stricmp("kyra3", gameid)) {
+		*engine = new KyraEngine_v3(syst);
+#endif
 	} else
 		error("Kyra engine created with invalid gameid.");
 	

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/resource.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -111,6 +111,12 @@
 		"COST2_SH.PAK", "DINOC.PAK", "FOOT.PAK", "INJAIL.PAK", "MISC_CPS.PAK", "PHONE_A.PAK", "SKY.PAK", "VOC.PAK",
 		"VOLC_K.PAK", 0
 	};
+	
+	static const char *kyra3Filelist[] = {
+		// enough for now
+		"ONETIME.PAK", 0
+	};
+	
 	const char **usedFilelist = 0;
 
 	if (_engine->game() == GI_KYRA1) {
@@ -120,8 +126,11 @@
 				usedFilelist = kyra1Filelist;
 			else if (_engine->features() & GF_TALKIE)
 				usedFilelist = kyra1CDFilelist;
-	} else {
+	} else if (_engine->game() == GI_KYRA2) {
+		// TODO: add kyra2 floppy file list
 		usedFilelist = kyra2CDFilelist;
+	} else if (_engine->game() == GI_KYRA3) {
+		usedFilelist = kyra3Filelist;
 	}
 		
 	if (!usedFilelist)
@@ -143,9 +152,11 @@
 		}
 	}
 
-	// we're loading KYRA.DAT here too
-	if (!loadPakFile("KYRA.DAT")) {
-		error("couldn't open Kyrandia resource file ('KYRA.DAT') make sure you got one file for your version");
+	// we're loading KYRA.DAT here too (but just for Kyrandia 1)
+	if (_engine->game() == GI_KYRA1) {
+		if (!loadPakFile("KYRA.DAT")) {
+			error("couldn't open Kyrandia resource file ('KYRA.DAT') make sure you got one file for your version");
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/kyra/seqplayer.cpp
===================================================================
--- scummvm/trunk/engines/kyra/seqplayer.cpp	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/seqplayer.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -51,12 +51,16 @@
 
 	for (int i = 0; i < ARRAYSIZE(_handShapes); ++i)
 		_handShapes[i] = 0;
+	for (int i = 0; i < ARRAYSIZE(_seqMovies); ++i)
+		_seqMovies[i].movie = 0;
 }
 
 SeqPlayer::~SeqPlayer() {
 	freeHandShapes();
 
 	for (int i = 0; i < ARRAYSIZE(_seqMovies); ++i) {
+		if (!_seqMovies[i].movie)
+			continue;
 		_seqMovies[i].movie->close();
 		delete _seqMovies[i].movie;
 		_seqMovies[i].movie = 0;

Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -396,6 +396,7 @@
 	_vibratoAndAMDepthBits = _curRegOffset = 0;
 
 	_lastProcessed = _flagTrigger = _curChannel = _rhythmSectionBits = 0;
+	_soundsPlaying = 0;
 	_rnd = 0x1234;
 
 	_tempo = 0;

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2006-05-12 21:41:54 UTC (rev 22424)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2006-05-12 23:57:53 UTC (rev 22425)
@@ -140,7 +140,7 @@
 	if (_engine->game() == GI_KYRA1) {
 		_builtIn = 0;
 		_filenameTable = kyra1StaticRes;
-	} else if (_engine->game() == GI_KYRA2) {
+	} else if (_engine->game() == GI_KYRA2 || _engine->game() == GI_KYRA3) {
 		return true;
 	} else {
 		error("unknown game ID");


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