Jo Engine Function prototypes special effects (Laser beam, fire, smoke, flash, shake, etc).
More...
Go to the source code of this file.
|
| void | jo_init_homing_laser (jo_homing_laser *const homing_laser, const int sprite_id, const unsigned short thickness, const int z, const unsigned short nb_sections) |
| | Init jo_homing_laser struct.
|
| void | jo_draw_homing_laser (jo_homing_laser *const homing_laser) |
| | Draw homing laser effect.
|
| void | jo_effect_add (const jo_effect_def *const def, const jo_pos3D_fixed *const position, const int delay) |
| | Add an effect.
|
| void | jo_effects_clear (void) |
| | Remove all the effects, the flash and the shake.
|
| void | jo_effects_update (void) |
| | Animate the effects, the flash and the shake: once per frame of the game.
|
| int | jo_effects_draw (void) |
| | Draw the effects (in the world: the camera matrix is the current matrix, see jo_3d_set_depth_bias()).
|
| void | jo_effect_flash (const int r, const int g, const int b, const int frames) |
| | Flash of the screen: the color offset of the VDP2 is added to all the screens, it fades to 0.
|
| void | jo_effect_fade (const int darkness, const int frames) |
| | Fade of the screen to black (or back): the color offset of the VDP2 (see jo_effect_flash()).
|
| bool | jo_effect_is_fading (void) |
| | Check if the fade is not finished (see jo_effect_fade()).
|
| void | jo_effect_shake (const int amount, const int frames) |
| | Shake of the camera.
|
| void | jo_effect_get_shake (jo_pos3D_fixed *const offset) |
| | Offset of the camera of the shake (add it to the position of the eyes).
|
Jo Engine Function prototypes special effects (Laser beam, fire, smoke, flash, shake, etc).
- Author
- Johannes Fetz
- Bug
- No known bugs.
◆ jo_homing_laser
Homing laser effect definition.
◆ jo_effect_def
Definition of an effect (shared by the effects of the same kind).
| Data Fields |
|
unsigned char |
__pad |
|
|
short |
__pad2 |
|
|
unsigned char |
flags |
|
|
unsigned char |
frame_count |
|
|
unsigned char |
life |
|
|
short |
rise |
|
|
short |
size_end |
|
|
short |
size_start |
|
|
short |
sprites[(4)] |
|
◆ JO_EFFECT_HALF_TRANSPARENT
| #define JO_EFFECT_HALF_TRANSPARENT |
The sprite is mixed with what is behind (VDP1 half transparency: costly, for small sprites only).
◆ JO_EFFECT_MAX
Effects at the same time (the oldest one is reused).
◆ JO_EFFECT_MAX_FRAMES
| #define JO_EFFECT_MAX_FRAMES |
Frames of the animation of an effect at most.
◆ JO_EFFECT_RANDOM_FLIP
| #define JO_EFFECT_RANDOM_FLIP |
The sprite is flipped at random (the effects don't look the same).
◆ JO_EFFECT_STANDING
| #define JO_EFFECT_STANDING |
The sprite stands on its position (else it is centered on it).
◆ jo_draw_homing_laser()
Draw homing laser effect.
- Parameters
-
| homing_laser | Homing laser definition |
◆ jo_effect_add()
Add an effect.
- Parameters
-
| def | Definition (it must stay in memory) |
| position | Center (or foot: JO_EFFECT_STANDING), world space |
| delay | Frames before the effect starts (an explosion is a group of fireballs that start one after the other) |
◆ jo_effect_fade()
| void jo_effect_fade |
( |
const int | darkness, |
|
|
const int | frames ) |
Fade of the screen to black (or back): the color offset of the VDP2 (see jo_effect_flash()).
- Parameters
-
| darkness | 0 (no fade) to 255 (black) |
| frames | Frames of the game to reach it (see jo_effects_update()), 0: now |
◆ jo_effect_flash()
| void jo_effect_flash |
( |
const int | r, |
|
|
const int | g, |
|
|
const int | b, |
|
|
const int | frames ) |
Flash of the screen: the color offset of the VDP2 is added to all the screens, it fades to 0.
- Parameters
-
| r | Red (0 to 255: added to the colors) |
| g | Green |
| b | Blue |
| frames | Frames of the game until it is gone |
◆ jo_effect_get_shake()
Offset of the camera of the shake (add it to the position of the eyes).
- Parameters
-
| offset | Offset (output, world units Q16.16), 0 when nothing shakes |
◆ jo_effect_is_fading()
| bool jo_effect_is_fading |
( |
void | | ) |
|
◆ jo_effect_shake()
| void jo_effect_shake |
( |
const int | amount, |
|
|
const int | frames ) |
Shake of the camera.
- Parameters
-
| amount | Amplitude (world units). A stronger shake than the current one replaces it |
| frames | Frames of the game until it is gone |
◆ jo_effects_clear()
| void jo_effects_clear |
( |
void | | ) |
|
Remove all the effects, the flash and the shake.
◆ jo_effects_draw()
| int jo_effects_draw |
( |
void | | ) |
|
Draw the effects (in the world: the camera matrix is the current matrix, see jo_3d_set_depth_bias()).
- Returns
- Number of VDP1 commands (sprites) drawn
◆ jo_effects_update()
| void jo_effects_update |
( |
void | | ) |
|
Animate the effects, the flash and the shake: once per frame of the game.
◆ jo_init_homing_laser()
| void jo_init_homing_laser |
( |
jo_homing_laser *const | homing_laser, |
|
|
const int | sprite_id, |
|
|
const unsigned short | thickness, |
|
|
const int | z, |
|
|
const unsigned short | nb_sections ) |
Init jo_homing_laser struct.
- Parameters
-
| homing_laser | Homing laser definition |
| sprite_id | Sprite ID |
| thickness | Horizontal Laser thickness (1 to 256) |
| z | Default z index (500 for example) |
| nb_sections | Number of section in the curve aka smoothness (4 to 64 and must be a multiple of 2). |