Merge remote-tracking branch 'mrcheko/master'

This commit is contained in:
Marc Zinnschlag 2015-01-02 18:08:47 +01:00
commit ec1df719fe
7 changed files with 90 additions and 5 deletions

View file

@ -208,6 +208,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
OMW::Engine::~Engine()
{
mOgre->restoreWindowGammaRamp();
mEnvironment.cleanup();
delete mScriptContext;
delete mOgre;
@ -382,6 +383,8 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
// Create sound system
mEnvironment.setSoundManager (new MWSound::SoundManager(mUseSound));
mOgre->setWindowGammaContrast(Settings::Manager::getFloat("gamma", "General"), Settings::Manager::getFloat("contrast", "General"));
if (!mSkipMenu)
{
std::string logo = mFallbackMap["Movies_Company_Logo"];

View file

@ -182,6 +182,20 @@ namespace MWGui
getWidget(mRefractionButton, "RefractionButton");
getWidget(mDifficultySlider, "DifficultySlider");
#ifndef WIN32
// hide gamma controls since it currently does not work under Linux
MyGUI::ScrollBar *gammaSlider;
getWidget(gammaSlider, "GammaSlider");
gammaSlider->setVisible(false);
MyGUI::TextBox *textBox;
getWidget(textBox, "GammaText");
textBox->setVisible(false);
getWidget(textBox, "GammaTextDark");
textBox->setVisible(false);
getWidget(textBox, "GammaTextLight");
textBox->setVisible(false);
#endif
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord += MyGUI::newDelegate(this, &SettingsWindow::onWindowResize);
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);

View file

@ -757,6 +757,10 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
changeRes = true;
else if (it->second == "field of view" && it->first == "General")
mRendering.setFov(Settings::Manager::getFloat("field of view", "General"));
else if (it->second == "gamma" && it->first == "General")
{
mRendering.setWindowGammaContrast(Settings::Manager::getFloat("gamma", "General"), Settings::Manager::getFloat("contrast", "General"));
}
else if ((it->second == "texture filtering" && it->first == "General")
|| (it->second == "anisotropy" && it->first == "General"))
{