Skip to content

render: setBackdrop shows a part of its texture (the picture in a power-of-two one) - #163

Open
boubou666 wants to merge 1 commit into
masterfrom
amp/backdrop-extent
Open

boubou666 wants to merge 1 commit into
masterfrom
amp/backdrop-extent

Conversation

@boubou666

Copy link
Copy Markdown
Contributor

What

Renderer::setBackdrop gets two trailing parameters, u and v: the part of the texture that is the picture, from its corner.

  • A movie picture decoded as a texture is rounded up to powers of two, for example a 640 × 448 picture in a 1024 × 512 texture. With u, v the backdrop shows only the picture.
  • The defaults (1, 1) keep every existing call as it was (JC2, Shinobido, TTA, TMB).

Why

Without it, a port had to draw the whole texture larger than the picture and rely on the window cutting the padding off. Where the window doesn't, the padding shows. Amplitude's widescreen movies keep the 4:3 picture in the middle of a 16:9 frame, and a strip of stale pictures appeared at the right, and below in a 4:3 window's letterbox.

Testing

Amplitude: the logos and the intro in widescreen are centred with nothing at the sides. 4:3 is unchanged.

🤖 Generated with Claude Code

…er-of-two one)

A movie picture decoded as a texture is rounded up to powers of two: a
640 x 448 picture in a 1024 x 512 texture. setBackdrop mapped the whole
texture to its rectangle, so a port had to draw it larger than the
picture and let the window cut the padding off. Where the window does not
(a 4:3 picture kept 4:3 in a widescreen frame, or a letterbox), the
padding showed: Amplitude's widescreen movies had a strip of stale
pictures at the right and below.

Two trailing parameters (u, v) give the part that is the picture; their
defaults (1, 1) keep every port's call as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant