![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <ultra64.h>
#include "sm64.h"
#include "display.h"
#include "memory.h"
#include "ingame_menu.h"
#include "envfx_snow.h"
#include "envfx_bubbles.h"
#include "engine/surface_collision.h"
#include "engine/math_util.h"
#include "engine/behavior_script.h"
#include "audio/external.h"
#include "obj_behaviors.h"
Functions | |
s32 | particle_is_laterally_close (s32 index, s32 x, s32 z, s32 distance) |
Check whether the particle with the given index is laterally within distance of point (x, z). More... | |
s32 | random_flower_offset () |
Generate a uniform random number in range [-2000, -1000[ or [1000, 2000[ Used to position flower particles. More... | |
void | envfx_update_flower (Vec3s centerPos) |
Update flower particles. More... | |
void | envfx_set_lava_bubble_position (s32 index, Vec3s centerPos) |
Update the position of a lava bubble to be somewhere around centerPos Uses find_floor to find the height of lava, if no floor or a non-lava floor is found the bubble y is set to -10000, which is why you can see occasional lava bubbles far below the course in Lethal Lava Land. More... | |
void | envfx_update_lava (Vec3s centerPos) |
Update lava bubble animation and give the bubble a new position if the animation is over. More... | |
void | envfx_rotate_around_whirlpool (s32 *x, s32 *y, s32 *z) |
Rotate the input x, y and z around the rotation origin of the whirlpool according to the pitch and yaw of the whirlpool. More... | |
s32 | envfx_is_whirlpool_bubble_alive (s32 index) |
Check whether a whirlpool bubble is alive. More... | |
void | envfx_update_whirlpool (void) |
Update whirlpool particles. More... | |
s32 | envfx_is_jestream_bubble_alive (s32 index) |
Check whether a jetstream bubble should respawn. More... | |
void | envfx_update_jetstream (void) |
Update the positions of jestream bubble particles. More... | |
s32 | envfx_init_bubble (s32 mode) |
Initialize bubble (or flower) effect by allocating a buffer to store the state of each particle and setting the initial and max count. More... | |
void | envfx_bubbles_update_switch (s32 mode, Vec3s camTo, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3) |
Update particles depending on mode. More... | |
void | append_bubble_vertex_buffer (Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3, Vtx *template) |
Append 15 vertices to 'gfx', which is enough for 5 bubbles starting at 'index'. More... | |
void | envfx_set_bubble_texture (s32 mode, s16 index) |
Appends to the enfvx display list a command setting the appropriate texture for a specific particle. More... | |
Gfx * | envfx_update_bubble_particles (s32 mode, UNUSED Vec3s marioPos, Vec3s camFrom, Vec3s camTo) |
Updates the bubble particle positions, then generates and returns a display list drawing them. More... | |
void | envfx_set_max_bubble_particles (s32 mode) |
Set the maximum particle count from the gEnvFxBubbleConfig variable, which is set by the whirlpool or jetstream behavior. More... | |
Gfx * | envfx_update_bubbles (s32 mode, Vec3s marioPos, Vec3s camTo, Vec3s camFrom) |
Update bubble-like environment effects. More... | |
Variables | |
s16 | gEnvFxBubbleConfig [10] |
This file implements environment effects that are not snow: Flowers (unused), lava bubbles and jetsream/whirlpool bubbles. More... | |
static Gfx * | sGfxCursor |
static s32 | sBubbleParticleCount |
static s32 | sBubbleParticleMaxCount |
UNUSED s32 | D_80330690 = 0 |
UNUSED s32 | D_80330694 = 0 |
Vtx_t | gBubbleTempVtx [3] |
Template for a bubble particle triangle. More... | |
void * | flower_bubbles_textures_ptr_0B002008 |
void * | lava_bubble_ptr_0B006020 |
void * | bubble_ptr_0B006848 |
void * | tiny_bubble_dl_0B006AB0 |
void * | tiny_bubble_dl_0B006D38 |
void * | tiny_bubble_dl_0B006D68 |
void append_bubble_vertex_buffer | ( | Gfx * | gfx, |
s32 | index, | ||
Vec3s | vertex1, | ||
Vec3s | vertex2, | ||
Vec3s | vertex3, | ||
Vtx * | template | ||
) |
Append 15 vertices to 'gfx', which is enough for 5 bubbles starting at 'index'.
The 3 input vertices represent the roated triangle around (0,0,0) that will be translated to bubble positions to draw the bubble image
void envfx_bubbles_update_switch | ( | s32 | mode, |
Vec3s | camTo, | ||
Vec3s | vertex1, | ||
Vec3s | vertex2, | ||
Vec3s | vertex3 | ||
) |
Update particles depending on mode.
Also sets the given vertices to the correct shape for each mode, though they are not being rotated yet.
Initialize bubble (or flower) effect by allocating a buffer to store the state of each particle and setting the initial and max count.
Analogous to init_snow_particles, but for bubbles.
Dead code
Check whether a jetstream bubble should respawn.
Happens if it is laterally 1000 units away from the source or 1500 units above it.
Check whether a whirlpool bubble is alive.
A bubble respawns when it is too low or close to the center.
Rotate the input x, y and z around the rotation origin of the whirlpool according to the pitch and yaw of the whirlpool.
Appends to the enfvx display list a command setting the appropriate texture for a specific particle.
The display list is not passed as parameter but uses the global sGfxCursor instead.
Update the position of a lava bubble to be somewhere around centerPos Uses find_floor to find the height of lava, if no floor or a non-lava floor is found the bubble y is set to -10000, which is why you can see occasional lava bubbles far below the course in Lethal Lava Land.
In the second Bowser fight arena, the visual lava is above the lava floor so lava-bubbles are not normally visible, only if you bring the camera below the lava plane.
Set the maximum particle count from the gEnvFxBubbleConfig variable, which is set by the whirlpool or jetstream behavior.
Updates the bubble particle positions, then generates and returns a display list drawing them.
Update bubble-like environment effects.
Assumes the mode is larger than 10, lower modes are snow effects which are updated in a different function. Returns a display list drawing the particles.
Update flower particles.
Flowers are scattered randomly in front of the camera, and can land on any ground
Update the positions of jestream bubble particles.
They move up and outwards.
Update lava bubble animation and give the bubble a new position if the animation is over.
Update whirlpool particles.
Whirlpool particles start high and far from the center and get sucked into the sink in a spiraling motion.
Check whether the particle with the given index is laterally within distance of point (x, z).
Used to kill flower and bubble particles.
s32 random_flower_offset | ( | ) |
Generate a uniform random number in range [-2000, -1000[ or [1000, 2000[ Used to position flower particles.
void* bubble_ptr_0B006848 |
void* flower_bubbles_textures_ptr_0B002008 |
Vtx_t gBubbleTempVtx[3] |
Template for a bubble particle triangle.
s16 gEnvFxBubbleConfig[10] |
This file implements environment effects that are not snow: Flowers (unused), lava bubbles and jetsream/whirlpool bubbles.
Refer to 'envfx_snow.c' for more info about environment effects. Note that the term 'bubbles' is used as a collective name for effects in this file even though flowers aren't bubbles. For the sake of concise naming, flowers fall under bubbles.
void* lava_bubble_ptr_0B006020 |
|
static |
|
static |
|
static |
void* tiny_bubble_dl_0B006AB0 |
void* tiny_bubble_dl_0B006D38 |
void* tiny_bubble_dl_0B006D68 |