Skip to content

Commit

Permalink
Implement & link ef_douzou_light
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuyler36 committed Aug 6, 2024
1 parent b1521b5 commit 5c45af9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config/rel_slices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,10 @@ ef_dig_scoop.c:
.text: [0x80609F6C, 0x8060A808]
.rodata: [0x8064BF70, 0x8064BF90]
.data: [0x806D2268, 0x806D2280]
ef_douzou_light.c:
.text: [0x8060A808, 0x8060AAD4]
.rodata: [0x8064BF90, 0x8064BFA8]
.data: [0x806D2280, 0x806D2298]
ef_flash.c:
.text: [0x8060B7B4, 0x8060BCB0]
.rodata: [0x8064C078, 0x8064C0B0]
Expand Down
56 changes: 52 additions & 4 deletions src/ef_douzou_light.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "ef_effect_control.h"

#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"

static void eDouzou_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDouzou_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDouzou_Light_mv(eEC_Effect_c* effect, GAME* game);
Expand All @@ -18,17 +22,61 @@ eEC_PROFILE_c iam_ef_douzou_light = {
};

static void eDouzou_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
eEC_CLIP->make_effect_proc(eEC_EFFECT_DOUZOU_LIGHT, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}

static void eDouzou_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
switch (effect->arg0) {
case 0:
effect->offset.x = 0.012f;
break;
case 1:
effect->offset.x = 0.011f;
break;
case 2:
effect->offset.x = 0.010f;
break;
default:
effect->offset.x = 0.009f;
break;
}

effect->timer = 24;
}

static void eDouzou_Light_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
if (effect->timer > 12) {
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 12, 24, effect->offset.x, 0.0f);
} else {
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 12, 0.0f, effect->offset.x);
}

effect->scale.y = effect->scale.z = effect->scale.x;
}

extern Gfx ef_carhosi01_00_modelT[];

static void eDouzou_Light_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
OPEN_DISP(game->graph);

eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);

switch (effect->arg0) {
case 0:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 255, 0, 255);
break;
case 1:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 200, 255, 255, 255);
break;
case 2:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 100, 100, 255);
break;
default:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 100, 255, 100, 255);
break;
}

gSPDisplayList(NEXT_POLY_XLU_DISP, ef_carhosi01_00_modelT);

CLOSE_DISP(game->graph);
}

0 comments on commit 5c45af9

Please sign in to comment.