fix: avoid full rebuild by writing BuildVer.h only when content changes#1164
Open
MrTheShy wants to merge 4 commits intosmartcmd:mainfrom
Open
fix: avoid full rebuild by writing BuildVer.h only when content changes#1164MrTheShy wants to merge 4 commits intosmartcmd:mainfrom
MrTheShy wants to merge 4 commits intosmartcmd:mainfrom
Conversation
Previously, prebuild.ps1 unconditionally overwrote BuildVer.h on every build using Set-Content, updating its timestamp even when the content was identical. This caused MSBuild to treat all files depending on BuildVer.h as out of date, triggering a full rebuild every time. Fix: compare the new content with the existing file before writing. BuildVer.h is now only written if sha, branch, or dev suffix has actually changed. Also removed the `git restore` call from postbuild.ps1 as it is no longer needed.
Updated the safe zone calculations across multiple UI components to ensure symmetry in split viewports. Removed unnecessary assignments and added comments for clarity. Modified the repositionHud function to include an additional parameter for better handling of HUD positioning in split-screen scenarios.
The F3 debug screen was badly broken in splitscreen: it used the GUI coordinate space which gets distorted by the splitscreen scaling, so text appeared stretched, misaligned or completely off-screen depending on the viewport layout. Fixed by setting up a dedicated projection matrix using physical pixel coordinates (g_rScreenWidth / g_rScreenHeight) each time the overlay is drawn, completely decoupled from whatever transform the HUD is using. The viewport dimensions are now computed per screen section so the ortho projection matches the actual pixel area of each player's quadrant. Version and branch strings are only shown for player 0 (iPad == 0) to avoid repeating them across every splitscreen pane. Also removed a few redundant calculations that were being done twice in the same frame (atan for xRot, health halves, air supply scaled value). These are minor and have negligible real-world impact; more substantial per-frame caching work (safe zone calculations etc.) will follow in a separate commit.
Contributor
Author
|
@codeHusky we should just add that file to gitignore and remove the removal of the file from postscript, wdyt? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fix incremental builds being ignored — every build was triggering a full recompilation due to
prebuild.ps1unconditionally touchingBuildVer.h.Changes
Previous Behavior
Every build performed a full recompilation of all translation units, regardless of whether any source files had actually changed.
Root Cause
prebuild.ps1usedSet-Contentto overwriteBuildVer.hon every build, updating its file timestamp even when the content was completely identical. SinceBuildVer.his included across many source files, MSBuild considered all of them out of date and recompiled everything from scratch.New Behavior
Incremental builds work correctly.
BuildVer.his only written to disk if its content has actually changed (i.e. a new commit was made, the branch changed, or uncommitted changes appeared/disappeared). Unchanged builds skip the write entirely and leave the file timestamp untouched.Fix Implementation
In
prebuild.ps1, replaced the unconditionalSet-Contentcall with a comparison between the newly generated content and the existing file content. The file is only written if the two differ.AI Use Disclosure
No AI was used to write the code in this PR. The PR Message was done by ai