Commit Graph
430 Commits
Author SHA1 Message Date
Peter NelsonandPeter Nelson 5cef1ca68a Codechange: rename and make RoadSpriteType a scoped enum
RoadTypeSpriteGroup is now renamed to RoadSpriteType
2026-04-16 21:01:17 +01:00
Tyler Trahan 2b530751dd Feature: Trains with an engine on the rear drive backwards when reversing 2026-04-13 21:52:22 -04:00
Peter NelsonandGitHub a5a60c8615 Codechange: make RoadTramType a scoped enum, and use EnumBitSet (#15477) 2026-04-13 18:15:41 +01:00
Peter NelsonandGitHub 4db1672611 Codechange: make TropicZone a scoped enum (#15442) 2026-04-07 08:33:16 +01:00
Peter NelsonandGitHub a9d7397a77 Codechange: Pass rail and roadtypes separately for tunnel and bridge commands. (#15438)
Avoids passing and casting each via an unrelated type, at the expense of an extra command parameter.
2026-04-06 14:45:22 +01:00
Rubidiumandrubidium42 b387f55ff7 Codechange: use designated initialisers for _tile_type_tunnelbridge_procs 2026-02-18 17:03:33 +01:00
Rubidiumandrubidium42 c6c06e13eb Codefix: wrong parameter names and partially missing parameters 2026-02-02 16:31:46 +01:00
Rubidiumandrubidium42 4adf494ebc Codechange: enum-class-ify Commands 2026-01-28 23:32:51 +01:00
Loïc GuillouxandGitHub ab68e3616d Fix #15153, beb213f9: Wrong tile used to get bridge reservation overlay (#15154) 2026-01-23 16:36:37 +01:00
Cyprian Klimaszewskiandrubidium42 322ce224b4 Codechange: Make Price an enum class. 2026-01-14 22:07:02 +01:00
Cyprian KlimaszewskiandGitHub fadeeb6da1 Fix 0b99a0b: Incorrect error message for aqueducts reaching northern map borders (#14974) 2026-01-08 22:14:58 +00:00
Peter NelsonandGitHub fb15730fc7 Fix 8a8ebabb9d: Don't draw bridge deck rail sprites for default bridges. (#14985)
Bridge deck sprites for default rail/road types should only be drawn for custom bridges.
2025-12-26 15:33:09 +00:00
Rito12andrubidium42 859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 98275ee5d3 Codechange: Use enum class for water-related enums. (#14804) 2025-11-19 20:35:11 +00:00
Peter NelsonandPeter Nelson 30955da3ce Codechange: Use enum class for Roadside. 2025-11-17 20:46:05 +00:00
Peter NelsonandGitHub bf3a07c5d2 Codechange: Silence uninitialized variable warning from GCC. (#14715)
`is_custom_layout` is not used uninitialized but GCC does not know that and produces a warning.
2025-10-19 11:45:13 +01:00
Peter NelsonandGitHub 8a8ebabb9d Change: Provide road and rail overlay sprites for bridge decks. (#14557)
This allows bridges designed primarily with NewGRF railtypes and roadtypes to be at least somewhat compatible with built-in rail and road.
2025-09-29 22:08:16 +01:00
Peter NelsonandGitHub 484ed1008a Codechange: Make TownRatingCheckType an enum class. (#14652) 2025-09-23 22:00:34 +01:00
Peter NelsonandGitHub a23970af32 Fix f30f808b50: Bridge over bridge head could be built one level too low. (#14564) 2025-08-31 19:15:49 +01:00
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
9a294ab2ed Feature: Allow stations and roadstops under bridges.
Bridges above stations will have pillars excluded if they conflict with the station layout.

Partly based on the system implemented in JGRPP.

Co-authored-by: <su@angel-island.zone>
2025-08-20 21:40:41 +01:00
Peter NelsonandPeter Nelson f30f808b50 Codechange: Implement tile proc handler to test for building bridge over tile. 2025-08-20 21:40:41 +01:00
Peter NelsonandPeter Nelson 0a1c0b8b48 Change: Hide bridge pillars if obstructed by tile below.
Tiles can now control if pillars are drawn on a bridge above it. There is no visible change with default bridges.
2025-08-15 23:20:18 +01:00
Peter NelsonandPeter Nelson 10eeba86a6 Codechange: Simplify/breakout logic for selecting bridge table sprites.
Move various base offsets to separate functions where they can be reused and documented.

No longer rely on coincidences to select the correct data between bridges and aqueducts.
2025-07-23 20:31:15 +01:00
Peter NelsonandPeter Nelson d99dad9e9e Codechange: Pass bridge pillar palette/sprite by reference. 2025-07-23 20:31:15 +01:00
Peter NelsonandGitHub 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 NelsonandGitHub b21c8a3450 Codechange: Simplify test for bridges above bridge ramps. (#14421) 2025-07-08 13:55:36 +01:00
Peter NelsonandGitHub 2c4897c2cd Codechange: Use EnumBitSet for HouseZones. (#14137) 2025-04-28 20:27:43 +01:00
Peter NelsonandGitHub fc45bb5a2b Codechange: Replace bitstuffed VehicleEnterTileStatus. (#14027)
VehicleEnterTileStatus was an bitset-style enum, but bitstuffed with a StationID. However the StationID part was only used by trains, and only in two locations.

Instead, return just the enum bitset. The two places which require the StationID just call GetStationIndex() directly.
2025-04-20 21:10:02 +01:00
Loïc GuillouxandGitHub 49ce7fe169 Fix 8846f347f2: Check bridge/tunnel transport type before querying road type (#13969) 2025-04-06 15:01:23 +02:00
Peter NelsonandGitHub 68fd949a52 Fix 44984f8410: Changing ownership of a tunnel/bridge did not check for road transport type. (#13963)
Changing ownership changed ownership of road components without checking if the tunnel/bridge is actually a road tunnel/bridge.
2025-04-04 17:11:19 +00:00
Peter NelsonandGitHub 79ef4e98fe Codechange: Use std::swap() instead of Swap() (#13883) 2025-03-24 23:47:34 +00:00
Peter NelsonandGitHub 89948b941b Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Peter NelsonandGitHub 17f7d0950e Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
Peter NelsonandGitHub 91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter NelsonandPeter Nelson 96f260e718 Codechange: Pass TileDesc by reference. 2025-02-23 23:00:51 +00:00
Rubidiumandrubidium42 b64e8c0aea Codechange: use std::vector/std::span over MallocT for NewGRF bridge sprites 2025-02-22 15:34:32 +01:00
Peter NelsonandGitHub 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Rubidiumandrubidium42 c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Peter NelsonandGitHub e114ed357d Codechange: Use EnumBitSet for ObjectFlags. (#13441) 2025-02-02 21:15:03 +00:00
Peter NelsonandGitHub 59354576d4 Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436) 2025-02-01 23:09:18 +00:00
Rubidiumandrubidium42 c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
Rubidiumandrubidium42 54d58a08f3 Codechange: use (better) named constants for the bridge sprite table 2024-12-22 13:59:18 +01:00
Peter NelsonandGitHub 1e77fd0b61 Codechange: Remove unnecessary 'return_cmd_error` macro. (#13160)
This macro is a leftover from when errors used to be packed into a single int32_t.

`return CommandCost` is clearer, and doesn't need a macro.
2024-12-08 18:02:30 +00:00
Thomas WinwoodandGitHub b1bba967a1 Add: Improving town-owned bridges increases company rating (#13036) 2024-11-07 08:14:04 -05:00
SamuXarickandGitHub d5a13fb9f4 Codechange: Use TileOffsByAxis(...) in more places (#13026) 2024-10-24 15:58:15 -04:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Michael Lutz 8b9f59d320 Codechange: Use references for non-optional in/out values of slope functions 2024-03-08 18:08:55 +01:00
Michael Lutz 8dda387f82 Codechange: Use std::tuple for slope functions with two return values 2024-03-08 18:08:55 +01:00