some bug fixes, added spritesheet filepath setting, etc.

This commit is contained in:
2026-03-05 00:10:59 -05:00
parent 5a48b07321
commit 77f6e65b15
14 changed files with 272 additions and 77 deletions
+3 -13
View File
@@ -226,6 +226,8 @@ namespace anm2ed::anm2
{
WorkingDirectory workingDirectory(directory);
this->path = !path.empty() ? path::make_relative(path) : this->path;
if (this->path.empty()) return false;
path::ensure_directory(this->path.parent_path());
return texture.write_png(this->path);
}
@@ -250,6 +252,7 @@ namespace anm2ed::anm2
hash_combine(seed, std::hash<int>{}(texture.size.y));
hash_combine(seed, std::hash<int>{}(texture.channels));
hash_combine(seed, std::hash<int>{}(texture.filter));
hash_combine(seed, std::hash<std::string>{}(path::to_utf8(path)));
if (!texture.pixels.empty())
{
@@ -261,19 +264,6 @@ namespace anm2ed::anm2
hash_combine(seed, 0);
}
for (const auto& [id, region] : regions)
{
hash_combine(seed, std::hash<int>{}(id));
hash_combine(seed, std::hash<std::string>{}(region.name));
hash_combine(seed, std::hash<float>{}(region.crop.x));
hash_combine(seed, std::hash<float>{}(region.crop.y));
hash_combine(seed, std::hash<float>{}(region.size.x));
hash_combine(seed, std::hash<float>{}(region.size.y));
hash_combine(seed, std::hash<float>{}(region.pivot.x));
hash_combine(seed, std::hash<float>{}(region.pivot.y));
hash_combine(seed, std::hash<int>{}(static_cast<int>(region.origin)));
}
return static_cast<uint64_t>(seed);
}