allow setting poison gas level

also commented out some find_water_level calls
This commit is contained in:
headshot2017
2023-01-26 22:25:21 -04:00
parent bd2b13871d
commit 349a3eb702
5 changed files with 26 additions and 6 deletions
+6 -4
View File
@@ -1321,7 +1321,7 @@ void update_mario_joystick_inputs(struct MarioState *m) {
* Resolves wall collisions, and updates a variety of inputs.
*/
void update_mario_geometry_inputs(struct MarioState *m) {
f32 gasLevel;
//f32 gasLevel;
f32 ceilToFloorDist;
f32_find_wall_collision(&m->pos[0], &m->pos[1], &m->pos[2], 60.0f, 50.0f);
@@ -1343,8 +1343,8 @@ void update_mario_geometry_inputs(struct MarioState *m) {
}
m->ceilHeight = vec3f_find_ceil(&m->pos[0], m->floorHeight, &m->ceil);
gasLevel = find_poison_gas_level(m->pos[0], m->pos[2]);
m->waterLevel = find_water_level(m->pos[0], m->pos[2]);
//gasLevel = find_poison_gas_level(m->pos[0], m->pos[2]);
//m->waterLevel = find_water_level(m->pos[0], m->pos[2]);
if (m->floor != NULL) {
m->floorAngle = atan2s(m->floor->normal.z, m->floor->normal.x);
@@ -1371,7 +1371,7 @@ void update_mario_geometry_inputs(struct MarioState *m) {
m->input |= INPUT_IN_WATER;
}
if (m->pos[1] < (gasLevel - 100.0f)) {
if (m->pos[1] < (m->gasLevel - 100.0f)) {
m->input |= INPUT_IN_POISON_GAS;
}
@@ -1831,6 +1831,8 @@ int init_mario(void) {
gMarioState->waterLevel =
find_water_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]);
gMarioState->gasLevel =
find_poison_gas_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]);
gMarioState->area = gCurrentArea;
gMarioState->marioObj = gMarioObject;
+4 -2
View File
@@ -269,7 +269,8 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
waterLevel = find_water_level(nextPos[0], nextPos[2]);
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
waterLevel = m->waterLevel;
m->wall = upperWall;
@@ -403,7 +404,8 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
waterLevel = find_water_level(nextPos[0], nextPos[2]);
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
waterLevel = m->waterLevel;
m->wall = NULL;