mirror of
https://github.com/n64decomp/mk64
synced 2026-06-21 07:12:28 -04:00
move actors code in actors folder and rename thing related to actor (#584)
* Move actors into their folders * Renamings and documentation
This commit is contained in:
@@ -90,18 +90,18 @@ glabel func_80009B60
|
||||
.L80009C58:
|
||||
/* 00A858 80009C58 00D81021 */ addu $v0, $a2, $t8
|
||||
/* 00A85C 80009C5C A4400000 */ sh $zero, ($v0)
|
||||
/* 00A860 80009C60 3C198016 */ lui $t9, %hi(D_8015F6EA) # $t9, 0x8016
|
||||
/* 00A864 80009C64 8739F6EA */ lh $t9, %lo(D_8015F6EA)($t9)
|
||||
/* 00A860 80009C60 3C198016 */ lui $t9, %hi(gCourseMinX) # $t9, 0x8016
|
||||
/* 00A864 80009C64 8739F6EA */ lh $t9, %lo(gCourseMinX)($t9)
|
||||
/* 00A868 80009C68 C4600014 */ lwc1 $f0, 0x14($v1)
|
||||
/* 00A86C 80009C6C 240A0001 */ li $t2, 1
|
||||
/* 00A870 80009C70 44994000 */ mtc1 $t9, $f8
|
||||
/* 00A874 80009C74 3C0B8016 */ lui $t3, %hi(D_8015F6E8) # $t3, 0x8016
|
||||
/* 00A874 80009C74 3C0B8016 */ lui $t3, %hi(gCourseMaxX) # $t3, 0x8016
|
||||
/* 00A878 80009C78 240C0002 */ li $t4, 2
|
||||
/* 00A87C 80009C7C 468042A0 */ cvt.s.w $f10, $f8
|
||||
/* 00A880 80009C80 3C0D8016 */ lui $t5, %hi(D_8015F6F2) # $t5, 0x8016
|
||||
/* 00A880 80009C80 3C0D8016 */ lui $t5, %hi(gCourseMinZ) # $t5, 0x8016
|
||||
/* 00A884 80009C84 240E0003 */ li $t6, 3
|
||||
/* 00A888 80009C88 24180004 */ li $t8, 4
|
||||
/* 00A88C 80009C8C 3C0F8016 */ lui $t7, %hi(D_8015F6F0) # $t7, 0x8016
|
||||
/* 00A88C 80009C8C 3C0F8016 */ lui $t7, %hi(gCourseMaxZ) # $t7, 0x8016
|
||||
/* 00A890 80009C90 460A003C */ c.lt.s $f0, $f10
|
||||
/* 00A894 80009C94 00000000 */ nop
|
||||
/* 00A898 80009C98 45000003 */ bc1f .L80009CA8
|
||||
@@ -109,7 +109,7 @@ glabel func_80009B60
|
||||
/* 00A8A0 80009CA0 A44A0000 */ sh $t2, ($v0)
|
||||
/* 00A8A4 80009CA4 C4600014 */ lwc1 $f0, 0x14($v1)
|
||||
.L80009CA8:
|
||||
/* 00A8A8 80009CA8 856BF6E8 */ lh $t3, %lo(D_8015F6E8)($t3)
|
||||
/* 00A8A8 80009CA8 856BF6E8 */ lh $t3, %lo(gCourseMaxX)($t3)
|
||||
/* 00A8AC 80009CAC 448B8000 */ mtc1 $t3, $f16
|
||||
/* 00A8B0 80009CB0 00000000 */ nop
|
||||
/* 00A8B4 80009CB4 468084A0 */ cvt.s.w $f18, $f16
|
||||
@@ -119,7 +119,7 @@ glabel func_80009B60
|
||||
/* 00A8C4 80009CC4 00000000 */ nop
|
||||
/* 00A8C8 80009CC8 A44C0000 */ sh $t4, ($v0)
|
||||
.L80009CCC:
|
||||
/* 00A8CC 80009CCC 85ADF6F2 */ lh $t5, %lo(D_8015F6F2)($t5)
|
||||
/* 00A8CC 80009CCC 85ADF6F2 */ lh $t5, %lo(gCourseMinZ)($t5)
|
||||
/* 00A8D0 80009CD0 C460001C */ lwc1 $f0, 0x1c($v1)
|
||||
/* 00A8D4 80009CD4 448D2000 */ mtc1 $t5, $f4
|
||||
/* 00A8D8 80009CD8 00000000 */ nop
|
||||
@@ -131,7 +131,7 @@ glabel func_80009B60
|
||||
/* 00A8F0 80009CF0 A44E0000 */ sh $t6, ($v0)
|
||||
/* 00A8F4 80009CF4 C460001C */ lwc1 $f0, 0x1c($v1)
|
||||
.L80009CF8:
|
||||
/* 00A8F8 80009CF8 85EFF6F0 */ lh $t7, %lo(D_8015F6F0)($t7)
|
||||
/* 00A8F8 80009CF8 85EFF6F0 */ lh $t7, %lo(gCourseMaxZ)($t7)
|
||||
/* 00A8FC 80009CFC 448F4000 */ mtc1 $t7, $f8
|
||||
/* 00A900 80009D00 00000000 */ nop
|
||||
/* 00A904 80009D04 468042A0 */ cvt.s.w $f10, $f8
|
||||
|
||||
@@ -3654,7 +3654,7 @@ Gfx d_course_mario_raceway_dl_tree[] =
|
||||
};
|
||||
|
||||
// 0x6B08
|
||||
Vtx d_course_mario_raceway_sign_model[] = {
|
||||
Vtx d_course_mario_sign_model[] = {
|
||||
{{{ 5, 0, 0 }, 0, { 0, 0 }, {0x00, 0x00, 0xFC, 0xFF }}},
|
||||
{{{ 5, 24, 0 }, 0, { 0, 0 }, {0x2D, 0x2D, 0xFF, 0xFF }}},
|
||||
{{{ 0, 28, 5 }, 0, { 0, 0 }, {0x2D, 0x2D, 0xFF, 0xFF }}},
|
||||
@@ -3762,12 +3762,12 @@ Vtx d_course_mario_raceway_06007008[] ={
|
||||
};
|
||||
|
||||
// 0x7068
|
||||
u8 d_course_mario_raceway_sign_left[] = {
|
||||
u8 d_course_mario_sign_left[] = {
|
||||
#include "assets/courses/mario_raceway/gTextureMarioRacewaySignLeft.inc.c"
|
||||
};
|
||||
|
||||
// 8284D0_08068
|
||||
u8 d_course_mario_raceway_sign_right[] = {
|
||||
u8 d_course_mario_sign_right[] = {
|
||||
#include "assets/courses/mario_raceway/gTextureMarioRacewaySignRight.inc.c"
|
||||
};
|
||||
|
||||
@@ -3776,7 +3776,7 @@ Gfx d_course_mario_raceway_dl_9068[] =
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsSPVertex(d_course_mario_raceway_sign_model, 8, 0),
|
||||
gsSPVertex(d_course_mario_sign_model, 8, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 1, 0, 4, 1, 0, 0),
|
||||
gsSP2Triangles(3, 2, 6, 0, 3, 6, 7, 0),
|
||||
@@ -3829,7 +3829,7 @@ Gfx d_course_mario_raceway_dl_9190[] =
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_left),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_left),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPLoadSync(),
|
||||
@@ -3837,7 +3837,7 @@ Gfx d_course_mario_raceway_dl_9190[] =
|
||||
gsSPVertex(d_course_mario_raceway_06006EE8, 6, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(1, 4, 5, 0, 1, 5, 2, 0),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_right),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_right),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPLoadSync(),
|
||||
@@ -3857,7 +3857,7 @@ Gfx d_course_mario_raceway_dl_9250[] =
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0x007C, 0x00FC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_left),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_left),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPLoadSync(),
|
||||
@@ -3865,7 +3865,7 @@ Gfx d_course_mario_raceway_dl_9250[] =
|
||||
gsSPVertex(d_course_mario_raceway_06006FA8, 6, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(3, 4, 5, 0, 3, 5, 0, 0),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_raceway_sign_right),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, d_course_mario_sign_right),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsDPLoadSync(),
|
||||
|
||||
@@ -83,15 +83,15 @@ extern Vtx d_course_mario_raceway_piranha_plant_model[];
|
||||
extern Gfx d_course_mario_raceway_dl_piranha_plant[];
|
||||
extern Vtx d_course_mario_raceway_tree_model[];
|
||||
extern Gfx d_course_mario_raceway_dl_tree[];
|
||||
extern Vtx d_course_mario_raceway_sign_model[];
|
||||
extern Vtx d_course_mario_sign_model[];
|
||||
extern Vtx d_course_mario_raceway_06006B88[];
|
||||
extern Vtx d_course_mario_raceway_06006D68[];
|
||||
extern Vtx d_course_mario_raceway_06006EE8[];
|
||||
extern Vtx d_course_mario_raceway_06006F48[];
|
||||
extern Vtx d_course_mario_raceway_06006FA8[];
|
||||
extern Vtx d_course_mario_raceway_06007008[];
|
||||
extern u8 d_course_mario_raceway_sign_left[];
|
||||
extern u8 d_course_mario_raceway_sign_right[];
|
||||
extern u8 d_course_mario_sign_left[];
|
||||
extern u8 d_course_mario_sign_right[];
|
||||
extern Gfx d_course_mario_raceway_dl_9068[];
|
||||
extern Gfx d_course_mario_raceway_dl_90B0[];
|
||||
extern Gfx d_course_mario_raceway_dl_90C0[];
|
||||
|
||||
@@ -421,7 +421,7 @@ index 7c90951..135e98c 100644
|
||||
gCourseTimer += 0.01666666; // 1 / 60
|
||||
@@ -585,7 +586,6 @@ void race_logic_loop(void) {
|
||||
func_802909F0();
|
||||
evaluate_player_collision();
|
||||
evaluate_collision_for_players_and_actors();
|
||||
func_800382DC();
|
||||
- func_8001EE98(gPlayerOneCopy, camera1, 0);
|
||||
func_80028F70();
|
||||
|
||||
+25
-17
@@ -36,16 +36,18 @@
|
||||
* exactly what you're doing.
|
||||
*/
|
||||
enum ActorType {
|
||||
ACTOR_TREE_MARIO_RACEWAY = 0x02,
|
||||
ACTOR_UNKNOWN_0x01 = 0x01,
|
||||
ACTOR_TREE_MARIO_RACEWAY,
|
||||
ACTOR_TREE_YOSHI_VALLEY,
|
||||
ACTOR_TREE_ROYAL_RACEWAY,
|
||||
ACTOR_FALLING_ROCK,
|
||||
ACTOR_BANANA,
|
||||
ACTOR_GREEN_SHELL,
|
||||
ACTOR_RED_SHELL,
|
||||
ACTOR_YOSHI_VALLEY_EGG,
|
||||
ACTOR_YOSHI_EGG,
|
||||
ACTOR_PIRANHA_PLANT,
|
||||
ACTOR_ITEM_BOX = 0x0C,
|
||||
ACTOR_UNKNOWN_0x0B,
|
||||
ACTOR_ITEM_BOX,
|
||||
ACTOR_FAKE_ITEM_BOX,
|
||||
ACTOR_BANANA_BUNCH,
|
||||
ACTOR_TRAIN_ENGINE,
|
||||
@@ -53,18 +55,24 @@ enum ActorType {
|
||||
ACTOR_TRAIN_PASSENGER_CAR,
|
||||
ACTOR_COW,
|
||||
ACTOR_TREE_MOO_MOO_FARM,
|
||||
ACTOR_TRIPLE_GREEN_SHELL = 0x15,
|
||||
ACTOR_UNKNOWN_0x14,
|
||||
ACTOR_TRIPLE_GREEN_SHELL,
|
||||
ACTOR_TRIPLE_RED_SHELL,
|
||||
ACTOR_MARIO_SIGN,
|
||||
ACTOR_PALM_TREE = 0x19,
|
||||
ACTOR_TREE_BOWSERS_CASTLE = 0x1C,
|
||||
ACTOR_UNKNOWN_0x18,
|
||||
ACTOR_PALM_TREE,
|
||||
ACTOR_UNKNOWN_0x1A,
|
||||
ACTOR_UNKNOWN_0x1B,
|
||||
ACTOR_TREE_BOWSERS_CASTLE,
|
||||
ACTOR_TREE_FRAPPE_SNOWLAND,
|
||||
ACTOR_CACTUS1_KALAMARI_DESERT,
|
||||
ACTOR_CACTUS2_KALAMARI_DESERT,
|
||||
ACTOR_CACTUS3_KALAMARI_DESERT,
|
||||
ACTOR_BUSH_BOWSERS_CASTLE,
|
||||
ACTOR_WARIO_SIGN = 0x23,
|
||||
ACTOR_BOX_TRUCK = 0x25,
|
||||
ACTOR_UNKNOWN_0x21,
|
||||
ACTOR_WARIO_SIGN,
|
||||
ACTOR_UNKNOWN_0x23,
|
||||
ACTOR_BOX_TRUCK,
|
||||
ACTOR_PADDLE_BOAT,
|
||||
ACTOR_RAILROAD_CROSSING,
|
||||
ACTOR_SCHOOL_BUS,
|
||||
@@ -91,7 +99,7 @@ enum ShellState {
|
||||
TRIPLE_RED_SHELL, // Loses triple shell state when shot.
|
||||
DESTROYED_SHELL, // Collision with the shell.
|
||||
BLUE_SHELL_LOCK_ON, // A blue shell has found a target and is hastily approaching it.
|
||||
BLUE_SHELL_TARGET_ELIMINATED // Mission completed, well done boss.
|
||||
BLUE_SHELL_TARGET_ELIMINATED // Mission completed, well done boss.
|
||||
};
|
||||
|
||||
// Actor banana->state
|
||||
@@ -101,7 +109,7 @@ enum BananaState {
|
||||
FIRST_BANANA_BUNCH_BANANA, // The first banana of the banana bunch
|
||||
BANANA_BUNCH_BANANA, // Every banana of the banana bunch except the first one.
|
||||
BANANA_ON_GROUND, // A banana sitting on the ground.
|
||||
DESTROYED_BANANA // Collision with the banana.
|
||||
DESTROYED_BANANA // Collision with the banana.
|
||||
};
|
||||
|
||||
// Actor fakeItemBox->state
|
||||
@@ -183,7 +191,7 @@ struct ActorSpawnData {
|
||||
};
|
||||
};
|
||||
|
||||
// Required for func_80298AC0 due to diff size.
|
||||
// Required for evaluate_collision_player_palm_trees due to diff size.
|
||||
// members unverified. data located at d_course_dks_jungle_parkway_tree_spawn
|
||||
/**
|
||||
* There are nearly 100 trees in DK Jungle Parkway. If they were put into the actor list proper
|
||||
@@ -261,17 +269,17 @@ struct PiranhaPlant {
|
||||
/* 0x30 */ Collision unk30;
|
||||
}; // size = 0x70
|
||||
|
||||
// Copied from PiranhaPlant, may not be accurate.
|
||||
struct PalmTree {
|
||||
/* 0x00 */ s16 type;
|
||||
/* 0x02 */ s16 flags;
|
||||
/* 0x04 */ Vec4s visibilityStates; // A per-camera visibilty state tracker
|
||||
/* 0x04 */ s16 variant; // four different types of palm trees
|
||||
/* 0x06 */ s16 state;
|
||||
/* 0x08 */ f32 unk_08;
|
||||
/* 0x0C */ f32 boundingBoxSize;
|
||||
/* 0x10 */ Vec3s unk10;
|
||||
/* 0x16 */ s16 unk16;
|
||||
/* 0x10 */ Vec3s rot;
|
||||
/* 0x16 */ s16 unk_16;
|
||||
/* 0x18 */ Vec3f pos;
|
||||
/* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state
|
||||
/* 0x2C */ f32 unk_02C;
|
||||
/* 0x24 */ Vec3f velocity;
|
||||
/* 0x30 */ Collision unk30;
|
||||
}; // size = 0x70
|
||||
|
||||
|
||||
@@ -325,6 +325,7 @@ typedef enum {
|
||||
* @brief sound effect of player's
|
||||
* for soundEffect
|
||||
*/
|
||||
#define HIT_SOUND_EFFECT 0x100 // hitting an object
|
||||
#define BOOST_SOUND_EFFECT 0x200 // being boosted by trigger a mushroom
|
||||
#define BOO_SOUND_EFFECT 0x800 // being a boo
|
||||
#define STAR_SOUND_EFFECT 0x2000 // being a star
|
||||
@@ -344,6 +345,7 @@ typedef enum {
|
||||
#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom
|
||||
#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad
|
||||
#define HIT_BY_ITEM_EFFECT 0x2000000 // being hit by an item
|
||||
#define HIT_EFFECT 0x4000000 // hitting an object
|
||||
#define LIGHTNING_EFFECT 0x40000000 // being hit by lightning
|
||||
#define BOO_EFFECT 0x80000000 // being a boo
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#include <actors.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <PR/gbi.h>
|
||||
|
||||
/**
|
||||
* @brief Render the banana actor
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param banana
|
||||
*/
|
||||
void render_actor_banana(Camera *camera, UNUSED Mat4 arg1, struct BananaActor *banana) {
|
||||
UNUSED s32 pad[2];
|
||||
s32 maxObjectsReached;
|
||||
Vec3s sp7C;
|
||||
Mat4 sp3C;
|
||||
|
||||
f32 temp = is_within_render_distance(camera->pos, banana->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 490000.0f);
|
||||
if (temp < 0.0f) {
|
||||
actor_not_rendered(camera, (struct Actor *) banana);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((banana->pos[1] > gCourseMaxY + 800.0f)) {
|
||||
actor_not_rendered(camera, (struct Actor *) banana);
|
||||
return;
|
||||
}
|
||||
if (banana->pos[1] < (gCourseMinY - 800.0f)) {
|
||||
actor_not_rendered(camera, (struct Actor *) banana);
|
||||
return;
|
||||
}
|
||||
|
||||
actor_rendered(camera, (struct Actor *) banana);
|
||||
|
||||
if (banana->state == 5) {
|
||||
mtxf_pos_rotation_xyz(sp3C, banana->pos, banana->rot);
|
||||
} else {
|
||||
sp7C[0] = 0;
|
||||
sp7C[1] = 0;
|
||||
sp7C[2] = 0;
|
||||
mtxf_pos_rotation_xyz(sp3C, banana->pos, sp7C);
|
||||
}
|
||||
|
||||
maxObjectsReached = render_set_position(sp3C, 0) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
if (banana->state != 5) {
|
||||
gSPDisplayList(gDisplayListHead++, &common_model_banana);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &common_model_flat_banana);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
#include <actors.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <defines.h>
|
||||
#include <main.h>
|
||||
|
||||
/**
|
||||
* @brief Update the banana actor
|
||||
*
|
||||
* @param banana
|
||||
*/
|
||||
void update_actor_banana(struct BananaActor *banana) {
|
||||
UNUSED f32 pad;
|
||||
Player *player;
|
||||
struct BananaActor *elderBanana;
|
||||
struct Controller *controller;
|
||||
Vec3f someOtherVelocity;
|
||||
Vec3f someVelocity;
|
||||
f32 temp_f0;
|
||||
UNUSED f32 var_f8;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad3;
|
||||
UNUSED f32 pad4[2];
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
f32 temp_f14;
|
||||
f32 temp_f16;
|
||||
f32 unkX;
|
||||
f32 unkY;
|
||||
f32 unkZ;
|
||||
|
||||
player = &gPlayers[banana->rot[0]];
|
||||
switch (banana->state) {
|
||||
case HELD_BANANA:
|
||||
temp_f2 = player->pos[0] - banana->pos[0];
|
||||
temp_f14 = player->pos[1] - banana->pos[1];
|
||||
temp_f16 = player->pos[2] - banana->pos[2];
|
||||
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 10.0f;
|
||||
if (temp_f12 == 0.0f) {
|
||||
banana->pos[0] = player->pos[0] + 0.2f;
|
||||
banana->pos[1] = player->pos[1] + 0.2f;
|
||||
banana->pos[2] = player->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f12;
|
||||
temp_f14 /= temp_f12;
|
||||
temp_f16 /= temp_f12;
|
||||
banana->pos[0] = player->pos[0] - temp_f2;
|
||||
banana->pos[1] = player->pos[1] - temp_f14 - 2.0f;
|
||||
banana->pos[2] = player->pos[2] - temp_f16;
|
||||
}
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
if (gDemoMode) {
|
||||
controller = gControllerOne;
|
||||
} else {
|
||||
controller = &gControllers[banana->rot[0]];
|
||||
}
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
banana->state = 1;
|
||||
banana->unk_04 = 0x00B4;
|
||||
player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
|
||||
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
|
||||
pad3 = controller->rawStickY;
|
||||
if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
|
||||
pad3 = pad3 - ((f32) 30);
|
||||
pad3 = (pad3 / 20.0f) + 0.5f;
|
||||
if (player->unk_094 < 2.0f) {
|
||||
temp_f0 = 4.0f;
|
||||
} else {
|
||||
temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
|
||||
}
|
||||
vec3f_set(someVelocity, 0, pad3, temp_f0);
|
||||
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
|
||||
banana->velocity[0] = someVelocity[0];
|
||||
banana->velocity[1] = someVelocity[1];
|
||||
banana->velocity[2] = someVelocity[2];
|
||||
} else {
|
||||
banana->velocity[0] = 0;
|
||||
banana->velocity[1] = 1.5f;
|
||||
banana->velocity[2] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DROPPED_BANANA:
|
||||
if (banana->unk_04 != 0) {
|
||||
banana->unk_04 -= 1;
|
||||
if (banana->unk_04 == 0) {
|
||||
banana->flags &= ~0x1000;
|
||||
}
|
||||
}
|
||||
banana->pos[0] += banana->velocity[0];
|
||||
banana->pos[2] += banana->velocity[2];
|
||||
if (banana->velocity[1] > -1.0f) {
|
||||
banana->velocity[1] -= 0.15f;
|
||||
}
|
||||
banana->pos[1] += banana->velocity[1];
|
||||
if ((banana->pos[2] < (f32) gCourseMinZ) || ((f32) gCourseMaxZ < banana->pos[2]) || (banana->pos[0] < (f32) gCourseMinX) || ((f32) gCourseMaxX < banana->pos[0]) || (banana->pos[1] < (f32) gCourseMinY)) {
|
||||
destroy_destructable_actor((struct Actor *) banana);
|
||||
} else {
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
banana->unk30.unk34 = 1;
|
||||
if ((banana->unk30.unk34 != 0) && (banana->unk30.unk3C[2] < 0.0f)) {
|
||||
someOtherVelocity[0] = -banana->unk30.orientationVector[0];
|
||||
someOtherVelocity[1] = -banana->unk30.orientationVector[1];
|
||||
someOtherVelocity[2] = -banana->unk30.orientationVector[2];
|
||||
banana->pos[0] += someOtherVelocity[0] * banana->unk30.unk3C[2];
|
||||
banana->pos[1] += someOtherVelocity[1] * banana->unk30.unk3C[2];
|
||||
banana->pos[2] += someOtherVelocity[2] * banana->unk30.unk3C[2];
|
||||
banana->flags &= ~0x1000;
|
||||
banana->state = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FIRST_BANANA_BUNCH_BANANA:
|
||||
someVelocity[0] = 0.0f;
|
||||
someVelocity[1] = 0.0f;
|
||||
someVelocity[2] = -5.0f;
|
||||
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
|
||||
unkX = player->pos[0] + someVelocity[0];
|
||||
unkY = player->pos[1] + someVelocity[1];
|
||||
unkZ = player->pos[2] + someVelocity[2];
|
||||
temp_f2 = unkX - banana->pos[0];
|
||||
temp_f14 = unkY - banana->pos[1];
|
||||
temp_f16 = unkZ - banana->pos[2];
|
||||
temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
|
||||
if (temp_f0 == 0.0f) {
|
||||
banana->pos[0] = player->pos[0] + 0.2f;
|
||||
banana->pos[1] = player->pos[1] + 0.2f;
|
||||
banana->pos[2] = player->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f0;
|
||||
temp_f14 /= temp_f0;
|
||||
temp_f16 /= temp_f0;
|
||||
banana->pos[0] = someVelocity[0] + (unkX - temp_f2);
|
||||
banana->pos[1] = unkY - temp_f14 - 2.0f;
|
||||
banana->pos[2] = unkZ - temp_f16;
|
||||
}
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case BANANA_BUNCH_BANANA:
|
||||
elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
|
||||
temp_f2 = elderBanana->pos[0] - banana->pos[0];
|
||||
temp_f14 = elderBanana->pos[1] - banana->pos[1];
|
||||
temp_f16 = elderBanana->pos[2] - banana->pos[2];
|
||||
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 5.0f;
|
||||
if (temp_f12 == 0.0f) {
|
||||
banana->pos[0] = elderBanana->pos[0] + 0.2f;
|
||||
banana->pos[1] = elderBanana->pos[1] + 0.2f;
|
||||
banana->pos[2] = elderBanana->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f12;
|
||||
temp_f14 /= temp_f12;
|
||||
temp_f16 /= temp_f12;
|
||||
banana->pos[0] = elderBanana->pos[0] - temp_f2;
|
||||
banana->pos[1] = elderBanana->pos[1] - temp_f14 - 2.0f;
|
||||
banana->pos[2] = elderBanana->pos[2] - temp_f16;
|
||||
}
|
||||
var_f8 = banana->pos[2];
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case DESTROYED_BANANA:
|
||||
banana->velocity[1] -= 0.3f;
|
||||
if (banana->velocity[1] < -5.0f) {
|
||||
banana->velocity[1] = -5.0f;
|
||||
}
|
||||
banana->pos[1] += banana->velocity[1];
|
||||
banana->rot[0] += 0x16C;
|
||||
banana->rot[1] -= 0x5B0;
|
||||
banana->rot[2] += 0x38E;
|
||||
banana->unk_04 -= 1;
|
||||
if (banana->unk_04 == 0) {
|
||||
destroy_actor((struct Actor *) banana);
|
||||
}
|
||||
break;
|
||||
case BANANA_ON_GROUND:
|
||||
banana->flags |= 0xC000;
|
||||
banana->flags &= ~0x1000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
|
||||
/**
|
||||
* @brief Render the red shell actor
|
||||
*
|
||||
* @param camera
|
||||
* @param matrix
|
||||
* @param shell
|
||||
*/
|
||||
void render_actor_red_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, &gTLUTRedShell); // set texture
|
||||
render_actor_shell(camera, matrix, shell);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Render the blue shell actor
|
||||
*
|
||||
* @param camera
|
||||
* @param matrix
|
||||
* @param shell
|
||||
*/
|
||||
void render_actor_blue_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_blue_shell); // set texture
|
||||
render_actor_shell(camera, matrix, shell);
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
#include <actors.h>
|
||||
#include <waypoints.h>
|
||||
#include <defines.h>
|
||||
#include <main.h>
|
||||
#include <actors_extended.h>
|
||||
#include <code_800029B0.h>
|
||||
|
||||
void func_802B3B44(struct ShellActor *shell) {
|
||||
u16 currentWaypoint;
|
||||
u16 nextWaypoint;
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 temp_f12_3;
|
||||
f32 temp_f14_2;
|
||||
f32 temp_f16_2;
|
||||
f32 temp_f2;
|
||||
f32 temp_f12;
|
||||
f32 temp_f28;
|
||||
f32 temp_f20;
|
||||
f32 temp_f22;
|
||||
f32 temp_f24;
|
||||
f32 temp_f12_0;
|
||||
f32 temp_f12_1;
|
||||
f32 temp_f12_2;
|
||||
f32 temp_f18_3;
|
||||
f32 temp_f16_3;
|
||||
f32 temp_f26;
|
||||
Vec3f origPos;
|
||||
|
||||
currentWaypoint = shell->pathIndex;
|
||||
temp_f2 = D_80164490[currentWaypoint].posX;
|
||||
temp_f12 = D_80164490[currentWaypoint].posY;
|
||||
temp_f28 = D_80164490[currentWaypoint].posZ;
|
||||
nextWaypoint = currentWaypoint + 1;
|
||||
|
||||
if (nextWaypoint >= D_80164430) {
|
||||
nextWaypoint -= D_80164430;
|
||||
}
|
||||
|
||||
temp_f20 = temp_f2 - shell->pos[0];
|
||||
temp_f22 = temp_f12 - shell->pos[1];
|
||||
temp_f24 = temp_f28 - shell->pos[2];
|
||||
temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
|
||||
if (temp_f0 > 400.0f) {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
temp_f12_0 = temp_f18_3 - shell->pos[0];
|
||||
temp_f12_1 = temp_f16_3 - shell->pos[1];
|
||||
temp_f12_2 = temp_f26 - shell->pos[2];
|
||||
|
||||
temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
|
||||
if (temp_f0_3 < temp_f0) {
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f0_2 = sqrtf(temp_f0) * 4.0f;
|
||||
temp_f20 /= temp_f0_2;
|
||||
temp_f22 /= temp_f0_2;
|
||||
temp_f24 /= temp_f0_2;
|
||||
|
||||
temp_f12_3 = shell->velocity[0];
|
||||
temp_f14_2 = shell->velocity[1];
|
||||
temp_f16_2 = shell->velocity[2];
|
||||
|
||||
temp_f12_3 += temp_f20;
|
||||
temp_f14_2 += temp_f22;
|
||||
temp_f16_2 += temp_f24;
|
||||
temp_f0 = sqrtf((temp_f12_3 * temp_f12_3) + (temp_f14_2 * temp_f14_2) + (temp_f16_2 * temp_f16_2));
|
||||
if (temp_f0 > 6.0f) {
|
||||
temp_f0 /= 6.0f;
|
||||
temp_f12_3 /= temp_f0;
|
||||
temp_f14_2 /= temp_f0;
|
||||
temp_f16_2 /= temp_f0;
|
||||
}
|
||||
shell->velocity[0] = temp_f12_3;
|
||||
shell->velocity[1] = temp_f14_2;
|
||||
shell->velocity[2] = temp_f16_2;
|
||||
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
|
||||
shell->pos[0] += temp_f12_3;
|
||||
shell->pos[1] += temp_f14_2;
|
||||
shell->pos[2] += temp_f16_2;
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
} else {
|
||||
if (temp_f0 > 5.0f) {
|
||||
shell->pos[0] = temp_f2;
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f12;
|
||||
shell->pos[2] = temp_f28;
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
|
||||
shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
|
||||
shell->pos[2] = (temp_f28 + temp_f26) * 0.5f;
|
||||
|
||||
shell->velocity[0] = (temp_f18_3 - temp_f2) * 0.5f;
|
||||
shell->velocity[1] = (temp_f16_3 - temp_f12) * 0.5f;
|
||||
shell->velocity[2] = (temp_f26 - temp_f28) * 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B3E7C(struct ShellActor *shell, Player *player) {
|
||||
f32 x_velocity;
|
||||
f32 z_velocity;
|
||||
f32 xz_dist;
|
||||
Vec3f newPosition;
|
||||
|
||||
x_velocity = player->pos[0];
|
||||
x_velocity -= shell->pos[0];
|
||||
z_velocity = player->pos[2];
|
||||
z_velocity -= shell->pos[2];
|
||||
xz_dist = sqrtf((x_velocity * x_velocity) + (z_velocity * z_velocity)) / 8;
|
||||
if (xz_dist == 0.0f) {
|
||||
x_velocity = 0.0f;
|
||||
z_velocity = 0.0f;
|
||||
} else {
|
||||
x_velocity /= xz_dist;
|
||||
z_velocity /= xz_dist;
|
||||
}
|
||||
|
||||
newPosition[0] = shell->pos[0];
|
||||
newPosition[1] = shell->pos[1];
|
||||
newPosition[2] = shell->pos[2];
|
||||
shell->pos[0] += x_velocity;
|
||||
shell->pos[1] -= 2.0f;
|
||||
shell->pos[2] += z_velocity;
|
||||
shell->velocity[0] = x_velocity;
|
||||
shell->velocity[1] = -2.0f;
|
||||
shell->velocity[2] = z_velocity;
|
||||
|
||||
if (player->effects & BOO_EFFECT) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
} else {
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], newPosition[0], newPosition[1], newPosition[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
func_802B4104(shell);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only used in Battle mode
|
||||
* Likely trying to find the nearest player that is not the shell's owner and is not dead
|
||||
**/
|
||||
s16 func_802B3FD0(Player *owner, struct ShellActor *shell) {
|
||||
Player *player;
|
||||
s32 playerIndex;
|
||||
f32 playerToShellDistance;
|
||||
s16 playerId = -1;
|
||||
f32 smallestDistance = 25000000.0f;
|
||||
|
||||
for (playerIndex = 0; playerIndex < 4; playerIndex++) {
|
||||
player = &gPlayers[playerIndex];
|
||||
if ((player->type & PLAYER_EXISTS) == 0) {continue;}
|
||||
if (player == owner) {continue; }
|
||||
if (gPlayerBalloonCount[playerIndex] < 0) { continue; }
|
||||
// func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the positions
|
||||
playerToShellDistance = func_802B51E8(player->pos, shell->pos);
|
||||
if (playerToShellDistance < smallestDistance) {
|
||||
smallestDistance = playerToShellDistance;
|
||||
playerId = player - gPlayerOne;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return playerId;
|
||||
}
|
||||
|
||||
void func_802B4104(struct ShellActor *shell) {
|
||||
if ((shell->unk30.unk3C[0] < 0.0f) && ((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
} else if ((shell->unk30.unk3C[1] < 0.0f) && ((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update the red and blue shell actors
|
||||
*
|
||||
* @param shell
|
||||
*/
|
||||
void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
UNUSED f32 pad9;
|
||||
Player *player;
|
||||
f32 temp_f0;
|
||||
UNUSED f32 temp_f14;
|
||||
f32 temp_f2;
|
||||
s16 temp_v0;
|
||||
UNUSED s16 pad3;
|
||||
Vec3f somePosVel;
|
||||
struct Controller *controller;
|
||||
TripleShellParent *parent;
|
||||
UNUSED f32 pad0;
|
||||
UNUSED f32 pad1;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad4;
|
||||
UNUSED f32 pad5;
|
||||
UNUSED f32 pad6;
|
||||
UNUSED f32 pad7;
|
||||
UNUSED f32 pad8;
|
||||
UNUSED f32 pad10;
|
||||
UNUSED f32 pad11;
|
||||
UNUSED f32 pad12;
|
||||
UNUSED s16 pad13;
|
||||
UNUSED s16 pad13_2;
|
||||
UNUSED f32 pad14;
|
||||
UNUSED f32 pad15;
|
||||
UNUSED f32 pad16;
|
||||
UNUSED f32 pad17;
|
||||
Vec3f origPos;
|
||||
|
||||
pad1 = shell->pos[0];
|
||||
pad0 = shell->pos[2];
|
||||
pad2 = shell->pos[1];
|
||||
pad13 = shell->type;
|
||||
if ((pad0 < (f32) gCourseMinZ) || ((f32) gCourseMaxZ < pad0) || (pad1 < (f32) gCourseMinX) || ((f32) gCourseMaxX < pad1) || (pad2 < (f32) gCourseMinY)) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
}
|
||||
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
copy_collision(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad7 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
temp_f0 = func_802ABE30(shell->pos[0], pad7, shell->pos[2], player->unk_110.unk3A);
|
||||
temp_f2 = pad7 - temp_f0;
|
||||
|
||||
if ((temp_f2 < 5.0f) && (temp_f2 > -5.0f)) {
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f0;
|
||||
} else {
|
||||
shell->pos[1] = pad7;
|
||||
}
|
||||
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
if (gDemoMode) {
|
||||
controller = gControllerOne;
|
||||
} else {
|
||||
controller = &gControllers[shell->playerId];
|
||||
}
|
||||
} else {
|
||||
controller = gControllerOne;
|
||||
}
|
||||
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
shell->state = RELEASED_SHELL;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
} else {
|
||||
shell->rotAngle = -0x78E4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0x71C;
|
||||
if (shell->rotAngle < 0) {
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
add_red_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
} else {
|
||||
add_blue_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
shell->rotAngle += 0x71C;
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
add_red_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
} else {
|
||||
add_blue_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shell->state == MOVING_SHELL) {
|
||||
shell->someTimer = 0x001E;
|
||||
temp_f0 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
temp_f0 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = temp_f0;
|
||||
func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
} else {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case MOVING_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
shell->someTimer -= 1;
|
||||
if (shell->someTimer == 0) {
|
||||
shell->flags &= 0xEFFF;
|
||||
if (shell->type == ACTOR_BLUE_SPINY_SHELL) {
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
shell->state = BLUE_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (gModeSelection == BATTLE) {
|
||||
shell->shellId = 1000.0f;
|
||||
shell->targetPlayer = func_802B3FD0(player, shell);
|
||||
if (shell->targetPlayer < 0) {
|
||||
shell->flags = 0x8000;
|
||||
shell->velocity[1] = 3.0f;
|
||||
shell->pathIndex = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
} else {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
} else {
|
||||
if (player->currentRank == 0) {
|
||||
shell->state = TRIPLE_GREEN_SHELL;
|
||||
shell->someTimer = 0x0258;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (player->currentRank >= 5) {
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
} else {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
shell->velocity[1] -= 0.5;
|
||||
if (shell->velocity[1] < -2.0f) {
|
||||
shell->velocity[1] = -2.0f;
|
||||
}
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
shell->pos[0] += shell->velocity[0];
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
shell->pos[2] += shell->velocity[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
func_802B4104(shell);
|
||||
break;
|
||||
case RED_SHELL_LOCK_ON:
|
||||
func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
|
||||
break;
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
func_802B3B44(shell);
|
||||
if (shell->someTimer == 0) {
|
||||
if ((shell->flags & 0xF) == 0) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
} else {
|
||||
shell->someTimer -= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
func_802B3B44(shell);
|
||||
player = &gPlayers[shell->targetPlayer];
|
||||
temp_f0 = player->pos[0];
|
||||
temp_f0 -= shell->pos[0];
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
break;
|
||||
case TRIPLE_RED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_RED_SHELL) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
} else {
|
||||
shell->rotAngle += parent->rotVelocity;
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case DESTROYED_SHELL:
|
||||
shell->velocity[1] -= 0.3f;
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
shell->velocity[1] = -5.0f;
|
||||
}
|
||||
shell->rotAngle += 0x5B0;
|
||||
shell->someTimer -= 1;
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
if (shell->someTimer == 0) {
|
||||
destroy_actor((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
func_802B3B44(shell);
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
player = &gPlayers[gPlayerPositionLUT[0]];
|
||||
temp_f0 = player->pos[0];
|
||||
temp_f0 -= shell->pos[0];
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = BLUE_SHELL_TARGET_ELIMINATED;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
#include "courses/toads_turnpike/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the box truck actor.
|
||||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_box_truck(Camera *arg0, struct Actor *arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spD8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(spD8, arg1->pos, arg1->rot);
|
||||
if (render_set_position(spD8, 0) != 0) {
|
||||
|
||||
switch(arg1->state) {
|
||||
case 0:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_23858);
|
||||
break;
|
||||
case 1:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238A0);
|
||||
break;
|
||||
case 2:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_toads_turnpike_dl_238E8);
|
||||
break;
|
||||
}
|
||||
|
||||
if (gActiveScreenMode == SCREEN_MODE_1P) {
|
||||
if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_0);
|
||||
} else if (temp_f0 < 640000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
|
||||
}
|
||||
} else if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
|
||||
/**
|
||||
* @brief Renders the car actor.
|
||||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_car(Camera *arg0, struct Actor *arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 = is_within_render_distance(arg0->pos,arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
|
||||
|
||||
if (!(temp_f0 < 0.0f)) {
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
|
||||
mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
|
||||
mtxf_scale(spC8, 0.1f);
|
||||
if (render_set_position(spC8, 0) != 0) {
|
||||
|
||||
if (gActiveScreenMode == SCREEN_MODE_1P) {
|
||||
if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_9);
|
||||
} else if (temp_f0 < 640000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
|
||||
}
|
||||
} else if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#include <camera.h>
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <PR/gbi.h>
|
||||
#include "courses/moo_moo_farm/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the cow actor.
|
||||
* Actor used in Moo Moo Farm.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_cow(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
if (is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) { return; }
|
||||
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
switch (arg2->state) {
|
||||
case 0:
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow1);
|
||||
break;
|
||||
case 1:
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow2);
|
||||
break;
|
||||
case 2:
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow3);
|
||||
break;
|
||||
case 3:
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow4);
|
||||
break;
|
||||
case 4:
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_cow5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
#include <actors.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
|
||||
/**
|
||||
* @brief Renders the fake item box actor.
|
||||
*
|
||||
* @param camera
|
||||
* @param fakeItemBox
|
||||
*/
|
||||
void render_actor_fake_item_box(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
Vec3s someRot;
|
||||
UNUSED s32 pad[3];
|
||||
Vec3f someVec;
|
||||
Mat4 someMatrix2;
|
||||
Mat4 someMatrix3;
|
||||
UNUSED s32 pad2[12];
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
f32 thing;
|
||||
f32 temp_f2_2;
|
||||
f32 someMultiplier;
|
||||
|
||||
if (is_within_render_distance(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 1000000.0f) < 0) {
|
||||
actor_not_rendered(camera, (struct Actor *) fakeItemBox);
|
||||
return;
|
||||
}
|
||||
if (((f32) gCourseMaxY + 800.0f) < fakeItemBox->pos[1]) {
|
||||
actor_not_rendered(camera, (struct Actor *) fakeItemBox);
|
||||
return;
|
||||
}
|
||||
if (fakeItemBox->pos[1] < ((f32) gCourseMinY - 800.0f)) {
|
||||
actor_not_rendered(camera, (struct Actor *) fakeItemBox);
|
||||
return;
|
||||
}
|
||||
|
||||
actor_rendered(camera, (struct Actor *) fakeItemBox);
|
||||
someRot[0] = 0;
|
||||
someRot[1] = fakeItemBox->rot[1];
|
||||
someRot[2] = 0;
|
||||
mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, someRot);
|
||||
mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
|
||||
if (fakeItemBox->state != 2) {
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, common_model_fake_itembox);
|
||||
mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
|
||||
mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
if ((fakeItemBox->rot[1] < 0xAA1) && (fakeItemBox->rot[1] > 0)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((fakeItemBox->rot[1] >= 0x6AA5) && (fakeItemBox->rot[1] < 0x754E)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((fakeItemBox->rot[1] >= 0x38E1) && (fakeItemBox->rot[1] < 0x438A)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((fakeItemBox->rot[1] >= 0xC711) && (fakeItemBox->rot[1] < 0xD1BA)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003090);
|
||||
} else {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
thing = fakeItemBox->someTimer;
|
||||
mtxf_pos_rotation_xyz(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
|
||||
if (thing < 10.0f) {
|
||||
someMultiplier = 1.0f;
|
||||
} else {
|
||||
someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
|
||||
}
|
||||
mtxf_scale(someMatrix2, someMultiplier);
|
||||
if (fakeItemBox->someTimer & 1) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
}
|
||||
temp_f2 = 2.0f * thing;
|
||||
someVec[0] = 0.0f;
|
||||
someVec[1] = temp_f2;
|
||||
someVec[2] = thing;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003158);
|
||||
temp_f2_2 = 0.8f * thing;
|
||||
temp_f12 = 0.5f * thing;
|
||||
someVec[0] = temp_f2_2;
|
||||
someVec[1] = 2.3f * thing;
|
||||
someVec[2] = temp_f12;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031B8);
|
||||
temp_f0_2 = -0.5f * thing;
|
||||
someVec[0] = temp_f2_2;
|
||||
someVec[1] = 1.2f * thing;
|
||||
someVec[2] = temp_f0_2;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003128);
|
||||
if (!(fakeItemBox->someTimer & 1)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
}
|
||||
someVec[0] = 0.0f;
|
||||
someVec[1] = 1.8f * thing;
|
||||
someVec[2] = -1.0f * thing;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031E8);
|
||||
temp_f0_3 = -0.8f * thing;
|
||||
someVec[0] = temp_f0_3;
|
||||
someVec[1] = 0.6f * thing;
|
||||
someVec[2] = temp_f0_2;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003188);
|
||||
someVec[0] = temp_f0_3;
|
||||
someVec[1] = temp_f2;
|
||||
someVec[2] = temp_f12;
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0030F8);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the fake item box actor.
|
||||
*
|
||||
* @param fake_item_box
|
||||
*/
|
||||
void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) {
|
||||
u32 temp_v1 = fake_item_box->playerId;
|
||||
Player *temp_v0_4 = &gPlayers[temp_v1];
|
||||
struct Controller *temp_v1_3;
|
||||
|
||||
UNUSED s32 pad[7];
|
||||
f32 temp_f2_2;
|
||||
f32 temp_f14;
|
||||
f32 temp_f16;
|
||||
f32 temp_f18;
|
||||
UNUSED s32 pad2[3];
|
||||
|
||||
switch(fake_item_box->state) {
|
||||
case 0:
|
||||
fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
|
||||
fake_item_box->rot[0] -= 0xB6;
|
||||
fake_item_box->rot[1] += 0x16C;
|
||||
fake_item_box->rot[2] -= 0xB6;
|
||||
|
||||
temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0];
|
||||
temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1];
|
||||
temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2];
|
||||
|
||||
temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f;
|
||||
temp_f14 /= temp_f2_2;
|
||||
temp_f16 /= temp_f2_2;
|
||||
temp_f18 /= temp_f2_2;
|
||||
fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14;
|
||||
fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
|
||||
fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18;
|
||||
func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
|
||||
func_802B4E30((struct Actor *)fake_item_box);
|
||||
temp_v1_3 = &gControllers[temp_v1];
|
||||
if ((temp_v0_4->type & 0x4000) != 0) {
|
||||
|
||||
if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
|
||||
temp_v1_3->buttonDepressed &= 0xDFFF;
|
||||
func_802A1064(fake_item_box);
|
||||
temp_v0_4->soundEffects &= 0xFFFBFFFF;
|
||||
func_800C9060((u8)(temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (fake_item_box->sizeScaling < 1.0f) {
|
||||
fake_item_box->sizeScaling += 0.05f;
|
||||
} else if (fake_item_box->sizeScaling >= 1.0f) {
|
||||
fake_item_box->sizeScaling = 1.0f;
|
||||
}
|
||||
|
||||
fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
|
||||
if (fake_item_box->targetY <= fake_item_box->pos[1]) {
|
||||
fake_item_box->pos[1] = fake_item_box->targetY;
|
||||
} else {
|
||||
fake_item_box->pos[1] += 0.2f;
|
||||
}
|
||||
if ((fake_item_box->flags & 0x1000) != 0) {
|
||||
if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) {
|
||||
fake_item_box->flags &= 0xEFFF;
|
||||
fake_item_box->someTimer = 0;
|
||||
} else {
|
||||
fake_item_box->someTimer--;
|
||||
}
|
||||
}
|
||||
fake_item_box->rot[0] -= 0xB6;
|
||||
fake_item_box->rot[1] += 0x16C;
|
||||
fake_item_box->rot[2] -= 0xB6;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) {
|
||||
destroy_actor((struct Actor *) fake_item_box);
|
||||
} else {
|
||||
fake_item_box->someTimer++;
|
||||
fake_item_box->rot[0] += 0x444;
|
||||
fake_item_box->rot[1] -= 0x2D8;
|
||||
fake_item_box->rot[2] += 0x16C;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
destroy_actor((struct Actor *) fake_item_box);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include "courses/choco_mountain/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the falling rock actor.
|
||||
* Actor used in Choco Mountain.
|
||||
*
|
||||
* @param camera
|
||||
* @param rock
|
||||
*/
|
||||
void render_actor_falling_rock(Camera *camera, struct FallingRock *rock) {
|
||||
Vec3s sp98;
|
||||
Vec3f sp8C;
|
||||
Mat4 sp4C;
|
||||
f32 temp_f0;
|
||||
UNUSED s32 pad[4];
|
||||
|
||||
if (rock->respawnTimer != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (temp_f0 < 250000.0f) {
|
||||
|
||||
if (rock->unk30.unk34 == 1) {
|
||||
sp8C[0] = rock->pos[0];
|
||||
sp8C[2] = rock->pos[2];
|
||||
temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A);
|
||||
sp98[0] = 0;
|
||||
sp98[1] = 0;
|
||||
sp98[2] = 0;
|
||||
sp8C[1] = temp_f0 + 2.0f;
|
||||
mtxf_pos_rotation_xyz(sp4C, sp8C, sp98);
|
||||
if (render_set_position(sp4C, 0) == 0) {
|
||||
return;
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_6F88);
|
||||
}
|
||||
}
|
||||
mtxf_pos_rotation_xyz(sp4C, rock->pos, rock->rot);
|
||||
if (render_set_position(sp4C, 0) == 0) {
|
||||
return;
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock);
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
#include <actors.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <main.h>
|
||||
#include "courses/choco_mountain/course_data.h"
|
||||
|
||||
void func_8029CF0C(struct ActorSpawnData *spawnData, struct FallingRock *rock) {
|
||||
s32 segment = SEGMENT_NUMBER2(spawnData);
|
||||
s32 offset = SEGMENT_OFFSET(spawnData);
|
||||
@@ -12,7 +17,13 @@ void func_8029CF0C(struct ActorSpawnData *spawnData, struct FallingRock *rock) {
|
||||
vec3s_set(rock->rot, 0, 0, 0);
|
||||
}
|
||||
|
||||
void place_falling_rocks(struct ActorSpawnData *spawnData) {
|
||||
/**
|
||||
* @brief Spawns falling rocks.
|
||||
* Used in Choco Mountain.
|
||||
*
|
||||
* @param spawnData
|
||||
*/
|
||||
void spawn_falling_rocks(struct ActorSpawnData *spawnData) {
|
||||
s32 addr = SEGMENT_NUMBER2(spawnData);
|
||||
s32 offset = SEGMENT_OFFSET(spawnData);
|
||||
// Casting this to prevent warning does not work.
|
||||
@@ -29,7 +40,7 @@ void place_falling_rocks(struct ActorSpawnData *spawnData) {
|
||||
startingPos[2] = temp_s0->pos[2];
|
||||
vec3f_set(startingVelocity, 0, 0, 0);
|
||||
vec3s_set(startingRot, 0, 0, 0);
|
||||
temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
|
||||
temp = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
|
||||
temp_v1 = (struct FallingRock *) &gActorList[temp];
|
||||
|
||||
temp_v1->unk_06 = temp_s0->someId;
|
||||
@@ -38,6 +49,12 @@ void place_falling_rocks(struct ActorSpawnData *spawnData) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates the falling rock actor.
|
||||
* Actor used in Choco Mountain.
|
||||
*
|
||||
* @param rock
|
||||
*/
|
||||
void update_actor_falling_rocks(struct FallingRock *rock) {
|
||||
Vec3f unkVec;
|
||||
f32 pad0;
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include "common_textures.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the green shell actor.
|
||||
*
|
||||
* @param camera
|
||||
* @param matrix
|
||||
* @param shell
|
||||
*/
|
||||
void render_actor_green_shell(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_green_shell); // set texture
|
||||
render_actor_shell(camera, matrix, shell);
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <types.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <defines.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the green shell actor.
|
||||
*
|
||||
* @param shell
|
||||
*/
|
||||
void update_actor_green_shell(struct ShellActor *shell) {
|
||||
Player *player;
|
||||
UNUSED f32 pad9;
|
||||
UNUSED f32 padA;
|
||||
Vec3f somePos2;
|
||||
Vec3f somePosVel;
|
||||
f32 var_f2;
|
||||
struct Controller *controller;
|
||||
TripleShellParent *parent;
|
||||
UNUSED f32 pad0;
|
||||
UNUSED f32 pad1;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad3;
|
||||
UNUSED f32 pad4;
|
||||
UNUSED f32 pad5;
|
||||
UNUSED f32 pad6;
|
||||
UNUSED f32 pad7;
|
||||
UNUSED f32 pad8;
|
||||
|
||||
pad0 = shell->pos[0];
|
||||
pad6 = shell->pos[1];
|
||||
pad1 = shell->pos[2];
|
||||
if ((pad1 < gCourseMinZ) || (gCourseMaxZ < pad1) || (pad0 < gCourseMinX) || (gCourseMaxX < pad0) || (pad6 < gCourseMinY)) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
}
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
copy_collision(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad2 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
pad0 = func_802ABE30(shell->pos[0], pad2, shell->pos[2], player->unk_110.unk3A);
|
||||
pad1 = pad2 - pad0;
|
||||
if ((pad1 < 5.0f) && (pad1 > -5.0f)) {
|
||||
shell->pos[1] = shell->boundingBoxSize + pad0;
|
||||
} else {
|
||||
shell->pos[1] = pad2;
|
||||
}
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
controller = &gControllers[shell->playerId];
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
if (controller->rawStickY < -0x2D) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = -var_f2;
|
||||
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
shell->state = 2;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
return;
|
||||
} else {
|
||||
shell->state = 1;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
} else {
|
||||
shell->rotAngle = -0x78E4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0xE38;
|
||||
if (shell->rotAngle < 0) {
|
||||
shell->state = 2;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
}
|
||||
} else {
|
||||
shell->rotAngle += 0xE38;
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->state = 2;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
add_green_shell_in_unexpired_actor_list((struct Actor*)shell - gActorList);
|
||||
}
|
||||
}
|
||||
if (shell->state == 2) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = var_f2;
|
||||
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
} else {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 6.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 6.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case MOVING_SHELL:
|
||||
if (shell->parentIndex > 0) {
|
||||
shell->parentIndex -= 1;
|
||||
if (shell->parentIndex == 0) {
|
||||
shell->flags &= ~0x1000;
|
||||
}
|
||||
}
|
||||
shell->velocity[1] -= 0.5f;
|
||||
if (shell->velocity[1] < -2.0f) {
|
||||
shell->velocity[1] = -2.0f;
|
||||
}
|
||||
somePos2[0] = shell->pos[0];
|
||||
somePos2[1] = shell->pos[1];
|
||||
somePos2[2] = shell->pos[2];
|
||||
shell->pos[0] += shell->velocity[0];
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
shell->pos[2] += shell->velocity[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
if ((shell->unk30.unk3C[0] < 0.0f) || (shell->unk30.unk3C[1] < 0.0f)) {
|
||||
shell_collision(&shell->unk30, shell->velocity);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
}
|
||||
break;
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_GREEN_SHELL) {
|
||||
destroy_destructable_actor((struct Actor *) shell);
|
||||
} else {
|
||||
shell->rotAngle += parent->rotVelocity;
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
somePos2[0] = shell->pos[0];
|
||||
somePos2[1] = shell->pos[1];
|
||||
somePos2[2] = shell->pos[2];
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
// Somehow, this fake match affects stack management up in case 2
|
||||
shell->velocity[1] -= (0, 0.3f);
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
shell->velocity[1] = -5.0f;
|
||||
}
|
||||
shell->rotAngle += 0x5B0;
|
||||
shell->someTimer -= 1;
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
if (shell->someTimer == 0) {
|
||||
destroy_actor((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <macros.h>
|
||||
|
||||
/**
|
||||
* @brief Renders the item box actor.
|
||||
*
|
||||
* @param camera
|
||||
* @param item_box
|
||||
*/
|
||||
void render_actor_item_box(Camera *camera, struct ItemBox *item_box) {
|
||||
UNUSED s32 pad[2];
|
||||
Vec3f someVec1;
|
||||
Vec3f someVec2;
|
||||
Vec3s someRot;
|
||||
f32 thing;
|
||||
UNUSED s32 pad2;
|
||||
Mat4 someMatrix1;
|
||||
Mat4 someMatrix2;
|
||||
UNUSED s32 pad3[4];
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
f32 temp_f2_2;
|
||||
f32 someMultiplier;
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
if (!(temp_f0 < 0.0f) && !(600000.0f < temp_f0)) {
|
||||
if ((item_box->state == 2) && (temp_f0 < 100000.0f)) {
|
||||
someRot[0] = 0;
|
||||
someRot[1] = item_box->rot[1];
|
||||
someRot[2] = 0;
|
||||
someVec2[0] = item_box->pos[0];
|
||||
someVec2[1] = item_box->resetDistance + 2.0f;
|
||||
someVec2[2] = item_box->pos[2];
|
||||
mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D002EE8);
|
||||
someRot[1] = item_box->rot[1] * 2;
|
||||
someVec2[1] = item_box->pos[1];
|
||||
mtxf_pos_rotation_xyz(someMatrix1, someVec2, someRot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
|
||||
}
|
||||
if (item_box->state == 5) {
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, itemBoxQuestionMarkModel);
|
||||
}
|
||||
if (item_box->state != 3) {
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
|
||||
if (!render_set_position(someMatrix1, 0)) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||
if ((item_box->rot[1] < 0xAA1) && (item_box->rot[1] > 0)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((item_box->rot[1] >= 0x6AA5) && (item_box->rot[1] < 0x754E)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((item_box->rot[1] >= 0x38E1) && (item_box->rot[1] < 0x438A)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else if ((item_box->rot[1] >= 0xC711) && (item_box->rot[1] < 0xD1BA)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
|
||||
}
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003090);
|
||||
} else {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gDPSetBlendMask(gDisplayListHead++, 0xFF);
|
||||
thing = item_box->someTimer;
|
||||
mtxf_pos_rotation_xyz(someMatrix1, item_box->pos, item_box->rot);
|
||||
if (thing < 10.0f) {
|
||||
someMultiplier = 1.0f;
|
||||
} else {
|
||||
someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
|
||||
}
|
||||
mtxf_scale(someMatrix1, someMultiplier);
|
||||
if (item_box->someTimer & 1) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
}
|
||||
temp_f2 = 2.0f * thing;
|
||||
someVec1[0] = 0.0f;
|
||||
someVec1[1] = temp_f2;
|
||||
someVec1[2] = thing;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003158);
|
||||
temp_f2_2 = 0.8f * thing;
|
||||
temp_f12 = 0.5f * thing;
|
||||
someVec1[0] = temp_f2_2;
|
||||
someVec1[1] = 2.3f * thing;
|
||||
someVec1[2] = temp_f12;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031B8);
|
||||
temp_f0_2 = -0.5f * thing;
|
||||
someVec1[0] = temp_f2_2;
|
||||
someVec1[1] = 1.2f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003128);
|
||||
if (!(item_box->someTimer & 1)) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2);
|
||||
}
|
||||
someVec1[0] = 0.0f;
|
||||
someVec1[1] = 1.8f * thing;
|
||||
someVec1[2] = -1.0f * thing;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0031E8);
|
||||
temp_f0_3 = -0.8f * thing;
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = 0.6f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D003188);
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = temp_f2;
|
||||
someVec1[2] = temp_f12;
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D0030F8);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the item box under the hot air balloon object.
|
||||
* It used in Luigi Raceway.
|
||||
* (here it's just update the rotation of the item box not the position, for the position it's in object)
|
||||
*
|
||||
* @param itemBox
|
||||
*/
|
||||
void update_actor_item_box_hot_air_balloon(struct ItemBox *itemBox) {
|
||||
switch(itemBox->state) {
|
||||
case 5:
|
||||
itemBox->rot[0] += 0xB6;
|
||||
itemBox->rot[1] -= 0x16C;
|
||||
itemBox->rot[2] += 0xB6;
|
||||
break;
|
||||
case 3:
|
||||
if (itemBox->someTimer == 0x14) {
|
||||
itemBox->state = 5;
|
||||
itemBox->flags = -0x4000;
|
||||
} else {
|
||||
itemBox->someTimer++;
|
||||
itemBox->rot[0] += 0x444;
|
||||
itemBox->rot[1] -= 0x2D8;
|
||||
itemBox->rot[2] += 0x16C;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates the item box actor.
|
||||
*
|
||||
* @param itemBox
|
||||
*/
|
||||
void update_actor_item_box(struct ItemBox *itemBox) {
|
||||
switch (itemBox->state) {
|
||||
case 0:
|
||||
itemBox->state = 1;
|
||||
break;
|
||||
case 1:
|
||||
if ((itemBox->pos[1] - itemBox->origY) < 8.66f) {
|
||||
itemBox->pos[1] += 0.45f;
|
||||
} else {
|
||||
itemBox->pos[1] = itemBox->origY + 8.66f;
|
||||
itemBox->state = 2;
|
||||
itemBox->flags = 0xC000;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
itemBox->rot[0] += 0xB6;
|
||||
itemBox->rot[1] -= 0x16C;
|
||||
itemBox->rot[2] += 0xB6;
|
||||
break;
|
||||
case 3:
|
||||
if (itemBox->someTimer == 20) {
|
||||
itemBox->state = 0;
|
||||
itemBox->pos[1] = itemBox->resetDistance - 20.0f;
|
||||
itemBox->flags = 0xC000;
|
||||
} else {
|
||||
itemBox->someTimer++;
|
||||
itemBox->rot[0] += 0x444;
|
||||
itemBox->rot[1] -= 0x2D8;
|
||||
itemBox->rot[2] += 0x16C;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include "courses/dks_jungle_parkway/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the kiwano fruit actor.
|
||||
* Actor used in DK's Jungle Parkway.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param actor
|
||||
*/
|
||||
void render_actor_kiwano_fruit(UNUSED Camera *camera, Mat4 arg1, struct Actor *actor) {
|
||||
uintptr_t addr;
|
||||
s32 maxObjectsReached;
|
||||
|
||||
if (actor->state == 0) { return; }
|
||||
|
||||
arg1[3][0] = actor->pos[0];
|
||||
arg1[3][1] = actor->pos[1];
|
||||
arg1[3][2] = actor->pos[2];
|
||||
|
||||
maxObjectsReached = render_set_position(arg1, 0) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
addr = (actor->rot[0] << 0xA) + 0x03009000; // Can this be a real symbol? Doesn't match.
|
||||
gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr),
|
||||
G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_dks_jungle_parkway_dl_kiwano_fruit);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
#include <waypoints.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the kiwano fruit actor.
|
||||
* Actor used in DK's Jungle Parkway.
|
||||
*
|
||||
* @param fruit
|
||||
*/
|
||||
void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
|
||||
Player *player;
|
||||
f32 temp_f2;
|
||||
f32 temp_f16;
|
||||
f32 temp_f14;
|
||||
f32 temp_f12;
|
||||
s32 nearestWaypoint;
|
||||
|
||||
player = &gPlayers[fruit->targetPlayer];
|
||||
if (((player->type & PLAYER_CPU) != 0) || (player->unk_110.unk34 == 0)) {
|
||||
fruit->state = 0;
|
||||
return;
|
||||
}
|
||||
switch (fruit->state) { /* irregular */
|
||||
case 0:
|
||||
if ((get_surface_type(player->unk_110.unk3A) & 0xFF) != GRASS) {
|
||||
return;
|
||||
}
|
||||
fruit->state = 1;
|
||||
fruit->velocity[0] = 80.0f;
|
||||
case 1:
|
||||
nearestWaypoint = gNearestWaypointByPlayerId[(u16)(player - gPlayerOne)];
|
||||
temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX;
|
||||
temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY;
|
||||
temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ;
|
||||
temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14));
|
||||
temp_f2 *= temp_f12;
|
||||
temp_f16 *= temp_f12;
|
||||
temp_f14 *= temp_f12;
|
||||
fruit->pos[0] = player->pos[0] + temp_f2;
|
||||
fruit->pos[1] = player->pos[1] + temp_f16;
|
||||
fruit->pos[2] = player->pos[2] + temp_f14;
|
||||
fruit->velocity[0] -= 2.0f;
|
||||
if (fruit->velocity[0] <= 0.0f) {
|
||||
fruit->state = 2;
|
||||
fruit->bonkTimer = 30.0f;
|
||||
fruit->velocity[0] = 0.0f;
|
||||
fruit->velocity[1] = 2.3f;
|
||||
fruit->velocity[2] = 0.0f;
|
||||
if ((player->effects & STAR_EFFECT) != 0) {
|
||||
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52));
|
||||
} else {
|
||||
player->effects |= 0x8000;
|
||||
player->pos[0] -= temp_f2 * 4.0f;
|
||||
player->pos[2] -= temp_f14 * 4.0f;
|
||||
player->velocity[0] -= temp_f2 * 0.7f;
|
||||
player->velocity[2] -= temp_f14 * 0.7f;
|
||||
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18));
|
||||
if (gModeSelection != GRAND_PRIX) {
|
||||
D_80162DF8 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
fruit->velocity[1] -= 0.3f;
|
||||
fruit->pos[0] += fruit->velocity[0];
|
||||
fruit->pos[1] += fruit->velocity[1];
|
||||
fruit->pos[2] += fruit->velocity[2];
|
||||
fruit->bonkTimer -= 1.0f;
|
||||
if (fruit->bonkTimer < 0.0f) {
|
||||
fruit->state = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (fruit->state != 0) {
|
||||
fruit->animTimer += 1;
|
||||
if (fruit->animTimer == 8) {
|
||||
fruit->animTimer = 0;
|
||||
fruit->animState += 1;
|
||||
if (fruit->animState == 3) {
|
||||
fruit->animState = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include "courses/mario_raceway/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the Mario sign actor.
|
||||
* Actor used in Mario Raceway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_mario_sign(Camera *arg0, UNUSED Mat4 arg1, struct Actor *arg2) {
|
||||
Mat4 sp40;
|
||||
f32 unk;
|
||||
s16 temp = arg2->flags;
|
||||
|
||||
if (temp & 0x800) { return; }
|
||||
|
||||
unk = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
|
||||
if (!(unk < 0.0f)) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
mtxf_pos_rotation_xyz(sp40, arg2->pos, arg2->rot);
|
||||
if (render_set_position(sp40, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the Mario sign actor.
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
void update_actor_mario_sign(struct Actor *arg0) {
|
||||
if ((arg0->flags & 0x800) == 0) {
|
||||
if ((arg0->flags & 0x400) != 0) {
|
||||
arg0->pos[1] += 4.0f;
|
||||
if (arg0->pos[1] > 800.0f) {
|
||||
arg0->flags |= 0x800;
|
||||
arg0->rot[1] += 1820;
|
||||
}
|
||||
} else {
|
||||
arg0->rot[1] += 182;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,15 @@
|
||||
#include "courses/all_course_data.h"
|
||||
#include <PR/gbi.h>
|
||||
|
||||
// This likely attaches the paddle wheel to the boat
|
||||
/**
|
||||
* @brief Renders the paddle boat actor.
|
||||
* Actor used in DK's Jungle Parkway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param boat
|
||||
* @param arg2
|
||||
* @param pathCounter
|
||||
*/
|
||||
void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED Mat4 arg2, u16 pathCounter) {
|
||||
UNUSED s32 pad[3];
|
||||
Vec3f sp120;
|
||||
@@ -28,6 +36,7 @@ void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED
|
||||
mtxf_pos_rotation_xyz(spE0, boat->pos, boat->boatRot);
|
||||
if (render_set_position(spE0, 1) != 0) {
|
||||
|
||||
// Render the boat
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E730);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E058);
|
||||
|
||||
@@ -36,10 +45,11 @@ void render_actor_paddle_boat(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED
|
||||
mtxf_translate(spA0, sp120);
|
||||
mtxf_multiplication(sp60, spE0, spA0);
|
||||
if (render_set_position(sp60, 3) != 0) {
|
||||
// Render the paddle wheel
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_FC28);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#include <actor_types.h>
|
||||
|
||||
/**
|
||||
* @brief Rotates paddle boat's wheel.
|
||||
* @brief Updates the paddle boat actor.
|
||||
* Actor used in DK's Jungle Parkway.
|
||||
* Rotate only the paddle wheel, for position and rotation of the boat it's in vehicle.
|
||||
*
|
||||
* @param boat
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include "courses/koopa_troopa_beach/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the palm tree actor.
|
||||
* Actor used in Koopa Troopa Beach.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_palm_tree(Camera *arg0, UNUSED Mat4 arg1, struct PalmTree *arg2) {
|
||||
Vec3s spA8 = {0, 0, 0};
|
||||
Mat4 sp68;
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800)) {
|
||||
return;
|
||||
}
|
||||
|
||||
temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
|
||||
|
||||
if (!(temp_f0 < 0.0f)) {
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.0f);
|
||||
}
|
||||
mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8);
|
||||
if (render_set_position(sp68, 0) != 0) {
|
||||
|
||||
gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
switch(arg2->variant) {
|
||||
case 0:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk1);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top1);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top2);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_trunk3);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_koopa_troopa_beach_dl_tree_top3);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <PR/gbi.h>
|
||||
#include "courses/mario_raceway/course_data.h"
|
||||
#include "courses/royal_raceway/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the piranha plant actor.
|
||||
* Actor used in Mario Raceway and Royal Raceway.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_piranha_plant(Camera *arg0, Mat4 arg1, struct PiranhaPlant *arg2) {
|
||||
UNUSED s32 pad;
|
||||
u8 *addr;
|
||||
s16 temp_lo = arg0 - camera1;
|
||||
s16 animationFrame; // unconfirmed
|
||||
s16 temp = arg2->flags;
|
||||
f32 temp_f0;
|
||||
s32 maxObjectsReached;
|
||||
|
||||
if (temp & 0x800) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 1000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) {
|
||||
|
||||
switch(temp_lo) {
|
||||
case 0:
|
||||
arg2->visibilityStates[0] = -1;
|
||||
break;
|
||||
case 1:
|
||||
arg2->visibilityStates[1] = -1;
|
||||
break;
|
||||
case 2:
|
||||
arg2->visibilityStates[2] = -1;
|
||||
break;
|
||||
case 3:
|
||||
arg2->visibilityStates[3] = -1;
|
||||
break;
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
maxObjectsReached = render_set_position(arg1, 0) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
if (90000.0f < temp_f0) {
|
||||
|
||||
switch(temp_lo) {
|
||||
case 0:
|
||||
arg2->visibilityStates[0] = 0;
|
||||
break;
|
||||
case 1:
|
||||
arg2->visibilityStates[1] = 0;
|
||||
break;
|
||||
case 2:
|
||||
arg2->visibilityStates[2] = 0;
|
||||
break;
|
||||
case 3:
|
||||
arg2->visibilityStates[3] = 0;
|
||||
break;
|
||||
}
|
||||
animationFrame = 0;
|
||||
|
||||
} else {
|
||||
switch(temp_lo) {
|
||||
case 0:
|
||||
arg2->visibilityStates[0] = 1;
|
||||
break;
|
||||
case 1:
|
||||
arg2->visibilityStates[1] = 1;
|
||||
break;
|
||||
case 2:
|
||||
arg2->visibilityStates[2] = 1;
|
||||
break;
|
||||
case 3:
|
||||
arg2->visibilityStates[3] = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(temp_lo) {
|
||||
case 0:
|
||||
animationFrame = arg2->timers[0];
|
||||
break;
|
||||
case 1:
|
||||
animationFrame = arg2->timers[1];
|
||||
break;
|
||||
case 2:
|
||||
animationFrame = arg2->timers[2];
|
||||
break;
|
||||
case 3:
|
||||
animationFrame = arg2->timers[3];
|
||||
break;
|
||||
}
|
||||
}
|
||||
animationFrame /= 6;
|
||||
|
||||
if (animationFrame > 8) {
|
||||
animationFrame = 8;
|
||||
}
|
||||
addr = D_802BA058 + (animationFrame << 0xB);
|
||||
gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 64, 0,
|
||||
G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
|
||||
if (gCurrentCourseId == COURSE_MARIO_RACEWAY) {
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_mario_raceway_dl_piranha_plant);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_royal_raceway_dl_piranha_plant);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the piranha plant actor.
|
||||
* Actor used in Mario Raceway and Royal Raceway.
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
void update_actor_piranha_plant(struct PiranhaPlant *arg0) {
|
||||
if ((arg0->flags & 0x800) == 0) {
|
||||
if ((arg0->flags & 0x400) != 0) {
|
||||
arg0->pos[1] += 4.0f;
|
||||
if (arg0->pos[1] > 800.0f) {
|
||||
arg0->flags |= 0x800;
|
||||
}
|
||||
} else {
|
||||
// This has to be an unrolled loop
|
||||
if (arg0->visibilityStates[0] == 1) {
|
||||
arg0->timers[0]++;
|
||||
if (arg0->timers[0] > 60) {
|
||||
arg0->timers[0] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->timers[0] = 0;
|
||||
}
|
||||
if (arg0->visibilityStates[1] == 1) {
|
||||
arg0->timers[1]++;
|
||||
if (arg0->timers[1] > 60) {
|
||||
arg0->timers[1] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->timers[1] = 0;
|
||||
}
|
||||
if (arg0->visibilityStates[2] == 1) {
|
||||
arg0->timers[2]++;
|
||||
if (arg0->timers[2] > 60) {
|
||||
arg0->timers[2] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->timers[2] = 0;
|
||||
}
|
||||
if (arg0->visibilityStates[3] == 1) {
|
||||
arg0->timers[3]++;
|
||||
if (arg0->timers[3] > 60) {
|
||||
arg0->timers[3] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->timers[3] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include "courses/kalimari_desert/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the railroad crossing actor.
|
||||
* Actor used in Kalimari Desert.
|
||||
*
|
||||
* @param arg0
|
||||
* @param rr_crossing
|
||||
*/
|
||||
void render_actor_railroad_crossing(Camera *arg0, struct RailroadCrossing *rr_crossing) {
|
||||
UNUSED Vec3s sp80 = {0, 0, 0};
|
||||
Mat4 sp40;
|
||||
f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
|
||||
|
||||
if (!(unk < 0.0f)) {
|
||||
mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot);
|
||||
|
||||
if (render_set_position(sp40, 0) != 0) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
|
||||
if (isCrossingTriggeredByIndex[rr_crossing->crossingId]) {
|
||||
|
||||
if (rr_crossing->someTimer < 20) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_right_active);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_left_active);
|
||||
}
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_crossing_both_inactive);
|
||||
}
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the railroad crossing actor.
|
||||
* Actor used in Kalimari Desert.
|
||||
* Make the sound of the bell when the train is close.
|
||||
*
|
||||
* @param crossing
|
||||
*/
|
||||
void update_actor_railroad_crossing(struct RailroadCrossing *crossing) {
|
||||
// If train close?
|
||||
if (isCrossingTriggeredByIndex[crossing->crossingId] != 0) {
|
||||
// Timer++
|
||||
crossing->someTimer++;
|
||||
// Reset timer
|
||||
if (crossing->someTimer > 40) {
|
||||
crossing->someTimer = 1;
|
||||
}
|
||||
// Play Bell sound when timer hits 20 or 1.
|
||||
if ((crossing->someTimer == 1) || (crossing->someTimer == 20)) {
|
||||
func_800C98B8(crossing->pos, crossing->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x16));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
|
||||
/**
|
||||
* @brief Renders the school bus actor.
|
||||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_school_bus(Camera *arg0, struct Actor *arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0;
|
||||
|
||||
temp_f0 = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
|
||||
mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
|
||||
if (render_set_position(spC8, 0) != 0) {
|
||||
|
||||
if (gActiveScreenMode == SCREEN_MODE_1P) {
|
||||
if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_3);
|
||||
} else if (temp_f0 < 640000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
|
||||
}
|
||||
} else if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
|
||||
/**
|
||||
* @brief Renders the tanker truck actor.
|
||||
* Actor used in Toad's Turnpike.
|
||||
* His update are made in vehicle.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_tanker_truck(Camera *camera, struct Actor* arg1) {
|
||||
UNUSED s32 pad[6];
|
||||
Mat4 spC8;
|
||||
UNUSED s32 pad2[32];
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, arg1->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
|
||||
|
||||
if (!(temp_f0 < 0.0f)) {
|
||||
|
||||
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
|
||||
if (render_set_position(spC8, 0) != 0) {
|
||||
|
||||
if (gActiveScreenMode == SCREEN_MODE_1P) {
|
||||
if (temp_f0 < 160000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_6);
|
||||
} else if (temp_f0 < 640000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
|
||||
}
|
||||
} else if (temp_f0 < 160000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// wheels
|
||||
void update_actor_train_engine(struct TrainCar *arg0) {
|
||||
arg0->wheelRot -= 0x666;
|
||||
|
||||
if (arg0->unk_08 != 0.0f) {
|
||||
arg0->unk_08 = 0.0f;
|
||||
func_800C9D80(arg0->pos, arg0->velocity, 0x51018000);
|
||||
}
|
||||
}
|
||||
|
||||
// wheels
|
||||
void update_actor_train_car1(struct TrainCar *tender) {
|
||||
tender->wheelRot -= 0x4FA;
|
||||
}
|
||||
|
||||
// wheels
|
||||
void update_actor_train_car2(struct TrainCar *arg0) {
|
||||
arg0->wheelRot -= 0x666;
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include "courses/kalimari_desert/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the train engine actor.
|
||||
* Actor used in Kalimari Desert.
|
||||
* His update position are made in vehicle.
|
||||
*
|
||||
* @param camera
|
||||
* @param actor
|
||||
*/
|
||||
void render_actor_train_engine(Camera *camera, struct TrainCar *actor) {
|
||||
UNUSED s32 pad[2];
|
||||
s32 maxObjectsReached;
|
||||
Vec3f sp160;
|
||||
Mat4 sp120;
|
||||
Mat4 spE0;
|
||||
Mat4 spA0;
|
||||
|
||||
f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
|
||||
|
||||
if (distance < 0.0f) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
|
||||
maxObjectsReached = render_set_position(sp120, 0) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
if (distance < 122500.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1C0F0);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1B978);
|
||||
|
||||
} else if (distance < 640000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D670);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
|
||||
}
|
||||
if (1440000.0f < distance) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 32.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 32.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 16.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, 16.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, 17.0f, 12.0f, -12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, -17.0f, 12.0f, -12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
vec3f_set(sp160, 17.0f, 12.0f, -34.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
vec3f_set(sp160, -17.0f, 12.0f, -34.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void render_actor_train_tender(Camera *camera, struct TrainCar *actor) {
|
||||
Mat4 sp120;
|
||||
Vec3f sp160;
|
||||
Mat4 spE0;
|
||||
Mat4 spA0;
|
||||
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 625.0f, gCameraZoom[camera - camera1], 9000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
|
||||
if (render_set_position(sp120, 0) == 0) { return; }
|
||||
|
||||
if (temp_f0 < 250000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F228);
|
||||
|
||||
} else if (temp_f0 < 1000000.0f) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1F708);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1FAF8);
|
||||
}
|
||||
if (1440000.0f < temp_f0) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
|
||||
void render_actor_train_passenger_car(Camera *camera, struct TrainCar *actor) {
|
||||
Mat4 sp120;
|
||||
Vec3f sp160;
|
||||
Mat4 spE0;
|
||||
Mat4 spA0;
|
||||
|
||||
f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2025.0f, gCameraZoom[camera - camera1], 9000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(sp120, actor->pos, actor->rot);
|
||||
|
||||
if (render_set_position(sp120, 0) == 0) { return; }
|
||||
|
||||
if (temp_f0 < 250000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A20);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_20A08);
|
||||
|
||||
} else if (temp_f0 < 1000000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21550);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21220);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21C90);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_21A80);
|
||||
}
|
||||
if (1440000.0f < temp_f0) { return; }
|
||||
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 28.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 28.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, 12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -24.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -24.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the train engine actor.
|
||||
* Used in Kalimari Desert.
|
||||
* Update wheels and make sound, for his update position it's in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
void update_actor_train_engine(struct TrainCar *arg0) {
|
||||
arg0->wheelRot -= 0x666;
|
||||
|
||||
if (arg0->unk_08 != 0.0f) {
|
||||
arg0->unk_08 = 0.0f;
|
||||
func_800C9D80(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x51,0x01,0x80,0x00));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates the train tender actor.
|
||||
* Used in Kalimari Desert.
|
||||
* Update wheels, for his update position it's in vehicle.
|
||||
* @param tender
|
||||
*/
|
||||
void update_actor_train_tender(struct TrainCar *tender) {
|
||||
tender->wheelRot -= 0x4FA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates the train passenger car actor.
|
||||
* Used in Kalimari Desert.
|
||||
* Update wheels, for his update position it's in vehicle.
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
void update_actor_train_passenger_car(struct TrainCar *arg0) {
|
||||
arg0->wheelRot -= 0x666;
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include <common_textures.h>
|
||||
#include "courses/all_course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Mario rawceay.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_mario_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 3.0f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_tree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Yoshi Valley.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_tree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Royal Raceway.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_tree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Moo Moo Farm.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_moo_moo_farm(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 5.0f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_dl_tree);
|
||||
}
|
||||
}
|
||||
|
||||
// have all the properties of the tree
|
||||
void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
// Why is a TLUT being used a DL here? That makes no sense
|
||||
// Based on the TLUT being loaded above, this ought to be be another
|
||||
// tree related DL, presumably one found in a course other than Moo Moo farm
|
||||
// 0x0600FC70
|
||||
gSPDisplayList(gDisplayListHead++, d_course_moo_moo_farm_mole_tlut);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Bowser's Castle.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_royal_raceway_dl_castle_tree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the bush actor in Bowser's Castle.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_bush_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_bowsers_castle_dl_bush);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the tree actor in Frappe Snowland.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_frappe_snowland_dl_tree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the a first variant of cactus in Kalimari Desert.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_cactus1_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 1.0f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the a second variant of cactus in Kalimari Desert.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_cactus2_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 1.0f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Renders the a third variant of cactus in Kalimari Desert.
|
||||
*
|
||||
* @param camera
|
||||
* @param arg1
|
||||
* @param arg2
|
||||
*/
|
||||
void render_actor_tree_cactus3_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2) {
|
||||
f32 temp_f0;
|
||||
s16 temp_v0 = arg2->flags;
|
||||
|
||||
if ((temp_v0 & 0x800) != 0) { return; }
|
||||
|
||||
temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
|
||||
|
||||
if (temp_f0 < 0.0f) { return; }
|
||||
|
||||
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
|
||||
func_8029794C(arg2->pos, arg2->rot, 0.80000001f);
|
||||
}
|
||||
arg1[3][0] = arg2->pos[0];
|
||||
arg1[3][1] = arg2->pos[1];
|
||||
arg1[3][2] = arg2->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_cactus3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <actors.h>
|
||||
#include <PR/gbi.h>
|
||||
#include <main.h>
|
||||
#include "courses/wario_stadium/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the Wario sign actor.
|
||||
* Used in Wario Stadium.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
*/
|
||||
void render_actor_wario_sign(Camera *arg0, struct Actor *arg1) {
|
||||
Mat4 sp38;
|
||||
f32 unk = is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 0, gCameraZoom[arg0 - camera1], 16000000.0f);
|
||||
|
||||
if (!(unk < 0.0f)) {
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
|
||||
mtxf_pos_rotation_xyz(sp38, arg1->pos, arg1->rot);
|
||||
if (render_set_position(sp38, 0) != 0) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_wario_stadium_dl_sign);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the Wario sign actor.
|
||||
* Used in Wario Stadium.
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
void update_actor_wario_sign(struct Actor *arg0) {
|
||||
arg0->rot[1] += 0xB6;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#include <camera.h>
|
||||
#include <actors.h>
|
||||
#include <defines.h>
|
||||
#include <main.h>
|
||||
#include "courses/yoshi_valley/course_data.h"
|
||||
|
||||
/**
|
||||
* @brief Renders the Yoshi egg actor.
|
||||
* Actor used in Yoshi Valley.
|
||||
*
|
||||
* @param arg0
|
||||
* @param arg1
|
||||
* @param egg
|
||||
* @param arg3
|
||||
*/
|
||||
void render_actor_yoshi_egg(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3) {
|
||||
Mat4 sp60;
|
||||
Vec3s sp5C;
|
||||
Vec3f sp54;
|
||||
f32 temp_f0;
|
||||
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
temp_f0 = is_within_render_distance(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], 16000000.0f);
|
||||
if (temp_f0 < 0.0f) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
arg3 = 15;
|
||||
temp_f0 = 0.0f;
|
||||
}
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
||||
if ((arg3 > 12) && (arg3 < 20)) {
|
||||
if (temp_f0 < 640000.0f) {
|
||||
sp54[0] = egg->pos[0];
|
||||
sp54[1] = 3.0f;
|
||||
sp54[2] = egg->pos[2];
|
||||
func_802976D8(sp5C);
|
||||
func_8029794C(sp54, sp5C, 10.0f);
|
||||
}
|
||||
sp5C[0] = 0;
|
||||
sp5C[1] = egg->eggRot;
|
||||
sp5C[2] = 0;
|
||||
mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
|
||||
if (render_set_position(sp60, 0) == 0) { return; }
|
||||
|
||||
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
|
||||
} else {
|
||||
arg1[3][0] = egg->pos[0];
|
||||
arg1[3][1] = egg->pos[1];
|
||||
arg1[3][2] = egg->pos[2];
|
||||
|
||||
if (render_set_position(arg1, 0) != 0) {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <actors.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the Yoshi egg actor.
|
||||
*
|
||||
* @param egg
|
||||
*/
|
||||
void update_actor_yoshi_egg(struct YoshiValleyEgg *egg) {
|
||||
egg->pathRot += 0x5B;
|
||||
egg->pos[0] = egg->pathCenter[0] + (sins(egg->pathRot) * egg->pathRadius);
|
||||
egg->pos[2] = egg->pathCenter[2] + (coss(egg->pathRot) * egg->pathRadius);
|
||||
if ((egg->flags & 0x400) != 0) {
|
||||
egg->pathCenter[1] -= 0.12;
|
||||
if (egg->pathCenter[1] < -3.0f) {
|
||||
egg->pathCenter[1] = -3.0f;
|
||||
}
|
||||
egg->pos[1] += egg->pathCenter[1];
|
||||
if (egg->pos[1] < 0.0f) {
|
||||
egg->pos[1] = 0.0f;
|
||||
egg->pathCenter[1] = 0.0f;
|
||||
egg->flags &= ~(1 << 10);
|
||||
}
|
||||
egg->eggRot -= 0x4FA;
|
||||
}
|
||||
egg->eggRot -= 0x222;
|
||||
}
|
||||
+13
-11
@@ -83,13 +83,15 @@ s32 D_8015F5A0;
|
||||
s32 D_8015F5A4;
|
||||
s32 code_800029B0_bss_pad[48];
|
||||
Vtx *vtxBuffer[32];
|
||||
s16 D_8015F6E8;
|
||||
s16 D_8015F6EA;
|
||||
s16 D_8015F6EC; // s16 or u16?
|
||||
s16 D_8015F6EE;
|
||||
|
||||
s16 D_8015F6F0;
|
||||
s16 D_8015F6F2;
|
||||
s16 gCourseMaxX;
|
||||
s16 gCourseMinX;
|
||||
|
||||
s16 gCourseMaxY; // s16 or u16?
|
||||
s16 gCourseMinY;
|
||||
|
||||
s16 gCourseMaxZ;
|
||||
s16 gCourseMinZ;
|
||||
|
||||
s16 D_8015F6F4;
|
||||
s16 D_8015F6F6;
|
||||
@@ -210,7 +212,7 @@ void setup_race(void) {
|
||||
func_802A74BC();
|
||||
func_802A4D18();
|
||||
func_80091FA4();
|
||||
func_8029E158();
|
||||
init_actors_and_load_textures();
|
||||
|
||||
if (gModeSelection != BATTLE) {
|
||||
D_8015F8D0[1] = (f32) (D_80164490->posY - 15);;
|
||||
@@ -320,7 +322,7 @@ void func_80003040(void) {
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_YOSHI_EGG);
|
||||
break;
|
||||
case COURSE_MOO_MOO_FARM:
|
||||
dma_textures(gTextureTrees4Left, 0x3E8, 0x800);
|
||||
@@ -353,11 +355,11 @@ void func_80003040(void) {
|
||||
break;
|
||||
case COURSE_WARIO_STADIUM:
|
||||
vec3f_set(position, -131.0f, 83.0f, 286.0f);
|
||||
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
|
||||
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
|
||||
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
add_actor_to_empty_slot(position, rotation, velocity, ACTOR_WARIO_SIGN);
|
||||
// d_course_wario_stadium_packed_dl_C50
|
||||
find_vtx_and_set_colours(0x07000C50, 0x64, 0xFF, 0xFF, 0xFF);
|
||||
// d_course_wario_stadium_packed_dl_BD8
|
||||
|
||||
+7
-6
@@ -58,13 +58,14 @@ extern s32 D_8015F5A0;
|
||||
extern s32 D_8015F5A4;
|
||||
|
||||
extern Vtx *vtxBuffer[];
|
||||
extern s16 D_8015F6E8;
|
||||
extern s16 D_8015F6EA;
|
||||
extern s16 D_8015F6EC;
|
||||
extern s16 D_8015F6EE;
|
||||
extern s16 gCourseMaxX;
|
||||
extern s16 gCourseMinX;
|
||||
|
||||
extern s16 D_8015F6F0;
|
||||
extern s16 D_8015F6F2;
|
||||
extern s16 gCourseMaxY;
|
||||
extern s16 gCourseMinY;
|
||||
|
||||
extern s16 gCourseMaxZ;
|
||||
extern s16 gCourseMinZ;
|
||||
extern s16 D_8015F6F4;
|
||||
extern s16 D_8015F6F6;
|
||||
extern u16 D_8015F6F8;
|
||||
|
||||
+26
-26
@@ -1602,7 +1602,7 @@ void func_800098FC(s32 arg0, Player *player) {
|
||||
}
|
||||
}
|
||||
if (D_801633B0[arg0] >= 0xB) {
|
||||
if ((player->soundEffects & 0x400000) || (player->soundEffects & 0x01000000) || (player->soundEffects & 2) || (player->soundEffects & 4) || (player->effects & 0x04000000)) {
|
||||
if ((player->soundEffects & 0x400000) || (player->soundEffects & 0x01000000) || (player->soundEffects & 2) || (player->soundEffects & 4) || (player->effects & HIT_EFFECT)) {
|
||||
func_800C92CC(arg0, 0x2900800BU);
|
||||
D_801633B0[arg0] = 0;
|
||||
}
|
||||
@@ -1640,7 +1640,7 @@ void func_800099EC(s32 playerId, Player *unused) {
|
||||
// Lots of register allocation differences, but messing around seems to suggest they stem from 2 specific areas
|
||||
// MISMATCH1: something about the loading of `playerId` is off
|
||||
// MISMATCH2: something about the handling of the math is off. Not sure exactly what though
|
||||
// MISMATCH3: there's a small instruction ordering issue concerning `D_8015F6F0`. No idea what to do about it
|
||||
// MISMATCH3: there's a small instruction ordering issue concerning `gCourseMaxX`. No idea what to do about it
|
||||
// FAKEMATCH1 is the best improvement I've seen yet, MISMATCH2/3 become the only issues.
|
||||
|
||||
void func_80009B60(s32 playerId) {
|
||||
@@ -1698,17 +1698,17 @@ void func_80009B60(s32 playerId) {
|
||||
return;
|
||||
}
|
||||
D_801633E0[playerId] = 0;
|
||||
if (player->pos[0] < D_8015F6EA) {
|
||||
if (player->pos[0] < gCourseMinX) {
|
||||
D_801633E0[playerId] = 1;
|
||||
}
|
||||
if (D_8015F6E8 < player->pos[0]) {
|
||||
if (gCourseMaxX < player->pos[0]) {
|
||||
D_801633E0[playerId] = 2;
|
||||
}
|
||||
if (player->pos[2] < D_8015F6F2) {
|
||||
if (player->pos[2] < gCourseMinZ) {
|
||||
D_801633E0[playerId] = 3;
|
||||
}
|
||||
// MISMATCH3
|
||||
if (D_8015F6F0 < player->pos[2]) {
|
||||
if (gCourseMaxZ < player->pos[2]) {
|
||||
D_801633E0[playerId] = 4;
|
||||
}
|
||||
if (!(player->unk_0CA & 2) && !(player->unk_0CA & 8)) {
|
||||
@@ -3264,11 +3264,11 @@ void func_8000DF8C(s32 bombKartId) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_8000ED14(s32 actorIndex, s16 arg1) {
|
||||
s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1) {
|
||||
s32 i;
|
||||
s32 a2 = 0;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
|
||||
if (gUnexpiredActorsList[i].unkC == 0) {
|
||||
gUnexpiredActorsList[i].unkC = 1;
|
||||
@@ -3285,31 +3285,31 @@ s32 func_8000ED14(s32 actorIndex, s16 arg1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_8000ED80(s32 actorIndex) {
|
||||
s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct Actor *actor = &gActorList[actorIndex];
|
||||
if (actor->type != 8) {
|
||||
if (actor->type != ACTOR_RED_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return func_8000ED14(actorIndex, 0);
|
||||
return add_actor_in_unexpired_actor_list(actorIndex, 0);
|
||||
}
|
||||
|
||||
s32 func_8000EDC8(s32 actorIndex) {
|
||||
s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct Actor *actor = &gActorList[actorIndex];
|
||||
if (actor->type != 7) {
|
||||
if (actor->type != ACTOR_GREEN_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return func_8000ED14(actorIndex, 1);
|
||||
return add_actor_in_unexpired_actor_list(actorIndex, 1);
|
||||
}
|
||||
|
||||
s32 func_8000EE10(s32 arg0) {
|
||||
s32 add_blue_shell_in_unexpired_actor_list(s32 arg0) {
|
||||
struct Actor *actor = &gActorList[arg0];
|
||||
if (actor->type != 42) {
|
||||
if (actor->type != ACTOR_BLUE_SPINY_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return func_8000ED14(arg0, 2);
|
||||
return add_actor_in_unexpired_actor_list(arg0, 2);
|
||||
}
|
||||
|
||||
void func_8000EE58(s32 actorIndex) {
|
||||
void delete_actor_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct unexpiredActors *phi;
|
||||
s32 i;
|
||||
|
||||
@@ -4419,7 +4419,7 @@ void init_course_vehicles(void) {
|
||||
tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos;
|
||||
tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
tempLocomotive->actorIndex = addActorToEmptySlot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
|
||||
tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
|
||||
|
||||
tempTender = &gTrainList[loopIndex].tender;
|
||||
if (tempTender->isActive == 1) {
|
||||
@@ -4429,7 +4429,7 @@ void init_course_vehicles(void) {
|
||||
tempTender->velocity[0] = tempTender->position[0] - origXPos;
|
||||
tempTender->velocity[2] = tempTender->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
tempTender->actorIndex = addActorToEmptySlot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
|
||||
tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
|
||||
}
|
||||
|
||||
for(loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) {
|
||||
@@ -4441,7 +4441,7 @@ void init_course_vehicles(void) {
|
||||
tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos;
|
||||
tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos;
|
||||
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
|
||||
tempPassengerCar->actorIndex = addActorToEmptySlot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
|
||||
tempPassengerCar->actorIndex = add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4456,7 +4456,7 @@ void init_course_vehicles(void) {
|
||||
tempPaddleWheelBoat->velocity[0] = tempPaddleWheelBoat->position[0] - origXPos;
|
||||
tempPaddleWheelBoat->velocity[2] = tempPaddleWheelBoat->position[2] - origZPos;
|
||||
vec3s_set(paddleWheelBoatRot, 0, tempPaddleWheelBoat->rotY, 0);
|
||||
tempPaddleWheelBoat->actorIndex = addActorToEmptySlot(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT);
|
||||
tempPaddleWheelBoat->actorIndex = add_actor_to_empty_slot(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_BOAT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4464,22 +4464,22 @@ void init_course_vehicles(void) {
|
||||
for(loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) {
|
||||
tempBoxTruck = &gBoxTruckList[loopIndex];
|
||||
func_80012220(tempBoxTruck);
|
||||
tempBoxTruck->actorIndex = addActorToEmptySlot(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
|
||||
tempBoxTruck->actorIndex = add_actor_to_empty_slot(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
|
||||
}
|
||||
for(loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) {
|
||||
tempSchoolBus = &gSchoolBusList[loopIndex];
|
||||
func_80012220(tempSchoolBus);
|
||||
tempSchoolBus->actorIndex = addActorToEmptySlot(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
|
||||
tempSchoolBus->actorIndex = add_actor_to_empty_slot(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
|
||||
}
|
||||
for(loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) {
|
||||
tempTankerTruck = &gTankerTruckList[loopIndex];
|
||||
func_80012220(tempTankerTruck);
|
||||
tempTankerTruck->actorIndex = addActorToEmptySlot(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
|
||||
tempTankerTruck->actorIndex = add_actor_to_empty_slot(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
|
||||
}
|
||||
for(loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) {
|
||||
tempCar = &gCarList[loopIndex];
|
||||
func_80012220(tempCar);
|
||||
tempCar->actorIndex = addActorToEmptySlot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
|
||||
tempCar->actorIndex = add_actor_to_empty_slot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-5
@@ -117,11 +117,11 @@ s16 func_8000DBAC(Vec3f, s16*, f32);
|
||||
void set_bomb_kart_spawn_positions(void);
|
||||
void func_8000DF8C(s32);
|
||||
|
||||
s32 func_8000ED14(s32, s16);
|
||||
s32 func_8000ED80(s32);
|
||||
s32 func_8000EDC8(s32);
|
||||
s32 func_8000EE10(s32);
|
||||
void func_8000EE58(s32);
|
||||
s32 add_actor_in_unexpired_actor_list(s32, s16);
|
||||
s32 add_red_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_green_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_blue_shell_in_unexpired_actor_list(s32);
|
||||
void delete_actor_in_unexpired_actor_list(s32);
|
||||
void func_8000EEDC(void);
|
||||
void generate_player_smoke(void);
|
||||
|
||||
|
||||
+1
-1
@@ -1460,7 +1460,7 @@ void func_8005A14C(s32 playerId) {
|
||||
} else {
|
||||
f32_step_towards(&gObjectList[objectIndex].sizeScaling, 0.6f, 0.02f);
|
||||
}
|
||||
if (player->effects & 0x04000000) {
|
||||
if (player->effects & HIT_EFFECT) {
|
||||
u16_step_up_towards(&gObjectList[objectIndex].direction_angle[0], 0x0C00U, 0x0100U);
|
||||
} else {
|
||||
u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000100);
|
||||
|
||||
+37
-19
@@ -716,10 +716,10 @@ void func_8008D9C0(Player* player) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8008DABC(Player *player, s8 arg1) {
|
||||
void apply_hit_sound_effect(Player *player, s8 arg1) {
|
||||
clean_effect(player, arg1);
|
||||
|
||||
if ((player->effects & 0x4000000) == 0) {
|
||||
if ((player->effects & HIT_EFFECT) == 0) {
|
||||
player->unk_DB4.unk2 = 0;
|
||||
player->unk_238 = 0;
|
||||
player->unk_DB4.unk10 = 4.5f;
|
||||
@@ -737,18 +737,18 @@ void func_8008DABC(Player *player, s8 arg1) {
|
||||
player->unk_046 |= 0x80;
|
||||
}
|
||||
|
||||
if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & 0x04000000) == 0)) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
|
||||
if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & HIT_EFFECT) == 0)) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05));
|
||||
}
|
||||
|
||||
player->effects |= 0x04000000;
|
||||
player->effects |= HIT_EFFECT;
|
||||
if (((player->type) & 0x1000) != 0) {
|
||||
func_800098FC(arg1, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8008DC08(Player* player, s8 arg1) {
|
||||
void apply_hit_effect(Player* player, s8 arg1) {
|
||||
player->unk_0C2 = 0;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_07C = 0;
|
||||
@@ -837,7 +837,7 @@ void func_8008DC08(Player* player, s8 arg1) {
|
||||
break;
|
||||
case 3:
|
||||
player->unk_DB4.unk10 = 3.0f;
|
||||
player->effects &= ~0x04000000;
|
||||
player->effects &= ~HIT_EFFECT;
|
||||
player->unk_DB4.unk2 = 0;
|
||||
player->effects |= 0x08000000;
|
||||
player->size = 1.0f;
|
||||
@@ -889,7 +889,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 arg1) {
|
||||
|
||||
void apply_lightning_effect(Player *player, s8 arg1) {
|
||||
s16 test;
|
||||
if (((player->effects & 0x8000) == 0x8000) && ((player->effects & 0x04000000) != 0x04000000)) {
|
||||
if (((player->effects & 0x8000) == 0x8000) && ((player->effects & HIT_EFFECT) != HIT_EFFECT)) {
|
||||
player->effects &= ~0x20000;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_07C = 0;
|
||||
@@ -900,7 +900,7 @@ void apply_lightning_effect(Player *player, s8 arg1) {
|
||||
D_80165190[1][arg1] = 1;
|
||||
D_80165190[2][arg1] = 1;
|
||||
D_80165190[3][arg1] = 1;
|
||||
func_8008DABC(player, arg1);
|
||||
apply_hit_sound_effect(player, arg1);
|
||||
} else if ((player->effects & 0x20000) == 0x20000) {
|
||||
player->rotation[1] -= 0x5B0;
|
||||
D_8018D920[arg1] -= 0x5B0;
|
||||
@@ -1987,10 +1987,28 @@ void func_80090970(Player *player, s8 playerId, s8 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800910E4(Player *player) {
|
||||
#define EFFECT_BLACKLIST_USE_ITEM LIGHTNING_EFFECT| \
|
||||
0x10000000| \
|
||||
0x8000000| \
|
||||
HIT_EFFECT| \
|
||||
HIT_BY_ITEM_EFFECT| \
|
||||
0x1000000| \
|
||||
0x800000| \
|
||||
BOOST_RAMP_ASPHALT_EFFECT|\
|
||||
0x20000| \
|
||||
0x10000| \
|
||||
0x4000| \
|
||||
0x800| \
|
||||
0x400| \
|
||||
STAR_EFFECT| \
|
||||
0x80| \
|
||||
0x40| \
|
||||
BOOST_RAMP_WOOD_EFFECT
|
||||
|
||||
bool prevent_item_use(Player *player) {
|
||||
s32 phi_v0 = 0;
|
||||
if ((((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->type & PLAYER_UNKNOWN_0x40) != 0)) || ((player->type & PLAYER_CINEMATIC_MODE) != 0)) || ((player->type & PLAYER_EXISTS) == 0)) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
switch (player->currentItemCopy) {
|
||||
@@ -1999,20 +2017,20 @@ s32 func_800910E4(Player *player) {
|
||||
case ITEM_TRIPLE_MUSHROOM:
|
||||
case ITEM_SUPER_MUSHROOM:
|
||||
if ((player->effects & 8) != 0) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
phi_v0 = 0x5F934EC4;
|
||||
goto func_800910E4_label;
|
||||
phi_v0 = EFFECT_BLACKLIST_USE_ITEM;
|
||||
goto prevent_item_use_label;
|
||||
case ITEM_STAR:
|
||||
phi_v0 = 0xDF934EC4;
|
||||
phi_v0 = BOO_EFFECT| EFFECT_BLACKLIST_USE_ITEM;
|
||||
case ITEM_BOO:
|
||||
phi_v0 = phi_v0 | 0xDF934EC4;
|
||||
func_800910E4_label:
|
||||
phi_v0 = phi_v0 | (BOO_EFFECT | EFFECT_BLACKLIST_USE_ITEM);
|
||||
prevent_item_use_label:
|
||||
default:
|
||||
if ((player->effects & phi_v0) != 0) {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -69,8 +69,8 @@ void func_8008D7B0(Player*, s8);
|
||||
void func_8008D8B4(Player*, s8);
|
||||
void func_8008D97C(Player*);
|
||||
void func_8008D9C0(Player*);
|
||||
void func_8008DABC(Player*, s8);
|
||||
void func_8008DC08(Player*, s8);
|
||||
void apply_hit_sound_effect(Player*, s8);
|
||||
void apply_hit_effect(Player*, s8);
|
||||
void apply_hit_rotating_sound_effect(Player*, s8);
|
||||
void apply_lightning_effect(Player*, s8);
|
||||
void remove_lightning_effect(Player*, s8);
|
||||
@@ -111,7 +111,7 @@ void func_80090178(Player*, s8, Vec3f, Vec3f);
|
||||
void func_80090778(Player*);
|
||||
void func_80090868(Player*);
|
||||
void func_80090970(Player*, s8, s8);
|
||||
s32 func_800910E4(Player*);
|
||||
s32 prevent_item_use(Player*);
|
||||
void func_800911B4(Player*, s8);
|
||||
void func_80091298(Player*, s8);
|
||||
|
||||
|
||||
@@ -141,12 +141,14 @@ void load_credits(void) {
|
||||
load_course(gCurrentCourseId);
|
||||
D_8015F730 = gNextFreeMemoryAddress;
|
||||
set_segment_base_addr(0xB, (void *) decompress_segments((u8 *) CEREMONY_DATA_ROM_START, (u8 *) CEREMONY_DATA_ROM_END));
|
||||
D_8015F6EA = -0x15A1;
|
||||
D_8015F6EE = -0x15A1;
|
||||
D_8015F6F2 = -0x15A1;
|
||||
D_8015F6E8 = 0x15A1;
|
||||
D_8015F6EC = 0x15A1;
|
||||
D_8015F6F0 = 0x15A1;
|
||||
|
||||
gCourseMinX = -0x15A1;
|
||||
gCourseMinY = -0x15A1;
|
||||
gCourseMinZ = -0x15A1;
|
||||
|
||||
gCourseMaxX = 0x15A1;
|
||||
gCourseMaxY = 0x15A1;
|
||||
gCourseMaxZ = 0x15A1;
|
||||
D_8015F59C = 0;
|
||||
D_8015F5A0 = 0;
|
||||
D_8015F58C = 0;
|
||||
|
||||
@@ -117,13 +117,13 @@ void load_ceremony_cutscene(void) {
|
||||
set_segment_base_addr(6, (void *) decompress_segments((u8 *) &_course_banshee_boardwalk_dl_mio0SegmentRomStart, (u8 *) &_course_yoshi_valley_dl_mio0SegmentRomStart));
|
||||
D_8015F8E4 = -2000.0f;
|
||||
|
||||
D_8015F6EA = -0x15A1;
|
||||
D_8015F6EE = -0x15A1;
|
||||
D_8015F6F2 = -0x15A1;
|
||||
gCourseMinX = -0x15A1;
|
||||
gCourseMinY = -0x15A1;
|
||||
gCourseMinZ = -0x15A1;
|
||||
|
||||
D_8015F6E8 = 0x15A1;
|
||||
D_8015F6EC = 0x15A1;
|
||||
D_8015F6F0 = 0x15A1;
|
||||
gCourseMaxX = 0x15A1;
|
||||
gCourseMaxY = 0x15A1;
|
||||
gCourseMaxZ = 0x15A1;
|
||||
|
||||
D_8015F59C = 0;
|
||||
D_8015F5A0 = 0;
|
||||
|
||||
+4
-4
@@ -595,7 +595,7 @@ void race_logic_loop(void) {
|
||||
gCourseTimer += COURSE_TIMER_ITER;
|
||||
}
|
||||
func_802909F0();
|
||||
evaluate_player_collision();
|
||||
evaluate_collision_for_players_and_actors();
|
||||
func_800382DC();
|
||||
func_8001EE98(gPlayerOneCopy, camera1, 0);
|
||||
func_80028F70();
|
||||
@@ -660,7 +660,7 @@ void race_logic_loop(void) {
|
||||
gCourseTimer += COURSE_TIMER_ITER;
|
||||
}
|
||||
func_802909F0();
|
||||
evaluate_player_collision();
|
||||
evaluate_collision_for_players_and_actors();
|
||||
func_800382DC();
|
||||
func_8001EE98(gPlayerOneCopy, camera1, 0);
|
||||
func_80029060();
|
||||
@@ -706,7 +706,7 @@ void race_logic_loop(void) {
|
||||
gCourseTimer += COURSE_TIMER_ITER;
|
||||
}
|
||||
func_802909F0();
|
||||
evaluate_player_collision();
|
||||
evaluate_collision_for_players_and_actors();
|
||||
func_800382DC();
|
||||
func_8001EE98(gPlayerOneCopy, camera1, 0);
|
||||
func_80029060();
|
||||
@@ -774,7 +774,7 @@ void race_logic_loop(void) {
|
||||
gCourseTimer += COURSE_TIMER_ITER;
|
||||
}
|
||||
func_802909F0();
|
||||
evaluate_player_collision();
|
||||
evaluate_collision_for_players_and_actors();
|
||||
func_800382DC();
|
||||
func_8001EE98(gPlayerOneCopy, camera1, 0);
|
||||
func_80029158();
|
||||
|
||||
+11
-11
@@ -864,7 +864,7 @@ void func_8002934C(Player *player, Camera *camera, s8 arg2, s8 playerId) {
|
||||
player->unk_0CC[arg2] = func_802B7C40(temp_f0 / temp_f2) * 2;
|
||||
}
|
||||
}
|
||||
if ((player->effects & 0x04000000) == 0x04000000) {
|
||||
if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
player->unk_0CC[arg2] = (s16) ((s32) player->unk_D9C);
|
||||
}
|
||||
if ((player->effects & 8) != 8) {
|
||||
@@ -879,7 +879,7 @@ void func_8002934C(Player *player, Camera *camera, s8 arg2, s8 playerId) {
|
||||
}
|
||||
player->unk_0D4[arg2] = (s16) ((s32) (((f64) func_802B7C40(var_f0 / temp_f2)) * 0.5));
|
||||
}
|
||||
if ((player->effects & 0x04000000) == 0x04000000) {
|
||||
if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
player->unk_0D4[arg2] = (s16) ((s32) player->unk_D9C);
|
||||
}
|
||||
func_80029200(player, arg2);
|
||||
@@ -1538,8 +1538,8 @@ void apply_sound_effect(Player *player, s8 playerId, UNUSED s8 arg2) {
|
||||
if ((player->soundEffects & 0x20000) == 0x20000) {
|
||||
func_8008D7B0(player, playerId);
|
||||
}
|
||||
if ((player->soundEffects & 0x100) == 0x100) {
|
||||
func_8008DABC(player, playerId);
|
||||
if ((player->soundEffects & HIT_SOUND_EFFECT) == HIT_SOUND_EFFECT) {
|
||||
apply_hit_sound_effect(player, playerId);
|
||||
}
|
||||
if ((player->soundEffects & HIT_ROTATING_SOUND_EFFECT) == HIT_ROTATING_SOUND_EFFECT) {
|
||||
apply_hit_rotating_sound_effect(player, playerId);
|
||||
@@ -1595,7 +1595,7 @@ void func_8002B5C0(Player *player, UNUSED s8 playerId, UNUSED s8 arg2) {
|
||||
if ((player->effects & 0x800000) == 0x800000) {
|
||||
player->soundEffects &= 0xFE1D0478;
|
||||
}
|
||||
if ((player->effects & 0x04000000) == 0x04000000) {
|
||||
if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
player->soundEffects &= 0xFE1D0578;
|
||||
}
|
||||
if ((player->effects & 0x01000000) == 0x01000000) {
|
||||
@@ -2094,8 +2094,8 @@ void apply_effect(Player *player, s8 arg1, s8 arg2) {
|
||||
if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) {
|
||||
apply_boost_ramp_wood_effect(player);
|
||||
}
|
||||
if ((s32)(player->effects & 0x04000000) == 0x04000000) {
|
||||
func_8008DC08(player, arg1);
|
||||
if ((s32)(player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
apply_hit_effect(player, arg1);
|
||||
}
|
||||
if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) {
|
||||
apply_lightning_effect(player, arg1);
|
||||
@@ -2312,7 +2312,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
|
||||
sp98[2] += (((((f64) ((sp184[2] + spAC) + sp160[2])) - (sp98[2] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / 30.0);
|
||||
}
|
||||
sp98[1] += (((((f64) ((sp184[1] + spB0) + sp160[1])) - (sp98[1] * (0.12 * ((f64) player->kartFriction)))) / 6000.0) / ((f64) player->unk_DAC));
|
||||
if (((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->effects & 0x04000000) == 0x04000000)) || (player->unk_0CA & 1)) {
|
||||
if (((((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) || ((player->effects & HIT_EFFECT) == HIT_EFFECT)) || (player->unk_0CA & 1)) {
|
||||
sp98[0] = 0.0f;
|
||||
sp98[1] = 0.0f;
|
||||
sp98[2] = 0.0f;
|
||||
@@ -2334,7 +2334,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
|
||||
|
||||
if (((((player->unk_0CA & 2) != 2)
|
||||
&& ((player->unk_0CA & 8) != 8))
|
||||
&& ((player->effects & 0x04000000) != 0x04000000))
|
||||
&& ((player->effects & HIT_EFFECT) != HIT_EFFECT))
|
||||
&& (!(player->unk_0CA & 1))) {
|
||||
func_8002AAC0(player);
|
||||
spF8 += player->kartHopVelocity;
|
||||
@@ -4292,7 +4292,7 @@ void func_8003680C(Player *player, s16 arg1) {
|
||||
(player->effects & 0x20000) ||
|
||||
(player->effects & 0x01000000) ||
|
||||
(player->effects & HIT_BY_ITEM_EFFECT) ||
|
||||
(player->effects & 0x04000000))) {
|
||||
(player->effects & HIT_EFFECT))) {
|
||||
if (!(((player->unk_094 / 18.0f) * 216.0f) >= 110.0f)) {
|
||||
player->effects &= ~0x20000000;
|
||||
player->unk_228 = 0;
|
||||
@@ -4638,7 +4638,7 @@ void func_80037CFC(Player *player, struct Controller *controller, s8 arg2) {
|
||||
((player->effects & 0x01000000) != 0x01000000) &&
|
||||
((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT) && ((player->effects & 0x10000) != 0x10000) &&
|
||||
((player->effects & 0x20000) != 0x20000)) {
|
||||
if (((player->effects & 0x04000000) != 0x04000000) &&
|
||||
if (((player->effects & HIT_EFFECT) != HIT_EFFECT) &&
|
||||
((player->effects & 8) != 8) &&
|
||||
((player->effects & 2) != 2) &&
|
||||
((player->effects & 0x10) != 0x10) &&
|
||||
|
||||
+707
-2358
File diff suppressed because it is too large
Load Diff
+54
-48
@@ -4,10 +4,14 @@
|
||||
#include "types.h"
|
||||
#include "actor_types.h"
|
||||
|
||||
#define END_OF_SPAWN_DATA -0x8000
|
||||
|
||||
/** @cond */
|
||||
|
||||
void cleanup_red_and_green_shells(struct ShellActor*);
|
||||
void actor_init(struct Actor*, Vec3f, Vec3s, Vec3f, s16);
|
||||
void func_80297230(Camera*, struct Actor*);
|
||||
void func_802972B8(Camera*, struct Actor*);
|
||||
void actor_not_rendered(Camera*, struct Actor*);
|
||||
void actor_rendered(Camera*, struct Actor*);
|
||||
void func_80297340(Camera*);
|
||||
void func_802976D8(Vec3s);
|
||||
void func_802976EC(Collision*, Vec3s);
|
||||
@@ -18,20 +22,20 @@ void init_red_shell_texture(void);
|
||||
void func_8029794C(Vec3f, Vec3s, f32);
|
||||
void func_802979F8(struct Actor*, f32);
|
||||
void render_actor_cow(Camera*, Mat4, struct Actor*);
|
||||
void update_actor_yoshi_valley_egg(struct YoshiValleyEgg*);
|
||||
void update_actor_trees_cacti_shrubs(struct Actor*);
|
||||
void update_actor_yoshi_egg(struct YoshiValleyEgg*);
|
||||
void update_actor_static_plant(struct Actor*);
|
||||
void update_actor_kiwano_fruit(struct KiwanoFruit*);
|
||||
void update_actor_paddle_boat(struct PaddleWheelBoat*);
|
||||
void update_actor_train_engine(struct TrainCar*);
|
||||
void update_actor_train_car1(struct TrainCar*);
|
||||
void update_actor_train_car2(struct TrainCar*);
|
||||
void update_actor_train_tender(struct TrainCar*);
|
||||
void update_actor_train_passenger_car(struct TrainCar*);
|
||||
void update_actor_piranha_plant(struct PiranhaPlant*);
|
||||
void render_actor_piranha_plant(Camera*, Mat4, struct PiranhaPlant*);
|
||||
void func_802986B4(Camera*, Mat4, struct Actor*);
|
||||
void func_80298AC0(Player*);
|
||||
void func_80298C94(void);
|
||||
void render_cows(Camera*, Mat4, struct Actor*);
|
||||
void evaluate_collision_player_palm_trees(Player*);
|
||||
void evaluate_collision_players_palm_trees(void);
|
||||
void func_80298D10(void);
|
||||
void func_80298D7C(Camera*, Mat4, struct Actor*);
|
||||
void render_palm_trees(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_mario_raceway(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_yoshi_valley(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_royal_raceway(Camera*, Mat4, struct Actor*);
|
||||
@@ -43,67 +47,67 @@ void render_actor_tree_frappe_snowland(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_cactus1_kalimari_desert(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_cactus2_kalimari_desert(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_tree_cactus3_kalimari_desert(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_kiwano_fruit_dks_jungle_parkway(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_kiwano_fruit(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_shell(Camera*, Mat4, struct ShellActor*);
|
||||
void render_actor_green_shell(Camera*, Mat4, struct ShellActor*);
|
||||
void render_actor_red_shell(Camera*, Mat4, struct ShellActor*);
|
||||
void render_actor_blue_shell(Camera*, Mat4, struct ShellActor*);
|
||||
void render_actor_banana(Camera*, Mat4, struct BananaActor*);
|
||||
void update_actor_wario_stadium_sign(struct Actor*);
|
||||
void update_actor_wario_sign(struct Actor*);
|
||||
void update_actor_railroad_crossing(struct RailroadCrossing*);
|
||||
void update_actor_mario_raceway_sign(struct Actor*);
|
||||
void update_actor_mario_sign(struct Actor*);
|
||||
void func_8029AC18(Camera*, Mat4, struct Actor*);
|
||||
void render_actor_paddle_boat(Camera*, struct PaddleWheelBoat*, Mat4, u16);
|
||||
void func_8029B06C(Camera*, struct Actor*);
|
||||
void func_8029B2E4(Camera*, struct Actor*);
|
||||
void func_8029B4E0(Camera*, struct Actor*);
|
||||
void func_8029B6EC(Camera*, struct Actor*);
|
||||
void render_actor_box_truck(Camera*, struct Actor*);
|
||||
void render_actor_school_bus(Camera*, struct Actor*);
|
||||
void render_actor_car(Camera*, struct Actor*);
|
||||
void render_actor_tanker_truck(Camera*, struct Actor*);
|
||||
void render_actor_train_engine(Camera*, struct TrainCar*);
|
||||
void render_actor_train_tender(Camera*, struct TrainCar*);
|
||||
void render_actor_passenger_car(Camera*, struct TrainCar*);
|
||||
void render_actor_train_passenger_car(Camera*, struct TrainCar*);
|
||||
void render_actor_falling_rock(Camera*, struct FallingRock*);
|
||||
void place_piranha_plants(struct ActorSpawnData*);
|
||||
void place_palm_trees(struct ActorSpawnData*);
|
||||
void spawn_piranha_plants(struct ActorSpawnData*);
|
||||
void spawn_palm_trees(struct ActorSpawnData*);
|
||||
void func_8029CF0C(struct ActorSpawnData*, struct FallingRock*);
|
||||
void place_falling_rocks(struct ActorSpawnData*);
|
||||
void spawn_falling_rocks(struct ActorSpawnData*);
|
||||
void update_actor_falling_rocks(struct FallingRock*);
|
||||
void spawn_foliage(struct ActorSpawnData*);
|
||||
void place_all_item_boxes(struct ActorSpawnData*);
|
||||
void spawn_all_item_boxes(struct ActorSpawnData*);
|
||||
void init_kiwano_fruit(void);
|
||||
void destroy_all_actors(void);
|
||||
void place_course_actors(void);
|
||||
void func_8029E158(void);
|
||||
void func_8029E7DC(struct Actor*);
|
||||
void spawn_course_actors(void);
|
||||
void init_actors_and_load_textures(void);
|
||||
void play_sound_before_despawn(struct Actor*);
|
||||
void destroy_actor(struct Actor*);
|
||||
s16 func_8029E890(Vec3f, Vec3s, Vec3f, s16);
|
||||
s16 addActorToEmptySlot(Vec3f, Vec3s, Vec3f, s16);
|
||||
s16 func_8029ED38(Vec3f, s16);
|
||||
s32 func_8029EEB8(Player*, Vec3f, f32, f32, f32);
|
||||
s32 func_8029F1F8(Player*, struct Actor*);
|
||||
s32 func_8029F2FC(Player*, struct PiranhaPlant*);
|
||||
s32 func_8029F408(Player*, struct YoshiValleyEgg*);
|
||||
s32 func_8029F69C(Player*, struct Actor*);
|
||||
s32 func_8029FB80(Player*, struct Actor*);
|
||||
s32 func_8029FCA4(struct Actor*, struct Actor*);
|
||||
void func_8029FDC8(struct Actor*);
|
||||
void func_802A00E8(struct Actor*, struct Actor*);
|
||||
void func_802A0350(struct Actor*, struct Actor*);
|
||||
void func_802A0450(Player*, struct Actor*);
|
||||
void evaluate_player_collision(void);
|
||||
void func_802A0E44(void);
|
||||
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*);
|
||||
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*);
|
||||
void evaluate_collision_between_player_actor(Player*, struct Actor*);
|
||||
void evaluate_collision_for_players_and_actors(void);
|
||||
void evaluate_collision_for_destructible_actors(void);
|
||||
void func_802A1064(struct FakeItemBox*);
|
||||
void update_actor_fake_item_box(struct FakeItemBox*);
|
||||
void func_802A14BC(f32, f32, f32);
|
||||
void init_actor_hot_air_balloon_item_box(f32, f32, f32);
|
||||
void update_actor_item_box_hot_air_balloon(struct ItemBox*);
|
||||
void update_actor_item_box(struct ItemBox*);
|
||||
void func_802A171C(Camera*, struct FakeItemBox*);
|
||||
void func_802A1EA0(Camera*, struct ItemBox*);
|
||||
void render_actor_fake_item_box(Camera*, struct FakeItemBox*);
|
||||
void render_actor_item_box(Camera*, struct ItemBox*);
|
||||
void render_actor_wario_sign(Camera*, struct Actor*);
|
||||
void func_802A27A0(Camera*, Mat4, struct YoshiValleyEgg*, u16);
|
||||
void render_actor_yoshi_egg(Camera*, Mat4, struct YoshiValleyEgg*, u16);
|
||||
void render_actor_mario_sign(Camera*, Mat4, struct Actor*);
|
||||
void func_802A2AD0(Camera*, struct RailroadCrossing*);
|
||||
void func_802A2C78(Camera*, Mat4, struct Actor*);
|
||||
void func_802A2F34(struct UnkStruct_800DC5EC*);
|
||||
void render_actor_railroad_crossing(Camera*, struct RailroadCrossing*);
|
||||
void render_actor_palm_tree(Camera*, Mat4, struct PalmTree*);
|
||||
void render_item_boxes(struct UnkStruct_800DC5EC*);
|
||||
void render_course_actors(struct UnkStruct_800DC5EC*);
|
||||
void update_course_actors(void);
|
||||
|
||||
@@ -173,4 +177,6 @@ extern s8 D_800DC628[];
|
||||
extern s8 D_800DC630[];
|
||||
extern s8 D_802B8864[];
|
||||
|
||||
/** @endcond */
|
||||
|
||||
#endif // ACTORS_H
|
||||
|
||||
+21
-831
@@ -32,7 +32,7 @@ void copy_collision(Collision *arg0, Collision *arg1) {
|
||||
vec3f_copy_return(arg1->orientationVector, arg0->orientationVector);
|
||||
}
|
||||
|
||||
void func_802B02B4(struct ShellActor *shell, s32 shellType) {
|
||||
void triple_shell_actor_collide_with_player(struct ShellActor *shell, s32 shellType) {
|
||||
TripleShellParent *parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
|
||||
parent->shellsAvailable--;
|
||||
@@ -95,7 +95,7 @@ void func_802B04E8(UNUSED struct BananaActor *arg0, s16 bananaIndex) {
|
||||
}
|
||||
|
||||
// Handle a banana being ran over while it is still part of a banana bunch
|
||||
void func_802B0570(struct BananaActor *banana) {
|
||||
void destroy_banana_in_banana_bunch(struct BananaActor *banana) {
|
||||
struct BananaBunchParent *temp_v0_2;
|
||||
|
||||
func_802B0464(banana->youngerIndex);
|
||||
@@ -439,9 +439,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
|
||||
func_8000ED80(parent->shellIndices[0]);
|
||||
add_red_shell_in_unexpired_actor_list(parent->shellIndices[0]);
|
||||
} else {
|
||||
func_8000EDC8(parent->shellIndices[0]);
|
||||
add_green_shell_in_unexpired_actor_list(parent->shellIndices[0]);
|
||||
}
|
||||
parent->shellIndices[0] = -1.0f;
|
||||
parent->shellsAvailable -= 1;
|
||||
@@ -464,9 +464,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
|
||||
func_8000ED80(parent->shellIndices[1]);
|
||||
add_red_shell_in_unexpired_actor_list(parent->shellIndices[1]);
|
||||
} else {
|
||||
func_8000EDC8(parent->shellIndices[1]);
|
||||
add_green_shell_in_unexpired_actor_list(parent->shellIndices[1]);
|
||||
}
|
||||
parent->shellIndices[1] = -1.0f;
|
||||
parent->shellsAvailable -= 1;
|
||||
@@ -489,9 +489,9 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (parent->type == ACTOR_TRIPLE_RED_SHELL) {
|
||||
func_8000ED80(parent->shellIndices[2]);
|
||||
add_red_shell_in_unexpired_actor_list(parent->shellIndices[2]);
|
||||
} else {
|
||||
func_8000EDC8(parent->shellIndices[2]);
|
||||
add_green_shell_in_unexpired_actor_list(parent->shellIndices[2]);
|
||||
}
|
||||
parent->shellIndices[2] = -1.0f;
|
||||
parent->shellsAvailable -= 1;
|
||||
@@ -514,7 +514,7 @@ s32 use_banana_bunch_item(Player *player) {
|
||||
struct BananaBunchParent *bananaBunch;
|
||||
|
||||
// this have a animation of spawning so see update_actor_banana_bunch
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ s32 use_triple_shell_item(Player *player, s16 tripleShellType) {
|
||||
TripleShellParent *parent;
|
||||
|
||||
// this have a animation of spawning so see update_actor_triple_shell
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, tripleShellType);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, tripleShellType);
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -562,7 +562,7 @@ s32 init_triple_shell(TripleShellParent *parent, Player *player, s16 shellType,
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, shellType);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, shellType);
|
||||
if (actorIndex < 0) {
|
||||
parent->shellIndices[shellId] = -1.0f;
|
||||
return -1;
|
||||
@@ -613,7 +613,7 @@ s32 use_green_shell_item(Player *player) {
|
||||
startingPos[2] += player->pos[2];
|
||||
|
||||
// spawn the shell
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -652,7 +652,7 @@ s32 use_red_shell_item(Player *player) {
|
||||
startingPos[2] += player->pos[2];
|
||||
|
||||
// spawn the shell
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -676,182 +676,7 @@ void use_blue_shell_item(Player *player) {
|
||||
gActorList[use_red_shell_item(player)].type = ACTOR_BLUE_SPINY_SHELL;
|
||||
}
|
||||
|
||||
void update_actor_banana(struct BananaActor *banana) {
|
||||
UNUSED f32 pad;
|
||||
Player *player;
|
||||
struct BananaActor *elderBanana;
|
||||
struct Controller *controller;
|
||||
Vec3f someOtherVelocity;
|
||||
Vec3f someVelocity;
|
||||
f32 temp_f0;
|
||||
UNUSED f32 var_f8;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad3;
|
||||
UNUSED f32 pad4[2];
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
f32 temp_f14;
|
||||
f32 temp_f16;
|
||||
f32 unkX;
|
||||
f32 unkY;
|
||||
f32 unkZ;
|
||||
|
||||
player = &gPlayers[banana->rot[0]];
|
||||
switch (banana->state) {
|
||||
case HELD_BANANA:
|
||||
temp_f2 = player->pos[0] - banana->pos[0];
|
||||
temp_f14 = player->pos[1] - banana->pos[1];
|
||||
temp_f16 = player->pos[2] - banana->pos[2];
|
||||
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 10.0f;
|
||||
if (temp_f12 == 0.0f) {
|
||||
banana->pos[0] = player->pos[0] + 0.2f;
|
||||
banana->pos[1] = player->pos[1] + 0.2f;
|
||||
banana->pos[2] = player->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f12;
|
||||
temp_f14 /= temp_f12;
|
||||
temp_f16 /= temp_f12;
|
||||
banana->pos[0] = player->pos[0] - temp_f2;
|
||||
banana->pos[1] = player->pos[1] - temp_f14 - 2.0f;
|
||||
banana->pos[2] = player->pos[2] - temp_f16;
|
||||
}
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
if (gDemoMode) {
|
||||
controller = gControllerOne;
|
||||
} else {
|
||||
controller = &gControllers[banana->rot[0]];
|
||||
}
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
banana->state = 1;
|
||||
banana->unk_04 = 0x00B4;
|
||||
player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
|
||||
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
|
||||
pad3 = controller->rawStickY;
|
||||
if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
|
||||
pad3 = pad3 - ((f32) 30);
|
||||
pad3 = (pad3 / 20.0f) + 0.5f;
|
||||
if (player->unk_094 < 2.0f) {
|
||||
temp_f0 = 4.0f;
|
||||
} else {
|
||||
temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
|
||||
}
|
||||
vec3f_set(someVelocity, 0, pad3, temp_f0);
|
||||
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
|
||||
banana->velocity[0] = someVelocity[0];
|
||||
banana->velocity[1] = someVelocity[1];
|
||||
banana->velocity[2] = someVelocity[2];
|
||||
} else {
|
||||
banana->velocity[0] = 0;
|
||||
banana->velocity[1] = 1.5f;
|
||||
banana->velocity[2] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DROPPED_BANANA:
|
||||
if (banana->unk_04 != 0) {
|
||||
banana->unk_04 -= 1;
|
||||
if (banana->unk_04 == 0) {
|
||||
banana->flags &= ~0x1000;
|
||||
}
|
||||
}
|
||||
banana->pos[0] += banana->velocity[0];
|
||||
banana->pos[2] += banana->velocity[2];
|
||||
if (banana->velocity[1] > -1.0f) {
|
||||
banana->velocity[1] -= 0.15f;
|
||||
}
|
||||
banana->pos[1] += banana->velocity[1];
|
||||
if ((banana->pos[2] < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < banana->pos[2]) || (banana->pos[0] < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < banana->pos[0]) || (banana->pos[1] < (f32) D_8015F6EE)) {
|
||||
func_8029FDC8((struct Actor *) banana);
|
||||
} else {
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
banana->unk30.unk34 = 1;
|
||||
if ((banana->unk30.unk34 != 0) && (banana->unk30.unk3C[2] < 0.0f)) {
|
||||
someOtherVelocity[0] = -banana->unk30.orientationVector[0];
|
||||
someOtherVelocity[1] = -banana->unk30.orientationVector[1];
|
||||
someOtherVelocity[2] = -banana->unk30.orientationVector[2];
|
||||
banana->pos[0] += someOtherVelocity[0] * banana->unk30.unk3C[2];
|
||||
banana->pos[1] += someOtherVelocity[1] * banana->unk30.unk3C[2];
|
||||
banana->pos[2] += someOtherVelocity[2] * banana->unk30.unk3C[2];
|
||||
banana->flags &= ~0x1000;
|
||||
banana->state = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FIRST_BANANA_BUNCH_BANANA:
|
||||
someVelocity[0] = 0.0f;
|
||||
someVelocity[1] = 0.0f;
|
||||
someVelocity[2] = -5.0f;
|
||||
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
|
||||
unkX = player->pos[0] + someVelocity[0];
|
||||
unkY = player->pos[1] + someVelocity[1];
|
||||
unkZ = player->pos[2] + someVelocity[2];
|
||||
temp_f2 = unkX - banana->pos[0];
|
||||
temp_f14 = unkY - banana->pos[1];
|
||||
temp_f16 = unkZ - banana->pos[2];
|
||||
temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
|
||||
if (temp_f0 == 0.0f) {
|
||||
banana->pos[0] = player->pos[0] + 0.2f;
|
||||
banana->pos[1] = player->pos[1] + 0.2f;
|
||||
banana->pos[2] = player->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f0;
|
||||
temp_f14 /= temp_f0;
|
||||
temp_f16 /= temp_f0;
|
||||
banana->pos[0] = someVelocity[0] + (unkX - temp_f2);
|
||||
banana->pos[1] = unkY - temp_f14 - 2.0f;
|
||||
banana->pos[2] = unkZ - temp_f16;
|
||||
}
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case BANANA_BUNCH_BANANA:
|
||||
elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
|
||||
temp_f2 = elderBanana->pos[0] - banana->pos[0];
|
||||
temp_f14 = elderBanana->pos[1] - banana->pos[1];
|
||||
temp_f16 = elderBanana->pos[2] - banana->pos[2];
|
||||
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 5.0f;
|
||||
if (temp_f12 == 0.0f) {
|
||||
banana->pos[0] = elderBanana->pos[0] + 0.2f;
|
||||
banana->pos[1] = elderBanana->pos[1] + 0.2f;
|
||||
banana->pos[2] = elderBanana->pos[2] + 0.2f;
|
||||
} else {
|
||||
temp_f2 /= temp_f12;
|
||||
temp_f14 /= temp_f12;
|
||||
temp_f16 /= temp_f12;
|
||||
banana->pos[0] = elderBanana->pos[0] - temp_f2;
|
||||
banana->pos[1] = elderBanana->pos[1] - temp_f14 - 2.0f;
|
||||
banana->pos[2] = elderBanana->pos[2] - temp_f16;
|
||||
}
|
||||
var_f8 = banana->pos[2];
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case DESTROYED_BANANA:
|
||||
banana->velocity[1] -= 0.3f;
|
||||
if (banana->velocity[1] < -5.0f) {
|
||||
banana->velocity[1] = -5.0f;
|
||||
}
|
||||
banana->pos[1] += banana->velocity[1];
|
||||
banana->rot[0] += 0x16C;
|
||||
banana->rot[1] -= 0x5B0;
|
||||
banana->rot[2] += 0x38E;
|
||||
banana->unk_04 -= 1;
|
||||
if (banana->unk_04 == 0) {
|
||||
destroy_actor((struct Actor *) banana);
|
||||
}
|
||||
break;
|
||||
case BANANA_ON_GROUND:
|
||||
banana->flags |= 0xC000;
|
||||
banana->flags &= ~0x1000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#include "actors/banana/update.inc.c"
|
||||
|
||||
// This function could reasonably be called "spawn_bananas_for_banana_bunch" or similar
|
||||
void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 bananaId) {
|
||||
@@ -877,7 +702,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
|
||||
startingRot[0] = 0;
|
||||
startingRot[1] = 0;
|
||||
startingRot[2] = 0;
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
|
||||
if (actorIndex >= 0) {
|
||||
newBanana = (struct BananaActor*)&gActorList[actorIndex];
|
||||
startingPos[0] = player->pos[0];
|
||||
@@ -963,7 +788,7 @@ s32 use_fake_itembox_item(Player *player) {
|
||||
startingRot[2] = 0;
|
||||
|
||||
// spawn the itembox
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -1009,7 +834,7 @@ s32 use_banana_item(Player *player) {
|
||||
startingRot[1] = 0;
|
||||
startingRot[2] = 0;
|
||||
|
||||
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA); // spawn banana
|
||||
actorIndex = add_actor_to_empty_slot(startingPos, startingRot, startingVelocity, ACTOR_BANANA); // spawn banana
|
||||
if (actorIndex < 0) {
|
||||
return actorIndex;
|
||||
}
|
||||
@@ -1099,7 +924,7 @@ void player_use_item(Player *player) {
|
||||
}
|
||||
|
||||
// Check if a player is using an item?
|
||||
void func_802B30EC(void) {
|
||||
void check_player_use_item(void) {
|
||||
Player *player;
|
||||
struct Controller *target;
|
||||
struct Controller *controller;
|
||||
@@ -1107,7 +932,7 @@ void func_802B30EC(void) {
|
||||
|
||||
for (player = &gPlayers[0], loopController = &gControllers[0], target = &gControllers[4]; loopController != target; player++, loopController++) {
|
||||
controller = loopController;
|
||||
if (func_800910E4(player) == 0) {
|
||||
if (prevent_item_use(player) == FALSE) {
|
||||
if((player->type & PLAYER_INVISIBLE_OR_BOMB) != 0){
|
||||
if ((player - gPlayerTwo) == 0) {
|
||||
controller = gControllerSix;
|
||||
@@ -1130,644 +955,9 @@ void func_802B30EC(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void update_actor_green_shell(struct ShellActor *shell) {
|
||||
Player *player;
|
||||
UNUSED f32 pad9;
|
||||
UNUSED f32 padA;
|
||||
Vec3f somePos2;
|
||||
Vec3f somePosVel;
|
||||
f32 var_f2;
|
||||
struct Controller *controller;
|
||||
TripleShellParent *parent;
|
||||
UNUSED f32 pad0;
|
||||
UNUSED f32 pad1;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad3;
|
||||
UNUSED f32 pad4;
|
||||
UNUSED f32 pad5;
|
||||
UNUSED f32 pad6;
|
||||
UNUSED f32 pad7;
|
||||
UNUSED f32 pad8;
|
||||
#include "actors/green_shell/update.inc.c"
|
||||
|
||||
pad0 = shell->pos[0];
|
||||
pad6 = shell->pos[1];
|
||||
pad1 = shell->pos[2];
|
||||
if ((pad1 < D_8015F6F2) || (D_8015F6F0 < pad1) || (pad0 < D_8015F6EA) || (D_8015F6E8 < pad0) || (pad6 < D_8015F6EE)) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
}
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
copy_collision(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad2 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
pad0 = func_802ABE30(shell->pos[0], pad2, shell->pos[2], player->unk_110.unk3A);
|
||||
pad1 = pad2 - pad0;
|
||||
if ((pad1 < 5.0f) && (pad1 > -5.0f)) {
|
||||
shell->pos[1] = shell->boundingBoxSize + pad0;
|
||||
} else {
|
||||
shell->pos[1] = pad2;
|
||||
}
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
controller = &gControllers[shell->playerId];
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
if (controller->rawStickY < -0x2D) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = -var_f2;
|
||||
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
shell->state = 2;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
func_8000EDC8((struct Actor*)shell - gActorList);
|
||||
return;
|
||||
} else {
|
||||
shell->state = 1;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
} else {
|
||||
shell->rotAngle = -0x78E4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0xE38;
|
||||
if (shell->rotAngle < 0) {
|
||||
shell->state = 2;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
func_8000EDC8((struct Actor*)shell - gActorList);
|
||||
}
|
||||
} else {
|
||||
shell->rotAngle += 0xE38;
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->state = 2;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
func_8000EDC8((struct Actor*)shell - gActorList);
|
||||
}
|
||||
}
|
||||
if (shell->state == 2) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = var_f2;
|
||||
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
} else {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 6.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 6.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case MOVING_SHELL:
|
||||
if (shell->parentIndex > 0) {
|
||||
shell->parentIndex -= 1;
|
||||
if (shell->parentIndex == 0) {
|
||||
shell->flags &= ~0x1000;
|
||||
}
|
||||
}
|
||||
shell->velocity[1] -= 0.5f;
|
||||
if (shell->velocity[1] < -2.0f) {
|
||||
shell->velocity[1] = -2.0f;
|
||||
}
|
||||
somePos2[0] = shell->pos[0];
|
||||
somePos2[1] = shell->pos[1];
|
||||
somePos2[2] = shell->pos[2];
|
||||
shell->pos[0] += shell->velocity[0];
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
shell->pos[2] += shell->velocity[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
if ((shell->unk30.unk3C[0] < 0.0f) || (shell->unk30.unk3C[1] < 0.0f)) {
|
||||
shell_collision(&shell->unk30, shell->velocity);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
}
|
||||
break;
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_GREEN_SHELL) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
} else {
|
||||
shell->rotAngle += parent->rotVelocity;
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
somePos2[0] = shell->pos[0];
|
||||
somePos2[1] = shell->pos[1];
|
||||
somePos2[2] = shell->pos[2];
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], somePos2[0], somePos2[1], somePos2[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
// Somehow, this fake match affects stack management up in case 2
|
||||
shell->velocity[1] -= (0, 0.3f);
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
shell->velocity[1] = -5.0f;
|
||||
}
|
||||
shell->rotAngle += 0x5B0;
|
||||
shell->someTimer -= 1;
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
if (shell->someTimer == 0) {
|
||||
destroy_actor((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B3B44(struct ShellActor *shell) {
|
||||
u16 currentWaypoint;
|
||||
u16 nextWaypoint;
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 temp_f12_3;
|
||||
f32 temp_f14_2;
|
||||
f32 temp_f16_2;
|
||||
f32 temp_f2;
|
||||
f32 temp_f12;
|
||||
f32 temp_f28;
|
||||
f32 temp_f20;
|
||||
f32 temp_f22;
|
||||
f32 temp_f24;
|
||||
f32 temp_f12_0;
|
||||
f32 temp_f12_1;
|
||||
f32 temp_f12_2;
|
||||
f32 temp_f18_3;
|
||||
f32 temp_f16_3;
|
||||
f32 temp_f26;
|
||||
Vec3f origPos;
|
||||
|
||||
currentWaypoint = shell->pathIndex;
|
||||
temp_f2 = D_80164490[currentWaypoint].posX;
|
||||
temp_f12 = D_80164490[currentWaypoint].posY;
|
||||
temp_f28 = D_80164490[currentWaypoint].posZ;
|
||||
nextWaypoint = currentWaypoint + 1;
|
||||
|
||||
if (nextWaypoint >= D_80164430) {
|
||||
nextWaypoint -= D_80164430;
|
||||
}
|
||||
|
||||
temp_f20 = temp_f2 - shell->pos[0];
|
||||
temp_f22 = temp_f12 - shell->pos[1];
|
||||
temp_f24 = temp_f28 - shell->pos[2];
|
||||
temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
|
||||
if (temp_f0 > 400.0f) {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
temp_f12_0 = temp_f18_3 - shell->pos[0];
|
||||
temp_f12_1 = temp_f16_3 - shell->pos[1];
|
||||
temp_f12_2 = temp_f26 - shell->pos[2];
|
||||
|
||||
temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
|
||||
if (temp_f0_3 < temp_f0) {
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f0_2 = sqrtf(temp_f0) * 4.0f;
|
||||
temp_f20 /= temp_f0_2;
|
||||
temp_f22 /= temp_f0_2;
|
||||
temp_f24 /= temp_f0_2;
|
||||
|
||||
temp_f12_3 = shell->velocity[0];
|
||||
temp_f14_2 = shell->velocity[1];
|
||||
temp_f16_2 = shell->velocity[2];
|
||||
|
||||
temp_f12_3 += temp_f20;
|
||||
temp_f14_2 += temp_f22;
|
||||
temp_f16_2 += temp_f24;
|
||||
temp_f0 = sqrtf((temp_f12_3 * temp_f12_3) + (temp_f14_2 * temp_f14_2) + (temp_f16_2 * temp_f16_2));
|
||||
if (temp_f0 > 6.0f) {
|
||||
temp_f0 /= 6.0f;
|
||||
temp_f12_3 /= temp_f0;
|
||||
temp_f14_2 /= temp_f0;
|
||||
temp_f16_2 /= temp_f0;
|
||||
}
|
||||
shell->velocity[0] = temp_f12_3;
|
||||
shell->velocity[1] = temp_f14_2;
|
||||
shell->velocity[2] = temp_f16_2;
|
||||
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
|
||||
shell->pos[0] += temp_f12_3;
|
||||
shell->pos[1] += temp_f14_2;
|
||||
shell->pos[2] += temp_f16_2;
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
} else {
|
||||
if (temp_f0 > 5.0f) {
|
||||
shell->pos[0] = temp_f2;
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f12;
|
||||
shell->pos[2] = temp_f28;
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
|
||||
shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
|
||||
shell->pos[2] = (temp_f28 + temp_f26) * 0.5f;
|
||||
|
||||
shell->velocity[0] = (temp_f18_3 - temp_f2) * 0.5f;
|
||||
shell->velocity[1] = (temp_f16_3 - temp_f12) * 0.5f;
|
||||
shell->velocity[2] = (temp_f26 - temp_f28) * 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B3E7C(struct ShellActor *shell, Player *player) {
|
||||
f32 x_velocity;
|
||||
f32 z_velocity;
|
||||
f32 xz_dist;
|
||||
Vec3f newPosition;
|
||||
|
||||
x_velocity = player->pos[0];
|
||||
x_velocity -= shell->pos[0];
|
||||
z_velocity = player->pos[2];
|
||||
z_velocity -= shell->pos[2];
|
||||
xz_dist = sqrtf((x_velocity * x_velocity) + (z_velocity * z_velocity)) / 8;
|
||||
if (xz_dist == 0.0f) {
|
||||
x_velocity = 0.0f;
|
||||
z_velocity = 0.0f;
|
||||
} else {
|
||||
x_velocity /= xz_dist;
|
||||
z_velocity /= xz_dist;
|
||||
}
|
||||
|
||||
newPosition[0] = shell->pos[0];
|
||||
newPosition[1] = shell->pos[1];
|
||||
newPosition[2] = shell->pos[2];
|
||||
shell->pos[0] += x_velocity;
|
||||
shell->pos[1] -= 2.0f;
|
||||
shell->pos[2] += z_velocity;
|
||||
shell->velocity[0] = x_velocity;
|
||||
shell->velocity[1] = -2.0f;
|
||||
shell->velocity[2] = z_velocity;
|
||||
|
||||
if (player->effects & BOO_EFFECT) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
} else {
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], newPosition[0], newPosition[1], newPosition[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
func_802B4104(shell);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only used in Battle mode
|
||||
* Likely trying to find the nearest player that is not the shell's owner and is not dead
|
||||
**/
|
||||
s16 func_802B3FD0(Player *owner, struct ShellActor *shell) {
|
||||
Player *player;
|
||||
s32 playerIndex;
|
||||
f32 playerToShellDistance;
|
||||
s16 playerId = -1;
|
||||
f32 smallestDistance = 25000000.0f;
|
||||
|
||||
for (playerIndex = 0; playerIndex < 4; playerIndex++) {
|
||||
player = &gPlayers[playerIndex];
|
||||
if ((player->type & PLAYER_EXISTS) == 0) {continue;}
|
||||
if (player == owner) {continue; }
|
||||
if (gPlayerBalloonCount[playerIndex] < 0) { continue; }
|
||||
// func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the positions
|
||||
playerToShellDistance = func_802B51E8(player->pos, shell->pos);
|
||||
if (playerToShellDistance < smallestDistance) {
|
||||
smallestDistance = playerToShellDistance;
|
||||
playerId = player - gPlayerOne;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return playerId;
|
||||
}
|
||||
|
||||
void func_802B4104(struct ShellActor *shell) {
|
||||
if ((shell->unk30.unk3C[0] < 0.0f) && ((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
} else if ((shell->unk30.unk3C[1] < 0.0f) && ((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
|
||||
shell->flags |= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
UNUSED f32 pad9;
|
||||
Player *player;
|
||||
f32 temp_f0;
|
||||
UNUSED f32 temp_f14;
|
||||
f32 temp_f2;
|
||||
s16 temp_v0;
|
||||
UNUSED s16 pad3;
|
||||
Vec3f somePosVel;
|
||||
struct Controller *controller;
|
||||
TripleShellParent *parent;
|
||||
UNUSED f32 pad0;
|
||||
UNUSED f32 pad1;
|
||||
UNUSED f32 pad2;
|
||||
UNUSED f32 pad4;
|
||||
UNUSED f32 pad5;
|
||||
UNUSED f32 pad6;
|
||||
UNUSED f32 pad7;
|
||||
UNUSED f32 pad8;
|
||||
UNUSED f32 pad10;
|
||||
UNUSED f32 pad11;
|
||||
UNUSED f32 pad12;
|
||||
UNUSED s16 pad13;
|
||||
UNUSED s16 pad13_2;
|
||||
UNUSED f32 pad14;
|
||||
UNUSED f32 pad15;
|
||||
UNUSED f32 pad16;
|
||||
UNUSED f32 pad17;
|
||||
Vec3f origPos;
|
||||
|
||||
pad1 = shell->pos[0];
|
||||
pad0 = shell->pos[2];
|
||||
pad2 = shell->pos[1];
|
||||
pad13 = shell->type;
|
||||
if ((pad0 < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < pad0) || (pad1 < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < pad1) || (pad2 < (f32) D_8015F6EE)) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
}
|
||||
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
copy_collision(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad7 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
temp_f0 = func_802ABE30(shell->pos[0], pad7, shell->pos[2], player->unk_110.unk3A);
|
||||
temp_f2 = pad7 - temp_f0;
|
||||
|
||||
if ((temp_f2 < 5.0f) && (temp_f2 > -5.0f)) {
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f0;
|
||||
} else {
|
||||
shell->pos[1] = pad7;
|
||||
}
|
||||
|
||||
if ((player->type & PLAYER_HUMAN) != 0) {
|
||||
if (gDemoMode) {
|
||||
controller = gControllerOne;
|
||||
} else {
|
||||
controller = &gControllers[shell->playerId];
|
||||
}
|
||||
} else {
|
||||
controller = gControllerOne;
|
||||
}
|
||||
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
shell->state = RELEASED_SHELL;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
} else {
|
||||
shell->rotAngle = -0x78E4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0x71C;
|
||||
if (shell->rotAngle < 0) {
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
func_8000ED80((struct Actor*)shell - gActorList);
|
||||
} else {
|
||||
func_8000EE10((struct Actor*)shell - gActorList);
|
||||
func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
shell->rotAngle += 0x71C;
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04));
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00));
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
func_8000ED80((struct Actor*)shell - gActorList);
|
||||
} else {
|
||||
func_8000EE10((struct Actor*)shell - gActorList);
|
||||
func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shell->state == MOVING_SHELL) {
|
||||
shell->someTimer = 0x001E;
|
||||
temp_f0 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
temp_f0 = player->unk_094 * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
somePosVel[2] = temp_f0;
|
||||
func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
|
||||
shell->velocity[0] = somePosVel[0];
|
||||
shell->velocity[1] = somePosVel[1];
|
||||
shell->velocity[2] = somePosVel[2];
|
||||
} else {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case MOVING_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
shell->someTimer -= 1;
|
||||
if (shell->someTimer == 0) {
|
||||
shell->flags &= 0xEFFF;
|
||||
if (shell->type == ACTOR_BLUE_SPINY_SHELL) {
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
shell->state = BLUE_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (gModeSelection == BATTLE) {
|
||||
shell->shellId = 1000.0f;
|
||||
shell->targetPlayer = func_802B3FD0(player, shell);
|
||||
if (shell->targetPlayer < 0) {
|
||||
shell->flags = 0x8000;
|
||||
shell->velocity[1] = 3.0f;
|
||||
shell->pathIndex = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
} else {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
} else {
|
||||
if (player->currentRank == 0) {
|
||||
shell->state = TRIPLE_GREEN_SHELL;
|
||||
shell->someTimer = 0x0258;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (player->currentRank >= 5) {
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
} else {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
shell->velocity[1] -= 0.5;
|
||||
if (shell->velocity[1] < -2.0f) {
|
||||
shell->velocity[1] = -2.0f;
|
||||
}
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
shell->pos[0] += shell->velocity[0];
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
shell->pos[2] += shell->velocity[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
func_802B4104(shell);
|
||||
break;
|
||||
case RED_SHELL_LOCK_ON:
|
||||
func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
|
||||
break;
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
func_802B3B44(shell);
|
||||
if (shell->someTimer == 0) {
|
||||
if ((shell->flags & 0xF) == 0) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
} else {
|
||||
shell->someTimer -= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
func_802B3B44(shell);
|
||||
player = &gPlayers[shell->targetPlayer];
|
||||
temp_f0 = player->pos[0];
|
||||
temp_f0 -= shell->pos[0];
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
break;
|
||||
case TRIPLE_RED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_RED_SHELL) {
|
||||
func_8029FDC8((struct Actor *) shell);
|
||||
} else {
|
||||
shell->rotAngle += parent->rotVelocity;
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], origPos[0], origPos[1], origPos[2]);
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case DESTROYED_SHELL:
|
||||
shell->velocity[1] -= 0.3f;
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
shell->velocity[1] = -5.0f;
|
||||
}
|
||||
shell->rotAngle += 0x5B0;
|
||||
shell->someTimer -= 1;
|
||||
shell->pos[1] += shell->velocity[1];
|
||||
if (shell->someTimer == 0) {
|
||||
destroy_actor((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
func_802B3B44(shell);
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
player = &gPlayers[gPlayerPositionLUT[0]];
|
||||
temp_f0 = player->pos[0];
|
||||
temp_f0 -= shell->pos[0];
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = BLUE_SHELL_TARGET_ELIMINATED;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#include "actors/blue_and_red_shells/update.inc.c"
|
||||
|
||||
void func_802B4E30(struct Actor *arg0) {
|
||||
if ((arg0->unk30.unk3C[2] < 0.0f) && (arg0->unk30.unk34 == 1)) {
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
#include "common_structs.h"
|
||||
#include "actor_types.h"
|
||||
|
||||
/** @cond */
|
||||
|
||||
void copy_collision(Collision*, Collision*);
|
||||
void func_802B02B4(struct ShellActor*, s32);
|
||||
void triple_shell_actor_collide_with_player(struct ShellActor*, s32);
|
||||
void func_802B039C(struct BananaActor*);
|
||||
void func_802B0464(s16);
|
||||
void func_802B04E8(struct BananaActor*, s16);
|
||||
void func_802B0570(struct BananaActor*);
|
||||
void destroy_banana_in_banana_bunch(struct BananaActor*);
|
||||
void func_802B0648(struct BananaBunchParent*);
|
||||
void func_802B0788(s16, struct BananaBunchParent*, Player*);
|
||||
s32 func_802B09C0(s16);
|
||||
@@ -28,7 +30,7 @@ s32 use_fake_itembox_item(Player*);
|
||||
s32 use_banana_item(Player*);
|
||||
void use_thunder_item(Player*);
|
||||
void player_use_item(Player*);
|
||||
void func_802B30EC(void);
|
||||
void check_player_use_item(void);
|
||||
void update_actor_green_shell(struct ShellActor*);
|
||||
void func_802B3B44(struct ShellActor*);
|
||||
void func_802B3E7C(struct ShellActor*, Player*);
|
||||
@@ -44,4 +46,6 @@ extern f32 D_802B9F68;
|
||||
|
||||
extern s16 gPlayerBalloonCount[];
|
||||
|
||||
/** @endcond */
|
||||
|
||||
#endif // ACTORS_EXTENDED_H
|
||||
|
||||
+77
-111
@@ -77,7 +77,7 @@ f32 func_802AAB4C(Player *player) {
|
||||
return 0.8f;
|
||||
case COURSE_SHERBET_LAND:
|
||||
if ((get_surface_type(player->unk_110.unk3A) & 0xFF) == SNOW) {
|
||||
return (f32) (D_8015F6EE - 0xA);
|
||||
return (f32) (gCourseMinY - 0xA);
|
||||
}
|
||||
return D_8015F8E4;
|
||||
case COURSE_DK_JUNGLE:
|
||||
@@ -691,10 +691,10 @@ s32 func_802AC22C(KartBoundingBoxCorner *arg0) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
temp1 = D_8015F6E8 - D_8015F6EA;
|
||||
temp2 = D_8015F6F0 - D_8015F6F2;
|
||||
temp_f4 = (temp_f22 - D_8015F6EA) / (temp1 / 32);
|
||||
temp_f6 = (temp_f26 - D_8015F6F2) / (temp2 / 32);
|
||||
temp1 = gCourseMaxX - gCourseMinX;
|
||||
temp2 = gCourseMaxZ - gCourseMinZ;
|
||||
temp_f4 = (temp_f22 - gCourseMinX) / (temp1 / 32);
|
||||
temp_f6 = (temp_f26 - gCourseMinZ) / (temp2 / 32);
|
||||
if (temp_f4 < 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1279,14 +1279,14 @@ u16 func_802AD950(Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32
|
||||
}
|
||||
|
||||
|
||||
temp_v0_4 = (s32) D_8015F6E8 - D_8015F6EA;
|
||||
temp_v1 = (s32) D_8015F6F0 - D_8015F6F2;
|
||||
temp_v0_4 = (s32) gCourseMaxX - gCourseMinX;
|
||||
temp_v1 = (s32) gCourseMaxZ - gCourseMinZ;
|
||||
|
||||
temp1 = temp_v0_4 / 32;
|
||||
temp2 = temp_v1 / 32;
|
||||
|
||||
temp_f10 = (x1 - D_8015F6EA) / temp1;
|
||||
temp_f16 = (z1 - D_8015F6F2) / temp2;
|
||||
temp_f10 = (x1 - gCourseMinX) / temp1;
|
||||
temp_f16 = (z1 - gCourseMinZ) / temp2;
|
||||
|
||||
if (temp_f10 < 0) {
|
||||
return 0;
|
||||
@@ -1387,14 +1387,14 @@ u16 func_802ADDC8(Collision* collision, f32 boundingBoxSize, f32 posX, f32 posY,
|
||||
return var_s4;
|
||||
}
|
||||
|
||||
temp_f4 = (s32) D_8015F6E8 - D_8015F6EA;
|
||||
temp_f6 = (s32) D_8015F6F0 - D_8015F6F2;
|
||||
temp_f4 = (s32) gCourseMaxX - gCourseMinX;
|
||||
temp_f6 = (s32) gCourseMaxZ - gCourseMinZ;
|
||||
|
||||
temp1 = temp_f4 / 32;
|
||||
temp2 = temp_f6 / 32;
|
||||
|
||||
temp_f10 = (posX - D_8015F6EA) / temp1;
|
||||
temp_f16 = (posZ - D_8015F6F2) / temp2;
|
||||
temp_f10 = (posX - gCourseMinX) / temp1;
|
||||
temp_f16 = (posZ - gCourseMinZ) / temp2;
|
||||
|
||||
|
||||
if (temp_f10 < 0) {
|
||||
@@ -1471,13 +1471,13 @@ f32 func_802AE1C0(f32 posX, f32 posY, f32 posZ) {
|
||||
s32 c;
|
||||
s32 d;
|
||||
|
||||
a = (D_8015F6E8 - D_8015F6EA);
|
||||
b = (D_8015F6F0 - D_8015F6F2);
|
||||
a = (gCourseMaxX - gCourseMinX);
|
||||
b = (gCourseMaxZ - gCourseMinZ);
|
||||
c = a / 32;
|
||||
d = b / 32;
|
||||
|
||||
temp_f4 = (s16) ((posX - D_8015F6EA) / c);
|
||||
temp_f6 = (s16) ((posZ - D_8015F6F2) / d);
|
||||
temp_f4 = (s16) ((posX - gCourseMinX) / c);
|
||||
temp_f6 = (s16) ((posZ - gCourseMinZ) / d);
|
||||
temp_f66 = temp_f4 + (temp_f6 * 32);
|
||||
iter = D_8014F110[temp_f66].unk2;
|
||||
|
||||
@@ -1514,6 +1514,28 @@ f32 func_802AE1C0(f32 posX, f32 posY, f32 posZ) {
|
||||
return phi_f20;
|
||||
}
|
||||
|
||||
#define MAX3(a,b,c, out) if (a >= b) {\
|
||||
if (a >= c) {\
|
||||
out = a;\
|
||||
} else\
|
||||
out = c;\
|
||||
\
|
||||
} else if (b >= c) {\
|
||||
out = b;\
|
||||
} else\
|
||||
out = c; \
|
||||
|
||||
#define MIN3(a,b,c, out) if (a <= b) {\
|
||||
if (a <= c) {\
|
||||
out = a;\
|
||||
} else\
|
||||
out = c;\
|
||||
\
|
||||
} else if (b <= c) {\
|
||||
out = b;\
|
||||
} else\
|
||||
out = c;\
|
||||
|
||||
void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionId) {
|
||||
mk64_surface_map_ram *tile = &gSurfaceMap[D_8015F588];
|
||||
s16 x2;
|
||||
@@ -1545,12 +1567,12 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
|
||||
f32 normalZ;
|
||||
f32 distance;
|
||||
|
||||
s16 sp4A;
|
||||
s16 sp48;
|
||||
s16 sp46;
|
||||
s16 sp44;
|
||||
s16 sp42;
|
||||
s16 sp40;
|
||||
s16 maxX;
|
||||
s16 maxZ;
|
||||
s16 minY;
|
||||
s16 minX;
|
||||
s16 maxY;
|
||||
s16 minZ;
|
||||
|
||||
tile->vtxPoly1 = vtx1;
|
||||
tile->vtxPoly2 = vtx2;
|
||||
@@ -1585,73 +1607,17 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
|
||||
y3 = tile->vtxPoly2->v.ob[1];
|
||||
z3 = tile->vtxPoly2->v.ob[2];
|
||||
}
|
||||
if (x1 >= x2) {
|
||||
if (x1 >= x3) {
|
||||
sp4A = x1;
|
||||
} else
|
||||
sp4A = x3;
|
||||
MAX3(x1, x2, x3, maxX)
|
||||
|
||||
} else if (x2 >= x3) {
|
||||
sp4A = x2;
|
||||
} else
|
||||
sp4A = x3;
|
||||
MAX3(z1, z2, z3, maxZ)
|
||||
|
||||
if (z1 >= z2) {
|
||||
MAX3(y1, y2, y3, maxY)
|
||||
|
||||
if (z1 >= z3) {
|
||||
sp48 = z1;
|
||||
} else
|
||||
sp48 = z3;
|
||||
MIN3(x1, x2, x3, minX)
|
||||
|
||||
} else if (z2 >= z3) {
|
||||
sp48 = z2;
|
||||
} else
|
||||
sp48 = z3;
|
||||
MIN3(y1, y2, y3, minY)
|
||||
|
||||
if (y1 >= y2) {
|
||||
|
||||
if (y1 >= y3) {
|
||||
sp42 = y1;
|
||||
} else
|
||||
sp42 = y3;
|
||||
|
||||
} else if (y2 >= y3) {
|
||||
sp42 = y2;
|
||||
} else
|
||||
sp42 = y3;
|
||||
|
||||
if (x1 <= x2) {
|
||||
if (x1 <= x3) {
|
||||
sp44 = x1;
|
||||
} else
|
||||
sp44 = x3;
|
||||
|
||||
} else if (x2 <= x3) {
|
||||
sp44 = x2;
|
||||
} else
|
||||
sp44 = x3;
|
||||
|
||||
if (y1 <= y2) {
|
||||
if (y1 <= y3) {
|
||||
sp46 = y1;
|
||||
} else
|
||||
sp46 = y3;
|
||||
|
||||
} else if (y2 <= y3) {
|
||||
sp46 = y2;
|
||||
} else
|
||||
sp46 = y3;
|
||||
|
||||
if (z1 <= z2) {
|
||||
if (z1 <= z3) {
|
||||
sp40 = z1;
|
||||
} else
|
||||
sp40 = z3;
|
||||
|
||||
} else if (z2 <= z3) {
|
||||
sp40 = z2;
|
||||
} else
|
||||
sp40 = z3;
|
||||
MIN3(z1, z2, z3, minZ)
|
||||
|
||||
crossProductX = (((y2 - y1) * (z3 - z2)) - ((z2 - z1) * (y3 - y2)));
|
||||
crossProductY = (((z2 - z1) * (x3 - x2)) - ((x2 - x1) * (z3 - z2)));
|
||||
@@ -1689,30 +1655,30 @@ void func_802AE434(Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionI
|
||||
}
|
||||
}
|
||||
|
||||
tile->vtx21 = sp4A;
|
||||
tile->vtx23 = sp48;
|
||||
tile->vtx31 = sp44;
|
||||
tile->vtx33 = sp40;
|
||||
tile->vtx32 = sp46;
|
||||
tile->vtx22 = sp42;
|
||||
tile->vtx21 = maxX;
|
||||
tile->vtx23 = maxZ;
|
||||
tile->vtx31 = minX;
|
||||
tile->vtx33 = minZ;
|
||||
tile->vtx32 = minY;
|
||||
tile->vtx22 = maxY;
|
||||
|
||||
if (sp44 < D_8015F6EA) {
|
||||
D_8015F6EA = sp44;
|
||||
if (minX < gCourseMinX) {
|
||||
gCourseMinX = minX;
|
||||
}
|
||||
if (sp46 < D_8015F6EE) {
|
||||
D_8015F6EE = sp46;
|
||||
if (minY < gCourseMinY) {
|
||||
gCourseMinY = minY;
|
||||
}
|
||||
if (sp40 < D_8015F6F2) {
|
||||
D_8015F6F2 = sp40;
|
||||
if (minZ < gCourseMinZ) {
|
||||
gCourseMinZ = minZ;
|
||||
}
|
||||
if (sp4A > D_8015F6E8) {
|
||||
D_8015F6E8 = sp4A;
|
||||
if (maxX > gCourseMaxX) {
|
||||
gCourseMaxX = maxX;
|
||||
}
|
||||
if (sp42 > D_8015F6EC) {
|
||||
D_8015F6EC = sp42;
|
||||
if (maxY > gCourseMaxY) {
|
||||
gCourseMaxY = maxY;
|
||||
}
|
||||
if (sp48 > D_8015F6F0) {
|
||||
D_8015F6F0 = sp48;
|
||||
if (maxZ > gCourseMaxZ) {
|
||||
gCourseMaxZ = maxZ;
|
||||
}
|
||||
|
||||
tile->height = normalX;
|
||||
@@ -1953,8 +1919,8 @@ void func_802AF314(void) {
|
||||
s32 temp1;
|
||||
s32 temp2;
|
||||
s32 index;
|
||||
temp1 = (s32) D_8015F6E8 - D_8015F6EA;
|
||||
temp2 = (s32) D_8015F6F0 - D_8015F6F2;
|
||||
temp1 = (s32) gCourseMaxX - gCourseMinX;
|
||||
temp2 = (s32) gCourseMaxZ - gCourseMinZ;
|
||||
|
||||
temp_s6 = temp1 / 32;
|
||||
temp_fp = temp2 / 32;
|
||||
@@ -1976,8 +1942,8 @@ void func_802AF314(void) {
|
||||
for (k = 0; k < 32; k++) {
|
||||
index = k + j * 32;
|
||||
|
||||
temp_s1 = (D_8015F6EA + (temp_s6 * k)) - 20;
|
||||
temp_s2 = (D_8015F6F2 + (temp_fp * j)) - 20;
|
||||
temp_s1 = (gCourseMinX + (temp_s6 * k)) - 20;
|
||||
temp_s2 = (gCourseMinZ + (temp_fp * j)) - 20;
|
||||
|
||||
temp_a1 = temp_s1 + temp_s6 + 40;
|
||||
temp_a3 = temp_s2 + temp_fp + 40;
|
||||
@@ -2218,14 +2184,14 @@ u16 process_collision(Player *player, KartBoundingBoxCorner *corner, f32 cornerP
|
||||
|
||||
// If the surface flags are not set then try setting them.
|
||||
|
||||
temp_v0_2 = (s32) D_8015F6E8 - D_8015F6EA;
|
||||
temp_v1 = (s32) D_8015F6F0 - D_8015F6F2;
|
||||
temp_v0_2 = (s32) gCourseMaxX - gCourseMinX;
|
||||
temp_v1 = (s32) gCourseMaxZ - gCourseMinZ;
|
||||
|
||||
temp1 = temp_v0_2 / 32;
|
||||
temp2 = temp_v1 / 32;
|
||||
|
||||
temp_f10 = (cornerPos1 - D_8015F6EA) / temp1;
|
||||
temp_f16 = (cornerPos3 - D_8015F6F2) / temp2;
|
||||
temp_f10 = (cornerPos1 - gCourseMinX) / temp1;
|
||||
temp_f16 = (cornerPos3 - gCourseMinZ) / temp2;
|
||||
|
||||
|
||||
if (temp_f10 < 0) { return 0; }
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#include "common_structs.h"
|
||||
|
||||
#define COLLISION 0x1
|
||||
#define NO_COLLISION 0x0
|
||||
|
||||
void nullify_displaylist(uintptr_t);
|
||||
void func_802AAAAC(Collision*);
|
||||
f32 func_802AAB4C(Player*);
|
||||
|
||||
+24
-21
@@ -1383,11 +1383,11 @@ void func_80295BF8(s32 playerIndex) {
|
||||
|
||||
void func_80295C6C(void) {
|
||||
gNextFreeMemoryAddress += ALIGN16(D_8015F588 * sizeof(mk64_surface_map_ram));
|
||||
D_8015F6E8 += 20;
|
||||
D_8015F6F0 += 20;
|
||||
D_8015F6EA += -20;
|
||||
D_8015F6F2 += -20;
|
||||
D_8015F6EE += -20;
|
||||
gCourseMaxX += 20;
|
||||
gCourseMaxZ += 20;
|
||||
gCourseMinX += -20;
|
||||
gCourseMinZ += -20;
|
||||
gCourseMinY += -20;
|
||||
func_802AF314();
|
||||
gNextFreeMemoryAddress += ALIGN16(D_8015F58A * 2);
|
||||
}
|
||||
@@ -1404,12 +1404,15 @@ void func_80295D6C(void) {
|
||||
|
||||
void func_80295D88(void) {
|
||||
gNumActors = 0;
|
||||
D_8015F6EA = 0;
|
||||
D_8015F6EE = 0;
|
||||
D_8015F6F2 = 0;
|
||||
D_8015F6E8 = 0;
|
||||
D_8015F6EC = 0;
|
||||
D_8015F6F0 = 0;
|
||||
|
||||
gCourseMinX = 0;
|
||||
gCourseMinY = 0;
|
||||
gCourseMinZ = 0;
|
||||
|
||||
gCourseMaxX = 0;
|
||||
gCourseMaxY = 0;
|
||||
gCourseMaxZ = 0;
|
||||
|
||||
D_8015F59C = 0;
|
||||
D_8015F5A0 = 0;
|
||||
func_80295D6C();
|
||||
@@ -1431,7 +1434,7 @@ void func_80295D88(void) {
|
||||
}
|
||||
parse_course_displaylists((uintptr_t) d_course_mario_raceway_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_CHOCO_MOUNTAIN:
|
||||
D_800DC5BC = 1;
|
||||
@@ -1485,7 +1488,7 @@ void func_80295D88(void) {
|
||||
func_802B5D64(&d_course_yoshi_valley_lights4, -0x38F0, 0x1C70, 1);
|
||||
parse_course_displaylists((uintptr_t) d_course_yoshi_valley_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_FRAPPE_SNOWLAND:
|
||||
parse_course_displaylists((uintptr_t) d_course_frappe_snowland_addr);
|
||||
@@ -1512,12 +1515,12 @@ void func_80295D88(void) {
|
||||
case COURSE_LUIGI_RACEWAY:
|
||||
parse_course_displaylists((uintptr_t) d_course_luigi_raceway_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_MOO_MOO_FARM:
|
||||
parse_course_displaylists((uintptr_t) d_course_moo_moo_farm_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_TOADS_TURNPIKE:
|
||||
D_801625EC = 43;
|
||||
@@ -1527,12 +1530,12 @@ void func_80295D88(void) {
|
||||
D_802B87B4 = 1000;
|
||||
parse_course_displaylists((uintptr_t) d_course_toads_turnpike_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_KALAMARI_DESERT:
|
||||
parse_course_displaylists((uintptr_t) d_course_kalimari_desert_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_SHERBET_LAND:
|
||||
parse_course_displaylists((uintptr_t) d_course_sherbet_land_addr);
|
||||
@@ -1562,7 +1565,7 @@ void func_80295D88(void) {
|
||||
case COURSE_WARIO_STADIUM:
|
||||
parse_course_displaylists((uintptr_t) d_course_wario_stadium_addr);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
// d_course_wario_stadium_packed_dl_C50
|
||||
find_vtx_and_set_colours((uintptr_t)0x07000C50, 100, 255, 255, 255);
|
||||
// d_course_wario_stadium_packed_dl_BD8
|
||||
@@ -1584,7 +1587,7 @@ void func_80295D88(void) {
|
||||
// d_course_block_fort_packed_dl_15C0
|
||||
set_vertex_data_with_default_section_id((uintptr_t)0x070015C0, 1);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_SKYSCRAPER:
|
||||
// d_course_skyscraper_packed_dl_1110
|
||||
@@ -1599,7 +1602,7 @@ void func_80295D88(void) {
|
||||
// d_course_double_deck_packed_dl_738
|
||||
set_vertex_data_with_default_section_id((uintptr_t)0x07000738, 1);
|
||||
func_80295C6C();
|
||||
D_8015F8E4 = D_8015F6EE - 10.0f;
|
||||
D_8015F8E4 = gCourseMinY - 10.0f;
|
||||
break;
|
||||
case COURSE_DK_JUNGLE:
|
||||
parse_course_displaylists((uintptr_t) d_course_dks_jungle_parkway_addr);
|
||||
@@ -1698,7 +1701,7 @@ void func_802966A0(void) {
|
||||
}
|
||||
// d_course_dks_jungle_parkway_packed_dl_9880
|
||||
find_and_set_tile_size((uintptr_t)0x07009880, 0, D_802B87C4);
|
||||
func_80298C94();
|
||||
evaluate_collision_players_palm_trees();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +814,7 @@ void render_player_one_1p_screen(void) {
|
||||
render_players_on_screen_one();
|
||||
func_8029122C(D_800DC5EC, PLAYER_ONE);
|
||||
func_80021B0C();
|
||||
func_802A2F34(D_800DC5EC);
|
||||
render_item_boxes(D_800DC5EC);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_1P_PLAYER_ONE);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -870,7 +870,7 @@ void render_player_one_2p_screen_vertical(void) {
|
||||
render_players_on_screen_one();
|
||||
func_8029122C(D_800DC5EC, PLAYER_ONE);
|
||||
func_80021B0C();
|
||||
func_802A2F34(D_800DC5EC);
|
||||
render_item_boxes(D_800DC5EC);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_2P_HORIZONTAL_PLAYER_ONE);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -924,7 +924,7 @@ void render_player_two_2p_screen_vertical(void) {
|
||||
render_players_on_screen_two();
|
||||
func_8029122C(D_800DC5F0, PLAYER_TWO);
|
||||
func_80021C78();
|
||||
func_802A2F34(D_800DC5F0);
|
||||
render_item_boxes(D_800DC5F0);
|
||||
func_80058BF4();
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_2P_HORIZONTAL_PLAYER_TWO);
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -982,7 +982,7 @@ void render_player_one_2p_screen_horizontal(void) {
|
||||
render_players_on_screen_one();
|
||||
func_8029122C(D_800DC5EC, PLAYER_ONE);
|
||||
func_80021B0C();
|
||||
func_802A2F34(D_800DC5EC);
|
||||
render_item_boxes(D_800DC5EC);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_2P_VERTICAL_PLAYER_ONE);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -1039,7 +1039,7 @@ void render_player_two_2p_screen_horizontal(void) {
|
||||
render_players_on_screen_two();
|
||||
func_8029122C(D_800DC5F0, PLAYER_TWO);
|
||||
func_80021C78();
|
||||
func_802A2F34(D_800DC5F0);
|
||||
render_item_boxes(D_800DC5F0);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_2P_VERTICAL_PLAYER_TWO);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -1093,7 +1093,7 @@ void render_player_one_3p_4p_screen(void) {
|
||||
render_players_on_screen_one();
|
||||
func_8029122C(D_800DC5EC, PLAYER_ONE);
|
||||
func_80021B0C();
|
||||
func_802A2F34(D_800DC5EC);
|
||||
render_item_boxes(D_800DC5EC);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_ONE);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -1147,7 +1147,7 @@ void render_player_two_3p_4p_screen(void) {
|
||||
render_players_on_screen_two();
|
||||
func_8029122C(D_800DC5F0, PLAYER_TWO);
|
||||
func_80021C78();
|
||||
func_802A2F34(D_800DC5F0);
|
||||
render_item_boxes(D_800DC5F0);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_TWO);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -1202,7 +1202,7 @@ void render_player_three_3p_4p_screen(void) {
|
||||
render_players_on_screen_three();
|
||||
func_8029122C(D_800DC5F4, PLAYER_THREE);
|
||||
func_80021D40();
|
||||
func_802A2F34(D_800DC5F4);
|
||||
render_item_boxes(D_800DC5F4);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_THREE);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
@@ -1265,7 +1265,7 @@ void render_player_four_3p_4p_screen(void) {
|
||||
render_players_on_screen_four();
|
||||
func_8029122C(D_800DC5F8, PLAYER_FOUR);
|
||||
func_80021DA8();
|
||||
func_802A2F34(D_800DC5F8);
|
||||
render_item_boxes(D_800DC5F8);
|
||||
render_player_snow_effect(RENDER_SCREEN_MODE_3P_4P_PLAYER_FOUR);
|
||||
func_80058BF4();
|
||||
if (D_800DC5B8 != 0) {
|
||||
|
||||
+4
-4
@@ -896,8 +896,8 @@ void func_80022A98(Player* player, s8 arg1) {
|
||||
if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
|
||||
func_80026A48(player, arg1);
|
||||
func_800235AC(player, arg1);
|
||||
if (((player->effects & 0x04000000) == 0x04000000) || ((player->effects & 0x08000000) == 0x08000000)) {
|
||||
if ((player->effects & 0x04000000) == 0x04000000) {
|
||||
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x08000000) == 0x08000000)) {
|
||||
if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
func_80022B50(player, arg1);
|
||||
}
|
||||
if ((player->effects & 0x08000000) == 0x08000000) {
|
||||
@@ -1207,7 +1207,7 @@ void func_800235AC(Player *player, s8 arg1) {
|
||||
}
|
||||
|
||||
void func_80023BF0(Player *player, s8 arg1, s8 arg2, s8 arg3) {
|
||||
if (((player->effects & 0x4000000) == 0x4000000) || ((player->effects & 0x8000000) == 0x8000000)) {
|
||||
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x8000000) == 0x8000000)) {
|
||||
func_80022CA8(player, arg1, arg2, arg3);
|
||||
} else {
|
||||
func_80022E84(player, arg1, arg2, arg3);
|
||||
@@ -1374,7 +1374,7 @@ void kart_render(Player *player, s8 playerId, s8 arg2, s8 arg3) {
|
||||
}
|
||||
sp14C[1] = player->unk_048[arg2];
|
||||
sp14C[2] = player->unk_050[arg2];
|
||||
if (((s32)player->effects & 0x04000000) == 0x04000000) {
|
||||
if (((s32)player->effects & HIT_EFFECT) == HIT_EFFECT) {
|
||||
func_80062B18(&sp148, &sp144, &sp140, 0.0f, 8.0f, 0.0f, -player->unk_048[arg2], player->unk_050[arg2]);
|
||||
sp154[1] = (player->pos[1] - player->boundingBoxSize) + player->unk_108;
|
||||
sp154[0] = player->pos[0] + sp148;
|
||||
|
||||
@@ -7442,7 +7442,7 @@ void init_hot_air_balloon(s32 objectIndex) {
|
||||
func_800886F4(objectIndex);
|
||||
func_80086EF0(objectIndex);
|
||||
gObjectList[objectIndex].velocity[1] = -2.0f;
|
||||
func_802A14BC(0.0f, 0.0f, 0.0f);
|
||||
init_actor_hot_air_balloon_item_box(0.0f, 0.0f, 0.0f);
|
||||
func_80072488(objectIndex);
|
||||
}
|
||||
|
||||
|
||||
+267
-267
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user