mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
link ac_fallSESW.c
This commit is contained in:
@@ -693,6 +693,10 @@ ac_fallS.c:
|
||||
.text: [0x805AECE8, 0x805AEF84]
|
||||
.rodata: [0x8064A808, 0x8064A830]
|
||||
.data: [0x806C5120, 0x806C5148]
|
||||
ac_fallSESW.c:
|
||||
.text: [0x805AEF84, 0x805AF278]
|
||||
.rodata: [0x8064A830, 0x8064A858]
|
||||
.data: [0x806C5148, 0x806C51B0]
|
||||
ac_kago.c:
|
||||
.text: [0x805B1A08, 0x805B1D50]
|
||||
.data: [0x806C5750, 0x806C57A8]
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct actor_falls_south_east_west{
|
||||
typedef struct actor_falls_south_east_south_west{
|
||||
STRUCTURE_ACTOR structure_class;
|
||||
}FALLSEW_ACTOR;
|
||||
}FALLSESW_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE FallSESW_Profile;
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "ac_fallSESW.h"
|
||||
#include "m_name_table.h"
|
||||
#include "evw_anime.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_lib.h"
|
||||
#include "audio.h"
|
||||
#include "sys_math3d.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
extern Gfx obj_fallSESW_model[];
|
||||
extern Gfx obj_fallSE_rainbowT_model[];
|
||||
extern EVW_ANIME_DATA obj_fallSE_evw_anime;
|
||||
|
||||
|
||||
static void aFLEW_actor_move(ACTOR* actor, GAME* game);
|
||||
static void aFLEW_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE FallSESW_Profile = {
|
||||
mAc_PROFILE_FALLSESW,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
WATERFALL_EAST,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(FALLSESW_ACTOR),
|
||||
NONE_ACTOR_PROC,
|
||||
NONE_ACTOR_PROC,
|
||||
aFLEW_actor_move,
|
||||
aFLEW_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
#include "../src/ac_fallSESW_move.c_inc"
|
||||
|
||||
#include "../src/ac_fallSESW_draw.c_inc"
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
|
||||
void aFLEW_actor_draw(ACTOR* actor, GAME* game) {
|
||||
static const xyz_t base_vec_z = {0.0f, 0.0f, 1.0f};
|
||||
static MtxF flip_mtx = {{
|
||||
{-1.0f, 0.0f, 0.0f, 0.0f},
|
||||
{0.0f, 1.0f, 0.0f, 0.0f},
|
||||
{0.0f, 0.0f, 1.0f, 0.0f},
|
||||
{0.0f, 0.0f, 0.0f, 1.0f},
|
||||
}};
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
GRAPH* graph = game->graph;
|
||||
xyz_t bboard;
|
||||
int isWest;
|
||||
xyz_t l;
|
||||
f32 vecLen;
|
||||
s16 angle;
|
||||
Gfx* gfx;
|
||||
int a;
|
||||
|
||||
isWest = actor->npc_id == WATERFALL_WEST;
|
||||
|
||||
_texture_z_light_fog_prim_xlu(graph);
|
||||
|
||||
if (isWest != FALSE) {
|
||||
Matrix_mult(&flip_mtx, TRUE);
|
||||
}
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
{
|
||||
Gfx* gfx;
|
||||
gfx = NOW_POLY_XLU_DISP;
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
NOW_POLY_XLU_DISP = gfx;
|
||||
}
|
||||
Evw_Anime_Set(play, &obj_fallSE_evw_anime);
|
||||
|
||||
gfx = NOW_POLY_XLU_DISP;
|
||||
gSPDisplayList(gfx++, obj_fallSESW_model);
|
||||
|
||||
if (Common_Get(rainbow_opacity) > 0.0f) {
|
||||
a = (256.0f * Common_Get(rainbow_opacity));
|
||||
|
||||
if (a > 255) {
|
||||
a = 255;
|
||||
}
|
||||
bboard.x = play->billboard_matrix.mf[2][0];
|
||||
bboard.y = play->billboard_matrix.mf[2][1];
|
||||
bboard.z = play->billboard_matrix.mf[2][2];
|
||||
|
||||
if (isWest != FALSE) {
|
||||
bboard.x *= -1.0f;
|
||||
}
|
||||
|
||||
Math3DVectorProduct2Vec(&base_vec_z, &bboard, &l);
|
||||
|
||||
vecLen = Math3DVecLength(&l);
|
||||
|
||||
if (vecLen >= 0.0000001f) {
|
||||
xyz_t_mult_v(&l, 1.0f / vecLen);
|
||||
angle =
|
||||
RAD2SHORTANGLE(facos(base_vec_z.z * bboard.z + ((base_vec_z.x * bboard.x) + base_vec_z.y * bboard.y)));
|
||||
|
||||
Matrix_translate(actor->world.position.x, actor->world.position.y, actor->world.position.z, FALSE);
|
||||
if (actor->npc_id == WATERFALL_WEST) {
|
||||
Matrix_mult(&flip_mtx, TRUE);
|
||||
}
|
||||
Matrix_RotateVector(angle, &l, TRUE);
|
||||
Matrix_RotateY(-0x2000, TRUE);
|
||||
Matrix_scale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetRenderMode(gfx++, G_RM_FOG_SHADE_A, G_RM_XLU_SURF2);
|
||||
gDPSetEnvColor(gfx++, 255, 255, 255, a);
|
||||
gSPLoadGeometryMode(gfx++, G_SHADE | G_FOG | G_SHADING_SMOOTH);
|
||||
gSPDisplayList(gfx++, obj_fallSE_rainbowT_model);
|
||||
}
|
||||
}
|
||||
|
||||
NOW_POLY_XLU_DISP = gfx;
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
void aFLEW_actor_move(ACTOR* actor, GAME*) {
|
||||
xyz_t pos;
|
||||
|
||||
xyz_t_move(&pos, &actor->world.position);
|
||||
|
||||
pos.y += 40.0f;
|
||||
|
||||
sAdo_OngenPos((u32)actor, 12, &pos);
|
||||
}
|
||||
Reference in New Issue
Block a user