Commit graph

21137 commits

Author SHA1 Message Date
Christoph Oelckers
a0d679b84b - FileData cleanup and uncoupling from FString.
Work is still needed to allow this to use the lump cache directly because some decisions in the past made this data padded by a zero byte.
2023-08-22 22:54:52 +02:00
Christoph Oelckers
ca1d7fd539 - store longName in a std::string and use std::vector for FileInfo
TArray cannot handle std::string so this must both be changed together.
2023-08-22 22:48:06 +02:00
Christoph Oelckers
8a5d3c096b - return a std::string from GetFileFullPath 2023-08-22 22:18:54 +02:00
Christoph Oelckers
25b7b18c3d - got rid of the two copying variants of fileSystem.GetFileShortName. 2023-08-22 22:18:53 +02:00
Christoph Oelckers
c5b5b2b873 - cleanup. 2023-08-22 22:18:53 +02:00
Christoph Oelckers
eccbafc1bc - let FileData.GetString only return a const char pointer.
Not exposing the implementation will allow a lot more optimization in the backend and we also want to get rid of FString here.
2023-08-22 22:18:53 +02:00
Christoph Oelckers
5398045f7d - got rid of FileSystem::GetFileData.
Using FMemFile is better in all these places.
2023-08-22 22:18:53 +02:00
Christoph Oelckers
21d6eb99eb use std::vector as return value for the FileReader's buffer readers. 2023-08-22 22:18:21 +02:00
Christoph Oelckers
12c7413149 - handle ZLibError 2023-08-22 21:49:56 +02:00
Christoph Oelckers
7f024debfd - clean up includes in 3 files. 2023-08-22 21:49:56 +02:00
Christoph Oelckers
9f45cc0469 - use snprintf for FileWriter::Printf.
pulling in stb_sprintf here may be tricky if the consuming application uses different options, so better not use it here.
2023-08-22 21:49:55 +02:00
Christoph Oelckers
def6bffdfc - use std::vector for the MemoryArrayReader 2023-08-22 21:49:55 +02:00
Christoph Oelckers
2671394961 - only use standard types in WriteZip's API. 2023-08-22 21:49:55 +02:00
Christoph Oelckers
825f92b274 - use std::string in FZipFile::Open 2023-08-22 21:49:55 +02:00
Christoph Oelckers
959d0e93f7 - fixed and cleaned up file_whres.cpp 2023-08-22 21:49:55 +02:00
Christoph Oelckers
f0bbc32bae - add m_swap.h to several files. 2023-08-22 21:49:55 +02:00
Christoph Oelckers
454af06acf - use a local byteswap header in the file system. 2023-08-22 21:49:55 +02:00
Christoph Oelckers
771fa2b51c - rewrote dir CCMD using ScanDirectory and avoiding I_ChDir entirely. 2023-08-22 21:49:55 +02:00
Christoph Oelckers
5f3d25ef44 - use ScanDirectory in all places where the findfile API was used.
This allows to completely hide its implementation details from the rest of the code which only gets a list of file names now.
2023-08-22 21:49:54 +02:00
Christoph Oelckers
566a8f58a7 - disable dir CCMD.
The implementation of this one is garbage, it needs to be redone without I_ChDir.
2023-08-22 21:49:54 +02:00
Christoph Oelckers
219b3fb9f9 - uncoupled directory loader from the rest of the engine. 2023-08-22 21:49:54 +02:00
Christoph Oelckers
5a32f98bde - first stage of uncoupling the file system from the engine.
This replaces several FStrings and TArrays with std::string and std::vector.
2023-08-22 21:49:54 +02:00
Christoph Oelckers
2524ea6b0e - moved linked textures from file system to texture manager. 2023-08-22 21:49:54 +02:00
Christoph Oelckers
1dc47f91c2 - file system error management refactoring. 2023-08-22 21:49:54 +02:00
Cacodemon345
145450a044 WebP image support 2023-08-22 19:14:21 +02:00
alexey.lysiuk
ae2fa11963 - added safeguards against very early access to console variables in Cocoa backend
for an unknown reason, application activation functions can be called way too early during app launch
`S_SetSoundPaused()` function tries to read values of `i_pauseinbackground` and `i_soundinbackground` console variables before their initialization leading to a null pointer dereference

