Add standalone BMH and FLTD to OBW converter (by Codex)

This commit is contained in:
Codex committed 2026-10-17 22:21:17 +02:00
1 parent 310e3e2464
commit 9bff07828a
23 files changed
+1928 -4

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <filesystem>
#include <map>
#include <string>
#include "cli/json.hpp"
#include "formats/le.hpp"
#include "formats/m3d.hpp"
#include "formats/textd.hpp"
namespace bmh::obw {
// A conversion document, deliberately independent of GameState and CareerSession.
// Keys are relative, authored archive paths; values are UTF-8 text.
using Documents = std::map<std::string, std::string>;
struct Options {
std::string start_date; // Required: legacy databases have ages, not birth dates.
std::string title = "Imported legacy world";
};
Documents convert_database(const Database& database, const TextDb& texts,
const LeImage& executable, bool english, const Options& options);
Documents import_installation(const std::filesystem::path& source, const Options& options);
// Checks the conversion profile and its cross-table references before any output.
// This is not the future engine's competition/playability validator.
void validate(const Documents& documents);
// Refuses existing destinations. Publishes a complete sibling staging path by rename.
// No files in the installation are changed, copied back or executed.
void write(const Documents& documents, const std::filesystem::path& destination, bool directory);
} // namespace bmh::obw