forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'scrawl/sdl_input2'
This commit is contained in:
commit
b5926257f5
8 changed files with 21 additions and 56 deletions
|
@ -133,7 +133,6 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
|
||||||
OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
||||||
: mOgre (0)
|
: mOgre (0)
|
||||||
, mFpsLevel(0)
|
, mFpsLevel(0)
|
||||||
, mDebug (false)
|
|
||||||
, mVerboseScripts (false)
|
, mVerboseScripts (false)
|
||||||
, mNewGame (false)
|
, mNewGame (false)
|
||||||
, mUseSound (true)
|
, mUseSound (true)
|
||||||
|
@ -283,11 +282,6 @@ void OMW::Engine::addPlugin (const std::string& plugin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OMW::Engine::setDebugMode(bool debugMode)
|
|
||||||
{
|
|
||||||
mDebug = debugMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OMW::Engine::setScriptsVerbosity(bool scriptsVerbosity)
|
void OMW::Engine::setScriptsVerbosity(bool scriptsVerbosity)
|
||||||
{
|
{
|
||||||
mVerboseScripts = scriptsVerbosity;
|
mVerboseScripts = scriptsVerbosity;
|
||||||
|
@ -331,7 +325,6 @@ std::string OMW::Engine::loadSettings (Settings::Manager & settings)
|
||||||
nifOverrides.loadTransparencyOverrides(mCfgMgr.getGlobalPath().string() + "/transparency-overrides.cfg");
|
nifOverrides.loadTransparencyOverrides(mCfgMgr.getGlobalPath().string() + "/transparency-overrides.cfg");
|
||||||
|
|
||||||
settings.setBool("hardware cursors", "GUI", true);
|
settings.setBool("hardware cursors", "GUI", true);
|
||||||
settings.setBool("debug", "Engine", mDebug);
|
|
||||||
|
|
||||||
return settingspath;
|
return settingspath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,6 @@ namespace OMW
|
||||||
std::vector<std::string> mMaster;
|
std::vector<std::string> mMaster;
|
||||||
std::vector<std::string> mPlugins;
|
std::vector<std::string> mPlugins;
|
||||||
int mFpsLevel;
|
int mFpsLevel;
|
||||||
bool mDebug;
|
|
||||||
bool mVerboseScripts;
|
bool mVerboseScripts;
|
||||||
bool mNewGame;
|
bool mNewGame;
|
||||||
bool mUseSound;
|
bool mUseSound;
|
||||||
|
@ -147,10 +146,6 @@ namespace OMW
|
||||||
/// Enable fps counter
|
/// Enable fps counter
|
||||||
void showFPS(int level);
|
void showFPS(int level);
|
||||||
|
|
||||||
/// Enable debug mode:
|
|
||||||
/// - non-exclusive input
|
|
||||||
void setDebugMode(bool debugMode);
|
|
||||||
|
|
||||||
/// Enable or disable verbose script output
|
/// Enable or disable verbose script output
|
||||||
void setScriptsVerbosity(bool scriptsVerbosity);
|
void setScriptsVerbosity(bool scriptsVerbosity);
|
||||||
|
|
||||||
|
|
|
@ -118,9 +118,6 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
|
||||||
("anim-verbose", bpo::value<bool>()->implicit_value(true)
|
("anim-verbose", bpo::value<bool>()->implicit_value(true)
|
||||||
->default_value(false), "output animation indices files")
|
->default_value(false), "output animation indices files")
|
||||||
|
|
||||||
("debug", bpo::value<bool>()->implicit_value(true)
|
|
||||||
->default_value(false), "debug mode")
|
|
||||||
|
|
||||||
("nosound", bpo::value<bool>()->implicit_value(true)
|
("nosound", bpo::value<bool>()->implicit_value(true)
|
||||||
->default_value(false), "disable all sounds")
|
->default_value(false), "disable all sounds")
|
||||||
|
|
||||||
|
@ -243,7 +240,6 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
|
||||||
engine.setNewGame(variables["new-game"].as<bool>());
|
engine.setNewGame(variables["new-game"].as<bool>());
|
||||||
|
|
||||||
// other settings
|
// other settings
|
||||||
engine.setDebugMode(variables["debug"].as<bool>());
|
|
||||||
engine.setSoundUsage(!variables["nosound"].as<bool>());
|
engine.setSoundUsage(!variables["nosound"].as<bool>());
|
||||||
engine.setScriptsVerbosity(variables["script-verbose"].as<bool>());
|
engine.setScriptsVerbosity(variables["script-verbose"].as<bool>());
|
||||||
engine.setCompileAll(variables["script-all"].as<bool>());
|
engine.setCompileAll(variables["script-all"].as<bool>());
|
||||||
|
|
|
@ -221,7 +221,7 @@ namespace MWGui
|
||||||
unsetSelectedWeapon();
|
unsetSelectedWeapon();
|
||||||
|
|
||||||
//set up the hardware cursor manager
|
//set up the hardware cursor manager
|
||||||
mCursorManager = new SFO::SDLCursorManager(Settings::Manager::getBool("debug", "Engine"));
|
mCursorManager = new SFO::SDLCursorManager();
|
||||||
|
|
||||||
MyGUI::PointerManager::getInstance().eventChangeMousePointer += MyGUI::newDelegate(this, &WindowManager::onCursorChange);
|
MyGUI::PointerManager::getInstance().eventChangeMousePointer += MyGUI::newDelegate(this, &WindowManager::onCursorChange);
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ namespace MWInput
|
||||||
, mMouseWheel(0)
|
, mMouseWheel(0)
|
||||||
, mDragDrop(false)
|
, mDragDrop(false)
|
||||||
, mGuiCursorEnabled(false)
|
, mGuiCursorEnabled(false)
|
||||||
, mDebug(Settings::Manager::getBool("debug", "Engine"))
|
|
||||||
, mUserFile(userFile)
|
, mUserFile(userFile)
|
||||||
, mUserFileExists(userFileExists)
|
, mUserFileExists(userFileExists)
|
||||||
, mInvertY (Settings::Manager::getBool("invert y axis", "Input"))
|
, mInvertY (Settings::Manager::getBool("invert y axis", "Input"))
|
||||||
|
@ -272,8 +271,6 @@ namespace MWInput
|
||||||
// event callbacks (which may crash)
|
// event callbacks (which may crash)
|
||||||
mWindows.update();
|
mWindows.update();
|
||||||
|
|
||||||
if(!mDebug)
|
|
||||||
{
|
|
||||||
bool main_menu = mWindows.containsMode(MWGui::GM_MainMenu);
|
bool main_menu = mWindows.containsMode(MWGui::GM_MainMenu);
|
||||||
|
|
||||||
bool was_relative = mInputManager->getMouseRelative();
|
bool was_relative = mInputManager->getMouseRelative();
|
||||||
|
@ -292,7 +289,6 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
mInputManager->warpMouse(mMouseX, mMouseY);
|
mInputManager->warpMouse(mMouseX, mMouseY);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Disable movement in Gui mode
|
// Disable movement in Gui mode
|
||||||
if (mWindows.isGuiMode()) return;
|
if (mWindows.isGuiMode()) return;
|
||||||
|
@ -597,19 +593,12 @@ namespace MWInput
|
||||||
|
|
||||||
bool InputManager::windowFocusChange(bool have_focus)
|
bool InputManager::windowFocusChange(bool have_focus)
|
||||||
{
|
{
|
||||||
if(!mDebug)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InputManager::windowVisibilityChange(bool visible)
|
bool InputManager::windowVisibilityChange(bool visible)
|
||||||
{
|
|
||||||
if(!mDebug)
|
|
||||||
{
|
{
|
||||||
//TODO: Pause game?
|
//TODO: Pause game?
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,6 @@ namespace MWInput
|
||||||
|
|
||||||
bool mMouseLookEnabled;
|
bool mMouseLookEnabled;
|
||||||
bool mGuiCursorEnabled;
|
bool mGuiCursorEnabled;
|
||||||
bool mDebug;
|
|
||||||
|
|
||||||
float mOverencumberedMessageDelay;
|
float mOverencumberedMessageDelay;
|
||||||
|
|
||||||
|
|
9
extern/sdl4ogre/sdlcursormanager.cpp
vendored
9
extern/sdl4ogre/sdlcursormanager.cpp
vendored
|
@ -8,8 +8,7 @@
|
||||||
namespace SFO
|
namespace SFO
|
||||||
{
|
{
|
||||||
|
|
||||||
SDLCursorManager::SDLCursorManager(bool debug) :
|
SDLCursorManager::SDLCursorManager() :
|
||||||
mDebug(debug),
|
|
||||||
mEnabled(false),
|
mEnabled(false),
|
||||||
mCursorVisible(false),
|
mCursorVisible(false),
|
||||||
mInitialized(false)
|
mInitialized(false)
|
||||||
|
@ -45,7 +44,6 @@ namespace SFO
|
||||||
//turn off hardware cursors
|
//turn off hardware cursors
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!mDebug)
|
|
||||||
SDL_ShowCursor(SDL_FALSE);
|
SDL_ShowCursor(SDL_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +70,7 @@ namespace SFO
|
||||||
|
|
||||||
void SDLCursorManager::_setGUICursor(const std::string &name)
|
void SDLCursorManager::_setGUICursor(const std::string &name)
|
||||||
{
|
{
|
||||||
if(mEnabled && (mDebug || mCursorVisible))
|
if(mEnabled && mCursorVisible)
|
||||||
{
|
{
|
||||||
SDL_SetCursor(mCursorMap.find(name)->second);
|
SDL_SetCursor(mCursorMap.find(name)->second);
|
||||||
_setCursorVisible(mCursorVisible);
|
_setCursorVisible(mCursorVisible);
|
||||||
|
@ -84,9 +82,6 @@ namespace SFO
|
||||||
if(!mEnabled)
|
if(!mEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(mDebug)
|
|
||||||
visible = true;
|
|
||||||
|
|
||||||
SDL_ShowCursor(visible ? SDL_TRUE : SDL_FALSE);
|
SDL_ShowCursor(visible ? SDL_TRUE : SDL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
extern/sdl4ogre/sdlcursormanager.hpp
vendored
4
extern/sdl4ogre/sdlcursormanager.hpp
vendored
|
@ -12,7 +12,7 @@ namespace SFO
|
||||||
public CursorManager
|
public CursorManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SDLCursorManager(bool debug=false);
|
SDLCursorManager();
|
||||||
virtual ~SDLCursorManager();
|
virtual ~SDLCursorManager();
|
||||||
|
|
||||||
virtual void setEnabled(bool enabled);
|
virtual void setEnabled(bool enabled);
|
||||||
|
@ -36,8 +36,6 @@ namespace SFO
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
bool mInitialized;
|
bool mInitialized;
|
||||||
bool mCursorVisible;
|
bool mCursorVisible;
|
||||||
bool mDebug;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue