Skip to content
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

Add #7726: Shortcut to advance one tick #7851

Merged
merged 2 commits into from
Sep 23, 2018
Merged

Conversation

jensj12
Copy link
Contributor

@jensj12 jensj12 commented Aug 3, 2018

Tapping the shortcut advances the game by exactly one tick. Shortcut is disabled by default and does not work in multiplayer.

Some animations don't update because they rely on game_is_paused() to return true in their update function. Repeatedly tapping (or tap+hold) clearly shows this when a train passes through an on-ride photo section or a door. A search through the code shows that only map animations and twitch may be affected by the game advancing while in paused mode. Fixed, the game temporarily unpauses when advancing one frame.

@ZehMatt
Copy link
Member

ZehMatt commented Aug 5, 2018

Out of curiosity, can't you unset the paused state while advancing a single update?

@jensj12
Copy link
Contributor Author

jensj12 commented Aug 6, 2018

Because I only thought about that after submitting this PR. Would indeed be the best solution.

@ZehMatt
Copy link
Member

ZehMatt commented Aug 9, 2018

If the purpose of the single frame step is to debug things then the game should not sit in the paused state as that might change some logic that would normally execute when the game isn't paused, we can already debug a paused state. I think that its important when single stepping frames the pause flag should be unset.

@Broxzier
Copy link
Member

I've taken the liberty to rebase this PR and fix an issue where the sounds keep playing when you progress one frame. Everything looks good to me now.

@AaronVanGeffen AaronVanGeffen added changelog This issue/PR deserves a changelog entry. and removed changelog This issue/PR deserves a changelog entry. labels Aug 17, 2018
@Broxzier
Copy link
Member

I found something that needs to be fixed first, the title screen freezes when you go back to it (may be casued by me). Steps to reproduce:

  1. Open a park and pause, then advance one frame
  2. Exit to the titlescreen

After one frame, the title screen will be paused too.

@jensj12
Copy link
Contributor Author

jensj12 commented Aug 18, 2018

I’ve somehow managed to get the title screen in pause mode on the develop build as well, so I’ll investigate both. Problem might be that some things change the paused state, which gets undone by this code. I’ll at least get a more robust solution for that.

@jensj12
Copy link
Contributor Author

jensj12 commented Sep 20, 2018

The game is now only re-paused when this feature caused the game to get into an unpaused state. That should fix most (if not all) issues related to (un)pausing the game elsewhere (most notably, going to the title screen).

jensj12 and others added 2 commits September 23, 2018 23:35
Tapping the shortcut advances the game by exactly one tick. Shortcut is disabled by default and does not work in multiplayer.
@Broxzier Broxzier merged commit eac9b72 into OpenRCT2:develop Sep 23, 2018
@jensj12 jensj12 deleted the add-7726 branch September 24, 2018 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants