45#if defined(JO_COMPILE_WITH_FS_SUPPORT) && defined(JO_COMPILE_WITH_3D_SUPPORT)
48# define JO_CELL_MAX (48)
50# define JO_CELL_MAX_PORTALS (96)
52# define JO_CELL_MAX_DRAWN (12)
192# define JO_CELLS_DEFAULT_SHARE (400)
194# define JO_CELLS_DEFAULT_MAX_SHARE (1024)
Mesh structure.
Definition 3d.h:248
A rectangle of the screen (pixels, the edges are in it).
Definition 3d.h:1624
int radius
Definition cell.h:60
jo_pos3D_fixed points[4]
Definition cell.h:78
bool jo_cells_is_drawn(const int index)
Check if a cell was drawn in the last call of jo_cells_draw() or jo_cells_prepare() (the objects in t...
jo_3d_mesh * reflection
Definition cell.h:58
int floor1
Definition cell.h:66
bool jo_cells_floor(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int step, int *const floor)
Floor under a position.
int jo_cells_draw(const jo_pos3D_fixed *const camera)
Draw the cells seen from the camera (the camera matrix is the current matrix, see jo_3d_set_depth_bia...
void jo_cells_draw_prepared_on_both_cpus(void(*const slave_before)(void), const int slave_polygons)
Draw the cells found by jo_cells_prepare() on the 2 CPUs: the slave CPU draws its part (a job,...
int jo_cells_object_cell(const jo_fixed x, const jo_fixed y, const jo_fixed z)
Cell of an object (see jo_cells_depth_bias_at()).
void jo_cells_balance_share(void)
Balance the share of the CPUs for the next frame (see jo_cells_draw_prepared_on_both_cpus()): more po...
bool jo_cells_have_exits(void)
Check if a cell has a door or a window to the outside (the level is not an inside level: there is a w...
bool jo_cells_draw_mirror(void(*draw_more)(void))
Draw the mirror seen by the camera (in the cell of the camera or in a cell seen through a door),...
jo_3d_mesh * mesh
Definition cell.h:57
int jo_cells_prepare(const jo_pos3D_fixed *const camera)
Find the cells seen from the camera (the camera matrix is the current matrix): jo_cells_draw() in 2 p...
jo_pos3D_fixed center
Definition cell.h:59
void jo_cells_set_share_limits(const int min, const int max)
Limits of the share of the master CPU (see jo_cells_draw_prepared_on_both_cpus()).
void jo_cells_free(void)
Free the cells (and their models).
int jo_cells_window_of(const int bias)
The window of an object drawn with a depth bias of the cells (see jo_cells_depth_bias_at(),...
int floor0
Definition cell.h:65
bool jo_cells_seen_through_window(const int index)
Check if a cell is seen from the outside through one of its windows in this frame (see jo_cells_set_w...
short yaw
Definition cell.h:70
unsigned short cell
Definition cell.h:79
int jo_cells_load(jo_level *const level)
Create the cells of a level (sections CELL and PRTL): the previous ones are freed.
int jo_cells_depth_bias_of(const int cell)
Depth bias of an object in a cell (see jo_cells_depth_bias_at()).
void jo_cells_draw_prepared_part(const bool slave, const int part, const int handicap)
Draw a part of the cells found by jo_cells_prepare(): the 2 CPUs draw them together (the meshes split...
void jo_cells_set_occluders(const bool enabled)
A polygon of the cell of the camera that covers the whole screen (the camera near a wall,...
int x1
Definition cell.h:63
int jo_cells_depth_bias_at(const jo_fixed x, const jo_fixed y, const jo_fixed z)
Depth bias of an object in the cells (see jo_cells_draw()): the cells seen through more portals are d...
unsigned short first_portal
Definition cell.h:68
int jo_cells_outside_view(jo_3d_rect *const rect)
Rectangle of the screen where the outside is seen (after jo_cells_prepare()): the portals of the cell...
bool jo_cells_seen_through(const int index, jo_3d_rect *const rect)
The rectangle of the screen where a cell is seen from the outside (through its doors and its near win...
unsigned short slope
Definition cell.h:67
void jo_cells_set_portal_clipping(const bool enabled)
The cells seen through the portals are drawn in the far window (JO_3D_FAR_WINDOW),...
unsigned short jo_cells_generation(void)
Generation of the cells: it changes when cells are loaded or freed (the cells found before are then s...
void jo_cells_draw_prepared(const bool slave)
Draw the cells found by jo_cells_prepare().
jo_fixed cos
Definition cell.h:71
int jo_cells_close_portals(const jo_fixed x, const jo_fixed z, const int radius, const bool closed)
Close the portals of a door (JO_LEVEL_PORTAL_DOOR) whose middle is near a point: the cells behind the...
int jo_cells_count(void)
Number of cells.
const jo_cell * jo_cells_get(const int index)
A cell.
int x0
Definition cell.h:61
bool jo_cells_view_rect_at(const jo_pos3D_fixed *const position, jo_3d_rect *const rect)
The rectangle of the screen where a point is seen (the cell of the point seen through the doors,...
int z0
Definition cell.h:62
int jo_cells_find(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int step)
Cell of a position: its box has the position, its floor is under it (the highest one).
int jo_cells_get_share(void)
Share of the polygons of the cells drawn by the master CPU in the next frame (0 to 1024).
int jo_cells_prepared_polygon_count(void)
Polygons of the cells found by jo_cells_prepare() (the polygons of the chunks seen of the meshes seen...
int jo_cells_add_point_light_meshes(const bool shadows)
The models of the cells are lit by the point lights (see jo/light.h): their meshes are added,...
int jo_cell_floor(const jo_cell *const cell, const int x, const int z)
Floor of a cell at a position (its slope).
int z1
Definition cell.h:64
bool jo_cells_ray_hit(const jo_pos3D_fixed *const origin, const jo_pos3D_fixed *const dir, const jo_fixed max_t, jo_fixed *const t, jo_pos3D_fixed *const normal)
First wall (polygon of a cell) hit by a ray (the bullets).
unsigned short kind
Definition cell.h:80
bool jo_cells_mirror_is_floor(void)
The mirror drawn now (in draw_more of jo_cells_draw_mirror()) is a polished floor (a horizontal porta...
bool jo_cells_is_walkable(const jo_fixed x, const jo_fixed y, const jo_fixed z, const int radius, const int step)
Check if the player can stand at a position: a circle around it is in the box of a cell,...
void jo_cells_set_window_distance(const int distance)
Distance from the outside under which a cell is seen through its windows (portals JO_LEVEL_PORTAL_WIN...
void jo_cells_draw_prepared_share(const bool slave, const int part, const int share)
Draw a part of the cells found by jo_cells_prepare(): the 2 CPUs draw them together,...
unsigned short portal_count
Definition cell.h:69
jo_fixed sin
Definition cell.h:72
A cell.
Definition cell.h:56
A portal: an opening of a cell toward another cell.
Definition cell.h:77
int radius
Definition entity.h:3
jo_pos3D_fixed position
Definition entity.h:2
A loaded level.
Definition level.h:51
int jo_fixed
Fixed point Q16.16 number.
Definition types.h:59
3D position using fixed numbers
Definition types.h:103