notes/systems/filesystem.md: the packed .a archive format; data_path lowercases like the game

The import tool (tools/import.py, gitignored) unpacks all 22 archives (checksums verified), converts XML and anm2 to
JSON and writes every path lowercased, matching the game's case-insensitive lookups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 21:56:56 -05:00
1 parent 08ca87dded
commit 8c31c98a81
2 files changed
+72 -1

No files matched your search

+5 -1
View File
@@ -1,11 +1,15 @@
#include "data.h"
#include <cctype>
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)
{
return dataDirectory + std::string(path) + ".json";
std::string normalized(path);
for (char& letter : normalized) letter = letter == '\\' ? '/' : (char)std::tolower((unsigned char)letter);
return dataDirectory + normalized + ".json";
}
// Loads a converted document, leaving isLoaded false when it is missing or unreadable.