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
@@ -377,6 +377,9 @@ ava2::app::AppLoop::Frame RunClient(ava2::app::AppLoop* loop, int argc, char** a
|
||||
bool mobile_ui = false;
|
||||
float phone_w = 0.0f, phone_h = 0.0f, phone_density = 1.0f;
|
||||
#if defined(SDL_PLATFORM_ANDROID) || defined(SDL_PLATFORM_IOS)
|
||||
// The game is landscape-only. Without this hint SDL requests FULL_USER for a resizable window
|
||||
// on Android, overriding the manifest's sensorLandscape (the HUD then letterboxes in portrait).
|
||||
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
|
||||
mobile_ui = ava2::platform::QueryDisplay(&phone_w, &phone_h, &phone_density);
|
||||
#endif
|
||||
if (!phone_spec.empty()) {
|
||||
@@ -398,9 +401,14 @@ ava2::app::AppLoop::Frame RunClient(ava2::app::AppLoop* loop, int argc, char** a
|
||||
screen_width = int(ava2::CPythonSystem::Instance().GetWidth());
|
||||
screen_height = int(ava2::CPythonSystem::Instance().GetHeight());
|
||||
}
|
||||
#endif
|
||||
SDL_WindowFlags window_flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY;
|
||||
#if defined(SDL_PLATFORM_ANDROID) || defined(SDL_PLATFORM_IOS)
|
||||
// Immersive: hide the status and navigation bars, which otherwise draw over the HUD.
|
||||
window_flags |= SDL_WINDOW_FULLSCREEN;
|
||||
#endif
|
||||
std::unique_ptr<SDL_Window, decltype(&SDL_DestroyWindow)> window(
|
||||
SDL_CreateWindow("AVA2 — Metin2 Client", screen_width, screen_height, SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY),
|
||||
SDL_CreateWindow("AVA2 — Metin2 Client", screen_width, screen_height, window_flags),
|
||||
SDL_DestroyWindow
|
||||
);
|
||||
if (!window) throw std::runtime_error(SDL_GetError());
|
||||
|
||||
Reference in New Issue
Block a user