mirror of https://github.com/stella-emu/stella.git
rename some variables
This commit is contained in:
parent
b47234f776
commit
9f51b8caa0
|
@ -168,8 +168,8 @@ class EventHandler
|
|||
Event::Type eventForJoyButton(EventMode mode, int stick, int button) const {
|
||||
return myPJoyHandler->eventForButton(mode, stick, button);
|
||||
}
|
||||
Event::Type eventForJoyHat(EventMode mode, int stick, int hat, JoyHatDir value, int button) const {
|
||||
return myPJoyHandler->eventForHat(mode, stick, hat, value, button);
|
||||
Event::Type eventForJoyHat(EventMode mode, int stick, int hat, JoyHatDir hdir, int button) const {
|
||||
return myPJoyHandler->eventForHat(mode, stick, hat, hdir, button);
|
||||
}
|
||||
|
||||
/** Get description of given event and mode. */
|
||||
|
|
|
@ -299,9 +299,9 @@ void ContextMenu::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool ContextMenu::handleJoyHat(int stick, int hat, JoyHatDir value, int button)
|
||||
bool ContextMenu::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button)
|
||||
{
|
||||
handleEvent(instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, value, button));
|
||||
handleEvent(instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, hdir, button));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class ContextMenu : public Dialog, public CommandSender
|
|||
void handleKeyDown(StellaKey key, StellaMod mod, bool repeated) override;
|
||||
void handleJoyDown(int stick, int button, bool longPress) override;
|
||||
void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button) override;
|
||||
bool handleJoyHat(int stick, int hat, JoyHatDir value, int button) override;
|
||||
bool handleJoyHat(int stick, int hat, JoyHatDir vahdirlue, int button) override;
|
||||
void handleEvent(Event::Type e);
|
||||
|
||||
void drawDialog() override;
|
||||
|
|
|
@ -635,17 +635,17 @@ void Dialog::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool Dialog::handleJoyHat(int stick, int hat, JoyHatDir value, int button)
|
||||
bool Dialog::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button)
|
||||
{
|
||||
Event::Type e =
|
||||
instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, value, button);
|
||||
instance().eventHandler().eventForJoyHat(EventMode::kMenuMode, stick, hat, hdir, button);
|
||||
|
||||
// Unless a widget has claimed all responsibility for data, we assume
|
||||
// that if an event exists for the given data, it should have priority.
|
||||
if(!handleNavEvent(e) && _focusedWidget)
|
||||
{
|
||||
if(_focusedWidget->wantsRaw() || e == Event::NoType)
|
||||
return _focusedWidget->handleJoyHat(stick, hat, value, button);
|
||||
return _focusedWidget->handleJoyHat(stick, hat, hdir, button);
|
||||
else
|
||||
return _focusedWidget->handleEvent(e);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class Dialog : public GuiObject
|
|||
virtual void handleJoyDown(int stick, int button, bool longPress = false);
|
||||
virtual void handleJoyUp(int stick, int button);
|
||||
virtual void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button = JOY_CTRL_NONE);
|
||||
virtual bool handleJoyHat(int stick, int hat, JoyHatDir value, int button = JOY_CTRL_NONE);
|
||||
virtual bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button = JOY_CTRL_NONE);
|
||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||
virtual Event::Type getJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, int button);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void DialogContainer::updateTime(uInt64 time)
|
|||
if(myCurrentHatDown.stick != -1 && myHatRepeatTime < myTime)
|
||||
{
|
||||
activeDialog->handleJoyHat(myCurrentHatDown.stick, myCurrentHatDown.hat,
|
||||
myCurrentHatDown.value);
|
||||
myCurrentHatDown.hdir);
|
||||
myHatRepeatTime = myTime + _REPEAT_SUSTAIN_DELAY;
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ void DialogContainer::handleJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, i
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir value, int button)
|
||||
void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int button)
|
||||
{
|
||||
if(myDialogStack.empty())
|
||||
return;
|
||||
|
@ -355,20 +355,20 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir value, int
|
|||
myButtonLongPressTime = myTime + _REPEAT_NONE;
|
||||
|
||||
// Only stop firing events if it's the current stick
|
||||
if(myCurrentHatDown.stick == stick && value == JoyHatDir::CENTER)
|
||||
if(myCurrentHatDown.stick == stick && hdir == JoyHatDir::CENTER)
|
||||
{
|
||||
myCurrentHatDown.stick = myCurrentHatDown.hat = -1;
|
||||
myHatRepeatTime = 0;
|
||||
}
|
||||
else if(value != JoyHatDir::CENTER && myHatRepeatTime < myTime) // never repeat the 'center' direction; prevent pending repeats after enabling repeat again
|
||||
else if(hdir != JoyHatDir::CENTER && myHatRepeatTime < myTime) // never repeat the 'center' direction; prevent pending repeats after enabling repeat again
|
||||
{
|
||||
// Now account for repeated hat events (press and hold)
|
||||
myCurrentHatDown.stick = stick;
|
||||
myCurrentHatDown.hat = hat;
|
||||
myCurrentHatDown.value = value;
|
||||
myCurrentHatDown.hdir = hdir;
|
||||
myHatRepeatTime = myTime + (activeDialog->repeatEnabled() ? _REPEAT_INITIAL_DELAY : _REPEAT_NONE);
|
||||
}
|
||||
activeDialog->handleJoyHat(stick, hat, value, button);
|
||||
activeDialog->handleJoyHat(stick, hat, hdir, button);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -115,9 +115,9 @@ class DialogContainer
|
|||
|
||||
@param stick The joystick number
|
||||
@param hat The joystick hat
|
||||
@param value Value associated with given hat
|
||||
@param hdir Direction of the with given hat
|
||||
*/
|
||||
void handleJoyHatEvent(int stick, int hat, JoyHatDir value, int button);
|
||||
void handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int button);
|
||||
|
||||
/**
|
||||
Draw the stack of menus (full indicates to redraw all items).
|
||||
|
@ -217,7 +217,7 @@ class DialogContainer
|
|||
struct {
|
||||
int stick;
|
||||
int hat;
|
||||
JoyHatDir value;
|
||||
JoyHatDir hdir;
|
||||
} myCurrentHatDown;
|
||||
uInt64 myHatRepeatTime;
|
||||
|
||||
|
|
|
@ -511,15 +511,15 @@ void InputDialog::handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool InputDialog::handleJoyHat(int stick, int hat, JoyHatDir value, int button)
|
||||
bool InputDialog::handleJoyHat(int stick, int hat, JoyHatDir hdir, int button)
|
||||
{
|
||||
// Remap joystick hat in remap mode, otherwise pass to parent dialog
|
||||
if(myEmulEventMapper->remapMode())
|
||||
return myEmulEventMapper->handleJoyHat(stick, hat, value, button);
|
||||
return myEmulEventMapper->handleJoyHat(stick, hat, hdir, button);
|
||||
else if(myMenuEventMapper->remapMode())
|
||||
return myMenuEventMapper->handleJoyHat(stick, hat, value, button);
|
||||
return myMenuEventMapper->handleJoyHat(stick, hat, hdir, button);
|
||||
else
|
||||
return Dialog::handleJoyHat(stick, hat, value, button);
|
||||
return Dialog::handleJoyHat(stick, hat, hdir, button);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -52,7 +52,7 @@ class InputDialog : public Dialog
|
|||
void handleJoyDown(int stick, int button, bool longPress) override;
|
||||
void handleJoyUp(int stick, int button) override;
|
||||
void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button) override;
|
||||
bool handleJoyHat(int stick, int hat, JoyHatDir value, int button) override;
|
||||
bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button) override;
|
||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||
|
||||
void loadConfig() override;
|
||||
|
|
|
@ -80,7 +80,7 @@ class Widget : public GuiObject
|
|||
virtual void handleJoyDown(int stick, int button, bool longPress = false) { }
|
||||
virtual void handleJoyUp(int stick, int button) { }
|
||||
virtual void handleJoyAxis(int stick, JoyAxis axis, JoyDir adir, int button = JOY_CTRL_NONE) { }
|
||||
virtual bool handleJoyHat(int stick, int hat, JoyHatDir value, int button = JOY_CTRL_NONE) { return false; }
|
||||
virtual bool handleJoyHat(int stick, int hat, JoyHatDir hdir, int button = JOY_CTRL_NONE) { return false; }
|
||||
virtual bool handleEvent(Event::Type event) { return false; }
|
||||
|
||||
void setDirty() override;
|
||||
|
|
Loading…
Reference in New Issue