SceneUtil::KeyframeHolder and SceneUtil::AnimBlendRules are pure data — a
map of keyframe controllers and a vector of blend rules. Nothing attaches
them to a scene graph; both classes existed as osg::Object only because
the cache stored them via osg::ref_ptr. With the value-type seam from the
previous MR in place, they can be plain classes cached as
std::shared_ptr<const T>, and the TemplateRef pins in AnimBlendRulesManager
become an aliasing shared_ptr that keeps the cached base and override rules
alive while merged rules are in use.
* don't force Debian-style games prefix - distros that want it can add
it with -DCMAKE_INSTALL_DATAROOTDIR=/share/games etc., but it should
be easy for normal distros to not get the prefix and end up with a
working build.
* only set GLOBAL_DATA_PATH/GLOBAL_CONFIG_PATH defines for the one file
that uses them. This means changing them won't force a rebuild of
every single file.
* improve how those defines are used to eliminate some fuckiness
This has confused users for years, and there's no such thing as an invalid setting, as it may be valid for a different version of OpenMW that doesn't even exist yet.
osg::UserDataContainer only accepts osg::Object, so four payloads that are
pure game data inherited from it purely to get in the door: TextKeyMapHolder,
MWRender::PtrHolder, RefnumMarker and RefnumSet. SceneUtil::UserData<T> takes
that base on once so the payloads do not have to, which lets TextKeyMapHolder,
PtrHolder and RefnumSet disappear entirely in favour of TextKeyMap, MWWorld::Ptr
and std::vector<ESM::RefNum>, and leaves RefnumMarker a plain aggregate. The
five hand-rolled dynamic_cast scans over the container collapse into findUserData
and forEachUserData, which also drops the positional getUserObject(0) assumption
in getPagedRefnums in favour of a lookup by type.
SceneUtil::WorkQueue is a thread pool with no scene graph in it, so neither it
nor WorkItem needs an OSG base class to be reference counted; both now use
std::shared_ptr and workqueue.hpp, workqueue.cpp and generatenavmeshtile.hpp
end up with no reference to osg at all. Because osg::ref_ptr can re-adopt a raw
pointer and std::shared_ptr cannot without minting a second control block, the
places that passed the queue around as WorkQueue* now pass const
std::shared_ptr<WorkQueue>& instead, which is RenderingManager::getWorkQueue
and the World, WindowManager, MapWindow and GlobalMap constructors. The
non-owning WorkQueue& parameters in UnrefQueue, WorkThread and navmeshtool are
unchanged, and WorkItem gains the virtual destructor it used to inherit.
Deleting the wrapper missed that it had a second job: being a type serialize.cpp could ignore by name, which a bare osg::Object parked in a user data container cannot be singled out for. Without it a scene dump hoists the entire template subtree into the user-data block and demotes the node's real children to bare UniqueID back-references, and no blunt filter can fix that because the same containers carry shaderPrefix, recordIndex and fileHash value objects that the dump should keep. TemplateMultiRef stays gone, the eight call sites still share one addTemplateRef helper that ignores a null template, and holding a ref_ptr<const osg::Object> means no call site needs a const_cast any more.
The helper lived in its own templateref.hpp, which no longer declared any TemplateRef type, so it now sits next to SceneUtil::CopyOp in clone.hpp where the shallow-copy safety contract it exists to serve is already documented; the file and its CMake entry are gone and the five call sites include clone.hpp instead. The helper also skips a null template rather than parking a null ref_ptr in the user data container, which AnimBlendRulesManager::getRules can hit today because it adds the override rules unconditionally while only dereferencing them under a null check.