address variaty of compiler warnings and code documentation

This commit is contained in:
Banjo Kazooie
2022-12-03 01:30:35 -06:00
parent 263b5bab4e
commit 1c063c781c
211 changed files with 1341 additions and 1323 deletions

View File

@@ -2,13 +2,13 @@
#include "functions.h"
#include "variables.h"
extern void func_80328748(ActorAnimCtrl *, f32, f32);
extern void func_80328748(AnimCtrl *, f32, f32);
extern void func_8028F94C(s32, f32[3]);
extern void func_80324CFC(f32, enum comusic_e, s32);
extern void func_803289EC(Actor *, f32, s32);
extern void func_80326310(Actor *);
extern void actor_setOpacity(Actor *, s32);
extern void func_802C3D3C(void (*)(s32, s32), s32, s32);
extern void __spawnQueue_add_2(void (*)(s32, s32), s32, s32);
extern void func_802BAFE4(s32 arg0);
@@ -74,7 +74,7 @@ void func_80387E00(s32 arg0){
Actor * this = marker_getActor(marker);
func_803262E4(this);
func_802C3D3C(func_80387D18, reinterpret_cast(s32, marker), 0x1E);
__spawnQueue_add_2((GenMethod_2)func_80387D18, reinterpret_cast(s32, marker), 0x1E);
}
void func_80387E40(ActorMarker * arg0){
@@ -95,10 +95,10 @@ void func_80387E68(ActorMarker *caller, enum asset_e text_id, s32 arg2){
func_80328B8C(this, 5, 0.79f, 1);
func_80326310(this);
bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE;
timedFunc_set_1(1.1f, func_80387E00, bgs_D_803907B8[this->unkF4_8]);
timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, reinterpret_cast(s32, bgs_D_803907B8[this->unkF4_8]));
timed_setCameraToNode(0.8f, 9);
func_80324DBC(3.4f, 0xC87, 0xE, NULL, NULL, func_80387E68, NULL);
func_802C3D3C(&func_80387D18, this->marker, 0x46);
__spawnQueue_add_2((GenMethod_2) func_80387D18, reinterpret_cast(s32, this->marker), 0x46);
}
else{
func_80324E88(0.0f);
@@ -158,12 +158,12 @@ void func_80387FD4(Actor *this){
}
if (this->unkF4_8 < 5) {
bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE;
timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, bgs_D_803907B8[this->unkF4_8]);
timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, reinterpret_cast(s32, bgs_D_803907B8[this->unkF4_8]));
func_802BAFE4(D_803907B0[this->unkF4_8-1]);
} else {
timedFunc_set_1(0.8f, (GenMethod_1)func_80387D90, (s32) this->marker);
}
func_802C3D3C(&func_80387D18, this->marker, 0x46);
__spawnQueue_add_2((GenMethod_2)func_80387D18, reinterpret_cast(s32, this->marker), 0x46);
}
}
}//L80388348

View File

