22 #ifndef FIFE_VIEW_LAYERCACHE_H
23 #define FIFE_VIEW_LAYERCACHE_H
36 #include "model/structures/location.h"
37 #include "util/math/matrix.h"
38 #include "util/structures/rect.h"
39 #include "util/structures/quadtree.h"
40 #include "model/metamodel/grids/cellgrid.h"
42 #include "rendererbase.h"
47 class CacheLayerChangeListener;
51 typedef QuadTree<std::set<int> > CacheTree;
53 LayerCache(Camera* camera, ImagePool* image_pool, AnimationPool* animation_pool);
56 void setLayer(Layer* layer);
57 void update(Camera::Transform transform, RenderList& renderlist);
59 void addInstance(Instance* instance);
60 void removeInstance(Instance* instance);
62 void updateInstance(Instance* instance);
66 void collect(
const Rect& viewport, std::vector<int>& indices);
72 CacheTree::Node* node;
75 unsigned instance_index;
83 ImagePool* m_image_pool;
84 AnimationPool* m_animation_pool;
87 CacheLayerChangeListener* m_layer_observer;
89 void updateEntry(Entry& item);
91 std::map<Instance*,int> m_instance_map;
92 std::vector<Entry> m_entries;
95 std::vector<RenderItem> m_instances;