Jo Engine  2024.04.28
Jo Sega Saturn Engine
Data Structures | Functions
mode7.h File Reference

Jo Engine Mode7. More...

Go to the source code of this file.

Data Structures

struct  jo_mode7_computation_cache
 mode7 internal computation cache struct More...
 
struct  jo_mode7
 mode7 struct More...
 

Functions

bool jo_init_mode7_for_screen_output (jo_mode7 *const params, const unsigned short tile_width, const unsigned short tile_height)
 Initialize mode 7 effect for direct screen output and pre compute projection. More...
 
void jo_update_screen_output_coord_for_mode7 (jo_mode7 *const params)
 Update mode 7 computation if output_left or output_right params changed. More...
 
bool jo_init_mode7_for_image_output (jo_mode7 *params, const unsigned short tile_width, const unsigned short tile_height, jo_img *const output_image)
 Initialize mode 7 effect for image output and pre compute projection. More...
 
void jo_free_mode7 (jo_mode7 *const params)
 Free mode 7 computation. More...
 
void jo_do_mode7_floor (const jo_img *const tile, const int cam_x, const int cam_y, const jo_mode7 *const params)
 Draw projection according to the initialized output. More...
 

Detailed Description

Jo Engine Mode7.

Author
Johannes Fetz
Bug:
No known bugs.

Data Structure Documentation

◆ jo_mode7_computation_cache

struct jo_mode7_computation_cache

mode7 internal computation cache struct

Data Fields
int * distance
int * line_dy
jo_color * output
unsigned short output_height
unsigned short output_line_width
unsigned short output_width
unsigned short output_width_div2
unsigned short output_width_sizeof
int output_y_start
int tile_mask_x
int tile_mask_y

◆ jo_mode7

struct jo_mode7

mode7 struct

Data Fields
jo_mode7_computation_cache __cache
int horizon
unsigned short output_left
unsigned short output_top
int scale_x
int scale_y
int space_z

Function Documentation

◆ jo_do_mode7_floor()

void jo_do_mode7_floor ( const jo_img *const  tile,
const int  cam_x,
const int  cam_y,
const jo_mode7 *const  params 
)

Draw projection according to the initialized output.

Parameters
tileTile image
cam_xCamera horizontal position
cam_yCamera depth (Z index) position
paramsmode7 structure

◆ jo_free_mode7()

void jo_free_mode7 ( jo_mode7 *const  params)

Free mode 7 computation.

Parameters
paramsmode7 structure

◆ jo_init_mode7_for_image_output()

bool jo_init_mode7_for_image_output ( jo_mode7 params,
const unsigned short  tile_width,
const unsigned short  tile_height,
jo_img *const  output_image 
)

Initialize mode 7 effect for image output and pre compute projection.

Parameters
paramsmode7 structure
tile_widthTile width
tile_heightTile height
output_imageOutput image (data can be allocated before)
Returns
true if successful otherwise false (use jo_get_last_error())

◆ jo_init_mode7_for_screen_output()

bool jo_init_mode7_for_screen_output ( jo_mode7 *const  params,
const unsigned short  tile_width,
const unsigned short  tile_height 
)

Initialize mode 7 effect for direct screen output and pre compute projection.

Parameters
paramsmode7 structure
tile_widthTile width
tile_heightTile height
Returns
true if successful otherwise false (use jo_get_last_error())

◆ jo_update_screen_output_coord_for_mode7()

void jo_update_screen_output_coord_for_mode7 ( jo_mode7 *const  params)

Update mode 7 computation if output_left or output_right params changed.

Parameters
paramsmode7 structure