Commit Graph
177 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 ce5058aac8 Codechange: document a few other parameters and return types 2026-02-18 17:05:16 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Rubidiumandrubidium42 aa7eb089c6 Codechange: make all Providers fully const (Font/Screenshot/Sound) 2025-09-29 23:39:13 +03:00
Peter NelsonandGitHub dcc3a67752 Fix 9cdf740097: Don't make copy of format providers when making a screenshot. (#14681)
While here, use projection instead of lambda to select provider.
2025-09-29 20:02:08 +00:00
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
froschandfrosch 8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Rubidiumandrubidium42 708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
froschandfrosch fda93b6f35 Codechange: Add format_append as short-hand to format_to + back_inserter. 2025-04-29 20:26:23 +02:00
Rubidiumandrubidium42 360670626b Codechange: replace char* with std::string_view 2025-04-28 21:31:12 +02:00
froschandfrosch 0eb6964311 Codechange: Change ScreenshotCallback into a std::function, so there is no need for void* user data. 2025-04-18 22:43:41 +02:00
Peter NelsonandPeter Nelson 8275bbfb87 Codechange: Pass Viewport by reference.
This means we do not have to care what type of pointer is used.
2025-04-09 22:03:23 +01:00
Peter NelsonandPeter Nelson 70b4beb8e7 Codechange: Return screenshot viewport instead of using out parameter. 2025-04-09 22:03:23 +01:00
Rubidiumandrubidium42 18e1440947 Codefix: move or pass by reference instead of copy 2025-03-13 21:16:16 +01:00
Rubidiumandrubidium42 754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Peter NelsonandGitHub 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter NelsonandGitHub 9cdf740097 Codechange: Use ProviderManager to define screenshot generators. (#13526) 2025-02-11 21:38:20 +00:00
Peter NelsonandGitHub 984da2455b Codechange: Use EncodedString for Query window. (#13528)
This removes the need to separately capture and store global parameters.
2025-02-11 17:30:16 +00:00
Peter NelsonandGitHub 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
Rubidiumandrubidium42 4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Rubidiumandrubidium42 f55ba40b13 Codechange: use TileIndex constructor explicitly 2025-01-01 16:25:23 +01:00
SamuXarickandrubidium42 10e2d1ca36 Codechange: Use Map::Iterate() to iterate tiles 2024-12-06 10:33:11 +10: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
Peter NelsonandPeter Nelson c4a638dfe1 Codechange: Replace malloc/free with vector for screenshot buffers. 2024-08-20 22:15:30 +01:00
Peter NelsonandGitHub b68172c225 Codechange: Use std::endian instead of TTD_ENDIAN where trivial. (#12778) 2024-06-15 10:24:17 +01:00
Rubidiumandrubidium42 ded4d63db2 Codechange: simplify access to the current screenshot format 2024-04-21 21:07:05 +02:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidiumandrubidium42 27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2024-03-10 15:50:24 +01:00
Rubidiumandrubidium42 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidiumandrubidium42 eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Rubidiumandrubidium42 87ccff16b5 Codechange: use std::string for the screenshot name/path 2023-06-04 16:53:10 +02:00
Rubidiumandrubidium42 993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 2023-06-04 14:11:13 +02:00
Rubidiumandrubidium42 acec34a0fe Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex 2023-05-19 11:24:44 +02:00
Rubidiumandrubidium42 a312a6c1b2 Codechange: make md5sumToString std::string compatible 2023-05-04 23:23:32 +02:00
Rubidiumandrubidium42 6a8b4f3e10 Codechange: use fmt::format_to instead of seprintf to fill the PNG metadata 2023-04-28 19:53:03 +02:00
Charles PigottandPeterN b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
Rubidiumandrubidium42 f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 2023-01-28 20:33:02 +01:00
Rubidiumandrubidium42 fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidiumandrubidium42 bcfe0fb076 Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
2023-01-14 21:15:23 +01:00
Patric StoutandGitHub 1fb101eabb Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2023-01-02 20:30:02 +00:00
larryfennandGitHub d738cd235f Change: Automatic screenshot numbering with a filename ending in '#' (#9781) 2022-11-08 11:13:16 +00:00
Artin AlaviandMichael Lutz c536bde19e Fix #8252: Remove duplicate functionality in screenshot.cpp 2022-10-22 20:51:02 +02:00
Tyler TrahanandGitHub 08cb5ba2cd Fix: Don't show screenshot GUI in screenshots (#9674) 2021-11-07 17:41:24 +01:00
Loïc GuillouxandGitHub 08c048e0a1 Fix #9643, 95386dc: Incorrect determination of screenshot format (#9644) 2021-10-22 16:34:48 +02:00
rubidium42andrubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
rubidium42andrubidium42 95386dc2b8 Codechange: move misc settings to std::string 2021-05-13 23:13:17 +02:00
Michael Lutz 1f159f79de Fix #9147: Delay making screenshots until the next draw tick as we may not access the video buffer from the game thread. 2021-05-02 17:57:24 +02:00
rubidium42andrubidium42 40528db993 Fix #9152, Fix #9153: screenshot command showed error messages when successful 2021-05-01 11:54:41 +02:00
Patric StoutandPatric Stout d0ed656fd1 Change: scale heightmaps we export to highest peak and inform the user of this value
Before this commit, it scaled to map-height-limit. Recently this
could also be set to "auto", meaning players don't really know
or care about this value.

This also means that if a player exported a heightmap and wanted
to import it again, looking like the exact same map, he did not
know what value for "highest peak" to use.
2021-03-26 12:22:32 +01:00
Patric StoutandPatric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
2021-03-26 12:22:32 +01:00