FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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

enum  RenderEntryUpdateType { EntryNoneUpdate = 0x00, EntryVisualUpdate = 0x01, EntryPositionUpdate = 0x02, EntryFullUpdate = 0x03 }
 
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 updateEntries (std::set< int32_t > &removes, RenderList &renderlist)
 
bool updateVisual (Entry *entry)
 
void updatePosition (Entry *entry)
 
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 ( )

Member Function Documentation

void FIFE::LayerCache::collect ( const Rect viewport,
std::vector< int32_t > &  indices 
)
private
void FIFE::LayerCache::fullUpdate ( Camera::Transform  transform)
private

Definition at line 440 of file layercache.cpp.

References FIFE::LayerCache::Entry::forceUpdate, FIFE::LayerCache::Entry::instanceIndex, m_entries, FIFE::Camera::RotationTransform, updatePosition(), and updateVisual().

Referenced by update().

+ Here is the caller graph for this function:

ImagePtr FIFE::LayerCache::getCacheImage ( )

Definition at line 706 of file layercache.cpp.

References m_cacheImage.

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

+ Here is the caller graph for this function:

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

Definition at line 221 of file layercache.cpp.

References addInstance(), FIFE::Layer::getInstances(), m_cacheImage, m_entries, m_entriesToUpdate, m_freeEntries, m_instance_map, m_layer, m_renderItems, m_tree, and FIFE::SharedPtr< T >::reset().

Referenced by setLayer().

+ Here is the caller graph for this function:

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

Definition at line 710 of file layercache.cpp.

References m_cacheImage.

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

Member Data Documentation

ImagePtr FIFE::LayerCache::m_cacheImage
private

Definition at line 103 of file layercache.h.

Referenced by getCacheImage(), reset(), and setCacheImage().

Camera* FIFE::LayerCache::m_camera
private
std::vector<Entry*> FIFE::LayerCache::m_entries
private
std::set<int32_t> FIFE::LayerCache::m_entriesToUpdate
private

Definition at line 108 of file layercache.h.

Referenced by addInstance(), removeInstance(), reset(), update(), updateEntries(), and updateInstance().

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

Definition at line 109 of file layercache.h.

Referenced by addInstance(), removeInstance(), and reset().

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

Definition at line 105 of file layercache.h.

Referenced by addInstance(), removeInstance(), reset(), and updateInstance().

Layer* FIFE::LayerCache::m_layer
private
CacheLayerChangeListener* FIFE::LayerCache::m_layerObserver
private

Definition at line 101 of file layercache.h.

Referenced by setLayer(), and ~LayerCache().

bool FIFE::LayerCache::m_needSorting
private

Definition at line 111 of file layercache.h.

Referenced by LayerCache(), sortRenderList(), update(), and updateEntries().

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

Definition at line 117 of file layercache.h.

Referenced by LayerCache(), update(), and updatePosition().

CacheTree* FIFE::LayerCache::m_tree
private

Definition at line 102 of file layercache.h.

Referenced by collect(), LayerCache(), reset(), updatePosition(), and ~LayerCache().

double FIFE::LayerCache::m_zMax
private

Definition at line 113 of file layercache.h.

Referenced by LayerCache(), sortRenderList(), and update().

double FIFE::LayerCache::m_zMin
private

Definition at line 112 of file layercache.h.

Referenced by LayerCache(), sortRenderList(), and update().

double FIFE::LayerCache::m_zoom
private

Definition at line 115 of file layercache.h.

Referenced by LayerCache(), update(), and updatePosition().

bool FIFE::LayerCache::m_zoomed
private

Definition at line 116 of file layercache.h.

Referenced by LayerCache(), update(), and updatePosition().


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