Rubidium and rubidium42
0670c096f7
Codechange: use existing enum over magic number
...
DiagDirection is the enum that comes closest. A new enum doesn't make sense
for just one function, especially if you get sort-of overlapping behaviour.
It would be X::EastToSouth, X::SouthToWest where either can be chosen in case
of the dragging being in the southern direction.
2026-02-23 17:11:02 +01:00
Rubidium and rubidium42
671b62e073
Codechange: document a few parameter and return types
2026-02-18 17:04:49 +01:00
Rubidium and rubidium42
c6c06e13eb
Codefix: wrong parameter names and partially missing parameters
2026-02-02 16:31:46 +01:00
Cyprian Klimaszewski and rubidium42
d17f662490
Codechange: Allow to set cursor directly.
2026-01-30 00:00:53 +01:00
Cyprian Klimaszewski and rubidium42
97f3e5b70f
Codechange: Make TileType enum an enum class.
2026-01-24 08:34:05 +01:00
Kuhnovic and GitHub
8e35553208
Feature: Configurable sign text colors in scenario editor. ( #14743 )
2025-12-08 17:52:19 +01:00
Cyprian Klimaszewski and GitHub
99f04f27de
Doc: Update information for receiving a copy of GPL. ( #14869 )
2025-12-07 11:25:08 +00:00
mmtunligit and GitHub
3b541d4c74
Codefix: Add comments to SetViewport functions ( #14822 )
2025-11-25 06:04:16 -05:00
mmtunligit and GitHub
07177467b3
Feature: Signs, waypoint and station names may be moved ( #14744 )
2025-11-24 14:56:19 -05:00
Peter Nelson and GitHub
a617d009cc
Codechange: Dereference with x-> instead of (*x). ( #14700 )
2025-10-05 15:47:33 +01:00
Rubidium and rubidium42
7c0f69a8fe
Codefix: typos in comments and strings
2025-08-31 10:30:37 +02:00
85af200788
Add: Identify cities on the main viewport by appending an icon to their names ( #14504 )
...
Co-authored-by: Peter Nelson <peter1138@openttd.org >
2025-08-15 16:49:25 -04:00
Peter Nelson and GitHub
921d83c324
Codechange: Unify structures with sprite sub-tile bounds and simplify bounding boxes. ( #14424 )
...
Lots of different structs contain variations on sub-tile bounds with different naming. Unify into a single struct that can be inherited and passed directly to AddSortableSpriteToDraw.
At the same time, offsets now work more logically: sub-tile bounds now specify the bounding box, and an offset can be applied to the sprite.
2025-07-22 00:02:00 +01:00
Peter Nelson and GitHub
8e2df7809b
Codechange: Add distinct type to hold pixel drawing colour. ( #14457 )
...
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Peter Nelson and GitHub
5bf31a431e
Fix 4c8f1b0f81: Hidden-by-facility station signs were not ignored when handling clicks. ( #14326 )
2025-06-03 20:53:53 +00:00
frosch and frosch
61cec33be2
Codechange: Add 'const' to static variables, which are only initialised once.
2025-05-06 18:29:41 +02:00
frosch and frosch
8571af9833
Codechange: Turn ZoomLevel into enum class.
2025-05-03 23:21:09 +02:00
frosch and frosch
7055ea0aee
Codechange: Define sequential operators for ZoomLevel.
2025-05-03 23:21:09 +02:00
Peter Nelson and GitHub
2c59838acb
Codechange: (re)set multiple bitset flags in one call. ( #14017 )
2025-04-18 14:07:57 +01:00
Peter Nelson and Peter Nelson
c982816c0e
Codechange: Manage window viewport via unique_ptr.
2025-04-09 22:03:23 +01:00
Peter Nelson and Peter Nelson
8275bbfb87
Codechange: Pass Viewport by reference.
...
This means we do not have to care what type of pointer is used.
2025-04-09 22:03:23 +01:00
frosch and GitHub
25005cff16
Codefix: std::string_view::data() is not necessarily null terminated. ( #13891 )
2025-03-25 20:32:19 +01:00
Peter Nelson and GitHub
79ef4e98fe
Codechange: Use std::swap() instead of Swap() ( #13883 )
2025-03-24 23:47:34 +00:00
Rubidium and rubidium42
ec647975ad
Cleanup: remove ancient FIXME comments
2025-03-16 05:42:29 +01:00
Rubidium and rubidium42
c13226cdf8
Codefix: do not leave pointers to stack allocations in globals
2025-03-15 21:46:43 +01:00
Rubidium and rubidium42
ac2087a3eb
Codefix: remove some logically dead code
2025-03-14 16:26:21 +01:00
Peter Nelson and GitHub
274b7a0195
Fix #13645 : "Follow vehicle" button not raised when following stopped. ( #13746 )
2025-03-06 00:00:57 +00:00
Jonathan G Rennison and GitHub
8566030c53
Cleanup: Adjustments to comments to match code changes ( #13636 )
2025-02-22 13:28:35 +00:00
Rubidium and rubidium42
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Peter Nelson and GitHub
20e57a02a2
Codechange: Use GetString() with argument parameters in simple cases. ( #13551 )
...
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Rubidium and rubidium42
c3d5e6d2a0
Codechange: Use EnumBitSet for DoCommandFlags
2025-02-14 00:28:57 +01:00
Peter Nelson and Peter Nelson
75387b9e2b
Codechange: Use EnumBitSet for StationFacility.
2025-02-13 18:03:13 +00:00
Jonathan G Rennison and rubidium42
d06b371254
Cleanup: Fix various spelling errors
2025-02-12 22:44:51 +01:00
Peter Nelson and Peter Nelson
2cb9f55183
Codechange: Store EncodedString for tooltip text.
...
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
Rubidium and rubidium42
ec492cb267
Codechange: make CompanyMask a BaseBitSet implementation
2025-02-09 19:24:51 +01:00
Rubidium and rubidium42
42d6a12874
Codechange: replace union with std::variant for ViewportSignKdtreeItem::id
2025-02-09 18:05:01 +01:00
Peter Nelson and GitHub
8c48f9fc49
Codechange: Pass preformatted string when updating sign positions. ( #13480 )
...
This forces the strings to be formatted in advance and avoids using global string parameters.
2025-02-07 13:19:00 +00:00
Peter Nelson and Peter Nelson
56b1e9df1f
Codechange: Use EnumBitSet for FrameFlags.
2025-01-30 08:40:42 +00:00
Peter Nelson and Peter Nelson
4b573b2703
Codechange: Use EnumBitSet for ViewportStringFlags.
2025-01-29 21:46:39 +00:00
Peter Nelson and GitHub
afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. ( #13383 )
2025-01-28 22:17:34 +00:00
Peter Nelson and GitHub
b70438b76a
Fix #13392 : Signs of removed stations are no longer visible. ( #13395 )
...
Add "Ghost" option for station sign visibility.
2025-01-28 19:10:32 +00:00
Peter Nelson and GitHub
4c8f1b0f81
Add: Ability to toggle visibility of station signs by facility. ( #13207 )
2025-01-14 21:23:35 +00:00
Peter Nelson and GitHub
810dc23215
Codechange: Replace viewport StringID specialisation with flags. ( #13237 )
...
When drawing viewport strings, the StringID is used to determine how to draw the sign. Instead, allow the behaviour to be set by the caller with flags. This means that some of the viewport-specific strings are no longer necessary.
ViewportAddString() now returns a pointer to a string as it may not actually add the string, in which case preparing the string parameters in advance is a waste of time.
2025-01-02 20:47:12 +00:00
Peter Nelson and GitHub
fc8685d618
Codechange: Use functor for Kdtree's XYFunc. ( #13074 )
...
Kdtree uses a function pointer and incorrectly calls it a functor. The function pointer needs to be passed on instantiaton.
Instead, use an actual functor. This simplifies instantiation.
2024-11-19 20:29:56 +00:00
Peter Nelson and GitHub
1191efa581
Fix #12914 : Fix use of invalidated pointer in viewport drawer. ( #12918 )
...
Use index of last child instead of pointer to update next_child element.
In case there is no child sprite yet, the most recent parent sprite's first_child is updated instead.
2024-10-26 15:24:41 +01:00
Rubidium and rubidium42
826deaee57
Codechange: refactor CalcHeightdiff to remove some magic numbers
2024-04-28 16:05:21 +02:00
Peter Nelson and Peter Nelson
40fa45a76a
Codechange: Emplace std::pair into vectors.
...
This creates the pair in the vector, instead of creating it then copying it in.
2024-04-20 10:25:20 +01:00
Rubidium and rubidium42
4f2412a272
Codechange: range based for loops instead of C-style for loops
2024-04-11 07:05:04 +02:00
Peter Nelson and GitHub
b905209421
Fix: Viewport signs assume small font is smaller than normal font. ( #12422 )
...
If the small font is set to a larger size than the normal font for some reason, viewport signs would be drawn incorrect as the area marked dirty only considered the normal size font.
2024-04-06 19:29:41 +01:00
Peter Nelson and Peter Nelson
7572cfd103
Codechange: Redefine ZOOM_LVL so that ZOOM_LVL_NORMAL is 1x zoom.
...
This matches expectations of what normal zoom means.
2024-04-04 22:27:03 +01:00