mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 20:11:51 -04:00
Merge pull request #280 from Cuyler36/f_furniture_work
Implement 10 furniture actors
This commit is contained in:
+12
-10
@@ -7,6 +7,8 @@
|
||||
#include "audio.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "ac_my_room.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_malloc.h"
|
||||
|
||||
static u16 fFTR_myhome_off_pal_table[][16] = {
|
||||
// clang-format off
|
||||
@@ -795,28 +797,28 @@ static Gfx* fFTR_GetTwoTileGfx(int width0, int height0, int scroll_x0, int scrol
|
||||
#include "../src/ftr/ac_yos_luigi.c"
|
||||
#include "../src/ftr/ac_yos_terrace.c"
|
||||
#include "../src/ftr/ac_yos_turkey_mirror.c"
|
||||
// #include "../src/ftr/ac_yos_turkey_watch.c"
|
||||
#include "../src/ftr/ac_yos_turkey_watch.c"
|
||||
#include "../src/ftr/ac_yos_wheel.c"
|
||||
// #include "../src/ftr/ac_tak_ham1.c"
|
||||
// #include "../src/ftr/ac_tak_nes01.c"
|
||||
// #include "../src/ftr/ac_tak_noise.c"
|
||||
#include "../src/ftr/ac_tak_ham1.c"
|
||||
#include "../src/ftr/ac_tak_nes01.c"
|
||||
#include "../src/ftr/ac_tak_noise.c"
|
||||
#include "../src/ftr/ac_tak_stew.c"
|
||||
// #include "../src/ftr/ac_tak_tent.c"
|
||||
#include "../src/ftr/ac_tak_tent.c"
|
||||
#include "../src/ftr/ac_tak_tent_box.c"
|
||||
#include "../src/ftr/ac_tak_tent_lamp.c"
|
||||
// #include "../src/ftr/ac_ike_fish_tro2.c"
|
||||
#include "../src/ftr/ac_ike_fish_tro2.c"
|
||||
#include "../src/ftr/ac_ike_prores_bench01.c"
|
||||
#include "../src/ftr/ac_ike_prores_fense01.c"
|
||||
#include "../src/ftr/ac_ike_prores_ling01.c"
|
||||
#include "../src/ftr/ac_ike_prores_ling02.c"
|
||||
#include "../src/ftr/ac_ike_prores_ling03.c"
|
||||
#include "../src/ftr/ac_ike_prores_mat01.c"
|
||||
// #include "../src/ftr/ac_ike_prores_punch01.c"
|
||||
// #include "../src/ftr/ac_ike_prores_sandbag01.c"
|
||||
#include "../src/ftr/ac_ike_prores_punch01.c"
|
||||
#include "../src/ftr/ac_ike_prores_sandbag01.c"
|
||||
#include "../src/ftr/ac_ike_prores_table01.c"
|
||||
#include "../src/ftr/ac_ike_tent_bike01.c"
|
||||
// #include "../src/ftr/ac_ike_tent_fire01.c"
|
||||
// #include "../src/ftr/ac_ike_tent_fire02.c"
|
||||
#include "../src/ftr/ac_ike_tent_fire01.c"
|
||||
#include "../src/ftr/ac_ike_tent_fire02.c"
|
||||
#include "../src/ftr/ac_ike_tent_kayak01.c"
|
||||
#include "../src/ftr/ac_ike_tent_knap01.c"
|
||||
#include "../src/ftr/ac_ike_tent_sleepbag01.c"
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
static void fIFT2_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern u16 int_yaz_fish_trophy2_pal[];
|
||||
extern Gfx int_yaz_fish_trophy_cup_model[];
|
||||
extern Gfx int_yaz_fish_trophy_base_model[];
|
||||
|
||||
static void fIFT2_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8, int_yaz_fish_trophy2_pal);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_yaz_fish_trophy_cup_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_yaz_fish_trophy_base_model);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fIFT2_func = {
|
||||
NULL,
|
||||
NULL,
|
||||
&fIFT2_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, NULL, &fIFT2_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_ike_fish_tro2 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -26,4 +36,5 @@ aFTR_PROFILE iam_ike_fish_tro2 = {
|
||||
0,
|
||||
0,
|
||||
&fIFT2_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -1,16 +1,65 @@
|
||||
static void fIPPnch_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fIPPnch_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fIPPnch_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_ike_prores_punch01;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_ike_prores_punch01;
|
||||
|
||||
static void fIPPnch_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_ike_prores_punch01, &cKF_ba_r_int_ike_prores_punch01,
|
||||
ftr_actor->joint, ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_stop(keyframe, &cKF_ba_r_int_ike_prores_punch01, NULL);
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.0f;
|
||||
ftr_actor->switch_changed_flag = FALSE;
|
||||
}
|
||||
|
||||
static void fIPPnch_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
if (cKF_SkeletonInfo_R_play(keyframe) != cKF_STATE_STOPPED && keyframe->frame_control.speed != 0.0f) {
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
|
||||
if (ftr_actor->switch_changed_flag) {
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenTrgStart(0x176, &ftr_actor->position);
|
||||
}
|
||||
|
||||
keyframe->frame_control.current_frame = 1.0f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
}
|
||||
} else {
|
||||
if (ftr_actor->switch_changed_flag) {
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenTrgStart(0x176, &ftr_actor->position);
|
||||
}
|
||||
|
||||
keyframe->frame_control.current_frame = 1.0f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
static void fIPPnch_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fIPPnch_func = {
|
||||
&fIPPnch_ct,
|
||||
&fIPPnch_mv,
|
||||
&fIPPnch_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
&fIPPnch_ct, &fIPPnch_mv, &fIPPnch_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_ike_prores_punch01 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -28,4 +77,5 @@ aFTR_PROFILE iam_ike_prores_punch01 = {
|
||||
0,
|
||||
0,
|
||||
&fIPPnch_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -1,16 +1,66 @@
|
||||
static void aIPS_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void aIPS_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void aIPS_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_ike_prores_sandbag01;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_ike_prores_sandbag01;
|
||||
|
||||
static void aIPS_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_ike_prores_sandbag01, &cKF_ba_r_int_ike_prores_sandbag01,
|
||||
ftr_actor->joint, ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_stop(keyframe, &cKF_ba_r_int_ike_prores_sandbag01, NULL);
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.0f;
|
||||
ftr_actor->switch_changed_flag = FALSE;
|
||||
}
|
||||
|
||||
static void aIPS_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
if (cKF_SkeletonInfo_R_play(keyframe) != cKF_STATE_STOPPED && keyframe->frame_control.speed != 0.0f) {
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
|
||||
if (ftr_actor->switch_changed_flag) {
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenTrgStart(0x175, &ftr_actor->position);
|
||||
}
|
||||
|
||||
keyframe->frame_control.current_frame = 1.0f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
}
|
||||
} else {
|
||||
if (ftr_actor->switch_changed_flag) {
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenTrgStart(0x175, &ftr_actor->position);
|
||||
}
|
||||
|
||||
keyframe->frame_control.current_frame = 1.0f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aIPS_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c aIPS_func = {
|
||||
&aIPS_ct,
|
||||
&aIPS_mv,
|
||||
&aIPS_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
&aIPS_ct, &aIPS_mv, &aIPS_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_ike_prores_sandbag01 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -28,4 +78,5 @@ aFTR_PROFILE iam_ike_prores_sandbag01 = {
|
||||
0,
|
||||
0,
|
||||
&aIPS_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -1,16 +1,101 @@
|
||||
static void fITF_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fITF_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fITF_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_ike_tent_fire01;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_ike_tent_fire01;
|
||||
|
||||
static void fITF_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_ike_tent_fire01, &cKF_ba_r_int_ike_tent_fire01, ftr_actor->joint,
|
||||
ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat(keyframe, &cKF_ba_r_int_ike_tent_fire01, NULL);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
}
|
||||
static void fITF_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenPos((u32)ftr_actor, 0x5D, &ftr_actor->position);
|
||||
}
|
||||
}
|
||||
|
||||
extern Gfx int_ike_fire_model[];
|
||||
|
||||
static int fITF_DwAfter(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags,
|
||||
void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
FTR_ACTOR* ftr_actor = (FTR_ACTOR*)arg;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
xyz_t pos;
|
||||
xyz_t zero_pos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if (joint_idx == 2) {
|
||||
f32 scale_x = ftr_actor->scale.x * 0.01f;
|
||||
f32 scale_y = ftr_actor->scale.y * 0.01f;
|
||||
f32 scale_z = ftr_actor->scale.z * 0.01f;
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
Matrix_Position(&zero_pos, &pos);
|
||||
Matrix_push();
|
||||
Matrix_translate(pos.x, pos.y, pos.z, 0);
|
||||
Matrix_mult(&play->billboard_matrix, 1);
|
||||
Matrix_RotateY(DEG2SHORT_ANGLE(90.0f), 1);
|
||||
Matrix_scale(scale_x, scale_y, scale_z, 1);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
Matrix_pull();
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, int_ike_fire_model);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int fITF_DwBefore(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags,
|
||||
void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
FTR_ACTOR* ftr_actor = (FTR_ACTOR*)arg;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (joint_idx == 2) {
|
||||
*joint_shape = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Gfx* fITF_GetTwoTileGfx(int x0, int y0, int x1, int y1, GAME* game) {
|
||||
return two_tex_scroll_dolphin(game->graph, 0, x0, y0, 32, 64, 1, x1, y1, 32, 32);
|
||||
}
|
||||
|
||||
static void fITF_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
u32 ctr_ofs = ftr_actor->ctr_type == aFTR_CTR_TYPE_GAME_PLAY ? play->game_frame : game->frame_counter;
|
||||
Gfx* scroll_gfx = fITF_GetTwoTileGfx(0, -ctr_ofs * 6, 0, 0, game);
|
||||
|
||||
if (scroll_gfx != NULL) {
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_9, scroll_gfx); // fire scroll microcode commands
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, &fITF_DwBefore, &fITF_DwAfter, ftr_actor);
|
||||
}
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fITF_func = {
|
||||
&fITF_ct,
|
||||
&fITF_mv,
|
||||
&fITF_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
&fITF_ct, &fITF_mv, &fITF_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_ike_tent_fire01 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -28,4 +113,5 @@ aFTR_PROFILE iam_ike_tent_fire01 = {
|
||||
0,
|
||||
0,
|
||||
&fITF_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -1,16 +1,102 @@
|
||||
static void fITF02_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fITF02_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fITF02_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_ike_tent_fire02;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_ike_tent_fire02;
|
||||
|
||||
static void fITF02_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_ike_tent_fire02, &cKF_ba_r_int_ike_tent_fire02, ftr_actor->joint,
|
||||
ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat(keyframe, &cKF_ba_r_int_ike_tent_fire02, NULL);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
}
|
||||
|
||||
static void fITF02_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenPos((u32)ftr_actor, 0x5C, &ftr_actor->position);
|
||||
}
|
||||
}
|
||||
|
||||
extern Gfx int_ike_fire1_model[];
|
||||
|
||||
static int fITF02_DwAfter(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags,
|
||||
void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
FTR_ACTOR* ftr_actor = (FTR_ACTOR*)arg;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
xyz_t pos;
|
||||
xyz_t zero_pos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if (joint_idx == 2) {
|
||||
f32 scale_x = ftr_actor->scale.x * 0.01f;
|
||||
f32 scale_y = ftr_actor->scale.y * 0.01f;
|
||||
f32 scale_z = ftr_actor->scale.z * 0.01f;
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
Matrix_Position(&zero_pos, &pos);
|
||||
Matrix_push();
|
||||
Matrix_translate(pos.x, pos.y, pos.z, 0);
|
||||
Matrix_mult(&play->billboard_matrix, 1);
|
||||
Matrix_RotateY(DEG2SHORT_ANGLE(90.0f), 1);
|
||||
Matrix_scale(scale_x, scale_y, scale_z, 1);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
Matrix_pull();
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, int_ike_fire1_model);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int fITF02_DwBefore(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape,
|
||||
u8* joint_flags, void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
FTR_ACTOR* ftr_actor = (FTR_ACTOR*)arg;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (joint_idx == 2) {
|
||||
*joint_shape = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Gfx* fITF02_GetTwoTileGfx(int x0, int y0, int x1, int y1, GAME* game) {
|
||||
return two_tex_scroll_dolphin(game->graph, 0, x0, y0, 32, 64, 1, x1, y1, 64, 32);
|
||||
}
|
||||
|
||||
static void fITF02_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
u32 ctr_ofs = ftr_actor->ctr_type == aFTR_CTR_TYPE_GAME_PLAY ? play->game_frame : game->frame_counter;
|
||||
Gfx* scroll_gfx = fITF02_GetTwoTileGfx(0, -ctr_ofs * 3, -ctr_ofs * 2, 0, game);
|
||||
|
||||
if (scroll_gfx != NULL) {
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_9, scroll_gfx); // fire scroll microcode commands
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, &fITF02_DwBefore, &fITF02_DwAfter, ftr_actor);
|
||||
}
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fITF02_func = {
|
||||
&fITF02_ct,
|
||||
&fITF02_mv,
|
||||
&fITF02_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
&fITF02_ct, &fITF02_mv, &fITF02_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_ike_tent_fire02 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -28,4 +114,5 @@ aFTR_PROFILE iam_ike_tent_fire02 = {
|
||||
0,
|
||||
0,
|
||||
&fITF02_func,
|
||||
// clang-formt on
|
||||
};
|
||||
|
||||
+42
-8
@@ -1,16 +1,49 @@
|
||||
static void fTHM1_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fTHM1_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fTHM1_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_tak_ham1;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_tak_ham1;
|
||||
|
||||
static void fTHM1_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_tak_ham1, &cKF_ba_r_int_tak_ham1, ftr_actor->joint, ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat(keyframe, &cKF_ba_r_int_tak_ham1, NULL);
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
}
|
||||
|
||||
static void fTHM1_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
keyframe->frame_control.speed = 1.0f;
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
sAdo_OngenPos((u32)ftr_actor, 0x56, &ftr_actor->position);
|
||||
}
|
||||
|
||||
extern u8 int_tak_ham1_a1_tex_txt[];
|
||||
extern u8 int_tak_ham1_a2_tex_pic_ci4[];
|
||||
|
||||
static u8* tak_ham1_texture_table[] = { int_tak_ham1_a1_tex_txt, int_tak_ham1_a2_tex_pic_ci4 };
|
||||
|
||||
static void fTHM1_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8,
|
||||
tak_ham1_texture_table[(game->frame_counter / 5) % ARRAY_COUNT(tak_ham1_texture_table)]);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, NULL, NULL, ftr_actor);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fTHM1_func = {
|
||||
&fTHM1_ct,
|
||||
&fTHM1_mv,
|
||||
&fTHM1_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
&fTHM1_ct, &fTHM1_mv, &fTHM1_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_tak_ham1 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -28,4 +61,5 @@ aFTR_PROFILE iam_tak_ham1 = {
|
||||
0,
|
||||
0,
|
||||
&fTHM1_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
+21
-6
@@ -1,14 +1,28 @@
|
||||
static void fTakNes_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
extern Gfx int_tak_nes_af_tex_rgb_ci4[];
|
||||
extern u16 int_tak_nes_af_tex_rgb_ci4_pal[];
|
||||
extern Gfx int_tak_nes01_on_model[];
|
||||
extern Gfx int_tak_nes01_onT_model[];
|
||||
extern Gfx int_tak_nes01_game_on_model[];
|
||||
|
||||
static void fTakNes_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8, int_tak_nes_af_tex_rgb_ci4);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_9, int_tak_nes_af_tex_rgb_ci4_pal);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_nes01_on_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_nes01_onT_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_nes01_game_on_model);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fTakNes_func = {
|
||||
NULL,
|
||||
NULL,
|
||||
&fTakNes_dw,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, NULL, &fTakNes_dw, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_tak_nes01 = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -26,4 +40,5 @@ aFTR_PROFILE iam_tak_nes01 = {
|
||||
0,
|
||||
0,
|
||||
&fTakNes_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
+11
-6
@@ -1,16 +1,20 @@
|
||||
extern Gfx int_tak_noise_on_model[];
|
||||
extern Gfx int_tak_noise_onT_model[];
|
||||
static void fTNM_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
|
||||
static void fTNM_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
if (ftr_actor->switch_changed_flag == TRUE) {
|
||||
sAdo_OngenTrgStart(0x46A, &ftr_actor->position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fTNM_func = {
|
||||
NULL,
|
||||
&fTNM_mv,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, &fTNM_mv, NULL, NULL, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_tak_noise = {
|
||||
// clang-format off
|
||||
int_tak_noise_on_model,
|
||||
int_tak_noise_onT_model,
|
||||
NULL,
|
||||
@@ -28,4 +32,5 @@ aFTR_PROFILE iam_tak_noise = {
|
||||
0,
|
||||
0,
|
||||
&fTNM_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
+40
-9
@@ -1,17 +1,47 @@
|
||||
static void fTTnt_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fTTnt_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fTTnt_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fTTnt_dt(FTR_ACTOR* ftr_actor, u8* data);
|
||||
extern u16 int_tak_tent_off_pal[];
|
||||
extern u16 int_tak_tent_on_pal[];
|
||||
|
||||
static void fTTnt_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
ftr_actor->pal_p = (u16*)zelda_malloc_align(16 * sizeof(u16), 32);
|
||||
fFTR_MorphHousepaletteCt(ftr_actor->pal_p, int_tak_tent_off_pal, int_tak_tent_on_pal, ftr_actor);
|
||||
}
|
||||
|
||||
static void fTTnt_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
fFTR_MorphHousePalette(ftr_actor->pal_p, int_tak_tent_off_pal, int_tak_tent_on_pal, ftr_actor);
|
||||
}
|
||||
|
||||
static void fTTnt_dt(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
if (ftr_actor->pal_p != NULL) {
|
||||
zelda_free(ftr_actor->pal_p);
|
||||
}
|
||||
}
|
||||
|
||||
extern Gfx int_tak_tent_green_on_model[];
|
||||
extern Gfx int_tak_tent_body_onT_model[];
|
||||
extern Gfx int_tak_tent_etc_onT_model[];
|
||||
extern Gfx int_tak_tent_light_offT_model[];
|
||||
|
||||
static void fTTnt_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
u16* pal_p = ftr_actor->pal_p;
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8, pal_p);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_tent_green_on_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_tent_body_onT_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_tent_etc_onT_model);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, int_tak_tent_light_offT_model);
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fTTnt_func = {
|
||||
&fTTnt_ct,
|
||||
&fTTnt_mv,
|
||||
&fTTnt_dw,
|
||||
&fTTnt_dt,
|
||||
NULL,
|
||||
&fTTnt_ct, &fTTnt_mv, &fTTnt_dw, &fTTnt_dt, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_tak_tent = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -29,4 +59,5 @@ aFTR_PROFILE iam_tak_tent = {
|
||||
0,
|
||||
0,
|
||||
&fTTnt_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -1,17 +1,55 @@
|
||||
static void fYTW_ct(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static void fYTW_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fYTW_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data);
|
||||
static void fYTW_dt(FTR_ACTOR* ftr_actor, u8* data);
|
||||
static int fYTW_DwAfter(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags,
|
||||
void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int fYTW_DwBefore(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags,
|
||||
void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
if (joint_idx == 3) {
|
||||
joint_rot->z -= Common_Get(time.rad_hour);
|
||||
} else if (joint_idx == 4) {
|
||||
joint_rot->z -= Common_Get(time.rad_min);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void fYTW_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
Mtx* mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyframe, mtx, &fYTW_DwBefore, &fYTW_DwAfter, ftr_actor);
|
||||
}
|
||||
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_int_yos_turkey_watch;
|
||||
extern cKF_Animation_R_c cKF_ba_r_int_yos_turkey_watch;
|
||||
|
||||
static void fYTW_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(keyframe, &cKF_bs_r_int_yos_turkey_watch, &cKF_ba_r_int_yos_turkey_watch, ftr_actor->joint,
|
||||
ftr_actor->morph);
|
||||
cKF_SkeletonInfo_R_init_standard_repeat(keyframe, &cKF_ba_r_int_yos_turkey_watch, NULL);
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
keyframe->frame_control.speed = 0.5f;
|
||||
}
|
||||
|
||||
static void fYTW_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyframe = &ftr_actor->keyframe;
|
||||
|
||||
cKF_SkeletonInfo_R_play(keyframe);
|
||||
}
|
||||
|
||||
static void fYTW_dt(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
static aFTR_vtable_c fYTW_func = {
|
||||
&fYTW_ct,
|
||||
&fYTW_mv,
|
||||
&fYTW_dw,
|
||||
&fYTW_dt,
|
||||
NULL,
|
||||
&fYTW_ct, &fYTW_mv, &fYTW_dw, &fYTW_dt, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_yos_turkey_watch = {
|
||||
// clang-format off
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -29,4 +67,5 @@ aFTR_PROFILE iam_yos_turkey_watch = {
|
||||
0,
|
||||
0,
|
||||
&fYTW_func,
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user