mirror of https://github.com/stella-emu/stella.git
Small performance improvement; only query Unicode values in GUI modes,
otherwise turn it off (according to the SDL documentation, there's a small performance hit when it's turned on). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2357 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
73dbe861a6
commit
76e64b711b
|
@ -2032,32 +2032,41 @@ void EventHandler::setEventState(State state)
|
|||
{
|
||||
myState = state;
|
||||
|
||||
// Only enable Unicode in GUI modes, since there we need it for ascii data
|
||||
// Otherwise, it causes a performance hit, so leave it off
|
||||
switch(myState)
|
||||
{
|
||||
case S_EMULATE:
|
||||
myOverlay = NULL;
|
||||
myOSystem->sound().mute(false);
|
||||
SDL_EnableUNICODE(0);
|
||||
break;
|
||||
|
||||
case S_PAUSE:
|
||||
myOverlay = NULL;
|
||||
myOSystem->sound().mute(true);
|
||||
SDL_EnableUNICODE(0);
|
||||
break;
|
||||
|
||||
case S_MENU:
|
||||
myOverlay = &myOSystem->menu();
|
||||
SDL_EnableUNICODE(1);
|
||||
break;
|
||||
|
||||
case S_CMDMENU:
|
||||
myOverlay = &myOSystem->commandMenu();
|
||||
SDL_EnableUNICODE(1);
|
||||
break;
|
||||
|
||||
case S_LAUNCHER:
|
||||
myOverlay = &myOSystem->launcher();
|
||||
SDL_EnableUNICODE(1);
|
||||
break;
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
case S_DEBUGGER:
|
||||
myOverlay = &myOSystem->debugger();
|
||||
SDL_EnableUNICODE(1);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -162,10 +162,6 @@ FBInitStatus FrameBuffer::initialize(const string& title,
|
|||
else
|
||||
return kFailTooLarge;
|
||||
|
||||
// Enable unicode so we can see translated key events
|
||||
// (lowercase vs. uppercase characters)
|
||||
SDL_EnableUNICODE(1);
|
||||
|
||||
// Erase any messages from a previous run
|
||||
myMsg.counter = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue