Files
mtgodot-poc/oracle/build-wine.sh
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

30 lines
1.4 KiB
Bash
Executable File
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.
#!/usr/bin/env bash
# 在 macOS 上用 MinGW-w64 交叉编译 oracle.exe(链泄露 SDK 的 granny2_x64.lib),
# 用 Wine 跑。见 RUNBOOK.md。实测 macOS 26.4 / Apple Silicon / wine-stable 11.0 / Granny 2.9.12.
set -euo pipefail
cd "$(dirname "$0")"
SDK="${GRANNY_SDK:-../../MobileSource/Cross Platform/Granny-3D-SDK-main}"
[ -f "$SDK/include/granny.h" ] || { echo "找不到 $SDK/include/granny.h(传 GRANNY_SDK=<SDK 根>"; exit 1; }
CC="${MINGW_CC:-x86_64-w64-mingw32-gcc}"
command -v "$CC" >/dev/null || { echo "没装 MinGWbrew install mingw-w64"; exit 1; }
# 关键:granny.h 在 _WIN64 分支里 `#define GRANNY_64BIT_TYPE __int64`
# MinGW GCC 默认不认 __int64 关键字 → 用 -D__int64="long long" 顶掉。
"$CC" -O2 -std=gnu11 -fms-extensions -D'__int64=long long' \
-I "$SDK/include" \
oracle.c "$SDK/lib/win64/granny2_x64.lib" \
-o oracle.exe
cp "$SDK/lib/win64/granny2_x64.dll" ./
echo "built: $(pwd)/oracle.exe (+ granny2_x64.dll)"
echo
echo "跑(Wine):"
echo " export WINEPREFIX=\$HOME/.wine-oracle # ⚠ 别放 /tmpWine 拒绝在非属主目录建 prefix"
echo " wine wineboot --init # 首次,Rosetta 下较慢"
echo " wine oracle.exe probe 'Z:\\path\\to\\warrior_cheongrin.gr2'"
echo " wine oracle.exe dump 'Z:\\...\\model.gr2' 'Z:\\...\\anim.gr2' <t> -o 'Z:\\...\\out.bin' --mesh N"
echo
echo "对拍:build/tools/oracle_diff <model.gr2> <anim.gr2|-> <out.bin> --mesh N"