Widescreen: full-width overlays to within W/64 of each edge

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthew Stanley
2026-10-02 11:26:28 -07:00
parent cfd13c0b0a
commit bf91728a93
2 changed files with 16 additions and 5 deletions
+7 -5
View File
@@ -5602,11 +5602,13 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count,
int32_t width = max_x - min_x, height = max_y - min_y;
int32_t X = ws_disp_x(), W = ws_disp_w(), H = ws_disp_h();
/* Anything spanning the whole display width is a full-width overlay --
* letterbox bars, fade strips, subtitle bands -- not a widget: it widens
* with the image. Squashed as UI, a cutscene's bars left the revealed
* margins showing whatever the frame cleared to (Spider-Man). */
if ((min_x <= X && max_x >= X + W) ||
/* Anything spanning the display width (to within W/64 of each edge) is a
* full-width overlay -- letterbox bars, fade strips, menu band rules --
* not a widget: it widens with the image. Squashed as UI, a cutscene's
* bars left the revealed margins showing whatever the frame cleared to,
* and the pause menu's rules (x 2..510 of 512) stopped short of the band
* they frame (Spider-Man). */
if ((min_x <= X + W / 64 && max_x >= X + W - W / 64) ||
(width > W / 2 && height > H / 4)) {
ws_ui_reject.too_big++;
return;
@@ -259,6 +259,15 @@ int main(void) {
gpu_ws_prepass_linked_list(OT_HEAD);
assert(ws_ui_prepass_count == 2); /* frame + gouraud fill only */
assert(ws_ui_reject.too_big == 1);
/* A rule stopping two pixels short of each edge is full width too. */
const uint32_t rule[5] = {
0x28000000u, pack_vertex((int16_t)(bx0 + 2), 40), pack_vertex((int16_t)(bx1 - 2), 40),
pack_vertex((int16_t)(bx0 + 2), 44), pack_vertex((int16_t)(bx1 - 2), 44),
};
put_node(NODE_FLAT, 0xFFFFFFu, rule, 5);
gpu_ws_prepass_linked_list(OT_HEAD);
assert(ws_ui_prepass_count == 2 && ws_ui_reject.too_big == 1);
put_node(NODE_FLAT, 0xFFFFFFu, bar, 5);
gpu_exec_reset_triangles();
load_packet(NODE_FLAT, 5);
gp0_exec_mono_quad();