Add SurfaceFlags, and more formatting :)
Build libsm64 / Build libsm64 for linux (push) Successful in 32s
Build libsm64 / Build libsm64 for web (push) Successful in 39s
Build libsm64 / Build libsm64 for windows (push) Successful in 25s

This commit is contained in:
2026-05-24 18:03:08 -05:00
parent d3ea4e5e99
commit bd3dd8f523
38 changed files with 716 additions and 1295 deletions
+8 -16
View File
@@ -95,15 +95,12 @@ static f32 get_buoyancy(struct MarioState *m)
static u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos)
{
struct SM64SurfaceCollisionData *wall;
struct SM64SurfaceCollisionData *ceil;
struct SM64SurfaceCollisionData *floor;
f32 ceilHeight;
f32 floorHeight;
wall = resolve_and_return_wall_collisions(nextPos, 10.0f, 110.0f);
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
struct SM64SurfaceCollisionData *wall = resolve_and_return_wall_collisions(nextPos, 10.0f, 110.0f);
f32 floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
f32 ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
if (floor == NULL)
{
@@ -155,7 +152,6 @@ static u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos)
static void apply_water_current(struct MarioState *m, Vec3f step)
{
s32 i;
f32 whirlpoolRadius = 2000.0f;
if (m->floor->type == SURFACE_FLOWING_WATER)
@@ -167,7 +163,7 @@ static void apply_water_current(struct MarioState *m, Vec3f step)
step[2] += currentSpeed * coss(currentAngle);
}
for (i = 0; i < 2; i++)
for (s32 i = 0; i < 2; i++)
{
struct Whirlpool *whirlpool = gCurrentArea->whirlpools[i];
if (whirlpool != NULL)
@@ -212,7 +208,6 @@ static void apply_water_current(struct MarioState *m, Vec3f step)
static u32 perform_water_step(struct MarioState *m)
{
UNUSED u32 unused;
u32 stepResult;
Vec3f nextPos;
Vec3f step;
struct Object *marioObj = m->marioObj;
@@ -234,7 +229,7 @@ static u32 perform_water_step(struct MarioState *m)
m->vel[1] = 0.0f;
}
stepResult = perform_water_full_step(m, nextPos);
u32 stepResult = perform_water_full_step(m, nextPos);
vec3f_copy(marioObj->header.gfx.pos, m->pos);
vec3s_set(marioObj->header.gfx.angle, -m->faceAngle[0], m->faceAngle[1], m->faceAngle[2]);
@@ -1162,7 +1157,6 @@ static s32 act_water_death(struct MarioState *m)
static s32 act_water_plunge(struct MarioState *m)
{
u32 stepResult;
s32 stateFlags = m->heldObj != NULL;
f32 endVSpeed;
@@ -1188,7 +1182,7 @@ static s32 act_water_plunge(struct MarioState *m)
stationary_slow_down(m);
stepResult = perform_water_step(m);
u32 stepResult = perform_water_step(m);
if (m->actionState == 0)
{
@@ -1262,8 +1256,6 @@ static s32 act_water_plunge(struct MarioState *m)
static s32 act_caught_in_whirlpool(struct MarioState *m)
{
f32 sinAngleChange;
f32 cosAngleChange;
f32 newDistance;
s16 angleChange;
@@ -1301,8 +1293,8 @@ static s32 act_caught_in_whirlpool(struct MarioState *m)
m->vel[1] = -640.0f / (newDistance + 16.0f);
sinAngleChange = sins(angleChange);
cosAngleChange = coss(angleChange);
f32 sinAngleChange = sins(angleChange);
f32 cosAngleChange = coss(angleChange);
if (distance < 1.0f)
{