Skip to content

Commit

Permalink
Add macros to skip adding headers to cfgFunctions (#1065)
Browse files Browse the repository at this point in the history
* Add macros to skip adding headers to cfgFunctions

* Move to script_mod

* Cleanup vectors

* cleanup
  • Loading branch information
PabstMirror authored and commy2 committed Feb 16, 2019
1 parent b1dbeff commit d6cbc0f
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 12 deletions.
16 changes: 14 additions & 2 deletions addons/main/script_macros_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ Macro: PATHTO_FNC()
Full file path in addons:
'\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\fnc_<FNC>.sqf'
Define 'RECOMPILE' to enable recompiling.
Define 'SKIP_FUNCTION_HEADER' to skip adding function header.
Parameters:
FUNCTION NAME - Name of the function, unquoted <STRING>
Expand All @@ -968,9 +969,16 @@ Macro: PATHTO_FNC()
#else
#define RECOMPILE recompile = 0
#endif
// Set function header type: -1 - no header; 0 - default header; 1 - system header.
#ifdef SKIP_FUNCTION_HEADER
#define CFGFUNCTION_HEADER headerType = -1
#else
#define CFGFUNCTION_HEADER headerType = 0
#endif

#define PATHTO_FNC(func) class func {\
file = QPATHTOF(DOUBLES(fnc,func).sqf);\
CFGFUNCTION_HEADER;\
RECOMPILE;\
}

Expand Down Expand Up @@ -1119,6 +1127,7 @@ Macros: IS_x()
/* -------------------------------------------
Macro: SCRIPT()
Sets name of script (relies on PREFIX and COMPONENT values being #defined).
Define 'SKIP_SCRIPT_NAME' to skip adding scriptName.
Parameters:
NAME - Name of script [Indentifier]
Expand All @@ -1131,8 +1140,11 @@ Macro: SCRIPT()
Author:
Spooner
------------------------------------------- */
#define SCRIPT(NAME) \
scriptName 'PREFIX\COMPONENT\NAME'
#ifndef SKIP_SCRIPT_NAME
#define SCRIPT(NAME) scriptName 'PREFIX\COMPONENT\NAME'
#else
#define SCRIPT(NAME) /* nope */
#endif

/* -------------------------------------------
Macros: EXPLODE_n()
Expand Down
4 changes: 4 additions & 0 deletions addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
#define DEBUG_ENABLED_STRINGS
#define DEBUG_ENABLED_VERSIONING
*/

// Remove CfgFunction adding headers and disable SCRIPT macro (comment out to enable for debugging)
#define SKIP_FUNCTION_HEADER
#define SKIP_SCRIPT_NAME
1 change: 0 additions & 1 deletion addons/vectors/fnc_polar2vect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_polar2vect.sqf";

SCRIPT(polar2vect);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_scaleVect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_scaleVect.sqf";

SCRIPT(scaleVect);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_scaleVectTo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_scaleVectTo.sqf";

SCRIPT(scaleVectTo);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vect2polar.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vect2Polar.sqf";

SCRIPT(vect2Polar);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectCross2D.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectCross2D.sqf";

SCRIPT(vectCross2D);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectDir.sqf";

SCRIPT(vectDir);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectElev.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectElev.sqf";

SCRIPT(vectElev);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectMagn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectMagn.sqf";

SCRIPT(vectMagn);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectMagn2D.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectMagn2D.sqf";

SCRIPT(vectMagn2D);

Expand Down
1 change: 0 additions & 1 deletion addons/vectors/fnc_vectSubtract.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Examples:
Author:
Vigilante, courtesy by -=ACE=- of Simcentric
---------------------------------------------------------------------------- */
scriptName "fnc_vectSubtract.sqf";

SCRIPT(vectSubtract);

Expand Down

0 comments on commit d6cbc0f

Please sign in to comment.