1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-24 11:26:36 +00:00
Commit graph

190 commits

Author SHA1 Message Date
elsid
16abb436e2
Fix potential overflows on reading BSA header 2025-10-06 00:03:12 +02:00
elsid
c87cc643d1
Add tests for BSAFile 2025-10-06 00:02:32 +02:00
elsid
d7f6d7c13c
Add unit tests for CompressedBSAFile 2025-10-06 00:02:32 +02:00
elsid
a111391992
Check for failures after reading from stream in BSA 2025-10-06 00:02:32 +02:00
elsid
801224749f
Handle errors when computing stream size for BSA 2025-10-06 00:02:32 +02:00
elsid
796202f435
Use fail function to verify stream state in BSA
If there is a failure to read the file like unexpected EOF, bad returns
false, but fail returns true. Important for reading number of items more
than the file actually has.
2025-10-06 00:02:32 +02:00
elsid
9a449ed506
Only reserve capacity when reading collections
But do not initialize. If the meta information is invalid and has a big
value, initialization will take significant amount of time but there
might be no actual data in the file because it's too small.
2025-10-06 00:02:31 +02:00
elsid
38f6c5a68b
Properly handle duplicated BSA folders
Deduplicate folders first and then add their files to mFiles.
2025-10-06 00:02:31 +02:00
elsid
c92e321a08
Use std::string_view for BSA file name 2025-10-06 00:02:31 +02:00
elsid
c388fda5e4
Handle empty file name in BSA 2025-10-06 00:02:28 +02:00
elsid
91ccb0fe8d
Use proper naming for BSA File and Hash members 2025-09-20 19:21:17 +02:00
Evil Eye
a085036a92 Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
Alexei Kotov
6796121305 Use zlib directly for BSA file decompression (#8569) 2025-07-17 22:25:18 +03:00
Evil Eye
206d38f3d7 Fix path handling for files in BSAs 2025-07-03 08:46:23 +02:00
Alexei Kotov
5d5595cc5b Standardize components/bsa file include guards and order 2025-02-22 21:12:28 +03:00
Alexei Kotov
0254feefe3 Rename bsa_file.cpp/hpp to follow naming conventions 2025-02-22 20:52:39 +03:00
Alexei Kotov
a5d936993f Clarify Fallout 4 next gen update BA2 version naming 2024-04-28 05:09:40 +03:00
Alexei Kotov
52d77e3a45 Version 8 texture BA2s found 2024-04-26 16:45:30 +03:00
Alexei Kotov
61b6150c01 Properly detect the version for post-FO4 BA2 formats 2024-04-26 10:50:06 +03:00
Alexei Kotov
f796e051cb Support zlib-compressed version 3 DDS BA2s 2024-04-26 10:45:03 +03:00
Alexei Kotov
b32385a0af Fix BA2 signature check 2024-04-26 10:32:17 +03:00
Alexei Kotov
22fb3d7f83 Add support for Fallout 4 next-gen update BA2s 2024-04-26 10:30:42 +03:00
AnyOldName3
ff3ffa13b6 Auto format 2024-03-14 23:54:22 +00:00
AnyOldName3
28131fd62b Fixes for a whole bunch of warnings
These warnings were always enabled, but we didn't see them due to https://gitlab.com/OpenMW/openmw/-/issues/7882.
I do not fully understand the cause of 7822 as I can't repro it in a minimal CMake project.

Some of these fixes are thought through.
Some are sensible best guesses.
Some are kind of a stab in the dark as I don't know whether there was a
possible bug the warning was telling me about that I've done nothing to
help by introducing a static_cast.

Nearly all of these warnings were about some kind of narrowing
conversion, so I'm not sure why they weren't firing with GCC and Clang,
which have -Wall -Wextra -pedantic set, which should imply -Wnarrowing,
and they can't have been affected by 7882.

There were also some warnings being triggered from Boost code.
The vast majority of library headers that do questionable things weren't
firing warnings off, but for some reason, /external:I wasn't putting
these Boost headers into external mode.

We need these warnings dealt with one way or another so we can switch
the default Windows CI from MSBuild (which doesn't do ccache) to Ninja
(which does).
I have the necessary magic for that on a branch, but the branch won't
build because of these warnings.
2024-03-14 23:39:33 +00:00
elsid
8c6e0866e0
Avoid seek for detecting BSA type
Seek is pretty expensive operation. Try to read first 12 bytes instead.
2024-02-18 14:54:51 +01:00
elsid
cc9f9b53ba
Convert BsaVersion to enum class 2024-02-18 14:54:51 +01:00
Alexei Kotov
84ab7afd44 Make BA2 extension hash calculation safer (#7784) 2024-01-21 23:03:37 +03:00
Andrei Kortunov
87c9f395f1 Move local variables in components 2024-01-19 16:01:48 +04:00
psi29a
64bdbe339d
Merge branch 'starfieldbsa' into 'master'
Support Starfield BA2s

See merge request OpenMW/openmw!3392
2023-09-01 08:06:25 +00:00
Alexei Kotov
b2bb19ae4d Support Starfield BA2s 2023-08-30 21:57:30 +03:00
Alexei Kotov
4d717ade6c Allow BSA string tables to contain padding 2023-08-30 17:39:20 +03:00
psi29a
7233277d27 Merge branch 'compressedbsagozoomzoom' into 'master'
Rewrite compressed BSA loading

See merge request OpenMW/openmw!3361
2023-08-21 09:29:28 +00:00
Alexei Kotov
ab4ed390fc Rewrite compressed BSA loading 2023-08-20 13:19:32 +03:00
Cédric Mocquillon
3b1d6a7e62 Use the right size 2023-08-18 21:32:49 +02:00
Alexei Kotov
353b06325e Fix unintended sign extension in compressed BSA hash generation
Which, however, never happens with non-ASCII characters
2023-07-24 01:18:56 +03:00
elsid
b8525e8e3d
Fix code format 2023-04-18 20:23:03 +02:00
fall-leaf
cc7e29c9a2 opensuse build fix 2023-04-17 23:40:15 +03:00
Cédric Mocquillon
19fbba080d Add a check if the requested file is not found 2023-03-06 21:26:51 +01:00
Cédric Mocquillon
7f936ad18f Some cleanup on includes 2023-03-06 21:26:20 +01:00
Cédric Mocquillon
64ce6eb6bc Merge the two identical conditions 2023-03-06 21:25:53 +01:00
Cédric Mocquillon
1a7b2cd611 Fix remaining bugs 2023-03-06 15:50:45 +01:00
Cédric Mocquillon
d2244c8d97 Fix detectVersion 2023-03-03 20:49:31 +01:00
Cédric Mocquillon
78251a2bb1 Move outside the condition + fix bug: missing offset 2023-03-03 17:09:38 +01:00
Cédric Mocquillon
d73ab7ef6f Add comments 2023-03-03 17:09:38 +01:00
Cédric Mocquillon
24272d07bf Share generateHash used in ba2dx10file and ba2gnrlfile 2023-03-03 17:09:35 +01:00
Cédric Mocquillon
974799c011 Handle DX10 case of ba2 format 2023-03-02 18:40:44 +01:00
Cédric Mocquillon
c1fbe90953 Handle GNRL case of ba2 format 2023-03-02 18:19:58 +01:00
jvoisin
3cbf1dc042 First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
elsid
063fff7fa4
Fix and prevent -Wextra-semi warning 2022-10-06 00:26:43 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00