Fix so preview pics will scale correctly
[pandora-libraries.git] / minimenu / mmcache.h
1
2 #ifndef h_mmcache_h
3 #define h_mmcache_h
4
5 /* this cache is used, rather than just pointing right from the mm_app_t iconcache, since many apps
6  * may re-use the same icon, this lets the apps just cross-link to the same icon to save a bit of
7  * memory; probably irrelevent, but what the heck, I'm writing this quick ;)
8  */
9
10 /* the same structure can be used to contain preview pics, in a different list of same type
11  */
12
13 typedef struct _mm_cache_t {
14   char uniqueid [ 1024 ]; // pnd unique-id
15   void /*SDL_Surface*/ *i;
16   // structure
17   struct _mm_cache_t *next; // next in linked list
18 } mm_cache_t;
19
20 unsigned char cache_icon ( pnd_disco_t *app, unsigned char maxwidth, unsigned char maxheight );
21 unsigned char cache_preview ( pnd_disco_t *app, unsigned int maxwidth, unsigned int maxheight );
22
23 mm_cache_t *cache_query ( char *id, mm_cache_t *head );
24 mm_cache_t *cache_query_icon ( char *id ); // specialized version
25 mm_cache_t *cache_query_preview ( char *id ); // specialized version
26
27 #endif