![]() |
Jo Engine 2026.11.6
Jo Sega Saturn Engine
|
Jo Engine Palette Handling. More...
Go to the source code of this file.
Macros | |
| #define | JO_PALETTE_MAX_COLORS |
| Define the maximum of color entry available on each palette. | |
| #define | JO_PALETTE_LIGHT_COLOR(PALETTE_ID, FIRST, I) |
| Color code of the color i of the shades written by jo_palette_set_light_shades() (its darkest shade). | |
Functions | |
| void | jo_create_palette (jo_palette *const output) |
| Create a new palette with 255 entries maximum. | |
| 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 shade s (0 = the darkest, levels - 1 = the brightest) of the color i is the index first + s * count + i. | |
| 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 color of the palette, in all the modes. | |
| 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. | |
| 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. | |
| void | jo_set_palette_register (const unsigned short palette_index, const jo_color color) |
| Set palette index color. | |
| jo_color | jo_get_palette_register (const unsigned short palette_index) |
| Get palette color from index. | |
Jo Engine Palette Handling.
| #define JO_PALETTE_LIGHT_COLOR | ( | PALETTE_ID, | |
| FIRST, | |||
| I ) |
Color code of the color i of the shades written by jo_palette_set_light_shades() (its darkest shade).
| #define JO_PALETTE_MAX_COLORS |
Define the maximum of color entry available on each palette.
| void jo_create_palette | ( | jo_palette *const | output | ) |
Create a new palette with 255 entries maximum.
| output | The new palette: output->data[k] is the color of the pixels of index k + 1 (the index 0 is transparent; the TGA files: their index + 1) |
See also jo_sprite_set_palette_id()
|
static |
Create a new palette from existing data.
| output | The new palette |
| data | Data source |
| size | Data size |
See also jo_sprite_set_palette_id()
| jo_color jo_get_palette_register | ( | const unsigned short | palette_index | ) |
Get palette color from index.
| palette_index | palette Index |
|
static |
Color code of a color of a palette: a polygon of this color (jo_3d_set_mesh_polygon_color()) has the color of the palette, in all the modes.
| palette | Palette (jo_create_palette()) |
| index | Index of the color in the palette (1 to 255: palette->data[index - 1]) |
| 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 shade s (0 = the darkest, levels - 1 = the brightest) of the color i is the index first + s * count + i.
| palette | Palette (jo_create_palette()) |
| first | Index of the darkest shade of the first color (1 to 255; a multiple of 16 for the textures of 16 colors) |
| colors | Colors (the color itself at the shade levels / 2, from 35 % of it at the shade 0 to 125 % at the last one) |
| count | Colors count (16 for a texture of 16 colors: its color bank is the shade 0) |
| levels | Shades of each color (2 to 32) |
|
static |
Copies the image palette data to CRAM.
| data | Data source |
| cram_addr | Color RAM address |
| size | Data size |
| void jo_set_palette_register | ( | const unsigned short | palette_index, |
| const jo_color | color ) |
Set palette index color.
| palette_index | palette Index |
| color | Color |