1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 01:49:41 +00:00

fixing MSVC 2013 warning C4244: & C4305

fixes for mistakes in last commit.
This commit is contained in:
dteviot 2015-03-08 13:22:56 +13:00
parent e197f5318b
commit e6cd8484a2
8 changed files with 16 additions and 27 deletions

View file

@ -176,7 +176,7 @@ namespace MWClass
{
MWBase::Environment::get().getSoundManager()->fadeOutSound3D(ptr,
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,
//so we divide offset by two
action->setSoundOffset(offset * 0.5f);

View file

@ -624,14 +624,14 @@ namespace
RenderXform (MyGUI::ICroppedRectangle* croppedParent, MyGUI::RenderTargetInfo const & renderTargetInfo)
{
clipTop = static_cast<float>(croppedParent->_getMarginTop());
clipLeft = static_cast<int>(croppedParent->_getMarginLeft ());
clipRight = static_cast<int>(croppedParent->getWidth () - croppedParent->_getMarginRight ());
clipBottom = static_cast<int>(croppedParent->getHeight() - croppedParent->_getMarginBottom());
clipLeft = static_cast<float>(croppedParent->_getMarginLeft ());
clipRight = static_cast<float>(croppedParent->getWidth () - croppedParent->_getMarginRight ());
clipBottom = static_cast<float>(croppedParent->getHeight() - croppedParent->_getMarginBottom());
absoluteLeft = static_cast<int>(croppedParent->getAbsoluteLeft());
absoluteTop = static_cast<int>(croppedParent->getAbsoluteTop());
leftOffset = static_cast<int>(renderTargetInfo.leftOffset);
topOffset = static_cast<int>(renderTargetInfo.topOffset);
absoluteLeft = static_cast<float>(croppedParent->getAbsoluteLeft());
absoluteTop = static_cast<float>(croppedParent->getAbsoluteTop());
leftOffset = static_cast<float>(renderTargetInfo.leftOffset);
topOffset = static_cast<float>(renderTargetInfo.topOffset);
pixScaleX = renderTargetInfo.pixScaleX;
pixScaleY = renderTargetInfo.pixScaleY;

View file

@ -101,7 +101,7 @@ namespace MWGui
void InventoryWindow::adjustPanes()
{
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 );
mRightPane->setCoord( mLeftPane->getPosition().left + leftPaneWidth + 4,
mRightPane->getPosition().top,

View file

@ -264,7 +264,7 @@ namespace MWGui
// Image space is -Y up, cells are Y up
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;
@ -827,18 +827,7 @@ namespace MWGui
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
{
Ogre::Vector3 pos = MWBase::Environment::get().getWorld ()->getPlayerPtr().getRefData ().getBaseNode ()->_getDerivedPosition ();
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);
setGlobalMapPlayerPosition(pos.x, pos.y);
}
}
@ -858,7 +847,7 @@ namespace MWGui
// set the view offset so that player is in the center
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);
}

View file

@ -148,7 +148,7 @@ namespace MWGui
value = std::max(min, std::min(value, max));
value = (value-min)/(max-min);
scroll->setScrollPosition( value * (scroll->getScrollRange()-1));
scroll->setScrollPosition(static_cast<size_t>(value * (scroll->getScrollRange() - 1)));
}
else
{

View file

@ -34,7 +34,7 @@ namespace
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))
{
price *= item.getClass().getItemHealth(item);

View file

@ -1480,7 +1480,7 @@ namespace MWMechanics
disposition = getDerivedDisposition(ptr);
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())
{

View file

@ -1350,7 +1350,7 @@ namespace MWWorld
pos.pos[2] += dist;
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);
}