script_macros.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include "\x\cba\addons\main\script_macros_common.hpp"
  2. #define mag_2(a) a, a
  3. #define mag_3(a) a, a, a
  4. #define mag_4(a) a, a, a, a
  5. #define mag_5(a) a, a, a, a, a
  6. #define mag_6(a) a, a, a, a, a, a
  7. #define mag_7(a) a, a, a, a, a, a, a
  8. #define mag_8(a) a, a, a, a, a, a, a, a
  9. #define mag_9(a) a, a, a, a, a, a, a, a, a
  10. #define mag_10(a) a, a, a, a, a, a, a, a, a, a
  11. #define mag_11(a) a, a, a, a, a, a, a, a, a, a, a
  12. #define mag_12(a) a, a, a, a, a, a, a, a, a, a, a, a
  13. #define mag_xx(a,b) class _xx_##a {magazine = a; count = b;}
  14. #define weap_xx(a,b) class _xx_##a {weapon = a; count = b;}
  15. #define item_xx(a,b) class _xx_##a {name = a; count = b;}
  16. #define backpack_xx(a,b) class __xx_##a {backpack = a; count = b;}
  17. //scopes
  18. #define private 0
  19. #define protected 1
  20. #define public 2
  21. // weapon types
  22. #define TYPE_WEAPON_PRIMARY 1
  23. #define TYPE_WEAPON_HANDGUN 2
  24. #define TYPE_WEAPON_SECONDARY 4
  25. // magazine types
  26. #define TYPE_MAGAZINE_HANDGUN_AND_GL 16 // mainly
  27. #define TYPE_MAGAZINE_PRIMARY_AND_THROW 256
  28. #define TYPE_MAGAZINE_SECONDARY_AND_PUT 512 // mainly
  29. // more types
  30. #define TYPE_BINOCULAR_AND_NVG 4096
  31. #define TYPE_WEAPON_VEHICLE 65536
  32. #define TYPE_ITEM 131072
  33. // item types
  34. #define TYPE_DEFAULT 0
  35. #define TYPE_MUZZLE 101
  36. #define TYPE_OPTICS 201
  37. #define TYPE_FLASHLIGHT 301
  38. #define TYPE_BIPOD 302
  39. #define TYPE_FIRST_AID_KIT 401
  40. #define TYPE_FINS 501 // not implemented
  41. #define TYPE_BREATHING_BOMB 601 // not implemented
  42. #define TYPE_NVG 616
  43. #define TYPE_GOGGLE 603
  44. #define TYPE_SCUBA 604 // not implemented
  45. #define TYPE_HEADGEAR 605
  46. #define TYPE_FACTOR 607
  47. #define TYPE_RADIO 611
  48. #define TYPE_HMD 616
  49. #define TYPE_BINOCULAR 617
  50. #define TYPE_MEDIKIT 619
  51. #define TYPE_TOOLKIT 620
  52. #define TYPE_UAV_TERMINAL 621
  53. #define TYPE_VEST 701
  54. #define TYPE_UNIFORM 801
  55. #define TYPE_BACKPACK 901
  56. #define DFUNC(var1) TRIPLES(ADDON,fnc,var1)
  57. #ifdef DISABLE_COMPILE_CACHE
  58. #undef PREP
  59. #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf)
  60. #else
  61. #undef PREP
  62. #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
  63. #endif
  64. #ifdef DISABLE_COMPILE_CACHE
  65. #undef PREPO
  66. #define PREPO(location,fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\location\DOUBLES(fnc,fncName).sqf)
  67. #else
  68. #undef PREPO
  69. #define PREPO(location,fncName) [QPATHTOF(functions\location\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
  70. #endif