Commit Graph

365 Commits

Author SHA1 Message Date
Peter Nelson 5c2a37d03e Codechange: use enum class for ClearGround 2026-02-02 18:49:20 +00:00
Richard Wheeler 17cab9b29d Change: Protect rivers from removal when terraforming 2026-02-02 18:22:44 +00:00
Rubidium c6c06e13eb Codefix: wrong parameter names and partially missing parameters 2026-02-02 16:31:46 +01:00
Richard Wheeler 7092162a97 Change: Removing river tiles reduce local authority rating 2026-01-29 07:44:27 +00:00
Rubidium 4adf494ebc Codechange: enum-class-ify Commands 2026-01-28 23:32:51 +01:00
Cyprian Klimaszewski 97f3e5b70f Codechange: Make TileType enum an enum class. 2026-01-24 08:34:05 +01:00
Cyprian Klimaszewski 322ce224b4 Codechange: Make Price an enum class. 2026-01-14 22:07:02 +01:00
Rubidium 2fcd4e189a Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...' 2026-01-03 16:04:32 +01:00
Cyprian Klimaszewski 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter Nelson 98275ee5d3 Codechange: Use enum class for water-related enums. (#14804) 2025-11-19 20:35:11 +00:00
Peter Nelson 2851c70a59 Codechange: Use enum class for RailGroundType. 2025-11-17 20:46:05 +00:00
Rito12 70bf84175f Add: Show height difference in bridge is too low error message. (#14614) 2025-10-24 16:27:11 -04:00
Tyler Trahan 0b99a0b66a Feature: Draw infinite water when all borders are water (#13289) 2025-09-26 14:37:27 +00:00
Peter Nelson e10200efa4 Change: Allow bridges over locks. (#14595)
The bridge must be at least 2 levels higher than the lock.
2025-09-10 18:41:56 +01:00
Peter Nelson f30f808b50 Codechange: Implement tile proc handler to test for building bridge over tile. 2025-08-20 21:40:41 +01:00
Peter 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 Nelson 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 1cbc4da054 Codechange: Use Directions for water flooding data. 2025-05-07 17:31:29 +01:00
frosch 2bee313642 Codechange: Replace FindVehicleOnPos with 'for' loop. 2025-04-22 22:12:59 +02:00
Peter Nelson 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
frosch b956af631e Codechange: Replace CircularTileSearch with SpiralTileSequence. 2025-04-20 12:50:45 +02:00
frosch cde350dc01 Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette. 2025-04-18 23:41:37 +02:00
Björn Wärmedal d009bfc47b Codechange: Add vehicle owner to crash event (#13878)
Co-authored-by: Björn Wärmedal <bjorn.warmedal@lumera.com>
2025-03-25 22:53:44 +01:00
Peter Nelson 17f7d0950e Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
Peter Nelson 91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter Nelson 96f260e718 Codechange: Pass TileDesc by reference. 2025-02-23 23:00:51 +00:00
Peter Nelson 6e10584b91 Codechange: Use EncodedStrings for News messages. (#13654) 2025-02-23 20:24:02 +00:00
Rubidium 0449dc48c8 Codechange: explicitly initialise Depot member variables 2025-02-18 07:21:04 +01:00
Rubidium 44506ebc86 Codechange: use span size over terminator object 2025-02-16 11:19:12 +01:00
Rubidium 069ff846e4 Codechange: use std::vector/std::span for DrawTileSprites over malloc-ed table 2025-02-14 16:01:45 +01:00
Rubidium c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Peter Nelson ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +00:00
SamuXarick 610026ef17 Fix: Missing water region invalidation after flooding a half tile with rail in the highest corner
Invalidate water region when any flood occurs.
Convert a few magic numbers to their names.
2025-01-17 18:13:51 +01:00
Peter Nelson 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
SamuXarick 10e2d1ca36 Codechange: Use Map::Iterate() to iterate tiles 2024-12-06 10:33:11 +10:00
Peter Nelson 465df3bab1 Change: Don't try to flood buoys or dock tiles.
This reduces the active flooding water tiles a little more.
2024-11-06 19:44:14 +00:00
Peter Nelson 8f9836793f Change: Store water tile flooding state in the map.
This allows water tiles which cannot flood any further to not even try to flood.

On a large map with lots of water tiles this can noticeably reduce game loop processing time.

Mostly ported from JGRPP.
2024-11-06 19:44:14 +00:00
Peter Nelson f0f62961e1 Codechange: Make two water functions static. (#13057) 2024-11-03 23:25:51 +00:00
SamuXarick d5a13fb9f4 Codechange: Use TileOffsByAxis(...) in more places (#13026) 2024-10-24 15:58:15 -04:00
Peter Nelson 3eb7901ad9 Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015)
This removes some manual casting.
2024-10-21 17:54:54 +01:00
Rubidium 3b0fcf442f Codefix: use actual type instead of int for TileIndexDiff 2024-10-20 15:49:32 +02:00
Rubidium 4a359a4aed Fix 8ca417b: drying of (edge) tiles should consider MP_VOID tiles 2024-10-19 23:32:34 +02:00
Rubidium 8ca417baa9 Codefix: do not wrap-around the map when flooding tiles 2024-10-19 09:00:21 +02:00
Loïc Guilloux d67963e616 Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
Patric Stout a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidium 27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2024-03-10 15:50:24 +01:00
Rubidium bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Michael Lutz 8dda387f82 Codechange: Use std::tuple for slope functions with two return values 2024-03-08 18:08:55 +01:00
Loïc Guilloux b68d263d5f Fix #12014: Remove water when area clearing ship depot (#12030) 2024-02-09 18:17:08 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00