Gleb Mazovetskiy
1a1a282d9a
Use C FILE instead of C++ streams throughout
...
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
3 years ago
Gleb Mazovetskiy
6d274c9547
`UNPACKED_SAVES`: Saves without MPQs
...
Reduces rg99 binary size by ~70 KiB.
3 years ago
Gleb Mazovetskiy
dc3908e360
assets.cpp: Switch to C FILE for UNPACKED_MPQS
...
Eliminates some of the (minor) overhead of fstream.
3 years ago
Anders Jenbo
6f44b48f4e
Use SDL for creating file during RW test
4 years ago
Gleb Mazovetskiy
4063afb792
Xbox NXDK platform
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
qndel
8b0808bd4a
fix error spam
4 years ago
Vladimir Olteanu
b853559573
Make CreateFileStream return optional, rather than unique_ptr
5 years ago
Anders Jenbo
0475aed939
[android] Allow FileExists to work on assets
5 years ago
ephphatha
08ae390643
Add explicit casts for some implicit conversions
...
Some of these were triggering multiple warnings due to casts applied at times which forced potentially truncating operations.
5 years ago
Trihedraf
38cf99a423
Add IsWriteable to file_util.cpp
5 years ago
Gleb Mazovetskiy
6a27b37d62
Windows: Handle Unicode paths in language.cpp
5 years ago
Gleb Mazovetskiy
a3423cbc92
🧹 Move Storm code out of file_util
5 years ago
obligaron
58becefada
Define UNICODE/_UNICODE for StormLib and use SFileOpenArchive with wchar_t (TCHAR) on Windows
5 years ago
obligaron
2932da8950
CreateFileStream - Use ToWideChar on Windows
5 years ago
obligaron
60bfd5db34
Move SFileOpenArchive calls to new helper SFileOpenArchiveDiablo
5 years ago
obligaron
a64f94d580
Move creation of file stream to new helper CreateFileStream
5 years ago
obligaron
cfd72b68a0
Revert "remove windows specific code because stat works for this on windows"
...
This reverts commit 0987f8b479 .
5 years ago
Trihedraf
0987f8b479
remove windows specific code because stat works for this on windows
5 years ago
Gleb Mazovetskiy
f8a2552ac8
RemoveFile: Use DeleteFileW on Windows
5 years ago
Gleb Mazovetskiy
46742824ad
FileExists: Use PathFileExistsW on Windows
5 years ago
Gleb Mazovetskiy
adb5fa49da
🐞 Fix Windows UTF-8-to-16 conversion
...
Follow-up to #1905
5 years ago
Gleb Mazovetskiy
7ed08077f6
♻️ file_util: Cleanup Windows UTF-8-to-16 conversion
5 years ago
Jmgr
1b7e0d2cb3
Migrate existing log entries
5 years ago
Anders Jenbo
cc164985a3
🎨 Correct type checks in src sub-folder
5 years ago
Anders Jenbo
2969b80163
🎨 Run readability-identifier-naming on all src sub-folders
5 years ago
Anders Jenbo
b978d80119
🎨 llvm-include-order
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Gleb Mazovetskiy
86afa95d2a
Move file_util.h implementations to file_util.cpp
...
There is no reason for these functions to be in the header (inlining
won't benefit them one bit).
I put them in the header originally only because of the weird state
SourceS was in back then.
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
e7ae8ddd04
🚚 Move all enums to there respective headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
a2656637e4
🎨 Format source
5 years ago
Anders Jenbo
12658a0b3d
🐛 Fix console output on Windows and SDL1 targets
...
Fixes #921
5 years ago
Gleb Mazovetskiy
a091a56e8e
Remove MAX_PATH restriction ( #898 )
...
Do not limit filesystem paths to 259 chars for MPQs, save files, and diablo.ini.
The MAX_PATH constant remains but now only limits path lengths within the MPQs.
5 years ago
Anders Jenbo
0da3461d35
Use explicit types instead of auto
6 years ago
Anders Jenbo
69ad34f58f
Consistently use NULL instead of nullptr
...
While nullptr does have extra checking, most of the code uses NULL and
nullptr makes it harder to port the code to some targets like the
original XBox
6 years ago
Gleb Mazovetskiy
c9c1c323cd
mpqapi cleanup ( #624 )
...
* mpqapi FStreamWrapper: Fix silly bugs
* mpqapi cleanup
1. Do not rely on stream positions for getting the initial file size.
2. Remove most `seek` calls that were unnecessary.
3. Replace magic numbers with constants.
4. A class to manage archive lifetime and all associated data.
* Revert "Revert "mpqapi: Log all fstream calls""
This reverts commit e08007670f .
* mpqapi: Fix saves on Amiga
Works around https://github.com/bebbo/libnix/issues/30
* mpqapi: Fix logging format specifiers
This fixes fstream logging on Amiga
* mpqapi: Do not ResizeFile unless it was modified
* Add tests for file_util
* mpqapi: Replace malloc/free with new[]/delete[]
* mpqapi: Keep track of size instead of using tellp
This reduces log noise and reliance on `tellp`.
* mpqapi: Refactor mpqapi_write_file_contents
* mpqapi: Ensure we don't seekp beyond EOF on Amiga
* mpqapi: Minor fixes
* mpqapi: Fix FSTREAM_CHECK on Windows
* mpqapi: Remove undefined methods from header
6 years ago
Anders Jenbo
08aa6a860a
Move generic helpers out of miniwin
6 years ago
Gleb Mazovetskiy
cfe288a28e
mpqapi: Use <fstream> instead of custom functions
6 years ago
Gleb Mazovetskiy
c8605f79bd
capture.cpp: Replace WriteFile with <fstream>
6 years ago