35#ifndef __JO_PALETTE_H__
36# define __JO_PALETTE_H__
41# define JO_PALETTE_MAX_COLORS (255)
63 const int count,
const int levels);
66# define JO_PALETTE_LIGHT_COLOR(PALETTE_ID, FIRST, I) ((jo_color)((PALETTE_ID) * 256 + (FIRST) + (I)))
81 return ((
jo_color)(palette->
id * 256 + index));
91 while (size-- > 0) *(cram_addr++) = *(
data++);
120#ifdef JO_COMPILE_WITH_PRINTF_SUPPORT
127static __jo_force_inline void jo_set_printf_palette_color(
const unsigned short index,
const unsigned short color)
#define __JO_INDEX_IS_WRONG(INDEX, COUNT, WHAT)
Check an index given to a function of the engine (Internal usage, JO_DEBUG).
Definition core.h:55
void * data
Definition entity.h:19
#define JO_MULT_BY_16(X)
Multiply a variable by 16.
Definition math.h:87
static __jo_force_inline void jo_palette_to_cram(unsigned short *restrict data, unsigned short *restrict cram_addr, unsigned int size)
Copies the image palette data to CRAM.
Definition palette.h:89
static __jo_force_inline void jo_create_palette_from(jo_palette *const output, unsigned short *data, unsigned int size)
Create a new palette from existing data.
Definition palette.h:100
static __jo_force_inline jo_color jo_palette_color(const jo_palette *const palette, const int index)
Color code of a color of a palette: a polygon of this color (jo_3d_set_mesh_polygon_color()) has the ...
Definition palette.h:74
void jo_set_palette_register(const unsigned short palette_index, const jo_color color)
Set palette index color.
void jo_palette_set_light_shades(jo_palette *const palette, const int first, const jo_color *const colors, const int count, const int levels)
Write the shades of colors in a palette for the palette lighting (see jo_3d_set_palette_light()): the...
void jo_create_palette(jo_palette *const output)
Create a new palette with 255 entries maximum.
#define JO_PALETTE_MAX_COLORS
Define the maximum of color entry available on each palette.
Definition palette.h:41
jo_color jo_get_palette_register(const unsigned short palette_index)
Get palette color from index.
#define JO_PALETTE_MAX
Define the maximum of palette (the 256 colors palettes of the color RAM).
Definition sega_saturn.h:157
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39
unsigned short jo_color
15 bits color type
Definition types.h:53
int id
Definition types.h:270
jo_color * data
Definition types.h:269
Palette contents struct.
Definition types.h:268