Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo racing #653

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/racing/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ void spawn_course_actors(void) {
/**
* @brief Loads actor textures, course specific actor textures.
* Calls to init_course_vehicles and place_course_actors
*
*
*/
void init_actors_and_load_textures(void) {
set_segment_base_addr(3, (void *) gNextFreeMemoryAddress);
Expand Down Expand Up @@ -1818,18 +1818,18 @@ void destroy_destructable_actor(struct Actor *actor) {
Player *player;

switch (actor->type) {
case ACTOR_BANANA:
banana = (struct BananaActor *)actor;
switch (banana->state) {
case FIRST_BANANA_BUNCH_BANANA:
case BANANA_BUNCH_BANANA:
destroy_banana_in_banana_bunch(banana);
break;
case HELD_BANANA:
player = &gPlayers[banana->playerId];
player->soundEffects &= ~0x00040000;
/* fallthrough */
case BANANA_ON_GROUND:
case ACTOR_BANANA:
banana = (struct BananaActor *)actor;
switch (banana->state) {
case FIRST_BANANA_BUNCH_BANANA:
case BANANA_BUNCH_BANANA:
destroy_banana_in_banana_bunch(banana);
break;
case HELD_BANANA:
player = &gPlayers[banana->playerId];
player->soundEffects &= ~0x00040000;
/* fallthrough */
case BANANA_ON_GROUND:
banana->flags = -0x8000;
banana->unk_04 = 0x003C;
banana->state = DESTROYED_BANANA;
Expand Down
14 changes: 7 additions & 7 deletions src/racing/actors.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ void destroy_actor(struct Actor*);
s16 try_remove_destructable_item(Vec3f, Vec3s, Vec3f, s16);
s16 add_actor_to_empty_slot(Vec3f, Vec3s, Vec3f, s16);
s16 spawn_actor_at_pos(Vec3f, s16);
s32 query_and_resolve_collision_player_actor(Player*, Vec3f, f32, f32, f32);
s32 collision_mario_sign(Player*, struct Actor*);
s32 collision_piranha_plant(Player*, struct PiranhaPlant*);
s32 collision_yoshi_egg(Player*, struct YoshiValleyEgg*);
s32 collision_tree(Player*, struct Actor*);
s32 query_collision_player_vs_actor_item(Player*, struct Actor*);
s32 query_collision_actor_vs_actor(struct Actor*, struct Actor*);
bool query_and_resolve_collision_player_actor(Player*, Vec3f, f32, f32, f32);
bool collision_mario_sign(Player*, struct Actor*);
bool collision_piranha_plant(Player*, struct PiranhaPlant*);
bool collision_yoshi_egg(Player*, struct YoshiValleyEgg*);
bool collision_tree(Player*, struct Actor*);
bool query_collision_player_vs_actor_item(Player*, struct Actor*);
bool query_collision_actor_vs_actor(struct Actor*, struct Actor*);
void destroy_destructable_actor(struct Actor*);
void play_sound_on_destructible_actor_collision(struct Actor*, struct Actor*);
void evaluate_actor_collision_between_two_destructible_actors(struct Actor*, struct Actor*);
Expand Down
8 changes: 4 additions & 4 deletions src/racing/actors_extended.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,12 @@ s32 use_green_shell_item(Player *player) {

// rotate to match player orientation
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);

// move to player position
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];

// spawn the shell
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
if (actorIndex < 0) {
Expand Down Expand Up @@ -848,8 +848,8 @@ s32 use_banana_item(Player *player) {

/**
* Strikes players with thunder
*
* @param Activating player (not to be struck)
*
* @param Activating player (not to be struck)
*/
void use_thunder_item(Player *player) {
s32 index;
Expand Down
4 changes: 2 additions & 2 deletions src/racing/actors_extended.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ACTORS_EXTENDED_H
#define ACTORS_EXTENDED_H

#include "common_structs.h"
#include <common_structs.h>
#include "actor_types.h"

/** @cond */
Expand All @@ -16,7 +16,7 @@ void func_802B0648(struct BananaBunchParent*);
void func_802B0788(s16, struct BananaBunchParent*, Player*);
s32 func_802B09C0(s16);
void update_actor_banana_bunch(struct BananaBunchParent*);
s32 is_shell_exist(s16);
bool is_shell_exist(s16);
void update_actor_triple_shell(TripleShellParent*, s16);
s32 use_banana_bunch_item(Player*);
s32 use_triple_shell_item(Player*, s16);
Expand Down
10 changes: 5 additions & 5 deletions src/racing/collision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,6 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
}
}
sectionIndex++;

}
return flags;
}
Expand Down Expand Up @@ -1570,7 +1569,7 @@ void add_collision_triangle(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16
if ((triangle->vtx1->v.flag == 4) &&
(triangle->vtx2->v.flag == 4) &&
(triangle->vtx3->v.flag == 4)) {

return;
}

Expand Down Expand Up @@ -1776,7 +1775,7 @@ void set_vtx_from_quadrangle(u32 line, s8 surfaceType, u16 sectionId) {
vtx2 = vtxBuffer[vert2];
vtx3 = vtxBuffer[vert3];
vtx4 = vtxBuffer[vert4];

// Triangle 1
add_collision_triangle(vtx1, vtx2, vtx3, surfaceType, sectionId);
// Triangle 2
Expand Down Expand Up @@ -1914,6 +1913,7 @@ void generate_collision_grid(void) {
s32 courseLengthX;
s32 courseLengthZ;
s32 index;

courseLengthX = (s32) gCourseMaxX - gCourseMinX;
courseLengthZ = (s32) gCourseMaxZ - gCourseMinZ;

Expand Down Expand Up @@ -1958,7 +1958,7 @@ void generate_collision_grid(void) {
gCollisionGrid[index].triangle = gNumCollisionTriangles;
}
gCollisionGrid[index].numTriangles++;
gCollisionIndices[gNumCollisionTriangles] = (s16) i;
gCollisionIndices[gNumCollisionTriangles] = (u16) i;
gNumCollisionTriangles++;
}
}
Expand Down Expand Up @@ -2181,7 +2181,7 @@ u16 process_collision(Player *player, KartTyre *tyre, f32 tyre2X, f32 tyre2Y, f3
}

// If the surface flags are not set then try setting them.

courseLengthX = (s32) gCourseMaxX - gCourseMinX;
courseLengthZ = (s32) gCourseMaxZ - gCourseMinZ;

Expand Down
4 changes: 2 additions & 2 deletions src/racing/collision.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef collision_H
#define collision_H

#include "common_structs.h"
#include <common_structs.h>

#define COLLISION 0x1
#define NO_COLLISION 0x0
Expand Down Expand Up @@ -35,7 +35,7 @@ void generate_collision_mesh_with_defaults(Gfx*);
void generate_collision_mesh_with_default_section_id(Gfx*, s8);
void generate_collision_mesh(Gfx*, s8, u16);
void find_and_set_tile_size(uintptr_t, s32, s32);
void set_vertex_colours(u32, u32, s32, s8, u8, u8, u8);
void set_vertex_colours(uintptr_t, u32, s32, s8, u8, u8, u8);
void find_vtx_and_set_colours(uintptr_t, s8, u8, u8, u8);
void subtract_scaled_vector(Vec3f, f32, Vec3f);

Expand Down
2 changes: 1 addition & 1 deletion src/racing/math_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void *vec3f_copy_return(Vec3f dest, Vec3f src) {
dest[1] = src[1];
dest[2] = src[2];
//! @warning function returns address of local variable
return &dest;
return &dest;
}

void vec3s_copy(Vec3s dest, Vec3s src) {
Expand Down
Loading
Loading