Commit Graph

45 Commits

Author SHA1 Message Date
elsid cd6e49796e
Properly initialize local static pointers and collections
Static variables should be initalized once instead of initializing them with
nullptr and then doing actual initialization behind if condition. Otherwise a
race condition may happen leading to undefined behaviour.
2024-09-21 13:52:43 +02:00
Alexei Kotov 799da630e4 CopyRigVisitor: don't copy unskinned geometry (bug #5280) 2023-10-07 00:11:31 +03:00
Andrei Kortunov 35561450f1 Do not copy osg::ref_ptr when possible 2023-07-31 20:43:46 +04:00
elsid 843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
clang-format-bot ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid 5dc612aa54
Replace ciCompareLen with ciStartsWith where possible
`ciCompareLen(a, b, b.size()) == 0` expression is an equivalent of checking for
equality of `a` prefix with size `b.size()` with `b`.

`ciCompareLen(a, b, a.size()) == 0` is also the same thing but `a` is a prefix
`b` should start with.
2022-08-22 09:32:22 +02:00
unknown 206711876d Address feedback 2022-08-21 19:43:29 +02:00
unknown 827a2f0b77 Use string_view in animation code 2022-08-21 18:53:38 +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
Evil Eye a9106f4d7c Rotate torches by 90 degrees 2021-11-02 18:01:22 +01: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
psi29a 01a8998e3b return if source is null in mergeUserData 2021-09-10 14:04:11 +00:00
Bo Svensson 147ed39900
This PR solves a crash with Robert's bodies logged on your bugtracker. (#3095)
* attach.cpp [ci skip]

* attach.cpp [ci skip]

* attach.cpp [ci skip]

* npcanimation.cpp [ci skip]

* attach.hpp [ci skip]

* attach.cpp [ci skip]

* creatureanimation.cpp [ci skip]

* creatureanimation.cpp [ci skip]

* cellpreloader.cpp

* npcanimation.cpp

* attach.cpp

* make android adk happy

* make android adk happy

* changelog.md [ci skip]

* authors.md [ci skip]
2021-09-09 22:56:57 +02:00
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 2020-10-16 22:18:54 +04:00
Capostrophic 3b55d657e5 CopyRigVisitor: Log the number of parents in multiple parents error 2020-07-26 09:57:43 +03:00
Capostrophic 78b1bbe130 Remove unnecessary null check 2020-05-15 10:34:49 +03:00
Capostrophic 72e5043eda CopyRigVisitor fixes
Make sure it copies all relevant drawable parent nodes (e.g. including the node with the environment map effect)
Make sure it doesn't copy nodes multiple times
2020-05-15 01:12:06 +03:00
Andrei Kortunov 3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
Andrei Kortunov 1452684d9e Use new logging system for components 2018-08-14 19:42:41 +04:00
scrawl 209e139aa8 Move double buffering implementation inside RigGeometry
The double buffering is an implementation detail so it should be handled as such, rather than mandating the scene graph to be structured in a certain way.

Override accept(NodeVisitor&) instead of using callbacks.
2017-09-01 21:42:34 +00:00
scrawl 45f7563a55 Revert "Revert "Check for a Geometry node when attaching bodyparts""
Issue with shaders has been fixed with b9931fb71c

This reverts commit a1e3fb7604.
2017-08-31 21:40:35 +00:00
scrawl a1e3fb7604 Revert "Check for a Geometry node when attaching bodyparts"
This reverts commit 3fc8634206.
2017-08-29 22:40:19 +00:00
scrawl 3fc8634206 Check for a Geometry node when attaching bodyparts (Fixes #3957) 2017-08-29 12:55:42 +00:00
scrawl 8d84869432 Fix commit 8f71b65d38 (don't overwrite the previous user data)
This resulted in a crash/corruption because the KeyframeController, for performance reasons, does not check that the expected user data is there and of correct type.

(Fixes #3829)
2017-05-05 05:27:00 +02:00
scrawl 8f71b65d38 sceneutil/attach: inherit the UserDataContainer to avoid the resource cache from being cleared incorrectly 2017-04-14 15:04:53 +02:00
scrawl 29556a1802 More consistent wording of errors/warnings
A Warning indicates a potential problem in the content file(s) that the user told OpenMW to load. E.g. this might cause an object to not display at all or as intended, however the rest of the game will run fine.

An Error, however, is more likely to be a bug with the engine itself - it means that basic assumptions have been violated and the engine might not run correctly anymore.

The above mostly applies to errors/warnings during game-play; startup issues are handled differently: when a file is completely invalid/corrupted to the point that the engine can not start, that might cause messages that are worded as Error due to the severity of the issue but are not necessarily the engine's fault.

Hopefully, being a little more consistent here will alleviate confusion among users as to when a log message should be reported and to whom.
2017-03-04 21:48:31 +01:00
scrawl c231b06320 Remove boneOffset node after using it 2017-02-23 23:28:50 +01:00
scrawl 33e654f94d Add explicit handling of most commonly used nodes to NodeVisitors to avoid excessive virtual function calls 2017-02-04 02:16:26 +01:00
scrawl 767eba941f Speed up finding of attachment node by using the cached nodeMap 2017-02-03 23:15:37 +01:00
scrawl f898bf493f Don't use Geodes 2016-03-10 13:17:01 +01:00
scrawl 0df975a4d7 Properly detach nodes in CopyRigVisitor (Fixes #3234) 2016-03-06 11:33:07 +01:00
scrawl 563807ee53 Share the StateSet used to invert front face 2016-03-02 13:33:44 +01:00
scrawl 1e5b4bea0a Don't create an unnecessary osg::Group when copying over a rig 2016-02-29 17:50:18 +01:00
scrawl b3f5ac5dbb Include cleanup 2015-07-25 02:11:49 +02:00
scrawl 7882c3d7f0 Fix incorrect rotation for meshes with BoneOffset 2015-05-20 04:09:21 +02:00
scrawl 5fbcf8a859 Mesh filtering fix 2015-04-22 16:59:23 +02:00
scrawl eaa4316ff8 Move skinning code to SceneUtil 2015-04-21 20:30:48 +02:00
scrawl bd88758962 Use the new skinning system in OpenMW 2015-04-21 18:54:03 +02:00
scrawl f7d2a28930 Port BoneOffset 2015-04-19 14:25:36 +02:00
scrawl 8f6d4fb3e0 Fix filtering bug 2015-04-16 01:26:58 +02:00
scrawl 57fd18b161 Fix frontface bug 2015-04-15 22:43:53 +02:00
scrawl c334a76a6f Fix skinning bug 2015-04-15 22:38:43 +02:00
scrawl 591a35b8d7 *very* early version of the LightManager 2015-04-10 23:16:17 +02:00
scrawl 5162e9c09e Add comment 2015-03-29 19:39:22 +02:00
scrawl a7272b73d0 Add utility for assembling body parts / equipment 2015-03-29 19:39:22 +02:00