mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:19:40 +00:00
fixing MSVC 2013 warning C4244: & C4305
fixes for mistakes in last commit.
This commit is contained in:
parent
e197f5318b
commit
e6cd8484a2
8 changed files with 16 additions and 27 deletions
|
@ -176,7 +176,7 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->fadeOutSound3D(ptr,
|
MWBase::Environment::get().getSoundManager()->fadeOutSound3D(ptr,
|
||||||
openSound, 0.5f);
|
openSound, 0.5f);
|
||||||
float offset = 1.0 - ptr.getRefData().getLocalRotation().rot[2]/ 3.14159265f * 2.0f;
|
float offset = 1.0f - ptr.getRefData().getLocalRotation().rot[2]/ 3.14159265f * 2.0f;
|
||||||
//most if not all door have closing bang somewhere in the middle of the sound,
|
//most if not all door have closing bang somewhere in the middle of the sound,
|
||||||
//so we divide offset by two
|
//so we divide offset by two
|
||||||
action->setSoundOffset(offset * 0.5f);
|
action->setSoundOffset(offset * 0.5f);
|
||||||
|
|
|
@ -624,14 +624,14 @@ namespace
|
||||||
RenderXform (MyGUI::ICroppedRectangle* croppedParent, MyGUI::RenderTargetInfo const & renderTargetInfo)
|
RenderXform (MyGUI::ICroppedRectangle* croppedParent, MyGUI::RenderTargetInfo const & renderTargetInfo)
|
||||||
{
|
{
|
||||||
clipTop = static_cast<float>(croppedParent->_getMarginTop());
|
clipTop = static_cast<float>(croppedParent->_getMarginTop());
|
||||||
clipLeft = static_cast<int>(croppedParent->_getMarginLeft ());
|
clipLeft = static_cast<float>(croppedParent->_getMarginLeft ());
|
||||||
clipRight = static_cast<int>(croppedParent->getWidth () - croppedParent->_getMarginRight ());
|
clipRight = static_cast<float>(croppedParent->getWidth () - croppedParent->_getMarginRight ());
|
||||||
clipBottom = static_cast<int>(croppedParent->getHeight() - croppedParent->_getMarginBottom());
|
clipBottom = static_cast<float>(croppedParent->getHeight() - croppedParent->_getMarginBottom());
|
||||||
|
|
||||||
absoluteLeft = static_cast<int>(croppedParent->getAbsoluteLeft());
|
absoluteLeft = static_cast<float>(croppedParent->getAbsoluteLeft());
|
||||||
absoluteTop = static_cast<int>(croppedParent->getAbsoluteTop());
|
absoluteTop = static_cast<float>(croppedParent->getAbsoluteTop());
|
||||||
leftOffset = static_cast<int>(renderTargetInfo.leftOffset);
|
leftOffset = static_cast<float>(renderTargetInfo.leftOffset);
|
||||||
topOffset = static_cast<int>(renderTargetInfo.topOffset);
|
topOffset = static_cast<float>(renderTargetInfo.topOffset);
|
||||||
|
|
||||||
pixScaleX = renderTargetInfo.pixScaleX;
|
pixScaleX = renderTargetInfo.pixScaleX;
|
||||||
pixScaleY = renderTargetInfo.pixScaleY;
|
pixScaleY = renderTargetInfo.pixScaleY;
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace MWGui
|
||||||
void InventoryWindow::adjustPanes()
|
void InventoryWindow::adjustPanes()
|
||||||
{
|
{
|
||||||
const float aspect = 0.5; // fixed aspect ratio for the avatar image
|
const float aspect = 0.5; // fixed aspect ratio for the avatar image
|
||||||
int leftPaneWidth = static_cast<int>(mMainWidget->getSize().height - 44 - mArmorRating->getHeight()) * aspect);
|
int leftPaneWidth = static_cast<int>((mMainWidget->getSize().height - 44 - mArmorRating->getHeight()) * aspect);
|
||||||
mLeftPane->setSize( leftPaneWidth, mMainWidget->getSize().height-44 );
|
mLeftPane->setSize( leftPaneWidth, mMainWidget->getSize().height-44 );
|
||||||
mRightPane->setCoord( mLeftPane->getPosition().left + leftPaneWidth + 4,
|
mRightPane->setCoord( mLeftPane->getPosition().left + leftPaneWidth + 4,
|
||||||
mRightPane->getPosition().top,
|
mRightPane->getPosition().top,
|
||||||
|
|
|
@ -264,7 +264,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Image space is -Y up, cells are Y up
|
// Image space is -Y up, cells are Y up
|
||||||
widgetPos = MyGUI::IntPoint(static_cast<int>(nX * mMapWidgetSize + (1 + (cellX - mCurX)) * mMapWidgetSize),
|
widgetPos = MyGUI::IntPoint(static_cast<int>(nX * mMapWidgetSize + (1 + (cellX - mCurX)) * mMapWidgetSize),
|
||||||
static_cast<float>(nY * mMapWidgetSize + (1-(cellY-mCurY)) * mMapWidgetSize));
|
static_cast<int>(nY * mMapWidgetSize + (1-(cellY-mCurY)) * mMapWidgetSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
markerPos.nX = nX;
|
markerPos.nX = nX;
|
||||||
|
@ -827,18 +827,7 @@ namespace MWGui
|
||||||
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
|
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
|
||||||
{
|
{
|
||||||
Ogre::Vector3 pos = MWBase::Environment::get().getWorld ()->getPlayerPtr().getRefData ().getBaseNode ()->_getDerivedPosition ();
|
Ogre::Vector3 pos = MWBase::Environment::get().getWorld ()->getPlayerPtr().getRefData ().getBaseNode ()->_getDerivedPosition ();
|
||||||
|
setGlobalMapPlayerPosition(pos.x, pos.y);
|
||||||
float worldX, worldY;
|
|
||||||
mGlobalMapRender->worldPosToImageSpace (pos.x, pos.y, worldX, worldY);
|
|
||||||
worldX *= mGlobalMapRender->getWidth();
|
|
||||||
worldY *= mGlobalMapRender->getHeight();
|
|
||||||
|
|
||||||
mPlayerArrowGlobal->setPosition(MyGUI::IntPoint(static_cast<int>(worldX - 16), static_cast<int>(worldY - 16)));
|
|
||||||
|
|
||||||
// set the view offset so that player is in the center
|
|
||||||
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
|
||||||
MyGUI::IntPoint viewoffs((viewsize.width / 2) - worldX, (viewsize.height / 2) - worldY);
|
|
||||||
mGlobalMap->setViewOffset(viewoffs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +847,7 @@ namespace MWGui
|
||||||
|
|
||||||
// set the view offset so that player is in the center
|
// set the view offset so that player is in the center
|
||||||
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
||||||
MyGUI::IntPoint viewoffs((viewsize.width / 2) - x, (viewsize.height / 2) - y);
|
MyGUI::IntPoint viewoffs(static_cast<int>(viewsize.width * 0.5f - x), static_cast<int>(viewsize.height *0.5 - y));
|
||||||
mGlobalMap->setViewOffset(viewoffs);
|
mGlobalMap->setViewOffset(viewoffs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ namespace MWGui
|
||||||
value = std::max(min, std::min(value, max));
|
value = std::max(min, std::min(value, max));
|
||||||
value = (value-min)/(max-min);
|
value = (value-min)/(max-min);
|
||||||
|
|
||||||
scroll->setScrollPosition( value * (scroll->getScrollRange()-1));
|
scroll->setScrollPosition(static_cast<size_t>(value * (scroll->getScrollRange() - 1)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace
|
||||||
|
|
||||||
int getEffectiveValue (MWWorld::Ptr item, int count)
|
int getEffectiveValue (MWWorld::Ptr item, int count)
|
||||||
{
|
{
|
||||||
float price = item.getClass().getValue(item);
|
float price = static_cast<float>(item.getClass().getValue(item));
|
||||||
if (item.getClass().hasItemHealth(item))
|
if (item.getClass().hasItemHealth(item))
|
||||||
{
|
{
|
||||||
price *= item.getClass().getItemHealth(item);
|
price *= item.getClass().getItemHealth(item);
|
||||||
|
|
|
@ -1480,7 +1480,7 @@ namespace MWMechanics
|
||||||
disposition = getDerivedDisposition(ptr);
|
disposition = getDerivedDisposition(ptr);
|
||||||
|
|
||||||
int fight = std::max(0, ptr.getClass().getCreatureStats(ptr).getAiSetting(CreatureStats::AI_Fight).getModified()
|
int fight = std::max(0, ptr.getClass().getCreatureStats(ptr).getAiSetting(CreatureStats::AI_Fight).getModified()
|
||||||
+ static_cast<int>(getFightDistanceBias(ptr, target) + getFightDispositionBias(disposition)));
|
+ static_cast<int>(getFightDistanceBias(ptr, target) + getFightDispositionBias(static_cast<float>(disposition))));
|
||||||
|
|
||||||
if (ptr.getClass().isNpc() && target.getClass().isNpc())
|
if (ptr.getClass().isNpc() && target.getClass().isNpc())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1350,7 +1350,7 @@ namespace MWWorld
|
||||||
pos.pos[2] += dist;
|
pos.pos[2] += dist;
|
||||||
actor.getRefData().setPosition(pos);
|
actor.getRefData().setPosition(pos);
|
||||||
|
|
||||||
Ogre::Vector3 traced = mPhysics->traceDown(actor, dist*1.1);
|
Ogre::Vector3 traced = mPhysics->traceDown(actor, dist*1.1f);
|
||||||
moveObject(actor, actor.getCell(), traced.x, traced.y, traced.z);
|
moveObject(actor, actor.getCell(), traced.x, traced.y, traced.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue