Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ void Animatable3DObjClass::Render(RenderInfoClass & rinfo)
return;
}

if (!Is_Hierarchy_Valid() || Are_Sub_Object_Transforms_Dirty()) {
//
// Force the hierarchy to be recalculated for single animations.
//
const bool isSingleAnim = CurMotionMode == SINGLE_ANIM && ModeAnim.AnimMode != ANIM_MODE_MANUAL;

if (isSingleAnim || !Is_Hierarchy_Valid() || Are_Sub_Object_Transforms_Dirty()) {
Update_Sub_Object_Transforms();
}
}
Expand All @@ -307,7 +312,12 @@ void Animatable3DObjClass::Special_Render(SpecialRenderInfoClass & rinfo)
{
if (HTree == NULL) return;

if (!Is_Hierarchy_Valid()) {
//
// Force the hierarchy to be recalculated for single animations.
//
const bool isSingleAnim = CurMotionMode == SINGLE_ANIM && ModeAnim.AnimMode != ANIM_MODE_MANUAL;

if (isSingleAnim || !Is_Hierarchy_Valid()) {
Update_Sub_Object_Transforms();
}
}
Expand Down Expand Up @@ -805,7 +815,7 @@ void Animatable3DObjClass::Update_Sub_Object_Transforms(void)
ModeInterp.PrevFrame1 = AnimatedSoundMgrClass::Trigger_Sound(ModeInterp.Motion1, ModeInterp.PrevFrame1, ModeInterp.Frame1, HTree->Get_Transform(ModeInterp.Motion1->Get_Embedded_Sound_Bone_Index()));
}

break;
break;

case MULTIPLE_ANIM:
{
Expand Down Expand Up @@ -1025,19 +1035,13 @@ void Animatable3DObjClass::Single_Anim_Progress (void)
//
// Update the current frame (only works in "SINGLE_ANIM" mode!)
//
if (CurMotionMode == SINGLE_ANIM) {
WWASSERT(CurMotionMode == SINGLE_ANIM);

//
// Update the frame number and sync time
//
ModeAnim.PrevFrame = ModeAnim.Frame;
ModeAnim.Frame = Compute_Current_Frame(&ModeAnim.animDirection);

//
// Force the hierarchy to be recalculated
//
Set_Hierarchy_Valid (false);
}
//
// Update the frame number and sync time
//
ModeAnim.PrevFrame = ModeAnim.Frame;
ModeAnim.Frame = Compute_Current_Frame(&ModeAnim.animDirection);
}


Expand Down
8 changes: 4 additions & 4 deletions Generals/Code/Libraries/Source/WWVegas/WW3D2/animobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Animatable3DObjClass : public CompositeRenderObjClass

//
// Simple bone evaluation methods for when the caller doesn't want
// to update the heirarchy, but needs to know the transform of
// to update the hierarchy, but needs to know the transform of
// a bone at a given frame.
//
virtual bool Simple_Evaluate_Bone(int boneindex, Matrix3D *tm) const;
Expand Down Expand Up @@ -153,14 +153,14 @@ class Animatable3DObjClass : public CompositeRenderObjClass
void Combo_Update( const Matrix3D & root,
HAnimComboClass *anim);

// flag to kep track of whether the hierarchy tree transforms are currently valid
// flag to keep track of whether the hierarchy tree transforms are currently valid
bool Is_Hierarchy_Valid(void) const { return IsTreeValid; }
void Set_Hierarchy_Valid(bool onoff) const { IsTreeValid = onoff; }

// Progress anims for single anim (loop and once)
// Progress animations for single anim (loop and once)
void Single_Anim_Progress( void );

// Release any anims
// Release any animations
void Release( void );

protected:
Expand Down
34 changes: 19 additions & 15 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ void Animatable3DObjClass::Render(RenderInfoClass & rinfo)
return;
}

if (!Is_Hierarchy_Valid() || Are_Sub_Object_Transforms_Dirty()) {
//
// Force the hierarchy to be recalculated for single animations.
//
const bool isSingleAnim = CurMotionMode == SINGLE_ANIM && ModeAnim.AnimMode != ANIM_MODE_MANUAL;

if (isSingleAnim || !Is_Hierarchy_Valid() || Are_Sub_Object_Transforms_Dirty()) {
Update_Sub_Object_Transforms();
}
}
Expand All @@ -307,7 +312,12 @@ void Animatable3DObjClass::Special_Render(SpecialRenderInfoClass & rinfo)
{
if (HTree == NULL) return;

if (!Is_Hierarchy_Valid()) {
//
// Force the hierarchy to be recalculated for single animations.
//
const bool isSingleAnim = CurMotionMode == SINGLE_ANIM && ModeAnim.AnimMode != ANIM_MODE_MANUAL;

if (isSingleAnim || !Is_Hierarchy_Valid()) {
Update_Sub_Object_Transforms();
}
}
Expand Down Expand Up @@ -804,7 +814,7 @@ void Animatable3DObjClass::Update_Sub_Object_Transforms(void)
ModeInterp.PrevFrame1 = AnimatedSoundMgrClass::Trigger_Sound(ModeInterp.Motion1, ModeInterp.PrevFrame1, ModeInterp.Frame1, HTree->Get_Transform(ModeInterp.Motion1->Get_Embedded_Sound_Bone_Index()));
}

break;
break;

case MULTIPLE_ANIM:
{
Expand Down Expand Up @@ -1033,19 +1043,13 @@ void Animatable3DObjClass::Single_Anim_Progress (void)
//
// Update the current frame (only works in "SINGLE_ANIM" mode!)
//
if (CurMotionMode == SINGLE_ANIM) {
WWASSERT(CurMotionMode == SINGLE_ANIM);

//
// Update the frame number and sync time
//
ModeAnim.PrevFrame = ModeAnim.Frame;
ModeAnim.Frame = Compute_Current_Frame(&ModeAnim.animDirection);

//
// Force the hierarchy to be recalculated
//
Set_Hierarchy_Valid (false);
}
//
// Update the frame number and sync time
//
ModeAnim.PrevFrame = ModeAnim.Frame;
ModeAnim.Frame = Compute_Current_Frame(&ModeAnim.animDirection);
}


Expand Down
8 changes: 4 additions & 4 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/animobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Animatable3DObjClass : public CompositeRenderObjClass

//
// Simple bone evaluation methods for when the caller doesn't want
// to update the heirarchy, but needs to know the transform of
// to update the hierarchy, but needs to know the transform of
// a bone at a given frame.
//
virtual bool Simple_Evaluate_Bone(int boneindex, Matrix3D *tm) const;
Expand Down Expand Up @@ -153,14 +153,14 @@ class Animatable3DObjClass : public CompositeRenderObjClass
void Combo_Update( const Matrix3D & root,
HAnimComboClass *anim);

// flag to kep track of whether the hierarchy tree transforms are currently valid
// flag to keep track of whether the hierarchy tree transforms are currently valid
bool Is_Hierarchy_Valid(void) const { return IsTreeValid; }
void Set_Hierarchy_Valid(bool onoff) const { IsTreeValid = onoff; }

// Progress anims for single anim (loop and once)
// Progress animations for single anim (loop and once)
void Single_Anim_Progress( void );

// Release any anims
// Release any animations
void Release( void );

protected:
Expand Down
Loading