FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::LayerCache Class Reference

#include <layercache.h>

+ Collaboration diagram for FIFE::LayerCache:

Classes

struct  Entry
 

Public Types

typedef QuadTree< std::set< int32_t > > CacheTree
 

Public Member Functions

 LayerCache (Camera *camera)
 
 ~LayerCache ()
 
void setLayer (Layer *layer)
 
void update (Camera::Transform transform, RenderList &renderlist)
 
void addInstance (Instance *instance)
 
void removeInstance (Instance *instance)
 
void updateInstance (Instance *instance)
 
ImagePtr getCacheImage ()
 
void setCacheImage (ImagePtr image)
 

Private Types

typedef uint8_t RenderEntryUpdate
 

Private Member Functions

void collect (const Rect &viewport, std::vector< int32_t > &indices)
 
void reset ()
 
void fullUpdate (Camera::Transform transform)
 
void fullCoordinateUpdate (Camera::Transform transform)
 
void updateEntries (std::set< int32_t > &removes, RenderList &renderlist)
 
bool updateVisual (Entry *entry)
 
void updatePosition (Entry *entry)
 
void updateScreenCoordinate (RenderItem *item, bool changedZoom=true)
 
void sortRenderList (RenderList &renderlist)
 

Private Attributes

Cameram_camera
 
Layerm_layer
 
CacheLayerChangeListenerm_layerObserver
 
CacheTreem_tree
 
ImagePtr m_cacheImage
 
std::map< Instance *, int32_t > m_instance_map
 
std::vector< Entry * > m_entries
 
std::vector< RenderItem * > m_renderItems
 
std::set< int32_t > m_entriesToUpdate
 
std::deque< int32_t > m_freeEntries
 
bool m_needSorting
 
double m_zMin
 
double m_zMax
 
double m_zoom
 
bool m_zoomed
 
bool m_straightZoom
 

Detailed Description

Definition at line 49 of file layercache.h.

Member Typedef Documentation

typedef QuadTree<std::set<int32_t> > FIFE::LayerCache::CacheTree

Definition at line 51 of file layercache.h.

typedef uint8_t FIFE::LayerCache::RenderEntryUpdate
private

Definition at line 74 of file layercache.h.

Member Enumeration Documentation

Enumerator
EntryNoneUpdate 
EntryVisualUpdate 
EntryPositionUpdate 
EntryFullUpdate 

Definition at line 68 of file layercache.h.

Constructor & Destructor Documentation

FIFE::LayerCache::LayerCache ( Camera camera)
FIFE::LayerCache::~LayerCache ( )

Definition at line 192 of file layercache.cpp.

Member Function Documentation

void FIFE::LayerCache::collect ( const Rect viewport,
std::vector< int32_t > &  indices 
)
private
ImagePtr FIFE::LayerCache::getCacheImage ( )

Definition at line 806 of file layercache.cpp.

Referenced by FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

void FIFE::LayerCache::removeInstance ( Instance instance)

Definition at line 280 of file layercache.cpp.

References FIFE::RenderItem::reset().

Referenced by FIFE::CacheLayerChangeListener::onInstanceDelete().

+ Here is the caller graph for this function:

void FIFE::LayerCache::reset ( )
private

Definition at line 219 of file layercache.cpp.

void FIFE::LayerCache::setCacheImage ( ImagePtr  image)

Definition at line 810 of file layercache.cpp.

Referenced by FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

void FIFE::LayerCache::setLayer ( Layer layer)
void FIFE::LayerCache::sortRenderList ( RenderList renderlist)
private
void FIFE::LayerCache::updateScreenCoordinate ( RenderItem item,
bool  changedZoom = true 
)
inlineprivate

Member Data Documentation

ImagePtr FIFE::LayerCache::m_cacheImage
private

Definition at line 105 of file layercache.h.

Camera* FIFE::LayerCache::m_camera
private

Definition at line 101 of file layercache.h.

std::vector<Entry*> FIFE::LayerCache::m_entries
private

Definition at line 108 of file layercache.h.

std::set<int32_t> FIFE::LayerCache::m_entriesToUpdate
private

Definition at line 110 of file layercache.h.

std::deque<int32_t> FIFE::LayerCache::m_freeEntries
private

Definition at line 111 of file layercache.h.

std::map<Instance*, int32_t> FIFE::LayerCache::m_instance_map
private

Definition at line 107 of file layercache.h.

Layer* FIFE::LayerCache::m_layer
private

Definition at line 102 of file layercache.h.

CacheLayerChangeListener* FIFE::LayerCache::m_layerObserver
private

Definition at line 103 of file layercache.h.

bool FIFE::LayerCache::m_needSorting
private

Definition at line 113 of file layercache.h.

std::vector<RenderItem*> FIFE::LayerCache::m_renderItems
private

Definition at line 109 of file layercache.h.

bool FIFE::LayerCache::m_straightZoom
private

Definition at line 119 of file layercache.h.

CacheTree* FIFE::LayerCache::m_tree
private

Definition at line 104 of file layercache.h.

double FIFE::LayerCache::m_zMax
private

Definition at line 115 of file layercache.h.

double FIFE::LayerCache::m_zMin
private

Definition at line 114 of file layercache.h.

double FIFE::LayerCache::m_zoom
private

Definition at line 117 of file layercache.h.

bool FIFE::LayerCache::m_zoomed
private

Definition at line 118 of file layercache.h.


The documentation for this class was generated from the following files: