[Scummvm-cvs-logs] SF.net SVN: scummvm: [27437] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Fri Jun 15 23:40:05 CEST 2007


Revision: 27437
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27437&view=rev
Author:   peres001
Date:     2007-06-15 14:40:02 -0700 (Fri, 15 Jun 2007)

Log Message:
-----------
All known versions of Nippon Safes are now enabled with all features except for half-brite effects. Please keep an eye out for regression.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/archive.cpp
    scummvm/trunk/engines/parallaction/callables.cpp
    scummvm/trunk/engines/parallaction/detection.cpp
    scummvm/trunk/engines/parallaction/disk.cpp
    scummvm/trunk/engines/parallaction/disk.h
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/archive.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/archive.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/archive.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -56,8 +56,7 @@
 }
 
 void Archive::open(const char *file) {
-	bool isSmallArchive;
-	debugC(3, kDebugDisk, "Archive::open(%s)", file);
+	debugC(1, kDebugDisk, "Archive::open(%s)", file);
 
 	if (_archive.isOpen())
 		close();
@@ -68,11 +67,9 @@
 	if (!_archive.open(path))
 		error("archive '%s' not found", path);
 
-	if (_vm->getFeatures() & GF_DEMO) {
+	bool isSmallArchive = false;
+	if (_vm->getFeatures() & GF_DEMO)
 		isSmallArchive = _archive.size() == SIZEOF_SMALL_ARCHIVE;
-	} else {
-		isSmallArchive = (_archive.readUint32BE() != MKID_BE('NDOS'));
-	}
 
 	_numFiles = (isSmallArchive) ? SMALL_ARCHIVE_FILES_NUM : NORMAL_ARCHIVE_FILES_NUM;
 
@@ -102,6 +99,8 @@
 
 
 bool Archive::openArchivedFile(const char *filename) {
+	debugC(3, kDebugDisk, "Archive::openArchivedFile(%s)", filename);
+
 	resetArchivedFile();
 
 	debugC(3, kDebugDisk, "Archive::openArchivedFile(%s)", filename);

Modified: scummvm/trunk/engines/parallaction/callables.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/callables.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -68,12 +68,12 @@
 }
 
 void _c_fade(void *parm) {
-	
+
 	_vm->_gfx->setBlackPalette();
 
 	Gfx::Palette pal;
 	memset(pal, 0, sizeof(Gfx::Palette));
-	
+
 	for (uint16 _di = 0; _di < 64; _di++) {
 		_vm->_gfx->fadePalette(pal);
 		_vm->_gfx->setPalette(pal);
@@ -300,7 +300,7 @@
 }
 
 void _c_frankenstein(void *parm) {
-	
+
 	Gfx::Palette pal0;
 	Gfx::Palette pal1;
 
@@ -308,7 +308,7 @@
 		pal0[(i+FIRST_BASE_COLOR)] = _vm->_gfx->_palette[i];
 		pal0[(i+FIRST_BASE_COLOR)*3+1] = 0;
 		pal0[(i+FIRST_BASE_COLOR)*3+2] = 0;
-		
+
 		pal1[(i+FIRST_BASE_COLOR)*3+1] = 0;
 		pal1[(i+FIRST_BASE_COLOR)*3+2] = 0;
 	}
@@ -427,6 +427,8 @@
 
 void _c_testResult(void *parm) {
 	_vm->_gfx->swapBuffers();
+
+	_vm->_disk->selectArchive("disk1");
 	_vm->parseLocation("common");
 
 	_vm->_gfx->setFont(kFontMenu);

Modified: scummvm/trunk/engines/parallaction/detection.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/detection.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/detection.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -77,7 +77,7 @@
 		GType_Nippon,
 		GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT,
 	},
-	
+
 	{
 		{
 			"nippon",
@@ -100,7 +100,7 @@
 		GType_Nippon,
 		GF_LANG_EN | GF_LANG_FR | GF_LANG_DE,
 	},
-	
+
 	{
 		{
 			"nippon",
@@ -119,6 +119,27 @@
 	},
 
 
+	{
+		{
+			"nippon",
+			"",
+			{
+				{"disk0", 	0, "bfee75d8015f1fb97e75dbe08df4bef7", 354304},
+				{"disk1", 	0, "f339dd108c1a1f5cd4853d9966e5d01f", 901120},
+				{"disk2", 	0, "2db40bf8198a57d18e4471a6deaab970", 901120},
+				{"disk3", 	0, "0486972962b2bfc230e789b9f88f9ec8", 901120},
+				{"disk4", 	0, "6f625e7f05da4a2f57d6b62d57013614", 901120},
+				{"it", 		0, "746088eb8de2b2713685d243a4e4678f", 185344},
+				{ NULL, 0, NULL, 0}
+			},
+			Common::IT_ITA,
+			Common::kPlatformAmiga,
+			Common::ADGF_NO_FLAGS
+		},
+		GType_Nippon,
+		GF_LANG_IT,
+	},
+
 	{ AD_TABLE_END_MARKER, 0, 0 }
 };
 

Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/disk.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -95,6 +95,7 @@
 }
 
 void Disk::setLanguage(uint16 language) {
+	debugC(1, kDebugDisk, "setLanguage(%i)", language);
 
 	switch (language) {
 	case 0:
@@ -775,31 +776,23 @@
 #undef NUM_PLANES
 
 Script* AmigaDisk::loadLocation(const char *name) {
-	char archivefile[PATH_LEN];
+	debugC(1, kDebugDisk, "AmigaDisk()::loadLocation '%s'", name);
 
+	char path[PATH_LEN];
 	if (IS_MINI_CHARACTER(_vm->_characterName)) {
-		sprintf(archivefile, "%s%s", _vm->_characterName+4, _languageDir);
-	} else {
-		if (IS_DUMMY_CHARACTER(_vm->_characterName)) {
-			strcpy(archivefile, _languageDir);
-		} else {
-			sprintf(archivefile, "%s%s", _vm->_characterName, _languageDir);
+		sprintf(path, "%s%s%s.loc.pp", _vm->_characterName+4, _languageDir, name);
+	} else
+		sprintf(path, "%s%s%s.loc.pp", _vm->_characterName, _languageDir, name);
+
+	if (!_locArchive.openArchivedFile(path)) {
+		sprintf(path, "%s%s.loc.pp", _languageDir, name);
+		if (!_locArchive.openArchivedFile(path)) {
+			errorFileNotFound(name);
 		}
 	}
 
-	strcat(archivefile, name);
-	strcat(archivefile, ".loc.pp");
+	debugC(3, kDebugDisk, "location file found: %s", path);
 
-	debugC(1, kDebugDisk, "AmigaDisk::loadLocation(%s): trying '%s'", name, archivefile);
-
-	if (!_locArchive.openArchivedFile(archivefile)) {
-		sprintf(archivefile, "%s%s.loc.pp", _languageDir, name);
-		debugC(3, kDebugDisk, "AmigaDisk::loadLocation(%s): trying '%s'", name, archivefile);
-
-		if (!_locArchive.openArchivedFile(archivefile))
-			errorFileNotFound(name);
-	}
-
 	return new Script(new PowerPackerStream(_locArchive), true);
 }
 
@@ -816,46 +809,6 @@
 	return new Script(new DummyArchiveStream(_resArchive), true);
 }
 
-Cnv* AmigaDisk::loadTalk(const char *name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name);
-
-	Common::SeekableReadStream *s;
-
-	char path[PATH_LEN];
-	if (_vm->getFeatures() & GF_DEMO)
-		sprintf(path, "%s.talk", name);
-	else
-		sprintf(path, "talk/%s.talk", name);
-
-	s = openArchivedFile(path, false);
-	if (s == NULL) {
-		s = openArchivedFile(name, true);
-	}
-
-	Cnv *cnv = makeCnv(*s);
-	delete s;
-
-	return cnv;
-}
-
-Cnv* AmigaDisk::loadObjects(const char *name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
-
-	char path[PATH_LEN];
-	if (_vm->getFeatures() & GF_DEMO)
-		sprintf(path, "%s.objs", name);
-	else
-		sprintf(path, "objs/%s.objs", name);
-
-	Common::SeekableReadStream *s = openArchivedFile(path, true);
-
-	Cnv *cnv = makeCnv(*s);
-	delete s;
-
-	return cnv;
-}
-
-
 StaticCnv* AmigaDisk::loadPointer() {
 	debugC(1, kDebugDisk, "AmigaDisk::loadPointer");
 
@@ -866,32 +819,6 @@
 	return makeStaticCnv(stream);
 }
 
-StaticCnv* AmigaDisk::loadHead(const char* name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name);
-
-	char path[PATH_LEN];
-	sprintf(path, "%s.head", name);
-
-	Common::SeekableReadStream *s = openArchivedFile(path, true);
-	StaticCnv *cnv = makeStaticCnv(*s);
-
-	delete s;
-
-	return cnv;
-}
-
-Font* AmigaDisk::loadFont(const char* name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadFont '%s'", name);
-
-	char path[PATH_LEN];
-	sprintf(path, "%sfont", name);
-
-	if (!_resArchive.openArchivedFile(path))
-		errorFileNotFound(path);
-
-	return createFont(name, _resArchive);
-}
-
 StaticCnv* AmigaDisk::loadStatic(const char* name) {
 	debugC(1, kDebugDisk, "AmigaDisk::loadStatic '%s'", name);
 
@@ -904,6 +831,7 @@
 }
 
 Common::SeekableReadStream *AmigaDisk::openArchivedFile(const char* name, bool errorOnFileNotFound) {
+	debugC(3, kDebugDisk, "AmigaDisk::openArchivedFile(%s)", name);
 
 	if (_resArchive.openArchivedFile(name)) {
 		return new DummyArchiveStream(_resArchive);
@@ -927,22 +855,6 @@
 	return NULL;
 }
 
-Cnv* AmigaDisk::loadFrames(const char* name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name);
-
-	Common::SeekableReadStream *s = openArchivedFile(name, true);
-	Cnv *cnv = makeCnv(*s);
-	delete s;
-
-	return cnv;
-}
-
-void AmigaDisk::loadSlide(const char *name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name);
-	loadBackground(name);
-	return;
-}
-
 // FIXME: mask values are not computed correctly for level 1 and 2
 void buildMask(byte* buf) {
 
@@ -1107,7 +1019,93 @@
 	return;
 }
 
-Table* AmigaDisk::loadTable(const char* name) {
+
+AmigaFullDisk::AmigaFullDisk(Parallaction *vm) : AmigaDisk(vm) {
+}
+
+
+void AmigaFullDisk::loadSlide(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "slides/%s", name);
+	Common::SeekableReadStream *s = openArchivedFile(path, false);
+	if (s)
+		loadBackground(path);
+	else
+		loadBackground(name);
+
+	return;
+}
+
+Cnv* AmigaFullDisk::loadFrames(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name);
+
+	Common::SeekableReadStream *s;
+
+	char path[PATH_LEN];
+	sprintf(path, "anims/%s", name);
+
+	s = openArchivedFile(path, false);
+	if (!s)
+		s = openArchivedFile(name, true);
+
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+
+
+StaticCnv* AmigaFullDisk::loadHead(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "%s.head", name);
+
+	Common::SeekableReadStream *s = openArchivedFile(path, true);
+	StaticCnv *cnv = makeStaticCnv(*s);
+
+	delete s;
+
+	return cnv;
+}
+
+
+Cnv* AmigaFullDisk::loadObjects(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
+
+	char path[PATH_LEN];
+	sprintf(path, "objs/%s.objs", name);
+	Common::SeekableReadStream *s = openArchivedFile(path, true);
+
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+
+Cnv* AmigaFullDisk::loadTalk(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name);
+
+	Common::SeekableReadStream *s;
+
+	char path[PATH_LEN];
+	sprintf(path, "talk/%s.talk", name);
+	s = openArchivedFile(path, false);
+	if (s == NULL) {
+		s = openArchivedFile(name, true);
+	}
+
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+Table* AmigaFullDisk::loadTable(const char* name) {
 	debugC(1, kDebugDisk, "AmigaDisk::loadTable '%s'", name);
 
 	char path[PATH_LEN];
@@ -1125,9 +1123,7 @@
 		dispose = true;
 		stream = s;
 	} else {
-		if (!(_vm->getFeatures() & GF_DEMO))
-			sprintf(path, "objs/%s.table", name);
-
+		sprintf(path, "objs/%s.table", name);
 		if (!_resArchive.openArchivedFile(path))
 			errorFileNotFound(path);
 
@@ -1148,6 +1144,20 @@
 	return t;
 }
 
+Font* AmigaFullDisk::loadFont(const char* name) {
+	debugC(1, kDebugDisk, "AmigaFullDisk::loadFont '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "%sfont", name);
+
+	Common::File stream;
+	if (!stream.open(path))
+		errorFileNotFound(path);
+
+	return createFont(name, stream);
+}
+
+
 Common::ReadStream* AmigaDisk::loadMusic(const char* name) {
 	return openArchivedFile(name);
 }
@@ -1161,5 +1171,122 @@
 	return new DummyArchiveStream(_resArchive);
 }
 
+AmigaDemoDisk::AmigaDemoDisk(Parallaction *vm) : AmigaDisk(vm) {
+}
 
+Cnv* AmigaDemoDisk::loadTalk(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name);
+
+	Common::SeekableReadStream *s;
+
+	char path[PATH_LEN];
+	sprintf(path, "%s.talk", name);
+	s = openArchivedFile(path, false);
+	if (s == NULL) {
+		s = openArchivedFile(name, true);
+	}
+
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+Cnv* AmigaDemoDisk::loadObjects(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
+
+	char path[PATH_LEN];
+	sprintf(path, "%s.objs", name);
+	Common::SeekableReadStream *s = openArchivedFile(path, true);
+
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+
+Cnv* AmigaDemoDisk::loadFrames(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name);
+
+	if (IS_MINI_CHARACTER(name))
+		return NULL;
+
+	Common::SeekableReadStream *s = openArchivedFile(name, true);
+	Cnv *cnv = makeCnv(*s);
+	delete s;
+
+	return cnv;
+}
+
+void AmigaDemoDisk::loadSlide(const char *name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name);
+	loadBackground(name);
+	return;
+}
+
+StaticCnv* AmigaDemoDisk::loadHead(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "%s.head", name);
+
+	Common::SeekableReadStream *s = openArchivedFile(path, true);
+	StaticCnv *cnv = makeStaticCnv(*s);
+
+	delete s;
+
+	return cnv;
+}
+
+Table* AmigaDemoDisk::loadTable(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadTable '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "%s.table", name);
+
+	bool dispose = false;
+
+	Common::SeekableReadStream *stream;
+
+	if (!scumm_stricmp(name, "global")) {
+		Common::File *s = new Common::File;
+		if (!s->open(path))
+			errorFileNotFound(path);
+
+		dispose = true;
+		stream = s;
+	} else {
+		if (!_resArchive.openArchivedFile(path))
+			errorFileNotFound(path);
+
+		stream = &_resArchive;
+	}
+
+	Table *t = new Table(100);
+
+	fillBuffers(*stream);
+	while (scumm_stricmp(_tokens[0], "ENDTABLE")) {
+		t->addData(_tokens[0]);
+		fillBuffers(*stream);
+	}
+
+	if (dispose)
+		delete stream;
+
+	return t;
+}
+
+Font* AmigaDemoDisk::loadFont(const char* name) {
+	debugC(1, kDebugDisk, "AmigaDisk::loadFont '%s'", name);
+
+	char path[PATH_LEN];
+	sprintf(path, "%sfont", name);
+
+	if (!_resArchive.openArchivedFile(path))
+		errorFileNotFound(path);
+
+	return createFont(name, _resArchive);
+}
+
 } // namespace Parallaction

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/disk.h	2007-06-15 21:40:02 UTC (rev 27437)
@@ -176,20 +176,42 @@
 
 	Script* loadLocation(const char *name);
 	Script* loadScript(const char* name);
