Page 1 of 1

Zooming after game-end

Posted: Tue Apr 04, 2017 5:15 am
by filbo on Linux:

After the game has ended, RnD is still running the game engine; I speed it up to top speed to watch the remaining spaceships & bugs fight it out with the swarming amoeba... and I shrink the window to shove it in a corner that won't overlap my browser & terminal windows.

While adjusting the zoom, I suddenly notice that the window titlebar still says "100%" no matter what level of zoom it's actually at. It doesn't change until I satisfy the "overwrite tape y/n" question.

While playing with that I also noticed: suppose the window is at normal "100%" zoom, but the wrong shape. Choosing "100%" doesn't fix it. To reproduce:

0. Not in full-screen mode,
1. Setup > Graphics > 100%
2. (still in Setup -> Graphics) Drag the right side of the window, stretching it horizontally while not changing vertical size
3. Choose "100%" again -- nothing happens
4. Choose "90%", window snaps back to normal aspect ratio
5. Choose "100%", window is back to normal size & ratio

While playing with that, I noticed:

1. Choose "90%"
2. Double-click on titlebar; mine now shows "129%" (1366x768 craptop screen)
3. Double-click again
4. Titlebar now shows "89%"
5. Repeatable for 70-80-90-110-120%
6. Whatever wrong number it is, shows up in the list of choices on the zoom menu (this is correct)
7. For each size I tried, choosing the right number (e.g. "80%" when "79%" was current) did not change the window borders at all; I couldn't tell if it changed any of the graphics inside the window

Summary of bugs mentioned:

B1. Title bar doesn't reflect zoom changes in some game modes
B2. Choosing "100%" doesn't fix aspect ratio when already at 100% due to smaller dimension
B3. Double-click "maximize window", double-click "restore window", may show 1% less in titlebar

Re: Zooming after game-end

Posted: Mon Apr 10, 2017 7:16 am
by filbo
B4. After performing B1 -- that is, zooming by various means (including dragging window edge or double-clicking titlebar) while in end-of-game state; and noticing that the titlebar's opinion of current zoom level doesn't change -- furthermore, going into Setup > Graphics still shows the previous zoom level (100% in my case); and re-selecting that zoom level doesn't fix the display.

That is:

0. Start at normal (100%) zoom
1. Play a level to completion, saving a tape
2. Play it to completion again
3. Game requests "Replace old tape?"; don't respond
4. Change window shape by dragging edge or double-clicking titlebar; observe titlebar still says "100%" (B1)
5. Now respond to the question; observe titlebar still says "100%"
6. Go to Setup > Graphics; observe that "Window Scaling" (zoom indicator / selector) falsely says "100%" (B4-a)
7. Select 100%; observe that zoom level doesn't change (B4-b)
8. Select some other zoom level; observe that it changes as expected
9. Select 100%; observe that it changes as expected -- now actual & displayed zoom levels are in sync again

Re: Zooming after game-end

Posted: Mon Apr 10, 2017 8:43 am
by Holger
Yes, I can confirm the described behavior.

The problem is the various event loops in R'n'D. Beside the main event loop (that's the one that correctly responds to all size changes), there are a number of "quick and dirty" event loops (which are in fact quick and dirty and do not respond to all events, but just drop some of them), the most prominent (or infamous) being the door request event loop.

The long-term solution would be to unify all those sub-event loops into the main event loop cleanly. This would require a number of problems to be solved which currently prevent this from easily being done.

The short-term solution would be to add clean handling of some more events (like window resizing) to at least the door event loop. Plus, correctly handling screen sizes in the setup menu (which would mean adding a check if the screen size the program thinks it have is the screen size it really has, so changing from "100%" (while in fact having a changed screen size) to "100%" would restore the screen size it really should be.

I'll have a look at this as soon as I have finished my current R'n'D sub-project (integration of the Mirror Magic game engine (just to keep that game alive), which starts reaching a stable state now).

Re: Zooming after game-end

Posted: Mon Apr 10, 2017 10:09 pm
by Holger
Most such cases should now be fixed in the (updated) master branch.

- updating the window size percentage when resizing while door request is open should be fixed now
- getting 89% from previously having 90% after double-clicking title bar twice should be fixed now
- selecting and getting 100% when the window size is not 100% for whatever reason is NOT fixed yet

The last case should now be a little bit harder to reproduce though.

Please have a look at it; I hope it works fine for you, too.

Re: Zooming after game-end

Posted: Wed Apr 12, 2017 4:40 am
by filbo
As you say, B1 B3 are fixed, B2 not fixed, B4 no longer relevant since B1 is fixed.

B2 is just an oddity, not that important. I did appreciate the "fix my aspect ratio" part of choosing 100%; but Ctrl-, Ctrl+ is even quicker...