mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +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
|
|
@ -827,8 +827,8 @@ void afxEffectWrapper::prestart()
|
|||
if ((mEW_timing.fade_in_time + mEW_timing.fade_out_time) > 0.0f)
|
||||
{
|
||||
mFade_in_end = mEW_timing.delay + mEW_timing.fade_in_time;
|
||||
if (mFull_lifetime == INFINITE_LIFETIME)
|
||||
mFade_out_start = INFINITE_LIFETIME;
|
||||
if (mFull_lifetime == (F32)INFINITE_LIFETIME)
|
||||
mFade_out_start = (F32)INFINITE_LIFETIME;
|
||||
else
|
||||
mFade_out_start = mEW_timing.delay + mEW_timing.lifetime;
|
||||
mDo_fade_inout = true;
|
||||
|
|
@ -1088,7 +1088,7 @@ void afxEffectWrapper::stop()
|
|||
mStopped = true;
|
||||
|
||||
// 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();
|
||||
mLife_end = mElapsed;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ bool afxEA_AnimClip::ea_start()
|
|||
do_runtime_substitutions();
|
||||
|
||||
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);
|
||||
else
|
||||
anim_lifetime = mFull_lifetime;
|
||||
|
|
@ -197,4 +197,4 @@ bool afxEA_AnimClipDesc::requiresStop(const afxEffectWrapperData* ew, const afxE
|
|||
return (timing.lifetime < 0);
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ bool afxEA_CameraShake::ea_start()
|
|||
|
||||
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.");
|
||||
return false;
|
||||
|
|
@ -193,4 +193,4 @@ bool afxEA_CameraShakeDesc::requiresStop(const afxEffectWrapperData* ew, const a
|
|||
return (timing.lifetime < 0);
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ afxXM_WeightedBaseData::afxXM_WeightedBaseData(const afxXM_WeightedBaseData& oth
|
|||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue