1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-30 16:04:38 +00:00

Use static_cast for consistency

This commit is contained in:
Evil Eye 2025-10-02 18:15:33 +02:00
parent 5b94502c7f
commit 5dcb0e19fb
2 changed files with 6 additions and 4 deletions

View file

@ -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<float>(previewWindowSize.width));
const float normalisedY = y / std::max(1.f, static_cast<float>(previewWindowSize.height));
const MyGUI::IntSize viewport = getPreviewViewportSize();
return osg::Vec2i(static_cast<int>(normalisedX * (viewport.width - 1)),

View file

@ -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<float>(Settings::video().mResolutionX), static_cast<float>(Settings::video().mResolutionY));
};
api["_getAllUiModes"] = [](sol::this_state thisState) {
sol::table res(thisState, sol::create);