-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
d_a_msw #662
d_a_msw #662
Conversation
@@ -2,10 +2,31 @@ | |||
#define D_A_MSW_H | |||
|
|||
#include "f_op/f_op_actor.h" | |||
#include "SSystem/SComponent/c_phase.h" | |||
#include "d/d_bg_w.h" | |||
#include "d/d_cc_d.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since dBgW is only used as a pointer, you can forward-declare it in the header.
class dBgW;
angle1 = -cM_atan2s(tmp.y, tmp.z); | ||
|
||
// TODO: std::sqrtf(float) | ||
angle2 = cM_atan2s(tmp.x, sqrtf(tmp.y * tmp.y + tmp.z * tmp.z)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the sqrtf not just tmp.absXZ()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not in the debug map.
I'm pretty sure that d_a_msw was written very early in development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absXZ calls VECSquareMag so it wouldn't match anyway.
I think the team that did the C-style actors never used absXZ since I've seen this sqrtf(x*x + z*z)
written out manually a lot in them (maybe a macro?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absXZ calls VECSquareMag so it wouldn't match anyway. I think the team that did the C-style actors never used absXZ since I've seen this
sqrtf(x*x + z*z)
written out manually a lot in them (maybe a macro?)
I find it unlikely that they used a macro since there's not really any benefit to using macros for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it doesn't really matter in this case. All three of us have apparently misread the code.
i_this->m298 += 1; | ||
|
||
// WTH? | ||
// Branchless comparison |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably something #ifdef'd out for debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than a switch statement, another way to get MWCC to generate a branchless comparison is with this trick using a self-assign on any float member variable that gets optimized out:
if (i_this->m29A == 0) {
i_this->speedF = i_this->speedF;
}
but without knowing what i_this->m29A there's no way to know what they actually wrote
#125
Mostly matching except for regalloc issue in
daMsw_Execute