Commit Graph

331 Commits (2d3fef31131c2d9981265664c1581ca11dc2c2d3)

Author SHA1 Message Date
Peter Nelson 2d3fef3113 Fix: Incorrect padding for smallmap legend 'icon'.
The size of this icon is based off FONT_HEIGHT_SMALL - 1, so it makes sense to use a scaled 1 here.
7 months ago
Peter Nelson a8aba06a07 Fix: Insufficient space for labels on smallmap legend. 7 months ago
Peter Nelson 59a2abd298 Codechange: Use unified NWidgetContainer methods instead of duplicating.
Most NWidgetContainer derivatives implemented Draw() and GetWidgetFromPos()
the same way. Move this these to NWidgetContainer itself to avoid repeating.
7 months ago
Peter Nelson f379b31e28 Add: data parameter in Window::Close method.
This allows passing data when closing a window, e.g. to indicate how it was closed.
8 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Peter Nelson e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
9 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
11 months ago
Richard Wheeler 3b2934c479
Change: Make terraforming point selection sprite visible at >2x zoom out (#11017) 11 months ago
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
1 year ago
Peter Nelson 5199881a8d Codechange: Use correct type for linkgraph company mask. 1 year ago
Rubidium f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Rubidium bcfe0fb076 Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
1 year ago
Peter Nelson 920e588334 Change: Use standard dimensions instead of custom widths. 2 years ago
Peter Nelson 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2 years ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2 years ago
Peter Nelson 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2 years ago
Peter Nelson f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2 years ago
Peter Nelson eb4ba1991b Change: Use CenterBounds function in more places.
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2 years ago
Artin Alavi dd44f2139e
Fix c536bde: Remove problematic inline specifier (#10109) 2 years ago
Artin Alavi c536bde19e Fix #8252: Remove duplicate functionality in `screenshot.cpp` 2 years ago
Tyler Trahan e79724ea22
Feature: Alternative linkgraph colour schemes (#9866) 2 years ago
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 3 years ago
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 3 years ago
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 3 years ago
Peter Nelson 5434d63f91 Fix: Scale smallmap legend 'blob' to fit text. 3 years ago
Patric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
3 years ago
SamuXarick f9dee5aaa0 Feature: Show rainforest under vegetation on small map 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
TELK e04ca904a9 Feature: Minimap screenshot 4 years ago
glx ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 5 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Charles Pigott 69a6c494bf Codechange: Set VehicleType's base type to byte instead of using VehicleTypeByte 5 years ago
glx 48f99fd980 Codechange: use std::array for _sorted_industry_types 5 years ago
glx 0797de06be Codechange: use std::vector for _sorted_cargo_specs 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Andy 423aea5c32 Change: adjust Violet smallmap colour 1 shade darker, to compensate for legibility against darker blue of sea introduced by #7436 5 years ago
SamuXarick ed51fba7ed Change: Dark Blue company and water were indistinguishable in small map. (#7436) 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
PeterN 87ebfe1227
Fix #7004: Mark linkgraph dirty to be rebuilt on next draw call. (#7265)
Previously the linkgraph was rebuilt before the viewport extents were finalized.
5 years ago
Peter Nelson 6733b71300 Change: Make mini-map widget capture mouse when left-click dragging.
This allows the mini-map to be dragged when the cursor has left the widget.
5 years ago
Johannes E. Krause f0290d5de7 Codechange: Add InverseRemapCoords2 function for remapping viewport coordinates to underlying tile coordinates (Patch by adf88, #6583) 5 years ago
Peter Nelson 806e7d25dd Change: Use GUITimer class instead of bare int/uints. 5 years ago
Peter Nelson 2a8fa5fef9 Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks. 5 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Alexander Weiss e1a164b531 Change: [OSX] Setting mouse-wheel to scroll the map does not disable pinch to zoom 6 years ago