Peter Nelson
e5aed24395
Codechange: Use std::array for industry tile cargo acceptance. ( #11498 )
...
This avoids use of memcpy/memset to copy or fill.
10 months ago
Tyler Trahan
235ac0bceb
Codechange: Reword rail/road type label constants ( #11451 )
11 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.
11 months ago
Rubidium
c6411168d8
Cleanup: missing spaces before continuation * in some comments
11 months ago
Rubidium
37f84b7372
Codechange: replace x.size() != 0 with !x.empty()
12 months ago
Rubidium
f16399f4c9
Codechange: replace x.size() > 0 with !x.empty()
12 months ago
Rubidium
c9276c2959
Codechange: replace x.size() == 0 with x.empty()
12 months ago
Peter Nelson
bc8e26f4e7
Codechange: Simplify usage of GRFFile cargo_map. ( #11349 )
12 months ago
Peter Nelson
9602de474d
Codechange: Use iterators and/or range-for on cargo related loops.
12 months ago
Peter Nelson
5869f790d8
Fix: Check for engine variant loops during NewGRF initialization. ( #11343 )
...
Invalid NewGRFs could set up an engine variant loop that never ends. This
was checked for in some places that evaluated variants, but not all. In
most cases this would result in the engines not appearing, but could
potentially cause an infinite loop and crash.
Instead, during NewGRF initialization detect loops and remove invalid
variants before setting display flags.
1 year ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
1 year ago
PeterN
acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. ( #11287 )
1 year ago
Tyler Trahan
77173a6a10
Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes
1 year ago
Patric Stout
299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed ( #10761 )
1 year ago
Patric Stout
b7acf9e50e
Codechange: use TimerGameCalendar::Year and friends when working with years ( #11188 )
1 year ago
Tyler Trahan
c7b51a8c3a
Codechange: Use proper date types in various places ( #11177 )
1 year ago
Jonathan G Rennison
f31a25cd59
Change: Do not allow mixing road/tram types in powered road type list ( #11148 )
...
Road/tram property 0F
1 year 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
1 year ago
rubidium42
9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days ( #11112 )
1 year ago
Rubidium
18a31cca7c
Codechange: do not make a string valid in place, to then copy it
1 year ago
PeterN
509471f7f8
Codechange: Use std::optional for GRFConfig::GRFError ( #11066 )
...
This changes the semantics from "object pointer ownership" to "optional object", and simplifies copies.
1 year ago
Peter Nelson
9dd9b8ec74
Fix #11054 : Prevent translation of currency codes.
...
Most languages stick with the 3-letter latin currency codes in the name
string, however some translations are... clever... and use the currency
symbol instead. Whilst this may look nice, it can cause issues with fonts
as some scripts have a specific limited set of fonts which do not include
these symbols.
Instead, hard code the currency code list and add it when drawing the
currency name.
1 year ago
Rubidium
d4c2043294
Codechange: remove a number of unneeded c_str() calls
1 year ago
PeterN
0b663f709d
Codechange: Sprite mapping for objects doesn't involve cargo types. ( #10905 )
...
Objects have a default sprite group and an optional purchase list sprite
group. There is no need to pretend that these are cargo IDs.
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
6b87fe6540
Codechange: Use std::array for GRF(File|Config) parameters.
...
This simplifies comparison, copying and assignment operations.
1 year ago
Peter Nelson
c23aae96a2
Codechange: Use std::array instead of C array for automatic deep-copies.
1 year ago
Peter Nelson
f14479d27d
Codechange: Use std::optional for GRF Parameter list.
1 year ago
Peter Nelson
c38df2d589
Codechange: Use std::map instead of custom SmallMap.
1 year ago
Peter Nelson
83f2ad500e
Codechange: stdarg.h include not needed as cstdarg is included.
1 year ago
Peter Nelson
56085be9bd
Codechange: Move includes for common STL headers to stdafx.
1 year ago
Peter Nelson
0b72297d57
Feature: Increase number of stations/roadstops per NewGRF.
1 year ago
Peter Nelson
bc7dfd7b46
Add: Station property 1C/1D to set name/classname.
...
These are an alternative to the original "generic" C4xx/C5xx method,
which can only assign strings to IDs up to 256.
1 year ago
Peter Nelson
d6f35a9fd6
Change: Add placeholders for unimplemented NewGRF station properties.
1 year ago
Peter Nelson
e5c9a3e527
Change: Read Action 3 IDs as extended-bytes for all features.
...
This can be done because previous the value 0xFF (which indicates an
extended byte) was reserved for this purpose. Other features which may
not have mentioned reserving 0xFF do not allow this many IDs anyway.
This makes Action 3 consistent across all features. The allowable limits
for each feature do not change.
1 year ago
Peter Nelson
10baecd81f
Change: Make Action 3 debug messages more consistent.
1 year ago
Rubidium
3901ef9760
Codechange: use std::string for the GRF filenames
1 year ago
Rubidium
f78aa1e720
Codechange: use std::unique_ptr to manager GRFErrors in GRFConfig
1 year ago
Tyler Trahan
6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar ( #10753 )
1 year ago
Tyler Trahan
930f0a16d8
Codechange: Define Date/Year/Month/Day within TimerGameCalendar class
1 year ago
Peter Nelson
20d2558f1b
Fix: Clear church/stadium flags when copying house substitute specs.
1 year ago
Peter Nelson
64782cf005
Fix #10627 : Houses subsitute specs should only be copied on first definition.
...
Before #10627 , substitue specs were always copied despite redefinition.
1 year ago
PeterN
7535eb65e2
Codechange: Use vector instead of mallloc/free for Action 6 data. ( #10713 )
1 year ago
Rubidium
f74e26ca7e
Codechange: replace error/usererror printf variant with fmt variant and rename
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
Rubidium
7b539fa7c9
Fix: fmt's {:#04X} yields '0X00', not '0x0000'
...
Technically the 0X vs 0x is not a big problem, just not pretty. However, the
length also including the 0x results in unexpected behaviour, so it probably
better to not use it.
1 year ago
PeterN
27b4b5d0a0
Codechange: Make GRF temporary engine data a vector. ( #10685 )
...
This replaces manual C-style realloc/memset/free.
1 year ago
Rubidium
7088f5b7c7
Codechange: use string/fmt instead of printf for grfmsg
1 year ago