mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Common - Improve vehicle icon caching implementation (#8318)
* Use native hashmap for common vehicle icon caching Should be more optimised
This commit is contained in:
parent
75934f883c
commit
e870e2f1f9
@ -9,7 +9,7 @@ PREP_RECOMPILE_END;
|
||||
|
||||
GVAR(syncedEvents) = [] call CBA_fnc_hashCreate;
|
||||
GVAR(showHudHash) = [] call CBA_fnc_hashCreate;
|
||||
GVAR(vehicleIconCache) = call CBA_fnc_createNamespace; // for getVehicleIcon
|
||||
GVAR(vehicleIconCache) = createHashMap; // for getVehicleIcon
|
||||
|
||||
GVAR(settingsInitFinished) = false;
|
||||
GVAR(runAtSettingsInitialized) = [];
|
||||
|
@ -25,7 +25,7 @@ private _objectType = if (_object isEqualType objNull) then {
|
||||
} else {
|
||||
_object
|
||||
};
|
||||
private _cachedValue = GVAR(vehicleIconCache) getVariable _objectType;
|
||||
private _cachedValue = GVAR(vehicleIconCache) get _objectType;
|
||||
|
||||
if (isNil "_cachedValue") then {
|
||||
private _vehicleValue = getText (configfile >> "CfgVehicles" >> _objectType >> "icon");
|
||||
@ -41,7 +41,7 @@ if (isNil "_cachedValue") then {
|
||||
_cachedValue = _vehicleIconValue;
|
||||
};
|
||||
|
||||
GVAR(vehicleIconCache) setVariable [_objectType, _cachedValue];
|
||||
GVAR(vehicleIconCache) set [_objectType, _cachedValue];
|
||||
};
|
||||
|
||||
_cachedValue
|
||||
|
Loading…
Reference in New Issue
Block a user