ACE3/addons/common/functions/fnc_addLineToDebugDraw.sqf
PabstMirror c22fce273f Overpressure changes (#4770)
* Add setting to overpressure

* Change overpressure on 2a70 cannon

Close #4691
Also fix gl smoke causing frag

* Handle 2a28 cannon

* Fix base class
2016-12-22 13:29:05 -06:00

48 lines
1.2 KiB
Plaintext

/*
* Author: esteldunedain
* Add line to draw on debug
*
* Arguments:
* 0: Start point ASL <ARRAY>
* 1: End point ASL <ARRAY>
* 2: Color <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* [[0,0,0], [1,1,0], [1,0,0,1]]] call ace_common_fnc_addLineToDebugDraw;
*
* Public: No
*/
#include "script_component.hpp"
params ["_startASL", "_endASL", "_color"];
if (isNil QGVAR(debugLines)) then {
GVAR(debugLines) = [];
GVAR(debugLinesIndex) = 0;
};
if (count GVAR(debugLines) < 100) then {
GVAR(debugLines) pushBack [ASLtoAGL _startASL, ASLtoAGL _endASL, _color];
GVAR(debugLinesIndex) = 0;
} else {
GVAR(debugLines) set [GVAR(debugLinesIndex), [ASLtoAGL _startASL, ASLtoAGL _endASL, _color]];
GVAR(debugLinesIndex) = (GVAR(debugLinesIndex) + 1) mod 100;
};
if (isNil QGVAR(debugDrawHandler)) then {
GVAR(debugDrawHandler) = addMissionEventHandler ["Draw3D", {
if (GVAR(debugLines) isEqualTo []) exitWith {
removeMissionEventHandler ["Draw3D", GVAR(debugDrawHandler)];
GVAR(debugDrawHandler) = nil;
};
{
_x params ["_start", "_end", "_color"];
drawLine3D [_start, _end, _color];
} forEach GVAR(debugLines);
}];
};