mirror of https://github.com/stella-emu/stella.git
Fixed bug where pressing the keys to enter menu, commandmenu or debugger
were accessible from the launcher, and were causing a segfault when pressed. Fixed bug where 'mouse is paddle xxx' number wasn't being set when starting Stella for the first time. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@873 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
0d41f9dc5c
commit
d76d9247c2
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventHandler.cxx,v 1.108 2005-10-30 20:29:56 stephena Exp $
|
// $Id: EventHandler.cxx,v 1.109 2005-11-01 16:32:27 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -114,6 +114,8 @@ EventHandler::EventHandler(OSystem* osystem)
|
||||||
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
|
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
|
||||||
myEmulateMouseFlag = myOSystem->settings().getBool("joymouse");
|
myEmulateMouseFlag = myOSystem->settings().getBool("joymouse");
|
||||||
|
|
||||||
|
setPaddleMode(myOSystem->settings().getInt("paddle"), false);
|
||||||
|
|
||||||
myFryingFlag = false;
|
myFryingFlag = false;
|
||||||
|
|
||||||
memset(&myJoyMouse, 0, sizeof(myJoyMouse));
|
memset(&myJoyMouse, 0, sizeof(myJoyMouse));
|
||||||
|
@ -152,7 +154,6 @@ void EventHandler::reset(State state)
|
||||||
myLSState = 0;
|
myLSState = 0;
|
||||||
myPauseFlag = false;
|
myPauseFlag = false;
|
||||||
myQuitFlag = false;
|
myQuitFlag = false;
|
||||||
myPaddleMode = 0;
|
|
||||||
|
|
||||||
myOSystem->frameBuffer().pause(myPauseFlag);
|
myOSystem->frameBuffer().pause(myPauseFlag);
|
||||||
myOSystem->sound().mute(myPauseFlag);
|
myOSystem->sound().mute(myPauseFlag);
|
||||||
|
@ -1082,28 +1083,38 @@ bool EventHandler::eventStateChange(Event::Type type)
|
||||||
case Event::MenuMode:
|
case Event::MenuMode:
|
||||||
if(!myPauseFlag)
|
if(!myPauseFlag)
|
||||||
{
|
{
|
||||||
if(myState != S_MENU)
|
if(myState == S_EMULATE)
|
||||||
enterMenuMode(S_MENU);
|
enterMenuMode(S_MENU);
|
||||||
else
|
else if(myState == S_MENU)
|
||||||
leaveMenuMode();
|
leaveMenuMode();
|
||||||
|
else
|
||||||
|
handled = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
handled = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Event::CmdMenuMode:
|
case Event::CmdMenuMode:
|
||||||
if(!myPauseFlag)
|
if(!myPauseFlag)
|
||||||
{
|
{
|
||||||
if(myState != S_CMDMENU)
|
if(myState == S_EMULATE)
|
||||||
enterMenuMode(S_CMDMENU);
|
enterMenuMode(S_CMDMENU);
|
||||||
else
|
else if(myState == S_CMDMENU)
|
||||||
leaveMenuMode();
|
leaveMenuMode();
|
||||||
|
else
|
||||||
|
handled = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
handled = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Event::DebuggerMode:
|
case Event::DebuggerMode:
|
||||||
if(myState != S_DEBUGGER)
|
if(myState == S_EMULATE)
|
||||||
enterDebugMode();
|
enterDebugMode();
|
||||||
else
|
else if(myState == S_DEBUGGER)
|
||||||
leaveDebugMode();
|
leaveDebugMode();
|
||||||
|
else
|
||||||
|
handled = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1579,6 +1590,9 @@ void EventHandler::takeSnapshot()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EventHandler::setPaddleMode(uInt32 num, bool showmessage)
|
void EventHandler::setPaddleMode(uInt32 num, bool showmessage)
|
||||||
{
|
{
|
||||||
|
if(num < 0 || num > 3)
|
||||||
|
return;
|
||||||
|
|
||||||
myPaddleMode = num;
|
myPaddleMode = num;
|
||||||
|
|
||||||
if(showmessage)
|
if(showmessage)
|
||||||
|
|
Loading…
Reference in New Issue