Makes cells cache size configurable

pull/220/head
Andrei Kortunov 8 years ago
parent f9cdc2da94
commit f17badb3cd

@ -7,6 +7,7 @@
#include <components/esm/defs.hpp> #include <components/esm/defs.hpp>
#include <components/esm/cellstate.hpp> #include <components/esm/cellstate.hpp>
#include <components/loadinglistener/loadinglistener.hpp> #include <components/loadinglistener/loadinglistener.hpp>
#include <components/settings/settings.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
@ -88,7 +89,7 @@ void MWWorld::Cells::writeCell (ESM::ESMWriter& writer, CellStore& cell) const
MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& reader) MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& reader)
: mStore (store), mReader (reader), : mStore (store), mReader (reader),
mIdCache (40, std::pair<std::string, CellStore *> ("", (CellStore*)0)), /// \todo make cache size configurable mIdCache (Settings::Manager::getInt("pointers cache size", "Cells"), std::pair<std::string, CellStore *> ("", (CellStore*)0)),
mIdCacheIndex (0) mIdCacheIndex (0)
{} {}

@ -164,3 +164,12 @@ cache expiry delay
The amount of time (in seconds) that a preloaded texture or object will stay in cache The amount of time (in seconds) that a preloaded texture or object will stay in cache
after it is no longer referenced or required, for example, when all cells containing this texture have been unloaded. after it is no longer referenced or required, for example, when all cells containing this texture have been unloaded.
pointers cache size
------------------
:Type: integer
:Range: >0
:Default: 40
The count of object pointers, that will be saved for a faster search by object ID.

@ -76,6 +76,9 @@ preload cell expiry delay = 5
# How long to keep models/textures/collision shapes in cache after they're no longer referenced/required (in seconds) # How long to keep models/textures/collision shapes in cache after they're no longer referenced/required (in seconds)
cache expiry delay = 5 cache expiry delay = 5
# The count of pointers, that will be saved for a faster search by object ID.
pointers cache size = 40
[Terrain] [Terrain]
# If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells # If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells

Loading…
Cancel
Save