mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-26 05:34:08 -04:00
Get rid of useless return values
This commit is contained in:
parent
90f6cda4cc
commit
439018e706
@ -452,7 +452,7 @@ namespace MWInput
|
|||||||
mInputBinder->adjustMouseRegion(width, height);
|
mInputBinder->adjustMouseRegion(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::keyPressed( const SDL_KeyboardEvent &arg )
|
void InputManager::keyPressed( const SDL_KeyboardEvent &arg )
|
||||||
{
|
{
|
||||||
// Cut, copy & paste
|
// Cut, copy & paste
|
||||||
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||||
@ -498,7 +498,6 @@ namespace MWInput
|
|||||||
|
|
||||||
if (kc != OIS::KC_UNASSIGNED)
|
if (kc != OIS::KC_UNASSIGNED)
|
||||||
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(kc), 0);
|
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::Enum(kc), 0);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::textInput(const SDL_TextInputEvent &arg)
|
void InputManager::textInput(const SDL_TextInputEvent &arg)
|
||||||
@ -509,23 +508,21 @@ namespace MWInput
|
|||||||
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::None, *it);
|
MyGUI::InputManager::getInstance().injectKeyPress(MyGUI::KeyCode::None, *it);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::keyReleased(const SDL_KeyboardEvent &arg )
|
void InputManager::keyReleased(const SDL_KeyboardEvent &arg )
|
||||||
{
|
{
|
||||||
mInputBinder->keyReleased (arg);
|
mInputBinder->keyReleased (arg);
|
||||||
|
|
||||||
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
||||||
|
|
||||||
MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::Enum(kc));
|
MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::Enum(kc));
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id )
|
void InputManager::mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id )
|
||||||
{
|
{
|
||||||
mInputBinder->mousePressed (arg, id);
|
mInputBinder->mousePressed (arg, id);
|
||||||
|
|
||||||
if (id != SDL_BUTTON_LEFT && id != SDL_BUTTON_RIGHT)
|
if (id != SDL_BUTTON_LEFT && id != SDL_BUTTON_RIGHT)
|
||||||
return true; // MyGUI has no use for these events
|
return; // MyGUI has no use for these events
|
||||||
|
|
||||||
MyGUI::InputManager::getInstance().injectMousePress(mMouseX, mMouseY, sdlButtonToMyGUI(id));
|
MyGUI::InputManager::getInstance().injectMousePress(mMouseX, mMouseY, sdlButtonToMyGUI(id));
|
||||||
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
||||||
@ -536,20 +533,16 @@ namespace MWInput
|
|||||||
MWBase::Environment::get().getSoundManager ()->playSound ("Menu Click", 1.f, 1.f);
|
MWBase::Environment::get().getSoundManager ()->playSound ("Menu Click", 1.f, 1.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id )
|
void InputManager::mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id )
|
||||||
{
|
{
|
||||||
mInputBinder->mouseReleased (arg, id);
|
mInputBinder->mouseReleased (arg, id);
|
||||||
|
|
||||||
MyGUI::InputManager::getInstance().injectMouseRelease(mMouseX, mMouseY, sdlButtonToMyGUI(id));
|
MyGUI::InputManager::getInstance().injectMouseRelease(mMouseX, mMouseY, sdlButtonToMyGUI(id));
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::mouseMoved(const SFO::MouseMotionEvent &arg )
|
void InputManager::mouseMoved(const SFO::MouseMotionEvent &arg )
|
||||||
{
|
{
|
||||||
mInputBinder->mouseMoved (arg);
|
mInputBinder->mouseMoved (arg);
|
||||||
|
|
||||||
@ -597,8 +590,6 @@ namespace MWInput
|
|||||||
MWBase::Environment::get().getWorld()->setCameraDistance(arg.zrel, true, true);
|
MWBase::Environment::get().getWorld()->setCameraDistance(arg.zrel, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::windowFocusChange(bool have_focus)
|
void InputManager::windowFocusChange(bool have_focus)
|
||||||
|
@ -86,13 +86,13 @@ namespace MWInput
|
|||||||
virtual void resetToDefaultBindings();
|
virtual void resetToDefaultBindings();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool keyPressed(const SDL_KeyboardEvent &arg );
|
virtual void keyPressed(const SDL_KeyboardEvent &arg );
|
||||||
virtual bool keyReleased( const SDL_KeyboardEvent &arg );
|
virtual void keyReleased( const SDL_KeyboardEvent &arg );
|
||||||
virtual void textInput (const SDL_TextInputEvent &arg);
|
virtual void textInput (const SDL_TextInputEvent &arg);
|
||||||
|
|
||||||
virtual bool mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id );
|
virtual void mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id );
|
||||||
virtual bool mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id );
|
virtual void mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id );
|
||||||
virtual bool mouseMoved( const SFO::MouseMotionEvent &arg );
|
virtual void mouseMoved( const SFO::MouseMotionEvent &arg );
|
||||||
|
|
||||||
virtual void windowVisibilityChange( bool visible );
|
virtual void windowVisibilityChange( bool visible );
|
||||||
virtual void windowFocusChange( bool have_focus );
|
virtual void windowFocusChange( bool have_focus );
|
||||||
|
18
extern/oics/ICSInputControlSystem.h
vendored
18
extern/oics/ICSInputControlSystem.h
vendored
@ -102,19 +102,19 @@ namespace ICS
|
|||||||
JoystickIDList& getJoystickIdList(){ return mJoystickIDList; };
|
JoystickIDList& getJoystickIdList(){ return mJoystickIDList; };
|
||||||
|
|
||||||
// MouseListener
|
// MouseListener
|
||||||
bool mouseMoved(const SFO::MouseMotionEvent &evt);
|
void mouseMoved(const SFO::MouseMotionEvent &evt);
|
||||||
bool mousePressed(const SDL_MouseButtonEvent &evt, Uint8);
|
void mousePressed(const SDL_MouseButtonEvent &evt, Uint8);
|
||||||
bool mouseReleased(const SDL_MouseButtonEvent &evt, Uint8);
|
void mouseReleased(const SDL_MouseButtonEvent &evt, Uint8);
|
||||||
|
|
||||||
// KeyListener
|
// KeyListener
|
||||||
bool keyPressed(const SDL_KeyboardEvent &evt);
|
void keyPressed(const SDL_KeyboardEvent &evt);
|
||||||
bool keyReleased(const SDL_KeyboardEvent &evt);
|
void keyReleased(const SDL_KeyboardEvent &evt);
|
||||||
|
|
||||||
// JoyStickListener
|
// JoyStickListener
|
||||||
bool buttonPressed(const SDL_JoyButtonEvent &evt, int button);
|
void buttonPressed(const SDL_JoyButtonEvent &evt, int button);
|
||||||
bool buttonReleased(const SDL_JoyButtonEvent &evt, int button);
|
void buttonReleased(const SDL_JoyButtonEvent &evt, int button);
|
||||||
bool axisMoved(const SDL_JoyAxisEvent &evt, int axis);
|
void axisMoved(const SDL_JoyAxisEvent &evt, int axis);
|
||||||
bool povMoved(const SDL_JoyHatEvent &evt, int index);
|
void povMoved(const SDL_JoyHatEvent &evt, int index);
|
||||||
//TODO: does this have an SDL equivalent?
|
//TODO: does this have an SDL equivalent?
|
||||||
//bool sliderMoved(const OIS::JoyStickEvent &evt, int index);
|
//bool sliderMoved(const OIS::JoyStickEvent &evt, int index);
|
||||||
|
|
||||||
|
19
extern/oics/ICSInputControlSystem_joystick.cpp
vendored
19
extern/oics/ICSInputControlSystem_joystick.cpp
vendored
@ -318,7 +318,7 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// joyStick listeners
|
// joyStick listeners
|
||||||
bool InputControlSystem::buttonPressed(const SDL_JoyButtonEvent &evt, int button)
|
void InputControlSystem::buttonPressed(const SDL_JoyButtonEvent &evt, int button)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -354,11 +354,9 @@ namespace ICS
|
|||||||
mDetectingBindingControl, evt.which, button, mDetectingBindingDirection);
|
mDetectingBindingControl, evt.which, button, mDetectingBindingDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputControlSystem::buttonReleased(const SDL_JoyButtonEvent &evt, int button)
|
void InputControlSystem::buttonReleased(const SDL_JoyButtonEvent &evt, int button)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -371,10 +369,9 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputControlSystem::axisMoved(const SDL_JoyAxisEvent &evt, int axis)
|
void InputControlSystem::axisMoved(const SDL_JoyAxisEvent &evt, int axis)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -417,12 +414,10 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Here be dragons, apparently
|
//Here be dragons, apparently
|
||||||
bool InputControlSystem::povMoved(const SDL_JoyHatEvent &evt, int index)
|
void InputControlSystem::povMoved(const SDL_JoyHatEvent &evt, int index)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -542,13 +537,11 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: does this have an SDL equivalent?
|
//TODO: does this have an SDL equivalent?
|
||||||
/*
|
/*
|
||||||
bool InputControlSystem::sliderMoved(const OIS::JoyStickEvent &evt, int index)
|
void InputControlSystem::sliderMoved(const OIS::JoyStickEvent &evt, int index)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -590,8 +583,6 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
10
extern/oics/ICSInputControlSystem_keyboard.cpp
vendored
10
extern/oics/ICSInputControlSystem_keyboard.cpp
vendored
@ -85,7 +85,7 @@ namespace ICS
|
|||||||
|
|
||||||
return SDLK_UNKNOWN;
|
return SDLK_UNKNOWN;
|
||||||
}
|
}
|
||||||
bool InputControlSystem::keyPressed(const SDL_KeyboardEvent &evt)
|
void InputControlSystem::keyPressed(const SDL_KeyboardEvent &evt)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -118,11 +118,9 @@ namespace ICS
|
|||||||
mDetectingBindingControl, evt.keysym.sym, mDetectingBindingDirection);
|
mDetectingBindingControl, evt.keysym.sym, mDetectingBindingDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool InputControlSystem::keyReleased(const SDL_KeyboardEvent &evt)
|
void InputControlSystem::keyReleased(const SDL_KeyboardEvent &evt)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -132,8 +130,6 @@ namespace ICS
|
|||||||
it->second.control->setChangingDirection(Control::STOP);
|
it->second.control->setChangingDirection(Control::STOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectingBindingListener::keyBindingDetected(InputControlSystem* ICS, Control* control
|
void DetectingBindingListener::keyBindingDetected(InputControlSystem* ICS, Control* control
|
||||||
|
12
extern/oics/ICSInputControlSystem_mouse.cpp
vendored
12
extern/oics/ICSInputControlSystem_mouse.cpp
vendored
@ -219,7 +219,7 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// mouse Listeners
|
// mouse Listeners
|
||||||
bool InputControlSystem::mouseMoved(const SFO::MouseMotionEvent& evt)
|
void InputControlSystem::mouseMoved(const SFO::MouseMotionEvent& evt)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -304,11 +304,9 @@ namespace ICS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputControlSystem::mousePressed(const SDL_MouseButtonEvent &evt, Uint8 btn)
|
void InputControlSystem::mousePressed(const SDL_MouseButtonEvent &evt, Uint8 btn)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -341,11 +339,9 @@ namespace ICS
|
|||||||
mDetectingBindingControl, btn, mDetectingBindingDirection);
|
mDetectingBindingControl, btn, mDetectingBindingDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputControlSystem::mouseReleased(const SDL_MouseButtonEvent &evt, Uint8 btn)
|
void InputControlSystem::mouseReleased(const SDL_MouseButtonEvent &evt, Uint8 btn)
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
{
|
{
|
||||||
@ -355,8 +351,6 @@ namespace ICS
|
|||||||
it->second.control->setChangingDirection(Control::STOP);
|
it->second.control->setChangingDirection(Control::STOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// mouse auto bindings
|
// mouse auto bindings
|
||||||
|
18
extern/sdl4ogre/events.h
vendored
18
extern/sdl4ogre/events.h
vendored
@ -26,9 +26,9 @@ class MouseListener
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~MouseListener() {}
|
virtual ~MouseListener() {}
|
||||||
virtual bool mouseMoved( const MouseMotionEvent &arg ) = 0;
|
virtual void mouseMoved( const MouseMotionEvent &arg ) = 0;
|
||||||
virtual bool mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
|
virtual void mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
|
||||||
virtual bool mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
|
virtual void mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KeyListener
|
class KeyListener
|
||||||
@ -36,8 +36,8 @@ class KeyListener
|
|||||||
public:
|
public:
|
||||||
virtual ~KeyListener() {}
|
virtual ~KeyListener() {}
|
||||||
virtual void textInput (const SDL_TextInputEvent& arg) {}
|
virtual void textInput (const SDL_TextInputEvent& arg) {}
|
||||||
virtual bool keyPressed(const SDL_KeyboardEvent &arg) = 0;
|
virtual void keyPressed(const SDL_KeyboardEvent &arg) = 0;
|
||||||
virtual bool keyReleased(const SDL_KeyboardEvent &arg) = 0;
|
virtual void keyReleased(const SDL_KeyboardEvent &arg) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class JoyListener
|
class JoyListener
|
||||||
@ -45,18 +45,18 @@ class JoyListener
|
|||||||
public:
|
public:
|
||||||
virtual ~JoyListener() {}
|
virtual ~JoyListener() {}
|
||||||
/** @remarks Joystick button down event */
|
/** @remarks Joystick button down event */
|
||||||
virtual bool buttonPressed( const SDL_JoyButtonEvent &evt, int button ) = 0;
|
virtual void buttonPressed( const SDL_JoyButtonEvent &evt, int button ) = 0;
|
||||||
|
|
||||||
/** @remarks Joystick button up event */
|
/** @remarks Joystick button up event */
|
||||||
virtual bool buttonReleased( const SDL_JoyButtonEvent &evt, int button ) = 0;
|
virtual void buttonReleased( const SDL_JoyButtonEvent &evt, int button ) = 0;
|
||||||
|
|
||||||
/** @remarks Joystick axis moved event */
|
/** @remarks Joystick axis moved event */
|
||||||
virtual bool axisMoved( const SDL_JoyAxisEvent &arg, int axis ) = 0;
|
virtual void axisMoved( const SDL_JoyAxisEvent &arg, int axis ) = 0;
|
||||||
|
|
||||||
//-- Not so common control events, so are not required --//
|
//-- Not so common control events, so are not required --//
|
||||||
|
|
||||||
//! Joystick Event, and povID
|
//! Joystick Event, and povID
|
||||||
virtual bool povMoved( const SDL_JoyHatEvent &arg, int index) {return true;}
|
virtual void povMoved( const SDL_JoyHatEvent &arg, int index) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class WindowListener
|
class WindowListener
|
||||||
|
Loading…
x
Reference in New Issue
Block a user