ddnet/src/game/client/components
bors[bot] 502711541e
Merge #3804
3804: HiDPI-aware Resolution List r=def- a=TsFreddie

This is a version of https://github.com/teeworlds/teeworlds/pull/2827

Which gives you a resolution list that allows you to select appropriate window size (which is saved in config and used to initialize videos), while showing the canvas size (which is the drawing resolution), at least on MacOS.

This also fixes incorrect clips that happens without HiDPI enabled, because `Graphics()->ScreenWidth()` (in canvas size) was reported incorrectly before, which is now fixed.

Also, I noticed that `m_DesktopScreenWidth` and `m_DesktopScreenHeight` (in window size in MacOS) is used incorrectly or differently from what it was used during initialization:

* During initialization, DesktopScreenWidth is the "screen width of your desktop", but it was used as the "game window size on your desktop" when checking whether to resize window. I added a separate window size calculation to use during resize.

Also, god, I hope SDL's different sizes and stuff is reported consistently at least in Wayland or X, so please test. I know in Windows they are always in pixel/canvas size so it might not be a huge issue there.

## Checklist

- [x] Tested the change ~~ingame~~ on MacOS
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options (again, on MacOS, with both HiDPI and non-HiDPI settings)
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Freddie Wang <tsfreddiewang@gmail.com>
2021-05-22 09:56:09 +00:00
..
background.cpp Fix virtual call in Constructor 2020-10-10 12:16:27 +02:00
background.h Rename CURRENT to CURRENT_MAP 2020-10-02 16:21:18 +02:00
binds.cpp Fix composed binds. Close #3771 2021-04-17 17:37:39 +02:00
binds.h Port CConfig API from the upstream (0.7.5) 2021-01-10 17:10:19 +03:00
broadcast.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
broadcast.h Broadcast: Fix display time during demo replay 2019-04-02 23:28:13 +02:00
camera.cpp Add set_view camera position command 2021-01-23 17:36:35 +01:00
camera.h Add set_view camera position command 2021-01-23 17:36:35 +01:00
chat.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
chat.h More colors from chat in console 2021-03-08 01:20:28 +01:00
console.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
console.h More colors from chat in console 2021-03-08 01:20:28 +01:00
controls.cpp Add dummy_reset and remove +resetdummy 2021-03-17 18:09:39 +03:00
controls.h Add dummy_reset and remove +resetdummy 2021-03-17 18:09:39 +03:00
countryflags.cpp Fix leak, initialize UI Element Rect 2020-11-25 13:11:34 +01:00
countryflags.h Use std::sort instead of bubble_sort 2020-10-08 08:00:01 +02:00
damageind.cpp Add angle<->direction conversion functions to vector math (Cleanup) 2021-01-16 03:20:57 +03:00
damageind.h Run clang-format 2020-09-26 21:50:15 +02:00
debughud.cpp Don't crash with debug mode in demo 2020-11-12 22:56:50 +01:00
debughud.h hint for disabling debug mode 2020-11-03 15:06:31 +08:00
effects.cpp Modulize skins, particles, emoticons and game 2020-10-09 09:07:19 +02:00
effects.h Run clang-format 2020-09-26 21:50:15 +02:00
emoticon.cpp Add angle<->direction conversion functions to vector math (Cleanup) 2021-01-16 03:20:57 +03:00
emoticon.h fixed eyewheel (originally from Chairn) 2015-11-15 00:31:24 +01:00
flow.cpp Fix all Multiplication type alerts by CodeQL 2020-10-05 19:03:54 +02:00
flow.h Run clang-format 2020-09-26 21:50:15 +02:00
ghost.cpp Add skin metrics 2020-11-08 10:28:47 +01:00
ghost.h Enable clang-tidy performance-* checks 2020-11-05 11:34:20 +01:00
hud.cpp Center more tees 2021-04-09 20:11:53 +02:00
hud.h Use NUM_DUMMIES for dummy array length 2020-10-18 23:15:25 +02:00
items.cpp always use inferred tuning instead of current one 2021-04-23 13:53:54 +08:00
items.h Replace projectile hack with a new extended snapshot object 2021-01-26 20:58:42 +01:00
killmessages.cpp Center more tees 2021-04-09 20:11:53 +02:00
killmessages.h Recreate kill messages if required 2020-12-13 01:08:34 +01:00
mapimages.cpp Add F-DDrace entities 2020-12-22 12:23:21 +01:00
mapimages.h Add F-DDrace entities 2020-12-22 12:23:21 +01:00
maplayers.cpp Don't render fully transparent quads 2020-12-29 14:59:17 +01:00
maplayers.h Make animations more consistent with high float values 2020-10-05 02:32:50 +02:00
mapsounds.cpp Make animations more consistent with high float values 2020-10-05 02:32:50 +02:00
mapsounds.h Run clang-format 2020-09-26 21:50:15 +02:00
menu_background.cpp Add New Year season theme by mind and use for 2 days 2020-12-28 17:45:04 +01:00
menu_background.h Make menu background camera impl more robust 2020-10-13 15:37:34 +02:00
menus.cpp Implement HSL sliders 2021-05-03 22:54:29 +02:00
menus.h Implement HSL sliders 2021-05-03 22:54:29 +02:00
menus_browser.cpp Fix out of list clip clickable/hoverable items 2021-04-01 16:48:38 +02:00
menus_demo.cpp Remove stack pointer for pID in UIs 2021-05-17 10:02:21 +02:00
menus_ingame.cpp Fix serverbrowser crash 2021-04-20 22:13:59 +02:00
menus_settings.cpp Merge #3804 2021-05-22 09:56:09 +00:00
menus_settings_assets.cpp Remove stack pointer for pID in UIs 2021-05-17 10:02:21 +02:00
menus_start.cpp Support localizing discord link 2021-03-05 17:29:18 +01:00
motd.cpp More colors from chat in console 2021-03-08 01:20:28 +01:00
motd.h Run clang-format 2020-09-26 21:50:15 +02:00
nameplates.cpp Differentiate hook symbol 2021-01-12 10:22:39 +01:00
nameplates.h Run clang-format 2020-09-26 21:50:15 +02:00
particles.cpp Respect possible particle size increase, of worst case rotation 2020-12-29 15:58:05 +01:00
particles.h Only render visible particles 2020-12-23 14:55:49 +01:00
players.cpp Add hookcollision color changeable 2021-05-11 14:34:53 +02:00
players.h Run clang-format 2020-09-26 21:50:15 +02:00
race_demo.cpp Fix variable names manually 2020-11-02 22:40:40 +01:00
race_demo.h Clean up ghost and race recorder 2017-10-06 22:01:33 +02:00
scoreboard.cpp Center tees in more places 2021-03-12 21:23:29 +01:00
scoreboard.h Scoreboard same line height and font size for each team (fixes #3216, supersedes #3219) 2020-11-05 12:15:27 +01:00
skins.cpp Differenciate between width and height for body part 2021-05-19 12:10:58 +02:00
skins.h Move PNG loading in SkinDL to fetch thread (fixes #3398) 2020-12-13 00:08:46 +01:00
sounds.cpp Add GUI & Game sound volume sliders 2020-10-11 10:16:38 +02:00
sounds.h Add GUI & Game sound volume sliders 2020-10-11 10:16:38 +02:00
spectator.cpp Center tees in more places 2021-03-12 21:23:29 +01:00
spectator.h Don't change SpectatorID when not spectating, simplify code 2020-09-28 19:55:47 +01:00
statboard.cpp Make statboard work with up to 32 players 2021-02-26 12:46:32 +01:00
statboard.h Run clang-format 2020-09-26 21:50:15 +02:00
voting.cpp Play highlight sound on vote too when authed 2020-12-18 18:38:12 +01:00
voting.h Run clang-format 2020-09-26 21:50:15 +02:00