From 075143c0a1d5db8cd428d07401d5694a74c20e3e Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Tue, 12 Nov 2024 02:28:27 +0100 Subject: [PATCH] remove `subtitle-v3` tool --- .../serialization/subtitles/subtitles_v2.cpp | 11 +--------- game/assets/jak3/game_subtitle.gp | 2 +- goal_src/jak3/game.gp | 2 +- .../compiler/compilation/CompilerControl.cpp | 2 +- goalc/make/MakeSystem.cpp | 1 - goalc/make/Tools.cpp | 21 ------------------- goalc/make/Tools.h | 7 ------- 7 files changed, 4 insertions(+), 42 deletions(-) diff --git a/common/serialization/subtitles/subtitles_v2.cpp b/common/serialization/subtitles/subtitles_v2.cpp index 6387ea4ccd7..49d8917cbbd 100644 --- a/common/serialization/subtitles/subtitles_v2.cpp +++ b/common/serialization/subtitles/subtitles_v2.cpp @@ -465,16 +465,7 @@ GameSubtitleDB load_subtitle_project(const GameSubtitleDB::SubtitleFormat format if (format_version == GameSubtitleDB::SubtitleFormat::V1) { open_subtitle_project("subtitle", subtitle_project, files); } else { - switch (game_version) { - case GameVersion::Jak2: - open_subtitle_project("subtitle-v2", subtitle_project, files); - break; - case GameVersion::Jak3: - open_subtitle_project("subtitle-v3", subtitle_project, files); - break; - default: - break; - } + open_subtitle_project("subtitle-v2", subtitle_project, files); } for (auto& file : files) { db.init_banks_from_file(file); diff --git a/game/assets/jak3/game_subtitle.gp b/game/assets/jak3/game_subtitle.gp index 22bcec0e92c..f81fcd83f4c 100644 --- a/game/assets/jak3/game_subtitle.gp +++ b/game/assets/jak3/game_subtitle.gp @@ -1,6 +1,6 @@ ;; "project file" for subtitles make tool. -(subtitle-v3 +(subtitle-v2 (file-json :language-id 0 :text-version "jak3" diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 11275e258f0..23407ab7cf4 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -512,7 +512,7 @@ ) (defstep :in "game/assets/jak3/game_subtitle.gp" - :tool 'subtitle-v3 + :tool 'subtitle-v2 :out '("$OUT/iso/0SUBTI3.TXT") ) diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index 4a2cb815e7b..61929e54085 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -89,7 +89,7 @@ Val* Compiler::compile_asm_text_file(const goos::Object& form, const goos::Objec const auto kind = symbol_string(args.unnamed.at(0)); // compile files. - if (kind == "subtitle" || kind == "subtitle-v2" || kind == "subtitle-v3") { + if (kind == "subtitle" || kind == "subtitle-v2") { std::vector inputs; // open all project files specified (usually one). for_each_in_list(args.named.at("files"), [this, &inputs, &form, &kind](const goos::Object& o) { diff --git a/goalc/make/MakeSystem.cpp b/goalc/make/MakeSystem.cpp index 2cf46d85507..dfa29b7d0e9 100644 --- a/goalc/make/MakeSystem.cpp +++ b/goalc/make/MakeSystem.cpp @@ -108,7 +108,6 @@ MakeSystem::MakeSystem(const std::optional repl_config, const std: add_tool(); add_tool(); add_tool(); - add_tool(); add_tool(); add_tool(); add_tool(); diff --git a/goalc/make/Tools.cpp b/goalc/make/Tools.cpp index e1dce1f263c..ff6b245f4b8 100644 --- a/goalc/make/Tools.cpp +++ b/goalc/make/Tools.cpp @@ -247,27 +247,6 @@ bool SubtitleV2Tool::run(const ToolInput& task, const PathMap& path_map) { return true; } -SubtitleV3Tool::SubtitleV3Tool() : Tool("subtitle-v3") {} - -bool SubtitleV3Tool::needs_run(const ToolInput& task, const PathMap& path_map) { - if (task.input.size() != 1) { - throw std::runtime_error(fmt::format("Invalid amount of inputs to {} tool", name())); - } - std::vector files; - std::vector deps; - enumerate_subtitle_project_files(name(), task.input.at(0), path_map, files, deps); - return Tool::needs_run({task.input, deps, task.output, task.arg}, path_map); -} - -bool SubtitleV3Tool::run(const ToolInput& task, const PathMap& path_map) { - GameSubtitleDB db; - db.m_subtitle_version = GameSubtitleDB::SubtitleFormat::V2; - std::vector files; - run_subtitle_project_files(name(), task.input.at(0), path_map, files); - compile_game_subtitles(files, db, path_map.output_prefix); - return true; -} - BuildLevelTool::BuildLevelTool() : Tool("build-level") {} bool BuildLevelTool::needs_run(const ToolInput& task, const PathMap& path_map) { diff --git a/goalc/make/Tools.h b/goalc/make/Tools.h index 03479ab9195..28b88b42cb6 100644 --- a/goalc/make/Tools.h +++ b/goalc/make/Tools.h @@ -72,13 +72,6 @@ class SubtitleV2Tool : public Tool { bool needs_run(const ToolInput& task, const PathMap& path_map) override; }; -class SubtitleV3Tool : public Tool { - public: - SubtitleV3Tool(); - bool run(const ToolInput& task, const PathMap& path_map) override; - bool needs_run(const ToolInput& task, const PathMap& path_map) override; -}; - class BuildLevelTool : public Tool { public: BuildLevelTool();