mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Call CBA delayed execution functions, remove ACE's PFH for handling them
This commit is contained in:
parent
e7dbcd7b58
commit
bbd96f9e71
@ -3,47 +3,6 @@
|
||||
// #define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// PFHs
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
//Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec:
|
||||
[{
|
||||
BEGIN_COUNTER(waitAndExec);
|
||||
|
||||
//Handle the waitAndExec array:
|
||||
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
|
||||
private _entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||
(_entry select 2) call (_entry select 1);
|
||||
};
|
||||
|
||||
//Handle the execNextFrame array:
|
||||
{
|
||||
(_x select 0) call (_x select 1);
|
||||
false
|
||||
} count GVAR(nextFrameBufferA);
|
||||
|
||||
//Swap double-buffer:
|
||||
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
|
||||
GVAR(nextFrameBufferB) = [];
|
||||
GVAR(nextFrameNo) = diag_frameno + 1;
|
||||
|
||||
//Handle the waitUntilAndExec array:
|
||||
{
|
||||
// if condition is satisifed call statement
|
||||
if ((_x select 2) call (_x select 0)) then {
|
||||
// make sure to delete the correct handle when multiple conditions are met in one frame
|
||||
GVAR(waitUntilAndExecArray) deleteAt (GVAR(waitUntilAndExecArray) find _x);
|
||||
(_x select 2) call (_x select 1);
|
||||
};
|
||||
nil
|
||||
} count +GVAR(waitUntilAndExecArray);
|
||||
|
||||
END_COUNTER(waitAndExec);
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Get Map Data
|
||||
//////////////////////////////////////////////////
|
||||
|
@ -15,10 +15,4 @@
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_execNextFrame","3.8.0","CBA_fnc_execNextFrame");
|
||||
|
||||
params ["_func", "_params"];
|
||||
|
||||
if (diag_frameno != GVAR(nextFrameNo)) then {
|
||||
GVAR(nextFrameBufferA) pushBack [_params, _func];
|
||||
} else {
|
||||
GVAR(nextFrameBufferB) pushBack [_params, _func];
|
||||
};
|
||||
_this call CBA_fnc_execNextFrame;
|
||||
|
@ -19,7 +19,4 @@
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_waitAndExecute","3.8.0","CBA_fnc_waitAndExecute");
|
||||
|
||||
params ["_func", "_params", "_delay"];
|
||||
|
||||
GVAR(waitAndExecArray) pushBack [ACE_time + _delay, _func, _params];
|
||||
GVAR(waitAndExecArray) sort true;
|
||||
_this call CBA_fnc_waitAndExecute;
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_waitUntilAndExecute","3.8.0","CBA_fnc_waitUntilAndExecute");
|
||||
|
||||
TRACE_1("Adding",_this);
|
||||
_this call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
GVAR(waitUntilAndExecArray) pushBack _this;
|
||||
nil
|
||||
|
Loading…
Reference in New Issue
Block a user