Skip to content

Commit

Permalink
ENGINES: Make variable names of ADGameDescription conform to our guid…
Browse files Browse the repository at this point in the history
…elines.

gameid     -> gameId
guioptions -> guiOptions
  • Loading branch information
Johannes Schickel committed Mar 8, 2016
1 parent 0b6befd commit 3aecd8e
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 44 deletions.
22 changes: 11 additions & 11 deletions engines/advancedDetector.cpp
Expand Up @@ -42,7 +42,7 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa
extra = "";
} else {
while (sg->gameid) {
if (!scumm_stricmp(g.gameid, sg->gameid))
if (!scumm_stricmp(g.gameId, sg->gameid))
title = sg->description;
sg++;
}
Expand All @@ -56,7 +56,7 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa
else if (g.flags & ADGF_TESTING)
gsl = kTestingGame;

GameDescriptor gd(g.gameid, title, g.language, g.platform, 0, gsl);
GameDescriptor gd(g.gameId, title, g.language, g.platform, 0, gsl);
gd.updateDesc(extra);
return gd;
}
Expand Down Expand Up @@ -120,7 +120,7 @@ void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGame
if (_flags & kADFlagUseExtraAsHint)
desc["extra"] = realDesc->extra;

desc.setGUIOptions(realDesc->guioptions + _guiOptions);
desc.setGUIOptions(realDesc->guiOptions + _guiOptions);
desc.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(realDesc->language));

