Commit graph

1526 commits

Author SHA1 Message Date
Christoph Oelckers
72a2e5d532 fixed remaining issues in resource file loading. 2023-12-14 17:22:31 +01:00
Christoph Oelckers
f3c7e01195 fixed BufferingReader 2023-12-14 17:22:31 +01:00
Christoph Oelckers
292705ddc3 fixed OpenDecompressor flag handling. 2023-12-14 17:22:31 +01:00
Christoph Oelckers
e1cf8af9d3 zero the Entries array on allocation 2023-12-14 17:22:31 +01:00
Christoph Oelckers
0be8fed6fc fixed BufferingReader. 2023-12-14 17:22:31 +01:00
Christoph Oelckers
df3e82d94c cleaned up some redundant file reads and fixed file opening in the movie player.
As a streaming action this cannot borrow the one from the archive.
2023-12-14 17:22:31 +01:00
Christoph Oelckers
3e7ec9118f got rid of FUncompressedFile and reenabled postprocessing. 2023-12-14 17:22:31 +01:00
Christoph Oelckers
10f743a0d6 cleaned out all remaining references to FResourceLump.
Most importantly, the lump locking mechanism is finally gone.
2023-12-14 17:22:30 +01:00
Christoph Oelckers
e35b0f1453 got rid of FZipLump. 2023-12-14 17:22:30 +01:00
Christoph Oelckers
c27c8c232a handle RFF encryption like compression.
This allows simplifiying the code a lot by moving the decrypter to OpenDecompressor and handling it with generic code in the base class.
2023-12-14 17:22:30 +01:00
Christoph Oelckers
728bbd6327 fix some stuff 2023-12-14 17:22:30 +01:00
Christoph Oelckers
39020f7f95 preparations for getting rid of FZipLump
* allow ancient compression algorithms to be handled by OpenDecompressor.
* move FCompressedBuffer to fs_files.h
* use a mutex lock for 7z access because it cannot be made thread save otherwise.
2023-12-14 17:22:30 +01:00
Christoph Oelckers
9710c71669 got rid of FWadFileLump 2023-12-14 17:22:30 +01:00
Christoph Oelckers
854097024f Get rid of FUncompressedFile::Lumps
(RFF is inoperable in this commit!)
2023-12-14 17:22:30 +01:00
Christoph Oelckers
27a356814c got rid of F7ZLump 2023-12-14 17:22:30 +01:00
Christoph Oelckers
f5f9d5b5d8 got rid of FDirectoryLump. 2023-12-14 17:22:30 +01:00
Christoph Oelckers
3b0d101607 move GetRawData and associated code out of FResourceLump 2023-12-14 17:22:29 +01:00
Christoph Oelckers
ae1bd3c890 set up the new Entries array. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
e9700e2771 remove unused variable 2023-12-14 17:22:29 +01:00
Christoph Oelckers
fe106d9bfe merge FileData and ResourceData. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
d2cb44b1bf get rid of the FResourceLump pointer in LumpRecord. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
dc52cac89e more access methods for FResourceFile 2023-12-14 17:22:29 +01:00
Christoph Oelckers
aaea3d52aa fixed more warnings. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
c1ecc41f9d rewrote FileSystem::AddFromBuffer so that it gets backed by an actual FResourceFile. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
0a1eccef92 remove unused FileSystem::AddExternalFile method. 2023-12-14 17:22:29 +01:00
Christoph Oelckers
21acb9d467 simplify lump filter setup and move the Doom special case for 'doom.doom' out of FResourceFile 2023-12-14 17:22:28 +01:00
Christoph Oelckers
c95d611c1f fixed ibm437_to_utf8 2023-12-12 18:07:31 +01:00
Rachael Alexanderson
0bf634013e - fix nullptr dereference 2023-12-11 08:00:23 +01:00
Rachael Alexanderson
93772c4e0c - add new ccmd cvarsearch allows searching cvar by name, languageid, or description 2023-12-11 08:00:23 +01:00
Christoph Oelckers
6ff667a490 fixed savepic loading. 2023-12-10 22:14:09 +01:00
Christoph Oelckers
f873946bd0 fixed some warnings. 2023-12-10 13:31:50 +01:00
Christoph Oelckers
36d05112d5 backend update from Raze.
Mainly fixing case table for Georgian script and de-inlining M_Calloc.
2023-12-10 13:26:43 +01:00
Christoph Oelckers
749d4e3acb use the FResourceFile interface in favor of FResourceLump's where possible. 2023-12-10 12:20:06 +01:00
Christoph Oelckers
5c04185d5a renamed things. 2023-12-10 12:06:52 +01:00
Christoph Oelckers
96b3f1f5e0 removed unused variable in M_FindResponseFile and added file length check in ANM player. 2023-12-10 11:55:42 +01:00
Christoph Oelckers
02a6e0422d Clang did not like this... 2023-12-10 11:00:44 +01:00
Christoph Oelckers
7d0ad4897f use proper access functions to ResourceData. 2023-12-10 10:32:16 +01:00
Christoph Oelckers
4da196a416 UTF8 conversion stuff.
This is for dealing with Unicode file names which cannot be handled with an idealized Unicode approach as was present before.
utf8proc was included to handle normalization because with externally provided filenames we have no control over enforcing our pld rules.
2023-12-10 10:29:38 +01:00
Christoph Oelckers
df56fc65e0 rework some of the friend-dependent access to FResourceLump. 2023-12-10 10:26:44 +01:00
Christoph Oelckers
ebc808e2a9 did some cleanup of the FResourceFile interface.
* making all members protected (but adding friend overrides for the classes which still need it)
* allowing to read data without retrieving the FResourceLump object.
2023-12-10 10:24:39 +01:00
Christoph Oelckers
fc84579319 let FileReader::Read return an opaque buffer instead of std::vector.
This can later allow returning a pointer to a static buffer from a cache without creating copies.
2023-12-10 09:07:49 +01:00
Christoph Oelckers
54fb37e39e changed SoundEngine::ReadSound back to a TArray. 2023-12-10 09:07:48 +01:00
Christoph Oelckers
41573df58f added STL compatible access functions to TArray.
This allows using them in templates made for STL containers.
2023-12-10 09:07:48 +01:00
Tyler Schneider
429d402dc4 Fixed console rendering crash on wide consoles 2023-12-10 07:18:28 +01:00
Ricardo Luís Vaz Silva
43c70cdf9d JIT-Compile all functions during startup 2023-12-06 17:44:51 -05:00
Ricardo Luís Vaz Silva
aed85a25a2 serialize cvars 2023-11-25 21:06:39 -05:00
Ricardo Luís Vaz Silva
74ace89d6e properly serialize int-backed keys for maps 2023-11-25 21:06:39 -05:00
Rachael Alexanderson
4b54aac288 - rename ZSprites to VisualThinkers 2023-11-22 12:11:57 -05:00
Ricardo Luís Vaz Silva
4ec76afc40 move all doom-specific loops out of common code 2023-11-20 22:11:05 -05:00
Ricardo Luís Vaz Silva
71999e7cf6 add foreach(a/type a : thinkeriterator/actoriterator) 2023-11-20 22:11:05 -05:00
Ricardo Luís Vaz Silva
f5507a7373 add foreach(a/l/a,p/l,p/a,p,f/l,p,f : blocklinesiterator/blockthingsiterator) 2023-11-20 22:11:05 -05:00
Ricardo Luís Vaz Silva
5cb0e3bc5b add foreach v loop for maps 2023-11-20 22:11:05 -05:00
Ricardo Luís Vaz Silva
c58bd6efb5 add foreach k,v loop for maps
* make FxFunctionCall and FxMemberFunctionCall take a temporary for args, since they always move it
* fix type for cast
2023-11-20 22:11:05 -05:00
Ricardo Luís Vaz Silva
b6b6b0cb89 fix gcc/clang 2023-11-20 22:08:33 -05:00
Ricardo Luís Vaz Silva
5d5e7ca042 Decoupled IQM Model Animations 2023-11-20 22:08:33 -05:00
Ricardo Luís Vaz Silva
1a8dfd2dfa ActorModelData cleanup in preparation for decoupled model animations 2023-11-20 22:08:33 -05:00
Christoph Oelckers
c73f805110 restore accidentally deleted 'else'. 2023-11-19 13:01:08 +01:00
Christoph Oelckers
0b36beb10d serialize the remap data of custom translations defined at run time. 2023-11-19 12:44:22 +01:00
Christoph Oelckers
8e319a7669 allow comparisons between ints and translation IDs in pre 4.12 ZScript. 2023-11-19 07:47:23 +01:00
Christoph Oelckers
eaf43dfb96 fixed potential nullptr dereference. 2023-11-19 07:22:12 +01:00
Major Cooke
b6b1b25035 Added ZSprites.
- Effectively similar to Actors, but without the excess.
- Can be created with either the `level` function or the static `Spawn` function in ZSprite.
- STAT_SPRITE belongs to ZSprites only; ZSprites cannot be moved out of, nor can anything else be moved in to, this statnum.