+	StaticCnv* loadPointer();
+	StaticCnv* loadStatic(const char* name);
+	void loadScenery(const char* background, const char* mask);
+	Common::ReadStream* loadMusic(const char* name);
+	Common::ReadStream* loadSound(const char* name);
+};
+
+class AmigaDemoDisk : public AmigaDisk {
+
+public:
+	AmigaDemoDisk(Parallaction *vm);
+
 	Cnv* loadTalk(const char *name);
 	Cnv* loadObjects(const char *name);
-	StaticCnv* loadPointer();
 	StaticCnv* loadHead(const char* name);
+	Cnv* loadFrames(const char* name);
+	void loadSlide(const char *filename);
+	Table* loadTable(const char* name);
 	Font* loadFont(const char* name);
-	StaticCnv* loadStatic(const char* name);
+};
+
+class AmigaFullDisk : public AmigaDisk {
+
+public:
+	AmigaFullDisk(Parallaction *vm);
+
+	Cnv* loadTalk(const char *name);
+	Cnv* loadObjects(const char *name);
+	StaticCnv* loadHead(const char* name);
 	Cnv* loadFrames(const char* name);
 	void loadSlide(const char *filename);
-	void loadScenery(const char* background, const char* mask);
 	Table* loadTable(const char* name);
-	Common::ReadStream* loadMusic(const char* name);
-	Common::ReadStream* loadSound(const char* name);
+	Font* loadFont(const char* name);
 };
 
+
 } // namespace Parallaction
 
 

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -857,7 +857,7 @@
 
 	freeStaticCnv(_mouseComposedArrow);
 	delete _mouseComposedArrow;
-	
+
 	return;
 }
 

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -105,10 +105,12 @@
 
 void Menu::start() {
 
-	_vm->_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+	_vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1");
 
 	splash();
 
+	_vm->_gfx->setFont(kFontMenu);
+
 	_language = chooseLanguage();
 	_vm->_disk->setLanguage(_language);
 
@@ -144,6 +146,8 @@
 
 	const char **v14 = introMsg3;
 
+	_vm->_disk->selectArchive("disk1");
+
 	_vm->_disk->loadScenery("test", NULL);
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 	_vm->_gfx->swapBuffers();
@@ -182,10 +186,12 @@
 		return 1;
 	}
 
+	if (_vm->getFeatures() == GF_LANG_IT) {
+		return 0;
+	}
+
 	// user can choose language in dos version
 
-	_vm->_gfx->setFont(kFontMenu);
-
 	_vm->_disk->loadSlide("lingua");
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
@@ -329,7 +335,7 @@
 
 	_vm->_gfx->setFont(kFontMenu);
 
-	_vm->_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+	_vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1");
 
 	_vm->_disk->loadSlide("password");	// loads background into kBitBack buffer
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-06-15 21:22:14 UTC (rev 27436)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-06-15 21:40:02 UTC (rev 27437)
@@ -135,15 +135,15 @@
 	delete _zoneFlagNames;
 
 	_animations.remove(&_char._ani);
