[Ohrrpgce] SVN: james/7911 Add .autosize_vertical member to MenuState. It defaults to OFF

Ralph Versteegen teeemcee at gmail.com
Thu Apr 7 01:53:30 PDT 2016


Awesome! This is something I was hoping we would do soon. When I have
some time I'll try to get gfx_directx and gfx_fb to support changing
the resolution, and then we could change Custom's default
resolution...

A month ago I also started work on making menus automatically adjust
to the screen size. I didn't finish and thought it too risky anyway,
but the patch is here:
https://bitbucket.org/rbv/ohrrpgce/commits/c6628f9345067f211228ef6ac3e79e10cc2fa952?at=master
I wanted to affect both standardmenu and MenuDef menus, but at the
time was most concerned with the latter. My approach was to calculate
the appropriate .size in init_menu_state, and to set MenuState.spacing
in standardmenu like draw_menu already does, but I realised that won't
support resizing the menu as the window size changes, so I have had to
change the approacht anyway.

It turns out that MenuDef menus cope really badly with changes not
just window size but to basic settings! They use a default .size of 17
and ignore .itemspacing and the border size. Fixing that is the most
interesting part of my patch.

On 7 April 2016 at 07:45,  <subversion at hamsterrepublic.com> wrote:
> james
> 2016-04-06 12:45:05 -0700 (Wed, 06 Apr 2016)
> 241
> Add .autosize_vertical member to MenuState. It defaults to OFF
> but if it is set = ON and .spacing is set correctly, calls to
> usemenu will automatically adjust .size to fit the current vertical
> screen size
>
> (tested on the map selection menu)
> ---
> U   wip/mapsubs.bas
> U   wip/menus.bas
> U   wip/menus.bi
> U   wip/udts.bi
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


More information about the Ohrrpgce mailing list