Commit Graph
486 Commits
Author SHA1 Message Date
Peter NelsonandPeter Nelson d6eff806f0 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-10-23 21:02:27 +01:00
Peter NelsonandPeter Nelson fd32d1447e Codechange: Remove StationIDStack and SmallStack.
Use a std::vector or std::span instead.
2025-10-23 21:02:27 +01:00
Peter NelsonandGitHub 5ed8f1203b Codechange: Cleanup unnecessary includes of spritecache.h (#14678) 2025-09-28 17:09:57 +00:00
Peter NelsonandGitHub 42c9f84d74 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-09-24 22:44:41 +01:00
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02: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
Ivan PravdinandGitHub 434163aa31 Fix #14277: Aircraft can land when Zeppeliner in the runway (#14317) 2025-07-17 07:26:57 +02:00
froschandGitHub d7ddea4032 Codechange: Turn AnimationTrigger enums into enum classes. (#14067) 2025-04-21 20:53:31 +02:00
froschandfrosch f399b8eb29 Codechange: Unify naming of NewGRF animation callbacks. 2025-04-21 19:06:13 +02:00
froschandGitHub b862d4937f Codechange: Turn custom vehicle spritenums into enum, and use them consistently. (#14022) 2025-04-18 15:19:28 +02:00
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
Rubidiumandrubidium42 ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Peter NelsonandGitHub 8b39b23d2b Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Jonathan G RennisonandGitHub 61e8dcfca7 Cleanup: Remove unused DepotCommandFlag::LocateHangar flag (#13775) 2025-03-09 18:07:47 +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 NelsonandGitHub 3fde611012 Codechange: Use EnumBitSet for AirportMovingDataFlags. (#13754) 2025-03-06 19:03:41 +00:00
Peter NelsonandGitHub 6e10584b91 Codechange: Use EncodedStrings for News messages. (#13654) 2025-02-23 20:24:02 +00:00
Rubidiumandrubidium42 fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidiumandrubidium42 380e7b48ce Codechange: use std::variant instead of a custom version for news references 2025-02-16 14:50:15 +01:00
Rubidiumandrubidium42 c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Peter NelsonandPeter Nelson f309b90a1d Codechange: Use EnumBitSet for Airport blocks. 2025-02-13 22:02:02 +00:00
Peter NelsonandPeter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Peter NelsonandGitHub 0d5708ba86 Codechange: Use EnumBitSet for AirportFTAClass::Flags (#13535) 2025-02-11 21:49:18 +00:00
Rubidiumandrubidium42 f90fa2a4d1 Codechange: use C++ constructs over MallocT/free 2025-02-07 22:49:03 +01:00
Peter NelsonandPeter Nelson ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +00:00
Rubidiumandrubidium42 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 NelsonandPeter Nelson f8b1e3033f Codechange: Use EnumBitSet for EngineFlags. 2025-01-31 18:55:31 +00:00
Peter NelsonandPeter Nelson f51627c76f Codechange: Use EnumBitSet for DepotCommand(Flag)s. 2025-01-29 21:46:39 +00:00
Peter NelsonandGitHub afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Rubidiumandrubidium42 e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Rubidiumandrubidium42 08d84b2f4a Codechange: use AdviceType over StringID to remove vehicle advice news 2025-01-08 02:03:55 +01:00
Peter NelsonandGitHub 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
Rubidiumandrubidium42 c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
Rubidiumandrubidium42 fd5f6caed4 Codechange: use explicit TileIndex constructor for tile 0 2025-01-01 08:26:54 +01:00
Peter NelsonandGitHub 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 GuillouxandGitHub d67963e616 Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
Peter NelsonandGitHub 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 NelsonandGitHub 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 StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidiumandrubidium42 bab5a8a787 Codechange: use std::source_location over __FILE__ and __LINE__ for Backup 2024-03-10 10:14:20 +01:00
Tyler TrahanandGitHub 32b0fb9f6e Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
SamuXarickandPatric Stout ab52f7eecf Fix ccb4c37: Aircraft could route to hangars outside their range when stopping at them 2024-03-08 14:31:35 +01:00
Peter NelsonandGitHub 2fd9096070 Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
2024-02-04 10:16:08 +00:00
Tyler TrahanandGitHub f6dd5053a3 Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
Tyler TrahanandGitHub 735abfe111 Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Peter NelsonandPeter Nelson 9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 2023-10-19 17:03:25 +01:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 2023-09-10 08:40:25 -04:00
Tyler TrahanandGitHub 8ea01c0bfb Fix #11180: Use TileVirtXY for aircraft crash tile (#11184) 2023-08-11 14:05:16 +00:00