mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
KEYMAPPER: Simplify calling getKeymap
This commit is contained in:
parent
40b68b41c7
commit
366a942a3a
@ -128,21 +128,24 @@ void Keymapper::cleanupGameKeymaps() {
|
||||
_activeMaps = newStack;
|
||||
}
|
||||
|
||||
Keymap *Keymapper::getKeymap(const String& name, bool &global) {
|
||||
Keymap *Keymapper::getKeymap(const String& name, bool *globalReturn) {
|
||||
Keymap *keymap = _gameDomain.getKeymap(name);
|
||||
global = false;
|
||||
bool global = false;
|
||||
|
||||
if (!keymap) {
|
||||
keymap = _globalDomain.getKeymap(name);
|
||||
global = true;
|
||||
}
|
||||
|
||||
if (globalReturn)
|
||||
*globalReturn = global;
|
||||
|
||||
return keymap;
|
||||
}
|
||||
|
||||
bool Keymapper::pushKeymap(const String& name, bool inherit) {
|
||||
bool global;
|
||||
Keymap *newMap = getKeymap(name, global);
|
||||
Keymap *newMap = getKeymap(name, &global);
|
||||
|
||||
if (!newMap) {
|
||||
warning("Keymap '%s' not registered", name.c_str());
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
* @param name name of the keymap to return
|
||||
* @param global set to true if returned keymap is global, false if game
|
||||
*/
|
||||
Keymap *getKeymap(const String& name, bool &global);
|
||||
Keymap *getKeymap(const String& name, bool *global = 0);
|
||||
|
||||
/**
|
||||
* Push a new keymap to the top of the active stack, activating
|
||||
|
@ -467,11 +467,10 @@ Common::Error LoLEngine::init() {
|
||||
void LoLEngine::initKeymap() {
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
|
||||
bool tmp;
|
||||
Common::Keymapper *mapper = _eventMan->getKeymapper();
|
||||
|
||||
// Do not try to recreate same keymap over again
|
||||
if (mapper->getKeymap(kKeymapName, tmp) != 0)
|
||||
if (mapper->getKeymap(kKeymapName) != 0)
|
||||
return;
|
||||
|
||||
Common::Action *act;
|
||||
|
@ -103,11 +103,10 @@ GuiManager::~GuiManager() {
|
||||
void GuiManager::initKeymap() {
|
||||
using namespace Common;
|
||||
|
||||
bool tmp;
|
||||
Keymapper *mapper = _system->getEventManager()->getKeymapper();
|
||||
|
||||
// Do not try to recreate same keymap over again
|
||||
if (mapper->getKeymap(kGuiKeymapName, tmp) != 0)
|
||||
if (mapper->getKeymap(kGuiKeymapName) != 0)
|
||||
return;
|
||||
|
||||
Action *act;
|
||||
|
Loading…
x
Reference in New Issue
Block a user