2015-01-25 03:56:23 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-01-25 03:56:23 +00:00
|
|
|
* Add line to draw on debug
|
|
|
|
*
|
2015-09-18 06:47:14 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Start point ASL <ARRAY>
|
|
|
|
* 1: End point ASL <ARRAY>
|
|
|
|
* 2: Color <ARRAY>
|
2015-01-25 03:56:23 +00:00
|
|
|
*
|
2015-09-18 06:47:14 +00:00
|
|
|
* None
|
2015-01-25 03:56:23 +00:00
|
|
|
*
|
2015-09-18 06:47:14 +00:00
|
|
|
* Public: No
|
2015-01-25 03:56:23 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (isNil QGVAR(debugLines)) then {
|
|
|
|
GVAR(debugLines) = [];
|
|
|
|
GVAR(debugLinesIndex) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
if (count GVAR(debugLines) < 100) then {
|
|
|
|
GVAR(debugLines) pushBack _this;
|
|
|
|
GVAR(debugLinesIndex) = 0;
|
|
|
|
} else {
|
|
|
|
GVAR(debugLines) set [GVAR(debugLinesIndex), _this];
|
|
|
|
GVAR(debugLinesIndex) = (GVAR(debugLinesIndex) + 1) mod 100;
|
|
|
|
};
|
|
|
|
|
|
|
|
if (isNil QGVAR(debugDrawHandler)) then {
|
|
|
|
GVAR(debugDrawHandler) = addMissionEventHandler ["Draw3D", {
|
|
|
|
if (count GVAR(debugLines) == 0) exitWith {
|
2015-01-25 04:05:19 +00:00
|
|
|
removeMissionEventHandler ["Draw3D", GVAR(debugDrawHandler)];
|
2015-01-25 03:56:23 +00:00
|
|
|
GVAR(debugDrawHandler) = nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
_p0 = _x select 0;
|
|
|
|
if (!surfaceIsWater _p0) then {
|
|
|
|
_p0 = ASLtoATL _p0;
|
|
|
|
};
|
|
|
|
_p1 = _x select 1;
|
|
|
|
if (!surfaceIsWater _p1) then {
|
|
|
|
_p1 = ASLtoATL _p1;
|
|
|
|
};
|
|
|
|
drawLine3D [_p0, _p1, _x select 2];
|
|
|
|
} forEach GVAR(debugLines);
|
|
|
|
}];
|
2015-09-18 06:47:14 +00:00
|
|
|
};
|