diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 4552434b1f..e041971cfe 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -953,8 +953,8 @@ namespace MWGui osg::Vec2i InventoryWindow::mapPreviewWindowToViewport(int x, int y) const { const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize(); - const float normalisedX = x / float(std::max(1, previewWindowSize.width)); - const float normalisedY = y / float(std::max(1, previewWindowSize.height)); + const float normalisedX = x / std::max(1.f, static_cast(previewWindowSize.width)); + const float normalisedY = y / std::max(1.f, static_cast(previewWindowSize.height)); const MyGUI::IntSize viewport = getPreviewViewportSize(); return osg::Vec2i(static_cast(normalisedX * (viewport.width - 1)), diff --git a/apps/openmw/mwlua/uibindings.cpp b/apps/openmw/mwlua/uibindings.cpp index b5188b19d7..b4f78694e0 100644 --- a/apps/openmw/mwlua/uibindings.cpp +++ b/apps/openmw/mwlua/uibindings.cpp @@ -243,8 +243,10 @@ namespace MWLua return luaManager->uiResourceManager()->registerTexture(std::move(data)); }; - api["screenSize"] - = []() { return osg::Vec2f(float(Settings::video().mResolutionX), float(Settings::video().mResolutionY)); }; + api["screenSize"] = []() { + return osg::Vec2f( + static_cast(Settings::video().mResolutionX), static_cast(Settings::video().mResolutionY)); + }; api["_getAllUiModes"] = [](sol::this_state thisState) { sol::table res(thisState, sol::create);