Commit Graph

62 Commits

Author SHA1 Message Date
Peter Nelson 63ce81570c Remove: Custom opendir implementation for Windows no longer needed.
std::filesystem::directory_iterator is now used instead.
2024-04-18 01:41:14 +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 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 3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Rubidium 993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 2023-06-04 14:11:13 +02:00
Patric Stout 199e41c762
Codechange: use default dtor instead of empty (#10826) 2023-05-14 23:31:03 +02:00
Rubidium 98972a0748 Codechange: use C++ strings for constructing script file paths 2023-05-14 22:54:10 +02:00
Rubidium 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
Rubidium 43c65a3fec Codechange: use std::string for base media filename/warning storage 2023-04-25 15:01:08 +02:00
Patric Stout ed3946e295
Add: '-X' option to ignore global folders in the search path (#9341)
This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.

However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.
2021-06-10 23:13:34 +02:00
Rubidium fa6abe1646 Cleanup: remove the old FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium fdc11a9f94 Codechange: introduce SpriteFile to be used by the sprite loader instead of the global FIO slot functionality 2021-05-08 12:39:34 +02:00
Rubidium c097bc9d7d Codechange: let NewGRF sounds make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
glx22 983c7ade60 Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops 2021-05-03 19:46:57 +02: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
milek7 295f34a9df Fix: Freeing LanguagePack with wrong size. 2021-04-02 10:12:25 +02:00
Niels Martin Hansen b427ddce88 Codechange: Switch to explicit wide strings 2021-02-23 11:25:39 +01:00
Charles Pigott e0161cf8da Fix b408fe7: Don't try to construct a std::string from nullptr 2020-12-27 18:30:53 +00:00
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Michael Lutz 358056ec42 Codechange: Keep filenames of loaded Fio files in std::strings. 2020-12-27 13:19:25 +01:00
Michael Lutz 024a3f6259 Codechange: Use automatic memory management for language pack reading. 2020-12-27 13:19:25 +01:00
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 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
Michael Lutz 0c6e8a8123 Codechange: Store file search paths as std::string. 2020-12-27 13:19:25 +01:00
Michael Lutz dd138fc460 Codechange: Stringify config file paths. 2020-12-27 13:19:25 +01:00
Michael Lutz c972a63c8c Codechange: Store info about the dedicated server log file in globals with automatic destruction to simplify control flow in openttd_main. 2020-05-21 20:02:34 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Alberth 5981ed248a Codechange: Remove unused FioTarFirstDir and FioTarAddLink functions 2019-07-21 19:11:31 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 2018-12-27 18:09:16 +01:00
Niels Martin Hansen 458e441a4c Codechange: Make FioCreateDirectory public 2018-06-05 22:58:35 +02:00
Michael Lutz ce51e54d26 Change: [Win32] Parse and load DLS files for the DirectMusic driver without relying on high-level functions. 2018-05-26 22:28:01 +02:00
rubidium 21f991e235 (svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay 2014-04-23 21:23:21 +00:00
rubidium def597fe31 (svn r25974) -Codechange: make the _personal_dir global const, since once it's set it shouldn't be changed anyhow 2013-11-13 18:57:25 +00:00
frosch edd9c0553a (svn r24804) -Add: Separate subdirectory for screenshots. 2012-12-09 16:52:43 +00:00
michi_cc 36181b3fb2 (svn r24417) -Codechange: [Win32] Don't needlessly include windows.h in a commonly used header. 2012-07-19 19:21:47 +00:00
truebrain b4f832f29f (svn r23605) -Add: GAME_DIR and CONTENT_TYPE_GAME, and read gamescript from that directory 2011-12-19 20:54:37 +00:00
rubidium df16ebd730 (svn r23595) -Codechange: add comma after last enum to get a more uniform coding style 2011-12-19 17:48:04 +00:00
rubidium a3a2fdcfc2 (svn r23234) -Fix [FS#4840]: crash when after downloading content 2011-11-16 16:54:37 +00:00
rubidium 6d991b3b10 (svn r23217) -Codechange: introduce the concept of scanning only in a limited set of sub directories 2011-11-14 21:30:37 +00:00
rubidium 160294ff22 (svn r23216) -Codechange: introduce the concept of having different tar lists 2011-11-14 21:28:43 +00:00
rubidium 414c397000 (svn r22904) -Codechange: add tar filename to file scanning 2011-09-08 09:48:52 +00:00
rubidium 672df52e0c (svn r22835) -Codechange: keep track of the subdirectory we are looking through in the file scanner 2011-08-25 10:31:35 +00:00
rubidium b4edc30c64 (svn r22827) -Codechange: pass the/a more proper sub directory when opening (some) files instead of the default one 2011-08-24 13:53:34 +00:00
rubidium 2a12c9df2f (svn r22825) -Codechange: pass subdir to FioOpenFile 2011-08-24 13:42:06 +00:00
rubidium 0061b5f184 (svn r22822) -Codechange: make a distinction between base sets and newgrfs for their directory 2011-08-24 13:33:49 +00:00
alberth 28092366ec (svn r22459) -Doc: Typo fixes and doxygen markup improvements. 2011-05-14 18:35:40 +00:00
alberth 9f5a96ead2 (svn r20689) -Codechange: Make some global functions used in 1 .cpp file static in that file. 2010-08-29 15:58:43 +00:00