Bo Svensson
a62b22cd31
isolates groundcover content files ( #3208 )
...
Specifications developed in PR #3206 require that groundcover content files must not be allowed to corrupt normal content files. With this PR we simply isolate our existing loading logic by instantiating a separate `ESMStore` for `Groundcover`. In addition, we remove some outdated workarounds.
2021-11-13 23:37:53 +01:00
Alexei Dobrohotov
63ea57e9cf
Load NiSortAdjustNode and NiAccumulators
2021-11-14 00:31:49 +03:00
psi29a
d0263b6dda
Merge branch 'fix_hash_combine' into 'master'
...
Support seed type different from std::size_t for hashCombine
See merge request OpenMW/openmw!1391
2021-11-13 21:12:13 +00:00
Alexei Dobrohotov
50b90a594d
Loading and basic handling of BSLightingShaderProperty
2021-11-13 22:52:45 +03:00
psi29a
03e88b8e27
Merge branch 'lordofthenifs' into 'master'
...
Load a bunch of Bethesda Havok NIF records
See merge request OpenMW/openmw!1392
2021-11-13 18:51:54 +00:00
psi29a
ba0aae06ca
Merge branch 'morphyslaw' into 'master'
...
Morph geometry more like NifSkope (bug #6416 )
Closes #6416
See merge request OpenMW/openmw!1389
2021-11-13 18:42:17 +00:00
Alexei Kotov
49544cf7de
Merge branch 'no_one_likes_commas' into 'master'
...
Treat commas in scripts as whitespace
Closes #6380
See merge request OpenMW/openmw!1388
2021-11-13 17:19:22 +00:00
Alexei Dobrohotov
d347f8f4f0
Fix build
2021-11-13 20:11:18 +03:00
Alexei Dobrohotov
25f4d05c2e
Load bhkRigidBody
2021-11-13 19:59:30 +03:00
Alexei Dobrohotov
c01fff280a
Load bhkConvexVerticesShape, bhkBoxShape, bhkListShape
2021-11-13 19:53:03 +03:00
Alexei Dobrohotov
83aa96e38f
Load a bunch of triangle strip-based Havok records
2021-11-13 19:52:08 +03:00
Alexei Dobrohotov
e7cc76bba2
Load bhkMoppBvTreeShape
2021-11-13 19:27:32 +03:00
Alexei Dobrohotov
59ce00f742
Refactor all present Bethesda Havok 'support'
2021-11-13 19:14:28 +03:00
elsid
08a25c2b1f
Support seed type different from std::size_t for hashCombine
2021-11-13 16:14:50 +01:00
psi29a
41bd20e358
Merge branch 'bullet_shape_hash' into 'master'
...
Store BulletShape source file name and content hash
See merge request OpenMW/openmw!1379
2021-11-13 13:33:22 +00:00
Evil Eye
bee94e2afc
Treat commas in scripts as whitespace
2021-11-13 14:06:21 +01:00
Alexei Dobrohotov
c7edca559b
Morph geometry more like NifSkope (bug #6416 )
2021-11-13 15:58:59 +03:00
Evil Eye
5f406158b5
Zero initialize context index
2021-11-13 12:46:10 +01:00
psi29a
39f70c2d18
Merge branch 'correct-sound' into 'master'
...
Add correct sound path in resource helpers
See merge request OpenMW/openmw!1381
2021-11-12 22:23:32 +00:00
Petr Mikheev
ed85393288
Replace sol::table::create_table_with with a more compiler-friendly implementation. It fixes MSVC error "compiler is out of heap space" and also slightly reduces binary size.
2021-11-11 22:46:01 +01:00
elsid
d7041613ef
Store BulletShape source file name and content hash
2021-11-11 00:27:18 +01:00
Cédric Mocquillon
512d64e514
Extract correctSoundPath method to avoid code duplication. Add unit test for the new method
2021-11-10 23:06:35 +01:00
Alexei Dobrohotov
cc4c96d0f1
Follow global naming convention for new records
2021-11-10 22:50:01 +03:00
Alexei Dobrohotov
6e5b45453d
some physics stuff idk
2021-11-10 20:33:46 +03:00
Alexei Dobrohotov
6de9b49d3d
Remove an empty line
2021-11-10 19:59:13 +03:00
Alexei Dobrohotov
9880c43c86
Add specular strength shader parameter
2021-11-10 19:58:06 +03:00
Alexei Dobrohotov
923756b407
Load NiControllerManager
2021-11-10 19:42:55 +03:00
Alexei Dobrohotov
41097352a8
Load BSDismemberSkinInstance
2021-11-10 19:40:02 +03:00
Alexei Dobrohotov
5571099147
Load NiCollisionObject and bhkCollisionObject
2021-11-10 19:31:28 +03:00
Alexei Dobrohotov
9500afaa5a
Load BSFurnitureMarker
2021-11-10 19:21:07 +03:00
psi29a
b72d59b012
Merge branch 'fix_shadows_bin_crash' into 'master'
...
Fix crash on exit with enabled shadows (#6256 )
Closes #6256
See merge request OpenMW/openmw!1191
2021-11-09 15:58:03 +00:00
Evil Eye
099cd8a20c
Force alphabetical order per data dir
2021-11-09 16:47:42 +01:00
psi29a
5836d0225f
Merge branch 'leave_butter_to_soften' into 'master'
...
Soft Particles (#6128 )
See merge request OpenMW/openmw!980
2021-11-09 14:16:47 +00:00
elsid
3b6184dcda
Add missing include
...
In file included from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.cpp:1:0:
/<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.hpp:93:48: error: field ‘mSettings’ has incomplete type ‘std::reference_wrapper<const DetourNavigator::Settings>’
std::reference_wrapper<const Settings> mSettings;
^~~~~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
from /usr/include/c++/7/bits/nested_exception.h:40,
from /usr/include/c++/7/exception:143,
from /usr/include/c++/7/ios:39,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/dtstatus.hpp:6,
from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.hpp:4,
from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.cpp:1:
/usr/include/c++/7/type_traits:2125:11: note: declaration of ‘class std::reference_wrapper<const DetourNavigator::Settings>’
class reference_wrapper;
2021-11-09 12:32:53 +01:00
elsid
5972520b1a
Make sure areas size is 2 for rectangle
2021-11-08 18:49:17 +01:00
elsid
671e1e5424
Avoid copy when adding heightfield to vector
2021-11-08 18:49:16 +01:00
elsid
5f5163905a
Remove unused operator< for RecastMesh
2021-11-08 18:49:16 +01:00
Bo Svensson
5f1bf89369
improves groundcover view distance ( #3219 )
...
This PR aims to solve all issues with `Groundcover` view distance handling in a satisfying way while preserving other optimisations that benefit other features. The main idea here is not to rely on `ViewData` updates for distance culling calculations because we can not accurately determine distance against lazily updated views. Instead, we perform an accurate measurement in a cull callback we can run every frame in `Groundcover` itself. While we do have to add some code to handle this feature, it is quite loosely coupled code that could be useful elsewhere in the future. These changes should address a performance regression @akortunov experienced.
2021-11-08 10:27:42 +01:00
psi29a
b6718ecb10
Merge branch 'log_lock' into 'master'
...
Acquire log lock only when logger should log
See merge request OpenMW/openmw!1363
2021-11-08 07:41:27 +00:00
psi29a
9f26dfadd1
Merge branch 'cleanup_includes' into 'master'
...
Cleanup some includes
See merge request OpenMW/openmw!1369
2021-11-08 07:32:40 +00:00
elsid
a824e112d4
Fix recastmesh.cpp includes
...
recastmesh.cpp is supposed to include recastmesh.hpp not navmesh.hpp.
2021-11-08 02:21:17 +01:00
elsid
e0c4f08aa5
Remove redundant includes
2021-11-08 02:21:02 +01:00
elsid
727f784a98
Acquire log lock only when logger should log
...
To minimize overhead for calls when level is less than current. For example
Log(Debug::Debug) should not lock mutex when current logging level is Verbose.
2021-11-07 19:57:20 +01:00
Bo Svensson
2e031f195b
fixes LightBufferBinding messages ( #3223 )
...
This PR aims to solve `uniform block LightBufferBinding has no binding` messages @glassmancody has reportedly encountered since PR #3110 due to an apparent bug in OSG. While we do have to add a workaround here that adds a bit of clunkiness, #3216 should allow us to clean up these interactions a bit in the future.
2021-11-07 18:26:02 +01:00
Evil Eye
3f48d67d8e
Merge branch 'blackscreen_fix' into 'master'
...
Blackscreen fix (#6229 )
See merge request OpenMW/openmw!1359
2021-11-07 14:31:19 +00:00
Evil Eye
a3e039d862
Explicitely sort by file name after adding all data dirs
2021-11-07 14:15:30 +01:00
psi29a
256ec4c752
Merge branch 'fix_tile_bounds' into 'master'
...
Fix tile bounds scaling
See merge request OpenMW/openmw!1353
2021-11-07 12:34:55 +00:00
Alexei Dobrohotov
e125308dd8
Force assign head animation timer (bug #4389 )
2021-11-07 14:10:51 +03:00
Bo Svensson
726653087e
restores _mergeAlphaBlending behaviour ( #3222 )
...
This PR restores a minor peculiarity of `_mergeAlphaBlending` behaviour unintentionally changed by PR #3162 .
2021-11-07 10:36:22 +01:00
psi29a
627f816348
Merge branch 'navigator_impl' into 'master'
...
Reduce the size of included code from detournavigator/ into the engine
See merge request OpenMW/openmw!1355
2021-11-07 07:57:22 +00:00
Evil Eye
5fbfbb3d84
Merge branch 'clamp' into 'master'
...
Make better use of std::clamp
See merge request OpenMW/openmw!1357
2021-11-06 12:07:24 +00:00
cody glassman
04692e6012
blackscreen fix
2021-11-06 04:38:43 -07:00
Alexei Dobrohotov
7a0c13fcf8
Make better use of std::clamp
2021-11-06 08:47:32 +03:00
elsid
9f808fbe3a
Move findPath-like navigator functions into a separate header
2021-11-06 00:34:06 +01:00
elsid
5e99454cc4
Add factory functions to create navigator implementations
2021-11-06 00:14:41 +01:00
elsid
3f80725ebe
Remove duplicated implementation of Misc::Convert::toOsg
2021-11-05 22:57:08 +01:00
elsid
5db4898bec
Fix tile bounds scaling
...
OscillatingRecastMeshObject::update should be called with tile bounds in real
coordinates not in navmesh. But proper scaling was done only in
RecastMeshManager::getMesh and RecastMeshManager::updateObject used tile bounds
in navmesh coordinates.
Add a new function to create tile bounds with proper scaling and pass correct
value into RecastMeshManager constructor through CachedRecastMeshManager
constuctor from TileCachedRecastMeshManager member functions.
2021-11-05 22:48:45 +01:00
Bo Svensson
1960e976e2
refactors stringops.hpp ( #3192 )
...
With this PR we refactor `StringUtils::replaceAll` to accept `string_view` as suggested in a code comment. In addition, while we are touching this rebuild happy file, we slim it down a bit by moving a few sparingly used functions elsewhere.
2021-11-05 10:53:52 +01:00
Bo Svensson
5debd6e25a
removes two dummy serialisers ( #3212 )
...
This PR removes dummy serialisers for `StateSetUpdater`, `NodeCallback` and the respective `META` macros that trigger serialisation requirement here.
`StateSetUpdater` and `NodeCallback` are just base classes that can not be used on their own, so there is no need to incorporate them into serialisation. These changes might have minor effects on derived classes that forget to override `className()`, `libraryName()` through `META`, but it makes hardly a difference to now serialise such classes as a dysfunctional `osg::Callback` instead of a dysfunctional `SceneUtil::NodeCallback`.
2021-11-04 22:31:22 +01:00
Bo Svensson
0371072631
removes lowerCaseInPlace ( #3217 )
...
This PR removes unneeded `lowerCaseInPlace` calls in in a hot path of `objectpaging.cpp` that are no longer necessary after PR #3197 . In addition, I have been informed that these changes should by coincidence address a compiler specific compilation error we currently experience.
2021-11-04 22:20:06 +01:00
Evil Eye
ad44142dda
Modify the content file sorting algorithm to finish in finite time when encountering circular dependencies
2021-11-04 20:41:26 +01:00
Bo Svensson
6cf74f7041
refactors ESM::Land ( #3213 )
...
With this PR we reduce coupling, simplify code, encapsulate a variable and separate actual `ESM` data from its context.
2021-11-04 16:55:32 +01:00
Bo Svensson
1979ee1491
refactors hashed std::map ( #3199 )
...
We currently apply a strange algorithm to `LightManager::mStateSetCache`. For some reason this algorithm inserts hashed keys into `std::map` in a way that fails to handle hash collisions and exhibits worse lookup complexity than `std::unordered_map`. With this PR we just use `std::unordered_map` here.
2021-11-04 16:54:47 +01:00
Bo Svensson
4657c655b1
refactors parentFileIndices ( #3211 )
...
This PR aims to start addressing `ESM` design issues that have silenced errors we incorporated into groundcover `ESM` loading approaches.
- We move the resolution of `parentFileIndices` from `ESMStore` to `ESMReader` as suggested in a `TODO` comment.
- We improve a highly misleading comment which downplayed the significance of `parentFileIndices`.
- We document important preconditions.
- We move a user facing error message to the highest level and improve its context.
- We remove an inappropriate `setGlobalReaderList` method. We now pass this reader list into the method that requires it.
- We remove a thoroughly pointless optimisation of `Store<ESM::LandTexture>`'s construction that has unnecessarily depended on `getGlobalReaderList`.
There should be no functional changes for `master`, but this PR should remove an issue blocking PR #3208 .
2021-11-03 11:07:28 +01:00
elsid
2b057f5c15
Expect nif node children to have parent
2021-11-02 22:44:33 +01:00
elsid
19843af704
Combine data check with data handling logic
2021-11-02 22:44:33 +01:00
elsid
4e8e8304aa
Avoid mesh allocation when data is invalid
2021-11-02 22:44:33 +01:00
elsid
4ac83f4c39
Add separate function to handle NiGeometry node
...
To force use a single source of data. All fields of Nif::Node are available in NiGeometry.
2021-11-02 22:44:32 +01:00
elsid
56eef691a8
Use reference type to pass nif node as argument where nullptr is not handled
2021-11-02 22:44:32 +01:00
elsid
4631d95739
Add more tests for BulletNifLoader
2021-11-02 22:44:32 +01:00
psi29a
523289c531
Merge branch 'refactor_bullet_shape' into 'master'
...
Refactor bullet shape
See merge request OpenMW/openmw!1333
2021-11-02 20:30:22 +00:00
psi29a
4ff4afd50b
Merge branch 'lua_callback' into 'master'
...
Refactoring. Lua `Callback` is moved from apps/openmw/mwlua to components/lua.
See merge request OpenMW/openmw!1334
2021-11-02 20:28:34 +00:00
psi29a
cb3ab21c13
Merge branch 'recast_mesh_object' into 'master'
...
Store holder only in parent RecastMeshObject
See merge request OpenMW/openmw!1332
2021-11-02 20:27:49 +00:00
Evil Eye
a9106f4d7c
Rotate torches by 90 degrees
2021-11-02 18:01:22 +01:00
glassmancody.info
4461366761
settings update and launcher option
2021-11-01 09:26:50 -07:00
Petr Mikheev
e7ec89573e
Refactoring. Lua Callback
is moved from apps/openmw/mwlua to components/lua.
2021-10-31 17:47:46 +01:00
Bo Svensson
b9911da4c7
applies lightMask ( #3201 )
...
With this PR we apply `lightMask` to a `Transform` node we create specifically for a light. This mask will allow us to stop traversing such nodes sooner and avoid costly processing associated with `Transform` nodes in the cull visitor.
2021-10-31 13:03:42 +01:00
Bo Svensson
d88d006984
fixes getViewDistance ( #3207 )
...
I have been informed by @akortunov that my addition of `Groundcover::getViewDistance` is not working in some cases. Investigations revealed that some `ViewData` code interacting with my additions had been quite thoroughly optimised in a way that was not sufficiently documented and interfered with the new feature. With this PR we repair `getViewDistance` while preserving such optimisations and add a necessary comment to avoid issues in the future. In addition, we now rebuild views when the global `mViewDistance` changes.
2021-10-31 12:59:34 +01:00
Bo Svensson
356e9d7cf0
refactors osg::Callback virtual inheritance ( #3200 )
...
With this PR we refactor `SceneUtil::KeyframeController` not to require `virtual osg::Callback` inheritance. I suppose such `virtual` overhead is not justified here because it negatively impacts many other classes we derive from `osg::Callback`.
2021-10-30 22:43:18 +02:00
psi29a
4c81518abb
Merge branch 'puddle' into 'master'
...
Give each reflect and spell absorption effect a chance to apply
Closes #6255 and #6253
See merge request OpenMW/openmw!1279
2021-10-30 19:26:32 +00:00
glassmancody.info
40b6bbbdf3
use openmw define system
2021-10-30 12:19:31 -07:00
glassmancody.info
8c3b00164e
soft particles
2021-10-30 12:19:31 -07:00
elsid
9c5f8b8719
Store holder only in parent RecastMeshObject
2021-10-30 04:40:06 +02:00
elsid
a851ac5fea
Use custom deleter for btCompoundShape to delete children shapes
2021-10-30 03:48:02 +02:00
elsid
b731a981c4
Make BulletShape::isAnimated inlined
2021-10-30 03:44:09 +02:00
elsid
c83facd9d3
Avoid redundant osg::ref_ptr<const BulletShape> copy
2021-10-30 03:44:08 +02:00
elsid
ed5a4e195b
Use unique_ptr to avoid possible memory leak
2021-10-30 03:44:08 +02:00
elsid
8e71c246bf
Remove redundant BulletShape getters
2021-10-30 03:44:08 +02:00
elsid
fc9a405dc5
Make BulletShape::makeInstance free function
2021-10-30 03:44:08 +02:00
elsid
b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape
2021-10-30 03:44:07 +02:00
elsid
80e3623d9a
Avoid dynamic cast in duplicateCollisionShape
2021-10-30 03:43:48 +02:00
elsid
ca8584f6f6
Move functions independent from BulletShape into anonymous namespace
2021-10-30 03:43:38 +02:00
elsid
29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide
2021-10-29 21:05:58 +02:00
Petr Mikheev
37386f417e
Support *.omwscripts in openmw-launcher
2021-10-29 20:09:47 +02:00
psi29a
b189282ba1
Merge branch 'compile_no_evil' into 'master'
...
Remove dead code
See merge request OpenMW/openmw!1327
2021-10-29 12:51:20 +00:00
psi29a
34b63bf142
Merge branch 'omwscripts' into 'master'
...
Change format of "*.omwscripts" files
See merge request OpenMW/openmw!1271
2021-10-29 12:49:49 +00:00
Evil Eye
9b565c4cf9
Remove dead code
2021-10-28 22:16:43 +02:00
psi29a
b3f84df43c
Merge branch 'sky_shaders' into 'master'
...
Sky shaders
See merge request OpenMW/openmw!1057
2021-10-27 20:25:40 +00:00
Petr Mikheev
47c89567fb
Load LuaScriptsCfg from both *.omwscripts and *.omwaddon files.
2021-10-26 21:52:42 +02:00
Petr Mikheev
4ec7f0625e
Store Lua timers in std::map rather than in sol::table.
2021-10-26 21:32:48 +02:00
Petr Mikheev
9adc190209
Redesign LuaUtil::ScriptsContainer to work with ScriptsConfiguration
2021-10-26 21:32:48 +02:00
Petr Mikheev
33d71be81f
Add LuaUtil::ScriptsConfiguration
2021-10-26 21:32:02 +02:00
Petr Mikheev
6aab246879
Add ESM records that are needed to store Lua scripts configuration;
...
Use ptr.getType() (i.e. esm record names) instead of typeid(ptr.getClass()) in apps/openmw/mwlua.
2021-10-26 21:32:02 +02:00
Evil Eye
4ec927829f
Give each reflect and spell absorption effect a chance to apply
2021-10-26 16:50:40 +02:00
psi29a
3006c496fc
Merge branch 'morrowland_scripting' into 'master'
...
Morrowland scripting
Closes #6363
See merge request OpenMW/openmw!1318
2021-10-26 10:07:45 +00:00
psi29a
2765bcee5e
Merge branch 'serialization' into 'master'
...
Add helpers for binary serialization
See merge request OpenMW/openmw!1319
2021-10-26 08:25:17 +00:00
glassmancody.info
07e32c0fa6
remove object shader path
2021-10-25 10:23:16 -07:00
Bret Curtis
3d0da9b9b2
Merge pull request #3191 from akortunov/warnfix
...
Fix some MSVC warnings
2021-10-25 15:17:05 +02:00
Bret Curtis
ac02753da7
Merge pull request #3190 from akortunov/master
...
Fix showscenegraph warnings
2021-10-25 12:59:36 +02:00
Bo Svensson
1ff8318a52
refactors premultiplied alpha ( #3189 )
...
With this PR we refactor a `premultiplied alpha` user string set by `characterpreview.cpp` into a more flexible mechanism allowing us to assign any state to GUI textures. We can consider these changes more future proof than the previous approach.
2021-10-25 09:28:32 +02:00
Bo Svensson
7f9beac3a7
refactors a case insensitive map ( #3184 )
...
This PR aims to spark the retirement of a questionable pattern I have found all over our code base. I will illustrate how this pattern encourages code duplication, lacks type safety, requires documentation and can be prone to bugs.
```
std::map<std::string, Object> mMap; // Stored in all lowercase for a case-insensitive lookup
std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.emplace(lowerKey, object);
std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.find(lowerKey);
mMap.find(key); // Not found. Oops!
```
An alternative approach produces no such issues.
```
std::unordered_map<std::string, Object, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual> mMap;
mMap.emplace(key, object);
mMap.find(key);
```
Of course, such an alternative will work for a `map` as well, but an `unordered_map` is generally preferable over a `map` with these changes because we have moved `lowerCase` into the comparison operator.
In this PR I have refactored `Animation::mNodeMap` accordingly. I have reviewed and adapted all direct and indirect usage of `Animation::mNodeMap` to ensure we do not change behaviour with this PR.
2021-10-25 09:18:26 +02:00
Evil Eye
fef902617a
Parse integer format arguments as variable names
2021-10-24 17:23:15 +02:00
Andrei Kortunov
0f3c0cb0a0
Fix argument types mismatch
2021-10-24 18:45:46 +04:00
Andrei Kortunov
107a9ecb17
Fix variables hiding
2021-10-24 18:45:04 +04:00
elsid
a58f1a94e3
Add helpers for binary serialization
...
To construct serializer from given entities:
* Data source/destination - any value that has to be serialized/deserialized,
usually already existing type.
* Format - functional object to define high level serialization logic to
define specific format and data schema. Like order of fields, allocation.
* Visitor - functional object to define low level serialization logic to
operator on given data part.
* BinaryWriter - copies given value into provided buffer.
* BinaryReader - copies value into given destination from provided buffer.
* SizeAccumulator - calculates required buffer size for given data.
2021-10-24 14:20:44 +02:00
Andrei Kortunov
566380c0d6
Fix showscenegraph warnings
2021-10-24 12:37:49 +04:00
glassmancody.info
1e40d27318
introduce sky shaders
2021-10-23 17:53:38 -07:00
Bo Svensson
41318a585f
fixes enable and disable commands ( #3186 )
...
This PR fixes a recent regression concerning enable and disable commands with object paging. In addition, we add a necessary comment to avoid such issues in the future.
2021-10-23 12:40:26 +02:00
Evil Eye
31aa19574b
Make PositionCell take additional junk arguments
2021-10-23 11:47:42 +02:00
Evil Eye
dfb6bdf77e
Allow integer variable names
2021-10-23 11:47:35 +02:00
Bo Svensson
c9c8d02332
fixes a crash ( #3183 )
...
This PR fixes a crash caused by the improperly ensured lifetime of RigGeometry::mSourceGeometry. mSourceGeometry was not adequate to ensure mSourceGeometry would outlive mGeometry because we extend mGeometrys lifetime beyond this lifetime by passing mGeometry to the draw traversal instead of this.
In addition,
We add important comments.
We detect and prevent generally unsafe operations in high level code.
We add a sprinkling of const to help clarify intentions.
2021-10-23 10:31:46 +02:00
Fanael Linithien
07d505563e
Remove non-existent file from CMakeLists
2021-10-23 01:38:32 +02:00
psi29a
1ffa02b2fd
Merge branch 'fix_windows_tests' into 'master'
...
Fix tests on windows
See merge request OpenMW/openmw!1313
2021-10-22 12:35:10 +00:00
psi29a
ed811176bc
Merge branch 'fix_esm_loader' into 'master'
...
Fix logic expression for not found value in EsmLoader::getModel
See merge request OpenMW/openmw!1308
2021-10-22 12:33:39 +00:00
elsid
b5f0057ac9
Fix tests on windows
2021-10-21 19:48:31 +02:00
Bo Svensson
a854a6e04a
removes UnrefQueue ( #3181 )
...
Currently, we use an `UnrefQueue` which supposedly aims to transfer destruction costs to another thread. The implications of this unusual pattern can not be well understood because some allocators might free resources more efficiently if they are freed by the same thread that allocated them. In addition, `UnrefQueue` complicates the validation of thread safety in our engine. Lastly, our current usage of `UnrefQueue` triggers `ref()`, `unref()` atomic operations as objects are passed into the queue. These operations could be more expensive than the actual destruction.
With this PR we thus remove `UnrefQueue`. We can expect these changes to have a minor impact at most because we free most resources elsewhere in `ResourceSystem::updateCache`.
2021-10-20 23:02:15 +02:00
elsid
a3b6bc7263
Fix logic expression for not found value
2021-10-20 17:48:10 +02:00
elsid
562590720b
Remove ShadowsBin prototype on MWShadowTechnique destruction
...
To prevent crash:
==7733==ERROR: AddressSanitizer: heap-use-after-free on address 0x6040000ca1b0 at pc 0x55fcfa8d1ee3 bp 0x7ffd1c464e00 sp 0x7ffd1c464df0
READ of size 4 at 0x6040000ca1b0 thread T0
#0 0x55fcfa8d1ee2 in std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const /usr/include/c++/11.1.0/bits/stl_function.h:386
#1 0x55fcfa8d1ee2 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_lower_bound(std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*, std::_Rb_tree_node_base*, unsigned int const&) /usr/include/c++/11.1.0/bits/stl_tree.h:1903
#2 0x55fcfa8ca76e in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::lower_bound(unsigned int const&) /usr/include/c++/11.1.0/bits/stl_tree.h:1270
#3 0x55fcfa8ca76e in std::map<unsigned int, osg::ref_ptr<osg::ContextData>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::lower_bound(unsigned int const&) /usr/include/c++/11.1.0/bits/stl_map.h:1259
#4 0x55fcfa8ca76e in std::map<unsigned int, osg::ref_ptr<osg::ContextData>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::operator[](unsigned int const&) /usr/include/c++/11.1.0/bits/stl_map.h:497
#5 0x55fcfa8ca76e in osg::getOrCreateContextData(unsigned int) /home/elsid/dev/OpenSceneGraph/src/osg/ContextData.cpp:142
#6 0x55fcfab6848a in GLShaderManager* osg::get<GLShaderManager>(unsigned int) /home/elsid/dev/OpenSceneGraph/include/osg/ContextData:154
#7 0x55fcfab6848a in osg::Shader::PerContextShader::~PerContextShader() /home/elsid/dev/OpenSceneGraph/src/osg/Shader.cpp:540
#8 0x55fcfab68dc6 in osg::Shader::PerContextShader::~PerContextShader() /home/elsid/dev/OpenSceneGraph/src/osg/Shader.cpp:541
#9 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#10 0x55fcfab6d0ce in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/include/osg/Referenced:201
#11 0x55fcfab6d0ce in osg::ref_ptr<osg::Shader::PerContextShader>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/include/osg/ref_ptr:44
#12 0x55fcfab6d0ce in void std::_Destroy<osg::ref_ptr<osg::Shader::PerContextShader> >(osg::ref_ptr<osg::Shader::PerContextShader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:140
#13 0x55fcfab6d0ce in void std::_Destroy_aux<false>::__destroy<osg::ref_ptr<osg::Shader::PerContextShader>*>(osg::ref_ptr<osg::Shader::PerContextShader>*, osg::ref_ptr<osg::Shader::PerContextShader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:152
#14 0x55fcfab6d0ce in void std::_Destroy<osg::ref_ptr<osg::Shader::PerContextShader>*>(osg::ref_ptr<osg::Shader::PerContextShader>*, osg::ref_ptr<osg::Shader::PerContextShader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:185
#15 0x55fcfab6d0ce in void std::_Destroy<osg::ref_ptr<osg::Shader::PerContextShader>*, osg::ref_ptr<osg::Shader::PerContextShader> >(osg::ref_ptr<osg::Shader::PerContextShader>*, osg::ref_ptr<osg::Shader::PerContextShader>*, std::allocator<osg::ref_ptr<osg::Shader::PerContextShader> >&) /usr/include/c++/11.1.0/bits/alloc_traits.h:746
#16 0x55fcfab6d0ce in std::vector<osg::ref_ptr<osg::Shader::PerContextShader>, std::allocator<osg::ref_ptr<osg::Shader::PerContextShader> > >::~vector() /usr/include/c++/11.1.0/bits/stl_vector.h:680
#17 0x55fcfab6d0ce in osg::Shader::ShaderObjects::~ShaderObjects() /home/elsid/dev/OpenSceneGraph/include/osg/Shader:264
#18 0x55fcfab6d0ce in osg::Shader::ShaderObjects::~ShaderObjects() /home/elsid/dev/OpenSceneGraph/include/osg/Shader:264
#19 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#20 0x55fcfab6c532 in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/include/osg/Referenced:201
#21 0x55fcfab6c532 in osg::ref_ptr<osg::Shader::ShaderObjects>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/include/osg/ref_ptr:44
#22 0x55fcfab6c532 in void std::_Destroy<osg::ref_ptr<osg::Shader::ShaderObjects> >(osg::ref_ptr<osg::Shader::ShaderObjects>*) /usr/include/c++/11.1.0/bits/stl_construct.h:140
#23 0x55fcfab6c532 in void std::_Destroy_aux<false>::__destroy<osg::ref_ptr<osg::Shader::ShaderObjects>*>(osg::ref_ptr<osg::Shader::ShaderObjects>*, osg::ref_ptr<osg::Shader::ShaderObjects>*) /usr/include/c++/11.1.0/bits/stl_construct.h:152
#24 0x55fcfab6c532 in void std::_Destroy<osg::ref_ptr<osg::Shader::ShaderObjects>*>(osg::ref_ptr<osg::Shader::ShaderObjects>*, osg::ref_ptr<osg::Shader::ShaderObjects>*) /usr/include/c++/11.1.0/bits/stl_construct.h:185
#25 0x55fcfab6c532 in void std::_Destroy<osg::ref_ptr<osg::Shader::ShaderObjects>*, osg::ref_ptr<osg::Shader::ShaderObjects> >(osg::ref_ptr<osg::Shader::ShaderObjects>*, osg::ref_ptr<osg::Shader::ShaderObjects>*, std::allocator<osg::ref_ptr<osg::Shader::ShaderObjects> >&) /usr/include/c++/11.1.0/bits/alloc_traits.h:746
#26 0x55fcfab6c532 in std::vector<osg::ref_ptr<osg::Shader::ShaderObjects>, std::allocator<osg::ref_ptr<osg::Shader::ShaderObjects> > >::~vector() /usr/include/c++/11.1.0/bits/stl_vector.h:680
#27 0x55fcfab6c532 in osg::buffered_value<osg::ref_ptr<osg::Shader::ShaderObjects> >::~buffered_value() /home/elsid/dev/OpenSceneGraph/include/osg/buffered_value:26
#28 0x55fcfab6c532 in osg::Shader::~Shader() /home/elsid/dev/OpenSceneGraph/src/osg/Shader.cpp:271
#29 0x55fcfab6c80a in osg::Shader::~Shader() /home/elsid/dev/OpenSceneGraph/src/osg/Shader.cpp:271
#30 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#31 0x55fcfab185bd in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/include/osg/Referenced:201
#32 0x55fcfab185bd in osg::ref_ptr<osg::Shader>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/include/osg/ref_ptr:44
#33 0x55fcfab185bd in void std::_Destroy<osg::ref_ptr<osg::Shader> >(osg::ref_ptr<osg::Shader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:140
#34 0x55fcfab185bd in void std::_Destroy_aux<false>::__destroy<osg::ref_ptr<osg::Shader>*>(osg::ref_ptr<osg::Shader>*, osg::ref_ptr<osg::Shader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:152
#35 0x55fcfab185bd in void std::_Destroy<osg::ref_ptr<osg::Shader>*>(osg::ref_ptr<osg::Shader>*, osg::ref_ptr<osg::Shader>*) /usr/include/c++/11.1.0/bits/stl_construct.h:185
#36 0x55fcfab185bd in void std::_Destroy<osg::ref_ptr<osg::Shader>*, osg::ref_ptr<osg::Shader> >(osg::ref_ptr<osg::Shader>*, osg::ref_ptr<osg::Shader>*, std::allocator<osg::ref_ptr<osg::Shader> >&) /usr/include/c++/11.1.0/bits/alloc_traits.h:746
#37 0x55fcfab185bd in std::vector<osg::ref_ptr<osg::Shader>, std::allocator<osg::ref_ptr<osg::Shader> > >::~vector() /usr/include/c++/11.1.0/bits/stl_vector.h:680
#38 0x55fcfab185bd in osg::Program::~Program() /home/elsid/dev/OpenSceneGraph/src/osg/Program.cpp:147
#39 0x55fcfab18ae0 in osg::Program::~Program() /home/elsid/dev/OpenSceneGraph/src/osg/Program.cpp:147
#40 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#41 0x55fcf8582cfa in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/build/gcc/asan/install/include/osg/Referenced:201
#42 0x55fcf8582cfa in osg::ref_ptr<osg::StateAttribute>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/build/gcc/asan/install/include/osg/ref_ptr:44
#43 0x55fcf8582cfa in std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int>::~pair() /usr/include/c++/11.1.0/bits/stl_pair.h:211
#44 0x55fcf8582cfa in std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >::~pair() /usr/include/c++/11.1.0/bits/stl_pair.h:211
#45 0x55fcf8582cfa in void __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::destroy<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >(std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >*) /usr/include/c++/11.1.0/ext/new_allocator.h:162
#46 0x55fcf8582cfa in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > > >::destroy<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >(std::allocator<std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >&, std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >*) /usr/include/c++/11.1.0/bits/alloc_traits.h:531
#47 0x55fcf8582cfa in std::_Rb_tree<std::pair<osg::StateAttribute::Type, unsigned int>, std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >, std::_Select1st<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >, std::less<std::pair<osg::StateAttribute::Type, unsigned int> >, std::allocator<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:623
#48 0x55fcf8582cfa in std::_Rb_tree<std::pair<osg::StateAttribute::Type, unsigned int>, std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >, std::_Select1st<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >, std::less<std::pair<osg::StateAttribute::Type, unsigned int> >, std::allocator<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:631
#49 0x55fcf8582cfa in std::_Rb_tree<std::pair<osg::StateAttribute::Type, unsigned int>, std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >, std::_Select1st<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >, std::less<std::pair<osg::StateAttribute::Type, unsigned int> >, std::allocator<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1889
#50 0x55fcfac1f281 in std::_Rb_tree<std::pair<osg::StateAttribute::Type, unsigned int>, std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> >, std::_Select1st<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > >, std::less<std::pair<osg::StateAttribute::Type, unsigned int> >, std::allocator<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::clear() /usr/include/c++/11.1.0/bits/stl_tree.h:1254
#51 0x55fcfac1f281 in std::map<std::pair<osg::StateAttribute::Type, unsigned int>, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int>, std::less<std::pair<osg::StateAttribute::Type, unsigned int> >, std::allocator<std::pair<std::pair<osg::StateAttribute::Type, unsigned int> const, std::pair<osg::ref_ptr<osg::StateAttribute>, unsigned int> > > >::clear() /usr/include/c++/11.1.0/bits/stl_map.h:1134
#52 0x55fcfac1f281 in osg::StateSet::clear() /home/elsid/dev/OpenSceneGraph/src/osg/StateSet.cpp:738
#53 0x55fcfac2079e in osg::StateSet::~StateSet() /home/elsid/dev/OpenSceneGraph/src/osg/StateSet.cpp:285
#54 0x55fcfac20d3e in osg::StateSet::~StateSet() /home/elsid/dev/OpenSceneGraph/src/osg/StateSet.cpp:286
#55 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#56 0x55fcfb20dcac in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/build/gcc/asan/install/include/osg/Referenced:201
#57 0x55fcfb20dcac in osg::ref_ptr<osg::StateSet>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/build/gcc/asan/install/include/osg/ref_ptr:44
#58 0x55fcfb20dcac in std::array<osg::ref_ptr<osg::StateSet>, 8ul>::~array() /usr/include/c++/11.1.0/array:95
#59 0x55fcfb20dcac in SceneUtil::ShadowsBin::~ShadowsBin() /home/elsid/dev/openmw/components/sceneutil/shadowsbin.hpp:16
#60 0x55fcfb20dcac in SceneUtil::ShadowsBin::~ShadowsBin() /home/elsid/dev/openmw/components/sceneutil/shadowsbin.hpp:16
#61 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#62 0x55fcfa6cc17f in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/include/osg/Referenced:201
#63 0x55fcfa6cc17f in osg::ref_ptr<osgUtil::RenderBin>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/include/osg/ref_ptr:44
#64 0x55fcfa6cc17f in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >::~pair() /usr/include/c++/11.1.0/bits/stl_pair.h:211
#65 0x55fcfa6cc17f in void __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >*) /usr/include/c++/11.1.0/ext/new_allocator.h:162
#66 0x55fcfa6cc17f in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >(std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >*) /usr/include/c++/11.1.0/bits/alloc_traits.h:531
#67 0x55fcfa6cc17f in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:623
#68 0x55fcfa6cc17f in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:631
#69 0x55fcfa6cc17f in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1889
#70 0x55fcfa6cc122 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1887
#71 0x55fcfa6cc122 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1887
#72 0x55fcfa6cc245 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::~_Rb_tree() /usr/include/c++/11.1.0/bits/stl_tree.h:984
#73 0x55fcfa6cc245 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgUtil::RenderBin>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, osg::ref_ptr<osgUtil::RenderBin> > > >::~map() /usr/include/c++/11.1.0/bits/stl_map.h:302
#74 0x55fcfa6cc245 in RenderBinPrototypeList::~RenderBinPrototypeList() /home/elsid/dev/OpenSceneGraph/src/osgUtil/RenderBin.cpp:48
#75 0x55fcfa6cc245 in RenderBinPrototypeList::~RenderBinPrototypeList() /home/elsid/dev/OpenSceneGraph/src/osgUtil/RenderBin.cpp:48
#76 0x55fcfab4a3f3 in osg::Referenced::signalObserversAndDelete(bool, bool) const /home/elsid/dev/OpenSceneGraph/src/osg/Referenced.cpp:292
#77 0x55fcfa6cbcc1 in osg::Referenced::unref() const /home/elsid/dev/OpenSceneGraph/include/osg/Referenced:201
#78 0x55fcfa6cbcc1 in osg::ref_ptr<RenderBinPrototypeList>::~ref_ptr() /home/elsid/dev/OpenSceneGraph/include/osg/ref_ptr:44
#79 0x7f3977bd04a6 in __run_exit_handlers (/usr/lib/libc.so.6+0x3f4a6)
#80 0x7f3977bd064d in exit (/usr/lib/libc.so.6+0x3f64d)
#81 0x7f3977bb8b2b in __libc_start_main (/usr/lib/libc.so.6+0x27b2b)
#82 0x55fcf81ea12d in _start (/home/elsid/dev/openmw/build/gcc/asan/openmw+0xa4412d)
0x6040000ca1b0 is located 32 bytes inside of 48-byte region [0x6040000ca190,0x6040000ca1c0)
freed by thread T0 here:
#0 0x7f397a633d69 in operator delete(void*, unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:172
#1 0x55fcfa8d1824 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::deallocate(std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*, unsigned long) /usr/include/c++/11.1.0/ext/new_allocator.h:139
#2 0x55fcfa8d1824 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > > >::deallocate(std::allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >&, std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*, unsigned long) /usr/include/c++/11.1.0/bits/alloc_traits.h:492
#3 0x55fcfa8d1824 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_put_node(std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:565
#4 0x55fcfa8d1824 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:632
#5 0x55fcfa8d1824 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1889
#6 0x55fcfa8d18da in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::~_Rb_tree() /usr/include/c++/11.1.0/bits/stl_tree.h:984
#7 0x55fcfa8d18da in std::map<unsigned int, osg::ref_ptr<osg::ContextData>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::~map() /usr/include/c++/11.1.0/bits/stl_map.h:302
#8 0x7f3977bd04a6 in __run_exit_handlers (/usr/lib/libc.so.6+0x3f4a6)
previously allocated by thread T0 here:
#0 0x7f397a632ca1 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x55fcfa8d3aa1 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::allocate(unsigned long, void const*) /usr/include/c++/11.1.0/ext/new_allocator.h:121
#2 0x55fcfa8d3aa1 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >&, unsigned long) /usr/include/c++/11.1.0/bits/alloc_traits.h:460
#3 0x55fcfa8d3aa1 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_get_node() /usr/include/c++/11.1.0/bits/stl_tree.h:561
#4 0x55fcfa8d3aa1 in std::_Rb_tree_node<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >* std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<unsigned int const&>, std::tuple<> >(std::piecewise_construct_t const&, std::tuple<unsigned int const&>&&, std::tuple<>&&) /usr/include/c++/11.1.0/bits/stl_tree.h:611
#5 0x55fcfa8d3aa1 in std::_Rb_tree_iterator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > std::_Rb_tree<unsigned int, std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> >, std::_Select1st<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<unsigned int const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > >, std::piecewise_construct_t const&, std::tuple<unsigned int const&>&&, std::tuple<>&&) /usr/include/c++/11.1.0/bits/stl_tree.h:2429
#6 0x55fcfa8cfd91 in std::map<unsigned int, osg::ref_ptr<osg::ContextData>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, osg::ref_ptr<osg::ContextData> > > >::operator[](unsigned int const&) /usr/include/c++/11.1.0/bits/stl_map.h:501
#7 0x55fcfa8cfd91 in osg::ContextData::createNewContextID() /home/elsid/dev/OpenSceneGraph/src/osg/ContextData.cpp:171
#8 0x55fcfa9be218 in osg::GraphicsContext::createNewContextID() /home/elsid/dev/OpenSceneGraph/src/osg/GraphicsContext.cpp:320
#9 0x55fcfb68d1ef in SDLUtil::GraphicsWindowSDL2::GraphicsWindowSDL2(osg::GraphicsContext::Traits*) /home/elsid/dev/openmw/components/sdlutil/sdlgraphicswindow.cpp:39
#10 0x55fcfa17f93a in OMW::Engine::createWindow(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:611
#11 0x55fcfa18398f in OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:679
#12 0x55fcfa18c4f2 in OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:949
#13 0x55fcfa13c9ff in runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:316
#14 0x55fcfb49f562 in wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/components/debug/debugging.cpp:205
#15 0x55fcfa133114 in main /home/elsid/dev/openmw/apps/openmw/main.cpp:328
#16 0x7f3977bb8b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/c++/11.1.0/bits/stl_function.h:386 in std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const
Shadow bytes around the buggy address:
0x0c08800113e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c08800113f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011420: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c0880011430: fa fa fd fd fd fd[fd]fd fa fa fa fa fa fa fa fa
0x0c0880011440: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011450: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011460: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011470: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0880011480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==7733==ABORTING
2021-10-20 13:26:25 +02:00
elsid
590a340e6e
Remove redundant ShadowsBin::sCastingPrograms
...
This variable is only used in ShadowsBin constructor and it's initialized each
time before constructor call so required value can be just passed into
ShadowsBin ctor.
Make ShadowsBin default constructor private because it is required by osg even
it's not actually called.
2021-10-20 13:25:21 +02:00
elsid
9d1b7c4a30
Use type alias to avoid long type names and length redefinition for array
2021-10-20 13:25:21 +02:00
elsid
6cfabe252d
Remove redundant ShadowsBinAdder
2021-10-20 13:25:21 +02:00
elsid
06ea47f74b
Fix crash in DetourNavigator::fixupCorridor
...
Handle situation when resulting path does not fit into destination vector.
2021-10-19 22:54:46 +02:00
elsid
e5413c0664
Add functions to compress/decompress vector of bytes
2021-10-18 20:46:22 +02:00
elsid
bb26ba30b6
Add progress reporter type
...
To log/report progress of long duration operations using given time period.
2021-10-18 01:26:10 +02:00
AnyOldName3
9be606a40d
Finish removing old Escape classes
2021-10-17 23:40:34 +01:00
psi29a
d8d16a52e1
Merge branch 'esm_loader' into 'master'
...
Add ESM data loader
See merge request OpenMW/openmw!1301
2021-10-17 19:21:32 +00:00
elsid
046b5f83ee
Add ESM data loader
...
A component to load ESM content files with limited support for record types and
selection which of them to load. Supported record types are:
ACTI, CELL, CONT, DOOR, GMST, LAND, STAT.
2021-10-17 19:55:29 +02:00
elsid
18d3102148
Do not use union to access FIXED_STRING<4> as int
...
https://en.cppreference.com/w/cpp/language/union :
> It's undefined behavior to read from the member of the union that wasn't most recently written.
2021-10-17 17:16:21 +02:00
psi29a
62dfbb33d9
Merge branch 'fix_find_path_crash' into 'master'
...
Fix crash in finding path over navmesh (#6338 )
Closes #6338
See merge request OpenMW/openmw!1296
2021-10-17 12:15:14 +00:00
Bo Svensson
01605433cb
quadtreeworld.cpp ( #3174 )
...
Currently, we disable a paging root node that we only need in exterior cells by setting its node mask to 0 when transitioning into an interior cell. Node masks are not ideal for this usage case because Node::getBound is unaware of masks. With this PR we just detach the unused node from the scene graph. _shadowedScene->getBound() in the MWShadowTechnique should return a much better value in interior cells with these changes.
2021-10-16 21:48:13 +02:00
elsid
c88367b6a6
Add sqlite3 helpers
2021-10-16 17:43:08 +02:00
elsid
f6d1689bb9
Avoid redundant polygon path reallocations
...
Use separate variable to store size and make all operations in-place.
2021-10-14 23:48:14 +02:00
elsid
79665cea66
Avoid access to the path vector element out of range
...
polygonPath.front() in some cases might reference to a first element of empty
vector. Copy the value into a local variable to be able to access later.
2021-10-14 23:46:50 +02:00
Bo Svensson
db3d938ee9
cleans up BSAFile ( #3177 )
...
We currently build a large map of a BSAFile's contents unused by Open MW. We already map archive contents in VFS. With this PR we remove the map from BSAFile and reimplement its only current use in BSATool.
2021-10-14 14:46:44 +02:00
Dan Church
42bd10f356
Fix FTBFS against older versions of osg
...
Bring back osg version guard.
Drawable::dirtyGLObjects wasn't available until OpenSceneGraph-3.5.10.
2021-10-13 13:55:16 -05:00
Evil Eye
ec6451e93a
Merge branch 'recordtype' into 'master'
...
Avoid copying std::string in MWWorld::Ptr::getTypeDescription()
See merge request OpenMW/openmw!1290
2021-10-13 17:04:32 +00:00
Bo Svensson
617eec338a
removes version guard ( #3173 )
...
We currently use a version guard to adapt to a change in the number of parameters supplied to osg::TriangleFunctor's operator() template functor. The differing parameter is unused in our code. Crucially, operator() is not an override, so we can just add a default value for the differing parameter. Such a default allows us to apply identical code to both versions of the library without regressing functionality.
2021-10-13 16:12:47 +02:00
Bo Svensson
b0132be53f
do not dirty unchanged arrays ( #3164 )
...
This PR proposes a simple change to `RigGeometry` `dirtyGLObjects` logic.
1. We will avoid dirtying unmodified arrays.
2. We can drop an osg version guard since `Drawable::dirtyGLObjects` is not nearly as harmful as `Geometry::dirtyGLObjects`.
3. We will avoid crashes in an as yet unfinished future PR concerning `Array` sharing improvements.
2021-10-12 13:47:42 +02:00
psi29a
67fa8413f3
Merge branch 'physics_heightfield' into 'master'
...
Replace float type for arguments to create heightfield with int
See merge request OpenMW/openmw!1285
2021-10-12 07:58:34 +00:00
psi29a
207a7245bc
Merge branch 'navigator_settings' into 'master'
...
Initialize navigator max climb and max slope settings in makeSettingsFromSettingsManager
See merge request OpenMW/openmw!1283
2021-10-12 07:02:08 +00:00
Petr Mikheev
a8acc19988
Avoid copying std::string in MWWorld::Ptr::getTypeDescription()
2021-10-12 00:18:23 +02:00
elsid
405e814190
Move btCollisionObject creation for MWPhysics::Object into components
2021-10-11 23:14:02 +02:00
elsid
7c5a590890
Replace float type for arguments to create heightfield with int
...
To reduce amount of computations on the caller side and restrict possible
values.
* verts can't be non-int because it's a number of things.
* worldsize is initially defined as int by ESM::Land::REAL_SIZE.
* Put function to calculate heightfied shift into components to be able to
reuse by other binaries.
2021-10-11 19:28:08 +02:00
elsid
6986feb81b
Initialize navigator max climb and max slope settings in makeSettingsFromSettingsManager
...
To avoid having multiple places to initialize them when they will be required
by multiple binaries.
2021-10-11 18:50:26 +02:00
Bo Svensson
93848ef01c
avoids virtual function calls in ComputeLightSpaceBounds ( #3167 )
...
osg::NodeVisitor is designed to recursively call virtual apply signatures until we find an implemented signature. Encountered nodes that we do not explicitely handle will trigger additional virtual function calls. With this PR we avoid these additional virtual function calls in the particularly costly ComputeLightSpaceBounds by adding some explicit signatures.
2021-10-11 15:11:59 +02:00
Bo Svensson
98f8295765
allows to skip ComputeLightSpaceBounds traversal ( #3152 )
...
Currently, we always traverse the scene graph an additional time with a ComputeLightSpaceBounds visitor during shadow casting. ComputeLightSpaceBounds is only useful when the shadow casting mask allows us to shrink the bounds of the rendered scene, so we guard its traversal with a check against getCastsShadowTraversalMask. In practice, this guard never works because we build the traversal mask inclusively.
With this PR we limit the getCastsShadowTraversalMask check to relevant masks. This new check allows us to skip a superfluous ComputeLightSpaceBounds traversal with most settings.
2021-10-11 11:27:50 +02:00
psi29a
f9124ccea6
Merge branch 'recast_mesh_slope' into 'master'
...
Use different colors for walkable and non-walkable recast mesh triangles
See merge request OpenMW/openmw!1277
2021-10-11 08:56:04 +00:00
psi29a
f014edd27c
Merge branch 'fix_write_recast_mesh' into 'master'
...
Fix writing to file for RecastMesh
See merge request OpenMW/openmw!1278
2021-10-11 08:20:33 +00:00
Bo Svensson
7c50f823d8
devirtualises BSAFile ( #3161 )
...
Currently, Open MW's basic file access speed is limited by a peculiar layer of virtualisation in BSAFile's interface. This PR removes such virtualisation by properly separating BSAFile from CompressedBSAFile in low level contexts.
2021-10-11 10:09:48 +02:00
AnyOldName3
1b83b08d80
Merge remote-tracking branch 'upstream/master' into detain-hash
...
Tests which no longer work are commented out.
Some of these don't work because they're effectively testing for the
presence of bugs in the old implementation.
Others don't work because we're no longer accidentally disabling the
boost::program_options feature where it generates an error if only part
of a token gets consumed.
These will be fixed by later commits.
2021-10-10 23:50:50 +01:00
Bo Svensson
c2d836c6c4
optimises riggeometry.cpp ( #3165 )
...
We skip this during node path iterations. this is not a node we are interested in.
We avoid allocating a new mGeomToSkelMatrix per frame and avoid a ref_ptr associated with its update.
We speed up a search for the Skeleton node by adding a continue; condition prior to an expensive dynamic_cast.
2021-10-10 18:37:34 +02:00
Bo Svensson
031871cd48
speeds up optimizer ( #3162 )
...
We can expect marginally improved loading times with this PR. Drawable, Transform and Node counts in stats panels are expected to remain unchanged - this PR does not add new scene graph optimisations, it just increases the speed with which we apply existing ones.
1. We add explicit `NodeVisitor::apply` overrides for commonly encountered node types to avoid additional virtual function calls per node associated with the default `apply` implementation.
2. We skip pushing `StateSet`s when `_mergeAlphaBlending` is enabled or the `StateSet` contains no relevant state.
3. We add a specialised variant of `CollectLowestTransformsVisitor::addTransform` accepting `MatrixTransform` to avoid matrix copies and multiplications.
2021-10-10 18:09:15 +02:00
elsid
0c8a811ad5
Render only cached recast mesh
...
To avoid waiting while recast mesh is generating.
Remove redundant continue.
2021-10-10 13:13:57 +02:00
elsid
daff7aba01
Use different colors for walkable and non-walkable triangles
2021-10-09 17:44:25 +02:00
elsid
88ac77df1f
Fix writing to file for RecastMesh
...
Add missing scaling and y, z coordinates swap.
2021-10-09 17:30:37 +02:00
Bo Svensson
b61140b8ba
optimises skeleton.cpp ( #3158 )
...
With this PR we optimise a function that is called quite often when loading new cells.
We remove avoidable dynamic_casts.
We remove an unused pair.second element.
We convert a map to an unordered_map because its ordering is irrelevant in this case.
We avoid adding the root Skeleton node to the bones' node path.
2021-10-09 11:14:22 +02:00
AnyOldName3
af0d399103
Purge all uses of Escape Hash types
2021-10-09 01:49:08 +01:00
psi29a
7af245d205
Merge branch 'sync_sync_with_async' into 'master'
...
Merge logic of sync and async physics simulation
See merge request OpenMW/openmw!1250
2021-10-08 09:35:32 +00:00
psi29a
ae31138686
Merge branch 'options_tests' into 'master'
...
Add tests for openmw options
See merge request OpenMW/openmw!1253
2021-10-08 08:02:40 +00:00
Bo Svensson
5242e2695c
avoids memory allocations within ComputeLightSpaceBounds ( #3156 )
...
Currently, we create a new ComputeLightSpaceBounds visitor per frame. Within this visitor, we require excessive memory allocations, mainly a new osg::RefMatrix per encountered Transform node.
With this PR we reuse a single ComputeLightSpaceBounds visitor across frames and enable the createOrReuseMatrix functionality to avoid allocating new matrices every frame. osgUtil::CullVisitor internally uses the same approach.
2021-10-08 09:56:55 +02:00
psi29a
88d5b4a90b
Merge branch 'variable_function' into 'master'
...
Parse local variables sharing a name with a function as variables
Closes #6291
See merge request OpenMW/openmw!1269
2021-10-08 06:45:02 +00:00
psi29a
fc7e13d76a
Merge branch 'omwaddon_dep' into 'master'
...
Allow creating omwaddons without a dependency on an omwgame
See merge request OpenMW/openmw!1243
2021-10-08 06:40:43 +00:00
Bret Curtis
8d37d79d6c
Merge pull request #3154 from bosvensson1/patch-29
...
improves RemoveRedundantNodesVisitor performance for large children vectors
2021-10-07 15:00:38 +02:00
Bo Svensson
08608da62c
optimizer.cpp
2021-10-07 08:29:38 +00:00
AnyOldName3
cf3596fbb4
Add copyright preamble
2021-10-07 00:44:50 +01:00
AnyOldName3
e382f71aea
Add implementation of config file parser lifted from Boost
2021-10-07 00:39:23 +01:00
Evil Eye
5037def3b3
Parse local variables sharing a name with a function as variables
2021-10-06 21:27:08 +02:00
Bo Svensson
87d52dc1fd
fixes coverity-ci warning
2021-10-06 10:04:03 +00:00
Bo Svensson
cd4d76f8c5
discard off-screen lights ( #3120 )
...
Currently, we run culling tests against all lights in the scene during LightListCallback::pushLightState. We can avoid most of these tests by removing off-screen lights at an earlier stage. We should benchmark the cumulative time spent within LightListCallback::pushLightState before and after this PR.
2021-10-06 11:53:24 +02:00
Bo Svensson
787f91211d
resets state updater to apply light settings ( #3141 )
...
resets state updater to apply light settings
With this PR we achieve the same effect with fewer lines of code.
2021-10-06 11:21:30 +02:00
psi29a
c3f5e8f968
Merge branch 'lua_transform' into 'master'
...
3D transforms in Lua
See merge request OpenMW/openmw!1235
2021-10-06 09:21:21 +00:00
elsid
035307b012
Add tests for openmw options
...
In attempt to document current behaviour. Add commented out checks as desired
behaviour.
2021-10-05 22:51:12 +02:00
fredzio
21dbe314bf
Use common function for sync and async case. Now both cases follow the
...
same flow, synchronous simulation is just a special case.
2021-10-05 15:44:20 +02:00
Bo Svensson
4b1c009ffd
use StateSet define for translucentFramebuffer ( #3138 )
...
With this PR we test out osg's shader define system for a somewhat harmless feature. As we can see, our code becomes more concise and efficient in this case. Most importantly, we no longer create unneeded vertex shader objects.
2021-10-05 14:37:08 +02:00
Bo Svensson
b2af81bc18
converts remaining osg::NodeCallback ( #3147 )
...
With this PR we convert remaining instantiations of the deprecated osg::NodeCallback in Open MW to SceneUtil::NodeCallback.
2021-10-05 14:21:12 +02:00
Bo Svensson
3f731cd102
attempts to fix spellcasting freezes ( #3146 )
...
Firstly, this PR reintroduces commit "Recreate a special case for IntersectionVisitor on QuadTreeWorld" we forgot to reapply while reverting a revert commit. Secondly, in cases we still need to build a view for an intersection visitor, we now use the available `osgUtil::IntersectionVisitor::getReferenceEyePoint` instead of falling back to the origin position that was previously causing long rebuild times.
2021-10-04 22:00:31 +02:00
Bo Svensson
14d15dcfac
cleans up osgacontroller.cpp ( #3142 )
...
`handle_stateset` is not needed because `UpdateMatrixTransform` is a `NodeCallback` only allowed to be set on a `Node`. `Geode` and `Drawable` do not need explicit logic because they are both derived from `Node`.
2021-10-04 12:20:33 +02:00
Bo Svensson
aaf7b423d6
adds a replacement for osg::NodeCallback ( #3144 )
...
* nodecallback.hpp
* lightmanager.hpp
* lightmanager.cpp
* lightmanager.hpp
* nodecallback.hpp
* nodecallback.hpp
* [ci skip]
* lightmanager.hpp
* nodecallback.hpp
* nodecallback.hpp
* lightmanager.cpp
* lightmanager.cpp
* nodecallback.hpp
* [ci skip]
* [ci skip]
* controller.cpp
* [ci skip]
* osgacontroller.cpp
* keyframe.hpp
* controller.hpp
* keyframe.hpp
* [ci skip]
* keyframe.hpp
* animation.hpp
* [ci skip]
* weaponanimation.cpp
* nodecallback.hpp
2021-10-04 10:56:55 +02:00
psi29a
2c8c36fe5d
Merge branch 'master' into 'effective_magic'
...
# Conflicts:
# CHANGELOG.md
2021-10-01 21:20:08 +00:00
Bo Svensson
2568f119a4
reapplies PR without npe ( #3137 )
...
* avoids creating empty statesets on drawables
Currently, we attempt to skip creating state on drawable nodes when this state matches the default state. This attempt is incomplete because we still create an avoidable empty stateset in the default case.
* renderingmanager.cpp
* nifloader.cpp
* nifloader.cpp
* shadervisitor.cpp
2021-10-01 10:11:00 +02:00
Petr Mikheev
24ecdc37a7
Fix crash in LuaUtil::ScriptsContainer::~ScriptsContainer()
2021-09-30 03:01:38 +02:00
Evil Eye
dc1fe62dde
Overhaul magic effects to work with onApply and onEnd events
2021-09-29 19:25:10 +02:00
Andrei Kortunov
e109d86489
Revert "avoids creating empty statesets on drawables ( #3132 )"
...
This reverts commit 957c25a491
.
2021-09-29 21:01:22 +04:00
Bret Curtis
b7c1d9edb0
remove unnecessary includes
2021-09-29 17:13:40 +02:00
Bo Svensson
d8707a763f
fixes build ( #3134 )
...
* quadtreeworld.cpp
* renderingmanager.cpp [ci skip]
* quadtreeworld.hpp
* cellborder.hpp
* cellborder.cpp
2021-09-29 17:10:58 +02:00
Bret Curtis
803195a05f
add back some explicit includes
2021-09-29 16:29:10 +02:00
Bo Svensson
8358418555
set the correct program link parameters ( #3110 )
...
* shadermanager.hpp setProgramTemplate
* shadermanager.hpp
* shadermanager.cpp setProgramTemplate
* shadervisitor.hpp setProgramTemplate
* shadervisitor.cpp setProgramTemplate
* scenemanager.cpp setProgramTemplate
* scenemanager.hpp setProgramTemplate
* renderingmanager.cpp
* groundcover.cpp setProgramTemplate
* groundcover.hpp
* groundcover.cpp
* shadervisitor.cpp
* util.cpp
* lightmanager.cpp
* scenemanager.cpp
* scenemanager.hpp
* lightmanager.cpp
* lightmanager.cpp
* lightmanager.cpp
* scenemanager.hpp [ci skip]
* water.cpp
* groundcover.cpp
* shadermanager.hpp
2021-09-29 15:40:37 +02:00
Bo Svensson
957c25a491
avoids creating empty statesets on drawables ( #3132 )
...
* avoids creating empty statesets on drawables
Currently, we attempt to skip creating state on drawable nodes when this state matches the default state. This attempt is incomplete because we still create an avoidable empty stateset in the default case.
* renderingmanager.cpp
* nifloader.cpp
2021-09-29 09:58:19 +02:00
Andrei Kortunov
fc2076db1a
Fix MSVC warnings about local variables redeclaration ( #3130 )
2021-09-29 09:36:05 +02:00
Petr Mikheev
48538d5cef
3D transforms in Lua
2021-09-28 20:37:47 +02:00