Commit Graph
428 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 ce5058aac8 Codechange: document a few other parameters and return types 2026-02-18 17:05:16 +01:00
Rubidiumandrubidium42 3d844d3f1d Codefix: override already implies virtual, so don't add virtual 2026-02-04 00:26:51 +01:00
Rubidiumandrubidium42 c6c06e13eb Codefix: wrong parameter names and partially missing parameters 2026-02-02 16:31:46 +01:00
Rubidiumandrubidium42 67fac86149 Codefix: remove @param documentation for parameters that don't exist anymore 2026-02-01 15:49:41 +01:00
Rubidiumandrubidium42 f291e3c68e Codechange: reduce required padding of some structs 2026-01-07 18:26:29 +01:00
Peter NelsonandGitHub f1e831233a Codefix: Mark destructors override. (#14925)
Remove some empty destructors.
2025-12-19 18:14:29 +00:00
Rito12andrubidium42 859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +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
Peter NelsonandGitHub 8e055156e3 Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-10-11 10:22:50 +01:00
Peter NelsonandGitHub 0455627d16 Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
2025-05-23 10:36:28 +01:00
Rubidiumandrubidium42 f8aceb6c37 Codechange: use value initialisation over memset 2025-05-09 17:20:41 +02:00
froschandGitHub c3aa3f140c Codechange: Use more std::string_view. (#14197) 2025-05-03 18:40:37 +02:00
froschandGitHub 9ac9798d7f Codechange: Remove usages of stoi and stol. (#14196) 2025-05-03 17:46:30 +02:00
Loïc GuillouxandGitHub 1f212e6f2a Fix: Handle \t when loading GS strings from savegame (#14180) 2025-05-01 16:48:02 +02:00
Rubidiumandrubidium42 c1a287ad17 Codechange: make some saveload functions work natively with std::string_view 2025-04-30 23:49:06 +02:00
froschandfrosch 9cf36dac39 Codechange: Use data() instead of c_str(), if no NUL termination is needed. 2025-04-30 19:33:56 +02:00
Rubidiumandrubidium42 78250c3bba Codechange: remove const char* overloads when there are std::string_view and std::string& overloads 2025-04-29 10:14:53 +02:00
689f55a0ea Fix #14044: Negative string parameters from GS were rendered as zero. (#14049)
String parameters are always stored as uint64_t. Negative values are sign-extended to int64_t and then casted to uint64_t.
The same applies to encoded strings. But ScriptText encoded them as int64_t.

Co-authored-by: rubidium42 <rubidium42@users.noreply.github.com>
2025-04-20 23:01:49 +02:00
froschandGitHub 26db4ccf09 Codechange: Turn bit-stuffed FiosType enum into a struct. (#14019) 2025-04-18 15:20:55 +02:00
froschandfrosch 131b7c7122 Codechange: Replace Utf8Decode usages with StringConsumer. 2025-04-13 21:59:10 +02:00
froschandfrosch dd073eb38d Codechange: Use StringBuilder to create encoded strings. 2025-04-08 23:10:58 +02:00
Peter NelsonandGitHub 5b9d171e63 Codechange: Use EnumBitSet for StringValidationSettings. (#13974) 2025-04-08 21:19:17 +01:00
froschandGitHub 2cdf2bedfa Codechange: Add a std::string overload for StrMakeValidInPlace() and a moving std::string&& overload for StrMakeValid(). (#13962) 2025-04-07 18:22:47 +02:00
Peter NelsonandGitHub 8b4114d709 Fix #13849: Settings in old saves could be overridden by defaults. (#13874)
Resolved by resetting settings to default values before the OPTS and PATS chunks are loaded.
2025-03-23 15:55:55 +00:00
Peter NelsonandPeter Nelson 2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Peter NelsonandGitHub 89948b941b Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Rubidiumandrubidium42 754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Rubidiumandrubidium42 32b2de36ef Codefix: check the table header is actually being read 2025-03-12 17:55:34 +01:00
Peter NelsonandGitHub 94c6221dff Fix edf9f597ec: Screenshot with non-wallclock date saved with wrong filename. (#13721) 2025-03-03 21:44:48 +00:00
Peter NelsonandPeter Nelson edf9f597ec Codechange: Use parameterised GetString() for remaining windows. 2025-03-02 07:29:25 +00:00
Peter NelsonandGitHub 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter NelsonandGitHub dccc6185b9 Codechange: Change internal format of encoded strings to improve robustness and allow expansion. (#13499) 2025-02-09 12:45:50 +00:00
Rubidiumandrubidium42 83479a4e12 Codechange: add method for reading a string from a savegame given a length 2025-02-07 22:49:17 +01:00
Peter NelsonandGitHub bf6293a13f Fix: Rail/road type conversion data is not populated on new game. (#13403)
This means that the rail/road type conversion that happens if NewGRFs are changed does not work the first time for a new game, only with a savegame.
2025-01-29 21:45:16 +00:00
Peter NelsonandGitHub afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter NelsonandPeter Nelson fb6781015a Codechange: Use std::endian instead of TTD_ENDIAN defines. 2025-01-28 19:37:34 +00:00
Rubidiumandrubidium42 4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Peter NelsonandGitHub f6ab2b69c6 Codechange: Define GRFConfigList alias and pass by reference. (#13358)
This adds the distinction between a single GRFConfig and a GRFConfig list, and simplifies how GRFConfig lists are passed to various functions.
2025-01-22 22:30:32 +00:00
Peter NelsonandGitHub b653f875b0 Codechange: Space between template and < (#13278)
Make it all consistent so it matches CODINGSTYLE.
2025-01-04 17:56:14 +00:00
Peter NelsonandPeter Nelson 177e2ebf80 Codechange: Support saveload of reference vectors.
This uses the same data format as reference lists, but for vectors, so allows data structures to be changed without affecting savegame format.
2024-11-27 12:35:27 +00:00
Peter NelsonandPeter Nelson 059a4b22f7 Codechange: Use projection-based std::range::find where possible.
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
Peter NelsonandPeter Nelson d4f8453c22 Codefix: Clear and reserve storage when loading vectors from savegames. 2024-11-18 08:59:41 +00:00
Peter NelsonandGitHub 74910d3d14 Fix 908ee729: Inverted condition prevented actually writing data to files. (#12941) 2024-09-16 13:45:23 +00: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 RennisonandPeter Nelson 2a5a0b0990 Codechange: No longer allow saving of incorrect string container table fields
See: 1250ce8f
2024-09-14 15:32:48 +01:00
Peter NelsonandGitHub 7f5a3eaf83 Codefix: Avoid type-casting function pointer with incorrect type. (#12929)
Make `AutolengthProc` take `int` instead of `void *`, avoiding pointer parameters.
2024-09-12 06:49:45 +01:00
Jonathan G RennisonandGitHub 65c666cb57 Codechange: Remove unused size field from struct SaveLoad (#12859) 2024-07-14 14:30:35 -04:00
Peter NelsonandGitHub b4bcb330c7 Codechange: Replace GetSavegameFormat's compression output pointer with std::pair return. (#12850)
This avoids using an unchecked pointer as an out-parameter.
2024-07-09 18:57:47 +01:00
Peter NelsonandGitHub 100dd7b6d1 Codechange: Use find_if to get default writeable saveload format. (#12849)
* Codechange: Use find_if to get default writeable savegame format.

This removes the last of lastof, and so the lastof macro is removed.
2024-07-09 17:07:40 +01:00