Files
ACE3/addons/spectator/functions/fnc_handleMap.sqf
SilentSpike bcb21b782e Overhaul spectator icon handling and rendering
- Optimize and improve 3D icon drawing
- Combine 2D and 3D PFHs into 1
- Render group icons outside of 200m, unit icons within
- Store list of groups on units update to cut down on what needs to be done each frame
- Change map control type to 100 to remove all default unit icons
- Improve colour caching, group colours don't change, unit colours do
- Remove icon setting, toggling should be at users discretion
2015-08-06 16:03:32 +01:00

47 lines
1.1 KiB
Plaintext

/*
* Author: Head, SilentSpike
* Handles rendering the spectator map icons
*
* Arguments:
* 0: Parameters <ANY>
* 1: PFH handle <NUMBER>
*
* Return Value:
* None <NIL>
*
* Example:
* [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler;
*
* Public: No
*/
#include "script_component.hpp"
params ["_map"];
private ["_cachedVehicles","_unit","_color","_icon"];
if (GVAR(camMode) == 0) then {
_map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(camera),20,20,GVAR(camPan)];
};
_cachedVehicles = [];
{
_unit = vehicle _x;
if !(_unit in _cachedVehicles) then {
_cachedVehicles pushBack _unit;
// Use previously cached info where possible
if (GETVAR(_unit,GVAR(uIcon),"") == "") then {
[_unit] call FUNC(cacheUnitInfo);
};
// Function has caching built in
_color = [side effectiveCommander _unit] call BIS_fnc_sideColor;
_icon = GETVAR(_unit,GVAR(uIcon),"");
_map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit];
};
false
} count GVAR(unitList);