Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.
Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.
It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.
All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
Actors with disabled collisions still have physics simulations. Assuming they
should not be processed at all instead of disabling collision add a new flag to
make them inactive.
The virtual function does the same thing.
* Change return type to osg::Vec2i to avoid dependency on ESM3.
* Rename to positionToCellIndex to make it clear what is the index.
In file included from /home/elsid/dev/openmw/build/clang/unity/apps/openmw/ub_mwworld.cpp:41:
/home/elsid/dev/openmw/apps/openmw/mwworld/groundcoverstore.cpp:10:9: error: no type named 'Query' in 'MWWorld::EsmLoader'; did you mean '::EsmLoader::Query'?
EsmLoader::Query query;
^~~~~~~~~~~~~~~~
::EsmLoader::Query
/home/elsid/dev/openmw/./components/esmloader/load.hpp:23:12: note: '::EsmLoader::Query' declared here
struct Query
^
Engine controls lifetime of managers therefore it should own them. Environment
is only access provider.
This allows to avoid redundant virtual calls and also some functions from
managers base classes can be removed if they are used only by Engine.
for MWWorld::Action, ProjectileManager and ESSImport::Converter.
shared_ptr has additional cost of reference counter and requires additional
allocation when constructed as shared_ptr<T>(new T).