Commit Graph

767 Commits

Author SHA1 Message Date
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 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2021-12-16 22:28:32 +01:00
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP 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 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 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 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
Patric Stout 7acdaaaf2f
Fix: Prevent train reversing when wholly inside a train depot (#9557)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2021-09-18 15:56:23 +02:00
Michael Lutz ee333a9549
Fix 2183fd4d: [NewGRF] Use divide instead of right shift for signed numbers. (#9480)
"For negative a, the value of a >> b is implementation-defined (in most implementations, this performs arithmetic right shift, so that the result remains negative)."
2021-08-15 12:14:53 +02:00
Vít Šefl 2183fd4dab
Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346) 2021-08-15 11:17:05 +02:00
glx22 49b66ea504 Codechange: Remove FOR_EACH_SET_TRACK 2021-07-09 21:36:09 +02:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 2021-05-27 18:30:56 +02:00
Jonathan G Rennison a896753ecc Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing 2021-05-23 21:05:55 +02:00
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
frosch d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 2021-02-20 19:01:04 +01:00
Patric Stout cd36e17160
Fix: don't allow free-wagon-chains to exceed max-train-length (#8533)
This makes no sense, that a free-wagon-chain could be larger than
the maximum length of a train, as you cannot put an engine in
front of that anyway. And it prevents run-away AIs making very
silly long free-wagon-chains.
2021-01-11 20:58:00 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric Stout dff7ee8e1c
Fix #7611: keeps news about accidents around after vehicle is cleaned up (#8497)
When a vehicle is cleaned up, all news that points to the news is
also removed. This was a bit evil, as it would also remove any
news related to crashed, acting like the crash never happened.
This left players a bit in the dark what was going on exactly.
2021-01-05 21:39:23 +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
Andy 0f91cb0479
Fix: GetCurveSpeedLimit needs railtype from current tile (#8466) 2021-01-03 22:19:06 +01:00
glx d8a1be48cd Codechange: Replace vehicle 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
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 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 a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Michael Lutz cc5f175615 Feature: Railtype flags to allow/disallow 90 degree curves. (#7352) 2019-03-10 08:12:47 +00:00
Michael Lutz 690d1dd6a4 Fix #7159, e934f09: Waiting time at red one-way signals was too short.
This is not an exact fix as previously, the wait time was speed/acceleration dependant. This simple fix ignores that and just makes the 'days' from the settings comment to be actually days.
2019-02-21 23:19:03 +00:00
J0an Josep 029c48cf4a Cleanup: [NPF] Remove unused parameter. 2019-01-31 22:15:56 +00:00
J0an Josep 96c5e5e73a Cleanup: [NPF] Remove unused parameters. 2019-01-31 22:15:56 +00:00
Joan Josep 96854b2b8b Codechange #5859: Simplify CheckTrainStayInDepot() (#7045) 2019-01-12 17:04:04 +00:00
Andy e934f09f02 Fix: Don't increase motion counter while train is waiting at non-path signals (Author: frosch123) #5877 (#7018) 2019-01-09 18:37:58 +01:00
Charles Pigott bb7353c02a Codechange: Some more null checks 2018-10-31 12:41:49 +01: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 c2a7728084
Fix: Prevent ships moving into docks after finishing (un)loading. (#6791) 2018-06-14 09:25:39 +01:00
PeterN a07394a63a
Change: Remove direction parameter from Vehicle::UpdateDeltaXY. (#6792)
The value is either unused or always the same as this->direction.
2018-05-22 18:43:34 +01:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
peter1138 5951d2406e (svn r27811) -Change: Remove unused parameters in FreeTrainTrackReservation
FreeTrainTrackReservation is always called with INVALID_TILE
and INVALID_TRACKDIR as second and third arguments, so remove
them and just use those constants instead. (cirdan)
2017-03-20 17:49:44 +00:00
peter1138 67ab0450dd (svn r27809) -Codechange: Improve check in UpdateLevelCrossing
In UpdateLevelCrossing, checking if a level crossing is reserved is
cheaper than finding trains on it or approaching it, so do it first. (cirdan)
2017-03-20 08:04:47 +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 a6d1d128da (svn r27663) -Codechange: Deduplicate code when rotating crashed vehicles. 2016-10-16 14:56:33 +00:00