Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jube committed Feb 13, 2025
1 parent 814c08b commit 8ec60a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions code/akagoria-compile-data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <fstream>
#include <unordered_set>

#include <fmt/std.h>
#include <nlohmann/json.hpp>

#include <gf2/core/Clock.h>
Expand Down Expand Up @@ -242,8 +243,7 @@ namespace {
void copy_textures(const gf::TiledMap& map, const std::filesystem::path& raw_directory, const std::filesystem::path& out_directory)
{
for (const auto& texture : map.textures) {
const std::filesystem::path relative_path = std::filesystem::proximate(texture.string(), raw_directory);
copy_textures(relative_path, raw_directory, out_directory);
copy_textures(texture, raw_directory, out_directory);
}
}

Expand All @@ -263,8 +263,8 @@ namespace {
void sanitize_paths(gf::TiledMap& map, const std::filesystem::path& raw_directory)
{
for (auto& texture : map.textures) {
const std::filesystem::path relative_path = std::filesystem::proximate(texture.string(), raw_directory);
texture = relative_path;
std::filesystem::path relative_path = std::filesystem::proximate(texture.string(), raw_directory);
texture = std::move(relative_path);
}
}

Expand Down Expand Up @@ -341,6 +341,7 @@ int main() {
gf::Log::info("# Reading map...");

data.map = gf::TiledMap(raw_directory / "akagoria.tmx");
sanitize_paths(data.map, raw_directory);

gf::Log::info("# Creating database...");

Expand All @@ -357,8 +358,6 @@ int main() {
copy_textures(data.map, raw_directory, out_directory);
copy_textures(data.items, raw_directory, out_directory);

sanitize_paths(data.map, raw_directory);

auto duration = clock.elapsed_time();
gf::Log::info("Data successfully compiled in {} ms", duration.as_milliseconds());

Expand Down
2 changes: 1 addition & 1 deletion code/bits/Akagoria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace akgr {

auto font_file = resource_manager()->search("fonts/DejaVuSans.ttf");
assert(!font_file.empty());
auto* font = io.Fonts->AddFontFromFileTTF(font_file.string().c_str(), 32.0f);
[[maybe_unused]] auto* font = io.Fonts->AddFontFromFileTTF(font_file.string().c_str(), 32.0f);
assert(font != nullptr);

m_slot_manager.load_slot_headers();
Expand Down

0 comments on commit 8ec60a0

Please sign in to comment.