Nebula
Loading...
Searching...
No Matches
Terrain::TextureTileCache Class Reference

#include <texturetilecache.h>

Classes

struct  CacheResult
 
struct  Node
 

Public Member Functions

 TextureTileCache ()
 constructor
 
 ~TextureTileCache ()
 destructor
 
void Setup (uint tileSize, uint textureSize)
 setup cache
 
CacheResult Cache (TileCacheEntry entry)
 get tile, if invalid coord, gets the last used, otherwise, bumps the use of it
 
void Clear ()
 clear cache
 

Private Member Functions

void InsertBeginning (Node *node)
 insert at beginning of list
 
void InsertBefore (Node *node, Node *newNode)
 insert before another node
 
void Remove (Node *node)
 detach node and fix tail & head
 

Private Attributes

Util::FixedArray< Nodenodes
 
Nodehead
 
Nodetail
 
Util::Dictionary< TileCacheEntry, Node * > lookup
 
uint tiles
 
uint tileSize
 

Constructor & Destructor Documentation

◆ TextureTileCache()

Terrain::TextureTileCache::TextureTileCache ( )
inline

constructor

◆ ~TextureTileCache()

Terrain::TextureTileCache::~TextureTileCache ( )
inline

destructor

Member Function Documentation

◆ Cache()

TextureTileCache::CacheResult Terrain::TextureTileCache::Cache ( TileCacheEntry entry)
inline

get tile, if invalid coord, gets the last used, otherwise, bumps the use of it

◆ Clear()

void Terrain::TextureTileCache::Clear ( )
inline

clear cache

◆ InsertBefore()

void Terrain::TextureTileCache::InsertBefore ( Node * node,
Node * newNode )
inlineprivate

insert before another node

◆ InsertBeginning()

void Terrain::TextureTileCache::InsertBeginning ( Node * node)
inlineprivate

insert at beginning of list

◆ Remove()

void Terrain::TextureTileCache::Remove ( Node * node)
inlineprivate

detach node and fix tail & head

◆ Setup()

void Terrain::TextureTileCache::Setup ( uint tileSize,
uint textureSize )
inline

setup cache

Member Data Documentation

◆ head

Node* Terrain::TextureTileCache::head
private

◆ lookup

Util::Dictionary<TileCacheEntry, Node*> Terrain::TextureTileCache::lookup
private

◆ nodes

Util::FixedArray<Node> Terrain::TextureTileCache::nodes
private

◆ tail

Node* Terrain::TextureTileCache::tail
private

◆ tiles

uint Terrain::TextureTileCache::tiles
private

◆ tileSize

uint Terrain::TextureTileCache::tileSize
private

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