ULTIMA8: Remove commands related to swtiching games from pentagram.

ScummVM launcher replaces all pentagram menu functionality and this was now effectively dead code.
This commit is contained in:
Matthew Jimenez 2021-01-31 17:47:03 -06:00
parent 7c974b8cf9
commit b555cc8ee6
5 changed files with 5 additions and 84 deletions

View File

@ -129,18 +129,7 @@ void CoreApp::setupGameList() {
}
GameInfo *CoreApp::getDefaultGame() {
istring gamename;
Std::string defaultgame;
bool defaultset = _settingMan->get("defaultgame", defaultgame,
SettingManager::DOM_GLOBAL);
if (defaultset) {
// default game specified in config file
gamename = defaultgame;
} else {
gamename = _gameDesc->desc.gameId;
}
istring gamename = _gameDesc->desc.gameId;
GameInfo *info = getGameInfo(gamename);
if (!info) {

View File

@ -81,8 +81,6 @@ Debugger::Debugger() : Shared::Debugger() {
registerCmd("Ultima8Engine::loadGame", WRAP_METHOD(Debugger, cmdLoadGame));
registerCmd("Ultima8Engine::newGame", WRAP_METHOD(Debugger, cmdNewGame));
registerCmd("Ultima8Engine::engineStats", WRAP_METHOD(Debugger, cmdEngineStats));
registerCmd("Ultima8Engine::changeGame", WRAP_METHOD(Debugger, cmdChangeGame));
registerCmd("Ultima8Engine::listGames", WRAP_METHOD(Debugger, cmdListGames));
registerCmd("Ultima8Engine::setVideoMode", WRAP_METHOD(Debugger, cmdSetVideoMode));
registerCmd("Ultima8Engine::toggleAvatarInStasis", WRAP_METHOD(Debugger, cmdToggleAvatarInStasis));
registerCmd("Ultima8Engine::togglePaintEditorItems", WRAP_METHOD(Debugger, cmdTogglePaintEditorItems));
@ -284,36 +282,6 @@ bool Debugger::cmdEngineStats(int argc, const char **argv) {
return true;
}
bool Debugger::cmdChangeGame(int argc, const char **argv) {
if (argc == 1) {
debugPrintf("Current _game is: %s\n", Ultima8Engine::get_instance()->_gameInfo->_name.c_str());
} else {
Ultima8Engine::get_instance()->changeGame(argv[1]);
}
return true;
}
bool Debugger::cmdListGames(int argc, const char **argv) {
Ultima8Engine *app = Ultima8Engine::get_instance();
Std::vector<istring> games;
games = app->_settingMan->listGames();
Std::vector<istring>::const_iterator iter;
for (iter = games.begin(); iter != games.end(); ++iter) {
const istring &_game = *iter;
GameInfo *info = app->getGameInfo(_game);
debugPrintf("%s: ", _game.c_str());
if (info) {
Std::string details = info->getPrintDetails();
debugPrintf("%s\n", details.c_str());
} else {
debugPrintf("(unknown)\n");
}
}
return true;
}
bool Debugger::cmdSetVideoMode(int argc, const char **argv) {
if (argc != 3) {
debugPrintf("Usage: Ultima8Engine::setVidMode width height\n");

View File

@ -143,8 +143,6 @@ private:
bool cmdLoadGame(int argc, const char **argv);
bool cmdNewGame(int argc, const char **argv);
bool cmdQuit(int argc, const char **argv);
bool cmdChangeGame(int argc, const char **argv);
bool cmdListGames(int argc, const char **argv);
bool cmdSetVideoMode(int argc, const char **argv);
bool cmdEngineStats(int argc, const char **argv);
bool cmdToggleAvatarInStasis(int argc, const char **argv);

View File

@ -426,10 +426,6 @@ void Ultima8Engine::shutdownGame(bool reloading) {
}
}
void Ultima8Engine::changeGame(istring newgame) {
_changeGameName = newgame;
}
//
// To time the frames, we use "fast" ticks which come 3000 times a second.
//
@ -497,28 +493,6 @@ bool Ultima8Engine::runGame() {
// Paint Screen
paint();
if (!_changeGameName.empty()) {
pout << "Changing Game to: " << _changeGameName << Std::endl;
GameInfo *info = getGameInfo(_changeGameName);
if (info) {
shutdownGame();
_changeGameName.clear();
if (setupGame(info)) {
if (!startupGame())
return false;
} else {
CANT_HAPPEN_MSG("Failed to start up game with valid info.");
}
} else {
perr << "Game '" << _changeGameName << "' not found" << Std::endl;
_changeGameName.clear();
}
}
if (!_errorMessage.empty()) {
MessageBoxGump::Show(_errorTitle, _errorMessage, 0xFF8F3030);
_errorTitle.clear();
@ -1256,7 +1230,7 @@ Common::Error Ultima8Engine::loadGameStream(Common::SeekableReadStream *stream)
_mouse->pushMouseCursor();
if (!totalok) {
Error(message, "Error Loading savegame", true);
Error(message, "Error Loading savegame");
delete sg;
return Common::kReadingFailed;
}
@ -1267,18 +1241,13 @@ Common::Error Ultima8Engine::loadGameStream(Common::SeekableReadStream *stream)
return Common::kNoError;
}
void Ultima8Engine::Error(Std::string message, Std::string title, bool exit_to_menu) {
if (title.empty()) title = exit_to_menu ? "Fatal Game Error" : "Error";
void Ultima8Engine::Error(Std::string message, Std::string title) {
if (title.empty()) title = "Error";
perr << title << ": " << message << Std::endl;
_errorMessage = message;
_errorTitle = title;
if (exit_to_menu) {
_changeGameName = "pentagram";
Kernel::get_instance()->killProcesses(0, 6, false);
}
}
Gump *Ultima8Engine::getGump(uint16 gumpid) {

View File

@ -77,7 +77,6 @@ private:
// full system
Game *_game;
istring _changeGameName;
Std::string _errorMessage;
Std::string _errorTitle;
@ -178,7 +177,6 @@ public:
bool startupGame();
void shutdownGame(bool reloading = true);
void changeGame(istring newgame);
void changeVideoMode(int width, int height);
@ -325,8 +323,7 @@ public:
//! Display an error message box
//! \param message The message to display on the box
//! \param exit_to_menu If true, then exit to the Pentagram menu then display the message
void Error(Std::string message, Std::string title = Std::string(), bool exit_to_menu = false);
void Error(Std::string message, Std::string title = Std::string());
public:
unsigned int getInversion() const {
return _inversion;