-	
+
 	freeLocation();
-	
+
 	freeCharacter();
 	destroyInventory();
 
 	delete _gfx;
 	delete _soundMan;
-	delete _disk;	
+	delete _disk;
 }
 
 
@@ -178,7 +178,12 @@
 	if (getPlatform() == Common::kPlatformPC) {
 		_disk = new DosDisk(this);
 	} else {
-		_disk = new AmigaDisk(this);
+		if (getFeatures() & GF_DEMO) {
+			strcpy(_location._name, "fognedemo");
+			_disk = new AmigaDemoDisk(this);
+		} else {
+			_disk = new AmigaFullDisk(this);
+		}
 		_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
 	}
 
@@ -281,10 +286,11 @@
 
 		switch (e.type) {
 		case Common::EVENT_KEYDOWN:
+			if (e.kbd.flags == Common::KBD_CTRL && e.kbd.keycode == 'd')
+				_debugger->attach();
+			if (getFeatures() & GF_DEMO) break;
 			if (e.kbd.ascii == 'l') KeyDown = kEvLoadGame;
 			if (e.kbd.ascii == 's') KeyDown = kEvSaveGame;
-			if (e.kbd.flags == Common::KBD_CTRL && e.kbd.keycode == 'd')
-				_debugger->attach();
 			break;
 
 		case Common::EVENT_LBUTTONDOWN:
@@ -753,13 +759,10 @@
 		// character for sanity before memory is freed
 		freeCharacter();
 
-		_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+		_disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1");
 		_vm->_char._ani._cnv = _disk->loadFrames(fullName);
 
 		if (!IS_DUMMY_CHARACTER(name)) {
-			if (_vm->getPlatform() == Common::kPlatformAmiga)
-				_disk->selectArchive("disk0");
-
 			_vm->_char._head = _disk->loadHead(baseName);
 			_vm->_char._talk = _disk->loadTalk(baseName);
 			_vm->_char._objs = _disk->loadObjects(baseName);


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