diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/widgets/tabs/setup_video.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/widgets/tabs/setup_video.cpp')
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index fad7f3ba2..591093bc8 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -263,13 +263,13 @@ void Setup_Video::apply() const int sel = mOpenGLDropDown->getSelected(); RenderType mode = RENDER_SOFTWARE; - if (sel >= 0 && static_cast<unsigned int>(sel) < sizeof(indexToRender)) + if (sel >= 0 && CAST_U32(sel) < sizeof(indexToRender)) mode = indexToRender[mOpenGLDropDown->getSelected()]; // OpenGL change if (mode != mOpenGLEnabled) { - config.setValue("opengl", static_cast<int>(mode)); + config.setValue("opengl", CAST_S32(mode)); // OpenGL can currently only be changed by restarting, notify user. CREATEWIDGET(OkDialog, @@ -287,9 +287,9 @@ void Setup_Video::apply() } mFps = mFpsCheckBox->isSelected() ? - static_cast<int>(mFpsSlider->getValue()) : 0; + CAST_S32(mFpsSlider->getValue()) : 0; - mAltFps = static_cast<int>(mAltFpsSlider->getValue()); + mAltFps = CAST_S32(mAltFpsSlider->getValue()); mFpsSlider->setEnabled(mFps > 0); @@ -336,7 +336,7 @@ void Setup_Video::cancel() config.setValue("screenheight", mainGraphics->mActualHeight); config.setValue("customcursor", mCustomCursorEnabled); - config.setValue("opengl", static_cast<int>(mOpenGLEnabled)); + config.setValue("opengl", CAST_S32(mOpenGLEnabled)); config.setValue("enableresize", mEnableResize); config.setValue("noframe", mNoFrame); } @@ -443,7 +443,7 @@ void Setup_Video::action(const ActionEvent &event) } else if (id == "fpslimitcheckbox" || id == "fpslimitslider") { - int tempFps = static_cast<int>(mFpsSlider->getValue()); + int tempFps = CAST_S32(mFpsSlider->getValue()); if (id == "fpslimitcheckbox" && !mFpsSlider->isEnabled()) tempFps = 60; else @@ -458,8 +458,8 @@ void Setup_Video::action(const ActionEvent &event) } else if (id == "altfpslimitslider") { - int tempFps = static_cast<int>(mAltFpsSlider->getValue()); - tempFps = tempFps > 0 ? tempFps : static_cast<int>( + int tempFps = CAST_S32(mAltFpsSlider->getValue()); + tempFps = tempFps > 0 ? tempFps : CAST_S32( mAltFpsSlider->getScaleStart()); mAltFps = tempFps; // TRANSLATORS: video settings label @@ -486,7 +486,7 @@ void Setup_Video::action(const ActionEvent &event) { Configuration &conf = test->getConfig(); const int val = conf.getValueInt("opengl", -1); - if (val >= 0 && static_cast<unsigned int>(val) + if (val >= 0 && CAST_U32(val) < sizeof(renderToIndex) / sizeof(int)) { mOpenGLDropDown->setSelected(renderToIndex[val]); |