-
Notifications
You must be signed in to change notification settings - Fork 40
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
stats: fix the game hanging if exited during the level stats, credits, or final stats #1777
Merged
Conversation
This file contains 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
walkawayy
requested review from
rr- and
lahm86
and removed request for
a team
October 30, 2024 01:15
Download the built assets for this pull request: |
walkawayy
force-pushed
the
issue-1585-credits-exit
branch
from
October 30, 2024 01:17
b8f5aa4
to
41988ba
Compare
rr-
approved these changes
Oct 30, 2024
I can decompile the necessary functions after we merge #1768. |
@walkawayy actually you just need this: diff --git a/src/tr2/decomp/decomp.c b/src/tr2/decomp/decomp.c
index 990a0e87..38cc00a3 100644
--- a/src/tr2/decomp/decomp.c
+++ b/src/tr2/decomp/decomp.c
@@ -560,7 +560,8 @@ void __cdecl Shell_Shutdown(void)
{
Console_Shutdown();
WinInFinish();
- RenderFinish(true);
+ BGND_Free();
+ RenderFinish(false);
WinVidFinish();
WinVidHideGameWindow();
if (g_ErrorMessage[0]) {
@@ -3068,6 +3069,10 @@ void __cdecl S_Wait(int32_t frames, const BOOL input_check)
passed = Sync();
} while (!passed);
frames -= passed;
+
+ if (g_IsGameToExit) {
+ break;
+ }
}
}
@@ -3077,6 +3082,10 @@ void __cdecl S_Wait(int32_t frames, const BOOL input_check)
break;
}
+ if (g_IsGameToExit) {
+ break;
+ }
+
int32_t passed;
do {
passed = Sync(); |
walkawayy
force-pushed
the
issue-1585-credits-exit
branch
from
October 30, 2024 21:22
41988ba
to
1a29a29
Compare
lahm86
approved these changes
Oct 30, 2024
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.
LGTM. Thanks for fixing, this was always an annoying bug.
rr-
approved these changes
Oct 31, 2024
aredfan
approved these changes
Oct 31, 2024
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.
Checklist
Description
Fix the game hanging if exited during the level stats, credits, or final stats.
The only caveat to this PR is that if you exit during the credit images (not the final stats), the game has to wait until the current credits picture timer ends before it will exit. I think this is due to the credit pictures being unskippable which is a separate issue. I hate to bug @rr-, but if we could get
DisplayCredits
decompiled, I think we could solve this delayed exit and unskippable credits in another PR. There is no rush on this though, so I don't mind marking this PR as draft until we have to time to decompileDisplayCredits
.