Commit Graph

469 Commits (302ba934716b1de58138fb0def791ef60012dff0)

Author SHA1 Message Date
Michael Lutz 2b0200d429 Codechange: OS-specific data for font search is not used outside of searching. 4 years ago
Patric Stout c6fd6cfd15 Fix: tell the user if a font fails to load and fallback is about to be used
Additionally, tell exactly why the font failed to load, which
glyph was missing from the font. This hopefully helps the user
a bit more in the right direction.
4 years ago
Patric Stout 98400974a9 Codechange: nobody was using "str" parameter, so remove it 4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
Michael Lutz 024a3f6259 Codechange: Use automatic memory management for language pack reading. 4 years ago
Michael Lutz f3326d34e7 Codechange: Use std::string in FIO search path handling. 4 years ago
stormcone ca65f19b03 Feature: Show group name as part of the default vehicle name.
Only if the vehicle is member of a group and does not have a user defined name.
4 years ago
jostephd b1cf79da5b
Feature: new velocity unit "tiles/day" (#8278) 4 years ago
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
glx 8cccb158e9 Fix #7672: more than 32 resolutions may be available 5 years ago
Michael Lutz d2ed426077 Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font. 5 years ago
Michael Lutz 2675762ae9 Add: [Win32] GDI engine for font glyph rendering as a replacement for including FreeType.
Building with FreeType is still possible and will take precedence over the GDI renderer, but
the project files don't include FreeType anymore by default. Combining GDI rendering with ICU
text layout is untested.
5 years ago
glx 8899272614 Codechange: use std::vector for _language_dropdown 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 6 years ago
glx22 427d9d483f
Fix #6564: enforce types of arguments for station name strings (#7419) 6 years ago
Charles Pigott e453572b6a Codechange: Initialise a few variables that -flto seems to think could possibly be uninitialised 6 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 6 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 6 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 6 years ago
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
6 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
6 years ago
Patric Stout 36105841b9 Codechange: ICU_SORT is in reality ICU_I18N (according to their CMake files)
By naming it in a different way, things get a bit confusing.
Especially if we are switching to CMake, which autodetects these
things, we need to use the name the authors of ICU gave it; not
our interpertation of that name.
6 years ago
Patric Stout 52d7e7d45e Codechange: ICU_LAYOUT is in reality ICU_LX (according to their CMake files)
By naming it in a different way, things get a bit confusing.
Especially if we are switching to CMake, which autodetects these
things, we need to use the name the authors of ICU gave it; not
our interpertation of that name.
6 years ago
PeterN 63fe6c6598
Codechange: Make std::stack use std::vector container in string formatting/drawing. (#7305)
This is a very minor performance increase which can add up during operations such
as sorting. Performance impact my be platform/compiler dependent.
6 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
Michael Lutz 32ce1ce347 Add: [OSX] Text layout using the native CoreText API.
By default, the native API will be used instead of ICU, but if ICU is
forced in using configure, it will take precedence.
6 years ago
Michael Lutz 8d7cd6a526 Add: [OSX] Native natural sort implementation. 6 years ago
Charles Pigott e0c0394e37 Fix: Remove various dead or unnecessary assignments 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
PeterN 11ab3c4ea2
Change: Increase cargo type limit to 64. 6 years ago
Michael Lutz 768a31bfe3 Add: [Win32] Text layout using the native Windows Uniscribe library.
Uniscribe is sometimes producing different results compared to ICU, especially
when RTL and LTR content is mixed. Comparing the results to other programs
(like editors or web browsers) leads me to believe that the result are at least
not worse than ICU and possibly better.
6 years ago
Michael Lutz f4394debdc Add: [Win32] Native natural sort implementation. 6 years ago
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 6 years ago
PeterN 3b32075e8a
Add: {PUSH_COLOUR} and {POP_COLOUR} control codes to handle switching colours. (#6737)
This replaces the internal SCC_PREVIOUS_COLOUR swap.
7 years ago
Pavel Stupnikov 9175c349da Fix #6465: Add {NORMAL_FONT} and {MONO_FONT} control codes to GS strings (#6726) 7 years ago
Charles Pigott 19076c24c1 Fix #6690: Compilation with ICU 61 7 years ago
frosch 2bb80d280c (svn r27758) -Change: Increase the maximum number of GameScript texts to 64k, and NewGRF texts to 512k. 8 years ago
frosch a56e2bccd0 (svn r27756) -Codechange: Add StringTab enum 8 years ago
frosch 9ad09627ad (svn r27754) -Codechange: Add GetStringTab(), GetStringIndex() and MakeStringID() to access the structure of StringIDs. 8 years ago
frosch d874cef678 (svn r27602) -Fix [FS#6481]: Compilation with --disable-network. (Deranged) 8 years ago
michi_cc 2b8bb12d62 (svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists. 9 years ago
rubidium 69fac508c3 (svn r27367) -Codechange: make a distinction between the layouting part of ICU (lx) or the sorting/collation part of ICU (i18n) 9 years ago
michi_cc 95cb7c8692 (svn r27288) -Fix: Slow network content GUI in MSVC Debug builds due to repeated string resolving. 9 years ago
rubidium 730773f5f1 (svn r27102) -Fix [FS#6194]: money values would end up wrong in strings when outside of the bounds of a 32 bits integer 10 years ago
frosch 861b9bc85e (svn r27063) -Fix [FS#6172]: Some lists did not use natural string sorting. 10 years ago
rubidium 53e7138a2e (svn r26733) -Fix [FS#6086]: inconsistency in using spaces between number and unit in some strings
Try to follow the SI recommendation to use a non-breaking space between a number and its units (and prefix)
10 years ago
planetmaker 42bc994cce (svn r26657) -Add [FS#6047]: Days in dates are not represented by ordinal numbers in all languages 10 years ago
frosch ebd2d3ccef (svn r26525) -Remove: Screenshot format setting from GUI. 11 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 11 years ago
rubidium 21f991e235 (svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay 11 years ago
rubidium 5b82822c12 (svn r26486) -Codechange: replace a number of snprintfs with seprintf 11 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 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 477c15383d (svn r26239) -Fix: Check that there is space left in the string parameter array, before pushing NewGRF parameters to it. 11 years ago
frosch 5ab39cc651 (svn r26238) -Codechange: Use StringParameters::GetDataLeft to check for left space in the param array. 11 years ago
frosch bc86bf9b12 (svn r26237) -Cleanup: Remove unused SCC_STRING_ID. 11 years ago
rubidium 3bae1522c9 (svn r26063) -Fix (r26062): a few tabs too much 11 years ago
rubidium 3b2a92ea97 (svn r26062) -Fix: beef up checks against invalid data in highscore and language files 11 years ago
fonsinchen 8852d63711 (svn r26041) -Fix: make variable initialization more obvious for humans and compilers. 11 years ago
rubidium a25ecfd982 (svn r26007) -Change: make handling strings coming from game scripts slightly more lenient, i.e. less 'fatal error... must quit' 11 years ago
rubidium d7af679fd6 (svn r26006) -Fix [FS#5804]: Game script showing vehicle on a story book, then the vehicle being removed and eventually being replaced by a non-user vehicle (most likely smoke) causing an assertion to trigger 11 years ago
rubidium f9c9ff6ec3 (svn r25508) -Change: split unit localisation choice into a choice per type of unit, and move it to the advanced settings
-Feature [FS#5482]: have tractive effort in imperial (lbf) and metric (kgf) units
-Feature: have weights and volumes in imperial units (short tons, gallons)
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
rubidium 94a5fe6b92 (svn r25437) -Codechange: rework the FreeTypeSettings structure to make it better grouped 11 years ago
rubidium 13c450a66b (svn r25436) -Codechange: split the font detection code out of the font caching code 11 years ago
frosch 4261b6cc82 (svn r25314) -Fix (r25313): If '0' is the broadest digit, 0 * sum(10^i, i=0..(n-1)) is not the broadest n-digit number.
-Fix [FS#5562]: Proper size-estimation for numbers with n digits.
11 years ago
frosch ce110eed32 (svn r25313) -Fix: Do not assume '8' to be the broadest digit, but test all of them. 11 years ago
planetmaker 3c2d8cc28d (svn r25078) -Add: New plural form to be used by Scottish Gaelic (1,11; 2,12; 3..10, 13..19; other) 12 years ago
rubidium bb225ae39e (svn r24981) -Fix: handle corner case where an encoded string contains too many parameters more gracefully 12 years ago
rubidium b9b34bc898 (svn r24980) -Fix: memory leak in corner case of handling encoded strings 12 years ago
smatz 3a3162865b (svn r24915) -Fix: Several out-of-bounds reads 12 years ago
frosch fea76bbb78 (svn r24910) -Fix: [strgen] Description of plural form 3 was incorrect. 12 years ago
frosch 28f22a46bc (svn r24909) -Codechange: Remove implicit bool -> integer conversion. 12 years ago
zuu 07ffc90bf4 (svn r24908) -Fix [FS#5419]: Allow GSs to pass negative integer string parameters (frosch123) 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch b533523258 (svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations. 12 years ago
yexo 2f042ea198 (svn r24593) -Fix [FS#5333]: crash when a gamescript provided too many parameters to a GSText object 12 years ago
frosch bd17361817 (svn r24523) -Fix: The gender of an industry name is defined by the industry-type part of the name, not by the town-name part, even if it comes first. 12 years ago
frosch c7a536a6d8 (svn r24522) -Codechange: Rename _keep_gender_data to _scan_for_gender_data to reflect what it intends to do instead of what it does. 12 years ago
frosch 2ef319d0fe (svn r24373) -Codechange: Improve descriptions of plural forms. 12 years ago
rubidium 19923e81f9 (svn r24022) -Add: CARGO_LIST control code for strings 13 years ago
michi_cc 89daed858b (svn r23995) -Fix [FS#5079]: Improve rounding when converting display speeds to internal speeds. 13 years ago
michi_cc 76344163c7 (svn r23945) -Fix: Better rounding when converting internal speed to displayed speed. 13 years ago
smatz b5525fd33d (svn r23941) -Add: support for clang 13 years ago
yexo f917ac0a0f (svn r23830) -Revert (r23804) [FS#4986]: while the idea was good, it causes too much trouble 13 years ago
frosch 0011f9ce45 (svn r23805) -Add: {STRING6} and {STRING7}. 13 years ago
yexo 15292fa080 (svn r23804) -Fix: [NewGRF] Make string code 80 more secure by not crashing when it's used in strings where it's not supposed to be used 13 years ago
rubidium f33f9b3920 (svn r23782) -Fix [FS#4965]: crash due to genders used for station name in hangar string of Italian translation 13 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
smatz bcd3f2bb59 (svn r23706) -Codechange: prevent 'unknown command' doxygen errors 13 years ago
alberth 4af8c2d5e1 (svn r23704) -Doc: Doxygen comment fixes and additions. 13 years ago
rubidium c02aabf1b8 (svn r23644) -Fix [FS#4899]: prevent game scripts using StringIDs that are not coming from themselves, so the game script doesn't "accidentally" try to display an invalid string or try to display a town name in from an unknown town name generator 13 years ago
truebrain 102f811d02 (svn r23636) -Add: introduce ScriptText in parameters where it can be used 13 years ago
truebrain b0ac529a6f (svn r23635) -Add: introduce GSText, to allow translating GameScript text, even over network 13 years ago
truebrain 2ae87e7213 (svn r23634) -Add: support language files for GameScript (Rubidium) 13 years ago
truebrain f8203f09ca (svn r23598) -Fix: harden FormatString against abuse 13 years ago
rubidium 50b63c5870 (svn r23585) -Codechange: replace some magic numbers with less magic constants 13 years ago
rubidium c06a3555fb (svn r23478) -Codechange: add a method to copy string parameters *and* its raw strings 13 years ago
rubidium 58423b26d1 (svn r23474) -Codechange: move the declaration error related functions to error.h 13 years ago
rubidium ebb3ad33ff (svn r23472) -Fix [FS#4877]: the monospace font broke the bootstrap GUI's ability to find a font 13 years ago
truebrain 4e09cde649 (svn r23297) -Add: {CARGO_TINY} (Rubidium) 13 years ago
rubidium 462b875b4a (svn r23276) -Codechange: add the answer for the question whether we're looking for monospace fonts in the searcher 13 years ago
rubidium 9512838a5e (svn r23275) -Codechange: allow loading of the monospace (freetype) font at another moment than the other fonts 13 years ago
rubidium 0a4a75b0af (svn r23273) -Codechange: allow passing a MissingGlyphSearcher to CheckForMissingGlyphs (default to the language pack strings) 13 years ago
rubidium 542c61397c (svn r23271) -Codechange: don't repeatedly initialise and free the freetype library 13 years ago
rubidium 5638eaa307 (svn r23270) -Fix (r23267): compile failure without freetype 13 years ago
rubidium b8866be093 (svn r23269) -Codechange: rename some control/string codes/IDs to be more consistent 13 years ago
rubidium 4e1c4f9079 (svn r23267) -Codechange: unify the font name setting of the font cache 13 years ago
rubidium 447884fddb (svn r23265) -Codechange: replace the setfallbackfont callback function with a class to call back 13 years ago
rubidium 881d6d25fd (svn r23242) -Codechange: allow ignoring the sprite font completely when checking whether the font supports a language 13 years ago
rubidium 77b8343d8a (svn r23237) -Fix: ignore special characters, such as the train "character", when determining a fallback font 13 years ago
yexo cbbea5f521 (svn r23044) -Codechange: reorder parameter order so we can make use of the default=0 more often 13 years ago
yexo ffa47a563b (svn r23043) -Fix: allow the use of cases only for those cases where strgen allows them and reset the case_index properly after {DATE} and {DATE_LONG} codes 13 years ago
yexo 42e40a2ab0 (svn r23042) -Codechange: make case_index an explicit parameter of GetStringWithArgs instead of hiding it in the stringid parameter 13 years ago
yexo ac58a850fd (svn r23041) -Codechange: rename slightly unclear parameter name 13 years ago
yexo 47aaf41d40 (svn r23029) -Fix: [NewGRF] support for cases in strings was broken 13 years ago
yexo 1312c35bb6 (svn r23028) -Fix: when using a gender choice list there was still a value popped twice from the newgrf textstack 13 years ago
yexo bac8ce6b41 (svn r23027) -Fix: in some cases NewGRF string arguments were popped twice from the newgrf textstack 13 years ago
rubidium 1f266ec977 (svn r22955) -Fix: guard from reading outside the silly name list 13 years ago
rubidium 525e2c9e73 (svn r22806) -Codechange: store the number of untranslated strings in the language file 13 years ago
frosch 8d3d7b4e01 (svn r22776) -Codechange: Unify the naming of NewGRF string codes; always include the size of the parameter on the stack. (based on patch by Hirundo) 13 years ago
rubidium fb5ecb9499 (svn r22411) -Document: another bunch of bits 14 years ago
frosch f4649c7ce7 (svn r22336) -Fix (r22304): {DECIMAL} printed too many thousand separators. 14 years ago
frosch 70f9a6747e (svn r22304) -Add: {DECIMAL} string code to print decimal fractions. 14 years ago
frosch 2c8b7a980f (svn r22303) -Codechange: Simplify the 'zerofill' parameter of FormatNumber() and reduce usage of magic numbers. 14 years ago
yexo b1901586a0 (svn r22273) -Fix (r22271) [FS#4562]: fix was incorrect 14 years ago
yexo dfd2899a88 (svn r22271) -Fix (r22258) [FS#4562]: cargo en-route display in station was broken 14 years ago
yexo fd74c0f9dc (svn r22270) -Codechange: initialize some temporary arrays on the same line as they're declared
so the size doesn't have to be declared manually. Also detect the size of those
arrays automatically by using a template
14 years ago
yexo 0e17cbc9f8 (svn r22258) -Codechange: introduce a wrapper class to clean up the arguments to FormatString 14 years ago
rubidium 9ce2823959 (svn r22153) -Fix [FS#4536]: The Greek translation didn't work as it breached the 200.000 bytes "limit" for loading language files 14 years ago
alberth 1dbc0a20be (svn r22144) -Codechange: Unify 'while (true)' to 'for (;;)' 14 years ago
rubidium 246f6fe478 (svn r22056) -Fix [FS#4408]: metric and imperial HP are not the same. As imperial HP are used internally, set a conversion rate for metric HP
-Change: make the imperial HP to kW conversions a bit more precise
14 years ago
rubidium 66a8c324db (svn r22054) -Codechange: support for rounding the converted units to their closest integral value instead of flooring 14 years ago
rubidium e76465bab9 (svn r22037) -Codechange: remove some unneeded (hidden) casting 14 years ago
rubidium f4f5de5be1 (svn r22036) -Codechange: rename units to match coding style, and give conversion variables a more descriptive name 14 years ago
rubidium fbb5f87801 (svn r22035) -Codechange: refactor (display) unit conversion to happen at a single place 14 years ago
frosch faa2a26ae1 (svn r21986) -Codechange: Add helper function to test whether an engine is still associated to a GRF. 14 years ago
yexo 0cdb1c78cd (svn r21885) -Fix [FS#4422]: NewGRF string codes 0x80 and 0x81 were broken since the typechecking of string parameters 14 years ago
smatz 656caf16db (svn r21875) -Codechange: indentation of some comments was wrong 14 years ago
rubidium 7efd7e19ed (svn r21845) -Codechange: move documentation towards the code to make it more likely to be updates [d-m]. 14 years ago
rubidium ee87c91e05 (svn r21556) -Fix [FS#4320]: argt wasn't updated when argv was updated due to ARG_INDEX, so there was a mismatch between argt's offset and argv's offset causing trouble when getting the gender of a string 14 years ago
smatz 79681051c8 (svn r21541) -Add: {DATE_SHORT} and {DATE_LONG} can now have cases 14 years ago
yexo 91b043afbc (svn r21446) -Doc: doxygen comments for some functions in strings.cpp 14 years ago
yexo 74d608a67e (svn r21445) -Fix: [NewGRF] fix gender choice lists in newgrf strings.
Change: strgen no longer writes the type of a string for a gender choice list
14 years ago
yexo 475ac872c9 (svn r21444) -Codechange: compute the type of elements in the argv string array on the fly and compare it with the type set by strgen 14 years ago
yexo 23d8ebba3b (svn r21441) -Codechange: check all accesses to the argv array so a bad NewGRF can 'only' trigger an assert but no longer cause an invalid memory read 14 years ago
yexo 12e0f28229 (svn r21440) -Codechange: pass a pointer to just past the end of the argv array around in FormatString and friends 14 years ago
yexo ac0e83a7e2 (svn r21435) -Fix: NewGRF strings that referenced a value that was set by a string command later in the string failed 14 years ago
terkhen 4b944cb13e (svn r21343) -Add: Function that compares strings using case insensitive natural sort. 14 years ago