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:
stephena 2012-01-14 22:14:04 +00:00
parent 73dbe861a6
commit 76e64b711b
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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;