@@ -16,7 +16,7 @@ typedef struct chleafboat_s{
} ActorLocal_Leafboat;
void func_8038FD9C(Actor *this);
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3);
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **Vtx);
/* .data section */
@@ -30,23 +30,23 @@ ActorInfo D_80390DA8 = {MARKER_DA_LEAFBOAT, ACTOR_F1_LEAFBOAT, ASSET_30D_MODEL_L
/* .code section */
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){
Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx){
Actor * thisActor;
thisActor = marker_getActor(this);
if((thisActor->unk1C_x != 0.0f) && (0x80 < thisActor->alpha_124_19)){
thisActor = func_80325888(this, gdl, mtx, arg3);
thisActor = func_80325888(this, gdl, mtx, vtx);
}
return thisActor;
}
void func_8038FD88(ActorMarker *this, u32 arg1){
void func_8038FD88(ActorMarker *this, ActorMarker *other){
this->unk3E_1 = 1;
}
void func_8038FD9C(Actor *this){
f32 sp64[3];
f32 sp58[3];
f32 player_position[3];
ActorLocal_Leafboat *local;
u8 tmp[6] = D_80390DA0;
f32 pad0;
@@ -152,13 +152,13 @@ void func_8038FD9C(Actor *this){
local->unk60[1] = this->yaw;
local->unk60[2] = this->roll;
this->unk60 += time_getDelta();
_player_getPosition(&sp58);
_player_getPosition(player_position);
if( func_80294660() == 0x100
&& func_8028F20C()
&& this->marker->unk3E_1
){
sp44 = local->unk54[0] - sp58[0];
sp40 = local->unk54[2] - sp58[2];
sp44 = local->unk54[0] - player_position[0];
sp40 = local->unk54[2] - player_position[2];
sp3C = cosf((local->unk60[1] * M_PI) / 180.0);
sp38 = sinf((local->unk60[1] * M_PI) / 180.0);
local->unkC[0] = -((sp44 * sp38) + (sp40 * sp3C)) / 8;

View File

@@ -108,13 +108,13 @@ void BGS_func_8038BBA0(Actor *this, s32 arg1){
if(arg1 == 103){
func_80335A24(this->unk148, 0x124, 0.1f, 0.5f); //0x124 = croc_munch
if(this->state == 4){
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8);
timedFunc_set_1(0.31f, func_8038BB40, this->marker);
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 25000);
timedFunc_set_1(0.31f, (GenMethod_1)func_8038BB40, reinterpret_cast(s32, this->marker));
}
else{
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8);
timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 0x61A8);
timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 0x61A8);
timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 25000);
timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 25000);
timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 25000);
}
}
if(arg1 == 104){
@@ -143,7 +143,7 @@ void func_8038BD84(Actor *this){
void func_8038BDD4(Actor *this) {
ActorLocal_MrVile *local;
f32 sp60[3];
f32 start_position[3];
f32 sp5C;
f32 sp58;
f32 sp54;
@@ -153,9 +153,9 @@ void func_8038BDD4(Actor *this) {
local = (ActorLocal_MrVile *)&this->local;
sp5C = time_getDelta();
sp60[0] = this->position[0];
sp60[1] = this->position[1];
sp60[2] = this->position[2];
start_position[0] = this->position[0];
start_position[1] = this->position[1];
start_position[2] = this->position[2];
func_8025773C(&local->unk14, sp5C);
if ((local->unkC == 102) || (local->unkC == 103) || (local->unkC == 104)) {
sp44[0] = 0.0f;
@@ -191,7 +191,7 @@ void func_8038BDD4(Actor *this) {
}
}
if (this->position[1] > 100.0f) {
func_8038B9F0(&sp60, this->position, 90.0f, 70.0f, 0);
func_8038B9F0(start_position, this->position, 90.0f, 70.0f, 0);
}
}
@@ -228,7 +228,7 @@ void func_8038C0C8(Actor * this, s32 next_state){
Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){
Actor *this;
ActorLocal_MrVile *local;
f32 sp34[3];
f32 position[3];
this = func_80325888(marker, gfx, mtx, vtx);
@@ -238,10 +238,10 @@ Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){
(local->unk14 > 0.0f)
&& (this->marker->unk14_21)
) {
func_8034A174(func_80329934(), 5, &sp34);
sp34[1] -= 30.0f;
func_8034A174(func_80329934(), 5, position);
position[1] -= 30.0f;
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
modelRender_draw(gfx, mtx, &sp34, 0, local->unk14, 0, local->unk4);
modelRender_draw(gfx, mtx, position, 0, local->unk14, 0, local->unk4);
}
return this;
}
@@ -323,12 +323,10 @@ void BGS_func_8038C460(ActorMarker *arg0){
}
void chvile_update(Actor *this) {
ActorLocal_MrVile *local;
bool var_v1;
f32 sp94;
f32 player_position[3];
f32 sp90;
f32 temp_a0;
f32 temp_f0;
bool var_v1;
f32 sp84;
f32 sp80;
f32 sp7C;
@@ -337,8 +335,8 @@ void chvile_update(Actor *this) {
f32 sp70;
f32 sp6C;
f32 sp68;
f32 sp50;
f32 sp58[3];
ActorLocal_MrVile *local;
f32 random_position[3];
local = (ActorLocal_MrVile *)&this->local;
if (!this->unk16C_4) {
@@ -352,17 +350,17 @@ void chvile_update(Actor *this) {
return;
}
if (local->game_marker == NULL) {
local->game_marker = func_80326D68(this->position, 0x138, -1, &sp90)->marker;
local->game_marker = actorArray_findClosestActorFromActorId(this->position, 0x138, -1, &sp90)->marker;
}
player_getPosition(&sp94);
sp90 = ml_vec3f_distance(this->position, &sp94);
player_getPosition(player_position);
sp90 = ml_vec3f_distance(this->position, player_position);
if (sp90 <= 300.0f) {
local->unk0 = (local->unk0 == 0) ? 1 : 2;
} else if (sp90 > 300.0f) {
local->unk0 = 0U;
}
if (this->state == 2) {
func_80258A4C(this->position, this->yaw - 90.0f, &sp94, &sp84, &sp80, &sp7C);
func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp84, &sp80, &sp7C);
if (((sp84 > 50.0f) && (0.05 < sp7C)) || (sp7C < -0.05)) {
this->yaw += sp7C * 20.0f;
} else {
@@ -432,15 +430,15 @@ void chvile_update(Actor *this) {
}
if ((this->state == 6)){
local->unk10 = 400.0f;
if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(&sp94, local->target_position) < 300.0f)) {
if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(player_position, local->target_position) < 300.0f)) {
for(i = 0; i < 10; i++){
sp58[0] = randf2(-500.0f, 500.0f);
sp58[1] = 0.0f;
sp58[2] = randf2(-500.0f, 500.0f);
if ((i == 0) || (ml_vec3f_distance(&sp94, &sp58) > ml_vec3f_distance(&sp94, local->target_position))) {
local->target_position[0] = sp58[0];
local->target_position[1] = sp58[1];
local->target_position[2] = sp58[2];
random_position[0] = randf2(-500.0f, 500.0f);
random_position[1] = 0.0f;
random_position[2] = randf2(-500.0f, 500.0f);
if ((i == 0) || (ml_vec3f_distance(player_position, random_position) > ml_vec3f_distance(player_position, local->target_position))) {
local->target_position[0] = random_position[0];
local->target_position[1] = random_position[1];
local->target_position[2] = random_position[2];
}
};
}

View File

@@ -9,7 +9,7 @@ void func_80324E88(f32);
void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32);
void func_8028E668(f32[3], f32, f32, f32);
extern void func_802C3E10(void(*arg0)(void), ActorMarker *, s32, s32);
extern void __spawnQueue_add_3(GenMethod_3, s32, s32, s32);
void func_8038F6A4(Actor *);
@@ -18,7 +18,7 @@ enum chtanktup_leg_e {
TANKTUP_LEG_FRONT_LEFT,
TANKTUP_LEG_BACK_LEFT,
TANKTUP_LEG_FRONT_RIGHT,
TANKTUP_LEG_BACK_RIGHT,
TANKTUP_LEG_BACK_RIGHT
};
ActorAnimationInfo BGS_D_80390C20[] = {
@@ -53,7 +53,7 @@ void func_8038F470(ActorMarker *this, s32 arg1, enum chtanktup_leg_e leg_id){
void func_8038F51C(Actor *this){
Actor * spawnPtr;
spawnPtr = func_80326D68(this->position, ACTOR_E8_TANKTUP, -1, 0);
spawnPtr = actorArray_findClosestActorFromActorId(this->position, ACTOR_E8_TANKTUP, -1, 0);
spawnPtr->tanktup.unk0[this->unk10_12] = 1;
spawnPtr->tanktup.unk10 = 1;
}
@@ -65,26 +65,26 @@ s32 func_8038F570(s16 *arg0){
pos[0] = (f32)arg0[0];
pos[1] = (f32)arg0[1];
pos[2] = (f32)arg0[2];
spawnPtr = func_80326D68(pos, ACTOR_E8_TANKTUP, -1, 0);
spawnPtr = actorArray_findClosestActorFromActorId(pos, ACTOR_E8_TANKTUP, -1, 0);
return spawnPtr->state == 3;
}
void func_8038F5E4(s32 arg0, s32 arg1, s32 arg2){
void func_8038F5E4(ActorMarker *marker, enum asset_e text_id, s32 arg2){
func_80324E88(0.0f);
}
void func_8038F610(Actor *this) {
f32 sp24[3];
func_8034A174(this->marker->unk44, 8, &sp24);
if (func_80258368(&sp24) != 0) {
func_8028E668(&sp24, 200.0f, -600.0f, 300.0f);
func_8034A174(this->marker->unk44, 8, sp24);
if (func_80258368(sp24) != 0) {
func_8028E668(sp24, 200.0f, -600.0f, 300.0f);
}
func_8034A174(this->marker->unk44, 7, &sp24);
if (func_80258368(&sp24) != 0) {
func_8028E668(&sp24, 200.0f, -600.0f, 200.0f);
func_8034A174(this->marker->unk44, 7, sp24);
if (func_80258368(sp24) != 0) {
func_8028E668(sp24, 200.0f, -600.0f, 200.0f);
}
}
@@ -97,7 +97,7 @@ void func_8038F6A4(Actor *this)
ActorLocal_TanktupBody *local = (ActorLocal_TanktupBody *) (&this->local);
f32 sp48[3];
s32 sp44;
Prop *temp_v0;
NodeProp *temp_v0;
if (!this->initialized)
{
temp_v0 = func_80304C38(ACTOR_32B_UNKNOWN, this);
@@ -124,7 +124,7 @@ void func_8038F6A4(Actor *this)
{
if (local->unk0[sp44] == 0)
{
func_802C3E10(func_8038F470, *((s32 *) (&this->marker)), local->unk0[sp44], sp44);
__spawnQueue_add_3((GenMethod_3)func_8038F470, *((s32 *) (&this->marker)), local->unk0[sp44], sp44);
}
}

View File

@@ -6,13 +6,14 @@
extern void func_803253A0(Actor *);
extern void func_80325794(ActorMarker *);
extern f32 randf (void);
extern BKModelBin *chvilegame_get_grumblie_model(ActorMarker *marker);
enum chyumblie_state_e{
YUMBLIE_STATE_1_UNDER_GROUND = 1,
YUMBLIE_STATE_2_APPEAR,
YUMBLIE_STATE_3_ABOVE_GROUND,
YUMBLIE_STATE_4_DISAPPEAR,
YUMBLIE_STATE_5_BEING_EATEN,
YUMBLIE_STATE_5_BEING_EATEN
};
typedef struct chyumblie_s{
@@ -157,7 +158,7 @@ void chyumblie_update(Actor *this){
}
if(s0->game_marker == NULL){
s0->game_marker = func_80326D68(this->position, ACTOR_138_VILE_GAME_CTRL, -1, &sp48)->marker;
s0->game_marker = actorArray_findClosestActorFromActorId(this->position, ACTOR_138_VILE_GAME_CTRL, -1, &sp48)->marker;
}
sp50 = func_80335684(this->unk148);
if(this->state == YUMBLIE_STATE_1_UNDER_GROUND){