2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2005-11-12 06:01:24 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2006-02-11 12:46:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2005-11-12 06:01:24 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/stdafx.h"
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2007-01-21 16:57:13 +00:00
|
|
|
#include "common/advancedDetector.h"
|
2007-04-15 05:04:48 +00:00
|
|
|
#include "common/config-manager.h"
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#include "agos/agos.h"
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2007-01-21 16:57:13 +00:00
|
|
|
|
|
|
|
struct AGOSGameDescription {
|
|
|
|
Common::ADGameDescription desc;
|
|
|
|
|
|
|
|
int gameType;
|
|
|
|
int gameId;
|
|
|
|
uint32 features;
|
|
|
|
};
|
|
|
|
|
2006-03-09 14:30:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Conversion table mapping old obsolete target names to the
|
|
|
|
* corresponding new target and platform combination.
|
|
|
|
*
|
|
|
|
*/
|
2006-11-10 22:43:10 +00:00
|
|
|
static const Common::ADObsoleteGameID obsoleteGameIDsTable[] = {
|
2006-03-09 14:30:43 +00:00
|
|
|
{"simon1acorn", "simon1", Common::kPlatformAcorn},
|
|
|
|
{"simon1amiga", "simon1", Common::kPlatformAmiga},
|
|
|
|
{"simon1cd32", "simon1", Common::kPlatformAmiga},
|
2006-05-04 06:55:35 +00:00
|
|
|
{"simon1demo", "simon1", Common::kPlatformPC},
|
2006-03-09 14:30:43 +00:00
|
|
|
{"simon1dos", "simon1", Common::kPlatformPC},
|
|
|
|
{"simon1talkie", "simon1", Common::kPlatformPC},
|
|
|
|
{"simon1win", "simon1", Common::kPlatformWindows},
|
|
|
|
{"simon2dos", "simon2", Common::kPlatformPC},
|
|
|
|
{"simon2talkie", "simon2", Common::kPlatformPC},
|
|
|
|
{"simon2mac", "simon2", Common::kPlatformMacintosh},
|
|
|
|
{"simon2win", "simon2", Common::kPlatformWindows},
|
2006-11-12 03:23:29 +00:00
|
|
|
{0, 0, Common::kPlatformUnknown}
|
2006-03-09 14:30:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const PlainGameDescriptor simonGames[] = {
|
2006-10-06 05:17:54 +00:00
|
|
|
{"elvira1", "Elvira - Mistress of the Dark"},
|
2006-10-06 09:21:34 +00:00
|
|
|
{"elvira2", "Elvira II - The Jaws of Cerberus"},
|
2006-09-29 03:44:55 +00:00
|
|
|
{"waxworks", "Waxworks"},
|
|
|
|
{"simon1", "Simon the Sorcerer 1"},
|
|
|
|
{"simon2", "Simon the Sorcerer 2"},
|
|
|
|
{"feeble", "The Feeble Files"},
|
2006-09-29 05:33:22 +00:00
|
|
|
{"dimp", "Demon in my Pocket"},
|
2006-09-28 23:22:07 +00:00
|
|
|
{"jumble", "Jumble"},
|
2006-09-29 04:48:04 +00:00
|
|
|
{"puzzle", "NoPatience"},
|
2006-09-28 23:22:07 +00:00
|
|
|
{"swampy", "Swampy Adventures"},
|
2006-11-12 03:23:29 +00:00
|
|
|
{0, 0}
|
2006-03-09 14:30:43 +00:00
|
|
|
};
|
|
|
|
|
2007-04-27 22:42:02 +00:00
|
|
|
#include "agos/detection_tables.h"
|
2007-01-24 22:24:52 +00:00
|
|
|
|
|
|
|
static const Common::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 targets
|
|
|
|
simonGames,
|
|
|
|
// Structure for autoupgrading obsolete targets
|
2007-01-28 07:31:26 +00:00
|
|
|
obsoleteGameIDsTable,
|
|
|
|
// Name of single gameid (optional)
|
|
|
|
0,
|
2007-02-04 03:10:27 +00:00
|
|
|
// List of files for file-based fallback detection (optional)
|
|
|
|
0,
|
2007-02-13 23:37:44 +00:00
|
|
|
// Fallback callback
|
|
|
|
0,
|
2007-01-28 07:31:26 +00:00
|
|
|
// Flags
|
2007-02-13 13:17:46 +00:00
|
|
|
Common::kADFlagAugmentPreferredTarget
|
2007-01-24 22:24:52 +00:00
|
|
|
};
|
|
|
|
|
2007-04-15 05:04:48 +00:00
|
|
|
GameList Engine_AGOS_gameIDList() {
|
|
|
|
return GameList(simonGames);
|
|
|
|
}
|
|
|
|
|
|
|
|
GameDescriptor Engine_AGOS_findGameID(const char *gameid) {
|
|
|
|
return Common::AdvancedDetector::findGameID(gameid, detectionParams);
|
|
|
|
}
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2007-04-15 05:04:48 +00:00
|
|
|
GameList Engine_AGOS_detectGames(const FSList &fslist) {
|
|
|
|
return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginError Engine_AGOS_create(OSystem *syst, Engine **engine) {
|
|
|
|
assert(engine);
|
|
|
|
const char *gameid = ConfMan.get("gameid").c_str();
|
|
|
|
|
|
|
|
//const AGOSGameDescription gd = (const AGOSGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
|
|
//if (gd == 0) {
|
|
|
|
// return kNoGameDataFoundError;
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (!scumm_stricmp("elvira1", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Elvira1(syst);
|
|
|
|
} else if (!scumm_stricmp("elvira2", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Elvira2(syst);
|
|
|
|
} else if (!scumm_stricmp("waxworks", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Waxworks(syst);
|
|
|
|
} else if (!scumm_stricmp("simon1", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Simon1(syst);
|
|
|
|
} else if (!scumm_stricmp("simon2", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Simon2(syst);
|
|
|
|
} else if (!scumm_stricmp("feeble", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_Feeble(syst);
|
2007-05-07 08:29:29 +00:00
|
|
|
} else if (!scumm_stricmp("dimp", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
|
2007-04-15 05:04:48 +00:00
|
|
|
} else if (!scumm_stricmp("jumble", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
|
|
|
|
} else if (!scumm_stricmp("puzzle", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
|
|
|
|
} else if (!scumm_stricmp("swampy", gameid)) {
|
|
|
|
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
|
|
|
|
} else {
|
|
|
|
error("AGOS engine created with invalid gameid");
|
|
|
|
}
|
|
|
|
|
|
|
|
return kNoError;
|
|
|
|
}
|
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
|
2006-03-09 14:30:43 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2005-11-12 06:01:24 +00:00
|
|
|
|
2006-11-12 03:23:29 +00:00
|
|
|
bool AGOSEngine::initGame() {
|
2007-02-13 23:37:44 +00:00
|
|
|
_gameDescription = (const AGOSGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
|
|
return (_gameDescription != 0);
|
2006-11-12 03:23:29 +00:00
|
|
|
}
|
2005-11-12 06:01:24 +00:00
|
|
|
|
|
|
|
|
2007-01-21 16:57:13 +00:00
|
|
|
int AGOSEngine::getGameId() const {
|
|
|
|
return _gameDescription->gameId;
|
|
|
|
}
|
|
|
|
|
|
|
|
int AGOSEngine::getGameType() const {
|
|
|
|
return _gameDescription->gameType;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 AGOSEngine::getFeatures() const {
|
|
|
|
return _gameDescription->features;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *AGOSEngine::getExtra() const {
|
|
|
|
return _gameDescription->desc.extra;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Language AGOSEngine::getLanguage() const {
|
|
|
|
return _gameDescription->desc.language;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Platform AGOSEngine::getPlatform() const {
|
|
|
|
return _gameDescription->desc.platform;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *AGOSEngine::getFileName(int type) const {
|
|
|
|
for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileType; i++) {
|
|
|
|
if (_gameDescription->desc.filesDescriptions[i].fileType == type)
|
|
|
|
return _gameDescription->desc.filesDescriptions[i].fileName;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|