Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
32
Src/Wasabi/api/skin/regioncache.cpp
Normal file
32
Src/Wasabi/api/skin/regioncache.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "precomp.h"
|
||||
#include "regioncache.h"
|
||||
|
||||
|
||||
RegionServer *RegionCache::requestSkinRegion(const wchar_t *filename)
|
||||
{
|
||||
int n = -1;
|
||||
cache.findItem(filename, &n);
|
||||
if (n == -1) return NULL;
|
||||
|
||||
RegionCacheItem *el = cache.enumItem(n);
|
||||
// if (el->region != NULL) el->region->getRegion()->debug();
|
||||
return el->region;
|
||||
}
|
||||
|
||||
void RegionCache::cacheSkinRegion(const wchar_t *filename, api_region *r)
|
||||
{
|
||||
int n = -1;
|
||||
cache.findItem(filename, &n);
|
||||
if (n == -1) return;
|
||||
RegionCacheItem *el = cache.enumItem(n);
|
||||
ASSERT(el != NULL);
|
||||
if (el->region != NULL) {
|
||||
DebugString("Trying to cache a region but cache is already set!\n");
|
||||
return;
|
||||
}
|
||||
el->region = new CacheRegionServer(r);
|
||||
//el->region->getRegion()->debug();
|
||||
}
|
||||
|
||||
|
||||
PtrListQuickSorted<RegionCacheItem, SortRegionCacheItem> RegionCache::cache;
|
Loading…
Add table
Add a link
Reference in a new issue