Commit Graph

22 Commits (5d37cb3b74b1e47fef78fdabaedb791091018dc6)

Author SHA1 Message Date
Sam Hellawell 8c2c66d59e .nif check, matrix mult feedback, auto usage, reuse NodeMap typedef 9 months ago
Sam Hellawell 2288a691d2 Replace osgAnimation bone underscore naming at load time, map bone instances, reset root bone transform each frame 9 months ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
unknown 206711876d Address feedback 2 years ago
unknown 827a2f0b77 Use string_view in animation code 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
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.
3 years ago
Alexei Dobrohotov 1fc7cb8191 Don't use FreezeOnCull for any particle system (#4744) 3 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
Andrei Kortunov e06f0b797a Replace all NULLs to nullptr 6 years ago
Kyle Cooley e2ac392a40 Move common stuff to scene util, fix errors with 1st person meshes 6 years ago
Kyle Cooley 8444ee9981 Start rendering npc's 6 years ago
Miloslav Číž 380a5799dd use bbox as wrap range & apply to all particle systems 7 years ago
Miloslav Číž 33a1459b11 search for particle system by class name 7 years ago
scrawl 33e654f94d Add explicit handling of most commonly used nodes to NodeVisitors to avoid excessive virtual function calls 8 years ago
scrawl f898bf493f Don't use Geodes 9 years ago
scrawl f1ac408f35 Place Drawables directly in the scene graph when built with OSG 3.4
OSG 3.4 adds the ability to place Drawables directly in the scene graph, without a Geode decorating them. Leveraging this should give a small performance boost, because the redundant Geodes increase culling overhead.

There is still an oustanding issue with the RemoveDrawableVisitor no longer working correctly, because Drawables can have multiple parents.
9 years ago
scrawl fd1ccd21ff Disable freezeOnCull for weather particles 9 years ago
scrawl 12f3198f68 Node name lookups should be case insensitive
Concerns "AttachLight", "BoneOffset" and equipment part attachment points, that are all case insensitive in vanilla MW.
10 years ago
scrawl bd88758962 Use the new skinning system in OpenMW 10 years ago
scrawl f7d2a28930 Port BoneOffset 10 years ago
scrawl 591a35b8d7 *very* early version of the LightManager 10 years ago