N64FlashcartMenu
Loading...
Searching...
No Matches
background.c File Reference

Implementation of the background UI component. More...

Data Structures

struct  component_background_t
 Structure representing the background component. More...
 

Macros

#define CACHE_METADATA_MAGIC   (0x424B4731)
 

Functions

void ui_components_background_init (char *cache_location)
 Initialize the background component and load from cache.
 
void ui_components_background_free (void)
 Free the background component and its resources.
 
void ui_components_background_replace_image (surface_t *image)
 Replace the background image and update cache/display list.
 
void ui_components_background_draw (void)
 Draw the background image or clear the screen if not available.
 

Detailed Description

Implementation of the background UI component.


Data Structure Documentation

◆ component_background_t

struct component_background_t

Structure representing the background component.

Data Fields
char * cache_location

Path to the cache file location.

surface_t * image

Pointer to the loaded image surface.

rspq_block_t * image_display_list

Display list for rendering the image.

◆ cache_metadata_t

struct cache_metadata_t

Structure for background image cache metadata.

Data Fields
uint32_t magic

Magic number for cache validation.

uint32_t width

Image width in pixels.

uint32_t height

Image height in pixels.

uint32_t size

Image buffer size in bytes.

Function Documentation

◆ ui_components_background_init()

void ui_components_background_init ( char * cache_location)

Initialize the background component and load from cache.

Initialize the background component.

Parameters
cache_locationPath to the cache file location.

◆ ui_components_background_free()

void ui_components_background_free ( void )

Free the background component and its resources.

Free the background component resources.

◆ ui_components_background_replace_image()

void ui_components_background_replace_image ( surface_t * image)

Replace the background image and update cache/display list.

Replace the background image.

Parameters
imagePointer to the new background image surface.

◆ ui_components_background_draw()

void ui_components_background_draw ( void )

Draw the background image or clear the screen if not available.

Draw the background component.