mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
add safeties for enum math across define boundaries
This commit is contained in:
parent
1230d0d280
commit
aa02e48c8d
20 changed files with 71 additions and 71 deletions
|
|
@ -104,7 +104,7 @@ public:
|
||||||
|
|
||||||
static StringTableEntry smNoShapeAssetFallback;
|
static StringTableEntry smNoShapeAssetFallback;
|
||||||
|
|
||||||
static const String mShapeErrCodeStrings[ShapeAssetErrCode::Extended - Parent::Extended + 1];
|
static const String mShapeErrCodeStrings[U32(ShapeAssetErrCode::Extended) - U32(Parent::Extended) + 1];
|
||||||
|
|
||||||
static U32 getAssetErrCode(AssetPtr<ShapeAsset> shapeAsset) { if (shapeAsset) return shapeAsset->mLoadedState; else return 0; }
|
static U32 getAssetErrCode(AssetPtr<ShapeAsset> shapeAsset) { if (shapeAsset) return shapeAsset->mLoadedState; else return 0; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -691,7 +691,7 @@ void Lightning::processEvent(LightningStrikeEvent* pEvent)
|
||||||
start.z = mObjScale.z * 0.5f + getPosition().z;
|
start.z = mObjScale.z * 0.5f + getPosition().z;
|
||||||
strikePoint.z += -mObjScale.z * 0.5f;
|
strikePoint.z += -mObjScale.z * 0.5f;
|
||||||
bool rayHit = gClientContainer.castRay( start, strikePoint,
|
bool rayHit = gClientContainer.castRay( start, strikePoint,
|
||||||
(STATIC_COLLISION_TYPEMASK | WaterObjectType),
|
((U32)STATIC_COLLISION_TYPEMASK | (U32)WaterObjectType),
|
||||||
&rayInfo);
|
&rayInfo);
|
||||||
if( rayHit )
|
if( rayHit )
|
||||||
{
|
{
|
||||||
|
|
@ -933,7 +933,7 @@ U32 Lightning::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
||||||
U32 retMask = Parent::packUpdate(con, mask, stream);
|
U32 retMask = Parent::packUpdate(con, mask, stream);
|
||||||
|
|
||||||
// Only write data if this is the initial packet or we've been inspected.
|
// Only write data if this is the initial packet or we've been inspected.
|
||||||
if (stream->writeFlag(mask & (InitialUpdateMask | ExtendedInfoMask)))
|
if (stream->writeFlag(mask & ((U32)InitialUpdateMask | (U32)ExtendedInfoMask)))
|
||||||
{
|
{
|
||||||
// Initial update
|
// Initial update
|
||||||
mathWrite(*stream, getPosition());
|
mathWrite(*stream, getPosition());
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ void GroundPlane::createGeometry( const Frustum& frustum )
|
||||||
U32 width = mCeil( ( max.x - min.x ) / mSquareSize );
|
U32 width = mCeil( ( max.x - min.x ) / mSquareSize );
|
||||||
if( width > MAX_WIDTH )
|
if( width > MAX_WIDTH )
|
||||||
{
|
{
|
||||||
mSquareSize = mCeil( ( max.x - min.x ) / MAX_WIDTH );
|
mSquareSize = mCeil( ( max.x - min.x ) / (F32)MAX_WIDTH );
|
||||||
width = MAX_WIDTH;
|
width = MAX_WIDTH;
|
||||||
}
|
}
|
||||||
else if( !width )
|
else if( !width )
|
||||||
|
|
@ -451,7 +451,7 @@ void GroundPlane::createGeometry( const Frustum& frustum )
|
||||||
U32 height = mCeil( ( max.y - min.y ) / mSquareSize );
|
U32 height = mCeil( ( max.y - min.y ) / mSquareSize );
|
||||||
if( height > MAX_HEIGHT )
|
if( height > MAX_HEIGHT )
|
||||||
{
|
{
|
||||||
mSquareSize = mCeil( ( max.y - min.y ) / MAX_HEIGHT );
|
mSquareSize = mCeil( ( max.y - min.y ) / (F32)MAX_HEIGHT );
|
||||||
height = MAX_HEIGHT;
|
height = MAX_HEIGHT;
|
||||||
}
|
}
|
||||||
else if( !height )
|
else if( !height )
|
||||||
|
|
|
||||||
|
|
@ -1289,14 +1289,14 @@ bool Item::_setStatic(void *object, const char *index, const char *data)
|
||||||
{
|
{
|
||||||
Item *i = static_cast<Item*>(object);
|
Item *i = static_cast<Item*>(object);
|
||||||
i->mAtRest = dAtob(data);
|
i->mAtRest = dAtob(data);
|
||||||
i->setMaskBits(InitialUpdateMask | PositionMask);
|
i->setMaskBits((U32)InitialUpdateMask | (U32)PositionMask);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item::_setRotate(void *object, const char *index, const char *data)
|
bool Item::_setRotate(void *object, const char *index, const char *data)
|
||||||
{
|
{
|
||||||
Item *i = static_cast<Item*>(object);
|
Item *i = static_cast<Item*>(object);
|
||||||
i->setMaskBits(InitialUpdateMask | RotationMask);
|
i->setMaskBits((U32)InitialUpdateMask | (U32)RotationMask);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
#include "collision/collision.h"
|
#include "collision/collision.h"
|
||||||
#include "lighting/lightManager.h"
|
#include "lighting/lightManager.h"
|
||||||
|
|
||||||
const U32 LightFlareData::LosMask = STATIC_COLLISION_TYPEMASK |
|
const U32 LightFlareData::LosMask = (U32)STATIC_COLLISION_TYPEMASK |
|
||||||
ShapeBaseObjectType |
|
(U32)ShapeBaseObjectType |
|
||||||
StaticShapeObjectType |
|
(U32)StaticShapeObjectType |
|
||||||
ItemObjectType;
|
(U32)ItemObjectType;
|
||||||
|
|
||||||
|
|
||||||
LightFlareState::~LightFlareState()
|
LightFlareState::~LightFlareState()
|
||||||
|
|
|
||||||
|
|
@ -3937,7 +3937,7 @@ void Player::updateActionThread()
|
||||||
|
|
||||||
if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ),
|
if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ),
|
||||||
Point3F( pos.x, pos.y, pos.z - 2.0f ),
|
Point3F( pos.x, pos.y, pos.z - 2.0f ),
|
||||||
STATIC_COLLISION_TYPEMASK | VehicleObjectType, &rInfo ) )
|
(U32)STATIC_COLLISION_TYPEMASK | (U32)VehicleObjectType, &rInfo ) )
|
||||||
{
|
{
|
||||||
Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 );
|
Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 );
|
||||||
|
|
||||||
|
|
@ -5562,7 +5562,7 @@ void Player::setTransform(const MatrixF& mat)
|
||||||
mat.getColumn(3,&pos);
|
mat.getColumn(3,&pos);
|
||||||
Point3F rot(0.0f, 0.0f, -mAtan2(-vec.x,vec.y));
|
Point3F rot(0.0f, 0.0f, -mAtan2(-vec.x,vec.y));
|
||||||
setPosition(pos,rot);
|
setPosition(pos,rot);
|
||||||
setMaskBits(MoveMask | NoWarpMask);
|
setMaskBits((U32)MoveMask | (U32)NoWarpMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::getEyeTransform(MatrixF* mat)
|
void Player::getEyeTransform(MatrixF* mat)
|
||||||
|
|
@ -7073,7 +7073,7 @@ void Player:: playImpactSound()
|
||||||
|
|
||||||
if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ),
|
if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ),
|
||||||
Point3F( pos.x, pos.y, pos.z - 2.0f ),
|
Point3F( pos.x, pos.y, pos.z - 2.0f ),
|
||||||
STATIC_COLLISION_TYPEMASK | VehicleObjectType,
|
(U32)STATIC_COLLISION_TYPEMASK | (U32)VehicleObjectType,
|
||||||
&rInfo ) )
|
&rInfo ) )
|
||||||
{
|
{
|
||||||
Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 );
|
Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 );
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ void StaticShape::onUnmount(SceneObject* obj, S32 node)
|
||||||
U32 StaticShape::packUpdate(NetConnection *connection, U32 mask, BitStream *bstream)
|
U32 StaticShape::packUpdate(NetConnection *connection, U32 mask, BitStream *bstream)
|
||||||
{
|
{
|
||||||
U32 retMask = Parent::packUpdate(connection,mask,bstream);
|
U32 retMask = Parent::packUpdate(connection,mask,bstream);
|
||||||
if (bstream->writeFlag(mask & (PositionMask | ExtendedInfoMask)))
|
if (bstream->writeFlag(mask & ((U32)PositionMask | (U32)ExtendedInfoMask)))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Write the transform (do _not_ use writeAffineTransform. Since this is a static
|
// Write the transform (do _not_ use writeAffineTransform. Since this is a static
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ void Trigger::setTransform(const MatrixF & mat)
|
||||||
base.mul(mWorldToObj);
|
base.mul(mWorldToObj);
|
||||||
mClippedList.setBaseTransform(base);
|
mClippedList.setBaseTransform(base);
|
||||||
|
|
||||||
setMaskBits(TransformMask | ScaleMask);
|
setMaskBits((U32)TransformMask | (U32)ScaleMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
testObjects();
|
testObjects();
|
||||||
|
|
@ -564,7 +564,7 @@ void Trigger::onUnmount( SceneObject *obj, S32 node )
|
||||||
{
|
{
|
||||||
Parent::onUnmount( obj, node );
|
Parent::onUnmount( obj, node );
|
||||||
// Make sure the client get's the final server pos.
|
// Make sure the client get's the final server pos.
|
||||||
setMaskBits(TransformMask | ScaleMask);
|
setMaskBits((U32)TransformMask | (U32)ScaleMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Trigger::prepRenderImage( SceneRenderState *state )
|
void Trigger::prepRenderImage( SceneRenderState *state )
|
||||||
|
|
|
||||||
|
|
@ -1169,7 +1169,7 @@ U32 AITurretShape::packUpdate(NetConnection *connection, U32 mask, BitStream *bs
|
||||||
U32 retMask = Parent::packUpdate(connection,mask,bstream);
|
U32 retMask = Parent::packUpdate(connection,mask,bstream);
|
||||||
|
|
||||||
// Indicate that the transform has changed to update the scan box
|
// Indicate that the transform has changed to update the scan box
|
||||||
bstream->writeFlag(mask & (PositionMask | ExtendedInfoMask));
|
bstream->writeFlag(mask & ((U32)PositionMask | (U32)ExtendedInfoMask));
|
||||||
|
|
||||||
// Handle any state changes that need to be passed along
|
// Handle any state changes that need to be passed along
|
||||||
if (bstream->writeFlag(mask & TurretStateMask))
|
if (bstream->writeFlag(mask & TurretStateMask))
|
||||||
|
|
|
||||||
|
|
@ -827,8 +827,8 @@ void afxEffectWrapper::prestart()
|
||||||
if ((mEW_timing.fade_in_time + mEW_timing.fade_out_time) > 0.0f)
|
if ((mEW_timing.fade_in_time + mEW_timing.fade_out_time) > 0.0f)
|
||||||
{
|
{
|
||||||
mFade_in_end = mEW_timing.delay + mEW_timing.fade_in_time;
|
mFade_in_end = mEW_timing.delay + mEW_timing.fade_in_time;
|
||||||
if (mFull_lifetime == INFINITE_LIFETIME)
|
if (mFull_lifetime == (F32)INFINITE_LIFETIME)
|
||||||
mFade_out_start = INFINITE_LIFETIME;
|
mFade_out_start = (F32)INFINITE_LIFETIME;
|
||||||
else
|
else
|
||||||
mFade_out_start = mEW_timing.delay + mEW_timing.lifetime;
|
mFade_out_start = mEW_timing.delay + mEW_timing.lifetime;
|
||||||
mDo_fade_inout = true;
|
mDo_fade_inout = true;
|
||||||
|
|
@ -1088,7 +1088,7 @@ void afxEffectWrapper::stop()
|
||||||
mStopped = true;
|
mStopped = true;
|
||||||
|
|
||||||
// this resets full_lifetime so it starts to shrink or fade
|
// this resets full_lifetime so it starts to shrink or fade
|
||||||
if (mFull_lifetime == INFINITE_LIFETIME)
|
if (mFull_lifetime == (F32)INFINITE_LIFETIME)
|
||||||
{
|
{
|
||||||
mFull_lifetime = (mElapsed - mEW_timing.delay) + afterStopTime();
|
mFull_lifetime = (mElapsed - mEW_timing.delay) + afterStopTime();
|
||||||
mLife_end = mElapsed;
|
mLife_end = mElapsed;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ bool afxEA_AnimClip::ea_start()
|
||||||
do_runtime_substitutions();
|
do_runtime_substitutions();
|
||||||
|
|
||||||
afxConstraint* pos_constraint = getPosConstraint();
|
afxConstraint* pos_constraint = getPosConstraint();
|
||||||
if (mFull_lifetime == INFINITE_LIFETIME && pos_constraint != 0)
|
if (mFull_lifetime == (F32)INFINITE_LIFETIME && pos_constraint != 0)
|
||||||
anim_lifetime = pos_constraint->getAnimClipDuration(clip_data->clip_name);
|
anim_lifetime = pos_constraint->getAnimClipDuration(clip_data->clip_name);
|
||||||
else
|
else
|
||||||
anim_lifetime = mFull_lifetime;
|
anim_lifetime = mFull_lifetime;
|
||||||
|
|
@ -197,4 +197,4 @@ bool afxEA_AnimClipDesc::requiresStop(const afxEffectWrapperData* ew, const afxE
|
||||||
return (timing.lifetime < 0);
|
return (timing.lifetime < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ bool afxEA_CameraShake::ea_start()
|
||||||
|
|
||||||
if (aim_constraint && pos_constraint)
|
if (aim_constraint && pos_constraint)
|
||||||
{
|
{
|
||||||
if (mFull_lifetime <= 0 || mFull_lifetime == INFINITE_LIFETIME)
|
if (mFull_lifetime <= 0 || mFull_lifetime == (F32)INFINITE_LIFETIME)
|
||||||
{
|
{
|
||||||
Con::errorf("afxEA_CameraShake::ea_start() -- effect requires a finite lifetime.");
|
Con::errorf("afxEA_CameraShake::ea_start() -- effect requires a finite lifetime.");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -193,4 +193,4 @@ bool afxEA_CameraShakeDesc::requiresStop(const afxEffectWrapperData* ew, const a
|
||||||
return (timing.lifetime < 0);
|
return (timing.lifetime < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ afxXM_WeightedBaseData::afxXM_WeightedBaseData(const afxXM_WeightedBaseData& oth
|
||||||
|
|
||||||
bool afxXM_WeightedBaseData::hasFixedWeight() const
|
bool afxXM_WeightedBaseData::hasFixedWeight() const
|
||||||
{
|
{
|
||||||
return (delay == 0.0f && lifetime == afxEffectDefs::INFINITE_LIFETIME && fade_in_time == 0.0f && fade_out_time == 0.0f);
|
return (delay == 0.0f && lifetime == (F32)afxEffectDefs::INFINITE_LIFETIME && fade_in_time == 0.0f && fade_out_time == 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 afxXM_WeightedBaseData::getWeightFactor() const
|
F32 afxXM_WeightedBaseData::getWeightFactor() const
|
||||||
|
|
|
||||||
|
|
@ -149,15 +149,15 @@ bool GuiScrollCtrl::onWake()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mTextureObject = mProfile->getBitmapResource();
|
mTextureObject = mProfile->getBitmapResource();
|
||||||
if (mTextureObject && (mProfile->constructBitmapArray() >= BmpStates * BmpCount))
|
if (mTextureObject && (mProfile->constructBitmapArray() >= (U32)BmpStates * (U32)BmpCount))
|
||||||
{
|
{
|
||||||
mBitmapBounds = mProfile->mBitmapArrayRects.address();
|
mBitmapBounds = mProfile->mBitmapArrayRects.address();
|
||||||
|
|
||||||
//init
|
//init
|
||||||
mBaseThumbSize = mBitmapBounds[BmpStates * BmpVThumbTopCap].extent.y +
|
mBaseThumbSize = mBitmapBounds[(U32)BmpStates * (U32)BmpVThumbTopCap].extent.y +
|
||||||
mBitmapBounds[BmpStates * BmpVThumbBottomCap].extent.y;
|
mBitmapBounds[(U32)BmpStates * (U32)BmpVThumbBottomCap].extent.y;
|
||||||
mScrollBarThickness = mBitmapBounds[BmpStates * BmpVPage].extent.x;
|
mScrollBarThickness = mBitmapBounds[(U32)BmpStates * (U32)BmpVPage].extent.x;
|
||||||
mScrollBarArrowBtnLength = mBitmapBounds[BmpStates * BmpUp].extent.y;
|
mScrollBarArrowBtnLength = mBitmapBounds[(U32)BmpStates * (U32)BmpUp].extent.y;
|
||||||
computeSizes();
|
computeSizes();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1095,7 +1095,7 @@ void GuiScrollCtrl::drawVScrollBar(const Point2I &offset)
|
||||||
Point2I pos = ( offset + mUpArrowRect.point );
|
Point2I pos = ( offset + mUpArrowRect.point );
|
||||||
|
|
||||||
// Up Arrow.
|
// Up Arrow.
|
||||||
S32 upArrowBitmap = ( BmpStates * BmpUp );
|
S32 upArrowBitmap = ((U32)BmpStates * (U32)BmpUp );
|
||||||
if ( !mVBarEnabled )
|
if ( !mVBarEnabled )
|
||||||
{
|
{
|
||||||
upArrowBitmap += BmpDisabled;
|
upArrowBitmap += BmpDisabled;
|
||||||
|
|
@ -1114,7 +1114,7 @@ void GuiScrollCtrl::drawVScrollBar(const Point2I &offset)
|
||||||
pos.y += mBitmapBounds[upArrowBitmap].extent.y;
|
pos.y += mBitmapBounds[upArrowBitmap].extent.y;
|
||||||
|
|
||||||
// Track.
|
// Track.
|
||||||
S32 trackBitmap = ( BmpStates * BmpVPage );
|
S32 trackBitmap = ((U32)BmpStates * (U32)BmpVPage );
|
||||||
if ( !mVBarEnabled )
|
if ( !mVBarEnabled )
|
||||||
{
|
{
|
||||||
trackBitmap += BmpDisabled;
|
trackBitmap += BmpDisabled;
|
||||||
|
|
@ -1142,7 +1142,7 @@ void GuiScrollCtrl::drawVScrollBar(const Point2I &offset)
|
||||||
pos.y += trackRect.extent.y;
|
pos.y += trackRect.extent.y;
|
||||||
|
|
||||||
// Down Arrow.
|
// Down Arrow.
|
||||||
S32 downArrowBitmap = ( BmpStates * BmpDown );
|
S32 downArrowBitmap = ((U32)BmpStates * (U32)BmpDown );
|
||||||
if ( !mVBarEnabled )
|
if ( !mVBarEnabled )
|
||||||
{
|
{
|
||||||
downArrowBitmap += BmpDisabled;
|
downArrowBitmap += BmpDisabled;
|
||||||
|
|
@ -1167,9 +1167,9 @@ void GuiScrollCtrl::drawVScrollBar(const Point2I &offset)
|
||||||
pos.y = ( offset.y + mVThumbPos );
|
pos.y = ( offset.y + mVThumbPos );
|
||||||
|
|
||||||
// Determine the Bitmaps.
|
// Determine the Bitmaps.
|
||||||
S32 thumbBitmapTop = ( BmpStates * BmpVThumbTopCap );
|
S32 thumbBitmapTop = ((U32)BmpStates * (U32)BmpVThumbTopCap );
|
||||||
S32 thumbBitmapMiddle = ( BmpStates * BmpVThumb );
|
S32 thumbBitmapMiddle = ((U32)BmpStates * (U32)BmpVThumb );
|
||||||
S32 thumbBitmapBottom = ( BmpStates * BmpVThumbBottomCap );
|
S32 thumbBitmapBottom = ((U32)BmpStates * (U32)BmpVThumbBottomCap );
|
||||||
|
|
||||||
if ( mHitRegion == VertThumb && mStateDepressed )
|
if ( mHitRegion == VertThumb && mStateDepressed )
|
||||||
{
|
{
|
||||||
|
|
@ -1220,7 +1220,7 @@ void GuiScrollCtrl::drawHScrollBar(const Point2I &offset)
|
||||||
Point2I pos = ( offset + mLeftArrowRect.point );
|
Point2I pos = ( offset + mLeftArrowRect.point );
|
||||||
|
|
||||||
// Left Arrow.
|
// Left Arrow.
|
||||||
S32 leftArrowBitmap = ( BmpStates * BmpLeft );
|
S32 leftArrowBitmap = ((U32)BmpStates * (U32)BmpLeft );
|
||||||
if ( !mHBarEnabled )
|
if ( !mHBarEnabled )
|
||||||
{
|
{
|
||||||
leftArrowBitmap += BmpDisabled;
|
leftArrowBitmap += BmpDisabled;
|
||||||
|
|
@ -1239,7 +1239,7 @@ void GuiScrollCtrl::drawHScrollBar(const Point2I &offset)
|
||||||
pos.x += mBitmapBounds[leftArrowBitmap].extent.x;
|
pos.x += mBitmapBounds[leftArrowBitmap].extent.x;
|
||||||
|
|
||||||
// Track.
|
// Track.
|
||||||
S32 trackBitmap = ( BmpStates * BmpHPage );
|
S32 trackBitmap = ((U32)BmpStates * (U32)BmpHPage );
|
||||||
if ( !mHBarEnabled )
|
if ( !mHBarEnabled )
|
||||||
{
|
{
|
||||||
trackBitmap += BmpDisabled;
|
trackBitmap += BmpDisabled;
|
||||||
|
|
@ -1267,7 +1267,7 @@ void GuiScrollCtrl::drawHScrollBar(const Point2I &offset)
|
||||||
pos.x += trackRect.extent.x;
|
pos.x += trackRect.extent.x;
|
||||||
|
|
||||||
// Right Arrow.
|
// Right Arrow.
|
||||||
S32 rightArrowBitmap = ( BmpStates * BmpRight );
|
S32 rightArrowBitmap = ((U32)BmpStates * (U32)BmpRight );
|
||||||
if ( !mHBarEnabled )
|
if ( !mHBarEnabled )
|
||||||
{
|
{
|
||||||
rightArrowBitmap += BmpDisabled;
|
rightArrowBitmap += BmpDisabled;
|
||||||
|
|
@ -1292,9 +1292,9 @@ void GuiScrollCtrl::drawHScrollBar(const Point2I &offset)
|
||||||
pos.x = ( offset.x + mHThumbPos );
|
pos.x = ( offset.x + mHThumbPos );
|
||||||
|
|
||||||
// Determine the Bitmaps.
|
// Determine the Bitmaps.
|
||||||
S32 thumbBitmapLeft = ( BmpStates * BmpHThumbLeftCap );
|
S32 thumbBitmapLeft = ((U32)BmpStates * (U32)BmpHThumbLeftCap );
|
||||||
S32 thumbBitmapMiddle = ( BmpStates * BmpHThumb );
|
S32 thumbBitmapMiddle = ((U32)BmpStates * (U32)BmpHThumb );
|
||||||
S32 thumbBitmapRight = ( BmpStates * BmpHThumbRightCap );
|
S32 thumbBitmapRight = ((U32)BmpStates * (U32)BmpHThumbRightCap );
|
||||||
|
|
||||||
if ( mHitRegion == HorizThumb && mStateDepressed )
|
if ( mHitRegion == HorizThumb && mStateDepressed )
|
||||||
{
|
{
|
||||||
|
|
@ -1340,7 +1340,7 @@ void GuiScrollCtrl::drawScrollCorner(const Point2I &offset)
|
||||||
pos.x += mRightArrowRect.point.x + mRightArrowRect.extent.x - 1;
|
pos.x += mRightArrowRect.point.x + mRightArrowRect.extent.x - 1;
|
||||||
pos.y += mRightArrowRect.point.y;
|
pos.y += mRightArrowRect.point.y;
|
||||||
GFX->getDrawUtil()->clearBitmapModulation();
|
GFX->getDrawUtil()->clearBitmapModulation();
|
||||||
GFX->getDrawUtil()->drawBitmapSR(mTextureObject, pos, mBitmapBounds[BmpStates * BmpResize]);
|
GFX->getDrawUtil()->drawBitmapSR(mTextureObject, pos, mBitmapBounds[(U32)BmpStates * (U32)BmpResize]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,7 @@ bool GuiWindowCtrl::onWake()
|
||||||
mTextureObject = mProfile->getBitmapResource();
|
mTextureObject = mProfile->getBitmapResource();
|
||||||
|
|
||||||
mBitmapBounds = mProfile->mBitmapArrayRects.address();
|
mBitmapBounds = mProfile->mBitmapArrayRects.address();
|
||||||
S32 buttonHeight = mBitmapBounds[BmpStates * BmpClose].extent.y;
|
S32 buttonHeight = mBitmapBounds[(U32)BmpStates * (U32)BmpClose].extent.y;
|
||||||
|
|
||||||
mTitleHeight = buttonHeight + 4;
|
mTitleHeight = buttonHeight + 4;
|
||||||
|
|
||||||
|
|
@ -1397,7 +1397,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
// Draw the close button
|
// Draw the close button
|
||||||
Point2I tempUL;
|
Point2I tempUL;
|
||||||
Point2I tempLR;
|
Point2I tempLR;
|
||||||
S32 bmp = BmpStates * BmpClose;
|
S32 bmp = (U32)BmpStates * (U32)BmpClose;
|
||||||
|
|
||||||
if( mCanClose ) {
|
if( mCanClose ) {
|
||||||
if( mCloseButton.pointInRect( mMousePosition ) )
|
if( mCloseButton.pointInRect( mMousePosition ) )
|
||||||
|
|
@ -1414,9 +1414,9 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
|
|
||||||
// Draw the maximize button
|
// Draw the maximize button
|
||||||
if( mMaximized )
|
if( mMaximized )
|
||||||
bmp = BmpStates * BmpNormal;
|
bmp = (U32)BmpStates * (U32)BmpNormal;
|
||||||
else
|
else
|
||||||
bmp = BmpStates * BmpMaximize;
|
bmp = (U32)BmpStates * (U32)BmpMaximize;
|
||||||
|
|
||||||
if( mCanMaximize ) {
|
if( mCanMaximize ) {
|
||||||
if( mMaximizeButton.pointInRect( mMousePosition ) )
|
if( mMaximizeButton.pointInRect( mMousePosition ) )
|
||||||
|
|
@ -1433,9 +1433,9 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
|
||||||
|
|
||||||
// Draw the minimize button
|
// Draw the minimize button
|
||||||
if( mMinimized )
|
if( mMinimized )
|
||||||
bmp = BmpStates * BmpNormal;
|
bmp = (U32)BmpStates * (U32)BmpNormal;
|
||||||
else
|
else
|
||||||
bmp = BmpStates * BmpMinimize;
|
bmp = (U32)BmpStates * (U32)BmpMinimize;
|
||||||
|
|
||||||
if( mCanMinimize ) {
|
if( mCanMinimize ) {
|
||||||
if( mMinimizeButton.pointInRect( mMousePosition ) )
|
if( mMinimizeButton.pointInRect( mMousePosition ) )
|
||||||
|
|
@ -1502,8 +1502,8 @@ void GuiWindowCtrl::positionButtons(void)
|
||||||
if( !mBitmapBounds || !mAwake )
|
if( !mBitmapBounds || !mAwake )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
S32 buttonWidth = mBitmapBounds[BmpStates * BmpClose].extent.x;
|
S32 buttonWidth = mBitmapBounds[(U32)BmpStates * (U32)BmpClose].extent.x;
|
||||||
S32 buttonHeight = mBitmapBounds[BmpStates * BmpClose].extent.y;
|
S32 buttonHeight = mBitmapBounds[(U32)BmpStates * (U32)BmpClose].extent.y;
|
||||||
Point2I mainOff = mProfile->mTextOffset;
|
Point2I mainOff = mProfile->mTextOffset;
|
||||||
|
|
||||||
// Until a pref, if alignment is LEFT, put buttons RIGHT justified.
|
// Until a pref, if alignment is LEFT, put buttons RIGHT justified.
|
||||||
|
|
|
||||||
|
|
@ -1682,7 +1682,7 @@ bool clipFrustumByPolygon( const Point3F* points, U32 numPoints, const RectI& vi
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MAX_RESULT_VERTICES = 64,
|
MAX_RESULT_VERTICES = 64,
|
||||||
MAX_INPUT_VERTICES = MAX_RESULT_VERTICES - Frustum::PlaneCount // Clipping against each plane may add a vertex.
|
MAX_INPUT_VERTICES = (U32)MAX_RESULT_VERTICES - (U32)Frustum::PlaneCount // Clipping against each plane may add a vertex.
|
||||||
};
|
};
|
||||||
|
|
||||||
AssertFatal( numPoints <= MAX_INPUT_VERTICES, "MathUtils::clipFrustumByPolygon - Too many vertices!" );
|
AssertFatal( numPoints <= MAX_INPUT_VERTICES, "MathUtils::clipFrustumByPolygon - Too many vertices!" );
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ void CoverPoint::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatIn
|
||||||
|
|
||||||
// Data for decorations.
|
// Data for decorations.
|
||||||
GFXStateBlockDesc desc;
|
GFXStateBlockDesc desc;
|
||||||
F32 height = (float)(mSize + 1) / NumSizes * 2.0f;
|
F32 height = (float)(mSize + 1) / (F32)NumSizes * 2.0f;
|
||||||
|
|
||||||
// Draw an X if we're occupied.
|
// Draw an X if we're occupied.
|
||||||
if(isOccupied())
|
if(isOccupied())
|
||||||
|
|
|
||||||
|
|
@ -1293,7 +1293,7 @@ bool NavMesh::testEdgeCover(const Point3F &pos, const VectorF &dir, CoverPointDa
|
||||||
U32 hits = 0;
|
U32 hits = 0;
|
||||||
for(U32 j = 0; j < CoverPoint::NumSizes; j++)
|
for(U32 j = 0; j < CoverPoint::NumSizes; j++)
|
||||||
{
|
{
|
||||||
Point3F test = pos + Point3F(0.0f, 0.0f, mWalkableHeight * j / CoverPoint::NumSizes);
|
Point3F test = pos + Point3F(0.0f, 0.0f, mWalkableHeight * j / (F32)CoverPoint::NumSizes);
|
||||||
if(getContainer()->castRay(test, test + norm * mCoverDist, StaticObjectType, &ray))
|
if(getContainer()->castRay(test, test + norm * mCoverDist, StaticObjectType, &ray))
|
||||||
{
|
{
|
||||||
// Test peeking.
|
// Test peeking.
|
||||||
|
|
|
||||||
|
|
@ -1921,20 +1921,20 @@ private:
|
||||||
kInlineStrFlag = 0x1000,
|
kInlineStrFlag = 0x1000,
|
||||||
|
|
||||||
// Initial flags of different types.
|
// Initial flags of different types.
|
||||||
kNullFlag = kNullType,
|
kNullFlag = (U32)kNullType,
|
||||||
kTrueFlag = kTrueType | kBoolFlag,
|
kTrueFlag = (U32)kTrueType | (U32)kBoolFlag,
|
||||||
kFalseFlag = kFalseType | kBoolFlag,
|
kFalseFlag = (U32)kFalseType | (U32)kBoolFlag,
|
||||||
kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,
|
kNumberIntFlag = (U32)kNumberType | (U32)kNumberFlag | (U32)kIntFlag | (U32)kInt64Flag,
|
||||||
kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,
|
kNumberUintFlag = (U32)kNumberType | (U32)kNumberFlag | (U32)kUintFlag | (U32)kUint64Flag | (U32)kInt64Flag,
|
||||||
kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
|
kNumberInt64Flag = (U32)kNumberType | (U32)kNumberFlag | kInt64Flag,
|
||||||
kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,
|
kNumberUint64Flag = (U32)kNumberType | (U32)kNumberFlag | (U32)kUint64Flag,
|
||||||
kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,
|
kNumberDoubleFlag = (U32)kNumberType | (U32)kNumberFlag | (U32)kDoubleFlag,
|
||||||
kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag,
|
kNumberAnyFlag = (U32)kNumberType | (U32)kNumberFlag | (U32)kIntFlag | (U32)kInt64Flag | (U32)kUintFlag | (U32)kUint64Flag | (U32)kDoubleFlag,
|
||||||
kConstStringFlag = kStringType | kStringFlag,
|
kConstStringFlag = (U32)kStringType | (U32)kStringFlag,
|
||||||
kCopyStringFlag = kStringType | kStringFlag | kCopyFlag,
|
kCopyStringFlag = (U32)kStringType | (U32)kStringFlag | (U32)kCopyFlag,
|
||||||
kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag,
|
kShortStringFlag = (U32)kStringType | (U32)kStringFlag | (U32)kCopyFlag | (U32)kInlineStrFlag,
|
||||||
kObjectFlag = kObjectType,
|
kObjectFlag = (U32)kObjectType,
|
||||||
kArrayFlag = kArrayType,
|
kArrayFlag = (U32)kArrayType,
|
||||||
|
|
||||||
kTypeMask = 0x07
|
kTypeMask = 0x07
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -116,12 +116,12 @@ void TSShapeLoader::generateNodeTransform(AppNode* node, F32 t, bool blend, F32
|
||||||
void TSShapeLoader::updateProgress(S32 major, const char* msg, S32 numMinor, S32 minor)
|
void TSShapeLoader::updateProgress(S32 major, const char* msg, S32 numMinor, S32 minor)
|
||||||
{
|
{
|
||||||
// Calculate progress value
|
// Calculate progress value
|
||||||
F32 progress = (F32)major / NumLoadPhases;
|
F32 progress = (F32)major / (F32)NumLoadPhases;
|
||||||
const char *progressMsg = msg;
|
const char *progressMsg = msg;
|
||||||
|
|
||||||
if (numMinor)
|
if (numMinor)
|
||||||
{
|
{
|
||||||
progress += (minor * (1.0f / NumLoadPhases) / numMinor);
|
progress += (minor * (1.0f / (F32)NumLoadPhases) / numMinor);
|
||||||
progressMsg = avar("%s (%d of %d)", msg, minor + 1, numMinor);
|
progressMsg = avar("%s (%d of %d)", msg, minor + 1, numMinor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue