Commit Graph

152 Commits (05b55c4d4349b69026213ce12e1a41af8e87b069)

Author SHA1 Message Date
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
8 months ago
Tyler Trahan 701a61c9af Codechange: Delete date_type.h 10 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 10 months ago
Peter Nelson e4613fc04c Codechange: Allow using more than 65536 NewGRF string IDs.
NewGRF string allocation allowed up to 524288 strings, however stringid was passed as uint16_t which limits to 2^16.
10 months ago
Peter Nelson 3e762af2d1 Change: Replace fixed length _grf_text array with vector.
Additionally reshuffle GRFTextEntry for better alignment.

This removes a mostly-unused static 20MB allocation.
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
12 months ago
Rubidium 1d902a97ce Codechange: move StringParameters to strings_internal.h 1 year ago
Rubidium d4c2043294 Codechange: remove a number of unneeded c_str() calls 1 year ago
Rubidium aba0d27a28 Codechange: use StringParameters for remapping the NewGRF string control codes 1 year ago
PeterN ac1d042550
Remove: obsolete NewGRF text unprinting. (#10884)
Co-authored-by: Rubidium <rubidium@openttd.org>
1 year ago
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
PeterN 61516627ad
Add: NewGRF string code "9A 21" to display force from textstack. (#10782) 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
Rubidium 7088f5b7c7 Codechange: use string/fmt instead of printf for grfmsg 1 year ago
Rubidium a409e4b026 Add: documention to large functions that have too little documentation according to CodeQL 1 year ago
Rubidium 1c0c4637d2 Fix 11ab3c4: [NewGRF] Overflow when determining cargo mask for string code 9A 1E
9A 1E: Print unsigned word as name of a cargo type (translated for GRF version >= 7).
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
rubidium42 ab9b937ab7 Codechange: [Network] Use std::string to get a NewGRF's name 3 years ago
rubidium42 ed9e38221a Cleanup: remove dead code; ++ on ostreambuf_iterator is a no-op 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
Michael Lutz c082f570ce Codechange: Use std::string when translating TTDP NewGRF string codes. 4 years ago
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 4 years ago
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Charles Pigott 71a3e83468 Fix: GCC9's warnings about deprecated implicit assignment operators 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
PeterN d2b6176cdf
Add: NewGRF string codes to access PUSH/POP_COLOUR. (#7527) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
peter1138 0d13f793f2 (svn r27851) -Fix [FS#6555]: StringID truncation to 16 bits broke string remapping test. 7 years ago
frosch 2bb80d280c (svn r27758) -Change: Increase the maximum number of GameScript texts to 64k, and NewGRF texts to 512k. 7 years ago
frosch a56e2bccd0 (svn r27756) -Codechange: Add StringTab enum 7 years ago
frosch f4da8ece0c (svn r27755) -Codechange: Move TAB_SIZE to strings_type.h and use it consistently. 7 years ago
frosch 1a92b0c7c3 (svn r27707) -Fix: Make the result of NewGRF's CARGO_NAME string code reliably print 'Nothing', if an invalid type is provided. 8 years ago
frosch b25afb239a (svn r27706) -Feature: [NewGRF] String command 9A 1E to print the name of a cargo type. 8 years ago
frosch 9119ebe2ce (svn r26713) -Fix (r23027): [NewGRF] Parameters to SCC_NEWGRF_PUSH_WORD and SCC_NEWGRF_UNPRINT were not skipped during drawing. 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 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
frosch e9c22ef16f (svn r26244) -Feature: [NewGRF] Add StringCodes 9A 1B, 9A 1C and 9A 1D to display amounts of cargo. 11 years ago
frosch 00e7ceeca4 (svn r26243) -Cleanup: Move TTDPStringIDToOTTDStringIDMapping to newgrf.cpp, it's only used there. 11 years ago
frosch 4f419b8f84 (svn r26242) -Codechange: Use GRFFile that filled the TextRefStack to translate StringIDs from the TextRefStack, instead of passing stuff via global vars. 11 years ago
frosch ba1779b978 (svn r26241) -Codechange: Remember the GRFFile which filled the TextRefStack in the TextRefStack. 11 years ago
frosch 477c15383d (svn r26239) -Fix: Check that there is space left in the string parameter array, before pushing NewGRF parameters to it. 11 years ago
rubidium c29f18f357 (svn r26065) -Fix: possible dereference of NULL for texts from game scripts 11 years ago
rubidium b3e93d6520 (svn r26057) -Fix: a number of possibly uninitialised variables 11 years ago
rubidium 7c0f34130c (svn r25454) -Remove/Fix/Cleanup: SETX(Y) does not work at all with other than default fonts, so get rid of it 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago