uninitialized variables-afx

This commit is contained in:
AzaezelX 2020-05-11 13:54:23 -05:00
parent 157b114ec7
commit 3c0360fd2f
22 changed files with 88 additions and 25 deletions

View file

@ -1033,6 +1033,14 @@ LightningBolt::LightningBolt()
elapsedTime = 0.0f;
lifetime = 1.0f;
startRender = false;
endPoint.zero();
width = 1;
numMajorNodes = 10;
maxMajorAngle = 30.0f;
numMinorNodes = 4;
maxMinorAngle = 15.0f;
fadeTime = 0.2f;
renderTime = 0.125;
}
//--------------------------------------------------------------------------

View file

@ -147,8 +147,6 @@ public:
DECLARE_CATEGORY("AFX");
private: // 3POV SECTION
U32 mBlockers_mask_3pov;
void cam_update_3pov(F32 dt, bool on_server);
bool avoid_blocked_view(const Point3F& start, const Point3F& end, Point3F& newpos);
bool test_blocked_line(const Point3F& start, const Point3F& end);

View file

@ -1904,6 +1904,9 @@ afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr)
{
mEffect_name = ST_NULLSTRING;
mEffect = 0;
mClip_tag = 0;
mIs_death_clip = false;
mLock_tag = 0;
}
afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr, StringTableEntry effect_name)
@ -1911,6 +1914,9 @@ afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr, StringTableEntry
{
mEffect_name = effect_name;
mEffect = 0;
mClip_tag = 0;
mIs_death_clip = false;
mLock_tag = 0;
}
afxEffectConstraint::~afxEffectConstraint()

View file

@ -98,6 +98,7 @@ afxEffectVector::afxEffectVector()
mOn_server = false;
mTotal_fx_dur = 0;
mAfter_life = 0;
mPhrase_dur = 0;
}
afxEffectVector::~afxEffectVector()

View file

@ -298,8 +298,6 @@ protected:
bool mIn_scope;
bool mIs_aborted;
U8 mEffect_flags;
afxXM_Base* mXfm_modifiers[MAX_XFM_MODIFIERS];
F32 mLive_scale_factor;

View file

