core2/playerModel.c documentation

This commit is contained in:
Banjo Kazooie 2022-12-01 17:41:20 -06:00
parent aa33833595
commit 342011dd23
50 changed files with 560 additions and 545 deletions

View File

@ -512,7 +512,7 @@ segments:
- [0xF5FF60, c, code_A600] #DONE
- [0xF60040, c, code_A6E0] #DONE
- [0xF602C0, c, code_A960] #DONE
- [0xF603C0, c, code_AA60] #DONE
- [0xF603C0, c, playerModel] #DONE
- [0xF60FB0, c, code_B650] #DONE
- [0xF611B0, c, code_B850] #DONE
- [0xF614B0, c, code_BB50] #DONE
@ -749,7 +749,7 @@ segments:
- [0xFCF5E0, c, code_79C80] #DONE
- [0xFD00C0, c, code_7A760] #DONE
- [0xFD08E0, c, code_7AF80]
- [0xFD7960, c, code_82000] #DONE
- [0xFD7960, c, levelModel] #DONE
- [0xFD8CA0, c, code_83340]
- [0xFD96D0, c, gc/section] #DONE
- [0xFD9A30, c, gc/sky] #DONE
@ -887,7 +887,7 @@ segments:
- [0x1032000, .data, code_47C0]
- [0x1032060, .data, code_7060]
- [0x10320A0, .data, code_90E0]
- [0x1032150, .data, code_AA60]
- [0x1032150, .data, playerModel]
- [0x1032150, .data, code_B850]
- [0x1032170, .data, code_BB50]
- [0x10321C0, .data, code_C0E0]
@ -1023,7 +1023,7 @@ segments:
- [0x10392E0, .data, code_79C80]
- [0x1039330, .data, code_7A760]
- [0x1039380, .data, code_7AF80]
- [0x10395B0, .data, code_82000]
- [0x10395B0, .data, levelModel]
- [0x103A1D0, .data, code_83340]
- [0x103A1E0, .data, gc/section]
- [0x103A710, .data, gc/sky]
@ -1112,7 +1112,7 @@ segments:
- [0x1042F90, .rodata, code_9450]
- [0x1042FC0, .rodata, code_9900]
- [0x1042FD0, .rodata, code_9BD0]
- [0x1043010, .rodata, code_AA60]
- [0x1043010, .rodata, playerModel]
- [0x10430C0, .rodata, code_B650]
- [0x10430D0, .rodata, code_B850]
- [0x10430F0, .rodata, code_BD20]
@ -1267,7 +1267,7 @@ segments:
- [0x1045E50, .rodata, code_79C80]
- [0x1045E60, .rodata, code_7A760]
- [0x1045E80, .rodata, code_7AF80]
- [0x1045F40, .rodata, code_82000]
- [0x1045F40, .rodata, levelModel]
- [0x1046100, .rodata, code_83340]
- [0x1046110, .rodata, gc/section]
- [0x1046E10, .rodata, gc/sky]
@ -1366,7 +1366,7 @@ segments:
- [0x1048560, .bss, code_9BD0]
- [0x1048560, .bss, code_A600]
- [0x1048560, .bss, code_A6E0]
- [0x1048560, .bss, code_AA60]
- [0x1048560, .bss, playerModel]
- [0x1048560, .bss, code_B650]
- [0x1048560, .bss, code_BB50]
- [0x1048560, .bss, code_BD20]
@ -1530,7 +1530,7 @@ segments:
- [0x1048560, .bss, code_79C80]
- [0x1048560, .bss, code_7A760]
- [0x1048560, .bss, code_7AF80]
- [0x1048560, .bss, code_82000]
- [0x1048560, .bss, levelModel]
- [0x1048560, .bss, code_83340]
- [0x1048560, .bss, gc/section]
- [0x1048560, .bss, gc/sky]

View File

@ -15,7 +15,7 @@ BKAnimationList *model_getAnimationList(BKModelBin *arg0);
BKTextureList *model_getTextureList(BKModelBin *arg0);
void modelRender_reset(void);
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin);
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation[3], f32 scale, f32*arg5, BKModelBin* model_bin);
void modelRender_preDraw(GenMethod_1 func, s32 arg);
void modelRender_postDraw(GenMethod_1 func, s32 arg);

View File

@ -0,0 +1,16 @@
#ifndef _PLAYER_MODEL_H_
#define _PLAYER_MODEL_H_
enum player_model_direction_e {
PLAYER_MODEL_DIR_BANJO = 1,
PLAYER_MODEL_DIR_KAZOOIE = 2,
PLAYER_MODEL_DIR_GLOBAL = 3
};
void playerModel_80292048(s32, f32, f32, f32);
void playerModel_setDirection(enum player_model_direction_e arg0);
void playerModel_setScale(f32);
void playerModel_8029217C(f32);
void playerModel_setVisible(s32 arg0);
#endif

View File

