Fixed bug in ROM launcher; hasConsole() would be true even when the console

is closed (since it's not deleted until the next console is created).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3249 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2016-01-18 16:03:22 +00:00
parent e0676f2432
commit a85debea63
3 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,10 @@
issues in (for example) Kaboom, where there was a huge 'deadzone' issues in (for example) Kaboom, where there was a huge 'deadzone'
when moving to the left. when moving to the left.
* Fixed bug in ROM launcher; selecting 'Options -> Game Properties' after
loading a ROM would always point to the last opened ROM, not to the one
currently selected.
* Added more C++11 updates all over the codebase, and ran Stella * Added more C++11 updates all over the codebase, and ran Stella
through Coverity for the first time. I'm proud to say that Stella through Coverity for the first time. I'm proud to say that Stella
now has a 0.00 defect rate! now has a 0.00 defect rate!

View File

@ -405,6 +405,13 @@ bool OSystem::reloadConsole()
return createConsole(myRomFile, myRomMD5, false) == EmptyString; return createConsole(myRomFile, myRomMD5, false) == EmptyString;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool OSystem::hasConsole() const
{
return myConsole != nullptr &&
myEventHandler->state() != EventHandler::S_LAUNCHER;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool OSystem::createLauncher(const string& startdir) bool OSystem::createLauncher(const string& startdir)
{ {

View File

@ -128,7 +128,7 @@ class OSystem
@return The console object @return The console object
*/ */
Console& console() const { return *myConsole; } Console& console() const { return *myConsole; }
bool hasConsole() const { return myConsole != nullptr; } bool hasConsole() const;
/** /**
Get the serial port of the system. Get the serial port of the system.