@ -168,13 +168,14 @@ afxMagicMissileData::afxMagicMissileData()
impactForce = 0.0f;
armingDelay = 0;
fadeDelay = 20000 / 32;
lifetime = 20000 / 32;
activateSeq = -1;
maintainSeq = -1;
*/
lifetime = 20000 / 32;
fadeDelay = 20000 / 32;
gravityMod = 1.0;
/* From stock Projectile code...
bounceElasticity = 0.999f;

View file

@ -58,6 +58,10 @@ afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer()
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer(F32 renderOrder, F32 processAddOrder)
@ -66,6 +70,10 @@ afxZodiacGroundPlaneRenderer::afxZodiacGroundPlaneRenderer(F32 renderOrder, F32
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacGroundPlaneRenderer::~afxZodiacGroundPlaneRenderer()

View file

@ -58,6 +58,10 @@ afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer()
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer(F32 renderOrder, F32 processAddOrder)
@ -66,6 +70,10 @@ afxZodiacMeshRoadRenderer::afxZodiacMeshRoadRenderer(F32 renderOrder, F32 proces
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacMeshRoadRenderer::~afxZodiacMeshRoadRenderer()

View file

@ -58,6 +58,10 @@ afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer()
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer(F32 renderOrder, F32 processAddOrder)
@ -66,6 +70,10 @@ afxZodiacPolysoupRenderer::afxZodiacPolysoupRenderer(F32 renderOrder, F32 proces
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacPolysoupRenderer::~afxZodiacPolysoupRenderer()

View file

@ -68,6 +68,10 @@ afxZodiacTerrainRenderer::afxZodiacTerrainRenderer()
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacTerrainRenderer::afxZodiacTerrainRenderer(F32 renderOrder, F32 processAddOrder)
@ -76,6 +80,10 @@ afxZodiacTerrainRenderer::afxZodiacTerrainRenderer(F32 renderOrder, F32 processA
if (!master)
master = this;
shader_initialized = false;
zodiac_shader = NULL;
shader_consts = NULL;
projection_sc = NULL;
color_sc = NULL;
}
afxZodiacTerrainRenderer::~afxZodiacTerrainRenderer()

View file

@ -105,6 +105,11 @@ afxModelData::afxModelData(const afxModelData& other, bool temp_clone) : GameBas
customAmbientForSelfIllumination = other.customAmbientForSelfIllumination;
customAmbientLighting = other.customAmbientLighting;
shadowEnable = other.shadowEnable;
shadowSize = other.shadowSize;
shadowMaxVisibleDistance = other.shadowMaxVisibleDistance;
shadowProjectionDistance = other.shadowProjectionDistance;
shadowSphereAdjust = other.shadowSphereAdjust;
}
afxModelData::~afxModelData()
@ -360,7 +365,7 @@ afxModel::afxModel()
fade_amt = 1.0f;
is_visible = true;
sort_priority = 0;
mDataBlock = NULL;
mNetFlags.set( IsGhost );
}

View file

@ -133,6 +133,7 @@ afxMooring::afxMooring()
chor_id = 0;
hookup_with_chor = false;
ghost_cons_name = ST_NULLSTRING;
mDataBlock = NULL;
}
afxMooring::afxMooring(U32 networking, U32 chor_id, StringTableEntry cons_name)
@ -160,6 +161,7 @@ afxMooring::afxMooring(U32 networking, U32 chor_id, StringTableEntry cons_name)
this->chor_id = chor_id;
hookup_with_chor = false;
this->ghost_cons_name = cons_name;
mDataBlock = NULL;
}
afxMooring::~afxMooring()
@ -275,4 +277,4 @@ void afxMooring::onRemove()
Parent::onRemove();
}
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -687,6 +687,7 @@ bool afxParticleEmitterDiscData::preload(bool server, String &errorStr)
afxParticleEmitter::afxParticleEmitter()
{
mDataBlock = NULL;
pe_vector.set(0,0,1);
pe_vector_norm.set(0,0,1);
tpaths.clear();
@ -1086,6 +1087,7 @@ void afxParticleEmitter::emitParticlesExt(const MatrixF& xfm, const Point3F& poi
afxParticleEmitterVector::afxParticleEmitterVector()
{
mDataBlock = NULL;
}
afxParticleEmitterVector::~afxParticleEmitterVector()
@ -1151,6 +1153,7 @@ void afxParticleEmitterVector::sub_preCompute(const MatrixF& mat)
afxParticleEmitterCone::afxParticleEmitterCone()
{
mDataBlock = NULL;
cone_v.set(0,0,1);
cone_s0.set(0,0,1);
cone_s1.set(0,0,1);
@ -1266,6 +1269,7 @@ void afxParticleEmitterCone::sub_preCompute(const MatrixF& mat)
afxParticleEmitterPath::afxParticleEmitterPath()
{
mDataBlock = NULL;
epaths.clear();
epath_mults.clear();
n_epath_points = 0;
@ -1521,6 +1525,7 @@ void afxParticleEmitterPath::groundConformPoint(Point3F& point, const MatrixF& m
afxParticleEmitterDisc::afxParticleEmitterDisc()
{
mDataBlock = NULL;
disc_v.set(0,0,1);
disc_r.set(1,0,0);
}

View file

@ -122,6 +122,7 @@ ConsoleDocClass( afxStaticShape,
afxStaticShape::afxStaticShape()
{
mDataBlock = NULL;
mAFX_data = 0;
mIs_visible = true;
mChor_id = 0;
@ -238,4 +239,4 @@ void afxStaticShape::prepRenderImage(SceneRenderState* state)
Parent::prepRenderImage(state);
}
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -114,6 +114,7 @@ afxZodiacData::afxZodiacData()
grade_range_user.set(0.0f, 45.0f);
afxZodiacData::convertGradientRangeFromDegrees(grade_range, grade_range_user);
inv_grade_range = false;
zflags = 0;
}
afxZodiacData::afxZodiacData(const afxZodiacData& other, bool temp_clone) : GameBaseData(other, temp_clone)

View file

@ -61,7 +61,7 @@ afxZodiacPlaneData::afxZodiacPlaneData()
color.set(1,1,1,1);
blend_flags = BLEND_NORMAL;
respect_ori_cons = false;
zflags = 0;
double_sided = true;
face_dir = FACES_UP;
use_full_xfm = false;
@ -310,4 +310,4 @@ void afxZodiacPlane::onRemove()
Parent::onRemove();
}
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -75,6 +75,7 @@ afxEA_PhraseEffect::afxEA_PhraseEffect()
{
phrase_fx_data = 0;
active_phrases = &_phrases_a;
last_trigger_mask = 0;
}
afxEA_PhraseEffect::~afxEA_PhraseEffect()

View file

@ -60,7 +60,7 @@ class afxF_Drag : public afxForce
typedef afxForce Parent;
private:
afxF_DragData* datablock;
afxF_DragData* mDatablock;
F32 air_friction_constant;
public:
@ -149,13 +149,14 @@ afxForceData* afxF_DragData::cloneAndPerformSubstitutions(const SimObject* owner
afxF_Drag::afxF_Drag() : afxForce()
{
mDatablock = NULL;
air_friction_constant = 1.0f;
}
bool afxF_Drag::onNewDataBlock(afxForceData* dptr, bool reload)
{
datablock = dynamic_cast<afxF_DragData*>(dptr);
if (!datablock || !Parent::onNewDataBlock(dptr, reload))
mDatablock = dynamic_cast<afxF_DragData*>(dptr);
if (!mDatablock || !Parent::onNewDataBlock(dptr, reload))
return false;
return true;
@ -163,9 +164,9 @@ bool afxF_Drag::onNewDataBlock(afxForceData* dptr, bool reload)
void afxF_Drag::start()
{
air_friction_constant = 0.5f * datablock->drag_coefficient
* datablock->air_density
* datablock->cross_sectional_area;
air_friction_constant = 0.5f * mDatablock->drag_coefficient
* mDatablock->air_density
* mDatablock->cross_sectional_area;
//Con::printf("Air Friction: %f", air_friction_constant);
}

View file

@ -58,7 +58,7 @@ class afxF_Gravity : public afxForce
typedef afxForce Parent;
private:
afxF_GravityData* datablock;
afxF_GravityData* mDatablock;
public:
/*C*/ afxF_Gravity();
@ -133,12 +133,13 @@ afxForceData* afxF_GravityData::cloneAndPerformSubstitutions(const SimObject* ow
afxF_Gravity::afxF_Gravity() : afxForce()
{
mDatablock = NULL;
}
bool afxF_Gravity::onNewDataBlock(afxForceData* dptr, bool reload)
{
datablock = dynamic_cast<afxF_GravityData*>(dptr);
if (!datablock || !Parent::onNewDataBlock(dptr, reload))
mDatablock = dynamic_cast<afxF_GravityData*>(dptr);
if (!mDatablock || !Parent::onNewDataBlock(dptr, reload))
return false;
return true;
@ -146,7 +147,7 @@ bool afxF_Gravity::onNewDataBlock(afxForceData* dptr, bool reload)
Point3F afxF_Gravity::evaluate(Point3F pos, Point3F v, F32 mass)
{
return Point3F(0,0,-datablock->gravity)*mass;
return Point3F(0,0,-mDatablock->gravity)*mass;
}

View file

@ -29,6 +29,8 @@
afxAnimCurve::afxAnimCurve() : usable( false ), final_value( 0.0f ), start_value( 0.0f )
{
evaluator = new afxHermiteEval();
final_time = 0.0f;
start_time = 0.0f;
}
afxAnimCurve::~afxAnimCurve()
@ -277,4 +279,4 @@ void afxAnimCurve::printKey( int index )
{
Key &k = keys[index];
Con::printf( "%f: %f", k.time, k.value );
}
}

View file

@ -27,7 +27,7 @@
#include "afx/util/afxCurveEval.h"
#include "afx/util/afxCurve3D.h"
afxCurve3D::afxCurve3D() : usable( false ), default_vector( 0, 0, 0 )
afxCurve3D::afxCurve3D() : usable( false ), default_vector( 0, 0, 0 ), flip(false)
{
evaluator = new afxHermiteEval();
}
@ -329,4 +329,4 @@ void afxCurve3D::print()
Con::printf( "%f: %f %f %f", p.parameter, p.point.x, p.point.y, p.point.z );
}
Con::printf( "---------------------------------" );
}
}

View file

@ -29,7 +29,7 @@
#include "afx/util/afxPath3D.h"
afxPath3D::afxPath3D() : mStart_time(0), mNum_points(0), mLoop_type(LOOP_CONSTANT)
afxPath3D::afxPath3D() : mStart_time(0), mNum_points(0), mLoop_type(LOOP_CONSTANT), mEnd_time(0.0f)
{
}