40 |
|
|
41 |
struct bmpcache_entry |
struct bmpcache_entry |
42 |
{ |
{ |
43 |
HBITMAP bitmap; |
RD_HBITMAP bitmap; |
44 |
sint16 previous; |
sint16 previous; |
45 |
sint16 next; |
sint16 next; |
46 |
}; |
}; |
47 |
|
|
48 |
static struct bmpcache_entry g_bmpcache[3][0xa00]; |
static struct bmpcache_entry g_bmpcache[3][0xa00]; |
49 |
static HBITMAP g_volatile_bc[3]; |
static RD_HBITMAP g_volatile_bc[3]; |
50 |
|
|
51 |
static int g_bmpcache_lru[3] = { NOT_SET, NOT_SET, NOT_SET }; |
static int g_bmpcache_lru[3] = { NOT_SET, NOT_SET, NOT_SET }; |
52 |
static int g_bmpcache_mru[3] = { NOT_SET, NOT_SET, NOT_SET }; |
static int g_bmpcache_mru[3] = { NOT_SET, NOT_SET, NOT_SET }; |
190 |
} |
} |
191 |
|
|
192 |
/* Retrieve a bitmap from the cache */ |
/* Retrieve a bitmap from the cache */ |
193 |
HBITMAP |
RD_HBITMAP |
194 |
cache_get_bitmap(uint8 id, uint16 idx) |
cache_get_bitmap(uint8 id, uint16 idx) |
195 |
{ |
{ |
196 |
if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0]))) |
if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0]))) |
214 |
|
|
215 |
/* Store a bitmap in the cache */ |
/* Store a bitmap in the cache */ |
216 |
void |
void |
217 |
cache_put_bitmap(uint8 id, uint16 idx, HBITMAP bitmap) |
cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap) |
218 |
{ |
{ |
219 |
HBITMAP old; |
RD_HBITMAP old; |
220 |
|
|
221 |
if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0]))) |
if ((id < NUM_ELEMENTS(g_bmpcache)) && (idx < NUM_ELEMENTS(g_bmpcache[0]))) |
222 |
{ |
{ |
293 |
/* Store a glyph in the font cache */ |
/* Store a glyph in the font cache */ |
294 |
void |
void |
295 |
cache_put_font(uint8 font, uint16 character, uint16 offset, |
cache_put_font(uint8 font, uint16 character, uint16 offset, |
296 |
uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap) |
uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap) |
297 |
{ |
{ |
298 |
FONTGLYPH *glyph; |
FONTGLYPH *glyph; |
299 |
|
|
392 |
|
|
393 |
|
|
394 |
/* CURSOR CACHE */ |
/* CURSOR CACHE */ |
395 |
static HCURSOR g_cursorcache[0x20]; |
static RD_HCURSOR g_cursorcache[0x20]; |
396 |
|
|
397 |
/* Retrieve cursor from cache */ |
/* Retrieve cursor from cache */ |
398 |
HCURSOR |
RD_HCURSOR |
399 |
cache_get_cursor(uint16 cache_idx) |
cache_get_cursor(uint16 cache_idx) |
400 |
{ |
{ |
401 |
HCURSOR cursor; |
RD_HCURSOR cursor; |
402 |
|
|
403 |
if (cache_idx < NUM_ELEMENTS(g_cursorcache)) |
if (cache_idx < NUM_ELEMENTS(g_cursorcache)) |
404 |
{ |
{ |
413 |
|
|
414 |
/* Store cursor in cache */ |
/* Store cursor in cache */ |
415 |
void |
void |
416 |
cache_put_cursor(uint16 cache_idx, HCURSOR cursor) |
cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor) |
417 |
{ |
{ |
418 |
HCURSOR old; |
RD_HCURSOR old; |
419 |
|
|
420 |
if (cache_idx < NUM_ELEMENTS(g_cursorcache)) |
if (cache_idx < NUM_ELEMENTS(g_cursorcache)) |
421 |
{ |
{ |