![]() |
Jo Engine 2026.11.6
Jo Sega Saturn Engine
|
Jo Engine sun: the sun in the sky of a 3D view (its halo and its core, sprites behind everything) and its lens flare (pieces on the line from the sun through the middle of the screen, in front of everything). More...
Go to the source code of this file.
Data Structures | |
| struct | jo_sun_flare |
| A piece of the lens flare drawn. More... | |
| struct | jo_sun |
| The sun (see jo_sun_init(): the default values). More... | |
Macros | |
| #define | JO_SUN_MAX_HALO_STRIPS |
| Strips of the halo at most. | |
| #define | JO_SUN_FLARE_PIECES |
| Pieces of the lens flare (sprites): a ring, a disc, a hexagon (see jo_level/sun.py: FLARE_PIECES). | |
| #define | JO_SUN_FLARE_FULL |
| The full level of the lens flare (see jo_sun.flare_level). | |
Functions | |
| void | jo_sun_init (jo_sun *const sun, const jo_angle azimuth, const jo_angle elevation) |
| The default values of a sun: no sprite, the default lens flare. | |
| void | jo_sun_update (jo_sun *const sun, const jo_angle heading, const jo_fixed look_down, bool(*hidden)(void)) |
| Place the sun on the screen, fade the lens flare (once a frame). | |
| void | jo_sun_draw (const jo_sun *const sun) |
| Draw the sun (in the frame of the 3D: behind everything). | |
| void | jo_sun_draw_flare (const jo_sun *const sun) |
| Draw the lens flare (in front of the rest: before the HUD). | |
Jo Engine sun: the sun in the sky of a 3D view (its halo and its core, sprites behind everything) and its lens flare (pieces on the line from the sun through the middle of the screen, in front of everything).
Usage: jo_sun_init(), then set the sprites (jo_sun.halo[], halo_strips, core, flare[]); at each frame jo_sun_update() after the camera is known, jo_sun_draw() in the frame of the 3D, jo_sun_draw_flare() after the rest
| struct jo_sun |
The sun (see jo_sun_init(): the default values).
| Data Fields | ||
|---|---|---|
| jo_angle | azimuth | |
| int | bias | |
| int | core | |
| int | core_half | |
| jo_angle | elevation | |
| int | flare[(3)] | |
| int | flare_bias | |
| int | flare_count | |
| int | flare_level | |
| int | flare_rgb[(3)] | |
| int | flare_z | |
| const jo_sun_flare * | flares | |
| int | halo[(8)] | |
| int | halo_half | |
| int | halo_strips | |
| int | horizon_y | |
| bool | seen | |
| int | strip_height | |
| int | x | |
| int | y | |
| int | z | |
| #define JO_SUN_FLARE_FULL |
The full level of the lens flare (see jo_sun.flare_level).
| #define JO_SUN_FLARE_PIECES |
Pieces of the lens flare (sprites): a ring, a disc, a hexagon (see jo_level/sun.py: FLARE_PIECES).
| #define JO_SUN_MAX_HALO_STRIPS |
Strips of the halo at most.
| void jo_sun_draw | ( | const jo_sun *const | sun | ) |
Draw the sun (in the frame of the 3D: behind everything).
| void jo_sun_draw_flare | ( | const jo_sun *const | sun | ) |
Draw the lens flare (in front of the rest: before the HUD).
The default values of a sun: no sprite, the default lens flare.
| sun | Sun |
| azimuth | The heading toward it |
| elevation | Above the horizon |
| void jo_sun_update | ( | jo_sun *const | sun, |
| const jo_angle | heading, | ||
| const jo_fixed | look_down, | ||
| bool(* | hidden )(void) ) |
Place the sun on the screen, fade the lens flare (once a frame).
| sun | Sun |
| heading | Heading of the camera |
| look_down | How much the camera looks down (the tangent of the angle, jo_fixed) |
| hidden | Something between the camera and the sun (no lens flare)? Called only when the lens flare could be seen (JO_NULL: never hidden) |