@ -3681,8 +3681,10 @@ enum asset_e
ASSET_D96_TEXT_BEEHIVE = 0xd96,
ASSET_DA6_TEXT_BEEHIVE_WITH_BEES = 0xda6
ASSET_DA6_TEXT_BEEHIVE_WITH_BEES = 0xda6,
ASSET_14CF_MODEL_SM_OPA = 0x14CF,
ASSET_14D0_MODEL_SM_XLU
};
enum overlay_e{

View File

@ -101,7 +101,7 @@ void _player_getPosition(f32 dst[3]);
void player_getPosition(f32 dst[3]);
void player_getRotation(f32 *dst);
void func_80291A60(s32 arg0, f32* arg1);
void playerModel_80291A50(s32 arg0, f32* arg1);
int button_pressed(s32);
u32 button_held(s32);
@ -311,9 +311,9 @@ int func_80291698(s32);
int func_80291700(s32, f32);
void func_802917E4(s32, f32);
void func_80292078(s32, f32);
void func_80292158(f32);
f32 func_80292230(void);
void playerModel_80292078(s32, f32);
void playerModel_80292158(f32);
f32 playerModel_80292230(void);
void func_802927E0(f32, f32);

View File

@ -24,7 +24,7 @@ extern void func_8033A45C(s32, s32);
extern void func_8033A238(s32);
extern void func_8033A450(s32);
extern void func_8028FAB0(f32[3]);
extern void func_802921D4(f32[3]);
extern void playerModel_802921D4(f32[3]);
/* .data */
f32 D_80389C00[3] = {5700.0f, 4300.0f, 0.0f};
@ -209,7 +209,7 @@ void CC_func_80388760(Gfx **gfx, Mtx **mtx, Vtx **vtx){
modelRender_draw(gfx, mtx, D_80389FA0.unk28, NULL, 1.0f, NULL, D_80389FA0.unk24);
if(func_80340020(D_80389FA0.unk18, D_80389FA0.unk28, 0, 1.0f, 0, D_80389FA0.unk40, spA4, spA4)){
func_8028FAB0(spA4);
func_802921D4(spA4);
playerModel_802921D4(spA4);
}
}

View File

@ -89,7 +89,7 @@ void func_80386630(Actor *this){
mlMtxIdent();
mlMtxRotYaw(sp64[1]);
mlMtxRotPitch(sp64[0]);
func_802513B0(sp24);
mlMtxGet(sp24);
sp70[0] = 0.0f;
sp70[1] = 18.0f;

View File

@ -159,7 +159,7 @@ void func_803904A8(void){
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){
if( player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER && func_8028F20C()){
player_getPosition(sp50);
sp4C = func_8033F3E8(func_80309744(0), sp50, 0x190, 0x1a0);
sp4C = func_8033F3E8(levelModel_getModel(0), sp50, 0x190, 0x1a0);
if(sp4C){
sp48 = func_8034C528(sp4C);
if(D_80391AE0.state_9 == 1){
@ -197,7 +197,7 @@ void func_803904A8(void){
func_8034E120(D_80391AE0.tile1_0->unk4, 180.0f, 0.0f, 0.5f, 2);
func_8034E120(D_80391AE0.tile2_4->unk4, 180.0f, 0.0f, 0.5f, 2);
player_getPosition(sp38);
sp48 = func_8033F3E8(func_80309744(0), sp38, 0x190, 0x1a0);
sp48 = func_8033F3E8(levelModel_getModel(0), sp38, 0x190, 0x1a0);
if(sp48 == D_80391AE0.tile1_0->unk0 || sp48 == D_80391AE0.tile2_4->unk0){
func_8028F66C(BS_INTR_14);
}

View File

@ -220,7 +220,7 @@ void func_8038A9B4(void){
if(map_get() == MAP_24_MMM_TUMBLARS_SHED){
MMM_D_8038C510.unkC = NULL;
MMM_D_8038C510.unk0 = func_80309744(0);
MMM_D_8038C510.unk0 = levelModel_getModel(0);
MMM_D_8038C510.unk4 = NULL;
func_8038A2B8();

View File

@ -6,7 +6,7 @@
/* extern */
extern void func_802D6310(f32, enum map_e, s32, s32, enum bkprog_e);
extern BKModel *func_80309744(s32);
extern BKModel *levelModel_getModel(s32);
extern u8 D_8037DCC0[7];
@ -417,8 +417,8 @@ void func_8038B094(void){
func_8034E71C(sp28, -500, 0.0f);
}//L8038B1EC
D_8038D720.unk0 = func_80309744(0);
D_8038D720.unk4 = func_80309744(1);
D_8038D720.unk0 = levelModel_getModel(0);
D_8038D720.unk4 = levelModel_getModel(1);
D_8038D720.unk8 = 0;
D_8038D720.unk10 = 0;
D_8038D720.unkC = 0.0f;

View File

@ -24,7 +24,7 @@ u8 pad_D_80282850[0x780];
Mtx * D_80282FD0;
/*.code*/
void func_802513B0(f32 *arg0) {
void mlMtxGet(f32 *arg0) {
s32 var_v0, j;
for(var_v0 = 0; var_v0 < 4; var_v0++){
@ -388,14 +388,14 @@ void func_80252AF0(f32 arg0[3], f32 arg1[3], f32 rotation[3], f32 scale, f32 arg
}
void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]){
void func_80252C08(f32 arg0[3], f32 rotation[3], f32 scale, f32 arg3[3]){
if(arg0 != NULL)
mlMtxTranslate(arg0[0], arg0[1], arg0[2]);
if(arg1 != NULL){
mlMtxRotYaw(arg1[1]);
mlMtxRotPitch(arg1[0]);
mlMtxRotRoll(arg1[2]);
if(rotation != NULL){
mlMtxRotYaw(rotation[1]);
mlMtxRotPitch(rotation[0]);
mlMtxRotRoll(rotation[2]);
}
if(scale != 1.0f){

View File

@ -167,7 +167,7 @@ void func_8024CCC4(void){
mlMtxIdent();
mlMtxRotYaw(-60.0f);
mlMtxRotPitch(-90.0f);
func_802513B0(&D_80280FD8);
mlMtxGet(&D_80280FD8);
}
void func_8024CD7C(int arg0){
@ -247,7 +247,7 @@ void func_8024CFD4(void){
mlMtxIdent();
mlMtxRotYaw(D_80280EC0[1]);
mlMtxRotPitch(D_80280EC0[0]);
func_802513B0(&D_80280F98);
mlMtxGet(&D_80280F98);
D_80280EA0[0] = 0.0f;
D_80280EA0[1] = 0.0f;
D_80280EA0[2] = -1.0f;

View File

@ -3,7 +3,7 @@
#include "variables.h"
extern void func_8028FDC8(f32);
extern void func_802921BC(f32);
extern void playerModel_setYDisplacement(f32);
extern f32 func_8029B2D0(void);
extern void func_802BFE50(f32, f32, f32);
extern void func_80354030(f32[3], f32);
@ -47,7 +47,7 @@ void func_802A3404(void){
}
void func_802A3430(void){
func_802921BC(60.0f);
playerModel_setYDisplacement(60.0f);
func_802991A8(3);
func_80299234(500.0f, 2.0f);
roll_setAngularVelocity(500.0f, 2.0f);
@ -63,7 +63,7 @@ void func_802A34C8(void){
gravity_reset();
func_80297B94();
func_8029E070(0);
func_802921BC(0.0f);
playerModel_setYDisplacement(0.0f);
func_8029CB84();
func_802991A8(1);
func_80291548();
@ -462,7 +462,7 @@ void func_802A4430(void){
pitch_setIdeal(0.0f);
gravity_reset();
func_80297B94();
func_802921BC(0.0f);
playerModel_setYDisplacement(0.0f);
func_80299CF4(SFX_31_BANJO_OHHWAAOOO, 1.0f, 0x7fff);
func_80299D2C(SFX_61_CARTOONY_FALL, 1.0f, 0x7fff);
D_8037D320 = 0.35f;

View File

@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/playerModel.h"
/* .data */
const f32 D_80364A40 = 80.0f;
@ -57,7 +58,7 @@ void func_802A531C(void){
}
void func_802A5374(void){
func_80292078(1, -50.0f);
playerModel_80292078(1, -50.0f);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_8029E070(1);
@ -72,12 +73,12 @@ void func_802A5404(void){
if(bslongleg_inSet(bs_getNextState()))
return;
func_80292078(1,0);
playerModel_80292078(1,0);
func_8029B0C0();
func_8029E070(0);
func_8029E064(0);
func_8029E0F4(0);
func_80292090(1);
playerModel_setDirection(PLAYER_MODEL_DIR_BANJO);
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_802917C4(2);
@ -154,7 +155,7 @@ void bsblongleg_stand_enter(void){
func_8028A010(ASSET_41_ANIM_BSLONGLEG_IDLE, 1.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_80292090(2);
playerModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_802A5374();
}
@ -462,7 +463,7 @@ void func_802A6394(void){
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_802A5374();
func_80292090(2);
playerModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_8029C674();
}

View File

@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
void func_80292048(s32, f32, f32, f32);
void playerModel_80292048(s32, f32, f32, f32);
void func_802875AC(AnimCtrl *, char *, s32);
/* .data */
@ -42,8 +42,8 @@ void bsbpeck_init(void){
func_8029E070(1);
gravity_set(D_80364A60);
player_setYVelocity(D_80364A64);
func_80292048(1, -38.0f, 0.0f, 105.0f);
func_80292048(0, -38.0f, 0.0f, -7.0f);
playerModel_80292048(1, -38.0f, 0.0f, 105.0f);
playerModel_80292048(0, -38.0f, 0.0f, -7.0f);
func_8028D638(0x23, 0x2A);
D_8037D375 = 0;
D_8037D374 = 0;
@ -129,8 +129,8 @@ void bsbpeck_update(void){
void bsbpeck_end(void){
D_8037D376 = 0;
ability_use(0xa);
func_80292048(1, 0.0f, 0.0f, 0.0f);
func_80292048(0, 0.0f, 0.0f, 0.0f);
playerModel_80292048(1, 0.0f, 0.0f, 0.0f);
playerModel_80292048(0, 0.0f, 0.0f, 0.0f);
func_8028D638(0, 0);
func_8029E070(0);
gravity_reset();

View File

@ -35,7 +35,7 @@ void bsbshock_charge_init(void){
D_8037D382 = func_8030D90C();
sfxsource_setSfxId(D_8037D382, SFX_2C_PULLING_NOISE);
func_8030E04C(D_8037D382, 1.4f, 0.4f, -1.2f);
func_80292158(-50.0f);
playerModel_80292158(-50.0f);
func_80298528(-50.0f);
D_8037D380 = 1;
D_8037D381 = 0;
@ -103,7 +103,7 @@ void bsbshock_charge_update(void){
if(animctrl_isAt(aCtrl, 0.5551f)){
player_setYVelocity(180.0f);
func_80292158(0.0f);
playerModel_80292158(0.0f);
func_80298528(50.0f);
}
@ -116,8 +116,8 @@ void bsbshock_charge_end(void){
func_8030DA44(D_8037D382);
func_8029E064(0);
func_8029E070(0);
if(func_80292230() != 0.0f){
func_80292158(0.0f);
if(playerModel_80292230() != 0.0f){
playerModel_80292158(0.0f);
func_80298528(50.0f);
}
}
@ -146,7 +146,7 @@ void bsbshock_init(void){
func_8029E064(1);
func_8029E070(1);
ability_use(9);
func_80292158(-50.0f);
playerModel_80292158(-50.0f);
func_80298528(-50.0f);
D_8037D381 = 0;
}
@ -190,6 +190,6 @@ void bsbshock_end(void){
func_8029E064(0);
func_8029E070(0);
func_80292158(0.0f);
playerModel_80292158(0.0f);
func_80298528(50.0f);
}

View File

@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_802921BC(f32);
extern void playerModel_setYDisplacement(f32);
extern f32 func_8029494C(void);
extern f32 func_8029B2D0(void);
extern bool func_8029E284(s32, f32);
@ -76,7 +76,7 @@ void func_802A744C(void) {
func_8029B324(1, 1.0f);
func_8029E070(1);
func_80294378(3);
func_802921BC(60.0f);
playerModel_setYDisplacement(60.0f);
func_80297B64(2.0f);
}
@ -106,7 +106,7 @@ void func_802A75B0(void) {
func_8029B0C0();
func_8029E070(0);
func_80294378(1);
func_802921BC(0.0f);
playerModel_setYDisplacement(0.0f);
}
}

View File

@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/playerModel.h"
/* .data */
f32 D_80364A90 = 30.0f;
@ -104,7 +105,7 @@ void func_802A8A40(void){
roll_setAngularVelocity(1000.0f, 12.0f);
miscflag_set(3);
func_8029CF48(4,1,0.24f);
func_80292090(2);
playerModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
}
void func_802A8AD8(void){
@ -133,7 +134,7 @@ void func_802A8BB0(void){
if(bsbtrot_inSet(next_state))
return;
func_80292090(1);
playerModel_setDirection(PLAYER_MODEL_DIR_BANJO);
func_8029B0C0();
func_8029E070(0);
func_8029E064(0);
@ -378,7 +379,7 @@ void bsbtrot_jump_update(void){
else
func_802A89D4();
_get_velocity(&sp1C);
_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
@ -589,7 +590,7 @@ void bsbtrot_fall_update(void){
else
func_802A89D4();
_get_velocity(&sp1C);
_get_velocity(sp1C);
switch (D_8037D3A4){
case 0://L802A9D90
if(func_8028B254(0x8C)){
@ -679,7 +680,7 @@ void bsbtrot_unk79_init(void){
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_802A8A40();
func_80292090(2);
playerModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_8029C674();
}
@ -707,7 +708,7 @@ void bsbtrot_ow_init(void){
func_80298760(func_80296560());
func_8028A274(0x66, 1.1f);
func_80299BFC(1.0f);
_player_getPosition(&sp30);
_player_getPosition(sp30);
func_80294980(sp24);
func_80257F18(sp24, sp30, &sp3C);
yaw_setIdeal(mlNormalizeAngle(sp3C + 180.0f));\

View File

@ -8,7 +8,7 @@ f32 func_8029B33C(void);
void func_8029797C(f32);
void func_80297970(f32);
void func_802921BC(f32);
void playerModel_setYDisplacement(f32);
void func_80297BF8(f32);
void func_802BFE50(f32, f32, f32);
void func_80299234(f32, f32);
@ -94,7 +94,7 @@ void func_802A0750(void){
void _bsbeefly_end(void){
if(bsBeeFly_inSet(bs_getNextState()))
return;
func_802921BC(0.0f);
playerModel_setYDisplacement(0.0f);
roll_setIdeal(0.0f);
pitch_setIdeal(0.0f);
func_80291548();
@ -107,7 +107,7 @@ void _bsbeefly_end(void){
void func_802A07F8(void){
if(bsBeeFly_inSet(bs_getPrevState()))
return;
func_802921BC(65.0f);
playerModel_setYDisplacement(65.0f);
func_802991A8(3);
roll_setAngularVelocity(500.0f, 2.0f);
func_802A0724();

View File

@ -612,7 +612,7 @@ void func_802AD318(void){
void bscroc_eat_good_init(void){
func_8028A010(0x122, 0.25f);
func_8029C7F4(1,1,1,2);
func_80292188(func_802AD2A8);
playerModel_setPostDraw(func_802AD2A8);
D_8037D3E8 = assetcache_get(func_80294974());
D_8037D3F0 = 1.0f;
D_8037D3F5 = 0;
@ -661,7 +661,7 @@ void bscroc_eat_good_update(void){
void bscroc_eat_good_end(void){
D_8037D3F5 = 0;
assetcache_release(D_8037D3E8);
func_80292188(0);
playerModel_setPostDraw(0);
func_802ABFBC();
}

View File

@ -291,7 +291,7 @@ static void __bsdronexform_setState(int arg0){
yaw_applyIdeal();
}
func_8029A95C(func_80294A4C()); //set player transformation
func_80291D04(); //update player model
playerModel_updateModel(); //update player model
func_8029BD44(&sp34, &sp30);
func_8028A010(sp34, sp30);
func_8029E3C0(0, 0.1f);

View File

@ -9,7 +9,7 @@ f32 func_80297A64(void);
void func_80299B58(f32, f32);
f32 func_8029B2E8(void);
f32 func_8029B33C(void);
void func_802921BC(f32);
void playerModel_setYDisplacement(f32);
void func_8028A084(s32, f32);
/* .data */
@ -387,7 +387,7 @@ bool bsjump_jumpingFromWater(void){
void bsjump_tumble_init(void){
func_8028A084(0x68, 0.35f);
func_8029C7F4(1,1,3,6);
func_802921BC(60.0f);
playerModel_setYDisplacement(60.0f);
if(func_80293234() == 1){
func_8029E3C0(0, 0.5f);
func_8029E3C0(1, 0.41f);
@ -438,6 +438,6 @@ void bsjump_tumble_end(void){
func_80293240(3);
}
func_8029CB84();
func_802921BC(0.0f);
playerModel_setYDisplacement(0.0f);
func_80299E6C();
}

View File

@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_802920FC(f32);
extern void playerModel_setScale(f32);
extern void func_8028A084(s32, f32);
extern void func_8029AD68(f32, s32);
@ -321,7 +321,7 @@ void func_802B2C58(void) {
sp3C = ml_map_f(sp34, 0.0f, 2.3f, 0.0f, 45.0f);
yaw_setIdeal(mlNormalizeAngle(sp38 + sp3C));
yaw_applyIdeal();
func_802920FC(ml_map_f(sp34, 0.0f, 2.3f, 1.0f, 0.3f));
playerModel_setScale(ml_map_f(sp34, 0.0f, 2.3f, 1.0f, 0.3f));
ml_vec3f_copy(sp28, D_8037D4E8);
sp28[1] = ml_map_f(sp34, 0.0f, 2.3f, D_8037D4E8[1], D_8037D4E8[1] - 50.0);
func_8028FAB0(sp28);
@ -329,7 +329,7 @@ void func_802B2C58(void) {
void func_802B2D50(void) {
func_80294378(1);
func_802920FC(1.0f);
playerModel_setScale(1.0f);
}
void func_802B2D80(s32 arg0) {

View File

@ -34,9 +34,9 @@ void func_802B5480(void) {
if (func_80294574()) {
if (randf() > 0.5) {
func_8029223C(sp2C);
playerModel_8029223C(sp2C);
} else {
func_80292260(sp2C);
playerModel_80292260(sp2C);
}
sp28 = func_8029B950(&sp2C, 0.0f);
particleEmitter_setParticleVelocityRange(sp28, -60.0f, -100.0f, -60.0f, 60.0f, 0.0f, 60.0f);

View File

@ -567,9 +567,9 @@ void bswalrus_sled_update(void){
if(50.0f < func_80297AB8()){
if(func_8023DB4C(1)){
func_80292554(&sp20);
playerModel_80292554(&sp20);
}else{
func_80292578(&sp20);
playerModel_80292578(&sp20);
}
particleEmitter_emitN(func_802F1EC8(sp20), 1);
}//L802B927C

View File

@ -677,9 +677,9 @@ void func_8029C4E4(bool arg0) {
if (func_80294574()) {
if (arg0) {
func_80292260(sp3C);
playerModel_80292260(sp3C);
} else {
func_8029223C(sp3C);
playerModel_8029223C(sp3C);
}
sp3C[1] = func_80294500();
sp38 = yaw_get();

View File

@ -26,7 +26,7 @@ f32 D_8037D240;
/* .code */
void func_8029DBF0(void){
s32 temp_s0;
switch(func_80291FAC()){
switch(playerModel_getModelId()){
case 0x34D: //L8029DC24
case 0x34E: //L8029DC24
temp_s0 = (s32) func_80257C48(D_8037D23C, 1.0f, 8.0f);
@ -61,7 +61,7 @@ void func_8029DD6C(void) {
bool temp_s0;
func_8033A1FC();
switch (func_80291FAC()) {
switch (playerModel_getModelId()) {
case 0x34D:
case 0x34E:
func_8033A45C(1, D_8037D238);

View File

@ -22,8 +22,8 @@ void func_802AE4E0(s32 arg0) {
func_8025A6CC(COMUSIC_43_ENTER_LEVEL_GLITTER, 32000);
func_8025AABC(COMUSIC_43_ENTER_LEVEL_GLITTER);
func_8029E3C0(0, 0.4f);
func_80291FB8(0);
func_80291D04();
playerModel_setEnvAlpha(0);
playerModel_updateModel();
break;
case 3:
comusic_8025AB44(COMUSIC_43_ENTER_LEVEL_GLITTER, 0, 2000);
@ -120,7 +120,7 @@ void func_802AEA2C(void) {
case 2:
func_802AE914();
sp20 = func_8029E1A8(0);
func_80291FB8((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 255.0f, 0.0f));
playerModel_setEnvAlpha((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 255.0f, 0.0f));
if (sp20) {
func_802AE4E0(3);
}
@ -137,5 +137,5 @@ void func_802AEA2C(void) {
void func_802AEB24(void){
func_802AE874();
func_80294378(1);
func_80291D04();
playerModel_updateModel();
}

View File

@ -25,7 +25,7 @@ void bsdronevanish_setState(s32 next_state) {
break;
case 3:
gcpausemenu_returnToLair();
func_802921C8(0);
playerModel_setVisible(FALSE);
comusic_8025AB44(COMUSIC_43_ENTER_LEVEL_GLITTER, 0, 2000);
func_8029E3C0(0, 2.0f);
break;
@ -115,7 +115,7 @@ void bsdronevanish_update(void) {
case 2:
func_802AF550();
sp20 = func_8029E1A8(0);
func_80291FB8((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 0.0f, 255.0f));
playerModel_setEnvAlpha((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 0.0f, 255.0f));
if (sp20) {
bsdronevanish_setState(3);
}
@ -132,5 +132,5 @@ void bsdronevanish_update(void) {
void func_802AF768(void){
func_802AF4B0();
func_80294378(1);
func_80291D04();
playerModel_updateModel();
}

View File

@ -52,7 +52,7 @@ Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp48[1] = this->yaw;
sp48[2] = this->roll;
sp44 = ml_map_f(sp54[1] - sp40, 0.0f, 300.0f, 0.43f, 0.28f);
modelRender_preDraw(func_802CA790, this);
modelRender_preDraw((GenMethod_1)func_802CA790, (s32)this);
modelRender_draw(gfx, mtx, this->position, sp48, sp44, NULL, func_80330B1C(marker));
return this;
}

View File

@ -20,7 +20,7 @@ extern void func_8035644C(s32);
extern void func_8035646C(s32 arg0);
extern void func_80291634(ActorMarker *, ActorMarker *);
extern void func_80291610(ActorMarker *, ActorMarker *);
extern void func_80291AAC(void);
extern void playerModel_80291AAC(void);
extern void func_8028D7B8(s32 arg0, ActorMarker *arg1, struct5Cs *collision_flags);
extern void func_802EE6CC(f32[3], s32, s32[4], s32, f32, f32, s32,s32,s32);
extern void func_80320ED8(ActorMarker *, f32, s32);
@ -861,7 +861,7 @@ void func_8028BCA0(Prop *prop){
void playerMarker_init(void){
f32 sp1C[3];
_player_getPosition(sp1C);
playerMarker = func_8032FBE4(sp1C, func_80291AAC, 1, 0);
playerMarker = func_8032FBE4(sp1C, playerModel_80291AAC, 1, 0);
playerMarker->unk2C_1 = 1;
marker_setCollisionScripts(playerMarker, NULL, func_80291634, func_80291610);
func_803300B8(playerMarker, func_8028D7B8);
@ -907,7 +907,7 @@ void func_8028D2E4(void){
func_8032F64C(sp168, playerMarker);
for(D_8037BF8C = NULL, i = 0, temp_s2 = 0; i < 2;i++){//L8028D3DC
D_8037BF90 = i;
func_80292284(sp174, i); //get top of player?
playerModel_80292284(sp174, i); //get top of player?
playerMarker->unk38[0] = sp174[0] - sp168[0];
playerMarker->unk38[1] = sp174[1] - sp168[1];
playerMarker->unk38[2] = sp174[2] - sp168[2];

View File

@ -592,7 +592,7 @@ s32 func_802E48D8(void){
modelRender_defrag();
func_8028FB68();
func_802F0E58();
func_8030A298();
levelModel_defrag();
func_803086B4();
func_8032AF94();
func_802C4320();

View File

@ -18,7 +18,7 @@ void func_802EA060(struct58s **arg0, BKAnimationList *anim_list){
end_ptr = (Mtx *)(sp24->size_40*sizeof(Mtx) + (s32)sp24 +sizeof(struct58s));
mlMtxIdent();
for(i_ptr = sp24->data; i_ptr < end_ptr; i_ptr++){
func_802513B0(i_ptr);
mlMtxGet(i_ptr);
}
}
@ -39,7 +39,7 @@ struct58s *func_802EA154(void){
this->size_40 = 0;
this->capacity_44 = 0;
mlMtxIdent();
func_802513B0(this);
mlMtxGet(this);
return this;
}
@ -95,7 +95,7 @@ void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){
mlMtxScale_xyz(sp68[0], sp68[1], sp68[2]);
mlMtxTranslate(-s0->unk0[0], -s0->unk0[1], -s0->unk0[2]);
func_802513B0(i_ptr);
mlMtxGet(i_ptr);
}
}

View File

@ -374,7 +374,7 @@ s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
{
mlMtxIdent();
func_80252C08(position, rotation, scale, arg4);
func_802513B0(&D_80380880);
mlMtxGet(&D_80380880);
phi_v0 = func_802EB8A0(arg0, position, rotation, scale, arg4, arg5, arg6, arg7);
if (phi_v0 == 0)
{

View File

@ -330,7 +330,7 @@ void func_802F2ED0(Struct64s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
mlMtxIdent();
mlMtxRotPitch(-sp38[0]);
mlMtxRotYaw(-sp38[1]);
func_802513B0(&D_80380A18);
mlMtxGet(&D_80380A18);
for(phi_s0 = arg0->unk0; phi_s0 < arg0->unk0 + arg0->unk4; phi_s0++){
if (phi_s0->unk23 & 1) {
func_802F1FC0(phi_s0, gfx, mtx, vtx);

View File

@ -113,7 +113,7 @@ void func_8028DE0C(enum actor_e actor_id){
Actor *actor;
f32 sp20[3];
banjo_getPosition(sp20);
playerModel_getPosition(sp20);
actor = func_8032813C(actor_id, sp20, (s32) yaw_get());
actor->unk138_22 = TRUE;
func_802948F8(actor->marker);

View File

@ -233,7 +233,7 @@ void func_8028E668(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3) {
void func_8028E6A4(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
if (D_8037BFB8) {
eggShatter_draw(gfx, mtx, vtx);
func_80291AF0(gfx, mtx, vtx);
playerModel_draw(gfx, mtx, vtx);
}
}
@ -316,7 +316,7 @@ f32 func_8028E904(void){
f32 func_8028E924(f32 arg0[3], s32 arg1){
s32 *sp1C;
func_80292284(arg0, arg1);
playerModel_80292284(arg0, arg1);
func_8028D6F0(&sp1C);
return (f32) sp1C[arg1];
}
@ -336,19 +336,19 @@ void player_getPosition(f32 dst[3]){
void func_8028E9C4(s32 arg0, f32 arg1[3]) {
switch(arg0){
case 1: //L8028E9EC
banjo_getPosition(arg1);
playerModel_getPosition(arg1);
break;
case 2: //L8028E9FC
func_802924E8(arg1);
playerModel_802924E8(arg1);
break;
case 3: //L8028EA0C
func_8029223C(arg1);
playerModel_8029223C(arg1);
break;
case 4: //L8028EA1C
func_80292260(arg1);
playerModel_80292260(arg1);
break;
case 5: //L8028EA2C
@ -603,7 +603,7 @@ bool func_8028F12C(void){
}
bool func_8028F150(void){
return func_80292548();
return playerModel_isVisible();
}
bool func_8028F170(void){
@ -951,7 +951,7 @@ void func_8028FCBC(void){
}
void func_8028FCC8(bool arg0){
func_802921C8(arg0);
playerModel_setVisible(arg0);
}
void func_8028FCE8(void) {

View File

@ -32,10 +32,10 @@ void func_80290494(void){
f32 sp2C[3];
ParticleEmitter *sp28;
if(!D_8037C03D || player_getTransformation() != TRANSFORM_1_BANJO){
func_802924E8(sp2C);
playerModel_802924E8(sp2C);
}
else{
func_802924B8(sp2C);
playerModel_802924B8(sp2C);
}
sp28 = func_8029B950(sp2C, 0.0f);
particleEmitter_setParticleVelocityRange(sp28, -15.0f, 0.0f, -15.0f, 15.0f, 50.0f, 15.0f);

View File

@ -19,7 +19,7 @@ void func_80291930(s32 arg0){
func_8029E3C0(5, 2.0f);
func_8029C984();
bs_setState(BS_5A_LOADZONE);
func_802921C8(0);
playerModel_setVisible(FALSE);
func_802978DC(7);
func_8029151C(6);
}

View File

@ -1,392 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80254008(void);
extern void func_80256E24(f32[3], f32, f32, f32, f32, f32);
void assetcache_release(void *); //assetcache_free
extern void ml_vec3f_assign(f32[3], f32, f32, f32);
void func_8033A280(f32);
void func_80292048(s32, f32, f32, f32);
void func_80292090(s32 arg0);
void func_802920FC(f32);
void func_8029217C(f32);
void func_802921C8(s32 arg0);
extern s32 D_80000310;
/* .data */
struct5Bs *D_80363780 = NULL;
/* .bss */
void *D_8037C0E0; //playerModelPtr
s16 D_8037C0E4; //playerModel asset_id
u8 D_8037C0E6;
u8 D_8037C0E7;
u8 D_8037C0E8;
f32 D_8037C0EC;
f32 D_8037C0F0;
f32 D_8037C0F4;
f32 D_8037C0F8;
f32 D_8037C100[3];
f32 D_8037C110[3];
f32 D_8037C120[3];
void (*D_8037C12C)(Gfx **gfx, Mtx **mtx, Vtx **vtx);
f32 D_8037C130[2][4];
struct {
u8 unk0;
f32 unk4[3];
} D_8037C150;
//public
void playerModel_set(s32 asset_id);
//.data
void func_802919F0(void){
switch(D_8037C0E7){
case 2:
D_8037C0F8 = mlNormalizeAngle(yaw_get() + 180.0f);
break;
default:
D_8037C0F8 = yaw_get();
break;
case 3:
break;
}
}
void func_80291A60(s32 arg0, f32 arg1[3]){
func_8034A174(D_80363780, arg0, arg1);
if(func_802582EC(arg1)){
_player_getPosition(arg1);
}
}
int func_80291AAC(s32 arg0, s32 arga, s32 arg2, s32 arg3){
return 0;
}
void func_80291AC4(int arg0){
_player_getMarker()->unk14_21 = 1;
}
void func_80291AF0(Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 sp5C[3];
s32 sp50[3];
f32 plyr_pos[3]; //sp44
f32 sp38[3];
if(!D_8037C0E8)
return;
func_802919F0();
D_8037C0F4 = roll_get();
D_8037C0F0 = pitch_get();
_player_getPosition(plyr_pos);
plyr_pos[1] += 2.0f;
ml_vec3f_assign(sp5C, D_8037C0F0, D_8037C0F8, D_8037C0F4);
func_8029A47C(sp50);
ml_vec3f_copy(sp38, D_8037C100);
plyr_pos[0] += D_8037C120[0];\
plyr_pos[1] += D_8037C120[1];\
plyr_pos[2] += D_8037C120[2];
sp38[0] += D_8037C120[0];\
sp38[1] += D_8037C120[1];\
sp38[2] += D_8037C120[2];
if(D_8037C0E0){
func_80289F30();
func_8029DD6C();
modelRender_setEnvColor(sp50[0], sp50[1], sp50[2], D_8037C0E6);
func_8033A280(2.0f);
modelRender_preDraw(func_80291AC4, 0);
func_8033A450(D_80363780);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
if(D_8037C150.unk0){
D_8037C150.unk0 = 0;
modelRender_draw(gfx, mtx, D_8037C150.unk4, sp5C, D_8037C0EC, sp38, D_8037C0E0);
}
else{
modelRender_draw(gfx, mtx, plyr_pos, sp5C, D_8037C0EC, sp38, D_8037C0E0);
}
}//L80291CD4
if(D_8037C12C){
D_8037C12C(gfx, mtx, vtx);
}
}
void func_80291D04(void){
playerModel_set(func_802985F0());
}
void func_80291D2C(void){
f32 plyr_pos[3];
int i;
for(i = 0; i < 2 ; i++){
func_80292048(i, 0.0f, 0.0f, 0.0f);
func_80292078(i, 0.0f);
}
D_8037C0E6 = -1;
D_8037C0E0 = NULL;
D_8037C0E4 = 0;
D_8037C12C = 0;
D_80363780 = func_8034A2C8();
func_8034A130(D_80363780);
ml_vec3f_clear(D_8037C100);
ml_vec3f_clear(D_8037C110);
ml_vec3f_clear(D_8037C120);
D_8037C0F8 = D_8037C0F4 = D_8037C0F0 = 0.0f;
D_8037C150.unk0 = 0;
func_802921C8(1);
func_802920FC(1.0f);
D_8037C0E7 = 0;
func_80292090(1);
if(!func_8028ADB4())
func_80291D04();
player_getPosition(plyr_pos);
func_802C3F04(func_802C4140, 0x17,
reinterpret_cast(s32, plyr_pos[0]),
reinterpret_cast(s32, plyr_pos[1]),
reinterpret_cast(s32, plyr_pos[2])
);
}
void func_80291E88(void){
assetcache_release(D_8037C0E0);
D_8037C0E0 = NULL;
D_8037C0E4 = 0;
func_8034A2A8(D_80363780);
D_80363780 = NULL;
}
void func_80291ECC(void){
f32 sp1C;
f32 temp_f0;
sp1C = D_8037C110[1] - D_8037C100[1];
temp_f0 = mlAbsF(sp1C);
if( temp_f0 < 0.01){
D_8037C100[1] = D_8037C110[1];
}
else{
if(5.0f < temp_f0){
temp_f0 = 1.0f;
}
if(0.0f < sp1C){
D_8037C100[1] += temp_f0;
}
else{
D_8037C100[1] -= temp_f0;
}
{//L80291F7C
_player_getMarker()->unk14_21 = 0;
}
}
}
BKModelBin *func_80291FA0(void){
return D_8037C0E0;
}
enum asset_e func_80291FAC(void){
return D_8037C0E4;
}
void func_80291FB8(s32 arg0){
D_8037C0E6 = arg0;
}
void playerModel_set(s32 asset_id){
if(asset_id != D_8037C0E4){
if(D_8037C0E0){
func_80254008();
assetcache_release(D_8037C0E0);
D_8037C0E0 = NULL;
}
D_8037C0E4 = asset_id;
if(D_8037C0E4)
D_8037C0E0 = assetcache_get(D_8037C0E4);
}
}
void func_80292048(s32 arg0, f32 arg1, f32 arg2, f32 arg3){
D_8037C130[arg0][2] = arg1;
D_8037C130[arg0][3] = arg2;
D_8037C130[arg0][1] = arg3;
}
void func_80292078(s32 arg0, f32 arg1){
D_8037C130[arg0][0] = arg1;
}
void func_80292090(s32 arg0){
if(arg0 != D_8037C0E7){
if(arg0 == 2 || 2 == D_8037C0E7){
yaw_setIdeal(mlNormalizeAngle(yaw_get() + 180.0f));
yaw_applyIdeal();
}
}
D_8037C0E7 = arg0;
}
void func_802920FC(f32 arg0){
if(D_80000310 + -0x17D7){
arg0 = arg0*0.25;
}
D_8037C0EC = arg0;
}
void func_80292134(f32 arg0){
D_8037C0F8 = mlNormalizeAngle(arg0);
}
void func_80292158(f32 arg0){
D_8037C100[1] = arg0;
func_8029217C(arg0);
}
void func_8029217C(f32 arg0){
D_8037C110[1] = arg0;
}
void func_80292188(void (*draw_func)(Gfx **gfx, Mtx **mtx, Vtx **vtx)){
D_8037C12C = draw_func;
}
void func_80292194(f32 arg0[3]){
ml_vec3f_copy(D_8037C120, arg0);
}
void func_802921BC(f32 arg0){
D_8037C120[1] = arg0;
}
void func_802921C8(s32 arg0){
D_8037C0E8 = arg0;
}
void func_802921D4(f32 arg0[3]){
if(func_8028EE84() == BSWATERGROUP_0_NONE){
D_8037C150.unk0 = 1;
D_8037C150.unk4[0] = arg0[0];
D_8037C150.unk4[1] = arg0[1];
D_8037C150.unk4[2] = arg0[2];
}
}
f32 func_80292224(void){
return D_8037C0F8;
}
f32 func_80292230(void){
return D_8037C100[1];
}
void func_8029223C(f32 arg0[3]){
func_80291A60(8, arg0);
}
void func_80292260(f32 arg0[3]){
func_80291A60(7, arg0);
}
void func_80292284(f32 arg0[3], s32 arg1){
f32 sp44[3];
f32 sp38[3];
if(_player_getMarker()->unk14_21 && D_8037C0E8){
switch(func_80291FAC()){
case 0x34D:
case 0x34E:
case ASSET_34F_MODEL_BANJO_TERMITE: //802922E8
case ASSET_359_MODEL_BANJO_WALRUS: //802922E8
case ASSET_362_MODEL_BANJO_BEE:
case ASSET_36F_MODEL_BANJO_PUMPKIN:
case ASSET_374_MODEL_BANJO_CROC:
func_8034A174(D_80363780, arg1 + 1, arg0);
if(func_802582EC(arg0)){
_player_getPosition(arg0);
}
arg0[1] += D_8037C130[arg1][0];
if(D_8037C130[arg1][1] != 0.0f){
func_80256E24(sp44, D_8037C130[arg1][2], mlNormalizeAngle(yaw_get() + D_8037C130[arg1][3]), 0.0f, 0.0f, D_8037C130[arg1][1]);
arg0[0] += sp44[0];
arg0[1] += sp44[1];
arg0[2] += sp44[2];
}
func_802976C0(sp38);
arg0[0] = arg0[0] + sp38[0];
arg0[1] = arg0[1] + sp38[1];
arg0[2] = arg0[2] + sp38[2];
break;
default: ////80292400
_player_getPosition(arg0);
break;
}
}
else{//L80292410
_player_getPosition(arg0);
if(arg1){
arg0[1] += 33.0f;
}
else{
arg0[1] += 75.0f;
}
}
}
void banjo_getPosition(f32* dst){
f32 tmp1[3];
f32 tmp2[3];
func_80291A60(5,tmp1);
func_80291A60(6,tmp2);
ml_vec3f_add(dst, tmp1, tmp2);
ml_vec3f_scale(dst, 0.5);
}
void func_802924B8(f32 arg0[3]){
func_80291A60(0xA, arg0);
}
s32 func_802924DC(void){
return D_8037C0E7;
}
void func_802924E8(f32 arg0[3]){
switch(player_getTransformation()){
case TRANSFORM_5_CROC:
func_80291A60(5, arg0);
break;
case TRANSFORM_4_WALRUS: //L80292520
func_80291A60(0xB, arg0);
break;
default: //L80292530
func_80291A60(0x9, arg0);
break;
}
}
s32 func_80292548(void){
return D_8037C0E8;
}
void func_80292554(f32 arg0[3]){
func_80291A60(0x9, arg0);
}
void func_80292578(f32 arg0[3]){
func_80291A60(0xA, arg0);
}
void func_8029259C(void){
if(D_80363780){
D_80363780 = func_8034A348(D_80363780);
}
}

View File

@ -145,7 +145,7 @@ void func_8035D4F0(ActorMarker *marker, s32 arg1){
if(map_get() == MAP_13_GV_MEMORY_GAME){
actor = marker_getActor(marker);
if(actor->state != 9){
if(func_8033F3E8(func_80309744(0), actor->position, 0x190, 0x1A0) == arg1){
if(func_8033F3E8(levelModel_getModel(0), actor->position, 0x190, 0x1A0) == arg1){
func_802C9334(0x1C, actor);
func_8035D2C0(marker, 0);
}

View File

@ -41,7 +41,7 @@ void func_80294828(void){
player_getRotation(banjoRot);
banjo_getPosition(banjoPos);
playerModel_getPosition(banjoPos);
banjoRot[1] = mlNormalizeAngle(banjoRot[1] + D_8037C290.unk4);
banjoPos[1] += D_8037C290.unk0;
func_802947CC(D_8037C298, banjoPos, banjoRot);

View File

@ -218,7 +218,7 @@ void func_80295914(void){
func_80294790();
func_80293DA4();
func_80289D1C();
func_80291D2C();
playerModel_reset();
playerMarker_init();
func_80299900();
func_8029A4D0();
@ -259,7 +259,7 @@ void func_80295B04(void){
func_8029065C();
func_8029175C();
eggShatter_free();
func_80291E88();
playerModel_free();
func_80289DDC();
func_80293E88();
func_802947C4();
@ -299,7 +299,7 @@ void func_80295C14(void){
func_80290108();
eggShatter_update();
func_80292EDC();
func_80291ECC();
playerModel_update();
func_8029842C();
func_8028D2E4();
func_80294890();
@ -321,7 +321,7 @@ void func_80295C14(void){
void func_80295D74(void){
if(D_80363820){
func_80289E74();
func_8029259C();
playerModel_defrag();
eggShatter_defrag();
func_80294750();
func_8029AF1C();

View File

@ -845,7 +845,7 @@ void func_803163A8(gczoombox_t *this, Gfx **gfx, Mtx **mtx) {
if (this->anim_ctrl != NULL) {
func_8028781C(this->anim_ctrl, sp50, 1);
}
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, &sp38, this->model);
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, sp38, this->model);
}
void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) {

View File

@ -6,10 +6,8 @@
extern UNK_TYPE(s32) func_802E8E88(BKCollisionList *, BKVertexList *, f32[3], f32[3], f32, f32[3], s32, s32);
extern UNK_TYPE(s32) func_802E92AC(BKCollisionList *, BKVertexList *, f32[3], f32, f32[3], s32);
extern UNK_TYPE(s32) func_802EC394(BKMeshList *, UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32));
extern s32 func_802EC394(BKModelUnk14List *arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6);
extern void func_802EC458(BKVertexList *, s32[3], s32[3]);
extern void func_8033A494(s32);
extern void modelRender_setEnvColor(s32, s32, s32, s32);
extern void func_802F7BC0(Gfx **, Mtx **, Vtx **);
extern void func_8033A450(s32);
extern void func_8033A45C(s32, s32);
@ -179,7 +177,7 @@ struct {
f32 unk30;
}levelModel;
enum asset_e func_8030A068(void);
enum asset_e levelModel_getOpaModelId(void);
/* .code */
Struct_core2_82000_0 *func_80308F90(enum map_e map_id){
@ -241,7 +239,7 @@ void levelModel_opa_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 temp_a0;
if (func_80320708() && levelSpecificFlags_validateCRC2() && func_80320248()) {
if (func_8030A068() == 0x14CF) {
if (levelModel_getOpaModelId() == ASSET_14CF_MODEL_SM_OPA) {
func_8033A45C(1, 0);
func_8033A45C(2, 1);
}
@ -381,11 +379,11 @@ f32 func_80309724(f32 arg0[3]){
return func_80308FDC(arg0, 0x1e0000);
}
BKModel *func_80309744(s32 arg0){
BKModel *levelModel_getModel(s32 arg0){
return (arg0) ? levelModel.model_xlu : levelModel.model_opa;
}
BKModelBin *func_80309764(s32 arg0){
BKModelBin *levelModel_getModelBin(s32 arg0){
if(arg0 == 0)
return levelModel.model_bin_opa;
if(arg0 == 1)
@ -573,7 +571,7 @@ void levelModel_free(void){
func_8034A2A8(levelModel.unk24);
}
enum asset_e func_8030A068(void){
enum asset_e levelModel_getOpaModelId(void){
return levelModel.unk28->model1_id;
}
@ -647,7 +645,7 @@ void levelModel_setEnvColor(s32 r, s32 g, s32 b){
levelModel.env_blue = b;
}
void func_8030A298(void){
void levelModel_defrag(void){
if(levelModel.unk24 != NULL){
levelModel.unk24 = func_8034A348(levelModel.unk24);
}

View File

@ -615,7 +615,7 @@ s32 D_80383724;
static BKVertexList * modelRenderVextureList;
BKModelUnk20List * D_8038372C;
struct58s * D_80383730;
f32 D_80383734;
f32 modelRenderScale;
struct{
s32 env[4];
@ -665,7 +665,7 @@ Mtx D_80383BF8;
f32 modelRenderCameraPosition[3];
f32 modelRenderCameraRotation[3];
BKModelBin *modelRenderModelBin;
f32 D_80383C58[3];
f32 modelRenderRotation[3];
f32 D_80383C64;
f32 D_80383C68[3];
f32 D_80383C78[3];
@ -718,7 +718,7 @@ void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){
if(!cmd->unkA){
mlMtxRotPitch(modelRenderCameraRotation[0]);
}
mlMtxScale(D_80383734);
mlMtxScale(modelRenderScale);
mlMtxTranslate(-cmd->unkC[0], -cmd->unkC[1], -cmd->unkC[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -932,13 +932,13 @@ void func_80338DCC(Gfx ** gfx, Mtx ** mtx, void *arg2){
f32 sp20[3];
GeoCmdD * cmd = (GeoCmdD *)arg2;
if(cmd->unk14){
sp2C[0] = (f32)cmd->unk8[0] * D_80383734;
sp2C[1] = (f32)cmd->unk8[1] * D_80383734;
sp2C[2] = (f32)cmd->unk8[2] * D_80383734;
sp2C[0] = (f32)cmd->unk8[0] * modelRenderScale;
sp2C[1] = (f32)cmd->unk8[1] * modelRenderScale;
sp2C[2] = (f32)cmd->unk8[2] * modelRenderScale;
sp20[0] = (f32)cmd->unkE[0] * D_80383734;
sp20[1] = (f32)cmd->unkE[1] * D_80383734;
sp20[2] = (f32)cmd->unkE[2] * D_80383734;
sp20[0] = (f32)cmd->unkE[0] * modelRenderScale;
sp20[1] = (f32)cmd->unkE[1] * modelRenderScale;
sp20[2] = (f32)cmd->unkE[2] * modelRenderScale;
if(func_8024D374(sp2C, sp20)){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk14));
}
@ -952,10 +952,10 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
GeoCmdE * cmd = (GeoCmdE *)arg2;
if(cmd->unk12 == -1){
sp34[0] = (f32)cmd->unk8[0] * D_80383734;
sp34[1] = (f32)cmd->unk8[1] * D_80383734;
sp34[2] = (f32)cmd->unk8[2] * D_80383734;
sp30 = (f32)cmd->unkE*D_80383734;
sp34[0] = (f32)cmd->unk8[0] * modelRenderScale;
sp34[1] = (f32)cmd->unk8[1] * modelRenderScale;
sp34[2] = (f32)cmd->unk8[2] * modelRenderScale;
sp30 = (f32)cmd->unkE*modelRenderScale;
if(func_8024DB50(sp34, sp30) && cmd->unk10){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->unk10));
}
@ -965,7 +965,7 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp34[1] = (f32)cmd->unk8[1];
sp34[2] = (f32)cmd->unk8[2];
sp30 = (f32)cmd->unkE*D_80383734;
sp30 = (f32)cmd->unkE*modelRenderScale;
if(D_8038371C){
func_802519C8(&D_80383BF8, func_802EA110(D_8038371C, cmd->unk12));
func_8025235C(sp34, sp34);
@ -1009,7 +1009,7 @@ void func_80339124(Gfx ** gfx, Mtx ** mtx, BKGeoList *geo_list){
}while(1);
}
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin){
BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation[3], f32 scale, f32*arg5, BKModelBin* model_bin){
f32 camera_focus[3];
f32 camera_focus_distance;
f32 padEC;
@ -1253,28 +1253,28 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3],
mlMtxIdent();
if(D_80383758.unk18){
func_80252AF0(D_80383758.unk1C, object_position, arg3, scale, arg5);
func_80252AF0(D_80383758.unk1C, object_position, rotation, scale, arg5);
}
else{
func_80252AF0(modelRenderCameraPosition, object_position, arg3, scale, arg5);
func_80252AF0(modelRenderCameraPosition, object_position, rotation, scale, arg5);
}
if(D_803837B0.unk0){
mlMtxRotate(D_803837B0.unk4[0], D_803837B0.unk4[1], D_803837B0.unk4[2]);
}
mlMtxGet(&D_80383BF8);
func_802513B0(&D_80383BF8);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
D_80383734 = scale;
if(arg3){
D_80383C58[0] = arg3[0];
D_80383C58[1] = arg3[1];
D_80383C58[2] = arg3[2];
modelRenderScale = scale;
if(rotation){
modelRenderRotation[0] = rotation[0];
modelRenderRotation[1] = rotation[1];
modelRenderRotation[2] = rotation[2];
}
else{
D_80383C58[0] = D_80383C58[1] = D_80383C58[2] = 0.0f;
modelRenderRotation[0] = modelRenderRotation[1] = modelRenderRotation[2] = 0.0f;
}
func_80339124(gfx, mtx, (BKGeoList *)((u8 *)model_bin + model_bin->geo_list_offset_4));

388
src/core2/playerModel.c Normal file
View File

@ -0,0 +1,388 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/playerModel.h"
void func_80254008(void);
extern void func_80256E24(f32[3], f32, f32, f32, f32, f32);
void assetcache_release(void *); //assetcache_free
extern void ml_vec3f_assign(f32[3], f32, f32, f32);
void func_8033A280(f32);
extern s32 osCicId;
/* .data */
struct5Bs *D_80363780 = NULL;
/* .bss */
void *playerModelBin; //playerModelPtr
s16 playerModelId; //playerModel asset_id
u8 playerModelEnvAlpha;
u8 playerModelDirection;
u8 playerModelIsVisible;
f32 playerModelScale;
f32 playerModelPitch;
f32 playerModelRoll;
f32 playerModelYaw;
f32 D_8037C100[3];
f32 D_8037C110[3];
f32 playerModelDisplacement[3];
void (*playerModelPostDrawMethod)(Gfx **gfx, Mtx **mtx, Vtx **vtx);
f32 D_8037C130[2][4];
struct {
u8 unk0;
f32 unk4[3];
} D_8037C150;
//public
void playerModel_set(enum asset_e asset_id);
//.data
static void _playerModel_updateModelYaw(void){
switch(playerModelDirection){
case PLAYER_MODEL_DIR_KAZOOIE:
playerModelYaw = mlNormalizeAngle(yaw_get() + 180.0f);
break;
default:
playerModelYaw = yaw_get();
break;
case PLAYER_MODEL_DIR_GLOBAL:
break;
}
}
void playerModel_80291A50(s32 arg0, f32 arg1[3]){
func_8034A174(D_80363780, arg0, arg1);
if(func_802582EC(arg1)){
_player_getPosition(arg1);
}
}
int playerModel_80291AAC(s32 arg0, s32 arga, s32 arg2, s32 arg3){
return 0;
}
static void _playerModel_preDraw(int arg0){
_player_getMarker()->unk14_21 = 1;
}
void playerModel_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 rotation[3];
s32 env_color[3];
f32 plyr_pos[3]; //sp44
f32 sp38[3];
if(!playerModelIsVisible)
return;
_playerModel_updateModelYaw();
playerModelRoll = roll_get();
playerModelPitch = pitch_get();
_player_getPosition(plyr_pos);
plyr_pos[1] += 2.0f;
ml_vec3f_assign(rotation, playerModelPitch, playerModelYaw, playerModelRoll);
func_8029A47C(env_color);
ml_vec3f_copy(sp38, D_8037C100);
plyr_pos[0] += playerModelDisplacement[0];\
plyr_pos[1] += playerModelDisplacement[1];\
plyr_pos[2] += playerModelDisplacement[2];
sp38[0] += playerModelDisplacement[0];\
sp38[1] += playerModelDisplacement[1];\
sp38[2] += playerModelDisplacement[2];
if(playerModelBin){
func_80289F30();
func_8029DD6C();
modelRender_setEnvColor(env_color[0], env_color[1], env_color[2], playerModelEnvAlpha);
func_8033A280(2.0f);
modelRender_preDraw((GenMethod_1)_playerModel_preDraw, 0);
func_8033A450(D_80363780);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
if(D_8037C150.unk0){
D_8037C150.unk0 = 0;
modelRender_draw(gfx, mtx, D_8037C150.unk4, rotation, playerModelScale, sp38, playerModelBin);
}
else{
modelRender_draw(gfx, mtx, plyr_pos, rotation, playerModelScale, sp38, playerModelBin);
}
}//L80291CD4
if(playerModelPostDrawMethod){
playerModelPostDrawMethod(gfx, mtx, vtx);
}
}
void playerModel_updateModel(void){
playerModel_set(func_802985F0());
}
void playerModel_reset(void){
f32 plyr_pos[3];
int i;
for(i = 0; i < 2 ; i++){
playerModel_80292048(i, 0.0f, 0.0f, 0.0f);
playerModel_80292078(i, 0.0f);
}
playerModelEnvAlpha = 0xFF;
playerModelBin = NULL;
playerModelId = 0;
playerModelPostDrawMethod = NULL;
D_80363780 = func_8034A2C8();
func_8034A130(D_80363780);
ml_vec3f_clear(D_8037C100);
ml_vec3f_clear(D_8037C110);
ml_vec3f_clear(playerModelDisplacement);
playerModelYaw = playerModelRoll = playerModelPitch = 0.0f;
D_8037C150.unk0 = 0;
playerModel_setVisible(TRUE);
playerModel_setScale(1.0f);
playerModelDirection = 0;
playerModel_setDirection(PLAYER_MODEL_DIR_BANJO);
if(!func_8028ADB4())
playerModel_updateModel();
player_getPosition(plyr_pos);
func_802C3F04((GenMethod_4)func_802C4140,
ACTOR_17_PLAYER_SHADOW,
reinterpret_cast(s32, plyr_pos[0]),
reinterpret_cast(s32, plyr_pos[1]),
reinterpret_cast(s32, plyr_pos[2])
);
}
void playerModel_free(void){
assetcache_release(playerModelBin);
playerModelBin = NULL;
playerModelId = 0;
func_8034A2A8(D_80363780);
D_80363780 = NULL;
}
void playerModel_update(void){
f32 sp1C;
f32 temp_f0;
sp1C = D_8037C110[1] - D_8037C100[1];
temp_f0 = mlAbsF(sp1C);
if( temp_f0 < 0.01){
D_8037C100[1] = D_8037C110[1];
}
else{
if(5.0f < temp_f0){
temp_f0 = 1.0f;
}
if(0.0f < sp1C){
D_8037C100[1] += temp_f0;
}
else{
D_8037C100[1] -= temp_f0;
}
{//L80291F7C
_player_getMarker()->unk14_21 = 0;
}
}
}
BKModelBin *playerModel_getModelBin(void){
return playerModelBin;
}
enum asset_e playerModel_getModelId(void){
return playerModelId;
}
void playerModel_setEnvAlpha(s32 alpha){
playerModelEnvAlpha = alpha;
}
void playerModel_set(enum asset_e asset_id){
if(asset_id != playerModelId){
if(playerModelBin){
func_80254008();
assetcache_release(playerModelBin);
playerModelBin = NULL;
}
playerModelId = asset_id;
if(playerModelId)
playerModelBin = assetcache_get(playerModelId);
}
}
void playerModel_80292048(s32 arg0, f32 arg1, f32 arg2, f32 arg3){
D_8037C130[arg0][2] = arg1;
D_8037C130[arg0][3] = arg2;
D_8037C130[arg0][1] = arg3;
}
void playerModel_80292078(s32 arg0, f32 arg1){
D_8037C130[arg0][0] = arg1;
}
void playerModel_setDirection(enum player_model_direction_e direction){
if(direction != playerModelDirection){
if(direction == PLAYER_MODEL_DIR_KAZOOIE || PLAYER_MODEL_DIR_KAZOOIE == playerModelDirection){
//flip model
yaw_setIdeal(mlNormalizeAngle(yaw_get() + 180.0f));
yaw_applyIdeal();
}
}
playerModelDirection = direction;
}
void playerModel_setScale(f32 scale){
if(osCicId + -6103){
scale = scale*0.25;
}
playerModelScale = scale;
}
void playerModel_setYaw(f32 angleDegrees){
playerModelYaw = mlNormalizeAngle(angleDegrees);
}
void playerModel_80292158(f32 arg0){
D_8037C100[1] = arg0;
playerModel_8029217C(arg0);
}
void playerModel_8029217C(f32 arg0){
D_8037C110[1] = arg0;
}
void playerModel_setPostDraw(void (*draw_func)(Gfx **gfx, Mtx **mtx, Vtx **vtx)){
playerModelPostDrawMethod = draw_func;
}
void playerModel_setDisplacement(f32 arg0[3]){
ml_vec3f_copy(playerModelDisplacement, arg0);
}
void playerModel_setYDisplacement(f32 arg0){
playerModelDisplacement[1] = arg0;
}
void playerModel_setVisible(s32 arg0){
playerModelIsVisible = arg0;
}
void playerModel_802921D4(f32 arg0[3]){
if(func_8028EE84() == BSWATERGROUP_0_NONE){
D_8037C150.unk0 = 1;
D_8037C150.unk4[0] = arg0[0];
D_8037C150.unk4[1] = arg0[1];
D_8037C150.unk4[2] = arg0[2];
}
}
f32 playerModel_getYaw(void){
return playerModelYaw;
}
f32 playerModel_80292230(void){
return D_8037C100[1];
}
void playerModel_8029223C(f32 arg0[3]){
playerModel_80291A50(8, arg0);
}
void playerModel_80292260(f32 arg0[3]){
playerModel_80291A50(7, arg0);
}
void playerModel_80292284(f32 arg0[3], s32 arg1){
f32 sp44[3];
f32 sp38[3];
if(_player_getMarker()->unk14_21 && playerModelIsVisible){
switch(playerModel_getModelId()){
case 0x34D:
case 0x34E:
case ASSET_34F_MODEL_BANJO_TERMITE: //802922E8
case ASSET_359_MODEL_BANJO_WALRUS: //802922E8
case ASSET_362_MODEL_BANJO_BEE:
case ASSET_36F_MODEL_BANJO_PUMPKIN:
case ASSET_374_MODEL_BANJO_CROC:
func_8034A174(D_80363780, arg1 + 1, arg0);
if(func_802582EC(arg0)){
_player_getPosition(arg0);
}
arg0[1] += D_8037C130[arg1][0];
if(D_8037C130[arg1][1] != 0.0f){
func_80256E24(sp44, D_8037C130[arg1][2], mlNormalizeAngle(yaw_get() + D_8037C130[arg1][3]), 0.0f, 0.0f, D_8037C130[arg1][1]);
arg0[0] += sp44[0];
arg0[1] += sp44[1];
arg0[2] += sp44[2];
}
func_802976C0(sp38);
arg0[0] = arg0[0] + sp38[0];
arg0[1] = arg0[1] + sp38[1];
arg0[2] = arg0[2] + sp38[2];
break;
default: ////80292400
_player_getPosition(arg0);
break;
}
}
else{//L80292410
_player_getPosition(arg0);
if(arg1){
arg0[1] += 33.0f;
}
else{
arg0[1] += 75.0f;
}
}
}
void playerModel_getPosition(f32* dst){
f32 tmp1[3];
f32 tmp2[3];
playerModel_80291A50(5,tmp1);
playerModel_80291A50(6,tmp2);
ml_vec3f_add(dst, tmp1, tmp2);
ml_vec3f_scale(dst, 0.5);
}
void playerModel_802924B8(f32 arg0[3]){
playerModel_80291A50(0xA, arg0);
}
enum player_model_direction_e playerModel_getDirection(void){
return playerModelDirection;
}
void playerModel_802924E8(f32 arg0[3]){
switch(player_getTransformation()){
case TRANSFORM_5_CROC:
playerModel_80291A50(5, arg0);
break;
case TRANSFORM_4_WALRUS: //L80292520
playerModel_80291A50(0xB, arg0);
break;
default: //L80292530
playerModel_80291A50(0x9, arg0);
break;
}
}
s32 playerModel_isVisible(void){
return playerModelIsVisible;
}
void playerModel_80292554(f32 arg0[3]){
playerModel_80291A50(0x9, arg0);
}
void playerModel_80292578(f32 arg0[3]){
playerModel_80291A50(0xA, arg0);
}
void playerModel_defrag(void){
if(D_80363780){
D_80363780 = func_8034A348(D_80363780);
}
}

View File

@ -78,7 +78,7 @@ extern void func_80324CFC(f32, s16, s16);
extern void gczoombox_open(gczoombox_t *);
extern void gczoombox_maximize(gczoombox_t *);
extern void *func_80309744(s32);
extern void *levelModel_getModel(s32);
extern void func_8029A95C(s32); // set transformation
//typedef migrated to "inlcude/core2/code_C9E70.h"
@ -628,7 +628,7 @@ void lair_func_8038CF18(void)
if (map_get() != MAP_8E_GL_FURNACE_FUN)
return;
D_8037DCB8->unk0 = func_80309744(0);
D_8037DCB8->unk0 = levelModel_getModel(0);
D_8037DCB8->unk11 = 0;
if (func_803203FC(2) && !func_803203FC(4))

View File

@ -599,8 +599,8 @@ player_getVelocity = 0x8028EF68;
player_is_in_jiggy_jig = 0x8028F108;
player_is_present = 0x8028F1D4;
func_8028F45C = 0x8028F45C;
func_80291A60 = 0x80291A60;
banjo_getPosition = 0x80292468;
playerModel_80291A50 = 0x80291A60;
playerModel_getPosition = 0x80292468;
func_802947CC = 0x802947CC;
get_slope_timer = 0x802949D4;
should_beak_barge = 0x80294F00;

View File

@ -1,6 +1,7 @@
osTvType = 0x80000300;
osRomBase = 0x80000308;
osResetType = 0x8000030C;
osCicId = 0x80000310;
osAppNMIBuffer = 0x8000031C;
D_8023DA20 = 0x8023DA20;
gOverlayTable = 0x803FFE10;