Expose a non-blocking TLS socket API to mods (WSS clients) without bundling
any game-specific multiworld content.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose a generic seam so a mod can drive a second screen without the
engine owning any dual-screen layout policy:
- render.compose hook in Renderer:endFrame hands a mod the finished
world + UI canvases, their SGB zones, the frame metrics,
Renderer:blitCanvas (lifted from the internal blit closure) and the
SecondScreen bridge. Return true to take over the window; no wrap (or
calling next) runs the normal single-window composite byte-for-byte.
- SecondScreen.lua + the Android Presentation bridge (love_android_
secondary_* in common/android.cpp, GameActivity secondary display)
as the optional physical-second-display transport.
No battle-render changes: a mod lays out the two screens (including any
battle split) itself. Ships with a unit test, no-mod parity via
gate_hooks, and docs/modding.md (D14).
love.system.syncHealthSteps() now exists on Android, matching the iOS
Health bridge merged in #452 and using the same JNI route as the SAF
picker (wrap_System.cpp -> System.cpp -> common/android.cpp ->
GameActivity over JNI):
- GameActivity.syncHealthSteps: one-shot read of the hardware
TYPE_STEP_COUNTER sensor (cumulative since boot, counted by the OS
whether or not any app runs). The reading is anchored in
SharedPreferences so a walk is never credited twice; a reading below
the anchor means the phone rebooted, which re-anchors without
crediting. Deltas (50k clamp) merge into steps_pending.json in the
save identity dir - the same contract as the iOS GRHealthBridge, so
the Pokewalker mod works unchanged on both platforms.
- ACTIVITY_RECOGNITION declared in the app manifest (Android 10+
runtime prompt on first sync; granted -> the sensor read runs
immediately via onRequestPermissionsResult). The build script's
permission trim leaves it alone.
- Nothing in the base game calls the new seam; without a consumer mod
the only cost is one dormant manifest permission.
- build_android.sh: shadow-build from a space-free temp dir when the
checkout path contains spaces - ndk-build is GNU make underneath and
cannot cope with paths like "xCode Projects".
- mobile/ANDROID.md: step-bridge dev notes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The manifest asks for android:screenOrientation="fullUser", but SDL
overrides it at window creation: SDLActivity.setOrientationBis, given a
resizable window and no SDL_HINT_ORIENTATIONS -- which is what conf.lua
produces on Android -- requests SCREEN_ORIENTATION_FULL_SENSOR. The
*_SENSOR constants follow the accelerometer even when the player has
turned auto-rotate off, so the game rotated anyway on a locked device.
Override setOrientationBis in GameActivity to remap SDL's request onto
the matching *_USER constant after super has run. The same orientations
stay allowed and SDL keeps deciding which ones those are; only the
tie-break changes, from the sensor to the system rotation setting.