430 |
error("put cursor %d\n", cache_idx); |
error("put cursor %d\n", cache_idx); |
431 |
} |
} |
432 |
} |
} |
433 |
|
|
434 |
|
/* BRUSH CACHE */ |
435 |
|
static BRUSHDATA g_brushcache[64]; |
436 |
|
|
437 |
|
/* Retrieve brush from cache */ |
438 |
|
BRUSHDATA * |
439 |
|
cache_get_brush_data(uint16 cache_idx) |
440 |
|
{ |
441 |
|
if (cache_idx < NUM_ELEMENTS(g_brushcache)) |
442 |
|
{ |
443 |
|
return &g_brushcache[cache_idx]; |
444 |
|
} |
445 |
|
error("get brush %d\n", cache_idx); |
446 |
|
return NULL; |
447 |
|
} |
448 |
|
|
449 |
|
/* Store brush in cache */ |
450 |
|
void |
451 |
|
cache_put_brush_data(uint16 cache_idx, BRUSHDATA * brush_data) |
452 |
|
{ |
453 |
|
if (cache_idx < NUM_ELEMENTS(g_brushcache)) |
454 |
|
{ |
455 |
|
memcpy(&g_brushcache[cache_idx], brush_data, sizeof(BRUSHDATA)); |
456 |
|
} |
457 |
|
else |
458 |
|
{ |
459 |
|
error("put brush %d\n", cache_idx); |
460 |
|
} |
461 |
|
} |