Skip to content

Commit

Permalink
Fix #190 make debug visualizations optional
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Oct 15, 2018
1 parent 42e6c5c commit 589e4df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions _work/data/Scripts/Content/GFA/_intern/ccommands.d
Expand Up @@ -38,8 +38,13 @@ func string GFA_DebugPrint(var string _) {
/*
* Console function to enable/disable trace ray debug output. This function is registered as console command.
* When enabled, the trace ray is continuously drawn, as well as the nearest intersection with it.
* The visualizations require the LeGo package Draw3D to be initialized.
*/
func string GFA_DebugTraceRay(var string _) {
if (!(_LeGo_Flags & LeGo_Draw3D)) {
return "LeGo_Draw3D is not initialized. Cannot comply.";
};

if (!Hlp_IsValidHandle(GFA_DebugTRTrj)) {
GFA_DebugTRTrj = DrawLineAddr(0, zCOLOR_GREEN);
HideLine(GFA_DebugTRTrj);
Expand Down Expand Up @@ -72,8 +77,13 @@ func string GFA_DebugTraceRay(var string _) {
/*
* Console function to enable/disable trace ray debug output. This function is registered as console command.
* When enabled, the trajectory of the projectile is continuously drawn.
* The visualizations require the LeGo package Draw3D to be initialized.
*/
func string GFA_DebugTrajectory(var string _) {
if (!(_LeGo_Flags & LeGo_Draw3D)) {
return "LeGo_Draw3D is not initialized. Cannot comply.";
};

if (!Hlp_IsValidHandle(GFA_DebugCollTrj)) {
GFA_DebugCollTrj = DrawLineAddr(_@(GFA_CollTrj), zCOLOR_RED);
} else {
Expand All @@ -91,8 +101,13 @@ func string GFA_DebugTrajectory(var string _) {
/*
* Console function to enable/disable bone debug visualization. This function is registered as console command.
* When enabled, the hit model node of the last shot NPC is visualized by a bounding box or oriented bounding box.
* The visualizations require the LeGo package Draw3D to be initialized.
*/
func string GFA_DebugBone(var string _) {
if (!(_LeGo_Flags & LeGo_Draw3D)) {
return "LeGo_Draw3D is not initialized. Cannot comply.";
};

if (!Hlp_IsValidHandle(GFA_DebugBoneBBox)) {
GFA_DebugBoneBBox = DrawBBoxAddr(0, zCOLOR_RED);
HideBBox(GFA_DebugBoneBBox);
Expand Down
3 changes: 1 addition & 2 deletions _work/data/Scripts/Content/GFA/_intern/const.d
Expand Up @@ -32,8 +32,7 @@
const string GFA_VERSION = "Gothic Free Aim v1.0.1";
const int GFA_LEGO_FLAGS = LeGo_HookEngine // For initializing all hooks
| LeGo_ConsoleCommands // For console commands and debugging
| LeGo_Random // For scattering and other uses of random numbers
| LeGo_Draw3D; // For debug visualizations (may be removed)
| LeGo_Random; // For scattering and other uses of random numbers

var int GFA_Flags; // Flags for initialization of GFA
const int GFA_RANGED = 1<<0; // Free aiming for ranged combat (bow and crossbow)
Expand Down

0 comments on commit 589e4df

Please sign in to comment.