mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 23:30:16 -04:00
build-level2 tool
This commit is contained in:
@@ -102,6 +102,7 @@ MakeSystem::MakeSystem(const std::optional<REPL::Config> repl_config, const std:
|
||||
add_tool<SubtitleTool>();
|
||||
add_tool<SubtitleV2Tool>();
|
||||
add_tool<BuildLevelTool>();
|
||||
add_tool<BuildLevel2Tool>();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
+20
-2
@@ -4,7 +4,8 @@
|
||||
#include "common/util/DgoWriter.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
|
||||
#include "goalc/build_level/build_level.h"
|
||||
#include "goalc/build_level/jak1/build_level.h"
|
||||
#include "goalc/build_level/jak2/build_level.h"
|
||||
#include "goalc/compiler/Compiler.h"
|
||||
#include "goalc/data_compiler/dir_tpages.h"
|
||||
#include "goalc/data_compiler/game_count.h"
|
||||
@@ -258,5 +259,22 @@ bool BuildLevelTool::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()));
|
||||
}
|
||||
return run_build_level(task.input.at(0), task.output.at(0), path_map.output_prefix);
|
||||
return jak1::run_build_level(task.input.at(0), task.output.at(0), path_map.output_prefix);
|
||||
}
|
||||
|
||||
BuildLevel2Tool::BuildLevel2Tool() : Tool("build-level2") {}
|
||||
|
||||
bool BuildLevel2Tool::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()));
|
||||
}
|
||||
auto deps = get_build_level_deps(task.input.at(0));
|
||||
return Tool::needs_run({task.input, deps, task.output, task.arg}, path_map);
|
||||
}
|
||||
|
||||
bool BuildLevel2Tool::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()));
|
||||
}
|
||||
return jak2::run_build_level(task.input.at(0), task.output.at(0), path_map.output_prefix);
|
||||
}
|
||||
|
||||
@@ -78,3 +78,10 @@ class BuildLevelTool : public Tool {
|
||||
bool run(const ToolInput& task, const PathMap& path_map) override;
|
||||
bool needs_run(const ToolInput& task, const PathMap& path_map) override;
|
||||
};
|
||||
|
||||
class BuildLevel2Tool : public Tool {
|
||||
public:
|
||||
BuildLevel2Tool();
|
||||
bool run(const ToolInput& task, const PathMap& path_map) override;
|
||||
bool needs_run(const ToolInput& task, const PathMap& path_map) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user