Commit Graph
160 Commits
Author SHA1 Message Date
Peter NelsonandGitHub 20e57a02a2 Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Rubidiumandrubidium42 04d53ed6f5 Codechange: remove operator!=s that are synthesized 2025-02-08 06:37:36 +01:00
Jonathan G Rennisonandrubidium42 9f1bb055b7 Change: Exclude parent item from directory sort in FiosGetFileList 2024-09-18 06:49:30 +02:00
Tyler TrahanandGitHub ad020759c7 Feature: Import town data from JSON file (#10409) 2024-09-16 09:29:10 -04: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 440a633fcc Codechange: Remove shrink_to_fit for more lists.
A comment about "will actually do nothing" is out of date as that is not the case with std::vector.

These lists are always short lived (either within a command handler or in a window) so don't shrink_to_fit.
2024-04-27 19:25:34 +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
Peter NelsonandPeter Nelson 42523379d9 Codechange: Use directory_iterator in ScanPath.
Replaces use of custom ttd_opendir.
2024-04-18 01:41:14 +01:00
Peter NelsonandPeter 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 NelsonandGitHub a1b03ee69e Codechange: Replace platform-specific calls with std::filesystem::last_write_time. (#12487) 2024-04-15 18:10:19 +00:00
Peter NelsonandGitHub 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
Patric StoutandGitHub a1487ce620 Add: list_[scenario|heightmap] and load_[scenario|height] console commands (#11867) 2024-01-23 14:01:25 +01:00
Patric StoutandGitHub 090616b4c9 Add: allow loading heightmaps from command-line (#11870)
If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
2024-01-22 22:35:25 +00:00
Rubidiumandrubidium42 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
Rubidiumandrubidium42 c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +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 af9b9327af Codechange: do not keep local variable for temporary string parameters 2023-07-03 18:08:03 +02:00
Owen Rudge 1a3d1bca59 Remove: OS/2 port 2023-06-16 14:29:14 +01:00
Rubidiumandrubidium42 fbd71a9d72 Codechange: replace C-style string processing with C++-style for the listing callbacks 2023-06-05 23:25:49 +02:00
Rubidiumandrubidium42 324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 2023-05-31 10:56:33 +02:00
Rubidiumandrubidium42 f2e704b9a7 Codechange: use std::string for FiosIsRoot 2023-05-31 10:56:33 +02:00
Rubidiumandrubidium42 13789d1703 Codechange: use std::string for FiosIsValidFile 2023-05-31 10:56:33 +02:00
Rubidiumandrubidium42 d9a04ba446 Codechange: make the MD5 hash/digest/checksum variables a std::array 2023-05-19 11:24:44 +02:00
Rubidiumandrubidium42 98972a0748 Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +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 397221b94a Codechange: Make ScenarioIdentifier use std::string for the filename 2023-04-29 13:23:34 +02:00
Rubidiumandrubidium42 3a822fcd01 Codechange: Make FiosItem's name and title std::string 2023-04-29 13:23:34 +02:00
Rubidiumandrubidium42 f0a1ddd81c Codechange: let FiosBrowseTo return a bool 2023-04-29 13:23:34 +02:00
Rubidiumandrubidium42 c829930440 Codechange: replace strnatcmp with C++ string capable version 2023-04-29 12:07:45 +02:00
Rubidiumandrubidium42 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 2023-04-29 10:25:25 +02:00
Rubidiumandrubidium42 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Charles PigottandGitHub 80bd5ad727 Codechange: Use std::strto* variants everywhere (#10720) 2023-04-26 12:56:14 +01:00
Rubidiumandrubidium42 ae422be979 Cleanup: remove/replace trailing ; with . in comments 2023-01-26 23:47:55 +01:00
Loïc GuillouxandGitHub 460991ecf4 Feature: Persistant rotation of numbered auto/netsave after restart (#9397)
It was always starting from 0 on openttd restart.
Now the most recent auto/netsave number will be used as a base to generate the next filename.
2021-07-17 12:48:35 +02:00
Patric StoutandGitHub ca9a7df752 Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
rubidium42andrubidium42 6bca9e090d Codechange: add SetDParamStr that accepts std::string& 2021-05-06 21:45:36 +02:00
glx22andLoïc Guilloux 983c7ade60 Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops 2021-05-03 19:46:57 +02:00
PeterNandGitHub f018471b36 Cleanup: Remove old FiosList helper methods. (#9139) 2021-04-29 22:46:42 +01:00
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 2021-04-07 09:31:47 +02:00
glx22andLoïc Guilloux 45e8b7a5bd Add: Allow translation of "(Directory)" and "(Parent directory)" 2021-02-15 00:08:37 +01:00
Michael LutzandGitHub 4f8e7b2a2b Fix 65f65ad2: Missing path separator that fell over a cliff. 2020-12-27 15:07:06 +01:00
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 2020-12-27 13:19:25 +01:00
Michael Lutz f3326d34e7 Codechange: Use std::string in FIO search path handling. 2020-12-27 13:19:25 +01:00
Quipyowert2andMichael Lutz acb3d10832 Codechange: Format unsigned integers with %u instead of %i or %d. 2020-02-13 21:36:37 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Juriy PetrochenkovandCharles Pigott 8c6a16ba28 Fix: Possible double path separator in FiosMakeFilename 2019-10-25 22:35:51 +01:00
Owen Rudge 165eae0e80 Fix: Avoid using stat to retrieve file modification times on Windows (#7731) 2019-09-13 11:23:25 +01:00
Juriy PetrochenkovandNiels Martin Hansen 7bdde8b41d Fix: Use natural sort when sorting the file list. 2019-09-08 22:18:53 +02:00