Skip to content

a few pstypes changes and refinements#6506

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:pstypes_changes
Feb 2, 2025
Merged

a few pstypes changes and refinements#6506
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:pstypes_changes

Conversation

@Goober5000

@Goober5000 Goober5000 commented Jan 6, 2025

Copy link
Copy Markdown
Contributor

Several changes related to the volumetrics model fix:

  1. Update the model_load() prototype with better parameter names, including a new ErrorType enum defined in pstypes.h
  2. Update the MIN, MAX, and CLAMP macros, all of which were susceptible to performance issues because they duplicated their tokens. This could cause functions or calculations to be re-run unnecessarily. Since the codebase is now on C++17, std::clamp() can be used.
  3. Update the rest of the codebase to fix any associated issues.

Currently in draft as this depends on #6505.

@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability labels Jan 6, 2025
@Goober5000 Goober5000 force-pushed the pstypes_changes branch 4 times, most recently from c8aa664 to 911edfb Compare January 6, 2025 18:03
@Goober5000 Goober5000 marked this pull request as ready for review January 6, 2025 18:03

@wookieejedi wookieejedi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good and works in my tests

@Goober5000 Goober5000 marked this pull request as draft January 10, 2025 21:12
@Goober5000

Copy link
Copy Markdown
Contributor Author

Putting this in draft until #6465 is merged, due to probable merge conflicts.

@Goober5000 Goober5000 force-pushed the pstypes_changes branch 2 times, most recently from 8ef6a51 to e1acfc2 Compare January 11, 2025 07:20
@Goober5000 Goober5000 marked this pull request as ready for review January 31, 2025 01:39
Several changes related to the volumetrics model fix:
1. Update the `model_load()` prototype with better parameter names, including a new `ErrorType` enum defined in pstypes.h
2. Update the `MIN`, `MAX`, and `CLAMP` macros, all of which were susceptible to performance issues because they duplicated their tokens.  This could cause functions or calculations to be re-run unnecessarily.  Since the codebase is now on C++17, `std::clamp()` can be used.
3. Update the rest of the codebase to fix any associated issues.
@Goober5000 Goober5000 merged commit 5323cc3 into scp-fs2open:master Feb 2, 2025
@Goober5000 Goober5000 deleted the pstypes_changes branch February 2, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants