port 2D step 5b: PackInitialize + pack:// asset_io backend over the ported EterPackManager

Platform UserInterface PackInitialize/PackSingletons (40250 bootstrap, on-disk dbname
resolution), EterBase/FileLoader.cpp mirror, mtpack40250 backend behind asset_io's
pack:// scheme and a Metin2Pack node. port_eterpack_test now registers through
PackInitialize. Nothing reads pack:// at runtime yet; port-map stays TODO.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-23 01:31:17 +09:00
co-authored by Claude Opus 5
parent 1f1004da79
commit 5a26e93f07
13 changed files with 574 additions and 91 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
// Metin2Pack — GDScript access to the 40250 packs (platform/PackBackend.h).
//
// Metin2Pack.initialize(AssetRoot.client_path()) # registers <Client>/pack/Index once
// var b := Metin2Pack.get_bytes("locale/en/item_proto")
//
// Every native reader that takes a path accepts "pack://<40250 path>" through asset_io.
#include <godot_cpp/classes/object.hpp>
#include <godot_cpp/variant/packed_byte_array.hpp>
#include <godot_cpp/variant/string.hpp>
namespace mtgodot {
class Metin2Pack : public godot::Object {
GDCLASS(Metin2Pack, godot::Object)
public:
static bool initialize(const godot::String &client_dir);
static bool is_ready();
static bool exists(const godot::String &name);
static godot::PackedByteArray get_bytes(const godot::String &name);
protected:
static void _bind_methods();
};
} // namespace mtgodot