Skip to content

Commit

Permalink
remove subtitle-v3 tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Hat-Kid committed Nov 12, 2024
1 parent 8347e0d commit 075143c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 42 deletions.
11 changes: 1 addition & 10 deletions common/serialization/subtitles/subtitles_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion game/assets/jak3/game_subtitle.gp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; "project file" for subtitles make tool.

(subtitle-v3
(subtitle-v2
(file-json
:language-id 0
:text-version "jak3"
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/game.gp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
)

(defstep :in "game/assets/jak3/game_subtitle.gp"
:tool 'subtitle-v3
:tool 'subtitle-v2
:out '("$OUT/iso/0SUBTI3.TXT")
)

Expand Down
2 changes: 1 addition & 1 deletion goalc/compiler/compilation/CompilerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GameSubtitleDefinitionFile> inputs;
// open all project files specified (usually one).
for_each_in_list(args.named.at("files"), [this, &inputs, &form, &kind](const goos::Object& o) {
Expand Down
1 change: 0 additions & 1 deletion goalc/make/MakeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ MakeSystem::MakeSystem(const std::optional<REPL::Config> repl_config, const std:
add_tool<TextTool>();
add_tool<SubtitleTool>();
add_tool<SubtitleV2Tool>();
add_tool<SubtitleV3Tool>();
add_tool<BuildLevelTool>();
add_tool<BuildLevel2Tool>();
add_tool<BuildLevel3Tool>();
Expand Down
21 changes: 0 additions & 21 deletions goalc/make/Tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GameSubtitleDefinitionFile> files;
std::vector<std::string> 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<GameSubtitleDefinitionFile> 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) {
Expand Down
7 changes: 0 additions & 7 deletions goalc/make/Tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 075143c

Please sign in to comment.