ACE3/addons/laserpointer/functions/fnc_onDraw.sqf
ulteq 5ee1df424d
Minor performance tweaks (#5796)
* Medical_ai - Optimize 'fnc_isInjured'
* Laserpointer - Optimize 'fnc_onDraw'
* Overheating - Skip ground detection if possible
* Overheating - Replace function call with inline code
* Overheating - Nest 'firedEH' abort conditions
* Overheating - Remove duplicate code / Skip function call if possible
* Overheating - Cache energy increment
2017-11-23 11:13:58 +01:00

31 lines
686 B
Plaintext

/*
* Author: commy2
* Draw the visible laser beams of all cached units.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ACE_laserpointer_fnc_onDraw
*
* Public: No
*/
#include "script_component.hpp"
if (count GVAR(redLaserUnits) + count GVAR(greenLaserUnits) > 0 && {!GVAR(isTI)}) then {
private _brightness = 2 - call EFUNC(common,ambientBrightness);
{
// red laser. draw green dot anyway in IR mode
[_x, 100, GVAR(isIR), _brightness] call FUNC(drawLaserpoint);
} count GVAR(redLaserUnits);
{
// green laser
[_x, 100, true, _brightness] call FUNC(drawLaserpoint);
} count GVAR(greenLaserUnits);
};