mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 23:22:17 -04:00
extractor: cleanup, support unicode properly, and add multi-game support (#1609)
* extractor: refactor and cleanup for multi-game support * deps: switch to `ghc::filesystem` as it is utf-8 everywhere by default * extractor: finally working with unicode * unicode: fix unicode cli args on windows in all `main` functions
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include "TextureDB.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
@@ -45,12 +43,11 @@ void TextureDB::add_texture(u32 tpage,
|
||||
}
|
||||
}
|
||||
|
||||
void TextureDB::replace_textures(const std::filesystem::path& path) {
|
||||
std::filesystem::path base_path(path);
|
||||
void TextureDB::replace_textures(const fs::path& path) {
|
||||
fs::path base_path(path);
|
||||
for (auto& tex : textures) {
|
||||
std::filesystem::path full_path =
|
||||
base_path / tpage_names.at(tex.second.page) / (tex.second.name + ".png");
|
||||
if (std::filesystem::exists(full_path)) {
|
||||
fs::path full_path = base_path / tpage_names.at(tex.second.page) / (tex.second.name + ".png");
|
||||
if (fs::exists(full_path)) {
|
||||
fmt::print("Replacing {}\n", full_path.string().c_str());
|
||||
int w, h;
|
||||
auto data = stbi_load(full_path.string().c_str(), &w, &h, 0, 4); // rgba channels
|
||||
|
||||
Reference in New Issue
Block a user