1
0
Fork 0
Commit Graph

254 Commits (91d22f761720d7699c940650b1bd4b4366af7806)

Author SHA1 Message Date
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 27761ae431 Cleanup: Remove global string parameters.
Global parameters, and functions for dealing with them, are now gone.
2025-03-04 08:48:35 +00:00
Rubidium 11a8b71504 Codechange: explicitly initialise Vehicle related member variables 2025-02-18 22:11:04 +01:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidium af00b835a1 Codechange: remove transitional supports from the pool 2025-02-16 19:31:37 +01:00
Rubidium 59df0ff496 Codechange: strongly type StationID 2025-02-16 18:25:51 +01:00
Rubidium 70c9f3963c Codechange: strongly type VehicleID 2025-02-16 14:50:15 +01:00
Rubidium 2cb59b1856 Codechange: make VehicleID an enum 2025-02-16 14:50:15 +01:00
Rubidium bdd14063a0 Codechange: move vehicle name to LoadgameState and change to std::vector 2025-02-16 13:45:07 +01:00
Rubidium e7595c6c85 Codechange: pass oldloader LoadgameState by reference instead of pointer 2025-02-16 12:31:14 +01:00
Rubidium c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Rubidium 30127dfe90 Codechange: prepare the pool for strongly typed pool element IDs 2025-02-09 15:07:29 +01:00
Rubidium 04d53ed6f5 Codechange: remove operator!=s that are synthesized 2025-02-08 06:37:36 +01: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 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
Jonathan G Rennison f19829d029 Fix #12831: Delay vehicle cache init to after map upgrades in load
Split AfterLoadVehicles into two functions.
Vehicle cache init and other functionality requiring an upgraded and
valid map is now performed later in the load process.
2024-10-25 17:05:59 +02:00
Jonathan G Rennison e477706bf5
Codechange: Add AssignBit function to assign the value of a single bit (#12934)
* Codechange: Add AssignBit function to assign the value of a single bit

* Codechange: Replace various uses of SB with AssignBit

* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00
Peter Nelson 4940b6ff0b
Codefix: Compile warning with newer C++ compiler on MinGW. (#12689)
> template-id not allowed for constructor in C++20
2024-05-16 12:09:19 +01:00
Peter Nelson 3b75d8bbf8 Fix: Use modern comparisons instead of memcmp in cache check.
This uses C++20 default operator<=> to provide comparisons of some objects.

This works properly with caches that containers.
2024-04-18 22:13:55 +01:00
Loïc Guilloux 243c6bead3
Fix #12415, 9c49a61, df400ef: Aircraft::tile is valid only for front vehicle (#12416) 2024-04-03 23:16:36 +02:00
Jonathan G Rennison 433484cda3
Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389) 2024-03-27 21:20:27 +01:00
Peter Nelson 322ca6ef54 Codechange: Shuffle members of Vehicle to reduce size.
This reduces space wasted due to member alignment.
2024-03-17 16:22:38 +00:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +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
Tyler Trahan ab315d0dc9
Fix #12118: When adding an unbunching order, properly check for unsafe conditions (#12136) 2024-03-09 08:28:05 -05:00
Peter Nelson 56cf89d189
Change: Use bitmap for free unit ID generation. (#12165)
This improves performance of finding the next free unit number for a vehicle.

Based loosely on pool's used slot bitmap.
2024-02-25 12:36:13 +00:00
Tyler Trahan f6dd5053a3
Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Rubidium e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
Tyler Trahan 3902acb13d Codechange: Define a TickCounter variable type for TimerGameTick::counter 2023-11-25 11:50:46 -05:00
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Patric Stout a9ed590ca7
Codechange: use TimerGameCalendar::Date for variables in linkgraph that are dates (#11187) 2023-08-12 16:02:38 +02:00
Tyler Trahan 9a602ff304
Fix #10334: Store separate newgrf-safe version of date_of_last_service. (#11124)
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.

Co-authored-by: Peter Nelson <peter1138@openttd.org>
2023-08-06 12:57:10 -04:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Jonathan G Rennison cdb3a6288b Codechange: Remove unused CapacitiesMap typedef from struct Vehicle 2023-06-01 22:48:47 +02:00
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 2023-05-20 16:53:10 +02:00
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 2023-05-18 12:18:30 +01:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Peter Nelson 7ccdefa1c1 Change: Increase vehicle random data from 8 to 16 bits. 2023-05-04 21:42:28 +01:00
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 2023-04-26 07:14:03 -04:00
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 2023-04-24 16:55:40 +00:00
Rubidium b7a5d8e296 Codechange: add annotation to selectively force inlining in debug build 2023-01-28 20:32:45 +01:00
Rubidium 375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
Artin Alavi fd4f148c62
Feature: Hotkey to honk a vehicle's horn (#10110) 2022-11-10 21:36:18 +01:00
Henry Wilson 59dbcdb5ba Feature: Display power-to-weight ratio in ground vehicle details GUI 2022-11-08 21:02:08 +01:00
Nicolas Chappe f8a7b76675 Fix #9665: [Linkgraph] Fix travel times of non-direct journeys 2022-10-29 18:39:03 +02:00
Andy 1cfdbb4dea
Change: increase vehicle sprite stack from 4 layers to 8 (#9863) 2022-04-26 19:07:44 +02:00