Commit Graph

49 Commits

Author SHA1 Message Date
Peter Nelson 54be756aae
Codechange: Pass NewGRF strings as std::string_view instead of char *. (#12461) 2024-04-09 08:40:27 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
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.
2023-09-04 09:49:09 +01:00
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
2023-07-19 19:30:14 +02:00
Rubidium aba0d27a28 Codechange: use StringParameters for remapping the NewGRF string control codes 2023-06-13 22:11:21 +02:00
PeterN ac1d042550
Remove: obsolete NewGRF text unprinting. (#10884)
Co-authored-by: Rubidium <rubidium@openttd.org>
2023-06-04 13:14:56 +02:00
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 2023-05-20 16:53:10 +02:00
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
rubidium42 ab9b937ab7 Codechange: [Network] Use std::string to get a NewGRF's name 2021-06-10 21:53:19 +02:00
Michael Lutz c082f570ce Codechange: Use std::string when translating TTDP NewGRF string codes. 2020-05-21 20:02:34 +02:00
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 2020-05-21 20:02:34 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
peter1138 0d13f793f2 (svn r27851) -Fix [FS#6555]: StringID truncation to 16 bits broke string remapping test. 2017-04-09 21:58:07 +00:00
frosch 00e7ceeca4 (svn r26243) -Cleanup: Move TTDPStringIDToOTTDStringIDMapping to newgrf.cpp, it's only used there. 2014-01-12 18:01:16 +00:00
frosch ba1779b978 (svn r26241) -Codechange: Remember the GRFFile which filled the TextRefStack in the TextRefStack. 2014-01-12 18:00:39 +00:00
frosch 477c15383d (svn r26239) -Fix: Check that there is space left in the string parameter array, before pushing NewGRF parameters to it. 2014-01-12 18:00:02 +00:00
yexo fab78a7bf2 (svn r23812) -Fix [FS#4977] (r23804): custom ActionB messages were broken 2012-01-15 19:29:49 +00:00
yexo bac8ce6b41 (svn r23027) -Fix: in some cases NewGRF string arguments were popped twice from the newgrf textstack 2011-10-12 19:25:52 +00:00
rubidium 7de22e25da (svn r22970) -Fix [FS#4769]: strip newlines from NewGRF strings that should not have newlines, e.g. the NewGRF's name 2011-10-01 20:31:21 +00:00
frosch 5ea8b07e05 (svn r22630) -Cleanup: Remove SwitchToNormalRefStack() and SwitchToErrorRefStack(). 2011-07-03 14:33:17 +00:00
frosch 2158f4f1bf (svn r22628) -Codechange: Allow passing the textref stack values to use to StartTextRefStackUsage() instead of always using the temporary NewGRF registers. 2011-07-03 13:53:42 +00:00
frosch f93c8ce5aa (svn r22627) -Codechange: Rename PrepareTextRefStackUsage() to StartTextRefStackUsage() to make it more obvious that you must call StopTextRefStackUsage() at some point. Also extent the documentation. 2011-07-03 13:49:29 +00:00
yexo ac0e83a7e2 (svn r21435) -Fix: NewGRF strings that referenced a value that was set by a string command later in the string failed 2010-12-08 13:44:01 +00:00
rubidium 18f0f1d81d (svn r21216) -Feature: [NewGRF] Allow specifying a "choice list" for plurals 2010-11-16 21:03:39 +00:00
rubidium ddf71db8c2 (svn r21211) -Feature: [NewGRF] Allow specifying a "choice list" for cases and genders 2010-11-16 16:58:19 +00:00
rubidium 0f9c40244a (svn r21209) -Feature: [NewGRF] Allow setting the gender of the current string or select the case of the next substring 2010-11-16 14:00:02 +00:00
rubidium 0500c92003 (svn r21208) -Add: [NewGRF] Mapping information w.r.t. a translation's case and gender names 2010-11-16 12:47:22 +00:00
rubidium e84c52e662 (svn r21207) -Codechange: replace the magic 0x00DE constant with something less magic 2010-11-16 12:35:16 +00:00
rubidium 4965c7dd2b (svn r21202) -Codechange: allow strings with embedded '\0' in GRFText. 2010-11-16 11:34:19 +00:00
rubidium fc75b00992 (svn r21178) -Codechange: pass the language_id to TranslateTTDPatchCodes as well 2010-11-13 19:15:26 +00:00
yexo d3c1be9abd (svn r20249) -Codechange: change the newgrf name/description from a char* to a GRFText* to make translations possible 2010-07-31 09:33:39 +00:00
yexo faf5e19aae (svn r19569) -Fix: possible buffer underflow in newgrf string code 2010-04-06 21:16:36 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium 47bd3ee4ba (svn r17584) -Codechange: split the NewGRF StringID mapping in a 'global' part and a part that's for NewGRF strings 2009-09-20 10:21:00 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium eb0d43aadd (svn r15696) -Codechange: move the NewGRF language ID into the language file instead of maintaining a table in the code. 2009-03-13 00:30:26 +00:00
smatz 799f30c663 (svn r14817) -Cleanup: unify the place where the @file header is placed 2009-01-03 22:20:18 +00:00
peter1138 9ccce57438 (svn r12317) -Fix [FS#1815]: Map string IDs that are embedded from other strings. 2008-02-29 08:48:01 +00:00
peter1138 fb8973c64a (svn r12015) -Fix [FS#1716] (Revert r11422): Patch in FS#1430 avoided instead of fixed the problem. GetStringWithArgs() discards information that SCC_GENDER_LIST needs to work. Now use pointers to retrieve GRF strings, so that GetStringPtr() will work correctly. This is advantageous as now no buffer copy is made when using all GRF strings. 2008-01-29 17:09:00 +00:00
rubidium e21b7634bf (svn r11287) -Codechange: add support for pushing paramaters into NewIndustries' error messages. Patch by Csaboka. 2007-10-17 20:09:16 +00:00
rubidium 240285b8d8 (svn r11145) -Codechange: add support for "decoding" TTDPs string codes wrt to registers 0x100 to 0x10F. 2007-09-22 23:55:34 +00:00
maedhros 109dd33c4a (svn r10114) -Fix: Only load newgrf error messages if the language matches the current
language. Since only one error can be loaded anyway, if the language didn't
match you'd get "Undefined string". Also since we're only loading one language
there's no need to use AddGRFString any more.
2007-06-12 13:22:14 +00:00
belugas dcd510c81f (svn r9385) -Cleanup: doxygen changes. Today, we are exploring the letter N. 2007-03-21 03:06:21 +00:00
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 2007-03-07 11:47:46 +00:00
rubidium 66bbf336c6 (svn r7759) -Merge: makefile rewrite. This merge features:
- A proper ./configure, so everything needs to be configured only once, not for every make.
 - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies.
 - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC.
 - Proper support for OSX universal binaries.
 - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files.
 - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files.

Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.
2007-01-02 19:19:48 +00:00
Renamed from newgrf_text.h (Browse further)