Commit Graph

522 Commits

Author SHA1 Message Date
Peter Nelson e88d96e4df Codechange: Use single vector for next station order.
Pass vector to insert into to avoid handling multiple vectors.

This may change the order of returned stations.
2025-12-08 19:56:19 +05:00
Peter Nelson 57e48db628 Codechange: Remove StationIDStack and SmallStack.
Use a std::vector or std::span instead.
2025-12-08 19:54:33 +05:00
Peter Nelson dd64d510b8 Codechange: Cleanup unnecessary includes of spritecache.h (#14678) 2025-12-08 17:34:58 +05:00
Peter Nelson e2e01eabb5 Fix 3ac1a2f1e4: Game crash due to invalid vehicle type information. (#14628)
Use std::variant instead of union for vehicle info.

RailVehicleInfo is now non-POD so using in a union causes undefined behaviour.
2025-12-08 16:39:52 +05:00
dP 8404c2a7cc Merge remote-tracking branch 'upstream/master' 2025-09-28 02:33:49 +05:00
Rubidium 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02: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
Ivan Pravdin 434163aa31 Fix #14277: Aircraft can land when Zeppeliner in the runway (#14317) 2025-07-17 07:26:57 +02:00
dP f0f93c68ca Merge remote-tracking branch 'upstream/master' 2025-06-14 17:01:17 +05:00
dP df3a6e321f Merge remote-tracking branch 'upstream/master' 2025-05-14 18:41:13 +05:00
frosch d7ddea4032 Codechange: Turn AnimationTrigger enums into enum classes. (#14067) 2025-04-21 20:53:31 +02:00
frosch f399b8eb29 Codechange: Unify naming of NewGRF animation callbacks. 2025-04-21 19:06:13 +02:00
frosch b862d4937f Codechange: Turn custom vehicle spritenums into enum, and use them consistently. (#14022) 2025-04-18 15:19:28 +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
Rubidium ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Peter Nelson 8b39b23d2b Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Jonathan G Rennison 61e8dcfca7 Cleanup: Remove unused DepotCommandFlag::LocateHangar flag (#13775) 2025-03-09 18:07:47 +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 3fde611012 Codechange: Use EnumBitSet for AirportMovingDataFlags. (#13754) 2025-03-06 19:03:41 +00:00
Peter Nelson 6e10584b91 Codechange: Use EncodedStrings for News messages. (#13654) 2025-02-23 20:24:02 +00:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidium 380e7b48ce Codechange: use std::variant instead of a custom version for news references 2025-02-16 14:50:15 +01:00
Rubidium c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Peter Nelson f309b90a1d Codechange: Use EnumBitSet for Airport blocks. 2025-02-13 22:02:02 +00:00
Peter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Peter Nelson 0d5708ba86 Codechange: Use EnumBitSet for AirportFTAClass::Flags (#13535) 2025-02-11 21:49:18 +00:00
Rubidium f90fa2a4d1 Codechange: use C++ constructs over MallocT/free 2025-02-07 22:49:03 +01:00
Peter Nelson ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +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 f8b1e3033f Codechange: Use EnumBitSet for EngineFlags. 2025-01-31 18:55:31 +00:00
Peter Nelson f51627c76f Codechange: Use EnumBitSet for DepotCommand(Flag)s. 2025-01-29 21:46:39 +00: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
Rubidium e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Rubidium 08d84b2f4a Codechange: use AdviceType over StringID to remove vehicle advice news 2025-01-08 02:03:55 +01:00
Peter Nelson 810e442203 Codechange: Split GoodsEntry cargo and flows data to unique_ptr. (#13058)
This allows cargo packets and cargo flow data to be empty if not in use, which is the case for the majority of station goods entries, and data is allocated when needed.

This reduces the initial size of a Station from 9192 bytes to 2024 bytes (on 64 bit platforms), although an allocation of 120 bytes is made for each active cargo type at a station.

Based on similar changes in JGRPP.
2025-01-02 20:48:23 +00:00
Rubidium c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
Rubidium fd5f6caed4 Codechange: use explicit TileIndex constructor for tile 0 2025-01-01 08:26:54 +01:00
dP a86fd7c621 Update to 15.0-beta1 2024-12-25 20:34:06 +05:00
Peter Nelson e1697a6ad1 Codechange: Don't use enums for non-enumerated values. (#13031)
In the past we have used enums to hold an arbitrary values. These values
are not enumerated types, so make them constants instead.
2024-10-27 18:02:49 +00:00
Loïc Guilloux d67963e616 Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
dP 854c507086 Merge remote-tracking branch 'upstream/master' 2024-04-14 01:59:39 +07:00
dP 14504ff3b2 Update to 14.0 2024-04-14 01:56:35 +07:00
Peter Nelson 83da886093 Fix: Aircraft crash counter was too low to reach ground. (#12425)
Aircraft can float above the ground when crashed as the counter limit to reach the ground is too low.

Instead reset the counter until the aircraft reaches the ground, then continue the timer.
2024-04-05 19:16:22 +01:00
Peter Nelson d11622b9a0 Fix #12114: Viewport coords of crashed aircraft not updated when falling. (#12424)
This results in the aircraft glitching as the wrong viewport area is drawn.
2024-04-05 08:17:42 +01:00
Patric Stout a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
dP 47bc4b514f Merge remote-tracking branch 'upstream/master' 2024-03-17 01:25:55 +07:00
dP da761f41e2 Update to 14.0-RC2 2024-03-17 01:01:56 +07:00
Rubidium bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Tyler Trahan 32b0fb9f6e Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
SamuXarick ab52f7eecf Fix ccb4c37: Aircraft could route to hangars outside their range when stopping at them 2024-03-08 14:31:35 +01:00