Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View 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;