mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
Merge remote-tracking branch 'swick/master'
This commit is contained in:
commit
2fa0764c89
10 changed files with 50 additions and 8 deletions
|
@ -159,6 +159,9 @@ bool Launcher::GraphicsPage::loadSettings()
|
|||
if (mGraphicsSettings.value(QString("Video/fullscreen")) == QLatin1String("true"))
|
||||
fullScreenCheckBox->setCheckState(Qt::Checked);
|
||||
|
||||
if (mGraphicsSettings.value(QString("Video/window border")) == QLatin1String("true"))
|
||||
windowBorderCheckBox->setCheckState(Qt::Checked);
|
||||
|
||||
int aaIndex = antiAliasingComboBox->findText(mGraphicsSettings.value(QString("Video/antialiasing")));
|
||||
if (aaIndex != -1)
|
||||
antiAliasingComboBox->setCurrentIndex(aaIndex);
|
||||
|
@ -193,6 +196,9 @@ void Launcher::GraphicsPage::saveSettings()
|
|||
fullScreenCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("true"))
|
||||
: mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("false"));
|
||||
|
||||
windowBorderCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/window border"), QString("true"))
|
||||
: mGraphicsSettings.setValue(QString("Video/window border"), QString("false"));
|
||||
|
||||
mGraphicsSettings.setValue(QString("Video/antialiasing"), antiAliasingComboBox->currentText());
|
||||
mGraphicsSettings.setValue(QString("Video/render system"), rendererComboBox->currentText());
|
||||
|
||||
|
@ -331,10 +337,12 @@ void Launcher::GraphicsPage::slotFullScreenChanged(int state)
|
|||
customRadioButton->setEnabled(false);
|
||||
customWidthSpinBox->setEnabled(false);
|
||||
customHeightSpinBox->setEnabled(false);
|
||||
windowBorderCheckBox->setEnabled(false);
|
||||
} else {
|
||||
customRadioButton->setEnabled(true);
|
||||
customWidthSpinBox->setEnabled(true);
|
||||
customHeightSpinBox->setEnabled(true);
|
||||
windowBorderCheckBox->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -350,6 +350,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
|
||||
OEngine::Render::WindowSettings windowSettings;
|
||||
windowSettings.fullscreen = settings.getBool("fullscreen", "Video");
|
||||
windowSettings.window_border = settings.getBool("window border", "Video");
|
||||
windowSettings.window_x = settings.getInt("resolution x", "Video");
|
||||
windowSettings.window_y = settings.getInt("resolution y", "Video");
|
||||
windowSettings.screen = settings.getInt("screen", "Video");
|
||||
|
|
|
@ -166,6 +166,7 @@ namespace MWGui
|
|||
getWidget(mResolutionList, "ResolutionList");
|
||||
getWidget(mFullscreenButton, "FullscreenButton");
|
||||
getWidget(mVSyncButton, "VSyncButton");
|
||||
getWidget(mWindowBorderButton, "WindowBorderButton");
|
||||
getWidget(mFPSButton, "FPSButton");
|
||||
getWidget(mFOVSlider, "FOVSlider");
|
||||
getWidget(mAnisotropySlider, "AnisotropySlider");
|
||||
|
@ -239,6 +240,8 @@ namespace MWGui
|
|||
MyGUI::TextBox* diffText;
|
||||
getWidget(diffText, "DifficultyText");
|
||||
diffText->setCaptionWithReplacing("#{sDifficulty} (" + boost::lexical_cast<std::string>(int(Settings::Manager::getInt("difficulty", "Game"))) + ")");
|
||||
|
||||
mWindowBorderButton->setEnabled(!Settings::Manager::getBool("fullscreen", "Video"));
|
||||
}
|
||||
|
||||
void SettingsWindow::onOkButtonClicked(MyGUI::Widget* _sender)
|
||||
|
@ -354,6 +357,8 @@ namespace MWGui
|
|||
_sender->castType<MyGUI::Button>()->setCaption(off);
|
||||
return;
|
||||
}
|
||||
|
||||
mWindowBorderButton->setEnabled(!newState);
|
||||
}
|
||||
|
||||
if (getSettingType(_sender) == checkButtonType)
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace MWGui
|
|||
MyGUI::ListBox* mResolutionList;
|
||||
MyGUI::Button* mFullscreenButton;
|
||||
MyGUI::Button* mVSyncButton;
|
||||
MyGUI::Button* mWindowBorderButton;
|
||||
MyGUI::Button* mFPSButton;
|
||||
MyGUI::ScrollBar* mFOVSlider;
|
||||
MyGUI::ScrollBar* mDifficultySlider;
|
||||
|
|
|
@ -753,6 +753,8 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
|||
|| it->second == "resolution y"
|
||||
|| it->second == "fullscreen"))
|
||||
changeRes = true;
|
||||
else if (it->first == "Video" && it->second == "window border")
|
||||
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 == "texture filtering" && it->first == "General")
|
||||
|
@ -810,6 +812,7 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
|||
unsigned int x = Settings::Manager::getInt("resolution x", "Video");
|
||||
unsigned int y = Settings::Manager::getInt("resolution y", "Video");
|
||||
bool fullscreen = Settings::Manager::getBool("fullscreen", "Video");
|
||||
bool windowBorder = Settings::Manager::getBool("window border", "Video");
|
||||
|
||||
SDL_Window* window = mRendering.getSDLWindow();
|
||||
|
||||
|
@ -828,7 +831,10 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
|||
SDL_SetWindowFullscreen(window, fullscreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_SetWindowSize(window, x, y);
|
||||
SDL_SetWindowBordered(window, windowBorder ? SDL_TRUE : SDL_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
mWater->processChangedSettings(settings);
|
||||
|
|
|
@ -240,12 +240,22 @@
|
|||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="182 64 300 24">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="WindowBorderButton">
|
||||
<UserString key="SettingCategory" value="Video"/>
|
||||
<UserString key="SettingName" value="window border"/>
|
||||
<UserString key="SettingType" value="CheckButton"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 48 16" align="Left Top">
|
||||
<Property key="Caption" value="Window border"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="182 94 300 24">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="FPSButton"/>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 32 16" align="Left Top">
|
||||
<Property key="Caption" value="FPS"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="182 94 300 24">
|
||||
<Widget type="HBox" skin="" position="182 124 300 24">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="ShadersButton">
|
||||
<UserString key="SettingCategory" value="Objects"/>
|
||||
<UserString key="SettingName" value="shaders"/>
|
||||
|
@ -255,7 +265,7 @@
|
|||
<Property key="Caption" value="Object shaders"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="182 124 300 24">
|
||||
<Widget type="HBox" skin="" position="182 154 300 24">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="ShaderModeButton"/>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 93 16" align="Left Top">
|
||||
<Property key="Caption" value="Shader mode"/>
|
||||
|
|
|
@ -6,6 +6,7 @@ resolution x = 800
|
|||
resolution y = 600
|
||||
|
||||
fullscreen = false
|
||||
window border = true
|
||||
screen = 0
|
||||
|
||||
# Minimize the window if it loses key focus?
|
||||
|
|
|
@ -51,20 +51,27 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="windowBorderCheckBox">
|
||||
<property name="text">
|
||||
<string>Window border</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="antiAliasingLabel">
|
||||
<property name="text">
|
||||
<string>Anti-aliasing:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="screenLabel">
|
||||
<property name="text">
|
||||
<string>Screen:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="resolutionLabel">
|
||||
<property name="text">
|
||||
<string>Resolution:</string>
|
||||
|
@ -74,13 +81,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="antiAliasingComboBox"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="screenComboBox"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<layout class="QGridLayout" name="resolutionLayout">
|
||||
<item row="1" column="2">
|
||||
<layout class="QHBoxLayout" name="customResolutionLayout" stretch="1,0,1">
|
||||
|
|
|
@ -128,7 +128,9 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings&
|
|||
settings.window_x, // width, in pixels
|
||||
settings.window_y, // height, in pixels
|
||||
SDL_WINDOW_SHOWN
|
||||
| (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0) | SDL_WINDOW_RESIZABLE
|
||||
| SDL_WINDOW_RESIZABLE
|
||||
| (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0)
|
||||
| (settings.window_border ? 0 : SDL_WINDOW_BORDERLESS)
|
||||
);
|
||||
|
||||
SFO::SDLWindowHelper helper(mSDLWindow, settings.window_x, settings.window_y, title, settings.fullscreen, params);
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace OEngine
|
|||
{
|
||||
bool vsync;
|
||||
bool fullscreen;
|
||||
bool window_border;
|
||||
int window_x, window_y;
|
||||
int screen;
|
||||
std::string fsaa;
|
||||
|
|
Loading…
Reference in a new issue