From 0c64d48b0d507485366aea4b4ff3fa418f5327e6 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sat, 11 Mar 2023 22:13:55 +0000 Subject: [PATCH] [jak2] `force-envmap?` hack (#2316) Also affects texscroll and ripple, but I'm not sure what would be good places to test those. --- goal_src/jak2/engine/gfx/foreground/foreground.gc | 3 +++ goal_src/jak2/pc/debug/default-menu-pc.gc | 2 +- scripts/gsrc/code_retention/all_types_retention.py | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/goal_src/jak2/engine/gfx/foreground/foreground.gc b/goal_src/jak2/engine/gfx/foreground/foreground.gc index b55e26ed17..1a8a2d919d 100644 --- a/goal_src/jak2/engine/gfx/foreground/foreground.gc +++ b/goal_src/jak2/engine/gfx/foreground/foreground.gc @@ -857,6 +857,9 @@ ) ;;(.lui fg-work 28672) (set! fg-work (scratchpad-object foreground-work)) + (with-pc + (when (-> *pc-settings* force-envmap?) + (set! dist-in 0.0))) (let* ((bone-calc (the-as bone-calculation (-> dma-buf base))) (matrix-mem (the-as object (&+ (the-as pointer bone-calc) 64))) ) diff --git a/goal_src/jak2/pc/debug/default-menu-pc.gc b/goal_src/jak2/pc/debug/default-menu-pc.gc index 05b2c8ff7c..17fd8c88aa 100644 --- a/goal_src/jak2/pc/debug/default-menu-pc.gc +++ b/goal_src/jak2/pc/debug/default-menu-pc.gc @@ -771,7 +771,7 @@ ) (menu "Level of detail" (flag "PS2 LOD " #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-lod-dist?))) - ;(flag "Force Envmap" #f ,(dm-lambda-boolean-flag (-> *pc-settings* force-envmap?))) + (flag "Force Envmap" #f ,(dm-lambda-boolean-flag (-> *pc-settings* force-envmap?))) (int-var "LOD Tfrag" 0 dm-lod-int 0 1 #t 0 2) (int-var "LOD Tie" 1 dm-lod-int 0 1 #t 0 3) ;(int-var "LOD Ocean" 2 dm-lod-int 0 1 #t 0 3) diff --git a/scripts/gsrc/code_retention/all_types_retention.py b/scripts/gsrc/code_retention/all_types_retention.py index 4b791d8607..a65308d799 100644 --- a/scripts/gsrc/code_retention/all_types_retention.py +++ b/scripts/gsrc/code_retention/all_types_retention.py @@ -92,5 +92,7 @@ def update_all_blocks(game_name, block_dict): final_lines.append(line) i = i + 1 # Update the file contents - with open(path, "w") as f: - f.writelines(final_lines) + # Don't write a new file unless we have to, though + if lines != final_lines: + with open(path, "w") as f: + f.writelines(final_lines)