Boot game in EmuScreen::update instead of the constructor. Avoids issues with starting games from the command line.

This commit is contained in:
Henrik Rydgard 2013-07-27 13:26:26 +02:00
parent 5b32d2ecaf
commit 7462d988cf
2 changed files with 6 additions and 3 deletions

View File

@ -54,12 +54,11 @@
EmuScreen::EmuScreen(const std::string &filename)
: gamePath_(filename), invalid_(true), pauseTrigger_(false) {
bootGame(filename);
: booted_(false), gamePath_(filename), invalid_(true), pauseTrigger_(false) {
}
void EmuScreen::bootGame(const std::string &filename) {
booted_ = true;
std::string fileToStart = filename;
// This is probably where we should start up the emulated PSP.
INFO_LOG(BOOT, "Starting up hardware.");
@ -398,6 +397,9 @@ void EmuScreen::CreateViews() {
}
void EmuScreen::update(InputState &input) {
if (!booted_)
bootGame(gamePath_);
UIScreen::update(input);
// Simply forcibily update to the current screen size every frame. Doesn't cost much.

View File

@ -52,6 +52,7 @@ private:
void setVKeyAnalogX(int stick, int virtualKeyMin, int virtualKeyMax);
void setVKeyAnalogY(int stick, int virtualKeyMin, int virtualKeyMax);
bool booted_;
std::string gamePath_;
// Something invalid was loaded, don't try to emulate
bool invalid_;