-
Notifications
You must be signed in to change notification settings - Fork 42
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
Replay System part 3 #381
Replay System part 3 #381
Conversation
I made the app-quitting logic DRY, with one interesting change to the appleevents.mm file: A TODO comment in it said that the mac quit event handling was causing a crash. I wasn't actually able to reproduce this crash, so that's weird, but I decided it might be smart while de-duplicating all the quitting logic, to also stop letting apple handle the actual quitting, and let the game-loop ending do it for all 3 platforms. So I'm cancelling the apple quit events and queuing fake sfml quit events instead. Let's see what these CI build errors are... |
@@ -361,32 +355,36 @@ void handle_events() { | |||
cFramerateLimiter fps_limiter; | |||
|
|||
while(!All_Done) { | |||
if(replaying && has_next_action()){ | |||
replay_next_action(); | |||
}else{ |
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 guess it's not super important, but you could've avoided indenting all this code by just adding continue
on the line above…
return l; | ||
} | ||
|
||
short short_from_action(Element& action) { |
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.
Seems like a good place to use templates (if you need more than just these two).
1de6f0f
to
5ab8922
Compare
I accidentally pushed an unrelated commit from an experiment, the force-push just removed it |
If I recall correctly, the crash occurred when quitting via the menu but not if you quit by some other means (I think possibly even Cmd+Q didn't cause the crash?). It looks like your change probably does fix it, so if there's an open issue for that we should close it when this merges. Though I'll test it first, of course. |
You can reword the commit by amending it and force-push it. |
2 core changes:
Aside from that, added recording and replay for several relatively trivial actions.