From 63aa4b1036474543967ddef2f29f0834d056b519 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 13 Jan 2013 22:37:34 +0100 Subject: [PATCH] 3c96e19610 for d3xp/ - fix miscompilation with gcc 4.5 idAnimator::GetJointLocalTransform() miscompiles with gcc 4.5 and -ftree-vrp (implied by -O2). Reorder code to avoid the compiler bug, no functional change. The original commit was for game/ only, but d3xp/ will have the same issues.. --- d3xp/anim/Anim_Blend.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/d3xp/anim/Anim_Blend.cpp b/d3xp/anim/Anim_Blend.cpp index 842d00f..da1249a 100644 --- a/d3xp/anim/Anim_Blend.cpp +++ b/d3xp/anim/Anim_Blend.cpp @@ -4558,16 +4558,18 @@ bool idAnimator::GetJointLocalTransform( jointHandle_t jointHandle, int currentT // FIXME: overkill CreateFrame( currentTime, false ); - if ( jointHandle > 0 ) { - idJointMat m = joints[ jointHandle ]; - m /= joints[ modelJoints[ jointHandle ].parentNum ]; - offset = m.ToVec3(); - axis = m.ToMat3(); - } else { + if ( jointHandle == 0 ) { offset = joints[ jointHandle ].ToVec3(); axis = joints[ jointHandle ].ToMat3(); + + return true; } + idJointMat m = joints[ jointHandle ]; + m /= joints[ modelJoints[ jointHandle ].parentNum ]; + offset = m.ToVec3(); + axis = m.ToMat3(); + return true; }