on-screen controls: two sticks beside the d-pad, and the controls take the bars beside or under the picture

A left and a right stick (a base and a knob that follows the finger, clamped) write the pad's
thumb axes the way a physical stick does, and only while they own them, so a physical pad's
sticks are not zeroed by a tap on A. The layout follows where the compositor letterboxes the
picture: on a wide panel showing 16:9 the clusters go in the side bars, on a squarer panel
showing a wide picture they go in the bottom band, and only when neither bar is wide enough do
they overlay the picture as before. The activity hands the picture rectangle over whenever the
surface or the output size changes.
This commit is contained in:
The412Banner committed 2026-09-22 20:41:14 -04:00
1 parent 95cd642745
commit e0dd8b8c59
2 files changed
+159 -50

No files matched your search

@@ -263,6 +263,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
// was 16:9 — the picture came back squashed sideways. While a session runs, keep its size.
val size = if (SessionState.running) SessionState.outputSize else outputSize()
SessionState.outputSize = size
onScreenControls?.setPicture(drawnRect())
if (!SessionState.running) SessionState.refreshHz = refreshHz()
// Letterbox, never stretch or crop: the output can be a different shape from the panel,
// and a game's picture must keep its proportions with bars, not lose its edges.
@@ -336,6 +337,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
val resized = surfaceW != 0 && (width != surfaceW || height != surfaceH)
surfaceW = width
surfaceH = height
// The on-screen controls follow the picture: into the bars beside or under it when there are any.
onScreenControls?.setPicture(drawnRect())
if (resized) {
Log.i(TAG, "surface resized to ${width}x$height — rebinding the compositor")
CompositorHost.resize(holder.surface) { applyFrameGen() }