mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 13:06:39 +00:00
Rename misleading mInputManager variable
This commit is contained in:
parent
e353647d15
commit
c368250e6a
2 changed files with 18 additions and 19 deletions
|
@ -47,7 +47,7 @@ namespace MWInput
|
||||||
const std::string& controllerBindingsFile, bool grab)
|
const std::string& controllerBindingsFile, bool grab)
|
||||||
: mWindow(window)
|
: mWindow(window)
|
||||||
, mWindowVisible(true)
|
, mWindowVisible(true)
|
||||||
, mInputManager(nullptr)
|
, mInputWrapper(nullptr)
|
||||||
, mVideoWrapper(nullptr)
|
, mVideoWrapper(nullptr)
|
||||||
, mUserFile(userFile)
|
, mUserFile(userFile)
|
||||||
, mDragDrop(false)
|
, mDragDrop(false)
|
||||||
|
@ -61,9 +61,9 @@ namespace MWInput
|
||||||
, mAttemptJump(false)
|
, mAttemptJump(false)
|
||||||
, mFakeDeviceID(1)
|
, mFakeDeviceID(1)
|
||||||
{
|
{
|
||||||
mInputManager = new SDLUtil::InputWrapper(window, viewer, grab);
|
mInputWrapper = new SDLUtil::InputWrapper(window, viewer, grab);
|
||||||
mInputManager->setKeyboardEventCallback (this);
|
mInputWrapper->setKeyboardEventCallback (this);
|
||||||
mInputManager->setWindowEventCallback(this);
|
mInputWrapper->setWindowEventCallback(this);
|
||||||
|
|
||||||
mVideoWrapper = new SDLUtil::VideoWrapper(window, viewer);
|
mVideoWrapper = new SDLUtil::VideoWrapper(window, viewer);
|
||||||
mVideoWrapper->setGammaContrast(Settings::Manager::getFloat("gamma", "Video"),
|
mVideoWrapper->setGammaContrast(Settings::Manager::getFloat("gamma", "Video"),
|
||||||
|
@ -90,14 +90,14 @@ namespace MWInput
|
||||||
|
|
||||||
mActionManager = new ActionManager(mInputBinder, screenCaptureOperation, viewer, screenCaptureHandler);
|
mActionManager = new ActionManager(mInputBinder, screenCaptureOperation, viewer, screenCaptureHandler);
|
||||||
|
|
||||||
mMouseManager = new MouseManager(mInputBinder, mInputManager, window);
|
mMouseManager = new MouseManager(mInputBinder, mInputWrapper, window);
|
||||||
mInputManager->setMouseEventCallback (mMouseManager);
|
mInputWrapper->setMouseEventCallback (mMouseManager);
|
||||||
|
|
||||||
mControllerManager = new ControllerManager(mInputBinder, mInputManager, mActionManager, mMouseManager, userControllerBindingsFile, controllerBindingsFile);
|
mControllerManager = new ControllerManager(mInputBinder, mInputWrapper, mActionManager, mMouseManager, userControllerBindingsFile, controllerBindingsFile);
|
||||||
mInputManager->setControllerEventCallback(mControllerManager);
|
mInputWrapper->setControllerEventCallback(mControllerManager);
|
||||||
|
|
||||||
mSensorManager = new SensorManager();
|
mSensorManager = new SensorManager();
|
||||||
mInputManager->setSensorEventCallback (mSensorManager);
|
mInputWrapper->setSensorEventCallback (mSensorManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::clear()
|
void InputManager::clear()
|
||||||
|
@ -123,8 +123,7 @@ namespace MWInput
|
||||||
|
|
||||||
delete mInputBinder;
|
delete mInputBinder;
|
||||||
|
|
||||||
delete mInputManager;
|
delete mInputWrapper;
|
||||||
|
|
||||||
delete mVideoWrapper;
|
delete mVideoWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,15 +216,15 @@ namespace MWInput
|
||||||
bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
|
bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
|
||||||
&& !MWBase::Environment::get().getWindowManager()->isConsoleMode();
|
&& !MWBase::Environment::get().getWindowManager()->isConsoleMode();
|
||||||
|
|
||||||
bool was_relative = mInputManager->getMouseRelative();
|
bool was_relative = mInputWrapper->getMouseRelative();
|
||||||
bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode();
|
bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
|
|
||||||
// don't keep the pointer away from the window edge in gui mode
|
// don't keep the pointer away from the window edge in gui mode
|
||||||
// stop using raw mouse motions and switch to system cursor movements
|
// stop using raw mouse motions and switch to system cursor movements
|
||||||
mInputManager->setMouseRelative(is_relative);
|
mInputWrapper->setMouseRelative(is_relative);
|
||||||
|
|
||||||
//we let the mouse escape in the main menu
|
//we let the mouse escape in the main menu
|
||||||
mInputManager->setGrabPointer(grab && (mGrabCursor || is_relative));
|
mInputWrapper->setGrabPointer(grab && (mGrabCursor || is_relative));
|
||||||
|
|
||||||
//we switched to non-relative mode, move our cursor to where the in-game
|
//we switched to non-relative mode, move our cursor to where the in-game
|
||||||
//cursor is
|
//cursor is
|
||||||
|
@ -239,9 +238,9 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
mControlsDisabled = disableControls;
|
mControlsDisabled = disableControls;
|
||||||
|
|
||||||
mInputManager->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
mInputWrapper->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
||||||
|
|
||||||
mInputManager->capture(disableEvents);
|
mInputWrapper->capture(disableEvents);
|
||||||
|
|
||||||
if (mControlsDisabled)
|
if (mControlsDisabled)
|
||||||
{
|
{
|
||||||
|
@ -472,7 +471,7 @@ namespace MWInput
|
||||||
// HACK: to make Morrowind's default keybinding for the console work without printing an extra "^" upon closing
|
// HACK: to make Morrowind's default keybinding for the console work without printing an extra "^" upon closing
|
||||||
// This assumes that SDL_TextInput events always come *after* the key event
|
// This assumes that SDL_TextInput events always come *after* the key event
|
||||||
// (which is somewhat reasonable, and hopefully true for all SDL platforms)
|
// (which is somewhat reasonable, and hopefully true for all SDL platforms)
|
||||||
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
OIS::KeyCode kc = mInputWrapper->sdl2OISKeyCode(arg.keysym.sym);
|
||||||
if (mInputBinder->getKeyBinding(mInputBinder->getControl(A_Console), ICS::Control::INCREASE)
|
if (mInputBinder->getKeyBinding(mInputBinder->getControl(A_Console), ICS::Control::INCREASE)
|
||||||
== arg.keysym.scancode
|
== arg.keysym.scancode
|
||||||
&& MWBase::Environment::get().getWindowManager()->isConsoleMode())
|
&& MWBase::Environment::get().getWindowManager()->isConsoleMode())
|
||||||
|
@ -506,7 +505,7 @@ namespace MWInput
|
||||||
void InputManager::keyReleased(const SDL_KeyboardEvent &arg )
|
void InputManager::keyReleased(const SDL_KeyboardEvent &arg )
|
||||||
{
|
{
|
||||||
mControllerManager->setJoystickLastUsed(false);
|
mControllerManager->setJoystickLastUsed(false);
|
||||||
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
OIS::KeyCode kc = mInputWrapper->sdl2OISKeyCode(arg.keysym.sym);
|
||||||
|
|
||||||
if (!mInputBinder->detectingBindingState())
|
if (!mInputBinder->detectingBindingState())
|
||||||
setPlayerControlsEnabled(!MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::Enum(kc)));
|
setPlayerControlsEnabled(!MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::Enum(kc)));
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace MWInput
|
||||||
|
|
||||||
ICS::InputControlSystem* mInputBinder;
|
ICS::InputControlSystem* mInputBinder;
|
||||||
|
|
||||||
SDLUtil::InputWrapper* mInputManager;
|
SDLUtil::InputWrapper* mInputWrapper;
|
||||||
SDLUtil::VideoWrapper* mVideoWrapper;
|
SDLUtil::VideoWrapper* mVideoWrapper;
|
||||||
|
|
||||||
std::string mUserFile;
|
std::string mUserFile;
|
||||||
|
|
Loading…
Reference in a new issue