Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macros to skip adding headers to cfgFunctions #1065

Merged
merged 4 commits into from
Feb 16, 2019

Conversation

PabstMirror
Copy link
Contributor

@PabstMirror PabstMirror commented Feb 15, 2019

Adds optional macros to remove both

  • CfgFunction headers (which add code for _fnc_scriptNameParent / _fnc_scriptName)
  • CBA Macro SCRIPT (which adds scriptName 'PREFIX\COMPONENT\NAME')

e.g. CBA_fnc_currentUnit is a single line of code, but becomes

CBA_fnc_currentUnit = {
    private _fnc_scriptNameParent = if (isNil '_fnc_scriptName') then {'CBA_fnc_currentUnit'} else {_fnc_scriptName};
    private _fnc_scriptName = 'CBA_fnc_currentUnit';
    scriptName _fnc_scriptName;
    scriptName 'cba\common\currentUnit';
    missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]

Changing execution time from 0.0022 ms to 0.0045 ms.

There should be no change to anyone else using CBA macros unless they add these defines.
For CBA both are set in main/script_mod.hpp

@PabstMirror PabstMirror changed the title WIP: Add macros to skip adding headers to cfgFunctions Add macros to skip adding headers to cfgFunctions Feb 15, 2019
@PabstMirror
Copy link
Contributor Author

for addons not using the macro PATHTO_FNC1 (https://github.com/CBATeam/CBA_A3/blob/master/addons/events/CfgFunctions.hpp)

  • convert to use macro and drop description
  • just add CFGFUNCTION_HEADER to existing classes?

@commy2 commy2 added this to the 3.10 milestone Feb 16, 2019
@commy2 commy2 merged commit d6cbc0f into master Feb 16, 2019
@commy2 commy2 deleted the removeJunkFromFunctions branch February 16, 2019 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants