-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add localized entries, spt dbg source and fix oodle67 compression
- Loading branch information
Showing
8 changed files
with
173 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <includes.hpp> | ||
#include <tools/ff/linkers/linker_bo4.hpp> | ||
|
||
namespace fastfile::linker::bo4 { | ||
class LocalizeWorker : public LinkerWorker { | ||
public: | ||
LocalizeWorker() : LinkerWorker("Localize") {} | ||
|
||
void Compute(BO4LinkContext& ctx) override { | ||
|
||
std::filesystem::path localizePath{ ctx.linkCtx.input / "localize.json" }; | ||
core::config::Config localize{ localizePath }; | ||
localize.SyncConfig(false); | ||
if (localize.main.Empty()) return; // nothing to force | ||
|
||
struct LocalizeEntry { | ||
uintptr_t value; // const char* | ||
XHash name; | ||
}; | ||
|
||
size_t added{}; | ||
for (auto& [k, v] : localize.main.GetObj()) { | ||
if (!k.IsString() || !v.IsString()) { | ||
LOG_WARNING("Invalid localize: {} -> {}", k.GetString(), v.GetString()); | ||
continue; | ||
} | ||
LocalizeEntry& header{ utils::Allocate<LocalizeEntry>(ctx.assetData) }; | ||
header.name.hash = hash::Hash64Pattern(k.GetString()); | ||
header.value = fastfile::ALLOC_PTR; | ||
utils::WriteString(ctx.assetData, v.GetString()); | ||
ctx.assets.emplace_back(games::bo4::pool::ASSET_TYPE_LOCALIZE_ENTRY, fastfile::ALLOC_PTR); | ||
added++; | ||
} | ||
LOG_INFO("Added asset localizeentry {}: {} entry(ies)", localizePath.string(), added); | ||
} | ||
}; | ||
|
||
utils::ArrayAdder<LocalizeWorker, LinkerWorker> impl{ GetWorkers() }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters