summaryrefslogtreecommitdiff
path: root/src/cargopacket.cpp
AgeCommit message (Collapse)Author
2014-05-11(svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action ↵fonsinchen
counts.
2014-04-23(svn r26482) -Codechange: add an include that allows us to undefine/redefine ↵rubidium
"unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
2014-02-11(svn r26333) -Fix: Compilation without static_assert.frosch
2014-02-10(svn r26328) -Fix: Warnings and compilation failures.frosch
2014-02-09(svn r26327) -Fix [FS#5901]: Take care of next_station when reassigning from ↵fonsinchen
MTA_DELIVER to MTA_TRANSFER.
2013-10-23(svn r25910) -Fix: Guard against empty FlowStats in a few more places.fonsinchen
2013-10-22(svn r25900) -Change [FS#5677]: Allow restricted flows to be picked for kept ↵fonsinchen
cargo.
2013-10-20(svn r25891) -Feature: Use smallstack to allow for multiple next hops when ↵fonsinchen
loading and unloading.
2013-08-10(svn r25715) -Fix: return correct value from StationCargoList::Reserve, fix ↵fonsinchen
some documentation and simplify StationCargoList::Load a bit
2013-06-23(svn r25434) -Fix: reroute cargo staged for unloading if a link breaksfonsinchen
2013-06-15(svn r25419) -Fix: assign some random other source station to packets which ↵fonsinchen
have lost their source
2013-06-09(svn r25362) -Feature: consider cargo waiting at other stations for rating ↵fonsinchen
at the origin station
2013-06-09(svn r25361) -Feature: distribute cargo according to plan given by linkgraphfonsinchen
2013-02-17(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load ↵rubidium
improved loading) instead of calculating if for every cycle
2013-02-17(svn r25010) -Codechange: Add general framework for cargo actions, i.e. ↵rubidium
loading, transfering, delivering and such, to contain this logic in a single place instead of spread around (fonsinchen)
2013-02-17(svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce ↵rubidium
duplicated code (fonsinchen)
2013-02-17(svn r25008) -Codechange: Make CargoList::Truncate behave similarly to ↵rubidium
CargoList::MoveTo, i.e. pass the amount to truncate (fonsinchen)
2011-12-20(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the ↵truebrain
others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
2011-06-13(svn r22582) -Fix: Don't increment STL iterators after they've been invalidated.michi_cc
2011-05-02(svn r22413) -Document: even more stuffrubidium
2011-02-19(svn r22116) -Codechange: use PoolBase::Clean() at more placessmatz
2011-02-19(svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should ↵rubidium
not delete items from other pools
2011-02-08(svn r22023) -Fix: verify we can allocate a CargoPacket and CargoPayment ↵smatz
before we actually try to do so -Codechange: increase the limit of number of CargoPayments to match the limit of Vehicles (Rubidium)
2011-01-26(svn r21909) -Fix: some missing spacesrubidium
2011-01-19(svn r21863) -Fix (r21849): load the amount that should be loaded instead of ↵rubidium
the amount that should not be loaded
2011-01-19(svn r21849) -Codechange: move merging/splitting of cargopackets into a ↵rubidium
helper function (fonsinchen)
2011-01-19(svn r21848) -Codechange: unification of comment style for cargopacket.*rubidium
2011-01-18(svn r21844) -Codechange: move documentation towards the code to make it ↵rubidium
more likely to be updates [a-c].
2009-11-28(svn r18330) -Cleanup: remove some unneeded includesrubidium
2009-10-21(svn r17840) -Codechange: use the new pool's concepts (caching + not ↵rubidium
zeroing). Improves average CargoPacket con/destruction time by ~20%, MoveTo/Append by 5-10% and application performance by up to 2%.
2009-10-20(svn r17836) -Codechange: split the CargoPacket constructor for creating ↵rubidium
'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(svn r17818) -Codechange: iterate the cargo list from the back when trying ↵rubidium
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-19(svn r17813) -Codechange: unify the CargoPacket related coding stylerubidium
2009-10-19(svn r17812) -Codechange: move the feeder_share cache from CargoList to ↵rubidium
VehicleCargoList; saves 512 bytes per station and 1-2% on CargoList::MoveTo.
2009-10-18(svn r17809) -Fix: MSVC compilation.frosch
2009-10-18(svn r17807) -Codechange: move all 'updates' just after the 'load' ↵rubidium
constructor of CargoPackets to the constructor call itself
2009-10-18(svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations ↵rubidium
get removed to CargoPacket.
2009-10-18(svn r17801) -Codechange: for StationCargoLists the 'loaded_at_xy' does not ↵rubidium
matter when merging CargoPackets
2009-10-18(svn r17800) -Codechange: first steps into making CargoList a templaterubidium
2009-10-18(svn r17795) -Codechange: split cargolist into one for vehicles and one for ↵rubidium
stations.
2009-10-07(svn r17739) -Cleanup: compiler didn't warn about an unused variable, ↵rubidium
fonsinchen did
2009-10-07(svn r17736) -Codechange [FS#3135]: rewrite CargoList::MoveTo; don't require ↵rubidium
the secondary list, use cache updates instead of rebuilds. This is usually faster because of primarily gradual loading that only moves a (small) part of the cargo each time. Based on patch by fonsinchen.
2009-10-07(svn r17735) -Codechange: update the cache one inserting/removing ↵rubidium
CargoPackets from the CargoList via Append/Truncate instead of rebuilding the whole cache. For Append this changes the O(n) cache rebuild into a O(1) cache update. For Truncate no temporary list is needed anymore (based on patch by fonsinchen)
2009-10-06(svn r17733) -Codechange: store the 'days in transit' cache as the sum of ↵rubidium
the days in transit instead of the average; the variable isn't requested that often (primarily station NewGRFs) that the dividing/testing for dividing by 0 step needs to be cached.
2009-10-06(svn r17732) -Codechange: reorder some variables of cargo packets/cargo ↵rubidium
lists to get better alignment *and* smaller structs; both from 40 bytes to 32 bytes on 64 bits.
2009-10-06(svn r17731) -Codechange: do not cache a boolean which states whether some ↵rubidium
other variable is not 0.
2009-10-06(svn r17730) -Codechange: do not cache the source of a packet in the cargo ↵rubidium
list. It's only used for (some) GUI/NewGRF purposes so precalculating it costs more than calculating when it's actually used.
2009-10-06(svn r17727) -Codechange: some coding style and documentation fixesrubidium
2009-10-06(svn r17722) -Codechange: simplify the cargopacket constructor; unduplicate ↵rubidium
if and don't set a value to 0 if it already is 0.
2009-10-06(svn r17721) -Codechange: replace a magic number with a constantrubidium