Misc:

- Fixed (Sprite)Offset taking roll into account.

Crediting phantombeta, RicardoLuis0 and RaveYard for assistance.
2023-11-17 08:06:11 -05:00
Ricardo Luís Vaz Silva
3056786f38 Add missing loop 2023-11-14 20:14:48 +01:00
Rachael Alexanderson
747e55ce60 - fix GL ES switch appearing as 'Unknown' in the menu sometimes 2023-11-13 17:12:00 -05:00
Ricardo Luís Vaz Silva
fc130ccaac Serialize Name Keys as Strings for maps 2023-11-13 06:19:10 +01:00
Christoph Oelckers
578a398981 use FTranslationID in the 2D code. 2023-11-09 23:04:11 +01:00
Christoph Oelckers
9f90c64727 use FTranslationID in the high level parts of the hardware renderer. 2023-11-09 23:04:11 +01:00
Christoph Oelckers
c5c822ea75 use FTranslationID in the model code. 2023-11-09 23:04:11 +01:00
Christoph Oelckers
8c5eb2c807 use FTranslationID in all places where strict type checking is needed.
This means all properties in serializable classes now use this wrapper type. The backend hasn't been changed yet
2023-11-09 23:04:10 +01:00
Christoph Oelckers
f0c9b1765e gave translations a dedicated scripted type.
This is needed for implementing reliable serialization of custom translations. As long as they are merely ints they cannot be restored on loading a savegame because the serialization code does not know that these variables are special.
2023-11-09 23:04:10 +01:00
Christoph Oelckers
d5e9783324 fixed bad parameter types in direct native functions.
bool can cause undefined behavior here, these should be int.
2023-11-07 18:06:50 +01:00
Ricardo Luís Vaz Silva
e26f9fb13d fix int assign optimization constants generating broken code because they weren't expected 2023-11-01 16:51:26 +01:00
Professor Hastig
4d88e82e32 added Wads.GetLumpLength. 2023-10-26 09:41:27 -04:00
Christoph Oelckers
28400a12f1 fixed savegame file name check.
Writer and reader for the savegame metadata were mismatched so the readback of non-ASCII filenames failed.
2023-10-25 17:27:41 +02:00
Rachael Alexanderson
6d1ebf5f27 - allow FORCEBACKCULLFACES to work with hud models 2023-10-25 10:57:48 -04:00
Professor Hastig
731cad7553 do not print all GL extensions to the log for the GLES renderer. 2023-10-25 16:23:44 +02:00
Christoph Oelckers
d65d1a3b82 minor backend update from Raze. 2023-10-17 20:54:27 +02:00
Ricardo Luís Vaz Silva
1957c15a41 give error instead of warning for zscript 4.12+ on return count mismatch 2023-10-15 18:51:05 +02:00
Ricardo Luís Vaz Silva
d699ba248e warn when fewer returns than expected are given for a function 2023-10-15 18:51:05 +02:00
Ricardo Luís Vaz Silva
dccce46d5b allow "&" instead of "out" in function pointer parameters 2023-10-11 19:46:53 +02:00
Ricardo Luís Vaz Silva
c935a95cb0 Add function pointer Properties 2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
0e9135132d Allow FindFunctionPointer to return non-virtual methods 2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
d9a88d7080 Fix deserialization of methods inside function pointers 2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
e61bd10bbf Finish implementing function pointers
Allow using function literals with function pointers, allow narrowing classes parameter types, and widening classes in return types, allow pointers to non-static, non-virtual functions, add null checking to function calls
2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
23c21b23c3 cleanup. 2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
0ce4b3e7fb update/cleanup function pointers 2023-10-11 19:12:48 +02:00
Ricardo Luís Vaz Silva
e3704605d8 Implement Static Function Pointers 2023-10-11 19:12:48 +02:00
Rachael Alexanderson
88b5d9aba1 - fix $PROGDIR expansion being case sensitive 2023-10-10 10:29:01 -04:00
Christoph Oelckers
79f2fc6553 backend update from Raze.
Mainly a VMFunction script type and some associated utilities.
2023-10-09 18:45:30 +02:00
Christoph Oelckers
ac646e96be use copystring instead of strdup when reading environments.
The mismatched the underlying code which allocates via copystring.
2023-10-08 11:54:14 +02:00
Christoph Oelckers
448ca88bfd fixed some signed-ness issues. 2023-10-08 08:11:56 +02:00
Ricardo Luís Vaz Silva
04c167f181 final final GetChars fix on linux 2023-10-08 07:31:59 +02:00
Ricardo Luís Vaz Silva
f0be58e862 hopefully the last few GetChars fixes for linux 2023-10-08 07:31:59 +02:00
Ricardo Luís Vaz Silva
f4fb583c6c more GetChars fixes in linux/macOS 2023-10-08 07:31:59 +02:00
Ricardo Luís Vaz Silva
c69941e49d fix GetChars in linux/macOS 2023-10-08 07:31:59 +02:00
Christoph Oelckers
6055ff029d the remaining GetChars additions.
The offending operator const char * no longer exists.
2023-10-07 23:44:01 +02:00
Christoph Oelckers
7a5a2858a2 yet even more GetChars calls added. 2023-10-07 23:29:24 +02:00
Christoph Oelckers
c94c63110e added a third batch of GetChars call to FStrings. 2023-10-07 23:03:40 +02:00
Christoph Oelckers
89535b803a Backend update from Raze. 2023-10-07 18:42:24 +02:00
Cacodemon345
4497d7fdaa Update LZMA SDK to 23.01
As a bonus, add support for XZ-compressed files in ZIP
2023-10-07 17:31:24 +02:00
Ricardo Luís Vaz Silva
5e96dbc981 Add final and sealed as class options 2023-10-07 17:29:29 +02:00
Ricardo Luís Vaz Silva
42df40941c change version, improve errors for array/map/struct copy 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
b9104e8aa9 Turn Map/Array assignments into Copy
Better error checking for struct assignment

