Skip to content
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

Reorganizing fix library #195

Merged
merged 5 commits into from May 3, 2024
Merged

Conversation

winterheart
Copy link
Collaborator

Fixed point math library was part of the Vector math library until it was splitted to its own. Before that there was bundled version of vecmat code in scripts. This PR makes the library an isolated submodule that can be linked to any other.

Additional enhancements includes fixing minor warnings and removing unused Mac OS and Windows asm code.

Copy link
Collaborator

@Lgt2x Lgt2x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit. Tested on linux. Maybe a second pair of eyes could be useful @jcoby @Arcnor ?

@JeodC
Copy link
Member

JeodC commented Apr 29, 2024

This is requiring zlib1.dll in installdir. Is this intentional? (Debug/windows) -- game runs fine otherwise.

@@ -100,9 +97,6 @@ void InitMathTables() {

asin_table[256] = asin_table[255];
acos_table[256] = acos_table[255];

// Initialize a random seed.
ps_srand(time(NULL));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not needed to initialize the random number generator?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they relocated seed initialization to init.cpp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random seed was injected into InitMathTables when it was part of vecmat submodule. Logically seed initialization not belongs to vecmat or fixmat components so I decided to move it out to common initialization function.

Fix most of "narrowing conversion" warnings.
Seem this was done to ease linking mission dlls. Now these missions are reusing fix as static library.
Seems this is totally unrelated to fix library API. Moved ps_srand() to appropriate places right after InitMathTables();
@JeodC JeodC merged commit 940f4ff into DescentDevelopers:main May 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants