Commit Graph

220 Commits

Author SHA1 Message Date
Kuhnovic 80f672d5b4 Codechange: Remove redundant data members from YAPF ship node. (#14577) 2025-09-03 12:52:15 +02:00
Rubidium 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Kuhnovic 10e81af663 Codechange: Deduplicate YAPF estimate calculation. (#14527) 2025-08-28 21:09:00 +02:00
Peter Nelson 54f328beeb Codechange: Remove output pointer from GetTileArea(). (#14530)
This simplifies things and removes undocumented type `ETileArea`
2025-08-22 21:27:31 +01:00
Peter Nelson f898acae3e Codechange: Remove line break before opening brace of Yapf classes. (#14513) 2025-08-12 21:08:41 +01:00
Kuhnovic 40457fc0dd Change: Separate ships travelling in opposite direction (#14493) 2025-08-08 09:52:01 +02:00
Peter Nelson b042e7a439 Codefix: Prefer static inline const keyword order. (#14301) 2025-05-25 20:32:56 +01:00
Kuhnovic 34c0b09764 Codechange: Removed T prefix from water region related types. (#14290) 2025-05-24 18:12:16 +02:00
frosch 61cec33be2 Codechange: Add 'const' to static variables, which are only initialised once. 2025-05-06 18:29:41 +02:00
frosch 9cf36dac39 Codechange: Use data() instead of c_str(), if no NUL termination is needed. 2025-04-30 19:33:56 +02:00
Rubidium 78250c3bba Codechange: remove const char* overloads when there are std::string_view and std::string& overloads 2025-04-29 10:14:53 +02:00
frosch 1ea1dbd19e Add: [NewGRF] Station/roadstop animation-triggers 'tile loop' (bit 7) and 'path reservation' (bit 8). (#14080) 2025-04-26 14:44:55 +02:00
frosch 880a947eb3 Fix: [NewGRF] Randomisation-trigger 'path reservation' did not work for waypoints. 2025-04-24 09:19:43 +02:00
frosch bc0eaf9ac4 Codechange: Allow passing waypoints to Trigger(Station|RoadStop)Randomisation. 2025-04-24 09:19:43 +02:00
Peter Nelson 6d5aee0545 Codechange: Restructure RoadStop Entries to reduce pointers. (#14069)
A RoadStop must own both west and east `Entry`s, but they are allocated separately.

Combine this allocation into one instead.
2025-04-23 08:29:34 +01:00
frosch 2bee313642 Codechange: Replace FindVehicleOnPos with 'for' loop. 2025-04-22 22:12:59 +02:00
frosch dacd77b2bd Codechange: Use FindVehicleOnPos instead of HasVehicleOnPos, if there is no stop condition. 2025-04-22 22:12:59 +02:00
frosch 61a0a520f6 Codechange: Unify random trigger enums and turn them into enum classes. (#14066) 2025-04-21 20:03:34 +02:00
frosch 461b73e21b Codefix: stdafx.h and safeguards.h should be the first and last include in every source file, and not appear in any header file. 2025-04-20 22:06:18 +02:00
Peter Nelson 2c59838acb Codechange: (re)set multiple bitset flags in one call. (#14017) 2025-04-18 14:07:57 +01:00
Peter Nelson 936d78fefc Codefix: Avoid uppercase characters in variable names. (#13985) 2025-04-10 07:19:27 +01:00
frosch 04246c530f Codechange: Use fmt::format instead of stringstream with iomanip flags. (#13964) 2025-04-08 20:57:50 +00:00
Peter Nelson 47d078c033 Codechange: Use EnumBitSet for RailTypes. 2025-03-25 20:15:48 +00:00
Peter Nelson 89948b941b Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Rubidium 02f1bc0880 Codefix: remove some logically dead code 2025-03-12 22:00:33 +01: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
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Jonathan G Rennison d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Peter Nelson 1ed685b5c1 Codechange: Use EnumBitSet.Any(). (#13512) 2025-02-09 20:16:16 +00:00
Peter Nelson 11bfd5bb9e Codechange: Use EnumBitSet for EndSegmentReasons. (#13490) 2025-02-07 23:53:23 +00:00
Rubidium e937c4dcfd Codechange: change DestinationID into class with conversion helpers
A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
2025-02-06 21:03:24 +01:00
Peter Nelson afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson 4397aa3909 Codechange: Make StationType an enum class. (#13339) 2025-01-19 20:53:08 +00:00
SamuXarick ee860a5c8e Doc: Update some yapf inline comments 2024-12-24 20:43:46 +01:00
Koen Bussemaker 701cb2e9d7 Codechange: Move two way signal EOL to a more logical place 2024-12-06 09:27:32 +01:00
Peter Nelson 3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Peter Nelson c39810ff6a Codechange: Replace path cache queues with vectors.
Ship and RoadVehicle path caches use a std::deque, which is quite memory hungry, especially for RoadVehicle which has two.
std::deque was used to be able to push/pop from either end.

Change to use a single std::vector each, which is now push/popped from the back.
2024-11-18 08:59:41 +00:00
Peter Nelson 04b6dfae48 Cleanup: Remove now-unneeded includes from yapf. (#13088) 2024-11-16 23:23:06 +00:00
Jonathan G Rennison 71ea58c6de Codechange: Remove unused CYapfDestinationTileT (#13086) 2024-11-16 16:12:18 +00:00
Koen Bussemaker 6faf4fa70a Codechange: Simplified YAPF ship region node 2024-11-12 23:17:56 +01:00
Koen Bussemaker 3e195df3c7 Codechange: Cleaned up and renamed NodeList 2024-11-12 21:06:17 +01:00
Jonathan G Rennison 883be19865 Codefix a6f412c6: Missing this-> in YAPF 2024-10-29 19:07:14 +01:00
Koen Bussemaker 0200bc3720 Codechange: Renamed CHashTableT to HashTable and corrected code style 2024-10-29 08:35:47 +01:00
Peter Nelson e50c1774fc Codechange: Remove some unnecessary local variables. 2024-10-25 19:01:39 +01:00
Peter Nelson c39554a210 Codechange: Simplify selection between pathfinder functions. 2024-10-25 19:01:39 +01:00
Peter Nelson 1403a55e5d Codechange: Use uppercase naming for YAPF cost constant. 2024-10-25 19:01:39 +01:00
Peter Nelson a171939ec3 Codechange: Remove m_ prefix from pathfinders. 2024-10-25 19:01:39 +01:00
Peter Nelson a496e9397c Codechange: Prefer member-initialization. 2024-10-25 19:01:39 +01:00
Peter Nelson a6f412c615 Codechange: Add this-> to YAPF. 2024-10-25 19:01:39 +01:00
Peter Nelson 5b73654f94 Codechange: Add includes to YAPF .hpp files. 2024-10-25 19:01:39 +01:00