Skip to content

Commit

Permalink
Merge pull request #285 from CBATeam/fastercompilegamestart
Browse files Browse the repository at this point in the history
Skip some unused compiles in XEH
  • Loading branch information
Killswitch00 committed Mar 5, 2016
2 parents bc02f2c + 2aded81 commit 2710b24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addons/xeh/fnc_compileEventHandlers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private _resultNames = [];
_result pushBack ["", _eventName, _eventFunc];
_resultNames pushBack _customName;
} forEach configProperties [_baseConfig >> XEH_FORMAT_CONFIG_NAME(_eventName)];
} forEach ["preStart", "preInit", "postInit"];
} forEach ["preInit", "postInit"];

// object events
{
Expand Down
2 changes: 1 addition & 1 deletion addons/xeh/fnc_postInit_unscheduled.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (CBA_missionTime == -1) then {
// call PostInit events
{
if (_x select 1 == "postInit") then {
call (_x select 2);
[] call (_x select 2);
};
} forEach GVAR(allEventHandlers);

Expand Down
2 changes: 1 addition & 1 deletion addons/xeh/fnc_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GVAR(fallbackRunning) = false;
{
if (_x select 0 == "") then {
if (_x select 1 == "preInit") then {
call (_x select 2);
[] call (_x select 2);
};
} else {
_x params ["_className", "_eventName", "_eventFunc", "_allowInheritance", "_excludedClasses"];
Expand Down
20 changes: 17 additions & 3 deletions addons/xeh/fnc_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,24 @@ with uiNamespace do {

// call PreStart events
{
if (_x select 1 == "preStart") then {
call (_x select 2);
private _eventFunc = "";

if (isClass _x) then {
private _entry = _x >> "init";

if (isText _entry) then {
_eventFunc = _eventFunc + getText _entry + ";";
};
} else {
if (isText _x) then {
_eventFunc = getText _x + ";";
};
};

if !(_eventFunc isEqualTo "") then {
[] call compile _eventFunc;
};
} forEach (configFile call CBA_fnc_compileEventHandlers);
} forEach configProperties [configFile >> XEH_FORMAT_CONFIG_NAME("preStart")];

#ifdef DEBUG_MODE_FULL
diag_log text format ["isScheduled = %1", call CBA_fnc_isScheduled];
Expand Down

0 comments on commit 2710b24

Please sign in to comment.