mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-06 10:58:01 +00:00
Fix various incorrect usages of the word 'target' instead of 'gameid'; change the ambigiuous 'GameSettings::name' to 'GameSettings::gameid'
svn-id: r20115
This commit is contained in:
parent
e34d963027
commit
0b39c0ea9f
@ -212,7 +212,7 @@ GameDetector::GameDetector() {
|
|||||||
_plugin = 0;
|
_plugin = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** List all supported games, i.e. all games which any loaded plugin supports. */
|
/** List all supported game IDs, i.e. all games which any loaded plugin supports. */
|
||||||
void listGames() {
|
void listGames() {
|
||||||
const PluginList &plugins = PluginManager::instance().getPlugins();
|
const PluginList &plugins = PluginManager::instance().getPlugins();
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ void listGames() {
|
|||||||
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
||||||
GameList list = (*iter)->getSupportedGames();
|
GameList list = (*iter)->getSupportedGames();
|
||||||
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
|
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
|
||||||
printf("%-20s %s\n", v->name, v->description);
|
printf("%-20s %s\n", v->gameid, v->description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,7 +242,11 @@ void listTargets() {
|
|||||||
String description(iter->_value.get("description"));
|
String description(iter->_value.get("description"));
|
||||||
|
|
||||||
if (description.isEmpty()) {
|
if (description.isEmpty()) {
|
||||||
GameSettings g = GameDetector::findGame(name);
|
// FIXME: At this point, we should check for a "gameid" override
|
||||||
|
// to find the proper desc. In fact, the platform probably should
|
||||||
|
// be take into consideration, too.
|
||||||
|
String gameid(name);
|
||||||
|
GameSettings g = GameDetector::findGame(gameid);
|
||||||
if (g.description)
|
if (g.description)
|
||||||
description = g.description;
|
description = g.description;
|
||||||
}
|
}
|
||||||
@ -259,7 +263,7 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi
|
|||||||
PluginList::const_iterator iter = plugins.begin();
|
PluginList::const_iterator iter = plugins.begin();
|
||||||
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
||||||
result = (*iter)->findGame(gameName.c_str());
|
result = (*iter)->findGame(gameName.c_str());
|
||||||
if (result.name) {
|
if (result.gameid) {
|
||||||
if (plugin)
|
if (plugin)
|
||||||
*plugin = *iter;
|
*plugin = *iter;
|
||||||
break;
|
break;
|
||||||
@ -364,7 +368,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
|
|||||||
// To verify this, check if there is either a game domain (i.e.
|
// To verify this, check if there is either a game domain (i.e.
|
||||||
// a configured target) matching this argument, or if we can
|
// a configured target) matching this argument, or if we can
|
||||||
// find any target with that name.
|
// find any target with that name.
|
||||||
if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findGame(s).name)) {
|
if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findGame(s).gameid)) {
|
||||||
setTarget(s);
|
setTarget(s);
|
||||||
} else {
|
} else {
|
||||||
if (current_option == NULL)
|
if (current_option == NULL)
|
||||||
@ -596,9 +600,9 @@ ShowHelpAndExit:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameDetector::setTarget(const String &name) {
|
void GameDetector::setTarget(const String &target) {
|
||||||
_targetName = name;
|
_targetName = target;
|
||||||
ConfMan.setActiveDomain(name);
|
ConfMan.setActiveDomain(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameDetector::detectGame() {
|
bool GameDetector::detectGame() {
|
||||||
@ -612,7 +616,7 @@ bool GameDetector::detectGame() {
|
|||||||
printf("Looking for %s\n", realGame.c_str());
|
printf("Looking for %s\n", realGame.c_str());
|
||||||
_game = findGame(realGame, &_plugin);
|
_game = findGame(realGame, &_plugin);
|
||||||
|
|
||||||
if (_game.name) {
|
if (_game.gameid) {
|
||||||
printf("Trying to start game '%s'\n", _game.description);
|
printf("Trying to start game '%s'\n", _game.description);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,7 +41,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct GameSettings {
|
struct GameSettings {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst);
|
typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst);
|
||||||
|
|
||||||
typedef const char *(*NameFunc)();
|
typedef const char *(*NameFunc)();
|
||||||
typedef GameList (*TargetListFunc)();
|
typedef GameList (*GameIDListFunc)();
|
||||||
typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
|
typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ GameSettings Plugin::findGame(const char *gameName) const {
|
|||||||
GameList games = getSupportedGames();
|
GameList games = getSupportedGames();
|
||||||
GameSettings result = {NULL, NULL, 0};
|
GameSettings result = {NULL, NULL, 0};
|
||||||
for (GameList::iterator g = games.begin(); g != games.end(); ++g) {
|
for (GameList::iterator g = games.begin(); g != games.end(); ++g) {
|
||||||
if (!scumm_stricmp(g->name, gameName)) {
|
if (!scumm_stricmp(g->gameid, gameName)) {
|
||||||
result = *g;
|
result = *g;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -194,8 +194,8 @@ bool DynamicPlugin::loadPlugin() {
|
|||||||
}
|
}
|
||||||
_name = nameFunc();
|
_name = nameFunc();
|
||||||
|
|
||||||
// Query the plugin for the targets it supports
|
// Query the plugin for the game ids it supports
|
||||||
TargetListFunc gameListFunc = (TargetListFunc)findSymbol("PLUGIN_getSupportedGames");
|
GameIDListFunc gameListFunc = (GameIDListFunc)findSymbol("PLUGIN_getSupportedGames");
|
||||||
if (!gameListFunc) {
|
if (!gameListFunc) {
|
||||||
unloadPlugin();
|
unloadPlugin();
|
||||||
return false;
|
return false;
|
||||||
|
12
gob/gob.cpp
12
gob/gob.cpp
@ -107,11 +107,11 @@ static const Gob::GobGameSettings gob_games[] = {
|
|||||||
|
|
||||||
// Keep list of different supported games
|
// Keep list of different supported games
|
||||||
static const struct GobGameList {
|
static const struct GobGameList {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
} gob_list[] = {
|
} gob_list[] = {
|
||||||
@ -125,7 +125,7 @@ GameList Engine_GOB_gameList() {
|
|||||||
GameList games;
|
GameList games;
|
||||||
const GobGameList *g = gob_list;
|
const GobGameList *g = gob_list;
|
||||||
|
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(g->toGameSettings());
|
games.push_back(g->toGameSettings());
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ DetectedGameList Engine_GOB_detectGames(const FSList &fslist) {
|
|||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
|
sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
|
||||||
}
|
}
|
||||||
for (g = gob_games; g->name; g++) {
|
for (g = gob_games; g->gameid; g++) {
|
||||||
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
||||||
detectedGames.push_back(g->toGameSettings());
|
detectedGames.push_back(g->toGameSettings());
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ DetectedGameList Engine_GOB_detectGames(const FSList &fslist) {
|
|||||||
printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
|
printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
|
||||||
|
|
||||||
const GobGameList *g1 = gob_list;
|
const GobGameList *g1 = gob_list;
|
||||||
while (g1->name) {
|
while (g1->gameid) {
|
||||||
detectedGames.push_back(g1->toGameSettings());
|
detectedGames.push_back(g1->toGameSettings());
|
||||||
g1++;
|
g1++;
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ Engine *Engine_GOB_create(GameDetector * detector, OSystem *syst) {
|
|||||||
else
|
else
|
||||||
features = Gob::GF_GOB1;
|
features = Gob::GF_GOB1;
|
||||||
|
|
||||||
for (g = gob_games; g->name; g++) {
|
for (g = gob_games; g->gameid; g++) {
|
||||||
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
||||||
features = g->features;
|
features = g->features;
|
||||||
|
|
||||||
|
@ -74,12 +74,12 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct GobGameSettings {
|
typedef struct GobGameSettings {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
const char *md5sum;
|
const char *md5sum;
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
} GobGameSettings;
|
} GobGameSettings;
|
||||||
|
@ -594,18 +594,18 @@ void LauncherDialog::updateListing() {
|
|||||||
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
|
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
|
||||||
ConfigManager::DomainMap::const_iterator iter = domains.begin();
|
ConfigManager::DomainMap::const_iterator iter = domains.begin();
|
||||||
for (iter = domains.begin(); iter != domains.end(); ++iter) {
|
for (iter = domains.begin(); iter != domains.end(); ++iter) {
|
||||||
String name(iter->_value.get("gameid"));
|
String gameid(iter->_value.get("gameid"));
|
||||||
String description(iter->_value.get("description"));
|
String description(iter->_value.get("description"));
|
||||||
|
|
||||||
if (name.isEmpty())
|
if (gameid.isEmpty())
|
||||||
name = iter->_key;
|
gameid = iter->_key;
|
||||||
if (description.isEmpty()) {
|
if (description.isEmpty()) {
|
||||||
GameSettings g = GameDetector::findGame(name);
|
GameSettings g = GameDetector::findGame(gameid);
|
||||||
if (g.description)
|
if (g.description)
|
||||||
description = g.description;
|
description = g.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!name.isEmpty() && !description.isEmpty()) {
|
if (!gameid.isEmpty() && !description.isEmpty()) {
|
||||||
// Insert the game into the launcher list
|
// Insert the game into the launcher list
|
||||||
int pos = 0, size = l.size();
|
int pos = 0, size = l.size();
|
||||||
|
|
||||||
@ -669,7 +669,7 @@ void LauncherDialog::addGame() {
|
|||||||
// The auto detector or the user made a choice.
|
// The auto detector or the user made a choice.
|
||||||
// Pick a domain name which does not yet exist (after all, we
|
// Pick a domain name which does not yet exist (after all, we
|
||||||
// are *adding* a game to the config, not replacing).
|
// are *adding* a game to the config, not replacing).
|
||||||
String domain(result.name);
|
String domain(result.gameid);
|
||||||
if (ConfMan.hasGameDomain(domain)) {
|
if (ConfMan.hasGameDomain(domain)) {
|
||||||
char suffix = 'a';
|
char suffix = 'a';
|
||||||
domain += suffix;
|
domain += suffix;
|
||||||
@ -679,7 +679,7 @@ void LauncherDialog::addGame() {
|
|||||||
suffix++;
|
suffix++;
|
||||||
domain += suffix;
|
domain += suffix;
|
||||||
}
|
}
|
||||||
ConfMan.set("gameid", result.name, domain);
|
ConfMan.set("gameid", result.gameid, domain);
|
||||||
ConfMan.set("description", result.description, domain);
|
ConfMan.set("description", result.description, domain);
|
||||||
}
|
}
|
||||||
ConfMan.set("path", dir.path(), domain);
|
ConfMan.set("path", dir.path(), domain);
|
||||||
|
@ -58,14 +58,14 @@ enum {
|
|||||||
|
|
||||||
// Kyra MD5 detection brutally ripped from the Gobliins engine.
|
// Kyra MD5 detection brutally ripped from the Gobliins engine.
|
||||||
struct KyraGameSettings {
|
struct KyraGameSettings {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
byte id;
|
byte id;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
const char *md5sum;
|
const char *md5sum;
|
||||||
const char *checkFile;
|
const char *checkFile;
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -96,11 +96,11 @@ static const KyraGameSettings kyra_games[] = {
|
|||||||
|
|
||||||
// Keep list of different supported games
|
// Keep list of different supported games
|
||||||
struct KyraGameList {
|
struct KyraGameList {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -114,7 +114,7 @@ GameList Engine_KYRA_gameList() {
|
|||||||
GameList games;
|
GameList games;
|
||||||
const KyraGameList *g = kyra_list;
|
const KyraGameList *g = kyra_list;
|
||||||
|
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(g->toGameSettings());
|
games.push_back(g->toGameSettings());
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
|
|||||||
if (file->isDirectory())
|
if (file->isDirectory())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (g = kyra_games; g->name; g++) {
|
for (g = kyra_games; g->gameid; g++) {
|
||||||
if (scumm_stricmp(file->displayName().c_str(), g->checkFile) == 0)
|
if (scumm_stricmp(file->displayName().c_str(), g->checkFile) == 0)
|
||||||
isFound = true;
|
isFound = true;
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
|
|||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
|
sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
|
||||||
}
|
}
|
||||||
for (g = kyra_games; g->name; g++) {
|
for (g = kyra_games; g->gameid; g++) {
|
||||||
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
if (strcmp(g->md5sum, (char *)md5str) == 0) {
|
||||||
detectedGames.push_back(g->toGameSettings());
|
detectedGames.push_back(g->toGameSettings());
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
|
|||||||
debug("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
|
debug("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
|
||||||
|
|
||||||
const KyraGameList *g1 = kyra_list;
|
const KyraGameList *g1 = kyra_list;
|
||||||
while (g1->name) {
|
while (g1->gameid) {
|
||||||
detectedGames.push_back(g1->toGameSettings());
|
detectedGames.push_back(g1->toGameSettings());
|
||||||
g1++;
|
g1++;
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *system)
|
|||||||
// data contents
|
// data contents
|
||||||
_features = 0;
|
_features = 0;
|
||||||
|
|
||||||
for (g = kyra_games; g->name; g++) {
|
for (g = kyra_games; g->gameid; g++) {
|
||||||
if (!Common::File::exists(g->checkFile))
|
if (!Common::File::exists(g->checkFile))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ GameList Engine_QUEEN_gameList() {
|
|||||||
GameList games;
|
GameList games;
|
||||||
const GameSettings *g = queen_setting;
|
const GameSettings *g = queen_setting;
|
||||||
|
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(*g);
|
games.push_back(*g);
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ GameList Engine_SAGA_gameList() {
|
|||||||
GameList games;
|
GameList games;
|
||||||
const GameSettings *g = saga_games;
|
const GameSettings *g = saga_games;
|
||||||
|
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(*g);
|
games.push_back(*g);
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ ScummDebugger::ScummDebugger(ScummEngine *s)
|
|||||||
DVar_Register("scumm_vars", &_vm->_scummVars, DVAR_INTARRAY, _vm->_numVariables);
|
DVar_Register("scumm_vars", &_vm->_scummVars, DVAR_INTARRAY, _vm->_numVariables);
|
||||||
|
|
||||||
DVar_Register("scumm_gamename", &_vm->_targetName, DVAR_STRING, 0);
|
DVar_Register("scumm_gamename", &_vm->_targetName, DVAR_STRING, 0);
|
||||||
DVar_Register("scumm_exename", &_vm->_gameName, DVAR_STRING, 0);
|
DVar_Register("scumm_exename", &_vm->_baseName, DVAR_STRING, 0);
|
||||||
DVar_Register("scumm_gameid", &_vm->_gameId, DVAR_BYTE, 0);
|
DVar_Register("scumm_gameid", &_vm->_gameId, DVAR_BYTE, 0);
|
||||||
|
|
||||||
// Register commands
|
// Register commands
|
||||||
|
@ -118,28 +118,28 @@ void ScummEngine::openRoom(const int room) {
|
|||||||
|
|
||||||
switch(disk) {
|
switch(disk) {
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(buf, "%s.%s", _gameName.c_str(), "(b)");
|
sprintf(buf, "%s.%s", _baseName.c_str(), "(b)");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
sprintf(buf, "%s.%s", _gameName.c_str(), "(a)");
|
sprintf(buf, "%s.%s", _baseName.c_str(), "(a)");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf(buf, "%s.%s", _gameName.c_str(), "he0");
|
sprintf(buf, "%s.%s", _baseName.c_str(), "he0");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
sprintf(buf, "%s.he%.1d", _gameName.c_str(), room == 0 ? 0 : 1);
|
sprintf(buf, "%s.he%.1d", _baseName.c_str(), room == 0 ? 0 : 1);
|
||||||
} else if (_version >= 7) {
|
} else if (_version >= 7) {
|
||||||
if (room > 0 && (_version == 8))
|
if (room > 0 && (_version == 8))
|
||||||
VAR(VAR_CURRENTDISK) = diskNumber;
|
VAR(VAR_CURRENTDISK) = diskNumber;
|
||||||
sprintf(buf, "%s.la%d", _gameName.c_str(), diskNumber);
|
sprintf(buf, "%s.la%d", _baseName.c_str(), diskNumber);
|
||||||
|
|
||||||
sprintf(buf2, "%s.%.3d", _gameName.c_str(), diskNumber);
|
sprintf(buf2, "%s.%.3d", _baseName.c_str(), diskNumber);
|
||||||
} else if (_heversion >= 60) {
|
} else if (_heversion >= 60) {
|
||||||
sprintf(buf, "%s.he%.1d", _gameName.c_str(), diskNumber);
|
sprintf(buf, "%s.he%.1d", _baseName.c_str(), diskNumber);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s.%.3d", _gameName.c_str(), diskNumber);
|
sprintf(buf, "%s.%.3d", _baseName.c_str(), diskNumber);
|
||||||
if (_gameId == GID_SAMNMAX)
|
if (_gameId == GID_SAMNMAX)
|
||||||
sprintf(buf2, "%s.sm%.1d", _gameName.c_str(), diskNumber);
|
sprintf(buf2, "%s.sm%.1d", _baseName.c_str(), diskNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
encByte = (_features & GF_USE_KEY) ? 0x69 : 0;
|
encByte = (_features & GF_USE_KEY) ? 0x69 : 0;
|
||||||
|
@ -158,7 +158,7 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte
|
|||||||
fi.file = new Common::File;
|
fi.file = new Common::File;
|
||||||
|
|
||||||
if (!_fileName[0]) { // We are running for the first time
|
if (!_fileName[0]) { // We are running for the first time
|
||||||
snprintf(_fileName, 256, "%s.he3", _vm->getGameName());
|
snprintf(_fileName, 256, "%s.he3", _vm->getBaseName());
|
||||||
|
|
||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
char buf1[128];
|
char buf1[128];
|
||||||
@ -1292,7 +1292,7 @@ int MacResExtractor::extractResource(int id, byte **buf) {
|
|||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
char buf1[128];
|
char buf1[128];
|
||||||
|
|
||||||
snprintf(buf1, 128, "%s.he3", _vm->getGameName());
|
snprintf(buf1, 128, "%s.he3", _vm->getBaseName());
|
||||||
_vm->generateSubstResFileName(buf1, _fileName, sizeof(buf1));
|
_vm->generateSubstResFileName(buf1, _fileName, sizeof(buf1));
|
||||||
|
|
||||||
// Some programs write it as .bin. Try that too
|
// Some programs write it as .bin. Try that too
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
This file was generated by the md5table tool on Thu Jan 19 22:55:50 2006
|
This file was generated by the md5table tool on Sat Jan 21 12:36:17 2006
|
||||||
DO NOT EDIT MANUALLY!
|
DO NOT EDIT MANUALLY!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct MD5Table {
|
struct MD5Table {
|
||||||
const char *md5;
|
const char *md5;
|
||||||
const char *target;
|
const char *gameid;
|
||||||
Common::Language language;
|
Common::Language language;
|
||||||
Common::Platform platform;
|
Common::Platform platform;
|
||||||
};
|
};
|
||||||
|
@ -89,7 +89,7 @@ namespace Scumm {
|
|||||||
ScummEngine *g_scumm = 0;
|
ScummEngine *g_scumm = 0;
|
||||||
|
|
||||||
struct ScummGameSettings {
|
struct ScummGameSettings {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
byte id, version, heversion;
|
byte id, version, heversion;
|
||||||
int midi; // MidiDriverFlags values
|
int midi; // MidiDriverFlags values
|
||||||
@ -97,7 +97,7 @@ struct ScummGameSettings {
|
|||||||
Common::Platform platform;
|
Common::Platform platform;
|
||||||
|
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -109,13 +109,13 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct ObsoleteTargets {
|
struct ObsoleteGameIDs {
|
||||||
const char *from;
|
const char *from;
|
||||||
const char *to;
|
const char *to;
|
||||||
Common::Platform platform;
|
Common::Platform platform;
|
||||||
|
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { from, "Obsolete Target", 0 };
|
GameSettings dummy = { from, "Obsolete game ID", 0 };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -123,12 +123,12 @@ struct ObsoleteTargets {
|
|||||||
static const Common::Platform UNK = Common::kPlatformUnknown;
|
static const Common::Platform UNK = Common::kPlatformUnknown;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion table mapping old obsolete target names to the
|
* Conversion table mapping old obsolete game IDs to the
|
||||||
* corresponding new target and platform combination.
|
* corresponding new game ID and platform combination.
|
||||||
*
|
*
|
||||||
* We use an ugly macro 'UNK' here to make the following table more readable.
|
* We use an ugly macro 'UNK' here to make the following table more readable.
|
||||||
*/
|
*/
|
||||||
static ObsoleteTargets obsoleteTargetsTable[] = {
|
static ObsoleteGameIDs obsoleteGameIDsTable[] = {
|
||||||
{"comidemo", "comi", UNK},
|
{"comidemo", "comi", UNK},
|
||||||
{"digdemo", "dig", UNK},
|
{"digdemo", "dig", UNK},
|
||||||
{"digdemoMac", "dig", Common::kPlatformMacintosh},
|
{"digdemoMac", "dig", Common::kPlatformMacintosh},
|
||||||
@ -1389,7 +1389,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
|
|||||||
// Allow the user to override the game name with a custom string.
|
// Allow the user to override the game name with a custom string.
|
||||||
// This allows some game versions to work which use filenames
|
// This allows some game versions to work which use filenames
|
||||||
// differing from the regular version(s) of that game.
|
// differing from the regular version(s) of that game.
|
||||||
_gameName = ConfMan.hasKey("basename") ? ConfMan.get("basename") : gs.name;
|
_baseName = ConfMan.hasKey("basename") ? ConfMan.get("basename") : gs.gameid;
|
||||||
|
|
||||||
_copyProtection = ConfMan.getBool("copy_protection");
|
_copyProtection = ConfMan.getBool("copy_protection");
|
||||||
_demoMode = ConfMan.getBool("demo_mode");
|
_demoMode = ConfMan.getBool("demo_mode");
|
||||||
@ -2132,9 +2132,9 @@ void ScummEngine_v99he::scummInit() {
|
|||||||
memset(_hePalettes, 0, (_numPalettes + 1) * 1024);
|
memset(_hePalettes, 0, (_numPalettes + 1) * 1024);
|
||||||
|
|
||||||
// Array 129 is set to base name
|
// Array 129 is set to base name
|
||||||
int len = resStrLen((const byte *)_gameName.c_str()) + 1;
|
int len = resStrLen((const byte *)_baseName.c_str()) + 1;
|
||||||
ArrayHeader *ah = defineArray(129, kStringArray, 0, 0, 0, len);
|
ArrayHeader *ah = defineArray(129, kStringArray, 0, 0, 0, len);
|
||||||
memcpy(ah->data, _gameName.c_str(), len);
|
memcpy(ah->data, _baseName.c_str(), len);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2838,9 +2838,9 @@ using namespace Scumm;
|
|||||||
|
|
||||||
GameList Engine_SCUMM_gameList() {
|
GameList Engine_SCUMM_gameList() {
|
||||||
const ScummGameSettings *g = scumm_settings;
|
const ScummGameSettings *g = scumm_settings;
|
||||||
const ObsoleteTargets *o = obsoleteTargetsTable;
|
const ObsoleteGameIDs *o = obsoleteGameIDsTable;
|
||||||
GameList games;
|
GameList games;
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(g->toGameSettings());
|
games.push_back(g->toGameSettings());
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
@ -2862,11 +2862,11 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
|
|||||||
typedef Common::Map<Common::String, bool> StringSet;
|
typedef Common::Map<Common::String, bool> StringSet;
|
||||||
StringSet fileSet;
|
StringSet fileSet;
|
||||||
|
|
||||||
for (g = scumm_settings; g->name; ++g) {
|
for (g = scumm_settings; g->gameid; ++g) {
|
||||||
// Determine the 'detectname' for this game, that is, the name of a
|
// Determine the 'detectname' for this game, that is, the name of a
|
||||||
// file that *must* be presented if the directory contains the data
|
// file that *must* be presented if the directory contains the data
|
||||||
// for this game. For example, FOA requires atlantis.000
|
// for this game. For example, FOA requires atlantis.000
|
||||||
const char *base = g->name;
|
const char *base = g->gameid;
|
||||||
detectName[0] = '\0';
|
detectName[0] = '\0';
|
||||||
|
|
||||||
// TODO: we need to add cache here
|
// TODO: we need to add cache here
|
||||||
@ -3099,14 +3099,14 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) {
|
|||||||
if (!exactMatch)
|
if (!exactMatch)
|
||||||
detectedGames.clear(); // Clear all the non-exact candidates
|
detectedGames.clear(); // Clear all the non-exact candidates
|
||||||
|
|
||||||
const char *target = elem->target;
|
const char *gameid = elem->gameid;
|
||||||
|
|
||||||
// Find the GameSettings for that target
|
// Find the GameSettings for that gameid
|
||||||
for (g = scumm_settings; g->name; ++g) {
|
for (g = scumm_settings; g->gameid; ++g) {
|
||||||
if (0 == scumm_stricmp(g->name, target))
|
if (0 == scumm_stricmp(g->gameid, gameid))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(g->name);
|
assert(g->gameid);
|
||||||
// Insert the 'enhanced' game data into the candidate list
|
// Insert the 'enhanced' game data into the candidate list
|
||||||
if (iter->_value == true) // This was HE Mac game
|
if (iter->_value == true) // This was HE Mac game
|
||||||
detectedGames.push_back(DetectedGame(g->toGameSettings(), elem->language, Common::kPlatformMacintosh));
|
detectedGames.push_back(DetectedGame(g->toGameSettings(), elem->language, Common::kPlatformMacintosh));
|
||||||
@ -3173,39 +3173,49 @@ static int generateSubstResFileName_(const char *filename, char *buf, int bufsiz
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a ScummEngine instance, based on the given detector data.
|
||||||
|
*
|
||||||
|
* This is heavily based on our MD5 detection scheme.
|
||||||
|
*/
|
||||||
Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
||||||
Engine *engine;
|
Engine *engine;
|
||||||
|
|
||||||
const ObsoleteTargets *o = obsoleteTargetsTable;
|
// We start by checking whether the specified game ID is obsolete.
|
||||||
|
// If that is the case, we automaticlaly upgrade the target to use
|
||||||
|
// the correct new game ID (and platform, if specified).
|
||||||
|
const ObsoleteGameIDs *o = obsoleteGameIDsTable;
|
||||||
while (o->from) {
|
while (o->from) {
|
||||||
if (!scumm_stricmp(detector->_game.name, o->from)) {
|
if (!scumm_stricmp(detector->_game.gameid, o->from)) {
|
||||||
detector->_game.name = o->to;
|
// Match found, perform upgrade
|
||||||
|
detector->_game.gameid = o->to;
|
||||||
ConfMan.set("gameid", o->to);
|
ConfMan.set("gameid", o->to);
|
||||||
|
|
||||||
if (o->platform != Common::kPlatformUnknown)
|
if (o->platform != Common::kPlatformUnknown)
|
||||||
ConfMan.set("platform", Common::getPlatformCode(o->platform));
|
ConfMan.set("platform", Common::getPlatformCode(o->platform));
|
||||||
|
|
||||||
warning("Target upgraded from %s to %s", o->from, o->to);
|
warning("Target upgraded from game ID %s to %s", o->from, o->to);
|
||||||
ConfMan.flushToDisk();
|
ConfMan.flushToDisk();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
o++;
|
o++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lookup the game ID in our database. If this lookup fails, then
|
||||||
|
// the game ID is unknown, and we have to abort.
|
||||||
const ScummGameSettings *g = scumm_settings;
|
const ScummGameSettings *g = scumm_settings;
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
if (!scumm_stricmp(detector->_game.name, g->name))
|
if (!scumm_stricmp(detector->_game.gameid, g->gameid))
|
||||||
break;
|
break;
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
if (!g->name) {
|
if (!g->gameid) {
|
||||||
error("Invalid game '%s'\n", detector->_game.name);
|
error("Invalid game ID '%s'\n", detector->_game.gameid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate MD5 of the games detection file, for savegames etc.
|
// Calculate MD5 of the games detection file, for savegames etc.
|
||||||
const char *name = g->name;
|
const char *gameid = g->gameid;
|
||||||
char detectName[256], tempName[256], gameMD5[32+1];
|
char detectName[256], tempName[256], gameMD5[32+1];
|
||||||
uint8 md5sum[16];
|
uint8 md5sum[16];
|
||||||
int substLastIndex = 0;
|
int substLastIndex = 0;
|
||||||
@ -3222,19 +3232,19 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
|||||||
strcpy(detectName, "000.LFL");
|
strcpy(detectName, "000.LFL");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
strcpy(detectName, name);
|
strcpy(detectName, gameid);
|
||||||
strcat(detectName, ".la0");
|
strcat(detectName, ".la0");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
strcpy(detectName, name);
|
strcpy(detectName, gameid);
|
||||||
strcat(detectName, ".he0");
|
strcat(detectName, ".he0");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
strcpy(detectName, name);
|
strcpy(detectName, gameid);
|
||||||
strcat(detectName, ".000");
|
strcat(detectName, ".000");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
strcpy(detectName, name);
|
strcpy(detectName, gameid);
|
||||||
strcat(detectName, ".sm0");
|
strcat(detectName, ".sm0");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
@ -3288,11 +3298,11 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
|||||||
// Now search our 'database' for the MD5; if a match is found, we use
|
// Now search our 'database' for the MD5; if a match is found, we use
|
||||||
// the information in the 'database' to correct the GameSettings.
|
// the information in the 'database' to correct the GameSettings.
|
||||||
g = multiple_versions_md5_settings;
|
g = multiple_versions_md5_settings;
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
if (!scumm_stricmp(md5, g->name)) {
|
if (!scumm_stricmp(md5, g->gameid)) {
|
||||||
// Match found
|
// Match found
|
||||||
game = *g;
|
game = *g;
|
||||||
game.name = name;
|
game.gameid = gameid; // FIXME: Fingolfin wonders what this line is good for?
|
||||||
if (game.description)
|
if (game.description)
|
||||||
g_system->setWindowCaption(game.description);
|
g_system->setWindowCaption(game.description);
|
||||||
break;
|
break;
|
||||||
|
@ -434,7 +434,7 @@ public:
|
|||||||
|
|
||||||
// Misc utility functions
|
// Misc utility functions
|
||||||
uint32 _debugFlags;
|
uint32 _debugFlags;
|
||||||
const char *getGameName() const { return _gameName.c_str(); }
|
const char *getBaseName() const { return _baseName.c_str(); }
|
||||||
|
|
||||||
// Cursor/palette
|
// Cursor/palette
|
||||||
void updateCursor();
|
void updateCursor();
|
||||||
@ -696,7 +696,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _resourceHeaderSize;
|
int _resourceHeaderSize;
|
||||||
Common::String _gameName; // This is the name we use for opening resource files
|
Common::String _baseName; // This is the name we use for opening resource files
|
||||||
Common::String _targetName; // This is the game the user calls it, so use for saving
|
Common::String _targetName; // This is the game the user calls it, so use for saving
|
||||||
byte _resourceMapper[128];
|
byte _resourceMapper[128];
|
||||||
byte *_heV7DiskOffsets;
|
byte *_heV7DiskOffsets;
|
||||||
|
@ -1170,7 +1170,7 @@ void SmushPlayer::updateScreen() {
|
|||||||
#ifdef DUMP_SMUSH_FRAMES
|
#ifdef DUMP_SMUSH_FRAMES
|
||||||
char fileName[100];
|
char fileName[100];
|
||||||
// change path below for dump png files
|
// change path below for dump png files
|
||||||
sprintf(fileName, "/path/to/somethere/%s%04d.png", _vm->getGameName(), _frame);
|
sprintf(fileName, "/path/to/somethere/%s%04d.png", _vm->getBaseName(), _frame);
|
||||||
FILE *file = fopen(fileName, "wb");
|
FILE *file = fopen(fileName, "wb");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
error("can't open file for writing png");
|
error("can't open file for writing png");
|
||||||
|
@ -1008,12 +1008,12 @@ ScummFile *Sound::openSfxFile() {
|
|||||||
ScummFile *file = new ScummFile();
|
ScummFile *file = new ScummFile();
|
||||||
_offsetTable = NULL;
|
_offsetTable = NULL;
|
||||||
|
|
||||||
/* Try opening the file <_gameName>.sou first, e.g. tentacle.sou.
|
/* Try opening the file <baseName>.sou first, e.g. tentacle.sou.
|
||||||
* That way, you can keep .sou files for multiple games in the
|
* That way, you can keep .sou files for multiple games in the
|
||||||
* same directory */
|
* same directory */
|
||||||
|
|
||||||
const char *basename[4] = { 0, 0, 0, 0 };
|
const char *basename[4] = { 0, 0, 0, 0 };
|
||||||
basename[0] = _vm->getGameName();
|
basename[0] = _vm->getBaseName();
|
||||||
basename[1] = "monster";
|
basename[1] = "monster";
|
||||||
|
|
||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
@ -1036,9 +1036,9 @@ ScummFile *Sound::openSfxFile() {
|
|||||||
|
|
||||||
if (!file->isOpen()) {
|
if (!file->isOpen()) {
|
||||||
if ((_vm->_heversion <= 61 && _vm->_platform == Common::kPlatformMacintosh) || (_vm->_heversion >= 70)) {
|
if ((_vm->_heversion <= 61 && _vm->_platform == Common::kPlatformMacintosh) || (_vm->_heversion >= 70)) {
|
||||||
sprintf(buf, "%s.he2", _vm->getGameName());
|
sprintf(buf, "%s.he2", _vm->getBaseName());
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s.tlk", _vm->getGameName());
|
sprintf(buf, "%s.tlk", _vm->getBaseName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
|
@ -138,7 +138,7 @@ void Sound::setupHEMusicFile() {
|
|||||||
char buf[32], buf1[128];
|
char buf[32], buf1[128];
|
||||||
Common::File musicFile;
|
Common::File musicFile;
|
||||||
|
|
||||||
sprintf(buf, "%s.he4", _vm->getGameName());
|
sprintf(buf, "%s.he4", _vm->getBaseName());
|
||||||
|
|
||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
_vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
|
_vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
|
||||||
@ -334,7 +334,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
|
|||||||
char buf[32], buf1[128];
|
char buf[32], buf1[128];
|
||||||
Common::File musicFile;
|
Common::File musicFile;
|
||||||
|
|
||||||
sprintf(buf, "%s.he4", _vm->getGameName());
|
sprintf(buf, "%s.he4", _vm->getBaseName());
|
||||||
|
|
||||||
if (_vm->_substResFileNameIndex > 0) {
|
if (_vm->_substResFileNameIndex > 0) {
|
||||||
_vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
|
_vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
|
||||||
|
@ -104,7 +104,7 @@ static const GameSettings simonGames[] = {
|
|||||||
GameList Engine_SIMON_gameList() {
|
GameList Engine_SIMON_gameList() {
|
||||||
GameList games;
|
GameList games;
|
||||||
const GameSettings *g = simonGames;
|
const GameSettings *g = simonGames;
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(*g);
|
games.push_back(*g);
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
@ -119,8 +119,8 @@ DetectedGameList Engine_SIMON_detectGames(const FSList &fslist) {
|
|||||||
Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst) {
|
Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst) {
|
||||||
const ObsoleteTargets *o = obsoleteTargetsTable;
|
const ObsoleteTargets *o = obsoleteTargetsTable;
|
||||||
while (o->from) {
|
while (o->from) {
|
||||||
if (!scumm_stricmp(detector->_game.name, o->from)) {
|
if (!scumm_stricmp(detector->_game.gameid, o->from)) {
|
||||||
detector->_game.name = o->to;
|
detector->_game.gameid = o->to;
|
||||||
|
|
||||||
ConfMan.set("gameid", o->to);
|
ConfMan.set("gameid", o->to);
|
||||||
|
|
||||||
|
@ -46,12 +46,12 @@ extern bool isSmartphone();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct Sword2GameSettings {
|
struct Sword2GameSettings {
|
||||||
const char *name;
|
const char *gameid;
|
||||||
const char *description;
|
const char *description;
|
||||||
uint32 features;
|
uint32 features;
|
||||||
const char *detectname;
|
const char *detectname;
|
||||||
GameSettings toGameSettings() const {
|
GameSettings toGameSettings() const {
|
||||||
GameSettings dummy = { name, description, features };
|
GameSettings dummy = { gameid, description, features };
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -67,7 +67,7 @@ static const Sword2GameSettings sword2_settings[] = {
|
|||||||
GameList Engine_SWORD2_gameList() {
|
GameList Engine_SWORD2_gameList() {
|
||||||
const Sword2GameSettings *g = sword2_settings;
|
const Sword2GameSettings *g = sword2_settings;
|
||||||
GameList games;
|
GameList games;
|
||||||
while (g->name) {
|
while (g->gameid) {
|
||||||
games.push_back(g->toGameSettings());
|
games.push_back(g->toGameSettings());
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ DetectedGameList Engine_SWORD2_detectGames(const FSList &fslist) {
|
|||||||
// between the 'sword2' and 'sword2demo' targets. The current code
|
// between the 'sword2' and 'sword2demo' targets. The current code
|
||||||
// can't do that since they use the same detectname.
|
// can't do that since they use the same detectname.
|
||||||
|
|
||||||
for (g = sword2_settings; g->name; ++g) {
|
for (g = sword2_settings; g->gameid; ++g) {
|
||||||
// Iterate over all files in the given directory
|
// Iterate over all files in the given directory
|
||||||
for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
|
for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
|
||||||
if (!file->isDirectory()) {
|
if (!file->isDirectory()) {
|
||||||
|
@ -60,7 +60,7 @@ typedef struct {
|
|||||||
const char *platform;
|
const char *platform;
|
||||||
const char *language;
|
const char *language;
|
||||||
const char *md5;
|
const char *md5;
|
||||||
const char *target;
|
const char *gameid;
|
||||||
const char *infoSource;
|
const char *infoSource;
|
||||||
} Entry;
|
} Entry;
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ static const char *c_header =
|
|||||||
"\n"
|
"\n"
|
||||||
"struct MD5Table {\n"
|
"struct MD5Table {\n"
|
||||||
" const char *md5;\n"
|
" const char *md5;\n"
|
||||||
" const char *target;\n"
|
" const char *gameid;\n"
|
||||||
" Common::Language language;\n"
|
" Common::Language language;\n"
|
||||||
" Common::Platform platform;\n"
|
" Common::Platform platform;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
@ -147,7 +147,7 @@ static void parseEntry(Entry *entry, char *line) {
|
|||||||
entry->platform = strtok(NULL, "\t\n\r");
|
entry->platform = strtok(NULL, "\t\n\r");
|
||||||
entry->language = strtok(NULL, "\t\n\r");
|
entry->language = strtok(NULL, "\t\n\r");
|
||||||
entry->md5 = strtok(NULL, "\t\n\r");
|
entry->md5 = strtok(NULL, "\t\n\r");
|
||||||
entry->target = strtok(NULL, "\t\n\r");
|
entry->gameid = strtok(NULL, "\t\n\r");
|
||||||
entry->infoSource = strtok(NULL, "\t\n\r");
|
entry->infoSource = strtok(NULL, "\t\n\r");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(outFile, "\"%s\", ", entry.platform);
|
fprintf(outFile, "\"%s\", ", entry.platform);
|
||||||
fprintf(outFile, "\"%s\", ", entry.language);
|
fprintf(outFile, "\"%s\", ", entry.language);
|
||||||
fprintf(outFile, "\"%s\", ", entry.md5);
|
fprintf(outFile, "\"%s\", ", entry.md5);
|
||||||
fprintf(outFile, "\"%s\"", entry.target);
|
fprintf(outFile, "\"%s\"", entry.gameid);
|
||||||
if (entry.infoSource)
|
if (entry.infoSource)
|
||||||
fprintf(outFile, ", \"%s\"", entry.infoSource);
|
fprintf(outFile, ", \"%s\"", entry.infoSource);
|
||||||
fprintf(outFile, "); ?>\n");
|
fprintf(outFile, "); ?>\n");
|
||||||
@ -246,7 +246,7 @@ int main(int argc, char *argv[])
|
|||||||
entriesBuffer = realloc(entriesBuffer, maxEntries * entrySize);
|
entriesBuffer = realloc(entriesBuffer, maxEntries * entrySize);
|
||||||
}
|
}
|
||||||
snprintf(entriesBuffer + numEntries * entrySize, entrySize, "\t{ \"%s\", \"%s\", Common::%s, Common::%s },\n",
|
snprintf(entriesBuffer + numEntries * entrySize, entrySize, "\t{ \"%s\", \"%s\", Common::%s, Common::%s },\n",
|
||||||
entry.md5, entry.target, mapStr(entry.language, langMap), mapStr(entry.platform, platformMap));
|
entry.md5, entry.gameid, mapStr(entry.language, langMap), mapStr(entry.platform, platformMap));
|
||||||
numEntries++;
|
numEntries++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user