[Scummvm-cvs-logs] scummvm master -> 7ab553d72a14c04be1aa7e787eeef360be7bb619
fingolfin
max at quendi.de
Fri Jun 10 22:32:13 CEST 2011
This automated email contains information about 38 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bdad493f3f AUDIO: Remove dead code
55e1b08e22 AUDIO: Small cleanup in MidiParser_XMIDI::loadMusic
252a505db2 DETECTOR: Allocate MacResManager on the stack
4827cc914a ENGINES: Change incorrect use of 'target' to 'gameid'
b7d9e433bf DETECTOR: Add AdvancedMetaEngine constructor which works without ADParams
a9b49fbc66 AGI: Switch to alternate AdvancedMetaEngine, avoid ADParams
58c36801f4 AGOS: Switch to alternate AdvancedMetaEngine, avoid ADParams
3c837a39f0 CINE: Switch to alternate AdvancedMetaEngine, avoid ADParams
446e602840 CRUISE: Switch to alternate AdvancedMetaEngine, avoid ADParams
8174f7d521 DRACI: Switch to alternate AdvancedMetaEngine, avoid ADParams
ae75b9780c DRASCULA: Switch to alternate AdvancedMetaEngine, avoid ADParams
a89f9ca31c GOB: Switch to alternate AdvancedMetaEngine, avoid ADParams
0d581ba46d GROOVIE: Switch to alternate AdvancedMetaEngine, avoid ADParams
39aa627083 HUGO: Switch to alternate AdvancedMetaEngine, avoid ADParams
a29bc37eee KYRA: Switch to alternate AdvancedMetaEngine, avoid ADParams
2bbaf0339e LASTEXPRESS: Switch to alternate AdvancedMetaEngine, avoid ADParams
3491bf5b78 LURE: Switch to alternate AdvancedMetaEngine, avoid ADParams
dec7df0f16 M4: Switch to alternate AdvancedMetaEngine, avoid ADParams
97f82b5a93 MADE: Switch to alternate AdvancedMetaEngine, avoid ADParams
b1965f9a3f MOHAWK: Switch to alternate AdvancedMetaEngine, avoid ADParams
289ad6b541 PARALLACTION: Switch to alternate AdvancedMetaEngine, avoid ADParams
6fb0d6e8e9 SAGA: Switch to alternate AdvancedMetaEngine, avoid ADParams
b99d76acdb SCI: Switch to alternate AdvancedMetaEngine, avoid ADParams
43f301d4c7 SWORD25: Switch to alternate AdvancedMetaEngine, avoid ADParams
fc555635cf TEENAGENT: Switch to alternate AdvancedMetaEngine, avoid ADParams
3c0c14b4b5 TESTBED: Switch to alternate AdvancedMetaEngine, avoid ADParams
ce1a857669 TINSEL: Switch to alternate AdvancedMetaEngine, avoid ADParams
5e90393697 TOON: Switch to alternate AdvancedMetaEngine, avoid ADParams
3b6610927b TOUCHE: Switch to alternate AdvancedMetaEngine, avoid ADParams
0031e08349 TSAGE: Switch to alternate AdvancedMetaEngine, avoid ADParams
59d56b6687 TUCKER: Switch to alternate AdvancedMetaEngine, avoid ADParams
d46bfff066 DETECTOR: Make updateGameDescriptor a method of AdvancedMetaEngine
a0cba0a760 SWORD25: Fix warning
8878be7b11 LASTEXPRESS: Reduce header dependencies
95bfa81168 TOON: Reduce header dependencies
5d584bc782 TSAGE: Reduce header dependencies
eea6f69b59 DETECTOR: Turn some internal func of AdvancedMetaEngine into methods
7ab553d72a COMMON: Do not try to read from res forks of non-existant files
Commit: bdad493f3f01768f5693cc379609c2c89d6b2200
https://github.com/scummvm/scummvm/commit/bdad493f3f01768f5693cc379609c2c89d6b2200
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:39-07:00
Commit Message:
AUDIO: Remove dead code
Changed paths:
audio/mididrv.cpp
diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp
index 80981ee..0ca70b2 100644
--- a/audio/mididrv.cpp
+++ b/audio/mididrv.cpp
@@ -219,8 +219,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
}
}
- reslt = 0;
-
// If the selected driver did not match the flags setting,
// we try to determine a suitable and "optimal" music driver.
const MusicPlugin::List p = MusicMan.getPlugins();
@@ -268,7 +266,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
GUI::MessageDialog dialog(warningMsg);
dialog.runModal();
}
- hdl = 0;
}
}
@@ -283,9 +280,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
hdl = d->getHandle();
if (checkDevice(hdl))
return hdl;
- else
- // No warning here, since the user hasn't expressly requested anything.
- hdl = 0;
}
}
}
@@ -301,9 +295,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
hdl = d->getHandle();
if (checkDevice(hdl))
return hdl;
- else
- // No warning here, since the user hasn't expressly requested anything.
- hdl = 0;
}
}
}
@@ -357,15 +348,12 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
hdl = d->getHandle();
if (checkDevice(hdl))
return hdl;
- else
- // No warning here, since the user hasn't expressly requested anything.
- hdl = 0;
}
}
}
}
- return reslt;
+ return 0;
}
MidiDriver *MidiDriver::createMidi(MidiDriver::DeviceHandle handle) {
Commit: 55e1b08e22b737f6a64ae0505b4bdd190c9e08eb
https://github.com/scummvm/scummvm/commit/55e1b08e22b737f6a64ae0505b4bdd190c9e08eb
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:39-07:00
Commit Message:
AUDIO: Small cleanup in MidiParser_XMIDI::loadMusic
Changed paths:
audio/midiparser_xmidi.cpp
diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp
index 7c3cf10..85491fa 100644
--- a/audio/midiparser_xmidi.cpp
+++ b/audio/midiparser_xmidi.cpp
@@ -256,26 +256,25 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
// Add eight bytes
i += 8;
- if (memcmp(buf, "INFO", 4)) {
- // Must align
- pos += (chunk_len + 1) & ~1;
- i += (chunk_len + 1) & ~1;
- continue;
- }
-
- // Must be at least 2 bytes long
- if (chunk_len < 2) {
- warning("Invalid chunk length %d for 'INFO' block", (int)chunk_len);
- return false;
- }
+ if (memcmp(buf, "INFO", 4) == 0) {
+ // Must be at least 2 bytes long
+ if (chunk_len < 2) {
+ warning("Invalid chunk length %d for 'INFO' block", (int)chunk_len);
+ return false;
+ }
- _num_tracks = (byte)read2low(pos);
+ _num_tracks = (byte)read2low(pos);
- if (chunk_len > 2) {
- warning("Chunk length %d is greater than 2", (int)chunk_len);
- pos += chunk_len - 2;
+ if (chunk_len > 2) {
+ warning("Chunk length %d is greater than 2", (int)chunk_len);
+ //pos += chunk_len - 2;
+ }
+ break;
}
- break;
+
+ // Must align
+ pos += (chunk_len + 1) & ~1;
+ i += (chunk_len + 1) & ~1;
}
// Didn't get to fill the header
Commit: 252a505db2660ac1b022818f9883a8ba7e2dd405
https://github.com/scummvm/scummvm/commit/252a505db2660ac1b022818f9883a8ba7e2dd405
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:39-07:00
Commit Message:
DETECTOR: Allocate MacResManager on the stack
Changed paths:
engines/advancedDetector.cpp
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 2ee32b2..d81906e 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -456,16 +456,14 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p
// file and as one with resource fork.
if (g->flags & ADGF_MACRESFORK) {
- Common::MacResManager *macResMan = new Common::MacResManager();
+ Common::MacResManager macResMan;
- if (macResMan->open(parent, fname)) {
- tmp.md5 = macResMan->computeResForkMD5AsString(params.md5Bytes);
- tmp.size = macResMan->getResForkDataSize();
+ if (macResMan.open(parent, fname)) {
+ tmp.md5 = macResMan.computeResForkMD5AsString(params.md5Bytes);
+ tmp.size = macResMan.getResForkDataSize();
debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5.c_str());
filesSizeMD5[fname] = tmp;
}
-
- delete macResMan;
} else {
if (allFiles.contains(fname)) {
debug(3, "+ %s", fname.c_str());
Commit: 4827cc914a128b956d88ea3eae66d8866d9cd40e
https://github.com/scummvm/scummvm/commit/4827cc914a128b956d88ea3eae66d8866d9cd40e
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:40-07:00
Commit Message:
ENGINES: Change incorrect use of 'target' to 'gameid'
Changed paths:
engines/agi/detection.cpp
engines/agos/detection.cpp
engines/cine/detection.cpp
engines/cruise/detection.cpp
engines/draci/detection.cpp
engines/drascula/detection.cpp
engines/gob/detection.cpp
engines/groovie/detection.cpp
engines/hugo/detection.cpp
engines/kyra/detection.cpp
engines/lastexpress/detection.cpp
engines/lure/detection.cpp
engines/m4/detection.cpp
engines/made/detection.cpp
engines/mohawk/detection.cpp
engines/parallaction/detection.cpp
engines/saga/detection.cpp
engines/sci/detection.cpp
engines/sword25/detection.cpp
engines/teenagent/detection.cpp
engines/testbed/detection.cpp
engines/tinsel/detection.cpp
engines/toon/detection.cpp
engines/touche/detection.cpp
engines/tucker/detection.cpp
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 22d8adf..1d0f6c3 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -136,9 +136,9 @@ static const ADParams detectionParams = {
sizeof(Agi::AGIGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
agiGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"agi",
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 629a5d6..abd95cf 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -94,9 +94,9 @@ static const ADParams detectionParams = {
sizeof(AGOS::AGOSGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
simonGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
obsoleteGameIDsTable,
// Name of single gameid (optional)
0,
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 7383661..2e6e285 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -67,9 +67,9 @@ static const ADParams detectionParams = {
sizeof(Cine::CINEGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
cineGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
obsoleteGameIDsTable,
// Name of single gameid (optional)
"cine",
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index 3bd0c1f..cc058b1 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -224,9 +224,9 @@ static const ADParams detectionParams = {
sizeof(Cruise::CRUISEGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
cruiseGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"cruise",
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index d3483eb..0b2a0bd 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -90,9 +90,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
draciGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"draci",
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 5a8903d..853c4c7 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -273,9 +273,9 @@ static const ADParams detectionParams = {
sizeof(Drascula::DrasculaGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
drasculaGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"drascula",
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index be44c05..fc0915e 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -93,9 +93,9 @@ static const ADParams detectionParams = {
sizeof(Gob::GOBGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
gobGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
obsoleteGameIDsTable,
// Name of single gameid (optional)
"gob",
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 0dd510a..6f1b5e1 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -209,9 +209,9 @@ static const ADParams detectionParams = {
sizeof(GroovieGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
groovieGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"groovie",
diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index 25b8b16..29f5d9e 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -138,9 +138,9 @@ static const ADParams detectionParams = {
sizeof(HugoGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
hugoGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
0,
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 47a086e..6f2dcb5 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -54,9 +54,9 @@ static const ADParams detectionParams = {
sizeof(KYRAGameDescription),
// Number of bytes to compute MD5 sum for
1024 * 1024,
- // List of all engine targets
+ // List of all engine gameid
gameList,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
0,
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 7c7c6b0..e85ec41 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -183,9 +183,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
lastExpressGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"lastexpress",
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index ced0be0..69bc7d5 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -182,9 +182,9 @@ static const ADParams detectionParams = {
sizeof(Lure::LureGameDescription),
// Number of bytes to compute MD5 sum for
1024,
- // List of all engine targets
+ // List of all engine gameid
lureGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"lure",
diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp
index 1aefe3d..49a38d2 100644
--- a/engines/m4/detection.cpp
+++ b/engines/m4/detection.cpp
@@ -391,9 +391,9 @@ static const ADParams detectionParams = {
sizeof(M4::M4GameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
m4Games,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"m4",
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index 4576e2b..d27823f 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -532,9 +532,9 @@ static const ADParams detectionParams = {
sizeof(Made::MadeGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
madeGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"made",
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 6a73b28..551c369 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -165,9 +165,9 @@ static const ADParams detectionParams = {
sizeof(Mohawk::MohawkGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
mohawkGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"mohawk",
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index c3719bc..006ebac 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -227,9 +227,9 @@ static const ADParams detectionParams = {
sizeof(Parallaction::PARALLACTIONGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
parallactionGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
0,
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 23bdc73..4d1c89b 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -108,9 +108,9 @@ static const ADParams detectionParams = {
sizeof(Saga::SAGAGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
sagaGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
obsoleteGameIDsTable,
// Name of single gameid (optional)
"saga",
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 100b71e..6fb28fc 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -379,9 +379,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
s_sciGameTitles,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"sci",
diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp
index edb8c30..6e63996 100644
--- a/engines/sword25/detection.cpp
+++ b/engines/sword25/detection.cpp
@@ -48,9 +48,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
Sword25Game,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
NULL,
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index 5012e6a..5eb332f 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -86,9 +86,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
teenAgentGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"teenagent",
diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index 13af0f1..6a40b24 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -52,9 +52,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
512,
- // List of all engine targets
+ // List of all engine gameid
testbed_setting,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"testbed",
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index 0f0e3cd..0d283f2 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -63,7 +63,7 @@ uint16 TinselEngine::getVersion() const {
return _gameDescription->version;
}
-}
+} // End of namespace Tinsel
static const PlainGameDescriptor tinselGames[] = {
{"tinsel", "Tinsel engine game"},
@@ -81,9 +81,9 @@ static const ADParams detectionParams = {
sizeof(Tinsel::TinselGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
tinselGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"tinsel",
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index 1056f6e..be47d24 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -124,9 +124,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
- // List of all engine targets
+ // List of all engine gameid
ToonGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"toon",
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index b7f9c09..4ffad35 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -133,9 +133,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
4096,
- // List of all engine targets
+ // List of all engine gameid
toucheGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"touche",
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index 31d9cae..fe7cb47 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -109,9 +109,9 @@ static const ADParams detectionParams = {
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
512,
- // List of all engine targets
+ // List of all engine gameid
tuckerGames,
- // Structure for autoupgrading obsolete targets
+ // Structure for autoupgrading obsolete gameids
0,
// Name of single gameid (optional)
"tucker",
Commit: b7d9e433bfd93dbc91caa6759eafd3615d615b2e
https://github.com/scummvm/scummvm/commit/b7d9e433bfd93dbc91caa6759eafd3615d615b2e
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:40-07:00
Commit Message:
DETECTOR: Add AdvancedMetaEngine constructor which works without ADParams
Changed paths:
engines/advancedDetector.cpp
engines/advancedDetector.h
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index d81906e..c715d1e 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -62,7 +62,7 @@ static GameList gameIDList(const ADParams ¶ms) {
if (params.singleid != NULL) {
GameList gl;
- const PlainGameDescriptor *g = params.list;
+ const PlainGameDescriptor *g = params.gameDescriptors;
while (g->gameid) {
if (0 == scumm_stricmp(params.singleid, g->gameid)) {
gl.push_back(GameDescriptor(g->gameid, g->description));
@@ -74,7 +74,7 @@ static GameList gameIDList(const ADParams ¶ms) {
error("Engine %s doesn't have its singleid specified in ids list", params.singleid);
}
- return GameList(params.list);
+ return GameList(params.gameDescriptors);
}
static void upgradeTargetIfNecessary(const ADParams ¶ms) {
@@ -109,11 +109,11 @@ namespace AdvancedDetector {
GameDescriptor findGameID(
const char *gameid,
- const PlainGameDescriptor *list,
+ const PlainGameDescriptor *gameDescriptors,
const ADObsoleteGameID *obsoleteList
) {
- // First search the list of supported game IDs for a match.
- const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, list);
+ // First search the list of supported gameids for a match.
+ const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameDescriptors);
if (g)
return GameDescriptor(*g);
@@ -123,7 +123,7 @@ GameDescriptor findGameID(
const ADObsoleteGameID *o = obsoleteList;
while (o->from) {
if (0 == scumm_stricmp(gameid, o->from)) {
- g = findPlainGameDescriptor(o->to, list);
+ g = findPlainGameDescriptor(o->to, gameDescriptors);
if (g && g->description)
return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")");
else
@@ -244,14 +244,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
// Use fallback detector if there were no matches by other means
const ADGameDescription *fallbackDesc = fallbackDetect(fslist);
if (fallbackDesc != 0) {
- GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.list));
+ GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors));
updateGameDescriptor(desc, fallbackDesc, params);
detectedGames.push_back(desc);
}
} else {
// Otherwise use the found matches
for (uint i = 0; i < matches.size(); i++) {
- GameDescriptor desc(toGameDescriptor(*matches[i], params.list));
+ GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors));
updateGameDescriptor(desc, matches[i], params);
detectedGames.push_back(desc);
}
@@ -344,7 +344,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions, lang);
- debug(2, "Running %s", toGameDescriptor(*agdDesc, params.list).description().c_str());
+ debug(2, "Running %s", toGameDescriptor(*agdDesc, params.gameDescriptors).description().c_str());
if (!createInstance(syst, engine, agdDesc))
return Common::kNoGameDataFoundError;
else
@@ -645,5 +645,19 @@ GameList AdvancedMetaEngine::getSupportedGames() const {
return gameIDList(params);
}
GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const {
- return AdvancedDetector::findGameID(gameid, params.list, params.obsoleteList);
+ return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList);
+}
+
+AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors) {
+ params.descs = (const byte *)descs;
+ params.descItemSize = descItemSize;
+ params.md5Bytes = 5000;
+ params.gameDescriptors = gameDescriptors;
+ params.obsoleteList = NULL;
+ params.singleid = NULL;
+ params.fileBasedFallback = NULL;
+ params.flags = 0;
+ params.guioptions = Common::GUIO_NONE;
+ params.depth = 1;
+ params.directoryGlobs = NULL;
}
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 408c465..f3eac20 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -148,7 +148,7 @@ struct ADParams {
* A list of all gameids (and their corresponding descriptions) supported
* by this engine.
*/
- const PlainGameDescriptor *list;
+ const PlainGameDescriptor *gameDescriptors;
/**
* Structure for autoupgrading obsolete targets (optional).
@@ -224,9 +224,11 @@ GameDescriptor findGameID(
* A MetaEngine implementation based around the advanced detector code.
*/
class AdvancedMetaEngine : public MetaEngine {
- const ADParams ¶ms;
+protected:
+ ADParams params;
public:
AdvancedMetaEngine(const ADParams &dp) : params(dp) {}
+ AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors);
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
Commit: a9b49fbc66d4420e252500ac8316e632f53d2075
https://github.com/scummvm/scummvm/commit/a9b49fbc66d4420e252500ac8316e632f53d2075
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:40-07:00
Commit Message:
AGI: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/agi/detection.cpp
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 1d0f6c3..b0e055e 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -129,31 +129,6 @@ static const PlainGameDescriptor agiGames[] = {
#include "agi/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Agi::gameDescriptions,
- // Size of that superset structure
- sizeof(Agi::AGIGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- agiGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "agi",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOSPEECH,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
using namespace Agi;
class AgiMetaEngine : public AdvancedMetaEngine {
@@ -161,7 +136,10 @@ class AgiMetaEngine : public AdvancedMetaEngine {
mutable Common::String _extra;
public:
- AgiMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames) {
+ params.singleid = "agi";
+ params.guioptions = Common::GUIO_NOSPEECH;
+ }
virtual const char *getName() const {
return "AGI preAGI + v2 + v3";
Commit: 58c36801f4a59d8da05c8702637b1cc294625f5b
https://github.com/scummvm/scummvm/commit/58c36801f4a59d8da05c8702637b1cc294625f5b
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:40-07:00
Commit Message:
AGOS: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/agos/detection.cpp
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index abd95cf..dbd1743 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -63,7 +63,7 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
{0, 0, Common::kPlatformUnknown}
};
-static const PlainGameDescriptor simonGames[] = {
+static const PlainGameDescriptor agosGames[] = {
{"pn", "Personal Nightmare"},
{"elvira1", "Elvira - Mistress of the Dark"},
{"elvira2", "Elvira II - The Jaws of Cerberus"},
@@ -87,36 +87,16 @@ static const char *directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)AGOS::gameDescriptions,
- // Size of that superset structure
- sizeof(AGOS::AGOSGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- simonGames,
- // Structure for autoupgrading obsolete gameids
- obsoleteGameIDsTable,
- // Name of single gameid (optional)
- 0,
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOLAUNCHLOAD,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
using namespace AGOS;
class AgosMetaEngine : public AdvancedMetaEngine {
public:
- AgosMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ AgosMetaEngine() : AdvancedMetaEngine(AGOS::gameDescriptions, sizeof(AGOS::AGOSGameDescription), agosGames) {
+ params.obsoleteList = obsoleteGameIDsTable;
+ params.guioptions = Common::GUIO_NOLAUNCHLOAD;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "AGOS";
Commit: 3c837a39f0e2b45cf357c22a40cd3592f6ab760f
https://github.com/scummvm/scummvm/commit/3c837a39f0e2b45cf357c22a40cd3592f6ab760f
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:41-07:00
Commit Message:
CINE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/cine/detection.cpp
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 2e6e285..89c81c2 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -60,34 +60,13 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
#include "cine/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Cine::gameDescriptions,
- // Size of that superset structure
- sizeof(Cine::CINEGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- cineGames,
- // Structure for autoupgrading obsolete gameids
- obsoleteGameIDsTable,
- // Name of single gameid (optional)
- "cine",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class CineMetaEngine : public AdvancedMetaEngine {
public:
- CineMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) {
+ params.obsoleteList = obsoleteGameIDsTable;
+ params.singleid = "cine";
+ params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI;
+ }
virtual const char *getName() const {
return "Cine";
Commit: 446e6028409259f55691146c80070fb6a57a8640
https://github.com/scummvm/scummvm/commit/446e6028409259f55691146c80070fb6a57a8640
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:41-07:00
Commit Message:
CRUISE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/cruise/detection.cpp
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index cc058b1..f6f8db4 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -217,34 +217,12 @@ static const CRUISEGameDescription gameDescriptions[] = {
}
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Cruise::gameDescriptions,
- // Size of that superset structure
- sizeof(Cruise::CRUISEGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- cruiseGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "cruise",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class CruiseMetaEngine : public AdvancedMetaEngine {
public:
- CruiseMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) {
+ params.singleid = "cruise";
+ params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI;
+ }
virtual const char *getName() const {
return "CruisE";
Commit: 8174f7d5215cc7b2d85f66fde56803d25f25796a
https://github.com/scummvm/scummvm/commit/8174f7d5215cc7b2d85f66fde56803d25f25796a
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:41-07:00
Commit Message:
DRACI: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/draci/detection.cpp
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 0b2a0bd..cf0413f 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -83,34 +83,11 @@ const ADGameDescription gameDescriptions[] = {
} // End of namespace Draci
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Draci::gameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- draciGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "draci",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class DraciMetaEngine : public AdvancedMetaEngine {
public:
- DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ DraciMetaEngine() : AdvancedMetaEngine(Draci::gameDescriptions, sizeof(ADGameDescription), draciGames) {
+ params.singleid = "draci";
+ }
virtual const char *getName() const {
return "Draci";
Commit: ae75b9780c30d641591517862f6b2d60ff51f686
https://github.com/scummvm/scummvm/commit/ae75b9780c30d641591517862f6b2d60ff51f686
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:41-07:00
Commit Message:
DRASCULA: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/drascula/detection.cpp
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 853c4c7..9494bfa 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -266,34 +266,12 @@ static const DrasculaGameDescription gameDescriptions[] = {
} // End of namespace Drascula
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Drascula::gameDescriptions,
- // Size of that superset structure
- sizeof(Drascula::DrasculaGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- drasculaGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "drascula",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class DrasculaMetaEngine : public AdvancedMetaEngine {
public:
- DrasculaMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) {
+ params.singleid = "drascula";
+ params.guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD;
+ }
virtual const char *getName() const {
return "Drascula";
Commit: a89f9ca31cf913125f0310f09f48b1264e51be7b
https://github.com/scummvm/scummvm/commit/a89f9ca31cf913125f0310f09f48b1264e51be7b
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:42-07:00
Commit Message:
GOB: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/gob/detection.cpp
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index fc0915e..2ecd6b7 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -86,34 +86,14 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
#include "gob/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Gob::gameDescriptions,
- // Size of that superset structure
- sizeof(Gob::GOBGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- gobGames,
- // Structure for autoupgrading obsolete gameids
- obsoleteGameIDsTable,
- // Name of single gameid (optional)
- "gob",
- // List of files for file-based fallback detection (optional)
- Gob::fileBased,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOLAUNCHLOAD,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class GobMetaEngine : public AdvancedMetaEngine {
public:
- GobMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) {
+ params.obsoleteList = obsoleteGameIDsTable;
+ params.singleid = "gob";
+ params.fileBasedFallback = Gob::fileBased;
+ params.guioptions = Common::GUIO_NOLAUNCHLOAD;
+ }
virtual const char *getName() const {
return "Gob";
Commit: 0d581ba46dcbb8ef616a450ca0cf09d9072b9183
https://github.com/scummvm/scummvm/commit/0d581ba46dcbb8ef616a450ca0cf09d9072b9183
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:42-07:00
Commit Message:
GROOVIE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/groovie/detection.cpp
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 6f1b5e1..62ee65d 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -202,35 +202,13 @@ static const GroovieGameDescription gameDescriptions[] = {
{AD_TABLE_END_MARKER, kGroovieT7G, 0}
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)gameDescriptions,
- // Size of that superset structure
- sizeof(GroovieGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- groovieGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "groovie",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- kADFlagUseExtraAsHint,
- // Additional GUI options (for every game}
- Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
-
class GroovieMetaEngine : public AdvancedMetaEngine {
public:
- GroovieMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames) {
+ params.singleid = "groovie";
+ params.flags = kADFlagUseExtraAsHint;
+ params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX;
+ }
const char *getName() const {
return "Groovie";
Commit: 39aa627083ef0a6654909930e42bc1f8f6de4a28
https://github.com/scummvm/scummvm/commit/39aa627083ef0a6654909930e42bc1f8f6de4a28
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:42-07:00
Commit Message:
HUGO: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/hugo/detection.cpp
diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index 29f5d9e..f70a21a 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -131,34 +131,10 @@ static const HugoGameDescription gameDescriptions[] = {
{AD_TABLE_END_MARKER, kGameTypeNone}
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)gameDescriptions,
- // Size of that superset structure
- sizeof(HugoGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- hugoGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- 0,
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class HugoMetaEngine : public AdvancedMetaEngine {
public:
- HugoMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ HugoMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(HugoGameDescription), hugoGames) {
+ }
const char *getName() const {
return "Hugo";
Commit: a29bc37eee030533bafbae32a253f2ad8dabadde
https://github.com/scummvm/scummvm/commit/a29bc37eee030533bafbae32a253f2ad8dabadde
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:42-07:00
Commit Message:
KYRA: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/kyra/detection.cpp
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 6f2dcb5..6589c2b 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -47,37 +47,15 @@ const char * const directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)adGameDescs,
- // Size of that superset structure
- sizeof(KYRAGameDescription),
- // Number of bytes to compute MD5 sum for
- 1024 * 1024,
- // List of all engine gameid
- gameList,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- 0,
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
} // End of anonymous namespace
class KyraMetaEngine : public AdvancedMetaEngine {
public:
- KyraMetaEngine() : AdvancedMetaEngine(detectionParams) {}
-
+ KyraMetaEngine() : AdvancedMetaEngine(adGameDescs, sizeof(KYRAGameDescription), gameList) {
+ params.md5Bytes = 1024 * 1024;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
const char *getName() const {
return "Kyra";
}
Commit: 2bbaf0339e0f9ac4f592b1f9c414516057859015
https://github.com/scummvm/scummvm/commit/2bbaf0339e0f9ac4f592b1f9c414516057859015
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:42-07:00
Commit Message:
LASTEXPRESS: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/lastexpress/detection.cpp
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index e85ec41..d8b98bb 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -176,35 +176,13 @@ static const ADGameDescription gameDescriptions[] = {
AD_TABLE_END_MARKER
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)gameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- lastExpressGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "lastexpress",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class LastExpressMetaEngine : public AdvancedMetaEngine {
public:
- LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) {
+ params.singleid = "lastexpress";
+ params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX;
+ }
const char *getName() const {
return "Lastexpress";
Commit: 3491bf5b789f8fdc824e4aae346c7824550e841c
https://github.com/scummvm/scummvm/commit/3491bf5b789f8fdc824e4aae346c7824550e841c
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:43-07:00
Commit Message:
LURE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/lure/detection.cpp
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index 69bc7d5..83ede92 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -175,34 +175,14 @@ static const LureGameDescription gameDescriptions[] = {
} // End of namespace Lure
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Lure::gameDescriptions,
- // Size of that superset structure
- sizeof(Lure::LureGameDescription),
- // Number of bytes to compute MD5 sum for
- 1024,
- // List of all engine gameid
- lureGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "lure",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- kADFlagUseExtraAsHint,
- // Additional GUI options (for every game}
- Common::GUIO_NOSPEECH,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class LureMetaEngine : public AdvancedMetaEngine {
public:
- LureMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) {
+ params.md5Bytes = 1024;
+ params.singleid = "lure";
+ params.flags = kADFlagUseExtraAsHint;
+ params.guioptions = Common::GUIO_NOSPEECH;
+ }
virtual const char *getName() const {
return "Lure";
Commit: dec7df0f16c0615482f6ae2830cfee1690afe5fc
https://github.com/scummvm/scummvm/commit/dec7df0f16c0615482f6ae2830cfee1690afe5fc
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:43-07:00
Commit Message:
M4: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/m4/detection.cpp
diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp
index 49a38d2..bab17d9 100644
--- a/engines/m4/detection.cpp
+++ b/engines/m4/detection.cpp
@@ -384,34 +384,14 @@ static const char *directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)M4::gameDescriptions,
- // Size of that superset structure
- sizeof(M4::M4GameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- m4Games,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "m4",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOMIDI,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
class M4MetaEngine : public AdvancedMetaEngine {
public:
- M4MetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ M4MetaEngine() : AdvancedMetaEngine(M4::gameDescriptions, sizeof(M4::M4GameDescription), m4Games) {
+ params.singleid = "m4";
+ params.guioptions = Common::GUIO_NOMIDI;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "MADS/M4";
Commit: 97f82b5a93848ceeaa0701dd0f6038ba30f50ea3
https://github.com/scummvm/scummvm/commit/97f82b5a93848ceeaa0701dd0f6038ba30f50ea3
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:43-07:00
Commit Message:
MADE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/made/detection.cpp
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index d27823f..a0576a4 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -525,34 +525,11 @@ static MadeGameDescription g_fallbackDesc = {
} // End of namespace Made
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Made::gameDescriptions,
- // Size of that superset structure
- sizeof(Made::MadeGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- madeGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "made",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class MadeMetaEngine : public AdvancedMetaEngine {
public:
- MadeMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ MadeMetaEngine() : AdvancedMetaEngine(Made::gameDescriptions, sizeof(Made::MadeGameDescription), madeGames) {
+ params.singleid = "made";
+ }
virtual const char *getName() const {
return "MADE";
Commit: b1965f9a3f48a40cb84ff22b76a95a1cfc4eef38
https://github.com/scummvm/scummvm/commit/b1965f9a3f48a40cb84ff22b76a95a1cfc4eef38
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:43-07:00
Commit Message:
MOHAWK: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/mohawk/detection.cpp
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 551c369..a744272 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -158,35 +158,14 @@ static const char *directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Mohawk::gameDescriptions,
- // Size of that superset structure
- sizeof(Mohawk::MohawkGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- mohawkGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "mohawk",
- // List of files for file-based fallback detection (optional)
- Mohawk::fileBased,
- // Flags
- 0,
- // Additional GUI options (for every game)
- Common::GUIO_NONE,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
class MohawkMetaEngine : public AdvancedMetaEngine {
public:
- MohawkMetaEngine() : AdvancedMetaEngine(detectionParams) {}
-
+ MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) {
+ params.singleid = "mohawk";
+ params.fileBasedFallback = Mohawk::fileBased;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "Mohawk";
}
Commit: 289ad6b541a3f83f0283dc68510d2aedde9e4c38
https://github.com/scummvm/scummvm/commit/289ad6b541a3f83f0283dc68510d2aedde9e4c38
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:44-07:00
Commit Message:
PARALLACTION: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/parallaction/detection.cpp
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index 006ebac..09f6fa5 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -220,34 +220,11 @@ static const PARALLACTIONGameDescription gameDescriptions[] = {
}
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Parallaction::gameDescriptions,
- // Size of that superset structure
- sizeof(Parallaction::PARALLACTIONGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- parallactionGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- 0,
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOLAUNCHLOAD,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class ParallactionMetaEngine : public AdvancedMetaEngine {
public:
- ParallactionMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ ParallactionMetaEngine() : AdvancedMetaEngine(Parallaction::gameDescriptions, sizeof(Parallaction::PARALLACTIONGameDescription), parallactionGames) {
+ params.guioptions = Common::GUIO_NOLAUNCHLOAD;
+ }
virtual const char *getName() const {
return "Parallaction";
Commit: 6fb0d6e8e970c59b5f3cffaf12b2560d2687fdff
https://github.com/scummvm/scummvm/commit/6fb0d6e8e970c59b5f3cffaf12b2560d2687fdff
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:44-07:00
Commit Message:
SAGA: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/saga/detection.cpp
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 4d1c89b..ece9085 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -101,34 +101,12 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
#include "saga/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Saga::gameDescriptions,
- // Size of that superset structure
- sizeof(Saga::SAGAGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- sagaGames,
- // Structure for autoupgrading obsolete gameids
- obsoleteGameIDsTable,
- // Name of single gameid (optional)
- "saga",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class SagaMetaEngine : public AdvancedMetaEngine {
public:
- SagaMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) {
+ params.obsoleteList = obsoleteGameIDsTable;
+ params.singleid = "saga";
+ }
virtual const char *getName() const {
return "SAGA ["
Commit: b99d76acdbc990f24fc34c2b3f5f0ff6ab68422c
https://github.com/scummvm/scummvm/commit/b99d76acdbc990f24fc34c2b3f5f0ff6ab68422c
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:44-07:00
Commit Message:
SCI: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/sci/detection.cpp
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 6fb28fc..302ba13 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -371,35 +371,11 @@ static ADGameDescription s_fallbackDesc = {
static char s_fallbackGameIdBuf[256];
-
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Sci::SciGameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- s_sciGameTitles,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "sci",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class SciMetaEngine : public AdvancedMetaEngine {
public:
- SciMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles) {
+ params.singleid = "sci";
+ }
virtual const char *getName() const {
return "SCI [SCI0, SCI01, SCI10, SCI11"
Commit: 43f301d4c76cf1d303c71f3114d0f66e39264a95
https://github.com/scummvm/scummvm/commit/43f301d4c76cf1d303c71f3114d0f66e39264a95
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:45-07:00
Commit Message:
SWORD25: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/sword25/detection.cpp
diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp
index 6e63996..c704b3e 100644
--- a/engines/sword25/detection.cpp
+++ b/engines/sword25/detection.cpp
@@ -31,7 +31,7 @@ namespace Sword25 {
uint32 Sword25Engine::getGameFlags() const { return _gameDescription->flags; }
}
-static const PlainGameDescriptor Sword25Game[] = {
+static const PlainGameDescriptor sword25Game[] = {
{"sword25", "Broken Sword 2.5"},
{0, 0}
};
@@ -41,35 +41,13 @@ static const char *directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Sword25::gameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- Sword25Game,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- NULL,
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOMIDI,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
class Sword25MetaEngine : public AdvancedMetaEngine {
public:
- Sword25MetaEngine() : AdvancedMetaEngine(detectionParams) {}
-
+ Sword25MetaEngine() : AdvancedMetaEngine(Sword25::gameDescriptions, sizeof(ADGameDescription), sword25Game) {
+ params.guioptions = Common::GUIO_NOMIDI;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "Sword25";
}
Commit: fc555635cf2a64e6ac274550734949bb551b239f
https://github.com/scummvm/scummvm/commit/fc555635cf2a64e6ac274550734949bb551b239f
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:45-07:00
Commit Message:
TEENAGENT: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/teenagent/detection.cpp
diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp
index 5eb332f..b684560 100644
--- a/engines/teenagent/detection.cpp
+++ b/engines/teenagent/detection.cpp
@@ -79,37 +79,14 @@ static const ADGameDescription teenAgentGameDescriptions[] = {
AD_TABLE_END_MARKER,
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)teenAgentGameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- teenAgentGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "teenagent",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
+enum {
+ MAX_SAVES = 20
};
-#define MAX_SAVES 20
-
-
class TeenAgentMetaEngine : public AdvancedMetaEngine {
public:
- TeenAgentMetaEngine() : AdvancedMetaEngine(detectionParams) {
+ TeenAgentMetaEngine() : AdvancedMetaEngine(teenAgentGameDescriptions, sizeof(ADGameDescription), teenAgentGames) {
+ params.singleid = "teenagent";
}
virtual const char *getName() const {
Commit: 3c0c14b4b50d253d8f318335c8fa99cfbb3e013b
https://github.com/scummvm/scummvm/commit/3c0c14b4b50d253d8f318335c8fa99cfbb3e013b
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:45-07:00
Commit Message:
TESTBED: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/testbed/detection.cpp
diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index 6a40b24..2c3d5b4 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -45,34 +45,11 @@ static const ADGameDescription testbedDescriptions[] = {
AD_TABLE_END_MARKER
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)testbedDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 512,
- // List of all engine gameid
- testbed_setting,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "testbed",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- ADGF_NO_FLAGS,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class TestbedMetaEngine : public AdvancedMetaEngine {
public:
- TestbedMetaEngine() : AdvancedMetaEngine(detectionParams) {
+ TestbedMetaEngine() : AdvancedMetaEngine(testbedDescriptions, sizeof(ADGameDescription), testbed_setting) {
+ params.md5Bytes = 512;
+ params.singleid = "testbed";
}
virtual const char *getName() const {
Commit: ce1a8576694ede9434d4e44babc4dead9f6b44d7
https://github.com/scummvm/scummvm/commit/ce1a8576694ede9434d4e44babc4dead9f6b44d7
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:45-07:00
Commit Message:
TINSEL: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/tinsel/detection.cpp
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index 0d283f2..59a567b 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -74,34 +74,11 @@ static const PlainGameDescriptor tinselGames[] = {
#include "tinsel/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Tinsel::gameDescriptions,
- // Size of that superset structure
- sizeof(Tinsel::TinselGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- tinselGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "tinsel",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class TinselMetaEngine : public AdvancedMetaEngine {
public:
- TinselMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ TinselMetaEngine() : AdvancedMetaEngine(Tinsel::gameDescriptions, sizeof(Tinsel::TinselGameDescription), tinselGames) {
+ params.singleid = "tinsel";
+ }
virtual const char *getName() const {
return "Tinsel";
@@ -265,7 +242,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList &
if (testFile.open(allFiles[fname])) {
tmp.size = (int32)testFile.size();
- tmp.md5 = computeStreamMD5AsString(testFile, detectionParams.md5Bytes);
+ tmp.md5 = computeStreamMD5AsString(testFile, params.md5Bytes);
} else {
tmp.size = -1;
}
@@ -285,7 +262,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList &
bool fileMissing = false;
- if ((detectionParams.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra)
+ if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra)
continue;
bool allFilesPresent = true;
Commit: 5e9039369790379362c29619453327d2b3be4170
https://github.com/scummvm/scummvm/commit/5e9039369790379362c29619453327d2b3be4170
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:45-07:00
Commit Message:
TOON: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/toon/detection.cpp
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index be47d24..8ddfcd4 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -28,7 +28,7 @@
#include "graphics/thumbnail.h"
#include "toon/toon.h"
-static const PlainGameDescriptor ToonGames[] = {
+static const PlainGameDescriptor toonGames[] = {
{ "toon", "Toonstruck" },
{ 0, 0 }
};
@@ -117,35 +117,14 @@ static const char * const directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Toon::gameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine gameid
- ToonGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "toon",
- // List of files for file-based fallback detection (optional)
- Toon::fileBasedFallback,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 3,
- // List of directory globs
- directoryGlobs
-};
-
class ToonMetaEngine : public AdvancedMetaEngine {
public:
- ToonMetaEngine() : AdvancedMetaEngine(detectionParams) {}
-
+ ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) {
+ params.singleid = "toon";
+ params.fileBasedFallback = Toon::fileBasedFallback;
+ params.depth = 3;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "Toon";
}
Commit: 3b6610927b5591a3909c4e0daea3d7232400fc32
https://github.com/scummvm/scummvm/commit/3b6610927b5591a3909c4e0daea3d7232400fc32
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:46-07:00
Commit Message:
TOUCHE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/touche/detection.cpp
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index 4ffad35..3e324b5 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -126,35 +126,16 @@ static const char *directoryGlobs[] = {
0
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Touche::gameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 4096,
- // List of all engine gameid
- toucheGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "touche",
- // List of files for file-based fallback detection (optional)
- Touche::fileBasedFallback,
- // Flags
- kADFlagPrintWarningOnFileBasedFallback,
- // Additional GUI options (for every game}
- Common::GUIO_NONE,
- // Maximum directory depth
- 2,
- // List of directory globs
- directoryGlobs
-};
-
class ToucheMetaEngine : public AdvancedMetaEngine {
public:
- ToucheMetaEngine() : AdvancedMetaEngine(detectionParams) {}
-
+ ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) {
+ params.md5Bytes = 4096;
+ params.singleid = "touche";
+ params.fileBasedFallback = Touche::fileBasedFallback;
+ params.flags = kADFlagPrintWarningOnFileBasedFallback;
+ params.depth = 2;
+ params.directoryGlobs = directoryGlobs;
+ }
virtual const char *getName() const {
return "Touche";
}
Commit: 0031e0834911ad3b4dbec262aec0dd30858e96fc
https://github.com/scummvm/scummvm/commit/0031e0834911ad3b4dbec262aec0dd30858e96fc
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:46-07:00
Commit Message:
TSAGE: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/tsage/detection.cpp
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index 20c2002..57ba997 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -66,25 +66,17 @@ static const PlainGameDescriptor tSageGameTitles[] = {
#include "engines/tsage/detection_tables.h"
-static const ADParams detectionParams = {
- (const byte *)tSage::gameDescriptions,
- sizeof(tSage::tSageGameDescription),
- 0,
- tSageGameTitles,
- 0,
- "tsage",
- NULL,
- 0,
- Common::GUIO_NONE,
- 0,
- NULL
+enum {
+ MAX_SAVES = 100
};
-#define MAX_SAVES 100
-
class TSageMetaEngine : public AdvancedMetaEngine {
public:
- TSageMetaEngine() : AdvancedMetaEngine(detectionParams) {
+ TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) {
+ params.md5Bytes = 0; // FIXME ????
+ params.singleid = "tsage";
+ params.guioptions = Common::GUIO_NOSPEECH;
+ params.depth = 0; // FIXME ????
}
virtual const char *getName() const {
Commit: 59d56b66878ce9a5119c2278262fd37289685b4f
https://github.com/scummvm/scummvm/commit/59d56b66878ce9a5119c2278262fd37289685b4f
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:46-07:00
Commit Message:
TUCKER: Switch to alternate AdvancedMetaEngine, avoid ADParams
Changed paths:
engines/tucker/detection.cpp
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index fe7cb47..3eb3973 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -102,31 +102,6 @@ static const ADGameDescription tuckerGameDescriptions[] = {
AD_TABLE_END_MARKER
};
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)tuckerGameDescriptions,
- // Size of that superset structure
- sizeof(ADGameDescription),
- // Number of bytes to compute MD5 sum for
- 512,
- // List of all engine gameid
- tuckerGames,
- // Structure for autoupgrading obsolete gameids
- 0,
- // Name of single gameid (optional)
- "tucker",
- // List of files for file-based fallback detection (optional)
- 0,
- // Flags
- 0,
- // Additional GUI options (for every game)
- Common::GUIO_NONE,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
static const ADGameDescription tuckerDemoGameDescription = {
"tucker",
"Non-Interactive Demo",
@@ -139,7 +114,9 @@ static const ADGameDescription tuckerDemoGameDescription = {
class TuckerMetaEngine : public AdvancedMetaEngine {
public:
- TuckerMetaEngine() : AdvancedMetaEngine(detectionParams) {
+ TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) {
+ params.md5Bytes = 512;
+ params.singleid = "tucker";
}
virtual const char *getName() const {
Commit: d46bfff0660042de52732eb4176e23b73a45e2d6
https://github.com/scummvm/scummvm/commit/d46bfff0660042de52732eb4176e23b73a45e2d6
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:46-07:00
Commit Message:
DETECTOR: Make updateGameDescriptor a method of AdvancedMetaEngine
Changed paths:
engines/advancedDetector.cpp
engines/advancedDetector.h
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index c715d1e..06f6c79 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -189,7 +189,7 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD
return res;
}
-static void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc, const ADParams ¶ms) {
+static void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) {
if (params.singleid != NULL) {
desc["preferredtarget"] = desc["gameid"];
desc["gameid"] = params.singleid;
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index f3eac20..e3a4087 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -246,6 +246,9 @@ public:
virtual const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const {
return 0;
}
+
+protected:
+ void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc);
};
#endif
Commit: a0cba0a76032129d0197fa6413ea6ae6068ba073
https://github.com/scummvm/scummvm/commit/a0cba0a76032129d0197fa6413ea6ae6068ba073
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:47-07:00
Commit Message:
SWORD25: Fix warning
Changed paths:
engines/sword25/sfx/soundengine.cpp
diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp
index 13ee3fd..e650ae6 100644
--- a/engines/sword25/sfx/soundengine.cpp
+++ b/engines/sword25/sfx/soundengine.cpp
@@ -73,7 +73,7 @@ void SoundEngine::update() {
}
void SoundEngine::setVolume(float volume, SOUND_TYPES type) {
- int val = 255 * volume;
+ int val = (int)(255 * volume);
switch (type) {
case SoundEngine::MUSIC:
Commit: 8878be7b11e48541666a9a42a3d72122ad7c99f5
https://github.com/scummvm/scummvm/commit/8878be7b11e48541666a9a42a3d72122ad7c99f5
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:47-07:00
Commit Message:
LASTEXPRESS: Reduce header dependencies
Changed paths:
engines/lastexpress/detection.cpp
engines/lastexpress/lastexpress.cpp
engines/lastexpress/lastexpress.h
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index d8b98bb..bf575b6 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -21,6 +21,7 @@
*/
#include "lastexpress/lastexpress.h"
+#include "engines/advancedDetector.h"
namespace LastExpress {
@@ -202,6 +203,10 @@ bool LastExpressMetaEngine::createInstance(OSystem *syst, Engine **engine, const
return gd != 0;
}
+bool LastExpressEngine::isDemo() const {
+ return (bool)(_gameDescription->flags & ADGF_DEMO);
+}
+
} // End of namespace LastExpress
#if PLUGIN_ENABLED_DYNAMIC(LASTEXPRESS)
diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp
index 6fdd184..e162998 100644
--- a/engines/lastexpress/lastexpress.cpp
+++ b/engines/lastexpress/lastexpress.cpp
@@ -37,6 +37,8 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/error.h"
+#include "common/fs.h"
#include "engines/util.h"
diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h
index d78bba3..f8f3878 100644
--- a/engines/lastexpress/lastexpress.h
+++ b/engines/lastexpress/lastexpress.h
@@ -29,11 +29,12 @@
#include "common/random.h"
#include "common/timer.h"
-#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "graphics/pixelformat.h"
+struct ADGameDescription;
+
/**
* This is the namespace of the LastExpress engine.
*
@@ -101,7 +102,7 @@ public:
void restoreEventHandlers();
void setEventHandlers(EventHandler::EventFunction *eventMouse, EventHandler::EventFunction *eventTick);
- bool isDemo() const { return (bool)(_gameDescription->flags & ADGF_DEMO); }
+ bool isDemo() const;
// Frame Counter
uint32 getFrameCounter() { return _frameCounter; }
Commit: 95bfa811682bb620097e700c043ce5bd6ddfd562
https://github.com/scummvm/scummvm/commit/95bfa811682bb620097e700c043ce5bd6ddfd562
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:47-07:00
Commit Message:
TOON: Reduce header dependencies
Changed paths:
engines/toon/toon.cpp
engines/toon/toon.h
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 93da20f..0e0978b 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -28,6 +28,7 @@
#include "common/savefile.h"
#include "common/memstream.h"
+#include "engines/advancedDetector.h"
#include "engines/util.h"
#include "graphics/palette.h"
#include "graphics/surface.h"
diff --git a/engines/toon/toon.h b/engines/toon/toon.h
index 02828f2..65c6ba0 100644
--- a/engines/toon/toon.h
+++ b/engines/toon/toon.h
@@ -23,7 +23,6 @@
#ifndef TOON_TOON_H
#define TOON_TOON_H
-#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "graphics/surface.h"
#include "common/random.h"
@@ -44,6 +43,8 @@ namespace Common {
class MemoryWriteStreamDynamic;
}
+struct ADGameDescription;
+
#define TOON_DAT_VER_MAJ 0 // 1 byte
#define TOON_DAT_VER_MIN 3 // 1 byte
#define TOON_SAVEGAME_VERSION 4
Commit: 5d584bc7826317acacf1ca53afcc807b9545541e
https://github.com/scummvm/scummvm/commit/5d584bc7826317acacf1ca53afcc807b9545541e
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:47-07:00
Commit Message:
TSAGE: Reduce header dependencies
Changed paths:
engines/tsage/tsage.h
diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h
index 563fdfc..5db45f2 100644
--- a/engines/tsage/tsage.h
+++ b/engines/tsage/tsage.h
@@ -23,7 +23,6 @@
#ifndef TSAGE_H
#define TSAGE_H
-#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "common/rect.h"
#include "audio/mixer.h"
Commit: eea6f69b595be9c95f7af0f79086e0cb05fb8fa4
https://github.com/scummvm/scummvm/commit/eea6f69b595be9c95f7af0f79086e0cb05fb8fa4
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:15:48-07:00
Commit Message:
DETECTOR: Turn some internal func of AdvancedMetaEngine into methods
The eventual goal here is to make it easier (well, *possible*) for
subclasses to modify the detector behavior, e.g. to implement
custom fallback detection.
One immediate goal could be to move the filebased fallback detector
into a subclass.
Changed paths:
engines/advancedDetector.cpp
engines/advancedDetector.h
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 06f6c79..b0a304a 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -33,51 +33,7 @@
#include "engines/advancedDetector.h"
-/**
- * A list of pointers to ADGameDescription structs (or subclasses thereof).
- */
-typedef Common::Array<const ADGameDescription*> ADGameDescList;
-
-
-/**
- * Detect games in specified directory.
- * Parameters language and platform are used to pass on values
- * specified by the user. I.e. this is used to restrict search scope.
- *
- * @param fslist FSList to scan or NULL for scanning all specified
- * default directories.
- * @param params a ADParams struct containing various parameters
- * @param language restrict results to specified language only
- * @param platform restrict results to specified platform only
- * @return list of ADGameDescription (or subclass) pointers corresponding to matched games
- */
-static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams ¶ms, Common::Language language, Common::Platform platform, const Common::String &extra);
-
-
-/**
- * Returns list of targets supported by the engine.
- * Distinguishes engines with single ID
- */
-static GameList gameIDList(const ADParams ¶ms) {
- if (params.singleid != NULL) {
- GameList gl;
-
- const PlainGameDescriptor *g = params.gameDescriptors;
- while (g->gameid) {
- if (0 == scumm_stricmp(params.singleid, g->gameid)) {
- gl.push_back(GameDescriptor(g->gameid, g->description));
-
- return gl;
- }
- g++;
- }
- error("Engine %s doesn't have its singleid specified in ids list", params.singleid);
- }
-
- return GameList(params.gameDescriptors);
-}
-
-static void upgradeTargetIfNecessary(const ADParams ¶ms) {
+void AdvancedMetaEngine::upgradeTargetIfNecessary() const {
if (params.obsoleteList == 0)
return;
@@ -189,7 +145,7 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD
return res;
}
-static void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) {
+void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const {
if (params.singleid != NULL) {
desc["preferredtarget"] = desc["gameid"];
desc["gameid"] = params.singleid;
@@ -234,7 +190,7 @@ bool cleanupPirated(ADGameDescList &matched) {
GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
- ADGameDescList matches = detectGame(fslist, params, Common::UNK_LANG, Common::kPlatformUnknown, "");
+ ADGameDescList matches = detectGame(fslist, Common::UNK_LANG, Common::kPlatformUnknown, "");
GameList detectedGames;
if (cleanupPirated(matches))
@@ -245,14 +201,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
const ADGameDescription *fallbackDesc = fallbackDetect(fslist);
if (fallbackDesc != 0) {
GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors));
- updateGameDescriptor(desc, fallbackDesc, params);
+ updateGameDescriptor(desc, fallbackDesc);
detectedGames.push_back(desc);
}
} else {
// Otherwise use the found matches
for (uint i = 0; i < matches.size(); i++) {
GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors));
- updateGameDescriptor(desc, matches[i], params);
+ updateGameDescriptor(desc, matches[i]);
detectedGames.push_back(desc);
}
}
@@ -262,7 +218,7 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
assert(engine);
- upgradeTargetIfNecessary(params);
+ upgradeTargetIfNecessary();
const ADGameDescription *agdDesc = 0;
Common::Language language = Common::UNK_LANG;
@@ -305,7 +261,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
return Common::kNoGameDataFoundError;
}
- ADGameDescList matches = detectGame(files, params, language, platform, extra);
+ ADGameDescList matches = detectGame(files, language, platform, extra);
if (cleanupPirated(matches))
return Common::kNoGameDataFoundError;
@@ -357,7 +313,6 @@ struct SizeMD5 {
};
typedef Common::HashMap<Common::String, SizeMD5, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SizeMD5Map;
-typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap;
static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSizeMD5) {
// TODO: This message should be cleaned up / made more specific.
@@ -379,26 +334,22 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz
g_system->logMessage(LogMessageType::kInfo, report.c_str());
}
-static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms);
-
-static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth, const char * const *directoryGlobs) {
+void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const {
if (depth <= 0)
return;
if (fslist.empty())
return;
- // First we compose a hashmap of all files in fslist.
- // Includes nifty stuff like removing trailing dots and ignoring case.
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (file->isDirectory()) {
Common::FSList files;
- if (!directoryGlobs)
+ if (!params.directoryGlobs)
continue;
bool matched = false;
- for (const char * const *glob = directoryGlobs; *glob; glob++)
+ for (const char * const *glob = params.directoryGlobs; *glob; glob++)
if (file->getName().matchString(*glob, true)) {
matched = true;
break;
@@ -410,7 +361,7 @@ static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles,
if (!file->getChildren(files, Common::FSNode::kListAll))
continue;
- composeFileHashMap(files, allFiles, depth - 1, directoryGlobs);
+ composeFileHashMap(files, allFiles, depth - 1);
}
Common::String tstr = file->getName();
@@ -423,7 +374,7 @@ static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles,
}
}
-static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams ¶ms, Common::Language language, Common::Platform platform, const Common::String &extra) {
+ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const {
FileMap allFiles;
SizeMD5Map filesSizeMD5;
@@ -437,8 +388,7 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p
debug(3, "Starting detection in dir '%s'", parent.getPath().c_str());
// First we compose a hashmap of all files in fslist.
- // Includes nifty stuff like removing trailing dots and ignoring case.
- composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth), params.directoryGlobs);
+ composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth));
// Check which files are included in some ADGameDescription *and* present
// in fslist. Compute MD5s and file sizes for these files.
@@ -576,19 +526,13 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p
// Filename based fallback
if (params.fileBasedFallback != 0)
- matched = detectGameFilebased(allFiles, params);
+ matched = detectGameFilebased(allFiles);
}
return matched;
}
-/**
- * Check for each ADFileBasedFallback record whether all files listed
- * in it are present. If multiple pass this test, we pick the one with
- * the maximal number of matching files. In case of a tie, the entry
- * coming first in the list is chosen.
- */
-static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms) {
+ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) const {
const ADFileBasedFallback *ptr;
const char* const* filenames;
@@ -642,8 +586,24 @@ static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParam
}
GameList AdvancedMetaEngine::getSupportedGames() const {
- return gameIDList(params);
+ if (params.singleid != NULL) {
+ GameList gl;
+
+ const PlainGameDescriptor *g = params.gameDescriptors;
+ while (g->gameid) {
+ if (0 == scumm_stricmp(params.singleid, g->gameid)) {
+ gl.push_back(GameDescriptor(g->gameid, g->description));
+
+ return gl;
+ }
+ g++;
+ }
+ error("Engine %s doesn't have its singleid specified in ids list", params.singleid);
+ }
+
+ return GameList(params.gameDescriptors);
}
+
GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const {
return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList);
}
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index e3a4087..e5922be 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -71,6 +71,11 @@ struct ADGameDescription {
};
/**
+ * A list of pointers to ADGameDescription structs (or subclasses thereof).
+ */
+typedef Common::Array<const ADGameDescription*> ADGameDescList;
+
+/**
* End marker for a table of ADGameDescription structs. Use this to
* terminate a list to be passed to the AdvancedDetector API.
*/
@@ -214,7 +219,7 @@ namespace AdvancedDetector {
*/
GameDescriptor findGameID(
const char *gameid,
- const PlainGameDescriptor *list,
+ const PlainGameDescriptor *gameDescriptors,
const ADObsoleteGameID *obsoleteList = 0
);
@@ -230,12 +235,20 @@ public:
AdvancedMetaEngine(const ADParams &dp) : params(dp) {}
AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors);
+ /**
+ * Returns list of targets supported by the engine.
+ * Distinguishes engines with single ID
+ */
virtual GameList getSupportedGames() const;
+
virtual GameDescriptor findGame(const char *gameid) const;
+
virtual GameList detectGames(const Common::FSList &fslist) const;
+
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
- // To be provided by subclasses
+protected:
+ // To be implemented by subclasses
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const = 0;
/**
@@ -248,7 +261,38 @@ public:
}
protected:
- void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc);
+ typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap;
+
+ /**
+ * Detect games in specified directory.
+ * Parameters language and platform are used to pass on values
+ * specified by the user. I.e. this is used to restrict search scope.
+ *
+ * @param fslist FSList to scan or NULL for scanning all specified
+ * default directories.
+ * @param language restrict results to specified language only
+ * @param platform restrict results to specified platform only
+ * @return list of ADGameDescription (or subclass) pointers corresponding to matched games
+ */
+ ADGameDescList detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const;
+
+ /**
+ * Check for each ADFileBasedFallback record whether all files listed
+ * in it are present. If multiple pass this test, we pick the one with
+ * the maximal number of matching files. In case of a tie, the entry
+ * coming first in the list is chosen.
+ */
+ ADGameDescList detectGameFilebased(const FileMap &allFiles) const;
+
+ void upgradeTargetIfNecessary() const;
+
+ void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const;
+
+ /**
+ * Compose a hashmap of all files in fslist.
+ * Includes nifty stuff like removing trailing dots and ignoring case.
+ */
+ void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const;
};
#endif
Commit: 7ab553d72a14c04be1aa7e787eeef360be7bb619
https://github.com/scummvm/scummvm/commit/7ab553d72a14c04be1aa7e787eeef360be7bb619
Author: Max Horn (max at quendi.de)
Date: 2011-06-10T13:30:03-07:00
Commit Message:
COMMON: Do not try to read from res forks of non-existant files
Changed paths:
common/macresman.cpp
diff --git a/common/macresman.cpp b/common/macresman.cpp
index 6cbc08d..c1cab8b 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -107,14 +107,17 @@ bool MacResManager::open(String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();;
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
File *file = new File();
@@ -167,14 +170,17 @@ bool MacResManager::open(FSNode path, String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
// First, let's try to see if the Mac converted name exists
More information about the Scummvm-git-logs
mailing list