Example #1
0
GameDescriptor findGameID(
    const char *gameid,
    const PlainGameDescriptor *list,
    const ADObsoleteGameID *obsoleteList
) {
    // First search the list of supported game IDs for a match.
    const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, list);
    if (g)
        return GameDescriptor(*g);

    // If we didn't find the gameid in the main list, check if it
    // is an obsolete game id.
    if (obsoleteList != 0) {
        const ADObsoleteGameID *o = obsoleteList;
        while (o->from) {
            if (0 == scumm_stricmp(gameid, o->from)) {
                g = findPlainGameDescriptor(o->to, list);
                if (g && g->description)
                    return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")");
                else
                    return GameDescriptor(gameid, "Obsolete game ID");
            }
            o++;
        }
    }

    // No match found
    return GameDescriptor();
}
Example #2
0
GameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
	// First search the list of supported gameids for a match.
	const PlainGameDescriptor *g = findPlainGameDescriptor(gameId, _gameIds);
	if (g)
		return GameDescriptor(*g);

	// No match found
	return GameDescriptor();
}