![]() |
Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Jo Engine Background definition and tools. More...
Go to the source code of this file.
Macros | |
#define | JO_SCROLL_TABLE_SIZE |
512 entries. One offset for each line because the background size is a 512x512 pixels by default. More... | |
Functions | |
static __jo_force_inline void | jo_set_background_8bits_sprite (jo_img_8bits *img, int palette_id, bool vertical_flip) |
Add 8 bits background sprite. More... | |
static __jo_force_inline void | jo_set_background_sprite (const jo_img *const img, const unsigned short left, const unsigned short top) |
Add background sprite. More... | |
static __jo_force_inline void | jo_clear_background (const jo_color color) |
Clear the background. More... | |
static __jo_force_inline void | jo_move_background (const int x, const int y) |
Move background (scrolling) More... | |
static __jo_force_inline void | jo_zoom_background2 (const float width_factor, const float height_factor) |
Zoom background width and height independently. More... | |
static __jo_force_inline void | jo_zoom_background (const float factor) |
Zoom background. More... | |
static __jo_force_inline void | jo_draw_background_line (int x0, int y0, int x1, int y1, const jo_color color) |
Draw a line using Bresenham's line algorithm. More... | |
static __jo_force_inline void | jo_draw_background_square (const int x, const int y, const short width, const short height, const jo_color color) |
Draw a square on the background. More... | |
static __jo_force_inline void | jo_put_pixel_in_background (const int x, const int y, const jo_color color) |
Put pixel in background using color. More... | |
static __jo_force_inline void | jo_put_pixel_in_background_rgb (const int x, const int y, unsigned char r, unsigned char g, unsigned char b) |
Put pixel in background using composite color. More... | |
static __jo_force_inline void | jo_enable_background_3d_plane (jo_color background_color) |
Enable 3D planes. More... | |
static __jo_force_inline void | jo_disable_background_3d_plane (jo_color background_color) |
Disable 3D planes. More... | |
static __jo_force_inline void | jo_background_3d_plane_a_img (jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) |
Setup plane A. More... | |
static __jo_force_inline void | jo_background_3d_plane_b_img (jo_img_8bits *img, int palette_id, bool repeat, bool vertical_flip) |
Setup plane B. More... | |
static __jo_force_inline void | jo_background_3d_plane_a_draw (const bool use_scroll_format_matrix) |
Draw plane A. More... | |
static __jo_force_inline void | jo_background_3d_plane_b_draw (const bool use_scroll_format_matrix) |
Draw plane A. More... | |
static __jo_force_inline int * | jo_enable_background_horizontal_line_scroll (void) |
Enable horizontal line scroll effect. More... | |
static __jo_force_inline void | jo_disable_background_horizontal_line_scroll (void) |
Disable horizontal line scroll effect. More... | |
static __jo_force_inline void | jo_compute_background_horizontal_line_scroll (unsigned short offset) |
Compute horizontal line scroll effect using specific offset. More... | |
Jo Engine Background definition and tools.
#define JO_SCROLL_TABLE_SIZE |
512 entries. One offset for each line because the background size is a 512x512 pixels by default.
|
static |
Draw plane A.
use_scroll_format_matrix | Convert current matrix to scroll format matrix |
|
static |
Setup plane A.
img | 8 bits 255 colors max image. (Width AND height must be a multiple of 8) |
palette_id | palette id from TGA (see also jo_palette) |
repeat | Repeat the plane infinitely. |
vertical_flip | Flip image vertically |
|
static |
Draw plane A.
use_scroll_format_matrix | Convert current matrix to scroll format matrix |
|
static |
Setup plane B.
img | 8 bits 255 colors max image. (Width AND height must be a multiple of 8) |
palette_id | palette id from TGA (see also jo_palette) |
repeat | Repeat the plane infinitely. |
vertical_flip | Flip image vertically |
|
static |
Clear the background.
color | Clear color |
|
static |
Compute horizontal line scroll effect using specific offset.
offset | Offset in scroll table returned by jo_enable_background_horizontal_line_scroll() |
|
static |
Disable 3D planes.
background_color | Color (ex: JO_COLOR_Red) |
|
static |
Disable horizontal line scroll effect.
|
static |
Draw a line using Bresenham's line algorithm.
x0 | horizontal location of the beginning of the line |
y0 | vertical location of the beginning of the line |
x1 | horizontal location of the end of the line |
y1 | vertical location of the end of the line |
color | Color (ex: JO_COLOR_Red) |
|
static |
Draw a square on the background.
x | Square horizontal location |
y | Square vertical location |
width | Square width |
height | Square height |
color | Color (ex: JO_COLOR_Red) |
|
static |
Enable 3D planes.
background_color | Color (ex: JO_COLOR_Red) |
|
static |
Enable horizontal line scroll effect.
|
static |
Move background (scrolling)
x | horizontal location |
y | vertical location |
|
static |
Put pixel in background using color.
x | horizontal location |
y | vertical location |
color | Color (ex: JO_COLOR_Red) |
|
static |
Put pixel in background using composite color.
x | horizontal location |
y | vertical location |
r | Red color component |
g | Green color component |
b | Blue color component |
|
static |
Add 8 bits background sprite.
img | 8 bits 255 colors max image. (Width AND height must be a multiple of 8) |
palette_id | palette id from TGA (see also jo_palette) |
vertical_flip | Flip image vertically |
|
static |
Add background sprite.
img | Pointer to an image struct |
left | Left location |
top | Top location |
|
static |
Zoom background.
factor | Zoom factor |
|
static |
Zoom background width and height independently.
width_factor | Width zoom factor |
height_factor | Height zoom factor |