Skip to content

Conversation

@MarcelHB
Copy link
Collaborator

@MarcelHB MarcelHB commented Nov 30, 2025

Description

Inspired from a feature I've been using in the EE frequently (due to general overview or better micro managing), I don't see a reason to not generally introduce this to all games: using the mouse wheel to zoom in and out. Currently two steps in, two steps out:

zoom_out

zoom_in

Things I've tested in particular:

  • Weather
  • Shaking on small rooms (Oswald's vessel)
  • Dialogs
  • Overlays
  • Movement speeds (using the edges and dragging the cursor)
  • SDL v1.2, but it mostly gets swallowed by other issues, see Decomissioning plan for sdl1 #821 (comment)

Performance increases on slow device when zooming in, or slows down when zooming out, so this is some more ad-hoc way to tune this, e. g. in some combats.

Checklist

  • Commit messages are descriptive and explain the rationale for changes
  • I used the same coding style as the surrounding code
  • I have tested the proposed changes
  • I extended the documentation, if necessary
  • The proposed change builds also on our build bots (check after submission)

Visual artifacts remain, though, so it probably hasn't been used
in long time.
Stretching or squeezing into the target by design.
@lynxlynxlynx
Copy link
Member

Cool, LGTM and it works fine with my touchpad too (at least when the wayland scaling doesn't trigger, since it takes over).

Is there a particular reason you store the zoom in each window? For savegame and actions compatibility, we'll need to have a global setting. We already read and write it from the GAM file:
https://github.com/search?q=repo%3Agemrb%2Fgemrb%20zoom&type=code

There was already a working zoom here, but since it's entangled with 4K support and not yet polished, I wouldn't say this was wasted effort:
https://github.com/Goddard/gemrb/tree/pie4k

@MarcelHB
Copy link
Collaborator Author

MarcelHB commented Dec 1, 2025

Is there a particular reason you store the zoom in each window? For savegame and actions compatibility, we'll need to have a global setting. We already read and write it from the GAM file: https://github.com/search?q=repo%3Agemrb%2Fgemrb%20zoom&type=code

Mainly because I was looking for where the draw buffer handling is done. Anyway, gameWin is the only, the global user for this, so that's fine.

I wasn't aware of the GAM file, I'll have a look at it for the EEs.

@MarcelHB
Copy link
Collaborator Author

MarcelHB commented Dec 1, 2025

I now mapped the 27 zoom steps of the original EE.

Anyway, I found something in handling SDL that is visible in some literal edge cases of interior maps. Will look at this tomorrow.

@MarcelHB MarcelHB marked this pull request as draft December 1, 2025 23:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 2, 2025

@MarcelHB MarcelHB marked this pull request as ready for review December 2, 2025 23:20
@MarcelHB
Copy link
Collaborator Author

MarcelHB commented Dec 2, 2025

Testing savegames in the original EE looks broken before this already, but other than this I'm good for now.

@lynxlynxlynx lynxlynxlynx merged commit b67d16c into gemrb:master Dec 4, 2025
7 of 8 checks passed
@lynxlynxlynx
Copy link
Member

Thanks!

@MarcelHB MarcelHB deleted the zooming branch December 4, 2025 22:19
@burner1024
Copy link
Contributor

This is amazing! Thank you!

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.

3 participants