Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Wasabi/api/skin/regioncache.cpp

33 lines
813 B
C++
Raw Normal View History

2024-09-24 12:54:57 +00:00
#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;