Merge branch banjo-kazooie:master into documentation

This commit is contained in:
Cyrus Kashef
2024-09-01 00:00:26 +00:00
11 changed files with 89 additions and 63 deletions

View File

@@ -36,11 +36,11 @@ typedef struct {
f32 unk3C;
} ActorLocal_CCW_8050;
void func_8038E964(Actor *this);
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chgrublinhood_update(Actor *this);
Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_8038F930[] = {
ActorAnimationInfo chGrublinHood_animations[] = {
{0x000, 0.0f},
{0x243, 4.0f},
{0x243, 0.7f},
@@ -54,15 +54,15 @@ ActorAnimationInfo D_8038F930[] = {
{0x243, 1e+06f}
};
ActorInfo D_8038F988 = {
ActorInfo chGrublinHood = {
MARKER_1E2_GRUBLIN_HOOD, ACTOR_375_GRUBLIN_HOOD, ASSET_52C_MODEL_GRUBLIN_HOOD,
0x1, D_8038F930,
func_8038E964, func_80326224, func_8038E56C,
0x1, chGrublinHood_animations,
chgrublinhood_update, func_80326224, chgrublinhood_draw,
2500, 0, 1.0f, 0
};
/* .code */
void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
void __chgrublinhood_emitHat(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
static struct43s D_8038F9AC = {
{{-200.0f, 200.0f, -200.0f}, {200.0f, 400.0f, 200.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}},
@@ -78,7 +78,7 @@ void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
particleEmitter_emitN(pCtrl, 1);
}
void func_8038E4C0(ActorMarker* marker, s32 arg1) {
void __chgrublinhood_die(ActorMarker* marker, s32 arg1) {
Actor* actor = marker_getActor(marker);
ParticleEmitter *pCtrl;
@@ -86,13 +86,13 @@ void func_8038E4C0(ActorMarker* marker, s32 arg1) {
actor_playAnimationOnce(actor);
FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500);
pCtrl = partEmitMgr_newEmitter(1);
func_8038E440(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT);
__chgrublinhood_emitHat(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT);
__spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z));
actor_collisionOff(actor);
actor->unk138_24 = 1;
}
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_CCW_8050 *local;
@@ -113,10 +113,9 @@ Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
return actor_draw(marker, gfx, mtx, vtx);
}
void func_8038E868(Actor *this){
void __chgrublinhood_initialize(Actor *this){
ActorLocal_CCW_8050 *local = (ActorLocal_CCW_8050 *)&this->local;
local->unk8 = 6;
local->unk9 = 0xC;
local->unkA = 0x10;
@@ -126,14 +125,14 @@ void func_8038E868(Actor *this){
local->unk12 = 25000;
local->unkC_28 = 1;
local->unk30 = func_802DB548;
local->unk34 = func_8038E4C0;
local->unk34 = __chgrublinhood_die;
local->unk0 = 5.0f;
local->unk4 = 8.0f;
local->unk14 = 1.0f;
local->unk3C = 1.5f;
}
enum ccw_season_e func_8038E8FC(Actor *this){
enum ccw_season_e __get_current_season(Actor *this){
switch(map_get()){
case MAP_43_CCW_SPRING: //// 8038E930
case MAP_4A_CCW_SPRING_MUMBOS_SKULL:// 8038E930
@@ -171,15 +170,15 @@ enum ccw_season_e func_8038E8FC(Actor *this){
}
}
void func_8038E964(Actor *this) {
void chgrublinhood_update(Actor *this) {
ActorLocal_CCW_8050 *local;
f32 temp_a0;
local = (ActorLocal_CCW_8050 *)&this->local;
if (!this->unk16C_4) {
func_8038E868(this);
local->season = func_8038E8FC(this);
__chgrublinhood_initialize(this);
local->season = __get_current_season(this);
}
if(local->season < 4){

View File

@@ -0,0 +1,43 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "math.h" // for SQ()
void chVacationTextTrigger_update(Actor* this);
/* .data */
ActorInfo gChVacationTextTrigger = {
MARKER_1E3_VACATION_TEXT_TRIGGER, ACTOR_374_VACATION_TEXT_TRIGGER, 0x0,
0x0, NULL,
chVacationTextTrigger_update, func_80326224, func_80325340,
0, 0, 0.0f, 0
};
/* .code */
/**
* @brief Returns if player is within a specified horizontal radius of the
* supplied x,z positions.
*/
static bool __playerIsWithinTrigger(s32 x, s32 z, s32 distance) {
s32 player_position[3];
player_getPosition_s32(player_position);
return (SQ(x - player_position[0]) + SQ(z - player_position[2])) < SQ(distance);
}
void chVacationTextTrigger_update(Actor* this) {
// Despawn if already triggered
if (func_803203FC(UNKFLAGS1_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT)) {
marker_despawn(this->marker);
return;
}
// Start dialog if player is within trigger
if (__playerIsWithinTrigger(0, -107, 188) != 0) {
func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL);
func_803204E4(UNKFLAGS1_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT, 1);
}
}

View File

@@ -51,8 +51,8 @@ extern ActorInfo D_8038F720;
extern ActorInfo D_8038F744;
extern ActorInfo D_8038F768;
extern ActorInfo D_8038F78C;
extern ActorInfo D_8038F988;
extern ActorInfo D_8038FA00;
extern ActorInfo chGrublinHood;
extern ActorInfo gChVacationTextTrigger;
extern ActorInfo D_8038F7D4;
extern ActorInfo D_8038F7B0;
extern ActorInfo D_8038F888;
@@ -143,8 +143,8 @@ void CCW_func_8038DB6C(void)
spawnableActorList_add(&D_8038F744, actor_new, 0);
spawnableActorList_add(&D_8038F768, actor_new, 0);
spawnableActorList_add(&D_8038F78C, actor_new, 0);
spawnableActorList_add(&D_8038F988, actor_new, 0X2010121);
spawnableActorList_add(&D_8038FA00, actor_new, 0);
spawnableActorList_add(&chGrublinHood, actor_new, 0X2010121);
spawnableActorList_add(&gChVacationTextTrigger, actor_new, 0);
spawnableActorList_add(&D_8038F7D4, actor_new, 0X400);
spawnableActorList_add(&D_8038F7B0, actor_new, 0X400);
spawnableActorList_add(&D_8038F888, actor_new, 0X80);

View File

@@ -1,31 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038EAD4(Actor *this);
/* .data */
ActorInfo D_8038FA00 = { 0x1E3, 0x374, 0x0, 0x0, NULL, func_8038EAD4, func_80326224, func_80325340, 0, 0, 0.0f, 0};
/* .code */
bool func_8038EA60(s32 arg0, s32 arg1, s32 arg2) {
s32 sp24;
s32 temp_a0;
s32 sp1C;
s32 temp_v1;
player_getPosition_s32(&sp1C);
temp_v1 = arg1 - sp24;
temp_a0 = arg0 - sp1C;
return ((temp_v1 * temp_v1) + (temp_a0 * temp_a0)) < (arg2 * arg2);
}
void func_8038EAD4(Actor* this) {
if (func_803203FC(0x13)) {
marker_despawn(this->marker);
return;
}
if (func_8038EA60(0, -0x6B, 0xBC) != 0) {
func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL);
func_803204E4(0x13, 1);
}
}

View File

@@ -5,8 +5,6 @@
#include "core2/animctrl.h"
#include "animation.h"
extern u32 D_A0000238;
/* .code */
void animctrl_80286F90(AnimCtrl *this){
Animation *anim;

View File

@@ -1,3 +1,11 @@
/**
* @file anim/commoncache.c
* @brief This file controls a cache of common animations consisting of
* player move animations. This main difference between this cache and
* the normal anim/cache.c is that these assets default to persist even
* after they become stall, and are cleaned up much later in memory
* defragmentation.
*/
#include <ultra64.h>
#include "functions.h"
#include "variables.h"