Commit Graph

203 Commits (4280c413a6a409ecc6fd37f75226da5db0e26591)

Author SHA1 Message Date
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 a30ac59fd2 (svn r17837) -Fix (r17812): comment erroneously mentioned feeder share 15 years ago
rubidium a4d054eabc (svn r17837) -Fix (r17812): comment erroneously mentioned feeder share 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 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 75c375de54 (svn r17814) -Codechange: there's no need to invalidate the cache in the constructor of a CargoList; the list is empty, the CargoList is calloc-ed so all caches are 0. 15 years ago
rubidium 7f6d9d8c11 (svn r17814) -Codechange: there's no need to invalidate the cache in the constructor of a CargoList; the list is empty, the CargoList is calloc-ed so all caches are 0. 15 years ago
rubidium fe575367f9 (svn r17813) -Codechange: unify the CargoPacket related coding style 15 years ago
rubidium 08ac51fada (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
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
frosch f1d37fab37 (svn r17809) -Fix: MSVC compilation. 15 years ago
frosch fea06c5755 (svn r17809) -Fix: MSVC compilation. 15 years ago
rubidium 756f813040 (svn r17808) -Codechange: remove write 'access' from all of CargoPacket's variables 15 years ago
rubidium e613107e02 (svn r17808) -Codechange: remove write 'access' from all of CargoPacket's variables 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 f11cebfe9b (svn r17807) -Codechange: move all 'updates' just after the 'load' constructor of CargoPackets to the constructor call itself 15 years ago
rubidium 93cc3e6106 (svn r17806) -Codechange: split CargoPacket's 'afterload' to a separate function 15 years ago
rubidium 4ad30fecde (svn r17806) -Codechange: split CargoPacket's 'afterload' to a separate function 15 years ago
rubidium 8234230f9e (svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations get removed to CargoPacket. 15 years ago
rubidium 62a6e9509b (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 f76de82679 (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 138e7233bc (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 2e766884f6 (svn r17795) -Codechange: split cargolist into one for vehicles and one for stations. 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 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 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 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 96d098e120 (svn r17734) -Fix (r17732): broke the assumption that 'this->packets == this', which broke loading old savegames. Now remove the (need for the) hack that needed that assumption. 15 years ago
rubidium 446363aac4 (svn r17734) -Fix (r17732): broke the assumption that 'this->packets == this', which broke loading old savegames. Now remove the (need for the) hack that needed that assumption. 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 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 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 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 27d62a7ec6 (svn r17731) -Codechange: do not cache a boolean which states whether some other variable is not 0. 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 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 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 10428de7a3 (svn r17727) -Codechange: some coding style and documentation fixes 15 years ago
rubidium 1e2dc25582 (svn r17727) -Codechange: some coding style and documentation fixes 15 years ago
rubidium 9b94441eb8 (svn r17721) -Codechange: replace a magic number with a constant 15 years ago
rubidium e0e5eae1ee (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 5f59d0c5b4 (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 310465da07 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 15 years ago
rubidium e8ddf001c8 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 15 years ago
rubidium 99d46e0ad7 (svn r17248) -Fix: add GPL license notice where appropriate 15 years ago
rubidium 7fbc33dae1 (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
smatz 2a430d981f (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 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
rubidium 985608c713 (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 b178a94c19 (svn r16459) -Codechange: move definition of several cargopacket accessors to header file 15 years ago
smatz 3793b966c3 (svn r16380) -Codechange: rename pool.hpp to pool_type.hpp 15 years ago
smatz 56a7b70591 (svn r16380) -Codechange: rename pool.hpp to pool_type.hpp 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 62a7948af0 (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 7eb14aa49f (svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index 15 years ago
smatz 04723b240e (svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index 15 years ago
smatz 769de62daf (svn r16338) -Codechange: split loading of references to two phases
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
15 years ago
smatz 570af0ce44 (svn r16338) -Codechange: split loading of references to two phases
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
15 years ago
smatz cf986c3099 (svn r16326) -Codechange: replace GetPoolItemPoolSize() by PoolItem::GetPoolSize() 15 years ago
smatz ed1e54bd84 (svn r16326) -Codechange: replace GetPoolItemPoolSize() by PoolItem::GetPoolSize() 15 years ago
smatz d495dc5dbc (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 15 years ago
smatz 6221d74644 (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 15 years ago
celestar 3546b74e93 (svn r14137) -Codechange: Remove a now unused member of CargoPacket 16 years ago
celestar 7e8c7dfcbf (svn r14137) -Codechange: Remove a now unused member of CargoPacket 16 years ago
rubidium 3596b61c58 (svn r14101) -Cleanup (r14083): leftover friend. 16 years ago
rubidium c98c3122b5 (svn r14101) -Cleanup (r14083): leftover friend. 16 years ago
rubidium 1ce0b03bf0 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
bjarni 63fea0790b (svn r12940) -Fix [FS#1974](r12913): [autoreplace] a vehicle backup should include the cargo packets in the vehicle as well 16 years ago
bjarni dbf6e344a4 (svn r12940) -Fix [FS#1974](r12913): [autoreplace] a vehicle backup should include the cargo packets in the vehicle as well 16 years ago
rubidium c5ac9ee678 (svn r12815) -Codechange: reshuffle some variables in the CargoPacket struct saving 4 of 36 bytes with a 32 bit compiler and 8 of 48 bytes on 64 bit compiler per cargo packets. There are generally more cargopackets in game than vehicles. 16 years ago
rubidium cea98ea0e6 (svn r12815) -Codechange: reshuffle some variables in the CargoPacket struct saving 4 of 36 bytes with a 32 bit compiler and 8 of 48 bytes on 64 bit compiler per cargo packets. There are generally more cargopackets in game than vehicles. 16 years ago
rubidium c51b81c247 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h. 16 years ago
rubidium 2edd403656 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h. 16 years ago
rubidium eba67a3b8f (svn r12468) -Codechange: move some type related stuff from station.h (and openttd.h) to station_type.h. 16 years ago
rubidium 58e6e75320 (svn r12468) -Codechange: move some type related stuff from station.h (and openttd.h) to station_type.h. 16 years ago
peter1138 aefb78fcdf (svn r12120) -Cleanup: const-ify parameters when checking for same cargopacket source. 17 years ago
peter1138 592e22cc3a (svn r12120) -Cleanup: const-ify parameters when checking for same cargopacket source. 17 years ago
glx bba1a62db1 (svn r11914) -Documentation: fix some @file statement 17 years ago
glx b7f50533c2 (svn r11914) -Documentation: fix some @file statement 17 years ago
rubidium c004cc1fd9 (svn r11801) -Codechange: remove some unneeded includes from some header files. 17 years ago
rubidium 6c954cad5f (svn r11801) -Codechange: remove some unneeded includes from some header files. 17 years ago
rubidium 3074bca136 (svn r11680) -Codechange: refactor more out of openttd.h and functions.h. 17 years ago
rubidium 6a9e77e079 (svn r11680) -Codechange: refactor more out of openttd.h and functions.h. 17 years ago
rubidium 5ff81aca18 (svn r11009) -Codechange: unvirtualise IsValid as that isn't needed with templates. This gives up to 10% performance increase in games with lots of vehicles. 17 years ago
rubidium 8a6cc3aa10 (svn r11009) -Codechange: unvirtualise IsValid as that isn't needed with templates. This gives up to 10% performance increase in games with lots of vehicles. 17 years ago
rubidium 6edf2d3a1b (svn r11002) -Codechange: unhackify the cargo packet list saving (a little). 17 years ago
rubidium ac5fde61fb (svn r11002) -Codechange: unhackify the cargo packet list saving (a little). 17 years ago
rubidium e7d2918c0c (svn r10749) -Codechange: use the generic pool item class as super class for cargo packets, which results in a nice reduction of code duplication. 17 years ago
rubidium cab6275511 (svn r10749) -Codechange: use the generic pool item class as super class for cargo packets, which results in a nice reduction of code duplication. 17 years ago
rubidium cbd3aca30c (svn r10743) -Fix: some typos introduces by copy-pasting. 17 years ago
rubidium 435d39f8fb (svn r10743) -Fix: some typos introduces by copy-pasting. 17 years ago
rubidium 926d103482 (svn r10358) -Codechange: remove the cargopacket leakchecker as it never asserted in almost a week of stresstesting, so I'm pretty sure all cornercases are tested by now. 17 years ago
rubidium 67f46b40ab (svn r10358) -Codechange: remove the cargopacket leakchecker as it never asserted in almost a week of stresstesting, so I'm pretty sure all cornercases are tested by now. 17 years ago
rubidium fc201d4ad8 (svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it. 17 years ago
rubidium e5c352818d (svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it. 17 years ago