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;
|
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)
|
switch(myState)
|
||||||
{
|
{
|
||||||
case S_EMULATE:
|
case S_EMULATE:
|
||||||
myOverlay = NULL;
|
myOverlay = NULL;
|
||||||
myOSystem->sound().mute(false);
|
myOSystem->sound().mute(false);
|
||||||
|
SDL_EnableUNICODE(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_PAUSE:
|
case S_PAUSE:
|
||||||
|
myOverlay = NULL;
|
||||||
myOSystem->sound().mute(true);
|
myOSystem->sound().mute(true);
|
||||||
|
SDL_EnableUNICODE(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_MENU:
|
case S_MENU:
|
||||||
myOverlay = &myOSystem->menu();
|
myOverlay = &myOSystem->menu();
|
||||||
|
SDL_EnableUNICODE(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_CMDMENU:
|
case S_CMDMENU:
|
||||||
myOverlay = &myOSystem->commandMenu();
|
myOverlay = &myOSystem->commandMenu();
|
||||||
|
SDL_EnableUNICODE(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_LAUNCHER:
|
case S_LAUNCHER:
|
||||||
myOverlay = &myOSystem->launcher();
|
myOverlay = &myOSystem->launcher();
|
||||||
|
SDL_EnableUNICODE(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
case S_DEBUGGER:
|
case S_DEBUGGER:
|
||||||
myOverlay = &myOSystem->debugger();
|
myOverlay = &myOSystem->debugger();
|
||||||
|
SDL_EnableUNICODE(1);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -162,10 +162,6 @@ FBInitStatus FrameBuffer::initialize(const string& title,
|
||||||
else
|
else
|
||||||
return kFailTooLarge;
|
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
|
// Erase any messages from a previous run
|
||||||
myMsg.counter = 0;
|
myMsg.counter = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue