Files
mtgodot-poc/formats/texture_set.h
T
shenandClaude Sonnet 5 47baf6c0c6 Metin2 game client (P0–P11) + mobile asset pipeline
Networked client on the existing Godot 4.7 + libgr2 renderer:
- net: m2dev wire protocol (libsodium KX + XChaCha20), auth/select/game
  phases, EntityStore world model, ~all GC/CG headers. char create/delete,
  private shop / mall / cube, SHOP_GC_START_EX, guild, party (+ CG_PARTY_SET_STATE),
  quests, dragon soul, refine, safebox, exchange.
- UI: in-game windows migrated 1:1 from the reference uiscript/root .py —
  char status (/stat), inventory+equipment, select-item ([SELECT_ITEM] quest
  token), system-option + game-option + ESC system menu, private-shop 39-grid,
  party info board, shop tabs, atlas, minimap, quickbar, chat, …
- EterGrnLib polish: GR2 material blend/two-sided, LOD crossfade, motion-event
  dispatch, contact shadow, ray-AABB picking, weapon grip pre-transform.

Portable asset IO (A1) — all extension/libgr2/formats/mtproto reads routed
through godot::FileAccess (res:// PCK works on iOS/Android); standalone-lib
*_path() kept for the non-Godot CTests. AssetResolver + PropertyRegistry
switched to a baked index (bake_asset_index.gd) instead of std::filesystem.

Mobile builds: build-{android,ios}.sh, export-android.sh, pack-assets.sh,
gen-debug-keystore.sh. Assets ship as a zip mounted at runtime by
project/asset_pack.gd (adb push now; HTTP download is a drop-in later).

ctest 10/10, 34 GDScript suites, macOS/iOS/Android all build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EJxkHiNKS4kybHS3XKyAJ
2026-08-31 20:02:12 +09:00

32 lines
1.1 KiB
C++

// TextureSet .txt(首行 `TextureSet`)—— 地表图层表。
// 对标 PRTerrainLib/TextureSet.cpp CTextureSet::Load。SHINSOO §5.4。
//
// 关键:运行时 index 0 是原客户端内部的空图层(AddEmptyTexture),文件里的
// `Texture001` 对应运行时索引 1。`layers` 按文件顺序(即运行时索引 1..N)。
#pragma once
#include <string>
#include <vector>
namespace fmt {
struct TextureLayer {
std::string texture; // 相对路径(原样,含 d:\ymir work\ 前缀)
float u_scale = 1, v_scale = 1;
float u_offset = 0, v_offset = 0;
bool splat_enabled = false;
unsigned short height_begin = 0;
unsigned short height_end = 0;
};
struct TextureSet {
int declared_count = 0; // TextureCount
std::vector<TextureLayer> layers; // 实际解析到的图层(运行时索引 = 下标 + 1)
int runtime_count() const { return (int)layers.size() + 1; } // +1 空图层
};
bool parse_texture_set(const std::string& text, TextureSet& out, std::string* err);
bool parse_texture_set_file(const std::string& path, TextureSet& out, std::string* err);
} // namespace fmt