data.h: resource_path (lowercased, as the game normalizes); .anm2 files are Anm2Ed JSON documents

The import tool now writes every .anm2 as Anm2Ed's JSON document under its own name (anm2ed convert --format json),
as isaac-classic does; other XML keeps the generic {tag, attrs, children, text} mapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 22:31:16 -05:00
1 parent 837aa06518
commit d6e1ca7c6c
2 files changed
+13 -5

No files matched your search

+10 -4
View File
@@ -3,13 +3,19 @@
std::string dataDirectory = "resources/";
// Where a game path lives once imported: its converted JSON under the data directory.
// Paths are lowercased with forward slashes, as the game does before every lookup.
std::string data_path(std::string_view path)
// Where a game path lives once imported: under the data directory, lowercased with forward slashes, as the game
// normalizes every path before a lookup.
std::string resource_path(std::string_view path)
{
std::string normalized(path);
for (char& letter : normalized) letter = letter == '\\' ? '/' : (char)std::tolower((unsigned char)letter);
return dataDirectory + normalized + ".json";
return dataDirectory + normalized;
}
// Where a converted XML document lives: its resource path with ".json" appended.
std::string data_path(std::string_view path)
{
return resource_path(path) + ".json";
}
// Loads a converted document, leaving isLoaded false when it is missing or unreadable.