[Commits] [wesnoth/wesnoth] b49908: Fixed some issues with the resolution list (fixes ...

GitHub noreply at github.com
Sun Jul 23 20:39:00 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b4990801ef3a45c1d0c9d9a3037c4f1bfe191527
      https://github.com/wesnoth/wesnoth/commit/b4990801ef3a45c1d0c9d9a3037c4f1bfe191527
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2017-07-23 (Sun, 23 Jul 2017)

  Changed paths:
    M src/display.hpp
    M src/sdl/window.cpp
    M src/sdl/window.hpp
    M src/video.cpp

  Log Message:
  -----------
  Fixed some issues with the resolution list (fixes #1772)

Awhile back I added some code to remove any resolutions from the list that exceeded the current DPI.
I seem to have misunderstood some of the functionality.

First, off, GetCurrentDisplayMode doesn't seem to return current resolution. From my tests, it seems
to return a "maximum maximized size" of some sort equal to GetUsableDisplayBounds - 1 (see below):

* Render output size: 800, 600
* Display mode size: 1536, 864
* Window size: 800, 600
* Display Bounds: x: 0, y: 0, w: 1537, h: 865
* Usable display bounds: x: 0, y: 0, w: 1537, h: 865

The actual
window size, which @celticminstrel informs me is what we should be measuring here, is actually returned
by either GetWindowSize or GetRenderOutputSize. According to SDL, the latter should return pixel size
and the former screen coordinates. In my tests, though, the results are the same. This might be different
on macOS or iOS. Either way, I've changed current_resolution(), getx(), and gety() to use the results of
GetWindowSize().

Additionally, it seems I don't need to multiply any display modes by the DPI scale factor if I check the
sizes against the aforementioned "max maximized area" w/h. For that I use GetDisplayBounds however...
though again, I'm not sure that's the best way to do this. It does seem to work correctly to fix the
aforementioned bug, anyway. I'll need to figure out more about the handling of DPI on Windows vs macOS
or iOS. There's an implication that the measurements some of these functions return is different.


  Commit: 7df0da5659593dc57a459aa10d7a3c76db1067cf
      https://github.com/wesnoth/wesnoth/commit/7df0da5659593dc57a459aa10d7a3c76db1067cf
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2017-07-23 (Sun, 23 Jul 2017)

  Changed paths:
    M data/themes/widescreen.cfg

  Log Message:
  -----------
  Fix missing images in the widescreen theme.

The theme still has numerous other issues, such as misplaced elements.


  Commit: 40319fe849a7c32e6224b795c83abe2bf3416a19
      https://github.com/wesnoth/wesnoth/commit/40319fe849a7c32e6224b795c83abe2bf3416a19
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2017-07-23 (Sun, 23 Jul 2017)

  Changed paths:
    M src/units/unit.cpp

  Log Message:
  -----------
  Fix not showing selected unit profile image in widescreen theme


  Commit: e85b429b0b08e1fc6e161a290d8ca1aa0d89f3ee
      https://github.com/wesnoth/wesnoth/commit/e85b429b0b08e1fc6e161a290d8ca1aa0d89f3ee
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2017-07-23 (Sun, 23 Jul 2017)

  Changed paths:
    M data/themes/widescreen.cfg

  Log Message:
  -----------
  Update font sizes of widescreen theme to match default theme


Compare: https://github.com/wesnoth/wesnoth/compare/82829b00115f...e85b429b0b08


More information about the Commits mailing list