Commit Graph

60 Commits (c62cbe04a491f78c555587e896305324748906ed)

Author SHA1 Message Date
rubidium 79b74a5925 (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) 11 years ago
rubidium 4301d77d65 (svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce duplicated code (fonsinchen) 11 years ago
rubidium 84ca041564 (svn r25008) -Codechange: Make CargoList::Truncate behave similarly to CargoList::MoveTo, i.e. pass the amount to truncate (fonsinchen) 11 years ago
truebrain aa1a0053b0 (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) 13 years ago
michi_cc ddfab2cc1c (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. 13 years ago
rubidium d946841eff (svn r22413) -Document: even more stuff 13 years ago
smatz c85e1c3089 (svn r22116) -Codechange: use PoolBase::Clean() at more places 14 years ago
rubidium 7e4ff17e35 (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools 14 years ago
smatz eab3c044a1 (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)
14 years ago
rubidium 54c0dec6aa (svn r21909) -Fix: some missing spaces 14 years ago
rubidium 3cea46161d (svn r21863) -Fix (r21849): load the amount that should be loaded instead of the amount that should not be loaded 14 years ago
rubidium c7c9dd970f (svn r21849) -Codechange: move merging/splitting of cargopackets into a helper function (fonsinchen) 14 years ago
rubidium 943eb0809f (svn r21848) -Codechange: unification of comment style for cargopacket.* 14 years ago
rubidium f0ad5fd749 (svn r21844) -Codechange: move documentation towards the code to make it more likely to be updates [a-c]. 14 years ago
rubidium da30e736ca (svn r18330) -Cleanup: remove some unneeded includes 15 years ago
rubidium 5f1e16027d (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%. 15 years ago
rubidium 61720eede3 (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. 15 years ago
rubidium 0c06d279f0 (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.
15 years ago
rubidium fe575367f9 (svn r17813) -Codechange: unify the CargoPacket related coding style 15 years ago
rubidium 3adaa57a2e (svn r17812) -Codechange: move the feeder_share cache from CargoList to VehicleCargoList; saves 512 bytes per station and 1-2% on CargoList::MoveTo. 15 years ago
frosch f1d37fab37 (svn r17809) -Fix: MSVC compilation. 15 years ago
rubidium ef38feefda (svn r17807) -Codechange: move all 'updates' just after the 'load' constructor of CargoPackets to the constructor call itself 15 years ago
rubidium 8234230f9e (svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations get removed to CargoPacket. 15 years ago
rubidium be57392ba3 (svn r17801) -Codechange: for StationCargoLists the 'loaded_at_xy' does not matter when merging CargoPackets 15 years ago
rubidium e553983e39 (svn r17800) -Codechange: first steps into making CargoList a template 15 years ago
rubidium 760a329622 (svn r17795) -Codechange: split cargolist into one for vehicles and one for stations. 15 years ago
rubidium 79a0aca3bc (svn r17739) -Cleanup: compiler didn't warn about an unused variable, fonsinchen did 15 years ago
rubidium b7b1224ef3 (svn r17736) -Codechange [FS#3135]: rewrite CargoList::MoveTo; don't require 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. 15 years ago
rubidium de43874182 (svn r17735) -Codechange: update the cache one inserting/removing 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) 15 years ago
rubidium 702deb8366 (svn r17733) -Codechange: store the 'days in transit' cache as the sum of 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. 15 years ago
rubidium 0a621eae7e (svn r17732) -Codechange: reorder some variables of cargo packets/cargo lists to get better alignment *and* smaller structs; both from 40 bytes to 32 bytes on 64 bits. 15 years ago
rubidium 27d62a7ec6 (svn r17731) -Codechange: do not cache a boolean which states whether some other variable is not 0. 15 years ago
rubidium 49739b3c67 (svn r17730) -Codechange: do not cache the source of a packet in the cargo list. It's only used for (some) GUI/NewGRF purposes so precalculating it costs more than calculating when it's actually used. 15 years ago
rubidium 10428de7a3 (svn r17727) -Codechange: some coding style and documentation fixes 15 years ago
rubidium 72dd637e92 (svn r17722) -Codechange: simplify the cargopacket constructor; unduplicate if and don't set a value to 0 if it already is 0. 15 years ago
rubidium 9b94441eb8 (svn r17721) -Codechange: replace a magic number with a constant 15 years ago
rubidium ec3a0dc064 (svn r17720) -Codechange: guard the CargoPacket variables that are cached in CargoLists so they cannot be written from outside the CargoList class (based on patch by fonsinchen) 15 years ago
rubidium 99d46e0ad7 (svn r17248) -Fix: add GPL license notice where appropriate 15 years ago
smatz 0502a6df42 (svn r17113) -Change [FS#265][FS#2094][FS#2589]: apply the subsidy when subsidy's destination is in station's catchment area and cargo packets originate from subsidy's source
-Change [FS#1134]: subsidies aren't bound to stations after awarding anymore, they still apply to town or industry, no matter what station is used for loading and unloading. Awarded subsidies from older savegames are lost
-Change [NoAI]: due to these changes, AISubsidy::GetSource and AISubsidy::GetDestination now return STATION_INVALID for awarded subsidies
15 years ago
rubidium d361ecd8f0 (svn r16914) -Codechange: split Station and BaseStation into different files 15 years ago
rubidium 4f99508114 (svn r16694) -Fix [FS#2995] (rgradual loading, rnewindustries): only pay for whatever has been actually unloaded and perform the payment when unloading has finished. This fixes, amongst others:
* cheating by starting to unload and after getting paid rushing to the depot to get sold (or unloading, loading and getting paid again for the remainder)
 * cargo being dropped onto a station at the moment a stockpiling industry doesn't accept it anymore
 * industries getting cargo that has not been unloaded yet and subsequently dumping it back on the station in one go
Note: you will now get paid after the unloading has finished, so you'll have to wait a bit longer for 'your' money.
15 years ago
smatz 917e1f4fad (svn r16459) -Codechange: move definition of several cargopacket accessors to header file 15 years ago
smatz 50624d5c0f (svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved 15 years ago
smatz d495dc5dbc (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 15 years ago
smatz 9021c20b5e (svn r15299) -Cleanup: remove many redundant includes 16 years ago
smatz 91233ea596 (svn r14828) -Codechange: move most of save/load-specific code to separate files 16 years ago
glx 744c9eda2f (svn r14235) -Fix (r14234): compilation with MSVC was broken 16 years ago
smatz e25227d709 (svn r14234) -Fix: feeder share was computed wrong when splitting cargo packet 16 years ago
celestar 3546b74e93 (svn r14137) -Codechange: Remove a now unused member of CargoPacket 16 years ago
skidd13 0a178274e2 (svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant 16 years ago