![]() |
Jo Engine 2026.11.2
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. | |
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. | |
| 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. | |
| static __jo_force_inline void | jo_clear_background (const jo_color color) |
| Clear the background. | |
| static __jo_force_inline void | jo_move_background (const int x, const int y) |
| Move background (scrolling). | |
| static __jo_force_inline void | jo_zoom_background2 (const float width_factor, const float height_factor) |
| Zoom background width and height independently. | |
| static __jo_force_inline void | jo_zoom_background (const float factor) |
| Zoom background. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| static __jo_force_inline void | jo_enable_background_3d_plane (jo_color background_color) |
| Enable 3D planes. | |
| static __jo_force_inline void | jo_disable_background_3d_plane (jo_color background_color) |
| Disable 3D planes. | |
| 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. | |
| 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. | |
| static __jo_force_inline void | jo_background_3d_plane_far_limit (const int max_zoom_out) |
| Hide the farthest part of the 3D planes (the background color is visible instead). | |
| static __jo_force_inline void | jo_background_3d_plane_a_draw (const bool use_scroll_format_matrix) |
| Draw plane A. | |
| static __jo_force_inline void | jo_background_3d_plane_b_draw (const bool use_scroll_format_matrix) |
| Draw plane B. | |
| static __jo_force_inline void | jo_background_3d_plane_b_draw_flat (const int x, const int y) |
| Draw plane B as a flat image, without perspective: a sky behind the plane A (sea, ground). | |
| static __jo_force_inline int * | jo_enable_background_horizontal_line_scroll (void) |
| Enable horizontal line scroll effect. | |
| static __jo_force_inline void | jo_disable_background_horizontal_line_scroll (void) |
| Disable horizontal line scroll effect. | |
| static __jo_force_inline void | jo_compute_background_horizontal_line_scroll (unsigned short offset) |
| Compute horizontal line scroll effect using specific offset. | |
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 B.
| use_scroll_format_matrix | Convert current matrix to scroll format matrix |
|
static |
Draw plane B as a flat image, without perspective: a sky behind the plane A (sea, ground).
| x | Horizontal position in the image of the left of the screen (pixels, the image is repeated horizontally) |
| y | Vertical position in the image of the top of the screen (pixels) |
|
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 |
Hide the farthest part of the 3D planes (the background color is visible instead).
| max_zoom_out | Biggest reduction of the texture (0: no limit, 16: the plane stops where 16 texels are in 1 pixel) |
|
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 |