1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00
Commit Graph

764 Commits

Author SHA1 Message Date
Cyprian Klimaszewski
99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter Nelson
c3451b5d97 Codechange: Replace color with colour. 2025-11-18 00:02:48 +00:00
Peter Nelson
8e055156e3 Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-10-11 10:22:50 +01:00
merni-ns
e1b404089c Fix #13307: Return non-zero value when there is a mistake in command-line arguments
Specifically, when the savegame passed to -q cannot be read or when non-existent/invalid options are passed
2025-08-07 23:28:57 +02: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
156f98ba06 Fix #14256, dfd9fbf873: Company finance windows not updated when paused. (#14258)
Refresh company finance windows via a WindowTimer instead of in game loop.

As the invalidation affects multiple windows this is a global timer instead of window-specific.
2025-05-13 01:23:27 +01:00
Peter Nelson
9735fbbaa1 Codechange: Use LRUCache for layouted LineCache.
This avoids needing to manually manage the size of the cache.
2025-05-06 18:09:00 +01:00
frosch
8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Rubidium
fbe80f31fe Codechange: replace char* in GetOptData with std::string_view 2025-04-30 23:49:06 +02:00
Rubidium
855377191e Codechange: replace some more char*s with std::string_view 2025-04-30 23:49:06 +02:00
frosch
36ce1f890a Codechange: Remove c_str, if std::string_view is already accepted. 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
frosch
fda93b6f35 Codechange: Add format_append as short-hand to format_to + back_inserter. 2025-04-29 20:26:23 +02:00
frosch
98481ecc01 Codechange: Replace strtol, strtoll, stroul and strtoull with ParseInteger. 2025-04-29 20:14:56 +02:00
frosch
cdafc50c94 Codechange: Replace atoi and atoll with ParseInteger. 2025-04-29 20:14:56 +02:00
frosch
79b2202f2e Codechange: Use StringConsumer for parsing more strings. 2025-04-29 20:14:56 +02:00
Peter Nelson
dfd9fbf873 Codechange: Defer refreshing company finance windows. (#14111)
During each game tick every cargo payment will issue an Invalidate of the status bar and company finance window. While this doesn't paint the window yet, it does need to search for open windows, and then mark a area of dirty blocks, which is done for every Invalidate.

Instead, set a bit in a CompanyMask, and test these bits once after the game tick is complete.

This reduces the amount of dirtying, and allows more specific widgets to be dirtied instead of the whole window.
2025-04-26 10:50:51 +00:00
frosch
26db4ccf09 Codechange: Turn bit-stuffed FiosType enum into a struct. (#14019) 2025-04-18 15:20:55 +02:00
SamuXarick
4310d7c7f5 Fix: [Script] Only run the Game::GameLoop() in-game (#13896) 2025-04-04 17:29:48 +02:00
Peter Nelson
6914d99778 Codechange: Split baseset type definitions into separate files. 2025-03-27 18:57:53 +00:00
Peter Nelson
422ff9dbd8 Codechange: Use std::unique_ptr for ai/game config. 2025-03-26 10:54:11 +00:00
Peter 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 Nelson
5255aabe4d Fix #13839: Incorrect colour of first company legend in smallmap window. (#13841)
Use the proper command to set the initial company colour.
2025-03-17 20:28:02 +00:00
Rubidium
754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Rubidium
fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidium
1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 2025-02-16 14:02:18 +01:00
Peter Nelson
2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter Nelson
6cf7a899e9 Codechange: Use EnumBitSet for PauseMode. (#13553) 2025-02-14 08:30:04 +00:00
Peter Nelson
20e57a02a2 Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Peter Nelson
9cdf740097 Codechange: Use ProviderManager to define screenshot generators. (#13526) 2025-02-11 21:38:20 +00:00
Peter Nelson
fe31538a27 Codechange: Use EnumBitSet for Scanner::Modes. (#13471) 2025-02-05 20:08:12 +00:00
Peter Nelson
6f52a977a8 Codechange: Use EnumBitSet for GRFConfigFlags.
This is renamed from `GCF_Flag` didn't match convention.
2025-02-02 10:49:45 +00:00
Peter Nelson
5664b1e2f6 Codechange: Use std::vector for GRFConfig lists. (#10835)
This replaces the C-style custom managed linked-list and allows use of iterators etc.
2025-01-31 17:09:09 +00:00
Rubidium
4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Rubidium
c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00
Peter Nelson
1faf60ae13 Fix #13199: -f command line parameter does not need a value. (#13200) 2024-12-27 00:16:34 +00:00
Peter Nelson
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 Nelson
4b81b62b72 Change: Don't reinitialise font caches when setting initial interface scale. (#12722) 2024-05-27 12:44:34 +01:00
Peter Nelson
460fab920c Fix #12418, 338def1b06: Filename extension taken from wrong string. (#12680) 2024-05-14 18:18:30 +01:00
ladysadie
00cfd572ff Cleanup: Remove unneeded CheckMissingGlyphs call (#12640) 2024-05-08 21:42:02 +02:00
Rubidium
a9318cf653 Cleanup: remove UI for changing the password 2024-05-07 00:03:15 +02:00
Rubidium
16639939e9 Cleanup: remove command line option for company password 2024-05-07 00:03:15 +02:00
Rubidium
455e202e03 Fix: server's client is shown incorrectly in some cases 2024-05-05 22:57:50 +02:00
Peter Nelson
a1a01e21cf Change: Use std::make_unique instead of passing new() (#12539) 2024-04-20 11:20:49 +01:00
Peter Nelson
21d11ee361 Codechange: Move cache check function to own file. 2024-04-18 22:13:55 +01:00
Patric Stout
1005c86c62 Codechange: record cache warnings with a "warning" prefix (#12518) 2024-04-17 19:49:55 +00:00
Jonathan G Rennison
0b9029b69c Fix: Station/industry nearby list checks in CheckCaches 2024-04-17 20:33:49 +02:00
Rubidium
eda10abc8c Codechange: pass command line arguments as std::span to openttd_main 2024-04-11 21:57:53 +02:00