Skip to content

Commit

Permalink
fix another jak 1 level name (#3503)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManDude authored May 3, 2024
1 parent 6569636 commit cf79ca0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
5 changes: 4 additions & 1 deletion decompiler/level_extractor/extract_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<s32, 4> itimes[4],
Expand Down
8 changes: 0 additions & 8 deletions game/graphics/opengl_renderer/shaders/etie_base.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
8 changes: 0 additions & 8 deletions game/graphics/opengl_renderer/shaders/tfrag3.vert
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
4 changes: 3 additions & 1 deletion goal_src/jak1/engine/level/level.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf79ca0

Please sign in to comment.