From d25d6a61b3a74632017716bf0717c3ddcbfa4d8b Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 9 Jan 2024 23:17:08 -0600 Subject: [PATCH] readded seperate debug draw define --- addons/frag/XEH_postInit.sqf | 2 +- addons/frag/functions/fnc_doFrag.sqf | 2 +- addons/frag/functions/fnc_doFragRandom.sqf | 2 ++ addons/frag/functions/fnc_doFragTargeted.sqf | 5 ++--- addons/frag/functions/fnc_doSpall.sqf | 4 ++-- addons/frag/functions/fnc_doSpallMomentum.sqf | 4 +++- addons/frag/functions/fnc_initRound.sqf | 2 +- addons/frag/functions/fnc_submunition.sqf | 2 +- addons/frag/script_component.hpp | 1 + 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index f50279ce8a..5aa9fc9d51 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -16,7 +16,7 @@ ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;*/ // Debug info -#ifdef DEBUG_MODE_FULL +#ifdef DEBUG_MODE_DRAW if (hasInterface && GVAR(debugOptions)) then { private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; missionNamespace setVariable [QGVAR(dev_drawPFEH), _h]; diff --git a/addons/frag/functions/fnc_doFrag.sqf b/addons/frag/functions/fnc_doFrag.sqf index 412678377e..a3e77fa256 100644 --- a/addons/frag/functions/fnc_doFrag.sqf +++ b/addons/frag/functions/fnc_doFrag.sqf @@ -19,6 +19,7 @@ * * Public: No */ +TRACE_1("",_this); params ["_args", ["_isSubMunit", false, [false]]]; _args params [ ["_proj", objNull, [objNull]], @@ -27,7 +28,6 @@ _args params [ ["_ammo", "", [""]], ["_shotParents", [objNull, objNull], [[]]] ]; -TRACE_3("",_proj,_posASL,_vel); private _shotParentVic = _shotParents#0; if (_shotParentVic getVariable [QGVAR(nextFragTime), -1] > CBA_missionTime) exitWith { diff --git a/addons/frag/functions/fnc_doFragRandom.sqf b/addons/frag/functions/fnc_doFragRandom.sqf index 919a3ee049..145926fd00 100644 --- a/addons/frag/functions/fnc_doFragRandom.sqf +++ b/addons/frag/functions/fnc_doFragRandom.sqf @@ -59,6 +59,8 @@ _fragSpawner setShotParents _shotParents; #ifdef DEBUG_MODE_FULL systemChat ("fragging, id: " + getObjectID _proj); +#endif +#ifdef DEBUG_MODE_DRAW _fragSpawner addEventHandler [ "SubmunitionCreated", { diff --git a/addons/frag/functions/fnc_doFragTargeted.sqf b/addons/frag/functions/fnc_doFragTargeted.sqf index 22eaf0624d..fd3865c1a9 100644 --- a/addons/frag/functions/fnc_doFragTargeted.sqf +++ b/addons/frag/functions/fnc_doFragTargeted.sqf @@ -156,7 +156,7 @@ private _fragCount = 0; // limit of # of fragments to _maxFrags _fragObj setVectorDir _vecDir; _fragObj setVelocity (_vecDir vectorMultiply _locFragVel); _fragObj setShotParents _shotPrnt; - #ifdef DEBUG_MODE_FULL + #ifdef DEBUG_MODE_DRAW [_fragObj, "purple", true] call FUNC(dev_trackObj); [_targetPos, "orange"] call FUNC(dev_sphereDraw); #endif @@ -169,7 +169,6 @@ private _fragCount = 0; // limit of # of fragments to _maxFrags } forEach _objects; #ifdef DEBUG_MODE_FULL systemChat ("fragCount cnt: " + str _fragCount); -TRACE_1("fragCount",_fragCount); #endif - +TRACE_1("fragCount",_fragCount); _fragCount \ No newline at end of file diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 8777be45ea..a3dbb19d83 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -50,7 +50,7 @@ for "_i" from 1 to 20 do if (!lineIntersects [_spallPos, _nPos]) then {break}; _spallPos = +_nPos; }; -#ifdef DEBUG_MODE_FULL +#ifdef DEBUG_MODE_DRAW [_spallPos, "orange"] call FUNC(dev_sphereDraw); [_lPosASL, "orange"] call FUNC(dev_sphereDraw); #endif @@ -85,7 +85,7 @@ _fragSpawner setVectorDirandUp [vectorDir _projectile, vectorUp _projectile]; _fragSpawner setVelocity (_lVelUnit vectorMultiply _velScalar); -#ifdef DEBUG_MODE_FULL +#ifdef DEBUG_MODE_DRAW _fragSpawner addEventHandler [ "SubmunitionCreated", { diff --git a/addons/frag/functions/fnc_doSpallMomentum.sqf b/addons/frag/functions/fnc_doSpallMomentum.sqf index a75c4cf4c4..fe0321336d 100644 --- a/addons/frag/functions/fnc_doSpallMomentum.sqf +++ b/addons/frag/functions/fnc_doSpallMomentum.sqf @@ -87,7 +87,7 @@ for "_i" from 1 to 20 do _spallPos = _nPos; }; -#ifdef DEBUG_MODE_FULL +#ifdef DEBUG_MODE_DRAW if GVAR(dbgSphere) then { [_spallPos, "green"] call FUNC(dev_sphereDraw); [_lPosASL vectorAdd _lVelUnit, "orange"] call FUNC(dev_sphereDraw); @@ -126,6 +126,8 @@ if (_material isEqualTo "ground") then { systemChat "ground spall"; // really shouldn't happen }; systemChat ("bSpd: " + str speed _spallSpawner + ", frag: " + _fragSpawnType + ", dm: " + str _deltaMomentum); +#endif +#ifdef DEBUG_MODE_DRAW _spallSpawner addEventHandler [ "SubmunitionCreated", { diff --git a/addons/frag/functions/fnc_initRound.sqf b/addons/frag/functions/fnc_initRound.sqf index 7d50661e67..b636637044 100644 --- a/addons/frag/functions/fnc_initRound.sqf +++ b/addons/frag/functions/fnc_initRound.sqf @@ -37,7 +37,7 @@ if (_doFrag) then { if (isServer) then { [ FUNC(doFrag), - _this + [_ammo, _shotParents] + [_this + [_ammo, _shotParents]] ] call CBA_fnc_execNextFrame; } else { [ diff --git a/addons/frag/functions/fnc_submunition.sqf b/addons/frag/functions/fnc_submunition.sqf index 70fc19655c..560a706b74 100644 --- a/addons/frag/functions/fnc_submunition.sqf +++ b/addons/frag/functions/fnc_submunition.sqf @@ -35,6 +35,6 @@ if (_doSubmunit) then { _submunitionProjectile addEventHandler ["SubmunitionCreated", {_this call FUNC(submunition)}]; }; -#ifdef DEBUG_MODE_FULL +#ifdef DEBUG_MODE_DRAW [_submunitionProjectile] call FUNC(dev_addRound); #endif \ No newline at end of file diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 333ace4f89..f98d27e595 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -4,6 +4,7 @@ // #define LOG_FRAG_INFO #define DEBUG_MODE_FULL +// #define DEBUG_MODE_DRAW // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS