Android device verification: forced landscape, fullscreen, data layering
- Ava2Activity passes the "args" intent extra as the command line (build.sh forwards AVA2_ARGS); it also always requests sensor landscape. - app_loop sets SDL_HINT_ORIENTATIONS to landscape and creates the window fullscreen on Android/iOS (SDL requested FULL_USER for the resizable window, overriding the manifest; the status bar drew over the HUD). - push_assets.py: pack-manifest test-rundir now wins over assets/loose (~1000 differing files; half-size tree atlases broke SpeedTree UVs), pushes in batches of <=20k files, and chmods shell-owned files so the app can read them on Android 17. - PORT-PLAN: device verification results and outstanding gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6244b1d860
commit
8f96e7a143
@@ -5,7 +5,7 @@
|
||||
## 现状
|
||||
|
||||
- `android/build.sh` 可以编出 arm64 调试 APK(SDL3 + FreeType 自动编译,16 KB 页对齐),连接手机时自动安装启动;真机运行尚未验证。
|
||||
- `android/push_assets.py` 把资源(`assets/loose` + python-root + `python27.zip`)推送到应用外部存储目录,客户端启动时切换到该目录。
|
||||
- `android/push_assets.py` 把资源(`assets/loose`,其上叠加按打包清单生成的 `build/dev/test-rundir`,同名文件以 pack 版本为准;再叠加 python-root 和 `python27.zip`)推送到应用外部存储目录,客户端启动时切换到该目录。
|
||||
- 游戏资源为 2.8 GB、约 5 万个散文件(`assets/loose`),17 个源文件中 120 多处通过 `std::filesystem` / `ifstream` 直接读文件,无法读取 APK 内置资源。
|
||||
- 平台层已实现(`src/app/platform/`):资源根目录与配置目录;前后台切换(进后台时保存配置、暂停声音、取消输入、停止渲染,网络照常收发;Android 设 `SDL_ANDROID_BLOCK_ON_PAUSE=0`);安全区域按逻辑分辨率换算后放进触摸布局,HUD 用 `touch.GetSafeArea()` 内缩。低内存事件目前只记日志;均未真机验证。
|
||||
- 触摸分流已实现(`src/app/input/touch_router.*`,见下文 `input/`):移动端或 `--touch` / `AVA2_TOUCH=1` 时关闭 SDL 触摸转鼠标,每个手指分到界面、攻击键、左下浮动摇杆或镜头(单指拖动转向、双指缩放、轻点=点地移动)。Python 模块 `touch` 供 HUD 设置攻击键位置并读取摇杆状态;`ui_mobile_joystick` / `ui_mobile_combat` 改为只做显示(`not_pick`)。多指同时操作尚未在真机验证。
|
||||
|
||||
@@ -1495,3 +1495,55 @@ Outstanding:
|
||||
- A button's zero-size TextLine sits at the button's exact centre pixel,
|
||||
and IsIn is inclusive, as in the original. Only that one pixel misses
|
||||
the button.
|
||||
|
||||
### 2026-10-13 Android device verification
|
||||
|
||||
Device: OnePlus PJZ110 (Android 17), 2376x1080 at density 3.00, giving a 1320x600 logical UI.
|
||||
Safe area insets: 117/67/50/53.
|
||||
|
||||
Changes:
|
||||
- `Ava2Activity` (extends SDLActivity) passes the `args` intent extra as the command line,
|
||||
so a dev run can start in `--phase game --preview-data`. `android/build.sh` forwards
|
||||
`AVA2_ARGS`.
|
||||
- Startup crash: directories created by `adb push` were owned by `shell` with mode 2770,
|
||||
so the app uid could not stat `ymir work/pc/...gr2`. The uncaught std::filesystem
|
||||
exception ended main. `push_assets.py` now chmods what shell owns after the push. It
|
||||
skips files the app wrote itself (channel.inf, the cfg files), which shell cannot chmod.
|
||||
- Forced landscape: the window is resizable and had no `SDL_HINT_ORIENTATIONS`, so SDL
|
||||
requested FULL_USER. That overrode the manifest's `sensorLandscape`, and the game
|
||||
rendered letterboxed in portrait. Fixes:
|
||||
- app_loop sets the hint to `LandscapeLeft LandscapeRight` on Android and iOS.
|
||||
- `Ava2Activity.setOrientationBis` always requests SENSOR_LANDSCAPE.
|
||||
- Verified with the system rotation locked to portrait.
|
||||
- The mobile window is `SDL_WINDOW_FULLSCREEN` (immersive). Before this, the status bar
|
||||
drew over the HUD. Verified.
|
||||
- Wrong trees on the phone: about 1000 files exist in both `assets/loose` and the
|
||||
pack-manifest test-rundir with different content. Examples are the zone/b tree atlases
|
||||
(at half size), monster2/npc_pet models and pc effects. `assets/loose` was layered on
|
||||
top, which broke the SpeedTree UVs into flat green cards. The desktop client showed the
|
||||
same result in `build/android-data/root`. Fix: `push_assets.py` now stages
|
||||
`assets/loose` first and lets test-rundir (what the original client serves from its
|
||||
packs) win.
|
||||
- One `adb push --sync` over all ~98k files aborts in file_sync_client ("failed to read
|
||||
stat response"). push_assets.py now pushes batches of at most 20,000 files.
|
||||
|
||||
Verified on the device:
|
||||
- Game phase renders correctly on Vulkan.
|
||||
- Joystick moves the player.
|
||||
- The inventory opens from the HUD and closes with its X.
|
||||
- Login phase shows the server list.
|
||||
- 60 fps steady on the 60 Hz panel (SurfaceFlinger latency: 0 frames over 25 ms), with
|
||||
SoC sensors around 41 °C.
|
||||
|
||||
Environment notes:
|
||||
- A root-owned adb server on :5037 claims the phone, and launchd respawns it. Use the SDK
|
||||
adb (34.0.4) against it: a different client version restarts that server mid-push.
|
||||
|
||||
Outstanding:
|
||||
- Item gestures on the device: the preview inventory is empty, so pick/drag/double-tap/
|
||||
long-press were checked only in `ava2.inventory_touch`.
|
||||
- Real-server login: no isolated AVA2 server or account is available. The listed
|
||||
servers are not to be used.
|
||||
- A missing or unreadable model should fail that load, not throw out of main.
|
||||
- The `--preview-data` camera starts inside the tree canopy, so the player is hidden.
|
||||
- Thermals over a long session not yet measured.
|
||||
|
||||
Reference in New Issue
Block a user