mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Put problematic printf into ptrstructinit
It turns out the bug I was chasing in set_poses was not the data getting lost or incorrect data being read, but the arguments to printf being set from the parent pose `p` before `p` had actually been set.
This commit is contained in:
parent
00781160e2
commit
07ef862c52
1 changed files with 3 additions and 0 deletions
|
@ -129,6 +129,9 @@ set_poses (armature_t *arm, iqmjoint_t *joints, int num_joints)
|
|||
for (int i = 0; i < num_joints; i++) {
|
||||
if (joints[i].parent >= 0) {
|
||||
auto p = arm.pose[joints[i].parent];
|
||||
// printf IS the bug: its parameters get set before p is loaded,
|
||||
// otherwise this code compiles correctly
|
||||
printf ("%q %q %q\n", p.translate, p.rotate, p.scale);
|
||||
arm.pose[i] = {
|
||||
.translate = p.translate + [(quaternion)p.rotate * joints[i].translate, 0],
|
||||
.rotate = (quaternion)p.rotate * joints[i].rotate,
|
||||
|
|
Loading…
Reference in a new issue