153 node->
prev =
nullptr;
154 node->
next =
nullptr;
189 this->
lookup.Add(entry, node);
197 Node* node = this->
lookup.ValueAtIndex(index);
212 while (node !=
nullptr)
218 this->
head =
nullptr;
219 this->
tail =
nullptr;
230 if (this->
head ==
nullptr)
234 node->
prev =
nullptr;
235 node->
next =
nullptr;
247 newNode->
next = node;
248 if (node->
prev ==
nullptr)
250 newNode->
prev =
nullptr;
251 this->
head = newNode;
258 node->
prev = newNode;
268 if (node->
prev ==
nullptr)
273 if (node->
next ==
nullptr)
278 node->
next =
nullptr;
279 node->
prev =
nullptr;
Definition texturetilecache.h:62
uint tileSize
Definition texturetilecache.h:105
~TextureTileCache()
destructor
Definition texturetilecache.h:124
TextureTileCache()
constructor
Definition texturetilecache.h:112
void InsertBeginning(Node *node)
insert at beginning of list
Definition texturetilecache.h:228
Node * head
Definition texturetilecache.h:100
Util::FixedArray< Node > nodes
Definition texturetilecache.h:98
uint tiles
Definition texturetilecache.h:104
Node * tail
Definition texturetilecache.h:101
void Clear()
clear cache
Definition texturetilecache.h:209
CacheResult Cache(TileCacheEntry entry)
get tile, if invalid coord, gets the last used, otherwise, bumps the use of it
Definition texturetilecache.h:166
void Remove(Node *node)
detach node and fix tail & head
Definition texturetilecache.h:265
void Setup(uint tileSize, uint textureSize)
setup cache
Definition texturetilecache.h:132
void InsertBefore(Node *node, Node *newNode)
insert before another node
Definition texturetilecache.h:245
Util::Dictionary< TileCacheEntry, Node * > lookup
Definition texturetilecache.h:102
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
#define n_assert(exp)
Definition debug.h:50
The occupancy quad tree implements a tree which allows for a quick search.
Definition occupancyquadtree.h:15
static const TileCacheEntry InvalidTileCacheEntry
Definition texturetilecache.h:59
Nebula's scalar datatype.
Definition texturetilecache.h:18
uint physicalOffsetY
Definition texturetilecache.h:21
uint physicalOffsetX
Definition texturetilecache.h:20
uint mip
Definition texturetilecache.h:19
Definition texturetilecache.h:66
Math::uint2 cached
Definition texturetilecache.h:67
TileCacheEntry evicted
Definition texturetilecache.h:69
bool didCache
Definition texturetilecache.h:68
Definition texturetilecache.h:84
Node * next
Definition texturetilecache.h:88
Math::uint2 offset
Definition texturetilecache.h:86
Node * prev
Definition texturetilecache.h:87
TileCacheEntry entry
Definition texturetilecache.h:85
Definition texturetilecache.h:29
uint64 tiles
Definition texturetilecache.h:30
uint64 tileX
Definition texturetilecache.h:31
uint64 subTextureIndex
Definition texturetilecache.h:33
uint64 tileY
Definition texturetilecache.h:32
Definition texturetilecache.h:27
bool operator>(const TileCacheEntry &rhs) const
Definition texturetilecache.h:41
bool operator!=(const TileCacheEntry &rhs) const
Definition texturetilecache.h:53
Entry entry
Definition texturetilecache.h:37
uint64 hash
Definition texturetilecache.h:38
bool operator<(const TileCacheEntry &rhs) const
Definition texturetilecache.h:45
bool operator==(const TileCacheEntry &rhs) const
Definition texturetilecache.h:49
static const int InvalidIndex
Definition types.h:54
unsigned int uint
Definition types.h:31
uint64_t uint64
Definition types.h:36
int IndexT
Definition types.h:48