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..
This commit is contained in:
Daniel Gibson 2013-01-13 22:37:34 +01:00
parent ba549be284
commit 63aa4b1036

View file

@ -4558,15 +4558,17 @@ bool idAnimator::GetJointLocalTransform( jointHandle_t jointHandle, int currentT
// FIXME: overkill
CreateFrame( currentTime, false );
if ( jointHandle > 0 ) {
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();
} else {
offset = joints[ jointHandle ].ToVec3();
axis = joints[ jointHandle ].ToMat3();
}
return true;
}