mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-16 17:42:31 +00:00
Merge branch 'controller-bindings' into 'master'
Allow user controller bindings See merge request OpenMW/openmw!135
This commit is contained in:
commit
793016f163
@ -22,6 +22,7 @@ Programmers
|
|||||||
alexanderkjall
|
alexanderkjall
|
||||||
Alexander Nadeau (wareya)
|
Alexander Nadeau (wareya)
|
||||||
Alexander Olofsson (Ace)
|
Alexander Olofsson (Ace)
|
||||||
|
Alex Rice
|
||||||
Alex S (docwest)
|
Alex S (docwest)
|
||||||
Allofich
|
Allofich
|
||||||
Andrei Kortunov (akortunov)
|
Andrei Kortunov (akortunov)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons
|
Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons
|
||||||
Bug #4411: Reloading a saved game while falling prevents damage in some cases
|
Bug #4411: Reloading a saved game while falling prevents damage in some cases
|
||||||
Bug #4540: Rain delay when exiting water
|
Bug #4540: Rain delay when exiting water
|
||||||
Bug #4600: Crash when no sound output is available or --no-sound is used.
|
Bug #4600: Crash when no sound output is available or --no-sound is used.
|
||||||
Bug #4639: Black screen after completing first mages guild mission + training
|
Bug #4639: Black screen after completing first mages guild mission + training
|
||||||
Bug #4701: PrisonMarker record is not hardcoded like other markers
|
Bug #4701: PrisonMarker record is not hardcoded like other markers
|
||||||
Bug #4703: Editor: it's possible to preview levelled list records
|
Bug #4703: Editor: it's possible to preview levelled list records
|
||||||
@ -153,6 +153,7 @@
|
|||||||
Feature #5046: Gamepad thumbstick cursor speed
|
Feature #5046: Gamepad thumbstick cursor speed
|
||||||
Feature #5051: Provide a separate textures for scrollbars
|
Feature #5051: Provide a separate textures for scrollbars
|
||||||
Feature #5094: Unix like console hotkeys
|
Feature #5094: Unix like console hotkeys
|
||||||
|
Feature #5098: Allow user controller bindings
|
||||||
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
||||||
Task #4695: Optimize Distant Terrain memory consumption
|
Task #4695: Optimize Distant Terrain memory consumption
|
||||||
Task #4789: Optimize cell transitions
|
Task #4789: Optimize cell transitions
|
||||||
|
@ -515,8 +515,17 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||||||
controllerFileName = "gamecontrollerdb.txt";
|
controllerFileName = "gamecontrollerdb.txt";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string userdefault = mCfgMgr.getUserConfigPath().string() + "/" + controllerFileName;
|
||||||
const std::string localdefault = mCfgMgr.getLocalPath().string() + "/" + controllerFileName;
|
const std::string localdefault = mCfgMgr.getLocalPath().string() + "/" + controllerFileName;
|
||||||
const std::string globaldefault = mCfgMgr.getGlobalPath().string() + "/" + controllerFileName;
|
const std::string globaldefault = mCfgMgr.getGlobalPath().string() + "/" + controllerFileName;
|
||||||
|
|
||||||
|
std::string userGameControllerdb;
|
||||||
|
if (boost::filesystem::exists(userdefault)){
|
||||||
|
userGameControllerdb = userdefault;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
userGameControllerdb = "";
|
||||||
|
|
||||||
std::string gameControllerdb;
|
std::string gameControllerdb;
|
||||||
if (boost::filesystem::exists(localdefault))
|
if (boost::filesystem::exists(localdefault))
|
||||||
gameControllerdb = localdefault;
|
gameControllerdb = localdefault;
|
||||||
@ -525,7 +534,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||||||
else
|
else
|
||||||
gameControllerdb = ""; //if it doesn't exist, pass in an empty string
|
gameControllerdb = ""; //if it doesn't exist, pass in an empty string
|
||||||
|
|
||||||
MWInput::InputManager* input = new MWInput::InputManager (mWindow, mViewer, mScreenCaptureHandler, mScreenCaptureOperation, keybinderUser, keybinderUserExists, gameControllerdb, mGrab);
|
MWInput::InputManager* input = new MWInput::InputManager (mWindow, mViewer, mScreenCaptureHandler, mScreenCaptureOperation, keybinderUser, keybinderUserExists, userGameControllerdb, gameControllerdb, mGrab);
|
||||||
mEnvironment.setInputManager (input);
|
mEnvironment.setInputManager (input);
|
||||||
|
|
||||||
std::string myguiResources = (mResDir / "mygui").string();
|
std::string myguiResources = (mResDir / "mygui").string();
|
||||||
|
@ -39,6 +39,7 @@ namespace MWInput
|
|||||||
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler,
|
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler,
|
||||||
osgViewer::ScreenCaptureHandler::CaptureOperation *screenCaptureOperation,
|
osgViewer::ScreenCaptureHandler::CaptureOperation *screenCaptureOperation,
|
||||||
const std::string& userFile, bool userFileExists,
|
const std::string& userFile, bool userFileExists,
|
||||||
|
const std::string& userControllerBindingsFile,
|
||||||
const std::string& controllerBindingsFile, bool grab)
|
const std::string& controllerBindingsFile, bool grab)
|
||||||
: mWindow(window)
|
: mWindow(window)
|
||||||
, mWindowVisible(true)
|
, mWindowVisible(true)
|
||||||
@ -113,10 +114,14 @@ namespace MWInput
|
|||||||
|
|
||||||
// Load controller mappings
|
// Load controller mappings
|
||||||
#if SDL_VERSION_ATLEAST(2,0,2)
|
#if SDL_VERSION_ATLEAST(2,0,2)
|
||||||
if(controllerBindingsFile!="")
|
if(!controllerBindingsFile.empty())
|
||||||
{
|
{
|
||||||
SDL_GameControllerAddMappingsFromFile(controllerBindingsFile.c_str());
|
SDL_GameControllerAddMappingsFromFile(controllerBindingsFile.c_str());
|
||||||
}
|
}
|
||||||
|
if(!userControllerBindingsFile.empty())
|
||||||
|
{
|
||||||
|
SDL_GameControllerAddMappingsFromFile(userControllerBindingsFile.c_str());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Open all presently connected sticks
|
// Open all presently connected sticks
|
||||||
|
@ -76,6 +76,7 @@ namespace MWInput
|
|||||||
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler,
|
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler,
|
||||||
osgViewer::ScreenCaptureHandler::CaptureOperation *screenCaptureOperation,
|
osgViewer::ScreenCaptureHandler::CaptureOperation *screenCaptureOperation,
|
||||||
const std::string& userFile, bool userFileExists,
|
const std::string& userFile, bool userFileExists,
|
||||||
|
const std::string& userControllerBindingsFile,
|
||||||
const std::string& controllerBindingsFile, bool grab);
|
const std::string& controllerBindingsFile, bool grab);
|
||||||
|
|
||||||
virtual ~InputManager();
|
virtual ~InputManager();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user