Commit Graph

469 Commits

Author SHA1 Message Date
Peter Nelson
427ab4dd24 Codechange: Replace color with colour. 2025-12-08 05:00:32 +05:00
Peter Nelson
de9984f379 Codechange: Prefer string equality instead of comparison. (#14727) 2025-12-08 04:39:16 +05:00
Peter Nelson
09858583be Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-12-08 04:32:55 +05:00
Rubidium
c5d910a9aa Codechange: make all Providers fully const (Font/Screenshot/Sound) 2025-12-08 04:27:19 +05:00
Peter Nelson
840a024cb3 Change: Prefer normal/medium weight font in FontConfig fallback detection. (#14672)
This way it behaves similar to Windows.
2025-12-08 04:21:59 +05:00
Peter Nelson
f542343589 Codefix: Use of nullptr instead of std::nullopt. (#14590) 2025-12-08 03:07:08 +05:00
Rubidium
7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter Nelson
e6323e6760 Fix: File/directory titles not updated if language is changed. (#14542) 2025-08-28 17:42:00 +01:00
Loïc Guilloux
2d60b9d7b9 Codefix: [macos] variable length array warnings with clang-17 (#14521) 2025-08-17 19:47:31 +02:00
Peter Nelson
e1a50abcbb Codechange: Move fallback font detection to FontCacheFactory.
Provides a standard interface instead of relying on defines.
2025-08-07 19:38:00 +01:00
Peter Nelson
140f2b291a Codechange: Use ProviderManager interface to register FontCache factories.
This removes use of #ifdefs to select the appropriate loader, and also replaces FontCache self-registration.
2025-08-07 19:38:00 +01:00
Peter Nelson
0dc40877fd Codechange: Initialise/reset font cache with FontSizes bitset. (#14448)
Instead of choosing either "Normal/Small/Large" or "Monospace", use an EnumBitSet to allow any combination.
2025-07-18 18:23:28 +01:00
Peter Nelson
b2d69ae606 Codechange: Use AutoRelease to simplify cleanup after FontConfig calls. (#14354) 2025-06-11 21:24:31 +01:00
Peter Nelson
c702e05517 Codechange: Replace C-casts for FontConfig with helper functions. (#14349)
Add `ToFcString()` and `FromFcString()` to remove C-style casts and make reinterpret_casts safer and clearer.
2025-06-10 17:11:22 +01:00
Rubidium
f2b48bad79 Codechange: remove last (hidden) users of memset 2025-05-11 06:07:01 +02:00
Rubidium
a48a5f0cc6 Codechange: replace memcpy with std::copy_n 2025-05-10 16:50:58 +02:00
Rubidium
f8aceb6c37 Codechange: use value initialisation over memset 2025-05-09 17:20:41 +02:00
Rubidium
8f1e94c546 Codechange: use C++ initialisation over MemSetT 2025-05-06 20:03:35 +02:00
frosch
b20b6da937 Codechange: The compiler ensures static variables are initialised only once, no need to track that manually. 2025-05-06 18:29:41 +02:00
frosch
75a775e59d Codechange: Make GetCurrentLocale return a std::string instead of a reference to a static buffer.
For win32 this is even a fix, because the static buffer was only updated once. Later calls discarded the determined locale.
2025-05-06 18:29:41 +02:00
frosch
61cec33be2 Codechange: Add 'const' to static variables, which are only initialised once. 2025-05-06 18:29:41 +02:00
Rubidium
6189bbc45a Codechange: return std::string_view for convert_from_fs 2025-05-04 15:32:52 +02:00
Rubidium
afc1e76575 Codefix: StartNewThread uses char* after returning 2025-05-04 14:05:15 +02:00
Rubidium
5e3c7c4146 Codechange: char* -> char * 2025-05-04 10:43:56 +02:00
frosch
8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Rubidium
26a4da9b01 Codechange: replace last strncmp uses 2025-05-03 21:51:01 +02:00
frosch
bb767608de Codechange: Pass SpriteType as direct parameter to SpriteEncoder::Encoder. 2025-05-03 18:43:20 +02:00
Rubidium
d037dbb42a Codechange: use std::string_view for locales 2025-05-03 15:58:14 +02:00
Rubidium
c420ba349d Codechange: use std::string_view over char* 2025-05-02 23:12:43 +02:00
Rubidium
fbe80f31fe Codechange: replace char* in GetOptData with std::string_view 2025-04-30 23:49:06 +02:00
frosch
9cf36dac39 Codechange: Use data() instead of c_str(), if no NUL termination is needed. 2025-04-30 19:33:56 +02:00
Rubidium
708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
Rubidium
f4ad614285 Codechange: use std::string_view for FS2OTTD and OTTD2FS 2025-04-29 22:33:32 +02:00
Rubidium
ef71ce0a9d Codechange: return std::string_view for Textbuf::GetText() 2025-04-29 22:15:49 +02:00
frosch
fda93b6f35 Codechange: Add format_append as short-hand to format_to + back_inserter. 2025-04-29 20:26:23 +02:00
Rubidium
af25eecc15 Codechange: use const for std::string_view where appropriate 2025-04-29 10:15:18 +02:00
Rubidium
360670626b Codechange: replace char* with std::string_view 2025-04-28 21:31:12 +02:00
Rubidium
781187b8a6 Codechange: replace C-style strings with std::string_view related to strings functions 2025-04-27 17:57:42 +02:00
Rubidium
86039a5b69 Codechange: make SetDebugString use C++-style strings and function types 2025-04-25 19:04:22 +02:00
frosch
461b73e21b Codefix: stdafx.h and safeguards.h should be the first and last include in every source file, and not appear in any header file. 2025-04-20 22:06:18 +02:00
frosch
e89be12ebb Codechange: Rename _library to _ft_library. 2025-04-11 22:11:28 +02:00
frosch
9229956f04 Codechange: Replace strcasestr with StrContainsIgnoreCase. 2025-04-09 17:19:11 +02:00
frosch
f640daee4c Codechange: No need for Utf8Consume and Utf8Encode, if only ASCII characters are checked. 2025-04-03 18:43:41 +02:00
frosch
83401ad5e2 Codechange: Use Utf8View::iterator in StringIterator. 2025-04-03 18:43:41 +02:00
frosch
25005cff16 Codefix: std::string_view::data() is not necessarily null terminated. (#13891) 2025-03-25 20:32:19 +01:00
Rubidium
2000cea235 Codechange: initialise instance members 2025-03-09 20:41:03 +01:00
Rubidium
02f040b22a Codechange: remove unused alloc_func.hpp includes 2025-02-24 20:00:19 +01:00
Jonathan G Rennison
d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Jonathan G Rennison
23dc393822 Codechange: Compile fmt internals in a separate translation unit (#13527)
Instead of defining FMT_HEADER_ONLY to include fmt internals
in the headers included by all fmt-using translation units.
2025-02-11 20:11:50 +01:00
Patric Stout
86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00