if (realDesc->flags & ADGF_ADDENGLISH)
Expand Down Expand Up @@ -272,7 +272,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (_singleId == NULL) {
// Find the first match with correct gameid.
for (uint i = 0; i < matches.size(); i++) {
if (matches[i]->gameid == gameid) {
if (matches[i]->gameId == gameid) {
agdDesc = matches[i];
break;
}
Expand All @@ -287,7 +287,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (agdDesc != 0) {
// Seems we found a fallback match. But first perform a basic
// sanity check: the gameid must match.
if (_singleId == NULL && agdDesc->gameid != gameid)
if (_singleId == NULL && agdDesc->gameId != gameid)
agdDesc = 0;
}
}
Expand All @@ -301,7 +301,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (agdDesc->flags & ADGF_ADDENGLISH)
lang += " " + getGameGUIOptionsDescriptionLanguage(Common::EN_ANY);

Common::updateGameGUIOptions(agdDesc->guioptions + _guiOptions, lang);
Common::updateGameGUIOptions(agdDesc->guiOptions + _guiOptions, lang);

GameDescriptor gameDescriptor = toGameDescriptor(*agdDesc, _gameIds);

Expand Down Expand Up @@ -424,7 +424,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons

// Check which files are included in some ADGameDescription *and* are present.
// Compute MD5s and file sizes for these files.
for (descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize) {
for (descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameId != 0; descPtr += _descItemSize) {
g = (const ADGameDescription *)descPtr;

for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) {
Expand All @@ -447,7 +447,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons

// MD5 based matching
uint i;
for (i = 0, descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize, ++i) {
for (i = 0, descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameId != 0; descPtr += _descItemSize, ++i) {
g = (const ADGameDescription *)descPtr;
bool fileMissing = false;

Expand Down Expand Up @@ -504,7 +504,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
gotAnyMatchesWithAllFiles = true;

if (!fileMissing) {
debug(2, "Found game: %s (%s %s/%s) (%d)", g->gameid, g->extra,
debug(2, "Found game: %s (%s %s/%s) (%d)", g->gameId, g->extra,
getPlatformDescription(g->platform), getLanguageDescription(g->language), i);

if (curFilesMatched > maxFilesMatched) {
Expand All @@ -520,7 +520,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
}

} else {
debug(5, "Skipping game: %s (%s %s/%s) (%d)", g->gameid, g->extra,
debug(5, "Skipping game: %s (%s %s/%s) (%d)", g->gameId, g->extra,
getPlatformDescription(g->platform), getLanguageDescription(g->language), i);
}
}
Expand Down Expand Up @@ -560,7 +560,7 @@ const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap &
}

if (!fileMissing) {
debug(4, "Matched: %s", agdesc->gameid);
debug(4, "Matched: %s", agdesc->gameId);

if (numMatchedFiles > maxNumMatchedFiles) {
matchedDesc = agdesc;
Expand Down
4 changes: 2 additions & 2 deletions engines/advancedDetector.h
Expand Up @@ -95,7 +95,7 @@ enum ADGameFlags {
};

struct ADGameDescription {
const char *gameid;
const char *gameId;
const char *extra;
ADGameFileDescription filesDescriptions[14];
Common::Language language;
Expand All @@ -108,7 +108,7 @@ struct ADGameDescription {
*/
uint32 flags;

const char *guioptions;
const char *guiOptions;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions engines/agi/detection.cpp
Expand Up @@ -567,13 +567,13 @@ const ADGameDescription *AgiMetaEngine::fallbackDetect(const FileMap &allFilesXX
// Override the gameid & extra values in g_fallbackDesc.desc. This only works
// until the fallback detector is called again, and while the MetaEngine instance
// is alive (as else the string storage is modified/deleted).
g_fallbackDesc.desc.gameid = _gameid.c_str();
g_fallbackDesc.desc.gameId = _gameid.c_str();
g_fallbackDesc.desc.extra = _extra.c_str();

Common::String fallbackWarning;

fallbackWarning = "Your game version has been detected using fallback matching as a\n";
fallbackWarning += Common::String::format("variant of %s (%s).\n", g_fallbackDesc.desc.gameid, g_fallbackDesc.desc.extra);
fallbackWarning += Common::String::format("variant of %s (%s).\n", g_fallbackDesc.desc.gameId, g_fallbackDesc.desc.extra);
fallbackWarning += "If this is an original and unmodified version or new made Fanmade game,\n";
fallbackWarning += "please report any, information previously printed by ScummVM to the team.\n";

Expand Down
2 changes: 1 addition & 1 deletion engines/avalanche/detection.cpp
Expand Up @@ -40,7 +40,7 @@ uint32 AvalancheEngine::getFeatures() const {
}

const char *AvalancheEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

static const PlainGameDescriptor avalancheGames[] = {
Expand Down
2 changes: 1 addition & 1 deletion engines/composer/detection.cpp
Expand Up @@ -38,7 +38,7 @@ int ComposerEngine::getGameType() const {
}

const char *ComposerEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

uint32 ComposerEngine::getFeatures() const {
Expand Down
2 changes: 1 addition & 1 deletion engines/cruise/detection.cpp
Expand Up @@ -35,7 +35,7 @@ struct CRUISEGameDescription {
};

const char *CruiseEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

Common::Language CruiseEngine::getLanguage() const {
Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/detection.cpp
Expand Up @@ -32,7 +32,7 @@
namespace Fullpipe {

const char *FullpipeEngine::getGameId() const {
return _gameDescription->gameid;
return _gameDescription->gameId;
}

}
Expand Down
2 changes: 1 addition & 1 deletion engines/hugo/detection.cpp
Expand Up @@ -41,7 +41,7 @@ uint32 HugoEngine::getFeatures() const {
}

const char *HugoEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}


Expand Down
2 changes: 1 addition & 1 deletion engines/mohawk/detection.cpp
Expand Up @@ -54,7 +54,7 @@ struct MohawkGameDescription {
};

const char* MohawkEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

uint32 MohawkEngine::getFeatures() const {
Expand Down
2 changes: 1 addition & 1 deletion engines/neverhood/detection.cpp
Expand Up @@ -41,7 +41,7 @@ struct NeverhoodGameDescription {
};

const char *NeverhoodEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

uint32 NeverhoodEngine::getFeatures() const {
Expand Down
2 changes: 1 addition & 1 deletion engines/prince/detection.cpp
Expand Up @@ -29,7 +29,7 @@ int PrinceEngine::getGameType() const {
}

const char *PrinceEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

uint32 PrinceEngine::getFeatures() const {
Expand Down
12 changes: 6 additions & 6 deletions engines/queen/detection.cpp
Expand Up @@ -443,25 +443,25 @@ const ADGameDescription *QueenMetaEngine::fallbackDetect(const FileMap &allFiles
}
Queen::DetectedGameVersion version;
if (Queen::Resource::detectVersion(&version, &dataFile)) {
desc.gameid = "queen";
desc.gameId = "queen";
desc.language = version.language;
desc.platform = version.platform;
desc.flags = ADGF_NO_FLAGS;
desc.guioptions = GUIO0();
desc.guiOptions = GUIO0();
if (version.features & Queen::GF_DEMO) {
desc.extra = "Demo";
desc.flags = ADGF_DEMO;
desc.guioptions = GUIO_NOSPEECH;
desc.guiOptions = GUIO_NOSPEECH;
} else if (version.features & Queen::GF_INTERVIEW) {
desc.extra = "Interview";
desc.flags = ADGF_DEMO;
desc.guioptions = GUIO_NOSPEECH;
desc.guiOptions = GUIO_NOSPEECH;
} else if (version.features & Queen::GF_FLOPPY) {
desc.extra = "Floppy";
desc.guioptions = GUIO_NOSPEECH;
desc.guiOptions = GUIO_NOSPEECH;
} else if (version.features & Queen::GF_TALKIE) {
desc.extra = "Talkie";
desc.guioptions = GAMEOPTION_ALT_INTRO;
desc.guiOptions = GAMEOPTION_ALT_INTRO;
}
return (const ADGameDescription *)&desc;
}
Expand Down
10 changes: 5 additions & 5 deletions engines/sci/detection.cpp
Expand Up @@ -526,8 +526,8 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
s_fallbackDesc.language = Common::EN_ANY;
s_fallbackDesc.flags = ADGF_NO_FLAGS;
s_fallbackDesc.platform = Common::kPlatformDOS; // default to PC platform
s_fallbackDesc.gameid = "sci";
s_fallbackDesc.guioptions = GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);
s_fallbackDesc.gameId = "sci";
s_fallbackDesc.guiOptions = GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);

if (allFiles.contains("resource.map") || allFiles.contains("Data1")
|| allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) {
Expand Down Expand Up @@ -610,7 +610,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
Common::String gameId = convertSierraGameId(sierraGameId, &s_fallbackDesc.flags, resMan);
strncpy(s_fallbackGameIdBuf, gameId.c_str(), sizeof(s_fallbackGameIdBuf) - 1);
s_fallbackGameIdBuf[sizeof(s_fallbackGameIdBuf) - 1] = 0; // Make sure string is NULL terminated
s_fallbackDesc.gameid = s_fallbackGameIdBuf;
s_fallbackDesc.gameId = s_fallbackGameIdBuf;

// Try to determine the game language
// Load up text 0 and start looking for "#" characters
Expand Down Expand Up @@ -653,7 +653,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
const bool isCD = (s_fallbackDesc.flags & ADGF_CD);

if (!isCD)
s_fallbackDesc.guioptions = GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);
s_fallbackDesc.guiOptions = GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);

if (gameId.hasSuffix("sci")) {
s_fallbackDesc.extra = "SCI";
Expand Down Expand Up @@ -686,7 +686,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
bool SciMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const GameIdStrToEnum *g = s_gameIdStrToEnum;
for (; g->gameidStr; ++g) {
if (0 == strcmp(desc->gameid, g->gameidStr)) {
if (0 == strcmp(desc->gameId, g->gameidStr)) {
*engine = new SciEngine(syst, desc, g->gameidEnum);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/sci/sci.cpp
Expand Up @@ -834,7 +834,7 @@ Console *SciEngine::getSciDebugger() {
}

const char *SciEngine::getGameIdStr() const {
return _gameDescription->gameid;
return _gameDescription->gameId;
}

Common::Language SciEngine::getLanguage() const {
Expand Down
8 changes: 4 additions & 4 deletions engines/tinsel/detection.cpp
Expand Up @@ -228,8 +228,8 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile

// Check which files are included in some dw2 ADGameDescription *and* present
// in fslist without a '1' suffix character. Compute MD5s and file sizes for these files.
for (g = &Tinsel::gameDescriptions[0]; g->desc.gameid != 0; ++g) {
if (strcmp(g->desc.gameid, "dw2") != 0)
for (g = &Tinsel::gameDescriptions[0]; g->desc.gameId != 0; ++g) {
if (strcmp(g->desc.gameId, "dw2") != 0)
continue;

for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) {
Expand Down Expand Up @@ -265,8 +265,8 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile
int maxFilesMatched = 0;

// MD5 based matching
for (g = &Tinsel::gameDescriptions[0]; g->desc.gameid != 0; ++g) {
if (strcmp(g->desc.gameid, "dw2") != 0)
for (g = &Tinsel::gameDescriptions[0]; g->desc.gameId != 0; ++g) {
if (strcmp(g->desc.gameId, "dw2") != 0)
continue;

bool fileMissing = false;
Expand Down
2 changes: 1 addition & 1 deletion engines/tsage/detection.cpp
Expand Up @@ -40,7 +40,7 @@ struct tSageGameDescription {
};

const char *TSageEngine::getGameId() const {
return _gameDescription->desc.gameid;
return _gameDescription->desc.gameId;
}

uint32 TSageEngine::getGameID() const {
Expand Down
6 changes: 3 additions & 3 deletions engines/wintermute/detection.cpp
Expand Up @@ -94,8 +94,8 @@ class WintermuteMetaEngine : public AdvancedMetaEngine {
s_fallbackDesc.language = Common::UNK_LANG;
s_fallbackDesc.flags = ADGF_UNSTABLE;
s_fallbackDesc.platform = Common::kPlatformWindows; // default to Windows
s_fallbackDesc.gameid = "wintermute";
s_fallbackDesc.guioptions = GUIO0();
s_fallbackDesc.gameId = "wintermute";
s_fallbackDesc.guiOptions = GUIO0();

if (allFiles.contains("data.dcp")) {
Common::String name, caption;
Expand All @@ -109,7 +109,7 @@ class WintermuteMetaEngine : public AdvancedMetaEngine {
// Prefix to avoid collisions with actually known games
name = "wmeunk-" + name;
Common::strlcpy(s_fallbackGameIdBuf, name.c_str(), sizeof(s_fallbackGameIdBuf) - 1);
s_fallbackDesc.gameid = s_fallbackGameIdBuf;
s_fallbackDesc.gameId = s_fallbackGameIdBuf;
if (caption != name) {
caption += " (unknown version) ";
char *offset = s_fallbackGameIdBuf + name.size() + 1;
Expand Down
2 changes: 1 addition & 1 deletion engines/wintermute/wintermute.cpp
Expand Up @@ -133,7 +133,7 @@ Common::Error WintermuteEngine::run() {
}

int WintermuteEngine::init() {
BaseEngine::createInstance(_targetName, _gameDescription->adDesc.gameid, _gameDescription->adDesc.language, _gameDescription->targetExecutable);
BaseEngine::createInstance(_targetName, _gameDescription->adDesc.gameId, _gameDescription->adDesc.language, _gameDescription->targetExecutable);
_game = new AdGame(_targetName);
if (!_game) {
return 1;
Expand Down

0 comments on commit 3aecd8e

Please sign in to comment.