Initial commit of frag/spalling optimization rewrite. Now tracks in single PFH, with index-based referencing instead of searches. TODO: Break spall calculation up to multiple frames. Needs testing.

This commit is contained in:
jaynus
2015-05-13 14:33:14 -07:00
parent 021d277b12
commit 553942bbc7
10 changed files with 175 additions and 82 deletions

View File

@ -0,0 +1,46 @@
/*
* Author: jaynus
*
* Master single PFH abstraction for all rounds being tracked by frag/spall
*
* Arguments:
*
*
* Return Value:
* None
*/
#include "script_component.hpp"
PARAMS_2(_pfhArgs,_handle);
if (!GVAR(enabled)) exitWith {};
private["_gcIndex"];
_gcIndex = [];
{
private["_object", "_args"];
_object = _x;
if(!isNil "_object") then {
if(isNull _object) then {
_gcIndex pushBack _forEachIndex;
} else {
_args = GVAR(arguments) select _forEachIndex;
_args call FUNC(pfhRound);
};
if(!alive _object) then {
_gcIndex pushBack _forEachIndex;
};
};
} forEach GVAR(objects);
// clean up dead object references
private["_deletionCount", "_deleteIndex"];
_deletionCount = 0;
{
_deleteIndex = _gcIndex - _deletionCount;
GVAR(objects) deleteAt _deleteIndex;
GVAR(arguments) deleteAt _deleteIndex;
_deletionCount = _deletionCount + 1;
} forEach _gcIndex;