https://forum.zdoom.org/viewtopic.php?t=78092
2023-08-22 14:58:06 +03:00
Cacodemon345
22271d146a Switch to vcpkg for library dependencies 2023-08-21 21:12:00 +02:00
Christoph Oelckers
7fee89d1f5 - uncouple the file system from the engine's Printf function.
This is needed to use it in non GZDoom based projects.
2023-08-17 21:36:22 +02:00
Christoph Oelckers
9b790d23a8 - optimization of WideString and FileReader::Printf.
Both now omit the intermediate FString as the target buffer can be directly written to.
WideString was also moved to utf8.cpp/h to uncouple from zstring.
2023-08-17 18:45:33 +02:00
Cacodemon345
a4573b4ad1 Fix QOI image loading 2023-08-17 08:56:50 -04:00
Cacodemon345
2261dde791 Fix for Clang compilers 2023-08-14 19:30:50 +02:00
Cacodemon345
ce8753c6e1 Replace cxx_thread_local check 2023-08-14 19:30:50 +02:00
Cacodemon345
14a3cf8fc2 CMakeLists upgrade to 3.16 and cleanup
* Remove precompiled header hack
* Fixes for compilation on VS2022 Debug configurations
2023-08-14 19:30:50 +02:00
Christoph Oelckers
74b3d8e0a0 - optimized the QOI loader
* removed the intermediate pixel buffer
* instead of calling the file API for each single byte, load it into a buffer and use direct memory access. Using a file API like this can be magnitudes slower, depending on the underlying data.
* don't store the header in the image source object, it is never used again after validatipn.
2023-08-13 19:03:20 +02:00
Cacodemon345
c727e40e6c Add support for QOI image formats 2023-08-13 06:04:15 -04:00
Cacodemon345
fe7beaaf17 Add support for HDR canvas textures
Vulkan only.
2023-08-12 06:46:05 -04:00
Christoph Oelckers
b695e845e1 - eliminated several pointless string copies in network code. 2023-08-12 10:56:34 +02:00
Christoph Oelckers
46473b45da - use an FString to store the source for DHUDMessage 2023-08-12 10:29:04 +02:00
Christoph Oelckers
a675e4add8 - removed unused ReplaceString function. 2023-08-12 10:28:18 +02:00
Christoph Oelckers
16cefb7528 - some angle cleanup
* clean out the angle conversion helpers from basics.h.
* use degrees instead of radians in TMatrix3x3.
2023-08-12 10:10:27 +02:00
Christoph Oelckers
0c9b652583 - moved EStateUseFlags to a more fitting header and deleted unused RAD2BAM inlines 2023-08-12 09:38:41 +02:00
Christoph Oelckers
b5c1237f93 - removed NOVTABLE #define.
This was used on just two small base classes, the overall savings are zero.
2023-08-12 09:31:33 +02:00
Rachael Alexanderson
81af5279d1 - clang 6 debug workflow is broken for now 2023-08-10 16:31:51 -04:00
Rachael Alexanderson
d99ed7628c - fix: always update psprite scaling 2023-08-10 02:07:31 -04:00
nashmuhandes
1e0309ea10 - block the centerview CCMD if the player has TOTALLYFROZEN. This is deliberately done this way, instead of placing the check inside PlayerPawn::CheckPitch, because there may be other situations where we don't want to block the centering function (APowerFlight::EndEffect being one such case)
- also while I'm in this file, fix code styling for another one of my previous submissions
2023-08-09 09:17:20 -04:00
Christoph Oelckers
a46c0a52b6 - re-added the UTF-8 char formatter which is needed for ZScript. 2023-08-09 11:52:08 +02:00
Christoph Oelckers
fdad3186a6 - replaced zstrformat with stb_sprintf.
The main advantage here is that this allows to get rid of the gdtoa dependency, it is also preferable to have some code here that's being maintained.
Feature-wise both are mostly identical, stb also support MSFT integer size modifiers and hexadecimal floats.
2023-08-09 11:51:46 +02:00
Christoph Oelckers
479795abe2 - fix duplicated variable resulting in an assert on startup.
static definitions in headers are evil! Don't do that!
2023-08-09 10:12:16 +02:00
Christoph Oelckers
d3fa699782 - updated stb_image.h. 2023-08-09 08:25:04 +02:00
Christoph Oelckers
979f4311fa - moved stb_image.h to third party folder. 2023-08-09 08:22:47 +02:00