Disable registering 3D physics types when 3D is disabled #79185
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR organizes the 2D and 3D physics code in
register_server_types.cpp
and allows the 3D physics type registration code to be disabled by wrapping it in#ifndef _3D_DISABLED
.In the current master, a macOS arm64 template_release build is 66.5 MB (66503407 bytes). Using
disable_3d=yes
brings this down to 60.2 MB (60224255 bytes), a reduction of 9.4%.With this PR, the
disable_3d=yes
build is 58.8 MB (58848751 bytes), a reduction of 2.3% compared to master with this option, and brings the total savings from 9.4% to 11.5% compared to 3D enabled, a reduction of 2.1%.