Files
mtgodot-poc/formats/splat.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

31 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// W2 —— tile.raw -> 每图层 258×258 alphasplat 权重)。
// 逐字节照 GameLib/AreaTerrain.cpp CTerrain::RAW_GenerateSplat
// texel 值 = TextureSet 运行时图层索引;
// layer i 的 alpha = 0xFF 当 tile==i;当 tile>i 且 3×3 邻域有 ==i 时也 0xFF(1px 羽化);否则 0。
// SHINSOO §9-W2。无 godot 依赖。
#pragma once
#include <cstdint>
#include <vector>
#include "terrain_files.h"
namespace fmt {
constexpr int SPLAT_RAW_XY = TILEMAP_RAW_XY; // 258
struct SplatLayer {
int layer = 0; // TextureSet 运行时索引(1..N
std::vector<uint8_t> alpha; // 258*258,行主序
int coverage = 0; // alpha==0xFF 的 texel 数(调试 / 决定是否提交)
};
struct SplatSet {
std::vector<SplatLayer> layers; // 只含在本区块出现过的图层,按索引升序
std::vector<int> tile_histogram; // [runtime_layer_index] -> texel 数(长度 = max+1
};
// tile 来自 load_tile_map。runtime_layer_count = TextureSet.runtime_count()(含 index 0 空层)。
void build_splat(const TileMap& tile, int runtime_layer_count, SplatSet& out);
} // namespace fmt