DC: Update for the engineId changes
This commit is contained in:
parent
c142838122
commit
780db83e13
3 changed files with 17 additions and 9 deletions
|
@ -262,7 +262,7 @@ public:
|
|||
extern int handleInput(struct mapledev *pad,
|
||||
int &mouse_x, int &mouse_y,
|
||||
byte &shiftFlags, Interactive *inter = NULL);
|
||||
extern bool selectGame(char *&, char *&, Common::Language &, Common::Platform &, class Icon &);
|
||||
extern bool selectGame(char *&, char *&, char *&, Common::Language &, Common::Platform &, class Icon &);
|
||||
#ifdef DYNAMIC_MODULES
|
||||
extern bool selectPluginDir(Common::String &selection, const Common::FSNode &base);
|
||||
#endif
|
||||
|
|
|
@ -365,28 +365,31 @@ int main()
|
|||
|
||||
int DCLauncherDialog::runModal()
|
||||
{
|
||||
char *base = NULL, *dir = NULL;
|
||||
char *engineId = NULL, *gameId = NULL, *dir = NULL;
|
||||
Common::Language language = Common::UNK_LANG;
|
||||
Common::Platform platform = Common::kPlatformUnknown;
|
||||
|
||||
if (!selectGame(base, dir, language, platform, icon))
|
||||
if (!selectGame(engineId, gameId, dir, language, platform, icon))
|
||||
g_system->quit();
|
||||
|
||||
// Set the game path.
|
||||
ConfMan.addGameDomain(base);
|
||||
ConfMan.addGameDomain(gameId);
|
||||
ConfMan.set("engineid", engineId, gameId);
|
||||
ConfMan.set("gameid", gameId, gameId);
|
||||
|
||||
if (dir != NULL)
|
||||
ConfMan.set("path", dir, base);
|
||||
ConfMan.set("path", dir, gameId);
|
||||
|
||||
// Set the game language.
|
||||
if (language != Common::UNK_LANG)
|
||||
ConfMan.set("language", Common::getLanguageCode(language), base);
|
||||
ConfMan.set("language", Common::getLanguageCode(language), gameId);
|
||||
|
||||
// Set the game platform.
|
||||
if (platform != Common::kPlatformUnknown)
|
||||
ConfMan.set("platform", Common::getPlatformCode(platform), base);
|
||||
ConfMan.set("platform", Common::getPlatformCode(platform), gameId);
|
||||
|
||||
// Set the target.
|
||||
ConfMan.setActiveDomain(base);
|
||||
ConfMan.setActiveDomain(gameId);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ void draw_trans_quad(float x1, float y1, float x2, float y2,
|
|||
struct Game
|
||||
{
|
||||
char dir[256];
|
||||
char engine_id[256];
|
||||
char filename_base[256];
|
||||
char text[256];
|
||||
Common::Language language;
|
||||
|
@ -233,6 +234,8 @@ static int findGames(Game *games, int max, bool use_ini)
|
|||
}
|
||||
if (curr_game < max) {
|
||||
strcpy(games[curr_game].filename_base, (*i)._key.c_str());
|
||||
strncpy(games[curr_game].engine_id, (*i)._value["engineid"].c_str(), 256);
|
||||
games[curr_game].engine_id[255] = '\0';
|
||||
strncpy(games[curr_game].dir, dirs[j].node.getPath().c_str(), 256);
|
||||
games[curr_game].dir[255] = '\0';
|
||||
games[curr_game].language = Common::UNK_LANG;
|
||||
|
@ -278,6 +281,7 @@ static int findGames(Game *games, int max, bool use_ini)
|
|||
for (DetectedGames::const_iterator ge = candidates.begin();
|
||||
ge != candidates.end(); ++ge)
|
||||
if (curr_game < max) {
|
||||
strcpy(games[curr_game].engine_id, ge->engineId.c_str());
|
||||
strcpy(games[curr_game].filename_base, ge->gameId.c_str());
|
||||
strcpy(games[curr_game].dir, dirs[curr_dir-1].name);
|
||||
games[curr_game].language = ge->language;
|
||||
|
@ -465,7 +469,7 @@ int gameMenu(Game *games, int num_games)
|
|||
}
|
||||
}
|
||||
|
||||
bool selectGame(char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::Platform &plf_ret, Icon &icon)
|
||||
bool selectGame(char *&engineId, char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::Platform &plf_ret, Icon &icon)
|
||||
{
|
||||
Game *games = new Game[MAX_GAMES];
|
||||
int selected, num_games;
|
||||
|
@ -510,6 +514,7 @@ bool selectGame(char *&ret, char *&dir_ret, Common::Language &lang_ret, Common::
|
|||
chdir("/");
|
||||
dir_ret = the_game.dir;
|
||||
#endif
|
||||
engineId = the_game.engine_id;
|
||||
ret = the_game.filename_base;
|
||||
lang_ret = the_game.language;
|
||||
plf_ret = the_game.platform;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue