1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:59:57 +00:00
Commit graph

55 commits

Author SHA1 Message Date
Alexei Kotov
78eda530ac Simplify material file pointer acrobatics 2024-04-23 00:34:38 +03:00
psi29a
023c0f7a46 Merge branch 'vfs_normalized_path_6' into 'master'
Use normalized path for music related functions

See merge request OpenMW/openmw!4038
2024-04-22 07:02:14 +00:00
Alexei Kotov
4e3d45db1b Deduplicate file handling in niftest 2024-04-20 19:43:42 +03:00
Alexei Kotov
1d65aaee71 Formatting 2024-04-20 19:43:42 +03:00
Alexei Kotov
4a03555d53 Add BGEM/BGSM file support to niftest 2024-04-20 19:43:40 +03:00
elsid
e11a5a4352
Use normalized path for SoundManager::playPlaylist 2024-04-19 22:43:20 +02:00
elsid
79b73e45a1
Replace std::filesystem::path by std::string and std::string_view in nif code
It's used only for error reporting.
2024-03-11 22:07:37 +01:00
elsid
df077a2524
Simplify and reduce code duplication for BSA archive creation 2024-02-18 14:54:14 +01:00
psi29a
7450b11402 Merge branch 'vfs_normalized_path_1' into 'master'
Use normalized path for VFS manager and RecursiveDirectoryIterator

See merge request OpenMW/openmw!3806
2024-01-28 21:34:01 +00:00
Alexei Kotov
29a40c212f Support parsing KF files in niftest
Mention BA2 support in help messages
2024-01-25 15:53:24 +03:00
elsid
70061329a1
Return Path::Normalized from RecursiveDirectoryIterator 2024-01-24 22:19:03 +01:00
jvoisin
ec6ac8058b Merge branch 'vfs_normalized_path' into 'master'
Add type for normalized VFS path and use for VFS::Manager file map key

See merge request OpenMW/openmw!3781
2024-01-23 20:42:48 +00:00
Evil Eye
27fa411f4f Convert strings in nif files to utf8 2024-01-16 20:56:58 +01:00
elsid
a2147d70cc
Use forward declaration for some VFS types
This will allow to save on preprocessed code size in the future changes.
2024-01-16 01:32:11 +01:00
Alexei Kotov
b96600a7fb Make niftest exceptions more informative 2023-11-30 22:35:46 +03:00
Alexei Kotov
3be0ee824a niftest updates
Properly read archives within the supplied data directories
Don't print quote marks redundantly
Reduce code duplication
Improve logging
2023-11-27 03:09:38 +03:00
Alexei Kotov
1e3da5516a Fix BA2 handling in niftest 2023-09-17 19:30:30 +03:00
Andrei Kortunov
c50769c8c5 Catch filesystem exceptions 2023-07-31 16:35:31 +04:00
Evil Eye
eeda48ec50 Drop support for --fs-strict 2023-06-08 21:10:09 +02:00
Cédric Mocquillon
d30deef4b5 Use the right archive type to load bsa according to their type 2023-03-02 21:07:54 +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
elsid
d20b05c7fb
Support reading specific nif files from archive by niftest 2023-02-08 22:59:33 +01:00
elsid
2c43a8558a
Add option to disable debug log for unsupported nif files
It becomes quite extensive and not very useful when loading oblivion content
files.
2023-02-08 22:59:29 +01:00
elsid
ac5f22445e
Support compressed BSA archives by niftest 2023-02-08 22:07:37 +01:00
elsid
1a2c56fefb
Fix checking for file extension in niftest 2023-02-08 21:54:25 +01:00
jvoisin
cd29c181cf Another pass with IWYU 2022-10-10 15:16:18 +02:00
elsid
f2fb3d6de8
Separate NIFFileReader from NIFFile
NIFFile might not always be created from a file or stream containing NIF data.
Basically there are 2 different responsibilities for this class:
1. Read NIF file
2. Provide input for nifosg and bulletnifloader.

