Port ACE delayed execution functions to CBA#288
Merged
Killswitch00 merged 1 commit intoCBATeam:masterfrom Mar 5, 2016
Merged
Conversation
| }; | ||
| // CBA_fnc_execNextFrame | ||
| class execNextFrame | ||
| { |
Member
There was a problem hiding this comment.
Opening brace on same line as class. I know it's not used in others in this file but it has to get converted anyways.
Contributor
Author
There was a problem hiding this comment.
Ït's not used at all in cba_common, so I prefer to maintain consistency
Member
There was a problem hiding this comment.
@commy2 is changing it, he is currently going through entire cba_common. But sure.
Member
|
Totally awesome! 👍 |
Killswitch00
added a commit
that referenced
this pull request
Mar 5, 2016
Port ACE delayed execution functions to CBA
Contributor
Author
|
Thanks! |
This file contains hidden or 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
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.
This PR ports the following functions from ACE, with some optimizations. All of them run in non sched environment and are handled by the onFrame loop that handles PFH.
CBA_fnc_waitAndExecute: Executes a code once in non sched environment with a given game time delay. It' based on a queue, so only the bare minimum of elements are evaluated each frame. This is a very efficient way of delaying execution, certainly much more than a PFH, specially for long delays. It's savegame compatible due to the use ofCBA_missionTime.CBA_fnc_execNextFrame: A specialized version ofCBA_fnc_waitAndExecutethat delays execution a single frame.CBA_fnc_waitUntilAndExecute: Evaluates a condition code on each frame, and finally launches a sepparate statement code once when the condition returns true. This behaves like BISwaitUntil, but in non sched environment. Due to all condition being evaluated each frame, this function should be used only when necessary.All of this are heavily used in ACE. We'll certainly switch to CBA's versions if this is merged.