Commit Graph

204 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison ab6119cb76 Merge branch 'infrastructure_sharing' into jgrpp 6 years ago
Jonathan G Rennison 2c16800454 Add debug console command to show cargo packet deferred payment stats 6 years ago
Jonathan G Rennison 8c0c9274ea Merge branch 'infrastructure_sharing' into jgrpp
# Conflicts:
#	src/economy.cpp
#	src/misc.cpp
#	src/openttd.cpp
#	src/saveload/extended_ver_sl.cpp
6 years ago
Jonathan G Rennison 9000d74f3c Pay all cargo payment incomes when cargo finally delivered 6 years ago
Jonathan G Rennison a422cb6753 Use a deque instead of list for CargoPacketList and StationCargoPacketMap. 8 years ago
Jonathan G Rennison 495aa729df Fix VehicleCargoList::Truncate when not all cargo is MTA_KEEP. 8 years ago
fonsinchen a363b2c317 (svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts. 10 years ago
fonsinchen 1dc630ff26 (svn r26575) -Change [FS#5995]: Add an assert to catch underflowing action counts. 10 years ago
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 10 years ago
rubidium 2be4215f43 (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 10 years ago
frosch 858e80f3dd (svn r26333) -Fix: Compilation without static_assert. 10 years ago
frosch a92bf49191 (svn r26333) -Fix: Compilation without static_assert. 10 years ago
frosch 03169121c2 (svn r26328) -Fix: Warnings and compilation failures. 10 years ago
frosch 6040da6654 (svn r26328) -Fix: Warnings and compilation failures. 10 years ago
fonsinchen 88787412b6 (svn r26327) -Fix [FS#5901]: Take care of next_station when reassigning from MTA_DELIVER to MTA_TRANSFER. 10 years ago
fonsinchen fbd6707afc (svn r26327) -Fix [FS#5901]: Take care of next_station when reassigning from MTA_DELIVER to MTA_TRANSFER. 10 years ago
fonsinchen f528d2c592 (svn r25910) -Fix: Guard against empty FlowStats in a few more places. 11 years ago
fonsinchen 49d2cd4049 (svn r25910) -Fix: Guard against empty FlowStats in a few more places. 11 years ago
fonsinchen bd230f34f4 (svn r25900) -Change [FS#5677]: Allow restricted flows to be picked for kept cargo. 11 years ago
fonsinchen 809df5aaf6 (svn r25900) -Change [FS#5677]: Allow restricted flows to be picked for kept cargo. 11 years ago
fonsinchen 54db96be43 (svn r25891) -Feature: Use smallstack to allow for multiple next hops when loading and unloading. 11 years ago
fonsinchen fff00b6460 (svn r25891) -Feature: Use smallstack to allow for multiple next hops when loading and unloading. 11 years ago
fonsinchen 6ce4c1808b (svn r25715) -Fix: return correct value from StationCargoList::Reserve, fix some documentation and simplify StationCargoList::Load a bit 11 years ago
fonsinchen 8bec8a982b (svn r25715) -Fix: return correct value from StationCargoList::Reserve, fix some documentation and simplify StationCargoList::Load a bit 11 years ago
fonsinchen 3dd811e179 (svn r25434) -Fix: reroute cargo staged for unloading if a link breaks 11 years ago
fonsinchen 6ce6fd05d8 (svn r25434) -Fix: reroute cargo staged for unloading if a link breaks 11 years ago
fonsinchen c9452bbbff (svn r25419) -Fix: assign some random other source station to packets which have lost their source 11 years ago
fonsinchen 647d92c0d5 (svn r25419) -Fix: assign some random other source station to packets which have lost their source 11 years ago
fonsinchen 741c431caa (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 11 years ago
fonsinchen 1de46050f6 (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 11 years ago
fonsinchen 04e3eb6fab (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 11 years ago
fonsinchen f022550df9 (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 11 years ago
rubidium cdb0a76958 (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle 11 years ago
rubidium 7dd2354a13 (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle 11 years ago
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) 11 years ago
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 71bbc130fc (svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce duplicated code (fonsinchen) 11 years ago
rubidium 4301d77d65 (svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce duplicated code (fonsinchen) 11 years ago
rubidium 2795ed5b09 (svn r25008) -Codechange: Make CargoList::Truncate behave similarly to CargoList::MoveTo, i.e. pass the amount to truncate (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 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) 13 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 56b7faed52 (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. 13 years ago
michi_cc ddfab2cc1c (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. 13 years ago
rubidium ff143c6708 (svn r22413) -Document: even more stuff 13 years ago
rubidium d946841eff (svn r22413) -Document: even more stuff 13 years ago
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 13 years ago
smatz c85e1c3089 (svn r22116) -Codechange: use PoolBase::Clean() at more places 13 years ago
rubidium 68bc93f950 (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools 13 years ago
rubidium 7e4ff17e35 (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools 13 years ago
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)
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 8017c2a3d7 (svn r21909) -Fix: some missing spaces 14 years ago
rubidium 54c0dec6aa (svn r21909) -Fix: some missing spaces 14 years ago
rubidium 6435a89c28 (svn r21863) -Fix (r21849): load the amount that should be loaded instead of the amount that should not be loaded 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 2707186f6a (svn r21849) -Codechange: move merging/splitting of cargopackets into a helper function (fonsinchen) 14 years ago
rubidium c7c9dd970f (svn r21849) -Codechange: move merging/splitting of cargopackets into a helper function (fonsinchen) 14 years ago
rubidium 07e14525b8 (svn r21848) -Codechange: unification of comment style for cargopacket.* 14 years ago
rubidium 943eb0809f (svn r21848) -Codechange: unification of comment style for cargopacket.* 14 years ago
rubidium 6c9078fd30 (svn r21844) -Codechange: move documentation towards the code to make it more likely to be updates [a-c]. 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 b00a5f1069 (svn r18330) -Cleanup: remove some unneeded includes 15 years ago
rubidium da30e736ca (svn r18330) -Cleanup: remove some unneeded includes 15 years ago
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%. 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 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. 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 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.
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 08ac51fada (svn r17813) -Codechange: unify the CargoPacket related coding style 15 years ago
rubidium fe575367f9 (svn r17813) -Codechange: unify the CargoPacket related coding style 15 years ago
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. 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 fea06c5755 (svn r17809) -Fix: MSVC compilation. 15 years ago
frosch f1d37fab37 (svn r17809) -Fix: MSVC compilation. 15 years ago
rubidium f11cebfe9b (svn r17807) -Codechange: move all 'updates' just after the 'load' constructor of CargoPackets to the constructor call itself 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 62a6e9509b (svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations get removed to CargoPacket. 15 years ago
rubidium 8234230f9e (svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations get removed to CargoPacket. 15 years ago
rubidium f76de82679 (svn r17801) -Codechange: for StationCargoLists the 'loaded_at_xy' does not matter when merging CargoPackets 15 years ago
rubidium be57392ba3 (svn r17801) -Codechange: for StationCargoLists the 'loaded_at_xy' does not matter when merging CargoPackets 15 years ago
rubidium 138e7233bc (svn r17800) -Codechange: first steps into making CargoList a template 15 years ago
rubidium e553983e39 (svn r17800) -Codechange: first steps into making CargoList a template 15 years ago
rubidium 2e766884f6 (svn r17795) -Codechange: split cargolist into one for vehicles and one for stations. 15 years ago
rubidium 760a329622 (svn r17795) -Codechange: split cargolist into one for vehicles and one for stations. 15 years ago
rubidium 1017f4f6a1 (svn r17739) -Cleanup: compiler didn't warn about an unused variable, fonsinchen did 15 years ago
rubidium 79a0aca3bc (svn r17739) -Cleanup: compiler didn't warn about an unused variable, fonsinchen did 15 years ago
rubidium c53682810f (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 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 705615fd91 (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 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 9b045ac7b2 (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 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 80f0df17ba (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 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 d52fa73bb1 (svn r17731) -Codechange: do not cache a boolean which states whether some other variable is not 0. 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 31acc42b21 (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 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