Remove no longer needed NIFFileMock since the state of NIFFfile can be
initialized independently from reading NIF file.
2022-09-24 19:10:14 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid
4698a4cd2d
Use raw string literals to format command usage messages 2022-09-12 21:00:51 +02:00
elsid
6ae15f08e0
Avoid chained operator() calls to prevent formatting issues 2022-09-12 16:48:15 +02:00
Project579
4e428dee12 Update some settings that accept paths by "std::string" to accept them as "std::filesystem::path" instead. 2022-09-11 14:41:20 +02:00
Project579
a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2022-09-11 14:41:20 +02:00
Project579
6bf4c7a04f Upgraded "input-file" command line option to Files::MaybeQuotedPath from std::string to allow unicode characters on Windows. 2022-09-11 14:41:20 +02:00
Project579
e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2022-09-11 14:41:15 +02:00
elsid
f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00
elsid
9398e97600
Avoid manual memory management for VFS archives 2022-07-16 15:30:14 +02:00
jvoisin
472af7c164 Remove boost::filesystem from niftest 2022-05-22 18:56:14 +02:00
elsid
5eb8c4aebe
Avoid redundant conversion to const char* and use make_shared 2022-04-10 22:33:08 +02:00
Bret Curtis
74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
2022-01-23 17:30:25 +01:00
Evil Eye
751e8cf76b Do a bounds check before calling functions defined in cctype 2021-11-14 11:26:15 +01:00
Cédric Mocquillon
d4e26746a3 Use recurse subdirectory iterator to iterate over the VFS without exposing internal details 2021-09-14 18:09:54 +02:00
Thunderforge
ded7bd92e6 Using auto keyword in most apps
Detected by clang-tidy's modernize-use-auto
2021-05-18 19:20:59 -05:00
Thunderforge
339d347aea Fixing performance-faster-string-find issues
This addresses the Clang Tidy check [performance-faster-string-find](https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html).
2021-05-10 22:44:07 -05:00
Alexei Dobrohotov
c857588ee9 Remove NIFFile settings manager dependency 2020-11-09 14:24:48 +03:00
Andrei Kortunov
fd5e9cf271 Catch possible boost::bad_any_cast exception 2019-03-19 09:11:14 +04:00
Andrei Kortunov
68c170f065 Refactor tools to do not use boost exceptions and exit() command 2018-11-15 18:10:19 +04:00
Andrei Kortunov
f20d1b1b72 Catch exception in the NIFTest 2018-11-14 15:52:36 +04:00
tri4ng1e
d4d1703bcf
Some PVS-Studio and cppcheck fixes
cppcheck:
[apps/esmtool/record.cpp:697]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1126]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1138]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/niftest/niftest.cpp:36]: (performance) Function parameter 'filename' should be passed by reference.
[apps/niftest/niftest.cpp:41]: (performance) Function parameter 'filename' should be passed by reference.
[apps/opencs/model/prefs/boolsetting.cpp:25]: (warning) Possible leak in public function. The pointer 'mWidget' is not deallocated before it is allocated.
[apps/opencs/model/prefs/shortcuteventhandler.cpp:52]: (warning) Return value of std::remove() ignored. Elements remain in container.
[apps/openmw/mwstate/quicksavemanager.cpp:5]: (performance) Variable 'mSaveName' is assigned in constructor body. Consider performing initialization in initialization list.

PVS-Studio:
apps/opencs/model/filter/parser.cpp  582  warn  V560 A part of conditional expression is always true: allowPredefined.
apps/opencs/view/world/referencecreator.cpp  67  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/world/referencecreator.cpp  74  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !completed.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !error.empty().
apps/opencs/model/tools/pathgridcheck.cpp  32  err  V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 32, 34.
apps/opencs/model/world/refidadapterimp.cpp  1376  err  V547 Expression 'subColIndex < 3' is always true.

apps/openmw/mwgui/widgets.hpp  318  warn  V703 It is odd that the 'mEnableRepeat' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:318, MyGUI_ScrollBar.h:179.
apps/openmw/mwgui/widgets.hpp  319  warn  V703 It is odd that the 'mRepeatTriggerTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:319, MyGUI_ScrollBar.h:180.
apps/openmw/mwgui/widgets.hpp  320  warn  V703 It is odd that the 'mRepeatStepTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:320, MyGUI_ScrollBar.h:181
apps/openmw/mwmechanics/actors.cpp  1425  warn  V547 Expression '!detected' is always true.
apps/openmw/mwmechanics/character.cpp  2155  err  V547 Expression 'mode == 0' is always true.
apps/openmw/mwmechanics/character.cpp  1192  warn  V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
apps/openmw/mwmechanics/character.cpp  521  warn  V560 A part of conditional expression is always true: (idle == mIdleState).
apps/openmw/mwmechanics/pathfinding.cpp  317  err  V547 Expression 'mPath.size() >= 2' is always true.
apps/openmw/mwscript/interpretercontext.cpp  409  warn  V560 A part of conditional expression is always false: rank > 9.
apps/openmw/mwgui/windowbase.cpp  28  warn  V560 A part of conditional expression is always true: !visible.
apps/openmw/mwgui/journalwindow.cpp  561  warn  V547 Expression '!mAllQuests' is always false.
apps/openmw/mwgui/referenceinterface.cpp  18  warn  V571 Recurring check. The '!mPtr.isEmpty()' condition was already verified in line 16.
apps/openmw/mwworld/scene.cpp  463  warn  V547 Expression 'adjustPlayerPos' is always true.
apps/openmw/mwworld/worldimp.cpp  409  err  V766 An item with the same key '"sCompanionShare"' has already been added.
apps/openmw/mwworld/cellstore.cpp  691  warn  V519 The 'state.mWaterLevel' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 689, 691.
apps/openmw/mwworld/weather.cpp  1125  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1123, 1125.
apps/openmw/mwworld/weather.cpp  1137  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1137.

apps/wizard/unshield/unshieldworker.cpp  475  warn  V728 An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression.
apps/wizard/installationpage.cpp  163  warn  V735 Possibly an incorrect HTML. The "</p" closing tag was encountered, while the "</span" tag was expected.

components/fontloader/fontloader.cpp  427  err  V547 Expression 'i == 1' is always true.
components/nifosg/nifloader.cpp  282  warn  V519 The 'created' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 278, 282.
components/esm/loadregn.cpp  119  err  V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 112, 119.
components/esm/cellref.cpp  178  warn  V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 175, 178.
components/esmterrain/storage.cpp  235  warn  V560 A part of conditional expression is always true: colStart == 0.
components/esmterrain/storage.cpp  237  warn  V560 A part of conditional expression is always true: rowStart == 0.
2018-04-18 12:36:10 +00:00
Arthur Moore
c7b97ee9ba Cleaned up niftest's output
A bad file inside of a bsa archive now looks like:
<game dir>/Data Files/TR_Data.bsa/meshes/tr/x/tr_act_ind_mark_alm.nif
2015-08-07 20:52:34 -04:00