1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-07-01 14:11:34 +00:00
Commit graph

8523 commits

Author SHA1 Message Date
AnyOldName3
396cd1c727 Fix Windows Debug build
This was a regression from https://gitlab.com/OpenMW/openmw/-/merge_requests/4596

Also move more things into the anonymous namespace because there's not really a reason not to and I had to rearrange things anyway.
2025-04-11 17:33:19 +01:00
AnyOldName3
48572e4c96 Even more elses 2025-04-10 18:32:52 +01:00
AnyOldName3
37dc1a6a76 Remove redundant elses 2025-04-10 16:51:23 +01:00
AnyOldName3
15162a734d Avoid IO in resolveParentFileIndices
In the olden days, we passed it a vector of open ESMReader instances, as they knew the filenames and sizes, so were a convenient source of this knowledge.

When the ReadersCache was introduced as a pool of readers to limit the maximum number of simultaneously open file handles (to avoid going over the OS' limit) it was a poor substitute.
* We iterate over all the earlier readers in order in a double loop, which is the worst case scenario for an LRU pool as once we're past the size limit, we're guaranteed maximum thrashing - the least recently used item is the most likely to be used next, so the worst to evict.
* We didn't want to read any ESM files, just know whether they'd been read and what their sizes were, so didn't want to open a file handle, which the ReadersCache forced us to do.

Obviously, opening lots of file handles isn't fast, and as this was an operation done for each content file which iterated over the file's masters and within that loop iterated over every loaded file, that's O(n^3) complexity in the worst case, and for things like delta plugin merged plugins, they hit the worst case in long load orders.

This resolves the freeze reported as https://gitlab.com/OpenMW/openmw/-/issues/8425, but there may be other freezes on launch.
2025-04-10 16:16:19 +01:00
psi29a
ea8369eff0 Merge branch 'dont-redraw-the-whole-gui-every-time-we-change-the-tiniest-thing' into 'master'
Be more careful when we tell Qt that data has changed

Closes #8405

See merge request OpenMW/openmw!4621
2025-04-09 11:19:32 +00:00
AnyOldName3
096759435a Add progress bars where the launcher can be limited by IO
I tested this with a USB3 external hard drive.

These two places were the only ones where we're IO-bound and block the main thread, so they're the only ones that need progress bars.

If trying to replicate this test, then it's important to unplug the hard drive between each repeat.
Apparently Windows is excellent at disk caching these days as it takes a minute and a half to start the launcher with Total Overhaul on this drive when it's just been plugged in, but less time than the first launch after a reboot on an NVME drive once the cache has been warmed up.
2025-04-09 01:36:52 +01:00
AnyOldName3
894ea4ba62 Don't precompute load order errors after every change
It's much slower than doing it on demand as it only takes a microsecond, but for a really big load order, there are hundreds of thousands of intermediate calls before everything's set up and we can draw the GUI.
2025-04-08 01:19:24 +01:00
AnyOldName3
d6b61f1f54 Sprinkle some const&
QStringView required more fighting as loads of call sites take a const&
2025-04-08 00:34:45 +01:00
AnyOldName3
e779f115ef Exclude directories from containsDataFiles
Also include capo's microoptimisation even though it doesn't make things any faster.
2025-04-07 16:11:27 +01:00
psi29a
bd1c2a11d7 Merge branch 'herbalfish' into 'master'
Fix some graphic herbalism issues

See merge request OpenMW/openmw!4624
2025-04-07 11:03:55 +00:00
psi29a
211a5e5bda Merge branch 'lightminimumradius' into 'master'
Give point lights a minimum radius of 16

See merge request OpenMW/openmw!4601
2025-04-06 16:03:35 +00:00
Evil Eye
962ef91e25 Allow skinned plants to be harvested 2025-04-06 11:01:26 +02:00
AnyOldName3
973282e471 Optimise ContentSelectorModel::ContentModel::item
This saves about 5% of remaining launcher startup time

Not using fileProperty avoids loads of QVariant conversions.
2025-04-06 02:46:31 +01:00
AnyOldName3
1237746549 Be more careful when we tell Qt that data has changed
Unchecking files only changes whether they're checked, and doesn't completely rearrange the table and change the number of elements it has, so we only need to change the check state, not the whole layout.

It's way faster to just query all the data once after setting a content list than it is to query the data for all files between the old and new location of a file when we change any file's location in the load order.
2025-04-06 01:31:05 +01:00
Alexei Kotov
3523ba564a Merge branch 'non-deprecated-known-folder-api' into 'master'
Use non-deprecated known folder API

See merge request OpenMW/openmw!4603
2025-04-02 19:20:21 +03:00
psi29a
747771ac5e Merge branch 'fontexport' into 'master'
Restore --export-fonts option functionality

See merge request OpenMW/openmw!4561
2025-03-27 11:04:35 +00:00
AnyOldName3
166852254f Use non-deprecated known folder API
SHGetFolderPathW was deprecated in Windows Vista nearly two decades ago. ShGetKnownFolderPath is the replacement.

Also log if there was an error. Someone seemed to be getting an error on Discord, despite other apps being able to get the path just fine with these functions.

Also don't pass the flags to create the folders if they don't exist. We probably don't have the right permissions and if they don't exist, then there are bigger problems. Maybe this will fix the issue the user was having.

Also add a comment about global config on Windows being fundamentally wrong.
2025-03-25 01:32:44 +00:00
Alexei Kotov
f8be5fdd2a Give point lights a minimum radius of 16 2025-03-24 22:14:08 +03:00
elsid
ada48d9021
Reduce a chance to have a deadlock in the AsyncNavMeshUpdater
* Do not fail tile generation if debug mesh writing fails.
* Mark some functions as noexcept to better crash than have a deadlock.
* Unlock tile and remove job if there on exception while processing it.
2025-03-23 23:33:40 +01:00
elsid
7112217adc
Use temporary directory for tests output 2025-03-23 23:33:40 +01:00
elsid
87a2f776b7
Add version to the recast log prefix 2025-03-23 23:33:39 +01:00
elsid
51258662b5
Support max log level for Recast via env variable
Do not write to log if log message level is greater than one speficied
in the OPENMW_RECAST_MAX_LOG_LEVEL env variable. Use Error by default.
2025-03-21 15:34:47 +01:00
elsid
e5f6b77c29
Skip SLSD, SCVR, SCRV subrecords in QUST record
Present in:

Fallout 3 GOTY English/Data/Anchorage.esm
Fallout 3 GOTY English/Data/BrokenSteel.esm
Fallout 3 GOTY English/Data/PointLookout.esm
Fallout 3 GOTY English/Data/ThePitt.esm
Fallout 3 GOTY English/Data/Zeta.esm
2025-03-15 13:11:26 +01:00
elsid
e5ad1cd214 Do not use no longer supported std::char_traits
/usr/bin/../include/c++/v1/string_view:300:42: error: implicit instantiation of undefined template 'std::char_traits<signed char>'
  300 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/home/elsid/dev/openmw/components/to_utf8/to_utf8.cpp:55:41: note: in instantiation of template class 'std::basic_string_view<signed char>' requested here
   55 |     std::basic_string_view<signed char> getTranslationArray(FromType sourceEncoding)
      |                                         ^
/usr/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^

std::char_traits support for non char types was removed from libc++19:
https://reviews.llvm.org/D157058.
2025-03-11 20:32:36 +03:00
elsid
51d73e37df
Fix msvc warnings
components\lua\configuration.cpp(133): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
components\esm3\effectlist.cpp(35): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
components_tests\misc\testmathutil.cpp(54): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
components_tests\misc\testmathutil.cpp(62): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
components_tests\misc\testmathutil.cpp(131): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
components_tests\misc\testmathutil.cpp(135): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
components_tests\misc\testmathutil.cpp(135): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
components_tests\misc\testmathutil.cpp(139): warning C4305: 'argument': truncation from 'const double' to 'osg::Vec3f::value_type'
2025-03-09 17:55:17 +01:00
Alexei Kotov
5f92d520ee Merge branch 'mainmembers' into 'master'
Fix more potential use-after-free issues

See merge request OpenMW/openmw!4566
2025-03-07 00:25:35 +03:00
psi29a
8bbb46b52c Merge branch 'frankfontaine' into 'master'
Properly implement bitmap font kerning (#8378)

See merge request OpenMW/openmw!4565
2025-03-05 21:16:19 +00:00
psi29a
888415059c Merge branch 'fontainofdreams' into 'master'
Allow bitmap font texture reading to end prematurely (#8378)

See merge request OpenMW/openmw!4564
2025-03-05 13:11:10 +00:00
psi29a
1e0bdcc270 Merge branch 'elefont' into 'master'
Further revise bitmap glyph replacements (#7531)

See merge request OpenMW/openmw!4563
2025-03-05 13:09:53 +00:00
Evil Eye
b0e9df0139 Ensure class members are tied to the main Lua state 2025-03-03 19:37:07 +01:00
Alexei Kotov
fd358396fc Properly implement bitmap font kerning 2025-03-03 08:42:39 +03:00
Alexei Kotov
24468fd965 Allow bitmap font texture to end prematurely 2025-03-03 08:29:00 +03:00
Alexei Kotov
c8fe596fc4 Add some remaining missing bitmap substitutions 2025-03-03 08:02:34 +03:00
Alexei Kotov
c50d8195bb Remove custom substitutions for glyphs that may exist in the font 2025-03-03 08:02:16 +03:00
Alexei Kotov
dc3264a3a5 Restore --export-fonts option functionality 2025-03-02 22:33:06 +03:00
uramer
3a98b945a8 Keep MENU-registered input actions between games 2025-02-26 16:56:41 +01:00
Alexei Kotov
602a429a68 Fix UB when pathgrid geometry is generated and all pathgrid edges are invalid 2025-02-16 17:46:52 +03:00
psi29a
782c274d86 Merge branch 'shutupsdl' into 'master'
Silence SDL3 window/display events coming from SDL2-compat

See merge request OpenMW/openmw!4531
2025-02-10 16:58:28 +00:00
psi29a
d2610973dd Merge branch 'shutupssg' into 'master'
Add a dummy serializer for billboards

See merge request OpenMW/openmw!4532
2025-02-10 16:58:21 +00:00
Alexei Kotov
c1960635d2 Optimize NIF boolean vector reading 2025-02-07 04:55:06 +03:00
Alexei Kotov
eaf9488ba0 Silence SDL3 window/display events coming from SDL2-compat 2025-02-04 20:30:19 +03:00
Alexei Kotov
cfa1ad0b33 Add a dummy serializer for billboards 2025-02-04 20:22:14 +03:00
Alexei Kotov
a17bffda26 Merge branch 'blencludes' into 'master'
Remove superfluous includes from animblendrules.cpp

See merge request OpenMW/openmw!4523
2025-01-31 14:46:12 +00:00
Mads Buvik Sandvei
5b1aafb77a Formatting mistakes 2025-01-29 23:01:34 +01:00
Mads Buvik Sandvei
a1df9afc9a Formatting changes 2025-01-26 17:05:42 +01:00
Mads Buvik Sandvei
ea51c55d00 Restore valid per view shadow settings. 2025-01-26 16:31:52 +01:00
Mads Buvik Sandvei
a2f5e1c075 Fix multiview use in techniques 2025-01-26 16:26:36 +01:00
Evil Eye
af9a9a6d64 Remove superfluous includes from animblendrules.cpp 2025-01-20 16:49:22 +01:00
Alexei Kotov
9fc62be2c6 Track ESM4 file loading progress 2025-01-14 20:27:02 +03:00
AnyOldName3
806635b96c Don't unnecessarily overwrite openmw.cfg
We don't need to risk reformatting the user's potentially-handwritten file if it parses to the same thing as we're about to write.
2025-01-12 18:21:06 +00:00
psi29a
ec43849020 Merge branch 'sensiblechain' into 'master'
Handle weird post-processing chains gracefully (#8295)

Closes #8295

See merge request OpenMW/openmw!4509
2025-01-12 17:58:41 +00:00
Alexei Kotov
383876a516 Handle weird post-processing chains gracefully (#8295) 2025-01-11 17:03:59 +03:00
AnyOldName3
e1208b64e7 Update comments 2025-01-09 17:16:06 +00:00
AnyOldName3
29af981345 Don't give commas special meaning when matching comments to openmw.cfg values
Previously, comments would be associated with the openmw.cfg line that followed them, but only up to the first comma.
This meant that if you had fallback=thing,otherthing and fallback=thing,thirdthing, comments above the thirdthing line would be moved above the otherthing line, even though both lines would be kept when the file was written out.

This seemed to be an attempt at a feature when cc9cii first implemented the comment preservation system, but it only seems to cause confusion.
2025-01-09 15:21:14 +00:00
elsid
6464d99134
Throw system error on open file failure 2025-01-06 23:38:32 +01:00
elsid
be1ce81be7
Write debug recast mesh before generating navmesh 2025-01-06 23:38:29 +01:00
psi29a
52d1493500 Merge branch 'suntzuquote' into 'master'
Add an option to match sunlight to the sun (#8032)

Closes #8032

See merge request OpenMW/openmw!4490
2025-01-05 20:08:28 +00:00
Evil Eye
f92b5040c6 Don't add auto started local Lua scripts twice 2025-01-01 13:21:28 +01:00
Alexei Kotov
aa277c0934 Add an option to match sunlight to the sun (#8032) 2024-12-28 18:29:35 +03:00
Evil Eye
6090bfcdab Work around a regression in MSVC 2024-12-09 17:23:17 +01:00
psi29a
a66d4d77bc Merge branch 'todd1252encoding' into 'master'
Revise bitmap glyph replacements (#7531)

Closes #7531

See merge request OpenMW/openmw!4444
2024-12-05 08:01:03 +00:00
Alexei Kotov
b285e2f85f Merge branch 'fix_findpath_use_after_free' into 'master'
Fix findPath returning a raw vector

Closes #8238

See merge request OpenMW/openmw!4470
2024-12-03 09:24:45 +00:00
uramer
1675c74036 Fix findPath returning a raw vector 2024-12-02 21:22:29 +01:00
psi29a
c454675cff Merge branch 'nilightcolorcontroller' into 'master'
Give NiLightColorController its own struct

See merge request OpenMW/openmw!4472
2024-12-02 16:40:05 +00:00
Alexei Kotov
23a46a1bf9 Merge branch 'vfs_normalized_path_22' into 'master'
Use normalized path for KeyframeManager::get (#8138)

See merge request OpenMW/openmw!4463
2024-12-01 21:45:01 +00:00
Alexei Kotov
a923e311f5 Give NiLightColorController its own struct 2024-12-01 02:00:12 +03:00
psi29a
064e3c7c2e Merge branch 'useniftestinstead' into 'master'
Remove write nif debug log setting

See merge request OpenMW/openmw!4468
2024-11-28 18:05:22 +00:00
psi29a
7b992f98e7 Merge branch 'poisoncrank' into 'master'
Save interior fog bounds center to preserve rotation when expanding them

Closes #7013

See merge request OpenMW/openmw!4466
2024-11-27 08:18:29 +00:00
Alexei Kotov
95c38bacc7 Remove write nif debug log setting 2024-11-26 21:31:25 +03:00
psi29a
1dac165356 Merge branch 'precomputedbonematrices' into 'master'
Precompute bone matrices before skinning

See merge request OpenMW/openmw!4467
2024-11-26 09:25:14 +00:00
psi29a
690de3c3f9 Merge branch 'exorcisingtoddfrommyoblivioncopy' into 'master'
Support ESM4::Light with no spotlight data again

See merge request OpenMW/openmw!4465
2024-11-25 08:55:05 +00:00
Alexei Kotov
0f4e0ac818 Precompute bone matrices during skinning 2024-11-25 02:14:41 +03:00
Evil Eye
d57d5d9247 Save interior fog bounds center to preserve rotation when expanding them 2024-11-24 11:49:33 +01:00
Alexei Kotov
ec564b14df Support ESM4::Light with no spotlight data 2024-11-24 03:12:52 +03:00
Alexei Kotov
5433ecf861 Change default depth test mode to <= (#7040) 2024-11-23 08:32:25 +03:00
psi29a
cf3badb8a4 Merge branch 'data_files_menu' into 'master'
Implement a context menu for data directories page

Closes #8130

See merge request OpenMW/openmw!4458
2024-11-21 11:52:16 +00:00
elsid
a550a8af36
Use normalized path for KeyframeManager::get 2024-11-20 21:29:36 +01:00
Andrei Kortunov
bd59247270 Avoid trailing line breaks 2024-11-20 09:04:22 +04:00
elsid
630e815f66
Forbid to use toNormalized for normalized path 2024-11-18 21:21:33 +01:00
psi29a
79dbbceb10 Merge branch 'vfs_normalized_path_20' into 'master'
Use normalized path for correctMeshPath and getLODMeshName (#8138)

See merge request OpenMW/openmw!4455
2024-11-17 12:30:15 +00:00
Alexei Kotov
d11bd7397b Revise bitmap glyph replacements (#7531) 2024-11-16 22:48:52 +03:00
elsid
22817dd6a1
Use normalized path for correctMeshPath 2024-11-16 12:49:11 +01:00
elsid
36198e9413
Use normalized path for getLODMeshName 2024-11-15 01:05:36 +01:00
Andrei Kortunov
2522fe9517 Remove dead code 2024-11-14 22:16:05 +04:00
Evil Eye
d88ddc97cc Avoid an apparent compiler error in MSVC 2019 2024-11-11 17:54:48 +01:00
Pi03k
05a71e982d Move from qt_wrap_ui to AUTOUIC for qt components lib
(#7348)
2024-11-10 20:38:14 +01:00
Evil Eye
6572122acc Use the right deserializer for unloaded scripts 2024-11-09 13:05:39 +01:00
elsid
afa769408a
Use normalized path for correctActorModelPath 2024-11-03 13:50:17 +01:00
elsid
376911f645
Reduce duplication for getting file name 2024-11-03 13:50:17 +01:00
psi29a
362eec43be Merge branch 'noblacklisting' into 'master'
Exterminate script blacklisting (#8214)

Closes #8214

See merge request OpenMW/openmw!4440
2024-11-01 10:22:26 +00:00
psi29a
62079499c1 Merge branch 'nowaterculling' into 'master'
Allow opting out of water culling (#7318)

Closes #7318

See merge request OpenMW/openmw!4441
2024-11-01 10:21:45 +00:00
Evil Eye
81612a5358 Merge branch 'constcorrectattributes' into 'master'
Sprinkle const-correctness in NifLoader

See merge request OpenMW/openmw!4436
2024-10-31 18:55:45 +00:00
Alexei Kotov
5d37cb3b74 Exterminate script blacklisting (#8214) 2024-10-31 14:59:55 +03:00
Alexei Kotov
4f521a94d7 Allow opting out of water culling (#7318) 2024-10-31 14:54:05 +03:00
Alexei Kotov
e27732421e Adjust intro comment for user openmw-cs.cfg (#5859) 2024-10-30 20:23:46 +03:00
Alexei Kotov
b71ec84004 Sprinkle const-correctness in NifLoader 2024-10-30 17:10:08 +03:00
Alexei Kotov
964dafd42c Share texture type attributes 2024-10-29 12:48:54 +03:00
psi29a
1349fdb4f2 Merge branch 'serializable_readonly' into 'master'
Support table-valued settings

See merge request OpenMW/openmw!3917
2024-10-28 18:44:36 +00:00
uramer
e248ba293a Use sol helpers for metatable keys 2024-10-28 16:45:51 +01:00
Alexei Kotov
eea916a43d Save/load INI importer flags in the launcher (#8189) 2024-10-27 21:30:23 +03:00