Commit Graph

89 Commits

Author SHA1 Message Date
rubidium42 9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days (#11112) 2023-07-12 13:20:02 -04:00
Rubidium 4a6fdc8293 Fix: multiplication result converted to larger type
Technically unlikely to happen, though uint16 * uint16 get promoted to int and
then stored as uint64; similarly uint * uint16 remains uint and gets stored as
uint64. In both cases the value can get truncated before the change to uint64.
2023-05-14 22:09:58 +02:00
Peter Nelson e6740046ee Codechange: Use range-for iteration. 2023-05-11 07:58:55 +01:00
Jonathan G Rennison 37392935dd
Fix #10707: Incorrect type of days_in_transit in CargoPacket constructor (#10715) 2023-04-24 18:55:16 +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
dP e2f1cd44dc
Change: Increase max cargo age and let min cargo payment approach zero. (#10596)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2023-04-10 12:34:28 +02:00
Michael Lutz b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
2021-12-16 22:28:32 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Charles Pigott 52f3abba6e Cleanup: Remove unnecessary assert_tcompile macro 2020-12-27 10:30:55 +00:00
glx 5fce5fa300 Codechange: Replace FOR_ALL_CARGOPACKETS 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
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
fonsinchen a363b2c317 (svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts. 2014-05-11 12:49:51 +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 858e80f3dd (svn r26333) -Fix: Compilation without static_assert. 2014-02-11 20:34:48 +00:00
frosch 03169121c2 (svn r26328) -Fix: Warnings and compilation failures. 2014-02-10 17:13:54 +00:00
fonsinchen 88787412b6 (svn r26327) -Fix [FS#5901]: Take care of next_station when reassigning from MTA_DELIVER to MTA_TRANSFER. 2014-02-09 21:10:25 +00:00
fonsinchen f528d2c592 (svn r25910) -Fix: Guard against empty FlowStats in a few more places. 2013-10-23 19:04:06 +00:00
fonsinchen bd230f34f4 (svn r25900) -Change [FS#5677]: Allow restricted flows to be picked for kept cargo. 2013-10-22 16:15:59 +00:00
fonsinchen 54db96be43 (svn r25891) -Feature: Use smallstack to allow for multiple next hops when loading and unloading. 2013-10-20 13:47:58 +00:00
fonsinchen 6ce4c1808b (svn r25715) -Fix: return correct value from StationCargoList::Reserve, fix some documentation and simplify StationCargoList::Load a bit 2013-08-10 14:19:58 +00:00
fonsinchen 3dd811e179 (svn r25434) -Fix: reroute cargo staged for unloading if a link breaks 2013-06-23 08:28:53 +00:00
fonsinchen c9452bbbff (svn r25419) -Fix: assign some random other source station to packets which have lost their source 2013-06-15 20:48:50 +00:00
fonsinchen 741c431caa (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 2013-06-09 13:04:32 +00:00
fonsinchen 04e3eb6fab (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 2013-06-09 13:03:48 +00:00
rubidium cdb0a76958 (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle 2013-02-17 14:54:50 +00:00
rubidium d6e2a8aa56 (svn r25010) -Codechange: Add general framework for cargo actions, i.e. loading, transfering, delivering and such, to contain this logic in a single place instead of spread around (fonsinchen) 2013-02-17 14:36:40 +00:00
rubidium 71bbc130fc (svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce duplicated code (fonsinchen) 2013-02-17 14:17:06 +00:00
rubidium 2795ed5b09 (svn r25008) -Codechange: Make CargoList::Truncate behave similarly to CargoList::MoveTo, i.e. pass the amount to truncate (fonsinchen) 2013-02-17 14:10:15 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
michi_cc 56b7faed52 (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. 2011-06-13 10:46:00 +00:00
rubidium ff143c6708 (svn r22413) -Document: even more stuff 2011-05-02 20:59:54 +00:00
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 2011-02-19 23:05:47 +00:00
rubidium 68bc93f950 (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools 2011-02-19 18:02:17 +00:00
smatz b4273bcd35 (svn r22023) -Fix: verify we can allocate a CargoPacket and CargoPayment before we actually try to do so
-Codechange: increase the limit of number of CargoPayments to match the limit of Vehicles (Rubidium)
2011-02-08 18:27:21 +00:00
rubidium 8017c2a3d7 (svn r21909) -Fix: some missing spaces 2011-01-26 08:14:36 +00:00
rubidium 6435a89c28 (svn r21863) -Fix (r21849): load the amount that should be loaded instead of the amount that should not be loaded 2011-01-19 20:40:27 +00:00
rubidium 2707186f6a (svn r21849) -Codechange: move merging/splitting of cargopackets into a helper function (fonsinchen) 2011-01-19 16:25:00 +00:00
rubidium 07e14525b8 (svn r21848) -Codechange: unification of comment style for cargopacket.* 2011-01-19 16:20:26 +00:00
rubidium 6c9078fd30 (svn r21844) -Codechange: move documentation towards the code to make it more likely to be updates [a-c]. 2011-01-18 22:17:15 +00:00
rubidium b00a5f1069 (svn r18330) -Cleanup: remove some unneeded includes 2009-11-28 20:35:25 +00:00
rubidium 547677a782 (svn r17840) -Codechange: use the new pool's concepts (caching + not zeroing). Improves average CargoPacket con/destruction time by ~20%, MoveTo/Append by 5-10% and application performance by up to 2%. 2009-10-21 19:42:49 +00:00
rubidium 69b8e8e755 (svn r17836) -Codechange: split the CargoPacket constructor for creating 'real' new CargoPackets and saveload. For saveload we do not need to set anything except two variables (the rest is always overwritten by the load), for new 'real' cargo also pass the source_xy; dereferencing st before calling is easier than resolving st->index back to st and then dereferencing. Also don't set loaded_at_xy because that is of no importance when not loaded in a vehicle. 2009-10-20 22:24:34 +00:00
rubidium 86031d434d (svn r17818) -Codechange: iterate the cargo list from the back when trying to merge packets. Chances are higher that the last packet (in the FIFO-ish queue) is mergeable with the to be added package. If a train gets loaded packets get split up and put into the different carriages, at unload they are unloaded in the same order so the last in the FIFO-ish queue is likely the packet it can merge with.
This results in a 5-10% performance improvement of CargoList's Append/MoveTo without performance degradation of AgeCargo.
2009-10-20 16:36:35 +00:00
rubidium 08ac51fada (svn r17813) -Codechange: unify the CargoPacket related coding style 2009-10-19 09:15:47 +00:00
rubidium 2cca30d2e3 (svn r17812) -Codechange: move the feeder_share cache from CargoList to VehicleCargoList; saves 512 bytes per station and 1-2% on CargoList::MoveTo. 2009-10-19 01:12:51 +00:00
frosch fea06c5755 (svn r17809) -Fix: MSVC compilation. 2009-10-18 18:47:43 +00:00