From cf79ca04e987166ce045cc7e72ed306d696d2c59 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Fri, 3 May 2024 08:34:36 +0100 Subject: [PATCH] fix another jak 1 level name (#3503) --- decompiler/level_extractor/extract_level.cpp | 5 ++++- .../opengl_renderer/background/background_common.cpp | 3 --- game/graphics/opengl_renderer/shaders/etie_base.vert | 8 -------- game/graphics/opengl_renderer/shaders/tfrag3.vert | 8 -------- goal_src/jak1/engine/level/level.gc | 4 +++- 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/decompiler/level_extractor/extract_level.cpp b/decompiler/level_extractor/extract_level.cpp index 8a3a5349c..e209e6621 100644 --- a/decompiler/level_extractor/extract_level.cpp +++ b/decompiler/level_extractor/extract_level.cpp @@ -180,9 +180,12 @@ level_tools::BspHeader extract_bsp_from_level(const ObjectFileDB& db, bsp_header.read_from_file(bsp_file.linked_data, db.dts, &draw_stats, db.version()); ASSERT((int)bsp_header.drawable_tree_array.trees.size() == bsp_header.drawable_tree_array.length); + // grrr..... if (db.version() == GameVersion::Jak1 && dgo_name == "TIT.DGO" && bsp_header.name == "intro") { - // grrr..... bsp_header.name = "title"; + } else if (db.version() == GameVersion::Jak1 && dgo_name == "DEM.DGO" && + bsp_header.name == "intro") { + bsp_header.name = "demo"; } /* diff --git a/game/graphics/opengl_renderer/background/background_common.cpp b/game/graphics/opengl_renderer/background/background_common.cpp index a61604fac..3e51e04f0 100644 --- a/game/graphics/opengl_renderer/background/background_common.cpp +++ b/game/graphics/opengl_renderer/background/background_common.cpp @@ -191,9 +191,6 @@ void first_tfrag_draw_setup(const TfragRenderSettings& settings, glUniform4f(glGetUniformLocation(id, "fog_color"), render_state->fog_color[0] / 255.f, render_state->fog_color[1] / 255.f, render_state->fog_color[2] / 255.f, render_state->fog_intensity / 255); - - glUniform1f(glGetUniformLocation(id, "fog_hack_threshold"), - render_state->version == GameVersion::Jak1 ? 0.005f : 0); } void interp_time_of_day_slow(const math::Vector itimes[4], diff --git a/game/graphics/opengl_renderer/shaders/etie_base.vert b/game/graphics/opengl_renderer/shaders/etie_base.vert index 981009f36..1e45aa6da 100644 --- a/game/graphics/opengl_renderer/shaders/etie_base.vert +++ b/game/graphics/opengl_renderer/shaders/etie_base.vert @@ -11,7 +11,6 @@ uniform float fog_min; uniform float fog_max; uniform sampler1D tex_T10; // note, sampled in the vertex shader on purpose. uniform int decal; -uniform float fog_hack_threshold; out vec4 fragment_color; out vec3 tex_coord; @@ -62,12 +61,5 @@ void main() { fragment_color.a *= 2; } - // fog hack - if (fragment_color.r < fog_hack_threshold && - fragment_color.g < fog_hack_threshold && - fragment_color.b < fog_hack_threshold) { - fogginess = 0; - } - tex_coord = tex_coord_in; } diff --git a/game/graphics/opengl_renderer/shaders/tfrag3.vert b/game/graphics/opengl_renderer/shaders/tfrag3.vert index 4c07ded70..59e810752 100644 --- a/game/graphics/opengl_renderer/shaders/tfrag3.vert +++ b/game/graphics/opengl_renderer/shaders/tfrag3.vert @@ -11,7 +11,6 @@ uniform float fog_min; uniform float fog_max; uniform sampler1D tex_T10; // note, sampled in the vertex shader on purpose. uniform int decal; -uniform float fog_hack_threshold; out vec4 fragment_color; out vec3 tex_coord; @@ -72,13 +71,6 @@ void main() { // tfrag/tie always use TCC=RGB, so even with decal, alpha comes from fragment. fragment_color.xyz = vec3(1.0, 1.0, 1.0); } - - // fog hack - if (fragment_color.r < fog_hack_threshold && - fragment_color.g < fog_hack_threshold && - fragment_color.b < fog_hack_threshold) { - fogginess = 0; - } tex_coord = tex_coord_in; } diff --git a/goal_src/jak1/engine/level/level.gc b/goal_src/jak1/engine/level/level.gc index 6c391347c..c5ea0f1d7 100644 --- a/goal_src/jak1/engine/level/level.gc +++ b/goal_src/jak1/engine/level/level.gc @@ -141,9 +141,11 @@ (else (load-dbg "bsp relocate: ~A~%" this) ;; everything is okay, link the bsp and level. - ;; og:preserve-this fix bad filename. + ;; og:preserve-this fix bad filenames (when (= (-> s5-0 name) 'title) (set! (-> this name) 'title)) + (when (= (-> s5-0 name) 'demo) + (set! (-> this name) 'demo)) (set! (-> s5-0 bsp) this) (set! (-> this level) s5-0) this