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
Fix #2287: Sound not disabled when starting without focus #21777
Fix #2287: Sound not disabled when starting without focus #21777
Conversation
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.
This unfortunately a bad approach to go about this issue, this would also only work if people have the Uncap FPS disabled, this is also not the proper place to have logic like this.
I had not noticed there were two I can do something more complicated like having a RunFrame();
PostFirstFrame();
while(!_finished) {
RunFrame();
} |
I don't like that idea, the music should start playing post-load of a save file, we can probably just add a check for which screen flags are set after a save is loaded and call |
Defer calling `PlayTitleMusic()` the first time when OpenRCT2 starts until after SDL events have been polled. This allows the code to process focus events to mute the audio before the title music starts playing.
…ocus" This reverts commit feaafa4.
4508c2c
to
485f13c
Compare
@ZehMatt What about moving the If you find this acceptably, I'll squash and fix up the commit message. |
Sorry, it shouldn't go in the tick logic either. I appreciate that you're trying to solve an issue, but as @ZehMatt said, it would be better to refactor the loading code instead of hacking in a fix. Considering the approach, and the emerged merge conflict, I think it's best to close this. |
For #2287
Defer calling
PlayTitleMusic()
the first time when OpenRCT2 starts until after SDL events have been polled. This allows the code to process focus events to mute the audio before the title music starts playing.This slightly changes the current behavior in that the music no longer starts right when the window is created but about when the game starts rendering (about 1 second later on my machine).