mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-30 16:34:30 +00:00
Use static_cast for consistency
This commit is contained in:
parent
5b94502c7f
commit
5dcb0e19fb
2 changed files with 6 additions and 4 deletions
|
|
@ -953,8 +953,8 @@ namespace MWGui
|
||||||
osg::Vec2i InventoryWindow::mapPreviewWindowToViewport(int x, int y) const
|
osg::Vec2i InventoryWindow::mapPreviewWindowToViewport(int x, int y) const
|
||||||
{
|
{
|
||||||
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
||||||
const float normalisedX = x / float(std::max(1, previewWindowSize.width));
|
const float normalisedX = x / std::max(1.f, static_cast<float>(previewWindowSize.width));
|
||||||
const float normalisedY = y / float(std::max(1, previewWindowSize.height));
|
const float normalisedY = y / std::max(1.f, static_cast<float>(previewWindowSize.height));
|
||||||
|
|
||||||
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
||||||
return osg::Vec2i(static_cast<int>(normalisedX * (viewport.width - 1)),
|
return osg::Vec2i(static_cast<int>(normalisedX * (viewport.width - 1)),
|
||||||
|
|
|
||||||
|
|
@ -243,8 +243,10 @@ namespace MWLua
|
||||||
return luaManager->uiResourceManager()->registerTexture(std::move(data));
|
return luaManager->uiResourceManager()->registerTexture(std::move(data));
|
||||||
};
|
};
|
||||||
|
|
||||||
api["screenSize"]
|
api["screenSize"] = []() {
|
||||||
= []() { return osg::Vec2f(float(Settings::video().mResolutionX), float(Settings::video().mResolutionY)); };
|
return osg::Vec2f(
|
||||||
|
static_cast<float>(Settings::video().mResolutionX), static_cast<float>(Settings::video().mResolutionY));
|
||||||
|
};
|
||||||
|
|
||||||
api["_getAllUiModes"] = [](sol::this_state thisState) {
|
api["_getAllUiModes"] = [](sol::this_state thisState) {
|
||||||
sol::table res(thisState, sol::create);
|
sol::table res(thisState, sol::create);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue