1
0
Fork 0
Commit Graph

265 Commits (96fd2916933df7ed05accf68a31a91c7ce192194)

Author SHA1 Message Date
Rubidium 96fd291693 Codechange: introduce GetEnv that returns optional based on std::getenv 2025-05-03 15:58:14 +02:00
Rubidium 4109b6848b Codechange: replace manual trim and std::from_chars with ParseInteger 2025-05-03 15:57:53 +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 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 9107c3f6c6 Codechange: add std::string_view variant of FileHandle::Open 2025-04-28 21:31:12 +02:00
Rubidium e3858e81dc Codechange: use std::string_view over const std::string& for finding files 2025-04-21 17:20:00 +02:00
frosch 04246c530f
Codechange: Use fmt::format instead of stringstream with iomanip flags. (#13964) 2025-04-08 20:57:50 +00:00
Rubidium 754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Rubidium 2d30df8110 Codefix: 'Declaration hides variable' 2025-02-16 13:44:37 +01:00
Jonathan G Rennison d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Peter Nelson fe31538a27
Codechange: Use EnumBitSet for Scanner::Modes. (#13471) 2025-02-05 20:08:12 +00:00
merni-ns 2ab714b32e Change: Add fonts document to help window 2025-02-01 23:51:26 +01:00
Jonathan G Rennison 78c7dd1303
Fix #12945: Relative paths passed to -c were not made absolute (#12946) 2024-09-21 13:58:28 +01:00
Peter Nelson 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 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 19ca4089a1
Codechange: Use std::filesystem::exists instead of access. (#12702) 2024-05-22 09:23:01 +01:00
Rubidium 00c4b232b3 Fix #12550: files were not saved in the right location when binary and configuration are in the same folder 2024-05-14 17:01:28 +02:00
Peter Nelson b30fe0d7da Feature: Ctrl-click to toggle favourites in build-pickers.
This allows ctrl-click on a type in a build-picker window to remember it
as a favourite. An new filter button to show only favourites makes it
simpler to use these types.

Favourite types are saved locally in favs.cfg, so are remembered between
games.
2024-05-11 02:12:41 +01:00
Peter Nelson ef55cc7979
Codechange: Remove support for links in tar files. (#12571)
This was a feature to support the original 32bpp sprite system and is no longer relevant.
2024-04-28 15:18:24 +01:00
Loïc Guilloux 99b74c1064
Fix #12584: Improved error handling during tar scan (#12586) 2024-04-28 16:08:32 +02:00
Peter Nelson e8249e9075
Codechange: Pass buffers for TarFile's ExtractString as span. (#12567)
ExtractString does not need to find a string terminator as StrMakeValid already does this, so simply pass the full bounds of the buffer.

Removes lengthof, array indices, and needs only the buffer as a parameter.
2024-04-24 21:34:21 +01:00
Peter Nelson ac6a945e26
Revert 2408a68910: Remove work around for an MSVC bug from 17 years ago. (#12557) 2024-04-23 17:05:08 +01:00
Peter Nelson 42523379d9 Codechange: Use directory_iterator in ScanPath.
Replaces use of custom ttd_opendir.
2024-04-18 01:41:14 +01:00
Peter Nelson d7c547d0db Codechange: Use directory_iterator to list directories in file list windows.
This replaces use of custom ttd_opendir. Files are listed separately using ScanPath as that handles downloaded content.
2024-04-18 01:41:14 +01:00
Peter Nelson 5a523cf212 Codechange: Simplify FioCreateDirectory.
`std::filesystem` provides `create_directories()` as a cross-platform way to create a directory tree.
2024-04-18 01:41:14 +01:00
Peter Nelson 4eaeccdaeb
Codechange: Introduce FioRemove() to remove files. (#12491)
New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
2024-04-14 23:43:50 +01:00
Rubidium 4f2412a272 Codechange: range based for loops instead of C-style for loops 2024-04-11 07:05:04 +02:00
rubidium42 442daf58da Codechange: replace lengthof with std::size in Windows specific code 2024-04-10 23:17:13 +02:00
Loïc Guilloux 165f92c00b
Fix #12041, 0c81579: Tarball extraction failing due to incorrect filename (#12044) 2024-02-09 17:25:56 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Patric Stout d3b2a576de
Feature: Plugin framework for Social Integration with Steam, Discord, GOG, etc (#11628) 2024-01-22 19:22:45 +00:00
Patric Stout 0c81579363
Fix #6377: two tarballs with the same folder in them were considered as one (#11855) 2024-01-21 19:06:58 +01:00
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
Jonathan G Rennison 88324a253e
Fix #11644: Off by one error/buffer over-read in StrMakeValid (#11645)
* Fix #11644: Off by one error in StrMakeValid UTF-8 decode overrun detection

* Fix #11644: Off by one error in StrMakeValid buffer last character

* Fix: Unnecessary string duplication at StrMakeValid call sites
2024-01-01 13:26:31 -05:00
Patric Stout c059ce0c97
Fix cda6f24f: don't ignore binary-dir if it happens to be working-dir (#11431)
Some of our code ignores the SP_WORKING_DIR for some actions, which
means that if, for example, your SP_BINARY_DIR is the same as your
SP_WORKING_DIR, neither is scanned.

Instead, only add SP_WORKING_DIR if it is unique.
2023-11-04 10:39:18 +00:00
Peter Nelson cda6f24fe8
Change: Filter duplicate paths from valid search path list. (#11363) 2023-10-09 21:38:13 +00:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Owen Rudge 1a3d1bca59 Remove: OS/2 port 2023-06-16 14:29:14 +01:00
Rubidium 81f957b9f8 Codechange: use std::string to find the executable's working directory 2023-06-09 19:58:18 +02:00
Rubidium 993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 2023-06-04 14:11:13 +02:00
Rubidium 513ede7669 Codechange: use C++ strings/paths to resolve links in tars 2023-06-02 21:06:24 +02:00
Rubidium 13789d1703 Codechange: use std::string for FiosIsValidFile 2023-05-31 10:56:33 +02:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Rubidium 98972a0748 Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +02:00
Peter Nelson e6740046ee Codechange: Use range-for iteration. 2023-05-11 07:58:55 +01:00
Rubidium 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 2023-04-29 10:25:25 +02:00
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Charles Pigott 80bd5ad727
Codechange: Use std::strto* variants everywhere (#10720) 2023-04-26 12:56:14 +01:00