Commit Graph

487 Commits (a886bd96661a602f813424021b964da5c0e240d5)

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 4 months ago
Rubidium 4c117dd2d8 Revert #11993: new number format system does not and cannot work for CJK languages
There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b93
360fe8b0b6
1aa9a5c0ab
59f56941e5
7e2eefb91f
b741b2ba6f
609d0071d5
9f8fd80112
a253205b93
819c6c756e
4 months ago
Rubidium 5d2e6e4efa Fix #12148, fca8166: Do not draw decimals when number of digits is 0 4 months ago
Rubidium 360fe8b0b6 Fix a253205: division by zero when attempting to format some short currencies 4 months ago
Rubidium 7e2eefb91f Cleanup: Remove digit group separators from strgen and languages 5 months ago
Rubidium b741b2ba6f Feature: Fully user configurable number format and abbreviations 5 months ago
Rubidium 609d0071d5 Change: Remove saving of digit group and decimal separator configurations from the savegame 5 months ago
Rubidium 9f8fd80112 Feature: Fully customisable number abbreviations per translation 5 months ago
Rubidium a253205b93 Feature: Fully customisable number format per translation 5 months ago
Rubidium 819c6c756e Codechange: Add support for number format and abbreviations pragmas/attributes to strgen 5 months ago
Rubidium fca8166087 Codechange: Simplify FormatNumber by moving out zero fill and decimal support 5 months ago
Rubidium a44bd81280 Codechange: Move determining the decimal separator to a separate function 5 months ago
Patric Stout f1842f9144
Add: {CURRENCY_SHORT} only did k / m suffix. Add bn / tn and make translatable. (#11921)
64bit numbers are REALLY large, but our compact method was build
for 32bit numbers. Extend it to 64bit.
5 months ago
frosch 28c83089f6 Codechange: Remove TKM string code. 5 months ago
Peter Nelson 6d276698b6
Fix: Memory leak in ICUParagraphLayout::NextLine() (#11895)
This function calls icu::BreakIterator::createLineInstance() but does not clean up after it.

Instead use a static instance that is cloned (for thread-safety) and deleted as necessary.
5 months ago
Tyler Trahan fd9e72a7e7
Feature: Use real-time "wallclock" timekeeping units (#11341) 5 months ago
Rubidium ee00c7b159 Codechange: use TO_LE16 directly when reading language file offsets 5 months ago
Patric Stout fd073a2810 Remove: replace custom span with std::span 6 months ago
Jonathan G Rennison 4b48d3b5fe
Fix: String gender scan with SCC_INDUSTRY_NAME (#11697) 6 months ago
Peter Nelson 7482f71692
Change: Don't handle 'missing' string parameters as 0. (#11673)
If not enough parameters are supplied for a string, then a value of 0 was used, which could result in incorrect information being displayed.

Instead, throw an exception and include an error in the string.
6 months ago
Jonathan G Rennison 5db9266f4b Change: Allow STRING/STRINGN to use all remaining parameters in game script mode 6 months ago
Jonathan G Rennison e2a79f0f32 Codechange: No longer advance parent offset in StringParameters parent mode
Add method to manually advance offset
6 months ago
Peter Nelson 33ff64ef74
Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 6 months ago
Jonathan G Rennison 97b86b7147
Codechange: Use MakeParameters with GetNextParameter in FormatString (#11583)
Instead of StringParameters subspan, to avoid GSs being able to
cause subspan boundary assertion failures
7 months ago
Jonathan G Rennison 1de1af08b9
Codechange: Replace AllocatedStringParameters with ArrayStringParameters (#11452)
All uses of AllocatedStringParameters are with a compile-time fixed
constant.
Use of a dynamically allocated buffer on the heap is unnecessary and
increases overhead, particularly due to frequent use as a temporary.
8 months ago
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
8 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 8 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 10 months ago
Rubidium 6635f809dd Fix #11181: attempting to read string as int triggers assertion 11 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
12 months ago
Rubidium 968de827d6 Fix #11108, e2f583a: missing argument for SCC_CARGO_SHORT formatting 1 year ago
Rubidium 2ec4ea2b99 Codechange: use the string temporaries for game script strings 1 year ago
Rubidium 3e488465f8 Codechange: allow string temporaries in a StringParameter 1 year ago
Rubidium b2edf82b69 Cleanup: remove unneeded CopyOutDParam version with StringID 1 year ago
Rubidium 4654b2b0aa Codechange: separate integer and string usage in StringParameters 1 year ago
Rubidium 7ed90a859f Codechange: function to check whether string parameters have changed since the backup 1 year ago
Rubidium 05ef3f0998 Cleanup: remove old backup/restore of string parameters 1 year ago
Rubidium 2687704afc Codechange: introduce new type and functions for StringParameter backups 1 year ago
PeterN c3fbe7bea8
Cleanup: Use FS enum instead of magic numbers. (#11088) 1 year ago
Rubidium 75a22a1c83 Codechange: move from GetIntXY to GetNextParameter<XYY> 1 year ago
Rubidium e7937efb01 Codechange: add clearer named function to get the next (string) parameter 1 year ago
Rubidium 4e9a871718 Codechange: merge multiple string parameter arrays to single array of structs 1 year ago
Rubidium fa8c50758b Codechange: replace memcpy when copying DParams 1 year ago
Rubidium 7a785a4224 Codechange: simplify StringParameters now type cannot be nullptr 1 year ago
Rubidium 428333aeba Codechange: let AllocatedStringParameters allocated types too 1 year ago
Rubidium 9f3254b72a Fix b1fb209: build failure due to removed parameter 1 year ago
glx22 b1fb209bed Add: {COLOUR} control code to allow colour changes at runtime 1 year ago
Rubidium 88138c55f8 Codechange: make offset protected and guard against invalid offsets 1 year ago
Rubidium 9c3c90effa Codechange: rename ClearTypeInformation so it can be used for preparing for the next run 1 year ago
Rubidium 01abcdfcac Codechange: make StringParameters#next_type only writable from outside the class 1 year ago