Commit Graph

174 Commits (2fd9096070cf5af8548dadafdaf32e49909f6a8b)

Author SHA1 Message Date
Peter Nelson 2fd9096070
Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
4 months ago
Peter Nelson 60dcf3b5e2 Codechange: Rename TownEffect to TownAcceptanceEffect.
This makes it clearer that TownEffect only affects acceptance behaviour.
4 months ago
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 4 months ago
Peter Nelson c0ab436077
Codechange: Store Colours in Colours type. (#11625)
This reduces casts, some magic numbers, and introduces a bit of type-safety.
4 months ago
Rubidium 4cc97e04e6 Fix #11801, 51f1e93: CalcClosestTownFromTile needs the kd-tree to be valid 5 months ago
Rubidium d5518f6263 Fix 36a0818: TTO did not save company shares 5 months ago
Rubidium 51f1e939e8 Change: be more resilient against missing towns in old loader 5 months ago
Rubidium f5b320e502 Codechange: use range based for loop, instead of tile numbers 5 months ago
Rubidium b09a4384d9 Codechange: remove need to use separate array for old_map3 5 months ago
Peter Nelson 934545a674
Fix: Calculation of initial engine age was inaccurate. (#11660)
Engine age in months was calculated as the difference in days / 32, instead of the actually difference in months. This would result in engines being artificially younger if a game was started at a later date.
5 months ago
Peter Nelson 33ff64ef74
Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 5 months ago
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
7 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Patric Stout d1a0ca67be
Codechange: simplify splitting of CargoPacket (#11286) 9 months ago
Patric Stout 7e3cdbaf62 Fix: mark next_station as INVALID_STATION when loading from older savegames 9 months ago
Patric Stout e6c02ebee6
Fix b0e73277: cargodist information got lost when splitting of cargo (#11280)
During b0e73277 we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.
9 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 9 months ago
Patric Stout b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 9 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
11 months ago
rubidium42 9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days (#11112) 11 months ago
PeterN 584faaf064
Change: Reorganise industry accept/produce arrays. (#10853)
Use a array of struct for each cargo instead of an array for each statistic.
This makes iterating for acceptance and production much simpler.
pct_transported is now calculated when needed.
1 year ago
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Michael Lutz 72c7536325
Codechange: Use a dedicated variable for disaster vehicle action state. (#10798) 1 year ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 1 year ago
Patric Stout 36a0818bc5
Remove: buying/selling/owning company shares (#10709) 1 year ago
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 1 year ago
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Patric Stout ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
1 year ago
Peter Nelson 65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 1 year ago
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Rubidium 7cdc23fd64 Codechange: hide the map's size related fields in the Map structure 1 year ago
Rubidium 953445a5ac Codechange: use MakeSea/AllocateMap in the oldloader instead of MemSetT 1 year ago
Peter Nelson cbf48c4dd9 Change: Add extra random seed to StartupEngines().
This means that calling reset_engines will rerandomise introduction dates
and reliability.

Probably not necessary.
1 year ago
Peter Nelson 3485709f53 Add: Additional vehicle flags to control variants. 1 year ago
dP 548f0496a9
Change: Make _tick_counter 64bit to avoid wrapping (#10035) 2 years ago
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2 years ago
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.
2 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 3 years ago
Michael Lutz c558936ec3
Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. (#8356) 4 years ago
glx 9116b22386 Fix #8011, f5381798: Dock tile in TTD savegame was only 2 bytes 4 years ago
glx ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 5 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx fa9769f81a Codechange: Replace FOR_ALL_DEPOTS with range-based for loops 5 years ago