Lock assignments behind version, don't break or "fix" existing code using older ZScript versions
2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
a13b19815c allow "&" instead of "out" in function parameters 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
7a9ca1ad3f Allow dumping jit for mod functions only 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
3cb8f1be44 Don't try to generate code for abstract functions during JIT dump 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
fa8df5a4e5 make Array::Append faster for simple structs
This makes appending arrays of simple types faster
2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
65ea4f91b6 fix TMap move insertion, was using the copy constructor due to a missing std::move 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
b60b3fc09a fix PStruct::AddField not passing mDefFileNo 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
86e4d064e2 fix possible null dereference in FxStructMember::RequestAddress 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
fad350ff80 Make sure maps in return type don't segfault 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
3fc195c5b2 Improve handling of field names in error messages during Map/MapIterator compilation 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
87fcaab512 Fix Typo in Comment 2023-10-07 17:27:35 +02:00
Ricardo Luís Vaz Silva
766c61b3ed Deduplicate Map/MapIterator Types' Code 2023-10-07 17:27:35 +02:00
Professor Hastig
ab8711b57a removed several bad casts to 'long'.
The 'long' type should generally be avoided because its size differs on Windows and Linux/Mac so it is almost guaranteed to cause undefined behavior
2023-10-04 16:47:43 +02:00
Christoph Oelckers
48ba63c022 added even more explicit GetChars() calls. 2023-10-03 15:55:08 +02:00
Christoph Oelckers
1717ff47b2 add GetChars() accessors to many FString uses where const char* is wanted.
By no means complete, it's just a start to get rid of that automatic type conversion operator.
2023-10-03 14:27:39 +02:00
Rachael Alexanderson
d33f2697a3 - set default backend to Vulkan, if Vulkan fails go GLES not OpenGL 2023-10-01 10:35:11 -04:00
alexey.lysiuk
678cab7994 - fixed DumpCPUInfo() definition for non-x64 platforms
fix #2188
2023-09-26 09:48:11 +03:00
Christoph Oelckers
7491361863 - do some cleansing of the GPU string and add CPU name when only getting an anonymous series name.
The cleansing is mainly for AMD's Linux drivers which report too much extraneous info here.
The CPU name helps when classifying anonymous iGPU series.
2023-09-24 22:20:50 +02:00
Christoph Oelckers
7f9df12431 - Survey: return more meaningful info for current OS and Vulkan version. 2023-09-20 20:03:07 +02:00
Christoph Oelckers
b3cb2fafc7 stats 2023-09-20 19:49:54 +02:00
Cacodemon345
ba9ce0e83f Switch to miniz from zlib 2023-09-17 23:52:51 +02:00
Christoph Oelckers
71cc93f42c - fixed: ZScript's lump reader may not truncate strings at 0 bytes, like all other callers of GetStringFromLump need. 2023-09-16 07:44:58 +02:00
Magnus Norddahl
45a2cbe081 Update zvulkan to latest version 2023-09-16 00:32:15 -04:00
Christoph Oelckers
b082c50502 - fixed doublebind check with automap.
When no doublebinds get passed to C_DoKey it may not set the doubleclick flag.
For the automap C_DoKey gets called twice, once with the automap bindings and once with the regular bindings and doubleclicks.
2023-09-15 22:00:05 +02:00
Christoph Oelckers
7f7edc4f72 - clear the Dehacked string table after passing it to GStrings.
For some reason std::move does not work here so make sure it won't stick around.
2023-09-15 21:46:53 +02:00
Christoph Oelckers
d001c3464d - removed another bad assert from codegen.cpp 2023-09-15 20:51:05 +02:00
Professor Hastig
85ba35a1f1 - fix Strife-style startup asset check.
The STARTUP0 check is not only redundant but also was wrong. It already gets checked and validated in the asset loading loop, and this up-front check did not handle placement as a graphic.
2023-09-15 19:44:12 +02:00
Christoph Oelckers
eb93c764ee - restrict msglevel filtering only to the notify display, not the console, log and debug output. 2023-09-15 00:40:41 +02:00
Gutawer
23b489960e - put DTA_Localize at the end of the enum for backwards compat with integer usage 2023-09-14 23:24:42 +02:00
Gutawer
44d134298a - add support for not localizing some text functions, and modify menu text fields to use this 2023-09-14 23:24:42 +02:00
Christoph Oelckers
4fd5f00c4b - made all FileReader implementations 64 bit capable. 2023-09-14 21:45:38 +02:00
Christoph Oelckers
30c2524742 - validate text data before drawing the console. 2023-09-14 16:45:06 +02:00
Christoph Oelckers
ffa7891719 - remove pointless assert. 2023-09-14 16:39:21 +02:00
Professor Hastig
a5e1f3bcad - fixed M_GetSavegamesPath for Linux. 2023-09-14 16:31:48 +02:00
Ricardo Luís Vaz Silva
0e70e95fa4 Add Inventory::ModifyBob and Inventory::ModifyBob3D 2023-09-14 16:28:38 +02:00
Ricardo Luís Vaz Silva
e61ab4cbe2 Expose OF_Transient to actors as bNoSaveGame 2023-09-14 16:28:23 +02:00
Christoph Oelckers
52ec2b2a5b - listsounds CCMD 2023-09-13 21:10:08 +02:00
Professor Hastig
8b31e0d3b6 - fix bad stringpool setup in filesystem.
Doing it in the constructor does not work because InitMultipleFiles will clear everything again before building up the directory so it would always be null.
This triggered another bug in file_directory.cpp which used the constructor's unvalidated parameter.
2023-09-13 16:42:22 +02:00
Christoph Oelckers
7f61266621 - fixed memory leaks in file system management 2023-09-11 23:22:24 +02:00
Ricardo Luís Vaz Silva
0243efd851 Fix pointer math in FileSystem to stop debug assertions in std::vector 2023-09-11 04:41:00 -04:00
Christoph Oelckers
a44f7a72ca - fixed voxel loader 2023-09-10 21:31:53 +02:00
Ricardo Luís Vaz Silva
bf0e74447d add float.equal_epsilon and double.equal_epsilon 2023-09-07 10:19:10 -04:00
Christoph Oelckers
e7a79b0d44 - string conversion fixes 2023-09-06 00:19:36 +02:00
Christoph Oelckers
17ab6e851a - make sure that FileWriter::Printf never writes null characters. 2023-09-03 23:48:42 +02:00
Christoph Oelckers
ef8fd472a8 - fixed bad virtual override in FSheetTexture. 2023-09-03 19:52:53 +02:00
Christoph Oelckers
4baabf98c4 - use stb-image for JPEG decoding.
the statically provided library did not provide any advantage over it whatsoever and even libjpeg-turbo's better performance cannot really play out here so ease of use and getting rid of a dependency wins.
2023-09-03 08:34:58 +02:00
Ricardo Luís Vaz Silva
d0a955fef0 Allow disabling colors for NameAllKeys 2023-09-01 18:25:22 +02:00
Christoph Oelckers
ccd39d6df7 - code cleanup 2023-08-25 20:07:48 +02:00
Christoph Oelckers
afecb1ca0f - avoid high stack usage in anmtexture.cpp
MSVC warned about this one.
2023-08-25 20:07:48 +02:00
Christoph Oelckers
e0b3bdaadc - fixed directory loader. 2023-08-23 22:09:58 +02:00
Christoph Oelckers
c6e2e0add2 - fix compilation 2023-08-23 18:26:42 +02:00
Cacodemon345
7c90ea6b84 - Convert the entire image backend infrastructure to be animation-friendly 2023-08-23 18:18:45 +02:00
Christoph Oelckers
53d8a5bb2c - Reverted JPEG XL support because the project is not really usable on vcpkg. 2023-08-23 18:18:45 +02:00
alexey.lysiuk
79be69ec4a - implemented FS_FullPath() function for POSIX 2023-08-23 14:57:22 +03:00
alexey.lysiuk
bfefc12427 - fixed a bunch of Linux and macOS compilation errors 2023-08-23 12:34:33 +03:00
Christoph Oelckers
e28d3b7f0b - fix directory check in POSIX directory loader. 2023-08-22 23:15:23 +02:00
Cacodemon345
99fd354dd9 Fix copyright mistake 2023-08-22 23:11:00 +02:00
Cacodemon345
44a3bd719c JPEG XL implementation 2023-08-22 23:11:00 +02:00
Christoph Oelckers
5a1b858c0e - added some safety checks for reading empty lumps into a std::vector.
These can trip the internal safety checks, even though nothing gets read in.
2023-08-22 22:59:29 +02:00
Christoph Oelckers
42283f56ab - added a quick header check for WebP before loading the entire file for real identification.
This allows quick rejection of virtually everything that's not a WebP without loading the entire file first.
2023-08-22 22:54:54 +02:00
Christoph Oelckers
1748477086 - use FileData for readinf WebP 2023-08-22 22:54:54 +02:00
Christoph Oelckers
c77ece4922 moved private definitions out of public headers. 2023-08-22 22:54:54 +02:00
Christoph Oelckers
ebb71cebf1 - put the entire filesystem code into a namespace and created some subdirectories. 2023-08-22 22:54:54 +02:00
Christoph Oelckers
94c9ee4593 - got rid of the remaining persistent std::strings in the file system.
This also uses the string pool now.
2023-08-22 22:54:54 +02:00
Christoph Oelckers
929cae2f41 - rename File_Name back. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
8e250abe0a - fix lump name setup. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
54dc687436 - use the string pool for storing resource file names. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
6d2047eef6 - also use the stringpool for the lump names in the filesystem. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
3d673e3f20 - use a string pool to store the filenames in FResourceLump. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
4f8305de5f - use the lump cache directly for FileData.
This was the final puzzle piece to allow using memory mapped files. :)
2023-08-22 22:54:53 +02:00
Christoph Oelckers
2c2bf0265f - refactored all places which treated FileData as zero terminated. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
79e6d068a9 - got rid of the last two TArrays in the filesystem class. 2023-08-22 22:54:53 +02:00
Christoph Oelckers
535eb9a853 - use std::vector in GetFilesInFolder 2023-08-22 22:54:52 +02:00
Christoph Oelckers
2a6fb6da84 - use better hash function.
This is djb2 which is supposedly one of the best string hashing functions around.
Avoids annoying dependencies and is a lot simpler and faster than the alternatives.
2023-08-22 22:54:52 +02:00
Christoph Oelckers
5433430767 - FString is always gone. 2023-08-22 22:54:52 +02:00
Christoph Oelckers
3e3526f1ec - use a local hash function in the file system. 2023-08-22 22:54:52 +02:00
Christoph Oelckers
acd5911cd4 - StringPool class added
This is a specialized stripped doen FMemArena.
2023-08-22 22:54:52 +02:00
Christoph Oelckers
4906d287cb - use std::vector<std::string> to pass the file list to InitMultipleFiles 2023-08-22 22:54:52 +02:00
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