-
Notifications
You must be signed in to change notification settings - Fork 131
bugfix: Camera edge scroll broken after loading a savegame from ingame menu #2000
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
base: main
Are you sure you want to change the base?
bugfix: Camera edge scroll broken after loading a savegame from ingame menu #2000
Conversation
d92da0d to
513cdf8
Compare
|
|
||
| m_rankPointsToAddAtGameStart = 0; | ||
|
|
||
| TheMouse->onGamePaused(FALSE); |
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.
The observation makes sense.
The implementation is not optimal. It will be better to replace
m_pauseFrame = 0;
m_gamePaused = FALSE;
m_pauseSound = FALSE;
m_pauseMusic = FALSE;
m_pauseInput = FALSE;
m_inputEnabledMemory = TRUE;
m_mouseVisibleMemory = TRUE;
m_logicTimeScaleEnabledMemory = FALSE;with
setGamePaused(FALSE);
m_pauseFrame = 0;
m_inputEnabledMemory = TRUE;
m_mouseVisibleMemory = TRUE;
m_logicTimeScaleEnabledMemory = FALSE;higher up in this function and probably also in the init function.
This way other events can also properly update on pause state change.
Not sure if
m_inputEnabledMemory = TRUE;
m_mouseVisibleMemory = TRUE;
m_logicTimeScaleEnabledMemory = FALSE;
still need to be reset then. I suspect it does not matter, but not sure.
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.
I've made the requested changes and moved the memory resets above the setGamePaused(FALSE) so that things like TheMouse->setVisibility are updated as expected
Mouse edge scroll behavior, music and sound effects and mouse appear fine after the change. I do now notice a very short audio music glitch when loading the savegame probably (confirmed) because we're now calling TheAudio->resumeAudio(AudioAffect_Music) in reset()
7797d40 to
474d1da
Compare
|
The description has been updated to link the issues. I've been looking for a clean solution, the problem right now is that setGamePaused does not only affect state but also performs actions like resuming sounds and music, which now leads to an audio glitch when you do that in reset() or init(), which ideally is a function only concerned about state. Also setGamePaused deals with memory variables for restoring variables which does not apply for init() and reset(). So I think either we add some parameter to setGamePaused to indicate we only want state changes and no side effects, or we keep reset() much like it was before and i will do another pass to see that we properly reset everything. It was possible to clean up init() a bit by using reset() there see refactor commit. |
|
Better make the deduplication a separate refactor change to reduce the complexity of this bug fix. As for music bug, check why it happens and try to figure out an elegant way to avoid this. |
474d1da to
6dfcb89
Compare
|
Alright the deduplication commit is gone from this and I've added a parameter to The audio mishap was because reset would resume the music, and then milliseconds later the audiomanager subsystem would also reset which does a hard stop on all sounds |
This bugfix closes #1922 and possibly closes #1999
Introduced with #1369 was a mouse capture state that would update when you paused the game however it did not reset this capture state regarding pausing when GameLogic:reset() was called.
Tested with Zero Hour. I could not test it in Generals because a bug see #2001