From 3b1e99cd3f8b55ef6404f22f1de5e44ffef09788 Mon Sep 17 00:00:00 2001 From: ZedB0T <89345505+Zedb0T@users.noreply.github.com> Date: Sat, 28 Jan 2023 14:17:43 -0500 Subject: [PATCH] Hook Jak 1 into ImGUI actor filter (#2157) --- game/kernel/jak1/kmachine.cpp | 3 +++ goal_src/jak1/engine/debug/debug.gc | 8 ++++++++ goal_src/jak1/kernel-defs.gc | 1 + 3 files changed, 12 insertions(+) diff --git a/game/kernel/jak1/kmachine.cpp b/game/kernel/jak1/kmachine.cpp index 20c5ab9e3d..30122bc0f0 100644 --- a/game/kernel/jak1/kmachine.cpp +++ b/game/kernel/jak1/kmachine.cpp @@ -646,6 +646,9 @@ void InitMachine_PCPort() { // profiler make_function_symbol_from_c("pc-prof", (void*)prof_event); + // debugging tools + make_function_symbol_from_c("pc-filter-debug-string?", (void*)pc_filter_debug_string); + // init ps2 VM if (VM::use) { make_function_symbol_from_c("vm-ptr", (void*)VM::get_vm_ptr); diff --git a/goal_src/jak1/engine/debug/debug.gc b/goal_src/jak1/engine/debug/debug.gc index 0defb07bf4..1ddafaad5d 100644 --- a/goal_src/jak1/engine/debug/debug.gc +++ b/goal_src/jak1/engine/debug/debug.gc @@ -548,6 +548,14 @@ (defun-debug add-debug-text-3d ((arg0 symbol) (arg1 bucket-id) (arg2 string) (arg3 vector) (arg4 font-color) (arg5 vector2h)) "Draw text at the given point. arg4 is the font-color index. arg5 is an offset and can be #f." (when arg0 + (#when PC_PORT + ;; Check to see if the string should be filtered or not + (when (pc-filter-debug-string? arg2 (vector-vector-distance arg3 (target-pos 0))) + ;;(format #t "got: ~S~%" arg2) + ;; no-op the function! + (return #f) + ) + ) (cond (*debug-draw-pauseable* (let ((v1-2 (get-debug-text-3d))) diff --git a/goal_src/jak1/kernel-defs.gc b/goal_src/jak1/kernel-defs.gc index 76a5740a3e..76faf69fa9 100644 --- a/goal_src/jak1/kernel-defs.gc +++ b/goal_src/jak1/kernel-defs.gc @@ -391,3 +391,4 @@ ;; These were made by us. (define-extern vm-ptr (function int pointer)) +(define-extern pc-filter-debug-string? (function string float symbol))