-
Notifications
You must be signed in to change notification settings - Fork 87
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
CCover #621
base: master
Are you sure you want to change the base?
CCover #621
Conversation
now ctor automatically sets m_nMaxPedsInCover to 0;
Note for future: We're usually reversing per-class basis. If you want to reverse all of |
It's fine I do functions only time to time too. |
btw the codes that I wrote are not clean, I'll reverse whole CCover and then make the code more cleaner. |
vector.x = (float)sin(direction * 0.02454369); | ||
vector.y = (float)cos(direction * 0.02454369); | ||
vector.z = 0.0; | ||
return vector; | ||
} | ||
|
||
// unused | ||
// 0x698790 | ||
CVector CCover::FindVectorFromFirstToMissingVertex(CColTriangle* triangle, int32* a3, CVector* vertPositions) { |
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.
CVector CCover::FindVectorFromFirstToMissingVertex(CColTriangle *tri, uint32 *sharedVert, CVector *vertices)
source/game_sa/Cover.cpp
Outdated
vector.x = (float)sin(direction * 0.02454369); | ||
vector.y = (float)cos(direction * 0.02454369); | ||
vector.z = 0.0; |
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.
vector.x = (float)sin(direction * 0.02454369); | |
vector.y = (float)cos(direction * 0.02454369); | |
vector.z = 0.0; | |
vector.x = -sinf(direction * 0.02454369f); | |
vector.y = cosf(direction * 0.02454369f); | |
vector.z = 0.0f; |
How do you like the idea of adding the following functions to common.h and using them?:
constexpr inline uint8_t CompressRad(float rad) { return (uint8)(rad * (128.0f / PI)); }
constexpr inline float DecompressRad(uint8 rad) { return (float)rad * (PI / 128.0f); }
Then it can be implemented like this:
return CVector{
-std::sinf(DecompressRad(direction)),
std::cosf(DecompressRad(direction)),
0.0f
};
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.
How do you like the idea of adding the following functions to common.h and using them?
FixedFloat<uint8, 128.0f / PI>
can be used for this purpose
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.
We could also typedef it for this purpose.
using FixedRadians = FixedFloat<uint8, 128.0f / PI>
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.
that's kinda errnous tho, it should be 255 / PI... Though seemingly they did use 256 instead, which might've lead to overflows... :D
…into alom4hdi/patch-1
No description provided.