Commit Graph

778 Commits

Author SHA1 Message Date
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 2023-04-15 13:58:55 +02:00
Tyler Trahan 97cfd40649
Fix #10630: Don't allow shifting service date earlier than 0 (#10643) 2023-04-12 18:52:37 +00:00
Tyler Trahan 3719f60de0 Add: Use specific error message when vehicle cannot go to station/waypoint 2023-03-03 17:11:14 -05:00
Jonathan G Rennison 4c1406a4b5 Add: NewGRF road stops 2023-02-26 21:28:30 +01:00
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 2023-01-29 20:28:45 +01:00
SamuXarick b2a5ebcfc4
Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
2023-01-22 08:14:02 -05:00
Rubidium 375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
Bernard Teo 8a78fa7121
Feature: Contextual actions for vehicles grouped by shared orders (#8425) 2022-11-26 18:03:21 +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
Charles Pigott 146827c458
Fix #9877: GS could trigger 'Cost: 0' cost message (#9878) 2022-05-05 19:51:56 +01:00
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2022-02-15 20:01:10 +01:00
Tyler Trahan 9c18236f2c Fix: Suppress vehicle age warnings for stopped vehicles 2021-12-20 22:13:37 +01:00
Michael Lutz 41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 2021-12-16 22:28:32 +01:00
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 2021-12-16 22:28:32 +01:00
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
nchappe 2cb6351af5
Fix: Update last servicing dates when using the date cheat (#9694) 2021-11-19 00:04:22 +00:00
SamuXarick a57c2b073a
Feature: Display icon/text whether vehicle is lost in vehicle (list) window (#9543) 2021-09-14 22:10:00 +02:00
Nicolas Chappe 977604ef08 Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo
Passengers usually prefer fast paths to short paths.
Average travel times of links are updated in real-time for use in Dijkstra's algorithm,
and newer travel times weigh more, just like capacities.
2021-08-17 14:57:59 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
Matt Kimber 520595ff87
Fix 3d7ab09: stopped trains not updating viewport hash when reversed for a second time (#9165) 2021-05-01 18:14:50 +01:00
Charles Pigott dd798d688b
Fix #8919: Release builds with asserts enabled (#8925) 2021-04-01 23:57:49 +01:00
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
frosch d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 2021-02-20 19:01:04 +01:00
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
2021-02-05 11:00:36 +01:00
Matt Kimber 40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540) 2021-01-17 19:57:16 +01:00
Charles Pigott 188bf0fbc9 Change: Remove disable_unsuitable_building setting
This setting is no longer useful, as you can now always build roads,
canals, etc.
2021-01-08 16:43:51 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Matt Kimber 5728f9c7d0 Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives 2021-01-05 11:42:25 +01:00
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 2021-01-05 11:42:25 +01:00
Matt Kimber eeb88e87d8 Codechange: improve performance for complex vehicle chains by resolving sprites less often 2021-01-05 11:42:25 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Galigator 933d02dce2 Change: Service depot also reset breakdown chance. 2020-09-25 22:38:58 +02:00
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
Charles Pigott 218db00c4c Fix #8216: Don't show floating text on autoreplace if cost is 0 2020-06-28 00:00:28 +01:00
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
2020-05-21 20:02:34 +02:00
glx b50d77b831 Fix #8064: Incorrect display of refit capacity 2020-04-06 16:21:30 +01:00
SamuXarick 9e7c5235e8 Fix #7891: Actually check the vehicle type before casting 2020-01-03 00:04:39 +00:00
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx 1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 2019-12-21 20:13:03 +01:00
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson f3938fdb83 Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() 2019-03-26 20:15:57 +00:00
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
stormcone 8acca3a72b Change: Do not display a newspaper about old vehicles for which replacement is activated. 2019-03-25 23:41:06 +01:00
PeterN 22f33fdd08
Fix 148e5b41d6: Uninitialized variable usage. (#7216) 2019-02-10 21:06:09 +00:00
Eddi-z 148e5b41d6 Change: Skip reliability decay if servicing is disabled 2019-02-10 18:45:48 +01:00
PeterN d242875d27
Fix #7197: Invalidate depot buttons when necessary. (#7212) 2019-02-10 08:43:54 +00:00
Henry Wilson d03cb80346 Fix: trains cancelling their pending reversal when ordered to go to a depot behind them
Previously, if a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is behind it, the train would continue forwards.
Also when a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is in front of it, the train would not cancel the
reversal.
In both cases the train would travel away from the target depot.

Trains in this situation now behave correctly and will travel towards the depot.
2019-02-08 23:23:41 +00:00
Peter Nelson e3b440c9c5 Add #5006: Flag to hide rail type from construction. 2019-02-06 07:40:55 +00:00
Peter Nelson e8f1c446a6 Fix: DMU/EMU livery should apply to passenger carriages with DMU/EMU engines. 2019-02-02 16:57:47 +00:00
PeterN 23960d0f2c Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection.

This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired.

* Feature: Add vehicle group liveries.
2019-01-31 14:57:44 +01:00
Peter Nelson 81330b8d6e Change: Add path cache for ships. 2019-01-19 23:11:17 +00:00
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Niels Martin Hansen 2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2018-07-19 21:17:07 +02:00
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 2018-05-21 22:08:39 +01:00
frosch 5558899621 (svn r27986) -Codechange: Name magic constants in the vehicle position hash functions. 2018-03-11 13:23:26 +00:00
adf88 88726f71b6 (svn r27904) -Fix [FS#6593]: When last vehicle is removed from shared orders group, hide the "Stop sharing" button in vehile orders window 2017-08-31 06:47:17 +00:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
peter1138 19d56a33e8 (svn r27822) -Feature: Vehicle Group Info: Add profits and occupancy display to group vehicle list (mtm, JGR) 2017-03-24 07:33:31 +00:00
frosch 117e73751c (svn r27668) -Feature: [NewGRF] Allow composing vehicles from multiple sprites. 2016-10-16 14:59:44 +00:00
frosch c175067ed9 (svn r27667) -Codechange: Add VehicleSpriteSeq::GetBounds and Draw. 2016-10-16 14:58:38 +00:00
frosch d2393b4f6c (svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq. 2016-10-16 14:57:56 +00:00
frosch dac94c7cbc (svn r27584) -Codechange: Add some assertions about Vehicle::cargo_payment. 2016-05-29 13:33:20 +00:00
frosch 312809228d (svn r27426) -Change: Round loading percentage in loading indicators and conditional orders towards 50%, so that 0% and 100% mean completely empty or full. 2015-10-30 17:24:05 +00:00
planetmaker 55f42eaa1f (svn r27222) -Fix [FS#6278]: Use the current maximum speed as limited by bridges, orders etc. for all vehicle types alike when considering increased smoke emissions of vehicles. 2015-04-09 18:17:43 +00:00
frosch 2e1be6081d (svn r27148) -Fix: Rounding and unit-conversion inconsistencies in calls to MarkAllViewportsDirty. 2015-02-14 12:53:07 +00:00
rubidium 9daf7e749c (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 2014-09-21 11:24:51 +00:00
rubidium 6c2abf0930 (svn r26863) -Codechange: move a number of Vehicle* functions into the Vehicle class 2014-09-20 15:31:26 +00:00
frosch 52fd95915a (svn r26756) -Fix (r26747): Ground vehicle breakdown smoke was not supposed to be available yet, since it is a looping animation. 2014-08-23 13:31:20 +00:00
frosch 17872c8be1 (svn r26755) -Fix (r26747) [FS#6093]: Silence MSVC warning. 2014-08-23 10:44:32 +00:00
frosch c30e137685 (svn r26747) -Feature: [NewGRF] Advanced visual effects with multiple effect sprites independent of spawning model. 2014-08-17 14:53:11 +00:00
frosch 17e88d644a (svn r26746) -Codechange: Separate enums for visual effect type and spawning model. 2014-08-17 14:52:48 +00:00
frosch d263fcce82 (svn r26745) -Codechange: Deduplicate calls to CreateEffectVehicleRel for vehicle visual effects. 2014-08-17 14:52:32 +00:00
rubidium 3d2895dbd1 (svn r26706) -Fix [FS#6015] (r20644): wrong breakdown sound was played for ships 2014-07-27 18:16:03 +00:00
rubidium 3d3fb76b7e (svn r26699) -Fix-ish: do not crash when trying to show an error about vehicle in a NewGRF and the NewGRF was not loaded at all 2014-07-21 18:03:05 +00:00
fonsinchen a9e3828dd2 (svn r26594) -Fix [FS#6006]: Don't call UpdateVehicleTimetable with dummy orders 2014-05-17 19:38:30 +00:00
fonsinchen 3ee31a8f89 (svn r26547) -Codechange: Collect order travel and wait times independent of timetables 2014-05-01 14:49:16 +00:00
fonsinchen c915d9fa55 (svn r26546) -Codechange: Make order wait_time, travel_time and max_speed private 2014-05-01 14:48:44 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 41b7a04a68 (svn r26317) -Fix [FS#5897]: Check whether NewGRF change vehicle capacity when they are not supposed to, and truncate cargo appropiately if they are allowed to. 2014-02-07 23:48:56 +00:00
rubidium 18beaac571 (svn r26101) -Fix: NULL pointer dereference when one can't allocate an order list but wants to make implicit orders 2013-11-25 11:08:21 +00:00
frosch ec4806a82d (svn r26027) -Change [FS#5669-ish]: [NewGRF] Invalidate vehicle colour palette when leaving a station. 2013-11-17 16:02:39 +00:00