Commit Graph
77 Commits
Author SHA1 Message Date
Peter NelsonandPeter Nelson 5aae8e2d64 Codechange: make Subdirectory a scoped enum 2026-04-05 21:46:07 +01:00
Rubidiumandrubidium42 7aecc268b6 Codechange: add missing @param and @return 2026-02-16 17:19:09 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 06b830dc07 Codechange: Prefer string equality instead of comparison. (#14727) 2025-10-24 21:30:03 +02:00
Rubidiumandrubidium42 ec79ceb2be Codechange: use std::string_view for sq_pushstring 2025-05-03 23:02:09 +02:00
Peter NelsonandGitHub bd1a3fe0b7 Change: Remove the limit of 20 parameters to a Script Text string. (#14193) 2025-05-03 18:33:29 +01:00
Rubidiumandrubidium42 04a6a55e94 Codechange: replace StripTrailingWhitespace with StrTrimView 2025-05-03 15:57:53 +02:00
froschandfrosch 36ce1f890a Codechange: Remove c_str, if std::string_view is already accepted. 2025-04-30 19:33:56 +02:00
Rubidiumandrubidium42 708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
Rubidiumandrubidium42 f4ad614285 Codechange: use std::string_view for FS2OTTD and OTTD2FS 2025-04-29 22:33:32 +02:00
Peter NelsonandPeter Nelson 341cdbc16b Codechange: Pass Script engine by reference. 2025-04-28 23:08:20 +01:00
froschandfrosch b27fd83ff1 Codechange: Parse translation strings using StringConsumer. 2025-04-14 18:10:14 +02:00
froschandfrosch 35cd05b27d Codechange: Rename _current_data to _current_gamestrings_data. 2025-04-11 22:11:28 +02:00
froschandfrosch e2ebf3a0f3 Codechange: Move global strgen state into a single struct. 2025-04-11 22:11:28 +02:00
Rubidiumandrubidium42 023bf38338 Codefix: std::string_view does not accept nullptr 2025-03-31 21:44:44 +02:00
Peter NelsonandGitHub a361841848 Codechange: Store GameStrings as shared_ptr. (#13905)
Uses shared_ptr/weak_ptr as LanguageScanner needs access without ownership.
2025-03-28 17:44:43 +00:00
froschandfrosch d7768f5f51 Codechange: Use more specific integer types than 'int'. 2025-03-24 23:10:13 +01:00
Peter NelsonandGitHub 42eb513897 Codechange: Make use of emplace_back's return value. (#13879) 2025-03-23 18:34:04 +00:00
froschandGitHub 5aa4ad5135 Codechange: Pass unformatted strings from GetStringPtr as std::string_view. (#13871) 2025-03-23 19:23:31 +01:00
Patric StoutandGitHub 86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00
Rubidiumandrubidium42 2929411130 Codechange: introduce ReferenceThroughBaseContainer
This provides support for ConvertibleThroughBase positions passed to the
functions of a container that return a reference, specifically 'at(pos)'
and 'operator[](pos)'.
2025-02-09 15:28:03 +01:00
Rubidiumandrubidium42 fd7a883cbd Codechange: make the StringIndex (within a StringTab) a strong type 2025-01-02 21:19:00 +01:00
Peter NelsonandGitHub 908ee7292b Codechange: Replace all FILE * with FileHandle RAII class. (#12718)
This removes the need to manually ensure all files are closed.
2024-09-16 08:45:26 +01:00
Jonathan G RennisonandGitHub d0b3e0c47e Fix: Crash in GetGameStringPtr when there are no GS strings (#12933) 2024-09-10 13:20:38 +01:00
Peter NelsonandGitHub b4b2fad8e0 Fix #12648: Ensure all uses of std::filesystem::path use native encoding. (#12650)
std::filesystem::path does not expect UTF-8 strings, so they must be converted to native format first (and back to utf-8 after.)
2024-06-09 10:23:47 +01:00
Peter NelsonandGitHub d57bf84196 Codechange: Remove some unnecessary c_str() when passing std::strings. (#12532)
Functions have been updated from `char *` to `std::string` since without removing `c_str()`.
2024-04-18 22:13:13 +01:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Loïc GuillouxandGitHub bf4b669628 Fix: [Script] Improve ScriptText validation (#11721)
The validation is now done in two steps:
 - First we get the list of parameters in the same order they used to be in encoded string
 - Then we validate the parameter types like FormatString would use them while encoding the string
2024-01-18 18:06:30 +01:00
Peter NelsonandPeterN 49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidiumandrubidium42 6d597879d0 Codechange: let ReadLine return a string instead of passing a buffer 2023-06-09 19:58:29 +02:00
Rubidiumandrubidium42 13cdf5fffa Codechange: use std::filesystem::path for the language file's path 2023-06-08 23:20:28 +02:00
Rubidiumandrubidium42 802d6cb509 Fix: memory leak when parsing (strgen) commands by moving to C++ containers 2023-06-02 11:57:23 +02:00
Rubidiumandrubidium42 4f94655cc2 Codechange: use vector/unorder_map over custom implementation 2023-06-02 11:57:23 +02:00
Rubidiumandrubidium42 234a143ee5 Codechange: use std::string for LangString over C-style strings 2023-06-02 11:57:23 +02:00
Peter NelsonandPeterN 83f2ad500e Codechange: stdarg.h include not needed as cstdarg is included. 2023-05-17 10:14:41 +01:00
Rubidiumandrubidium42 6e3d3c0e7c Codechange: introduce std::string variant of sq_pushstring 2023-05-09 23:14:48 +02:00
Rubidiumandrubidium42 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
Rubidiumandrubidium42 dfe52da1ea Codechange: use string/fmt instead of print for strgen warnings/errors/fatals 2023-04-18 23:20:53 +02:00
glx22andLoïc Guilloux 9a957f1d4b Change: [Script] Improve ScriptText validation error messages 2023-03-05 22:24:08 +01:00
glx22andLoïc Guilloux af15dca316 Change: [Script] Extract params info from GS strings 2023-02-28 18:53:17 +01:00
Rubidiumandrubidium42 90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2023-01-14 21:15:23 +01:00
Rubidiumandrubidium42 d31a535c87 Cleanup: remove some unneeded c_str() calls 2021-06-15 06:13:00 +02:00
rubidium42andrubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22andLoïc Guilloux 34215f7faa Codechange: Replace FOR_ALL_TARS with range-based for loops 2021-05-03 19:46:57 +02:00
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 2020-12-27 13:19:25 +01:00
Michael Lutz 9b6f5e3bb8 Codechange: Store GS lang texts in std::strings. 2020-05-21 20:02:34 +02:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Michael Lutz b73622a01c Fix #7600: Don't read uninitialised memory when parsing GS language files. 2019-05-23 00:08:39 +02:00