dsekai
World engine for retrocomputers.
Loading...
Searching...
No Matches
Functions
Unilayer Graphics Cache

Interface to cache that holds/deduplicates sprites and tiles. More...

Collaboration diagram for Unilayer Graphics Cache:

Functions

int16_t graphics_cache_blit_at (uint16_t bitmap_idx, int16_t instance_id, uint16_t s_x, uint16_t s_y, uint16_t d_x, uint16_t d_y, uint16_t w, uint16_t h)
 Copy part or all of a GRAPHICS_BITMAP image to the screen.
 
void graphics_clear_cache () SECTION_SETUP
 Free up graphics and resources used by loaded assets. Should only be called as part of cleanup (i.e. between maps).
 
int16_t graphics_cache_load_bitmap (RESOURCE_ID id, uint8_t type_flag)
 

Detailed Description

Interface to cache that holds/deduplicates sprites and tiles.

Function Documentation

◆ graphics_cache_blit_at()

int16_t graphics_cache_blit_at ( uint16_t  bitmap_idx,
int16_t  instance_id,
uint16_t  s_x,
uint16_t  s_y,
uint16_t  d_x,
uint16_t  d_y,
uint16_t  w,
uint16_t  h 
)

Copy part or all of a GRAPHICS_BITMAP image to the screen.

Parameters
bitmap_idxIndex of the GRAPHICS_BITMAP in the graphics cache.
instance_idUnique ID for the specific mobile being blitted, or -1.
s_xHorizontal location of upper-left corner of copy source rectangle.
s_yVertical location of upper-left corner of copy source rectangle.
d_xHorizontal location of upper-left corner of destination rectangle.
d_yVertical location of upper-left corner of destination rectangle.
wPixel width of copy rectangle.
hPixel height of copy rectangle.
Returns
1 if blit was successful or 0 otherwise.

This tries to load the bitmap into the internal bitmap cache the first time that bitmap's resource ID is given.