various documentation

This commit is contained in:
Banjo Kazooie
2024-07-01 00:28:11 -05:00
parent 676533f2dc
commit 9688497485
104 changed files with 1034 additions and 947 deletions

View File

@@ -36,7 +36,7 @@ int func_802A3350(void){
void func_802A339C(f32 arg0[3], f32 arg1[3], f32 arg2){
func_8024C5A8(arg0);
ml_vec3f_scale(arg0, arg2);
viewport_getRotation(arg1);
viewport_get_rotation_vec3f(arg1);
}
void func_802A33D8(void){

View File

@@ -88,7 +88,7 @@ f32 func_802D7038(Actor *this) {
void func_802D7124(Actor *actor, f32 arg1) {
f32 vp[3];
viewport_getPosition(&vp);
viewport_get_position_vec3f(&vp);
if ((actor->position[0] - vp[0]) * (actor->position[0] - vp[0]) + (actor->position[2] - vp[2]) * (actor->position[2] - vp[2]) < 12250000.0f) {
func_802D729C(actor, arg1);
}
@@ -112,7 +112,7 @@ void func_802D71A0(s32 this, s32 arg1){
sp2C[0] = (s32) D_8037DE10[0];
sp2C[1] = (s32) D_8037DE10[1];
sp2C[2] = (s32) D_8037DE10[2];
sp3C = func_803056FC(0x108, sp2C, (s32)sp38->yaw);
sp3C = spawn_actor(0x108, sp2C, (s32)sp38->yaw);
if(sp3C){
marker_getActor(marker)->unk104 = sp3C->marker;
sp3C->unk104 = marker;

View File

@@ -139,8 +139,8 @@ void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) {
vp_rotation[1] = 270.0f;
vp_rotation[2] = 0.0f;
}
viewport_setPosition(vp_position);
viewport_setRotation(vp_rotation);
viewport_set_position_vec3f(vp_position);
viewport_set_rotation_vec3f(vp_rotation);
viewport_update();
func_8024C904(gfx, mtx);
}
@@ -505,7 +505,7 @@ void chBottlesBonus_update(Actor *this) {
this->unk60 += sp50;
switch(this->state){
case 1:
if ((this->unk60 > 2.0) && gctransition_8030BD98()) {
if ((this->unk60 > 2.0) && gctransition_done()) {
this->unk60 = 0.0f;
func_8025A6EC(COMUSIC_98_BBONUS_PIECES_SHUFFLE, -1);
comusic_8025AB44(COMUSIC_95_BBONUS_A, 0, 2000);

View File

@@ -88,11 +88,11 @@ void func_802CDAC4(Actor *this){
f32 sp1C[3];
camera_setType(1);
viewport_setPosition(this->position);
viewport_set_position_vec3f(this->position);
sp1C[0] = this->pitch;
sp1C[1] = this->yaw;
sp1C[2] = 0.0f;
viewport_setRotation(sp1C);
viewport_set_rotation_vec3f(sp1C);
}
void func_802CDB18(Actor *this){

View File

@@ -3,9 +3,9 @@
#include "variables.h"
#include "core2/particle.h"
Actor *func_8035ECA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_8035F138(Actor *this);
extern bool func_803257B4(ActorMarker *marker);
extern void actor_postdrawMethod(ActorMarker *);
extern f32 func_80257204(f32, f32, f32, f32);

View File

@@ -40,8 +40,8 @@ Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vt
func_8024E258();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};
viewport_setPosition(sp58);
viewport_setRotation(sp4C);
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_update();
func_8024C904(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};

View File

@@ -50,8 +50,8 @@ Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx
func_8024E258();
{sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;};
{sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;};
viewport_setPosition(sp58);
viewport_setRotation(sp4C);
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_update();
func_8024C904(gdl, mptr);
{sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;};

View File

@@ -85,12 +85,12 @@ void chShrapnel_emitSmoke(Actor *this) {
func_802EFB84(temp_v0, 2.0f, 3.0f);
particleEmitter_setParticleSpawnPositionRange(temp_v0, -75.0f, 25.0f, -75.0f, 75.0f, 75.0f, 75.0f);
particleEmitter_setParticleVelocityRange(temp_v0, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f);
particleEmitter_setRGB(temp_v0, &D_803673F8);
particleEmitter_setRGB(temp_v0, D_803673F8);
particleEmitter_setParticleLifeTimeRange(temp_v0, 3.0f, 4.0f);
particleEmitter_emitN(temp_v0, 6);
}
void chShrapnel_emitBodyParts(Actor *this, enum model_e model_id, s32 n) {
void chShrapnel_emitBodyParts(Actor *this, enum asset_e model_id, s32 n) {
ParticleEmitter *temp_v0;
temp_v0 = partEmitMgr_newEmitter(n);

View File

@@ -3,8 +3,9 @@
#include "variables.h"
extern void func_80329904(ActorMarker *, s32, f32 *);
extern int func_80320C94(f32 (*)[3], f32(*)[3], f32, s32, s32, u32);
extern f32 func_8033229C(ActorMarker *);
extern BKCollisionTri *func_80320C94(f32[3], f32[3], f32, f32[3], s32, u32);
typedef struct{
s32 unk0;

View File

@@ -52,7 +52,7 @@ void __chTermite_updateWalkSFX(Actor *this) {
f32 sp24[3];
f32 sp20;
viewport_getPosition(&sp24);
viewport_get_position_vec3f(&sp24);
sp20 = ml_map_f( (300.0f - sp24[0])*(300.0f - sp24[0]) + (this->position[1] - sp24[1])*(this->position[1] - sp24[1]) + (-858.0f - sp24[2])*(-858.0f - sp24[2])
, 7617600.0f, 8236900.0f
, 8000.0f, 1000.0f

View File

@@ -203,7 +203,7 @@ f32 func_8029B41C(void){
f32 sp1C;
player_getPosition(sp2C);
viewport_getPosition(sp20);
viewport_get_position_vec3f(sp20);
func_80257F18(sp2C, sp20, &sp1C);
return sp1C;
}
@@ -363,7 +363,7 @@ void func_8029B984(f32 dst[3]){
f32 sp18[3];
_player_getPosition(plyr_pos);
viewport_getPosition(sp18);
viewport_get_position_vec3f(sp18);
ml_vec3f_diff_copy(dst, sp18, plyr_pos);
}

View File

@@ -33,8 +33,8 @@ void func_802BAC58(void) {
f32 vp_rotation[3];
f32 sp1C[3];
viewport_getPosition(vp_position);
viewport_getRotation(vp_rotation);
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
func_802BEA4C(vp_rotation, vp_position, 150.0f, sp1C);
if (D_8037D810 == NULL) {
D_8037D810 = func_8032FBE4(sp1C, func_802BABC0, 1, 0x15D);

View File

@@ -106,7 +106,7 @@ f32 func_802BB938(f32 arg0[3], f32 arg1[3]) {
phi_f20 = 65.0f;
}
if (gctransition_8030BDAC()) {
if (gctransition_active()) {
phi_f20 = ml_min_f(phi_f20, gctransition_8030BD88() * 0.8);
}
return phi_f20;
@@ -120,8 +120,8 @@ void func_802BBA84(void) {
f32 max[3];
mapModel_getBounds(min, max);
viewport_getPosition(vp_position);
viewport_getRotation(vp_rotation);
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
func_8024C5A8(sp48);
D_8037D8CC = (f32) func_8033EAF8(min, max, vp_position, sp48);
D_8037D8CC += 100.0f;
@@ -295,11 +295,11 @@ void ncCamera_update(void){
break;
}
viewport_getPosition(sp2C);
viewport_getRotation(sp20);
viewport_get_position_vec3f(sp2C);
viewport_get_rotation_vec3f(sp20);
func_802BB4D8(sp2C, sp20);
viewport_setPosition(sp2C);
viewport_setRotation(sp20);
viewport_set_position_vec3f(sp2C);
viewport_set_rotation_vec3f(sp20);
viewport_update();
func_802BEFB0();
func_802BBA84();
@@ -352,8 +352,8 @@ void func_802BC2CC(s32 arg0) {
if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) {
func_802BE894(D_8037D918, D_8037D908);
}
viewport_setPosition(D_8037D908);
viewport_setRotation(D_8037D918);
viewport_set_position_vec3f(D_8037D908);
viewport_set_rotation_vec3f(D_8037D918);
viewport_update();
__spawnQueue_add_2((GenFunction_2)func_802BC2A0, reinterpret_cast(s32, sp24), reinterpret_cast(s32, sp20));
if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) {

View File

@@ -94,7 +94,7 @@ void func_802BEFB0(void) {
return;
}
D_8037DA80.unk10 += time_getDelta();
viewport_getPosition(sp30);
viewport_get_position_vec3f(sp30);
sp24[0] = sp30[0];
sp24[1] = sp30[1] + 10000.0f;
sp24[2] = sp30[2];

View File

@@ -63,7 +63,7 @@ void func_802CA92C(Actor *this){
f32 sp28[3];
this->marker->collidable = FALSE;
player_getPosition(this->position);
viewport_getPosition(sp34);
viewport_get_position_vec3f(sp34);
ml_vec3f_diff_copy(sp28, sp34, this->position);
ml_vec3f_set_length_copy(sp28, sp28, 180.0f);
this->position_x += sp28[0];

View File

@@ -434,7 +434,7 @@ void func_802CCC5C(Actor *this) {
}
if (this->state == 1) {
player_getPosition(sp8C);
viewport_getPosition(sp80);
viewport_get_position_vec3f(sp80);
func_8024C5A8(sp74);
sp5C[0] = this->position[0] - sp80[0];
sp5C[1] = this->position[1] - sp80[1];

View File

@@ -38,8 +38,8 @@ Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
vp_rotation[2] = 0.0f;
viewport_setPosition(vp_position);
viewport_setRotation(vp_rotation);
viewport_set_position_vec3f(vp_position);
viewport_set_rotation_vec3f(vp_rotation);
viewport_update();
func_8024C904(gfx, mtx);
model_position[0] = 0.0f;

View File

@@ -37,8 +37,8 @@ Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
sp4C[0] = 0.0f;
sp4C[1] = 0.0f;
sp4C[2] = 0.0f;
viewport_setPosition(sp58);
viewport_setRotation(sp4C);
viewport_set_position_vec3f(sp58);
viewport_set_rotation_vec3f(sp4C);
viewport_update();
func_8024C904(gfx, mtx);
sp40[0] = 0.0f;

View File

@@ -145,6 +145,6 @@ void func_802E08F0(Actor *this) {
if (actor_animationIsAt(this, 0.99f) != 0) {
marker_despawn(this->marker);
}
viewport_getRotation(sp24);
viewport_get_rotation_vec3f(sp24);
this->yaw = sp24[1];
}

View File

@@ -5,8 +5,8 @@
#include "gc/gctransition.h"
extern void func_8024C510(f32);
extern void func_8024CDF8(f32, f32, f32);
extern void func_8024CE40(f32, f32, f32);
extern void viewport_set_position_f3(f32, f32, f32);
extern void viewport_set_rotation_f3(f32, f32, f32);
extern void func_8024CE60(f32, f32);
extern void func_802F5374(void);
extern void func_802FA0F8(void);
@@ -64,8 +64,8 @@ struct{
} D_8037E8E0;
void func_802E3800(void){
func_8024CDF8(0.0f, 0.0f, 0.0f);
func_8024CE40(-30.0f, 30.0f, 0.0f);
viewport_set_position_f3(0.0f, 0.0f, 0.0f);
viewport_set_rotation_f3(-30.0f, 30.0f, 0.0f);
func_8024C510(3000.0f);
viewport_update();
}
@@ -79,13 +79,13 @@ void func_802E3854(void){
func_802E6820(5);
modelRender_defrag();
mapSavestate_defrag_all();
gctransition_8030B740();
func_802F542C();
gctransition_defrag();
printbuffer_defrag();
func_80350E00();
func_802FA4E0();
func_8033B5FC();
timedFuncQueue_defrag();
func_8025AF38();
comusic_defrag();
}
}
@@ -536,7 +536,7 @@ bool func_802E4424(void) {
&& func_8028F070()
&& (func_8028EC04() == 0)
&& !gctransition_8030BDC0()
&& gctransition_8030BD98()
&& gctransition_done()
&& (level_get() != 0)
&& (0.6 < D_8037E8E0.unk10)
&& gcpausemenu_80314B00()
@@ -596,7 +596,7 @@ s32 game_defrag(void){
actorArray_defrag();
spawnQueue_defrag();
func_802F3300();
func_802F542C();
printbuffer_defrag();
gcdialog_defrag();
if(D_8037E8E0.game_mode == GAME_MODE_4_PAUSED)
gcpausemenu_defrag();

View File

@@ -971,29 +971,30 @@ BKCollisionTri *func_802E92AC(BKCollisionList *collisionList, BKVertexList *vert
return spD0;
}
s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 arg2[3], f32 *arg3, f32 arg4, f32 arg5[3], f32 arg6, f32 arg7[3], s32 arg8) {
s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 posA[3], f32 *rotA, f32 scaleA, f32 posB[3], f32 radB, f32 arg7[3], s32 arg8) {
f32 sp34[3];
s32 sp30;
s32 i;
if ((vtxList->global_norm * arg4) <= (ml_distance_vec3f(arg5, arg2) - arg6)) {
// check if (sphere around vtx's) <= ((distance between origins) - (radius of B))
if ((vtxList->global_norm * scaleA) <= (ml_distance_vec3f(posB, posA) - radB)) {
return 0;
}
mlMtxIdent();
func_80252CC4(arg2, arg3, arg4, 0);
func_8025235C(sp34, arg5);
sp30 = func_802E92AC(collisionList, vtxList, &sp34, arg6 / arg4, arg7, arg8);
func_80252CC4(posA, rotA, scaleA, NULL);
func_8025235C(sp34, posB);
sp30 = func_802E92AC(collisionList, vtxList, &sp34, radB / scaleA, arg7, arg8);
if (sp30 == 0) {
return 0;
}
mlMtxIdent();
func_80252C08(arg2, arg3, arg4, NULL);
func_8025235C(arg5, sp34);
func_80252C08(posA, rotA, scaleA, NULL);
func_8025235C(posB, sp34);
mlMtxIdent();
func_80252C08(NULL, arg3, 1.0f, NULL);
func_80252C08(NULL, rotA, 1.0f, NULL);
func_8025235C(arg7, arg7);
mlMtxIdent();
func_80252C08(arg2, arg3, arg4, NULL);
func_80252C08(posA, rotA, scaleA, NULL);
for(i = 0; i < 3; i++){
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]);

View File

@@ -4,7 +4,7 @@
extern void func_80252C08(f32[3], f32[3], f32, f32[3]);
extern void func_80252CC4(f32[3], f32[3], f32, s32);
extern void func_802524F0(f32[3], f32, f32, f32);
extern void mlMtx_apply_f3(f32[3], f32, f32, f32);
extern s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7, f32 arg8[3]);
/* .bss */
Mtx D_80380880;
@@ -191,10 +191,10 @@ s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
spD0[0] *= 2;
spD0[1] *= 2;
spD0[2] *= 2;
func_802519C8(&D_80380880, animMtxList_get(arg5, i_ptr->unk16));
mlMtx_push_multiplied_2(&D_80380880, animMtxList_get(arg5, i_ptr->unk16));
func_80252E4C(spF4, spD0);
func_802524F0(spB0, spE8[0], spE8[1], spE8[2]);
func_802524F0(sp98, spE8[0], spE8[1], spDC[2]);
mlMtx_apply_f3(spB0, spE8[0], spE8[1], spE8[2]);
mlMtx_apply_f3(sp98, spE8[0], spE8[1], spDC[2]);
spBC[0] = spB0[0] - sp98[0];
spBC[1] = spB0[1] - sp98[1];
spBC[2] = spB0[2] - sp98[2];
@@ -208,7 +208,7 @@ s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
sp8C[1] = arg6[1] - sp98[1];
sp8C[2] = arg6[2] - sp98[2];
if (!(arg7 <= -((sp8C[0]*spBC[0]) + (sp8C[1]*spBC[1]) + (sp8C[2]*spBC[2])))) {
func_802524F0(sp80, spDC[0], spE8[1], spE8[2]);
mlMtx_apply_f3(sp80, spDC[0], spE8[1], spE8[2]);
spBC[0] = spB0[0] - sp80[0];
spBC[1] = spB0[1] - sp80[1];
spBC[2] = spB0[2] - sp80[2];
@@ -219,7 +219,7 @@ s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
sp74[1] = arg6[1] - sp80[1];
sp74[2] = arg6[2] - sp80[2];
if (!(arg7 <= -((sp74[0]*spBC[0]) + (sp74[1]*spBC[1]) + (sp74[2]*spBC[2])))) {
func_802524F0(sp68, spE8[0], spDC[1], spE8[2]);
mlMtx_apply_f3(sp68, spE8[0], spDC[1], spE8[2]);
spBC[0] = spB0[0] - sp68[0];
spBC[1] = spB0[1] - sp68[1];
spBC[2] = spB0[2] - sp68[2];
@@ -270,11 +270,11 @@ s32 func_802EB458(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
spAC[0] = (f32) (i_ptr->unkA[0] * 2);
spAC[1] = (f32) (i_ptr->unkA[1] * 2);
spAC[2] = (f32) (i_ptr->unkA[2] * 2);
func_802519C8(&D_80380880, animMtxList_get(arg5, i_ptr->unkE));
mlMtx_push_multiplied_2(&D_80380880, animMtxList_get(arg5, i_ptr->unkE));
func_80252D8C(spB8, spAC);
func_802524F0(sp98, 0.0f, 0.0f, (f32) ((-i_ptr->unk2) / 2));
func_802524F0(sp8C, 0.0f, 0.0f, (f32) (i_ptr->unk2 / 2));
func_802524F0(sp68, (f32) i_ptr->unk0, 0.0f, (f32) ((-i_ptr->unk2) / 2));
mlMtx_apply_f3(sp98, 0.0f, 0.0f, (f32) ((-i_ptr->unk2) / 2));
mlMtx_apply_f3(sp8C, 0.0f, 0.0f, (f32) (i_ptr->unk2 / 2));
mlMtx_apply_f3(sp68, (f32) i_ptr->unk0, 0.0f, (f32) ((-i_ptr->unk2) / 2));
sp68[0] -= sp98[0];
sp68[1] -= sp98[1];
sp68[2] -= sp98[2];
@@ -445,7 +445,7 @@ s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
i_rotation[2] *= 2;
mlMtxIdent();
func_80252EC8(i_position, i_rotation); //rotate about point
func_80252EC8(i_position, i_rotation); //derotate about point
func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(sp68, arg5); //apply matrix to arg5
for (i = 0; i < 3; i++)
@@ -522,35 +522,35 @@ s32 func_802EC238(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
mlMtxIdent();
func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(sp54, arg5);
for (i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++)
{
if ((i_ptr->unk8 != 0) && ((arg6 == 0) || (arg6 == i_ptr->unk8)))
{
for (i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++) {
if ((i_ptr->unk8 != 0) && ((arg6 == 0) || (arg6 == i_ptr->unk8))) {
sp40[0] = i_ptr->unk2[0];
sp40[1] = i_ptr->unk2[1];
sp40[2] = i_ptr->unk2[2];
scale = i_ptr->unk0;
if (ml_distance_vec3f(sp40, sp54) < scale)
return i_ptr->unk8;
if (!i_ptr->unk0){
}
if (!i_ptr->unk0){ }
}
}
return 0U;
}
s32 func_802EC394(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], s32 arg6) {
s32 func_802EC394(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], s32 arg6) {
s32 phi_v0;
phi_v0 = func_802EBD3C(arg0, arg1, rotation, scale, arg4, arg5, arg6);
//transform type 0
phi_v0 = func_802EBD3C(arg0, position, rotation, scale, arg4, arg5, arg6);
if (phi_v0 != NULL) {
return phi_v0;
}
phi_v0 = func_802EC000(arg0, arg1, rotation, scale, arg4, arg5, arg6);
//transform type 1
phi_v0 = func_802EC000(arg0, position, rotation, scale, arg4, arg5, arg6);
if (phi_v0 != NULL) {
return phi_v0;
}
return func_802EC238(arg0, arg1, rotation, scale, arg4, arg5, arg6);
//transform type 2
return func_802EC238(arg0, position, rotation, scale, arg4, arg5, arg6);
}

View File

@@ -215,7 +215,7 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotati
f32 temp_f0;
s32 pad40;
viewport_getPosition(sp74);
viewport_get_position_vec3f(sp74);
func_8024C5A8(sp68);
mlMtxIdent();
func_80252CC4(arg2, rotation, 1.0f, NULL);

View File

@@ -160,7 +160,7 @@ void func_802F1A10(Struct_Core2_6A4B0_2 *arg0, f32 angle_degrees) {
cos = cosf(angle_degrees * 2 * BAD_PI);
sin = sinf(angle_degrees * 2 * BAD_PI);
viewport_getPosition(spC0);
viewport_get_position_vec3f(spC0);
spCC[0] = (-(framebuffer_width / 2) * 4) + 8;
spCC[1] = ((framebuffer_height / 2) * 4) - 0x38;
spCC[2] = -0xA;
@@ -214,7 +214,7 @@ void func_802F1CAC(Struct_Core2_6A4B0_2 *arg0) {
s32 *var_s2;
viewport_getPosition(sp78);
viewport_get_position_vec3f(sp78);
sp84[0] = (s32) ((1000.0f - sp78[0]) - 200.0f);
sp84[1] = (s32) ((0.0f - sp78[1]) + 300.0f);
sp84[2] = (s32) ((2000.0f - sp78[2]) + 0.0f);

View File

@@ -67,7 +67,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 width;
s32 height;
viewport_getPosition(spDC);
viewport_get_position_vec3f(spDC);
spD0[0] = self->unk0[0] - spDC[0];
spD0[1] = self->unk0[1] - spDC[1];
spD0[2] = self->unk0[2] - spDC[2];
@@ -326,7 +326,7 @@ void func_802F2ED0(Struct64s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
f32 sp38[3];
if (arg0 != NULL && arg0->unk4) {
viewport_getRotation(sp38);
viewport_get_rotation_vec3f(sp38);
mlMtxIdent();
mlMtxRotPitch(-sp38[0]);
mlMtxRotYaw(-sp38[1]);

View File

@@ -36,7 +36,7 @@ ParticleEmitter *func_802F4274(f32 arg0[3]) {
ml_vec3f_copy(sp2C, arg0);
func_8024559C(sp2C, &sp20, &sp28);
sp2C[1] = sp28 + 14.0f;
viewport_getPosition(sp38);
viewport_get_position_vec3f(sp38);
sp44[0] = sp38[0] - sp2C[0];
sp44[2] = sp38[2] - sp2C[2];
sp44[1] = 0.0f;

View File

@@ -479,7 +479,7 @@ void func_802F53D0(void){
D_80380B18 = 0;
}
void func_802F542C(void){
void printbuffer_defrag(void){
print_sFonts[0] = (FontLetter *)defrag(print_sFonts[0]);
print_sFonts[1] = (FontLetter *)defrag(print_sFonts[1]);
if(print_sFonts[3]){

View File

@@ -20,7 +20,7 @@ void func_802F7EB0(struct3s *this){
player_getPosition(plyrPos);
func_8024C5A8(camNorm);
viewport_getRotation(camRot);
viewport_get_rotation_vec3f(camRot);
sp50 = vector_pushBackNew(&this->unk20);
tmpf = randf2(50.0f, 1100.0f);
sp4C[0] = 0.0f;

View File

@@ -21,7 +21,7 @@ void func_802F87B0(struct6s *this){
player_getPosition(plyrPos);
func_8024C5A8(camNorm);
viewport_getRotation(camRot);
viewport_get_rotation_vec3f(camRot);
ptr = vector_pushBackNew(&this->unk1C);
f20 = randf2(50.0f, 1200.0f);
sp4C[0] = 0.0f;

View File

@@ -7,11 +7,11 @@ typedef struct {
f32 unkC[3];
}Struct_core2_72060_0;
extern f32 viewport_getYaw();
extern f32 viewport_get_yaw();
extern int func_8024DD34(f32, f32, f32);
extern void func_80251B5C(f32, f32, f32);
extern void func_80251F8C(f32);
extern void func_8025208C(f32);
extern void mlMtx_rotate_pitch_deg(f32);
extern void mlMtx_rotate_yaw_deg(f32);
extern void func_80252A38(f32, f32, f32);
extern void mlMtxApply(Mtx *);
extern f32 vtxList_getGlobalNorm(BKVertexList *);
@@ -166,7 +166,7 @@ void func_802F919C(void) {
} else {
var_f20 = 70.0f;
}
ml_vec3f_yaw_rotate_copy(sp4C, sp4C, viewport_getYaw() + randf2(-var_f20, var_f20));
ml_vec3f_yaw_rotate_copy(sp4C, sp4C, viewport_get_yaw() + randf2(-var_f20, var_f20));
sp4C[0] += D_80381040[0];
sp4C[1] += D_80381040[1];
sp4C[2] += D_80381040[2];
@@ -200,8 +200,8 @@ void func_802F962C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
void *phi_s0_2;
if ((D_80369280 != NULL) && (D_80369284 != 0)) {
viewport_getPosition(D_80381050);
viewport_getRotation(D_80381060);
viewport_get_position_vec3f(D_80381050);
viewport_get_rotation_vec3f(D_80381060);
D_80381090 = (s32)D_80369288 + D_80369288->gfx_list_offset_C + sizeof(BKGfxList);
temp_s3 = (BKVertexList *)((s32)D_80369288 + D_80369288->vtx_list_offset_10);
D_8038108C = vtxList_getGlobalNorm(temp_s3);
@@ -237,8 +237,8 @@ bool func_802F989C(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
mlMtxApply(*mtx);
func_80252434(&D_80381080, D_80381094->unkC);
func_80251B5C(D_80381080[0], D_80381080[1], D_80381080[2]);
func_8025208C(D_80381060[1]);
func_80251F8C(D_80381060[0]);
mlMtx_rotate_yaw_deg(D_80381060[1]);
mlMtx_rotate_pitch_deg(D_80381060[0]);
func_80252A38(-(D_80381094->unkC[0]), -(D_80381094->unkC[1]), -(D_80381094->unkC[2]));
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@@ -4,6 +4,8 @@
#include "prop.h"
#define SQ(x) ((x) * (x))
extern f32 ml_distanceSquared_vec3f(f32[3], f32[3]);
extern f32 func_802586B0(f32[3], f32[3]);
extern void mapModel_getCubeBounds(s32 min[3], s32 max[3]);
@@ -14,14 +16,9 @@ extern ActorProp *func_803322F0(Cube *, ActorMarker *, f32, s32, s32 *);
extern BKCollisionTri *func_803319C0(Cube *cube, f32 position[3], f32 radius, f32 arg2[3], u32 flags);
extern BKCollisionTri *func_80331638(Cube *cube, f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg2[3], s32, u32 flags);
typedef struct {
s32 unk0;
NodeProp *unk4;
} Struct_core2_7AF80_0;
typedef struct{
s32 unk0[3];
s32 unkC;
s32 position[3];
s32 radius;
u32 unk10_31: 28;
u32 unk10_3: 3;
u32 unk10_0: 1;
@@ -29,7 +26,7 @@ typedef struct{
} Struct_core2_7AF80_2;
typedef struct {
s32 unk0; //count
s32 count; //count
s32 unk4;
Struct_core2_7AF80_2 *unk8;
} Struct_core2_7AF80_1;
@@ -381,8 +378,8 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
return;
func_8032D3A8();
viewport_getPosition(vp_position);
viewport_getRotation(vp_rotation);
viewport_get_position_vec3f(vp_position);
viewport_get_rotation_vec3f(vp_rotation);
func_80256664(vp_rotation);
cube_positionToIndices(vp_cube_indices, vp_position);
vp_cube_indices[0] -= D_80381FA0.min[0];\
@@ -539,12 +536,12 @@ Cube *cube_atPosition_s32(s32 position[3]) {
}
Cube *cube_atPosition_f32(f32 position[3]){
s32 sp1C[3];
s32 pos_s32[3];
sp1C[0] = (s32)position[0];
sp1C[1] = (s32)position[1];
sp1C[2] = (s32)position[2];
return cube_atPosition_s32(sp1C);
pos_s32[0] = (s32)position[0];
pos_s32[1] = (s32)position[1];
pos_s32[2] = (s32)position[2];
return cube_atPosition_s32(pos_s32);
}
Cube *func_8030364C(void){
@@ -937,7 +934,7 @@ s32 func_80304984(s32 arg0, u32 *arg1) {
temp_v0 = cubeList_findNodePropByActorId(arg0, 0);
if (temp_v0 != 0) {
*arg1 = temp_v0->unk6.bit15;
*arg1 = temp_v0->unk6.radius;
return 1;
}
return 0;
@@ -1031,7 +1028,7 @@ NodeProp *func_80304D04(s32 arg0, s16 *arg1) {
}
s32 nodeprop_getRadius(NodeProp *arg0) {
return arg0->unk6.bit15;
return arg0->unk6.radius;
}
void func_80304D4C(NodeProp *arg0, s32 dst[3]) {
@@ -1239,7 +1236,7 @@ NodeProp *func_80305510(s32 arg0) {
}
Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 arg4){
Actor *actor = func_803056FC(arg0, arg1, arg2);
Actor *actor = spawn_actor(arg0, arg1, arg2);
NodeProp *tmp;
s32 sp34[3];
f32 sp28[3];
@@ -1264,14 +1261,11 @@ Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 ar
return actor;
}
Actor *func_803056FC(enum actor_e arg0, s32 arg1[3], s32 arg2)
{
Actor *spawn_actor(enum actor_e arg0, s32 arg1[3], s32 arg2) {
s32 i;
arg0 = (!func_80320248()) ? (ACTOR_4_BIGBUTT) : (arg0);
for (i = 0; i < sSpawnableActorSize; i++)
{
if (arg0 == sSpawnableActorList[i].infoPtr->actorId)
{
for (i = 0; i < sSpawnableActorSize; i++) {
if (arg0 == sSpawnableActorList[i].infoPtr->actorId) {
return sSpawnableActorList[i].spawnFunc(arg1, arg2, ((0, sSpawnableActorList[i])).infoPtr, sSpawnableActorList[i].unk8);
}
}
@@ -1448,18 +1442,18 @@ void func_80305F04(s32 *arg0, Struct_core2_7AF80_1 **arg1) {
for(a_list = *arg1; a_list < *arg1 + *arg0; a_list++){
for(b_list = a_list + 1; b_list < *arg1 + *arg0; b_list++) {
//same types and neither A or B are empty
if ((a_list->unk4 == b_list->unk4) && (a_list->unk0 != 0) && (b_list->unk0 != 0)) {
if ((a_list->unk4 == b_list->unk4) && (a_list->count != 0) && (b_list->count != 0)) {
continue_loop = TRUE;
for(a_elem = a_list->unk8; (a_elem < a_list->unk8 + a_list->unk0) && continue_loop; a_elem++){
for(b_elem = b_list->unk8; (b_elem < b_list->unk8 + b_list->unk0) && continue_loop; b_elem++) {
if ((((a_elem->unk0[0] - b_elem->unk0[0]) * (a_elem->unk0[0] - b_elem->unk0[0])) + ((a_elem->unk0[2] - b_elem->unk0[2]) * (a_elem->unk0[2] - b_elem->unk0[2]))) < ((a_elem->unkC + b_elem->unkC) * (a_elem->unkC + b_elem->unkC))) {
for(a_elem = a_list->unk8; (a_elem < a_list->unk8 + a_list->count) && continue_loop; a_elem++){
for(b_elem = b_list->unk8; (b_elem < b_list->unk8 + b_list->count) && continue_loop; b_elem++) {
if ((((a_elem->position[0] - b_elem->position[0]) * (a_elem->position[0] - b_elem->position[0])) + ((a_elem->position[2] - b_elem->position[2]) * (a_elem->position[2] - b_elem->position[2]))) < ((a_elem->radius + b_elem->radius) * (a_elem->radius + b_elem->radius))) {
//concat b_list to end of a_list
a_list->unk8 = (Struct_core2_7AF80_2 *) realloc(a_list->unk8, (a_list->unk0 + b_list->unk0)*sizeof(Struct_core2_7AF80_2));
memcpy(a_list->unk8 + a_list->unk0, b_list->unk8, b_list->unk0 * sizeof(Struct_core2_7AF80_2));
a_list->unk0 = (s32) (a_list->unk0 + b_list->unk0);
a_list->unk8 = (Struct_core2_7AF80_2 *) realloc(a_list->unk8, (a_list->count + b_list->count)*sizeof(Struct_core2_7AF80_2));
memcpy(a_list->unk8 + a_list->count, b_list->unk8, b_list->count * sizeof(Struct_core2_7AF80_2));
a_list->count = (s32) (a_list->count + b_list->count);
b_list->unk0 = 0;
b_list->count = 0;
free(b_list->unk8);
b_list->unk8 = NULL;
@@ -1474,13 +1468,13 @@ void func_80305F04(s32 *arg0, Struct_core2_7AF80_1 **arg1) {
//remove empty lists
for(a_list = *arg1; a_list < *arg1 + *arg0; a_list++){
if (a_list->unk0 == 0) { //A is empty
if (a_list->count == 0) { //A is empty
continue_loop = TRUE;
for(b_list = a_list + 1; (b_list < *arg1 + *arg0) && continue_loop; b_list++){
if (b_list->unk0 != 0) { //B is not empty
if (b_list->count != 0) { //B is not empty
//swap A an B
memcpy(a_list, b_list, sizeof(Struct_core2_7AF80_1));
b_list->unk0 = 0;
b_list->count = 0;
b_list->unk8 = NULL;
continue_loop = FALSE;
@@ -1490,7 +1484,7 @@ void func_80305F04(s32 *arg0, Struct_core2_7AF80_1 **arg1) {
}
//find first empty list (end)
for(a_list = *arg1; (a_list < *arg1 + *arg0) && (a_list->unk0 != 0); a_list++) { }
for(a_list = *arg1; (a_list < *arg1 + *arg0) && (a_list->count != 0); a_list++) { }
*arg0 = (a_list - *arg1); //count
*arg1 = (Struct_core2_7AF80_1 *)realloc((void *) *arg1, *arg0 * sizeof(Struct_core2_7AF80_1)); //ptr
@@ -1566,27 +1560,27 @@ Struct_core2_7AF80_1 *func_803064C0(s32 arg0) {
bool func_80306534(Struct_core2_7AF80_1 *arg0, s32 arg1, s32 arg2[3], s32 arg3) {
Struct_core2_7AF80_2 *iPtr;
for(iPtr = arg0->unk8; iPtr < &arg0->unk8[arg0->unk0]; iPtr++){
if(((arg2[0] - iPtr->unk0[0])*(arg2[0] - iPtr->unk0[0]) + (arg2[2] - iPtr->unk0[2])*(arg2[2] - iPtr->unk0[2])) < ((arg3 + iPtr->unkC) * (arg3 + iPtr->unkC))) {
for(iPtr = arg0->unk8; iPtr < &arg0->unk8[arg0->count]; iPtr++){
if(((arg2[0] - iPtr->position[0])*(arg2[0] - iPtr->position[0]) + (arg2[2] - iPtr->position[2])*(arg2[2] - iPtr->position[2])) < ((arg3 + iPtr->radius) * (arg3 + iPtr->radius))) {
return TRUE;
}
}
return FALSE;
}
void func_803065E4(s32 arg0, s32 position[3], s32 arg2, s32 arg3, s32 arg4) {
void func_803065E4(s32 arg0, s32 position[3], s32 radius, s32 arg3, s32 arg4) {
Struct_core2_7AF80_2 *temp_v1;
func_80306390();
while(func_803063D8(arg0) != NULL){
if (func_80306534(D_8036A9C0, arg0, position, arg2)) {
D_8036A9C0->unk0++;
D_8036A9C0->unk8 = realloc(D_8036A9C0->unk8, D_8036A9C0->unk0 * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9C0->unk8[D_8036A9C0->unk0 - 1];
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
if (func_80306534(D_8036A9C0, arg0, position, radius)) {
D_8036A9C0->count++;
D_8036A9C0->unk8 = realloc(D_8036A9C0->unk8, D_8036A9C0->count * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9C0->unk8[D_8036A9C0->count - 1];
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_31 = arg3;
temp_v1->unk10_0 = arg4;
temp_v1->unk10_3 = 0;
@@ -1595,14 +1589,14 @@ void func_803065E4(s32 arg0, s32 position[3], s32 arg2, s32 arg3, s32 arg4) {
}
D_8036A9B8++;
D_8036A9BC = realloc(D_8036A9BC, D_8036A9B8*sizeof(Struct_core2_7AF80_1));
D_8036A9BC[D_8036A9B8-1].unk0 = 1;
D_8036A9BC[D_8036A9B8-1].count = 1;
D_8036A9BC[D_8036A9B8-1].unk4 = arg0;
D_8036A9BC[D_8036A9B8-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2));
temp_v1 = (D_8036A9BC + D_8036A9B8-1)->unk8;
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_31 = arg3;
temp_v1->unk10_0 = arg4;
temp_v1->unk10_3 = 0;
@@ -1618,63 +1612,63 @@ s32 func_80306840(s32 arg0){
return 7;
}
void func_8030688C(s32 arg0, s32 position[3], s32 arg2, s32 arg3){
void func_8030688C(s32 arg0, s32 position[3], s32 radius, s32 arg3){
Struct_core2_7AF80_2 *temp_v1;
func_803063A8();
while(func_8030644C(arg0) != NULL){
if (func_80306534(D_8036A9CC, arg0, position, arg2)) {
D_8036A9CC->unk0++;
D_8036A9CC->unk8 = realloc(D_8036A9CC->unk8, D_8036A9CC->unk0 * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9CC->unk8[D_8036A9CC->unk0 - 1];
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
if (func_80306534(D_8036A9CC, arg0, position, radius)) {
D_8036A9CC->count++;
D_8036A9CC->unk8 = realloc(D_8036A9CC->unk8, D_8036A9CC->count * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9CC->unk8[D_8036A9CC->count - 1];
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_3 = func_80306840(arg3);
return;
}
}
D_8036A9C4++;
D_8036A9C8 = realloc(D_8036A9C8, D_8036A9C4*sizeof(Struct_core2_7AF80_1));
D_8036A9C8[D_8036A9C4-1].unk0 = 1;
D_8036A9C8[D_8036A9C4-1].count = 1;
D_8036A9C8[D_8036A9C4-1].unk4 = arg0;
D_8036A9C8[D_8036A9C4-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2));
temp_v1 = (D_8036A9C8 + D_8036A9C4-1)->unk8;
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_3 = func_80306840(arg3);
}
void func_80306AA8(s32 arg0, s32 position[3], s32 arg2){
void func_80306AA8(s32 arg0, s32 position[3], s32 radius){
Struct_core2_7AF80_2 *temp_v1;
func_803063C0();
while(func_803064C0(arg0) != NULL){
if (func_80306534(D_8036A9D8, arg0, position, arg2)) {
D_8036A9D8->unk0++;
D_8036A9D8->unk8 = realloc(D_8036A9D8->unk8, D_8036A9D8->unk0 * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9D8->unk8[D_8036A9D8->unk0 - 1];
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
if (func_80306534(D_8036A9D8, arg0, position, radius)) {
D_8036A9D8->count++;
D_8036A9D8->unk8 = realloc(D_8036A9D8->unk8, D_8036A9D8->count * sizeof(Struct_core2_7AF80_2));
temp_v1 = &D_8036A9D8->unk8[D_8036A9D8->count - 1];
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_3 = 0;
return;
}
}
D_8036A9D0++;
D_8036A9D4 = realloc(D_8036A9D4, D_8036A9D0*sizeof(Struct_core2_7AF80_1));
D_8036A9D4[D_8036A9D0-1].unk0 = 1;
D_8036A9D4[D_8036A9D0-1].count = 1;
D_8036A9D4[D_8036A9D0-1].unk4 = arg0;
D_8036A9D4[D_8036A9D0-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2));
temp_v1 = (D_8036A9D4 + D_8036A9D0-1)->unk8;
temp_v1->unk0[0] = position[0];
temp_v1->unk0[1] = position[1];
temp_v1->unk0[2] = position[2];
temp_v1->unkC = arg2;
temp_v1->position[0] = position[0];
temp_v1->position[1] = position[1];
temp_v1->position[2] = position[2];
temp_v1->radius = radius;
temp_v1->unk10_3 = 0;
}
@@ -1734,9 +1728,9 @@ s32 func_80306DDC(Struct_core2_7AF80_2 *arg0) {
phi_v1 = D_8036A9BC;
while(phi_v1 < &D_8036A9BC[D_8036A9B8]){
phi_a0 = phi_v1->unk8;
while(phi_a0 < &phi_v1->unk8[phi_v1->unk0]){
if (((phi_a0->unk0[1] - 150) < arg0->unk0[1]) && (arg0->unk0[1] < (phi_a0->unk0[1] + 150))) {
if ((((arg0->unk0[0] - phi_a0->unk0[0]) * (arg0->unk0[0] - phi_a0->unk0[0])) + ((arg0->unk0[2] - phi_a0->unk0[2]) * (arg0->unk0[2] - phi_a0->unk0[2]))) < (phi_a0->unkC * phi_a0->unkC)) {
while(phi_a0 < &phi_v1->unk8[phi_v1->count]){
if (((phi_a0->position[1] - 150) < arg0->position[1]) && (arg0->position[1] < (phi_a0->position[1] + 150))) {
if ((SQ(arg0->position[0] - phi_a0->position[0]) + SQ(arg0->position[2] - phi_a0->position[2])) < SQ(phi_a0->radius)) {
return phi_v1 - D_8036A9BC;
}
}
@@ -1759,20 +1753,20 @@ s32 func_80306EF4(s32 arg0[3], s32 arg1, u32 arg2) {
if (D_80381FE8[var_s1->unk4] != 0) {
if (arg2 & 1) {
var_s0 = var_s1->unk8;
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->unk0; var_s0++){
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->count; var_s0++){
if( (var_s0->unk10_3 & arg2)
&& (temp_s4 >= var_s0->unk0[1]) && (temp_s6 < var_s0->unk0[1])
&& (func_80259328(arg0, (void *) var_s0, var_s0->unkC))
&& (temp_s4 >= var_s0->position[1]) && (temp_s6 < var_s0->position[1])
&& (func_80259328(arg0, (void *) var_s0, var_s0->radius))
) {
return var_s1 - D_8036A9C8;
}
}
}
else{
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->unk0; var_s0++){
for(var_s0 = var_s1->unk8; var_s0 < var_s1->unk8 + var_s1->count; var_s0++){
if( (var_s0->unk10_3 & arg2)
&& ((var_s0->unk10_3 & 2) || ((temp_s4 >= var_s0->unk0[1]) && (temp_s6 < var_s0->unk0[1])))
&& (func_80259328(arg0, (void *) var_s0, var_s0->unkC))
&& ((var_s0->unk10_3 & 2) || ((temp_s4 >= var_s0->position[1]) && (temp_s6 < var_s0->position[1])))
&& (func_80259328(arg0, (void *) var_s0, var_s0->radius))
) {
return var_s1 - D_8036A9C8;
}
@@ -1783,20 +1777,16 @@ s32 func_80306EF4(s32 arg0[3], s32 arg1, u32 arg2) {
return -1;
}
s32 func_80307164(Struct_core2_7AF80_2 *arg0) {
s32 func_80307164(s32 arg0[3]) {
Struct_core2_7AF80_1 *phi_v1;
Struct_core2_7AF80_2 *phi_a0;
phi_v1 = D_8036A9D4;
while(phi_v1 < &D_8036A9D4[D_8036A9D0]){
phi_a0 = phi_v1->unk8;
while(phi_a0 < &phi_v1->unk8[phi_v1->unk0]){
if ((((arg0->unk0[0] - phi_a0->unk0[0]) * (arg0->unk0[0] - phi_a0->unk0[0])) + ((arg0->unk0[2] - phi_a0->unk0[2]) * (arg0->unk0[2] - phi_a0->unk0[2]))) < (phi_a0->unkC * phi_a0->unkC)) {
for( phi_v1 = D_8036A9D4; phi_v1 < &D_8036A9D4[D_8036A9D0]; phi_v1++){
for(phi_a0 = phi_v1->unk8; phi_a0 < &phi_v1->unk8[phi_v1->count]; phi_a0++){
if ((SQ(arg0[0] - phi_a0->position[0]) + SQ(arg0[2] - phi_a0->position[2])) < SQ(phi_a0->radius)) {
return phi_v1 - D_8036A9D4;
}
phi_a0++;
}
phi_v1++;
}
return -1;
}
@@ -1811,14 +1801,14 @@ s32 func_80307258(f32 arg0[3], s32 arg1, s32 arg2) {
temp_v0 = &D_8036A9BC[arg1];
var_v1 = temp_v0->unk8 + arg2;
if (((arg0[0] - var_v1->unk0[0]) * (arg0[0] - var_v1->unk0[0])) + (((arg0[2] - var_v1->unk0[2]) * (arg0[2] - var_v1->unk0[2]))) < (var_v1->unkC * var_v1->unkC)) {
if (((arg0[0] - var_v1->position[0]) * (arg0[0] - var_v1->position[0])) + (((arg0[2] - var_v1->position[2]) * (arg0[2] - var_v1->position[2]))) < (var_v1->radius * var_v1->radius)) {
return arg2;
}
temp_a0 = temp_v0->unk8 + temp_v0->unk0;
temp_a0 = temp_v0->unk8 + temp_v0->count;
for (var_v1 = temp_v0->unk8; var_v1 < temp_a0; var_v1++) {
temp_f2 = arg0[2] - var_v1->unk0[2];
temp_f14 = arg0[0] - var_v1->unk0[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->unkC * var_v1->unkC)) {
temp_f2 = arg0[2] - var_v1->position[2];
temp_f14 = arg0[0] - var_v1->position[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->radius * var_v1->radius)) {
return var_v1 - temp_v0->unk8;
}
}
@@ -1839,14 +1829,14 @@ s32 func_803073CC(f32 arg0[3], s32 arg1, s32 arg2) {
temp_v0 = &D_8036A9D4[arg1];
var_v1 = temp_v0->unk8 + arg2;
if (((arg0[0] - var_v1->unk0[0]) * (arg0[0] - var_v1->unk0[0])) + (((arg0[2] - var_v1->unk0[2]) * (arg0[2] - var_v1->unk0[2]))) < (var_v1->unkC * var_v1->unkC)) {
if (((arg0[0] - var_v1->position[0]) * (arg0[0] - var_v1->position[0])) + (((arg0[2] - var_v1->position[2]) * (arg0[2] - var_v1->position[2]))) < (var_v1->radius * var_v1->radius)) {
return arg2;
}
temp_a0 = temp_v0->unk8 + temp_v0->unk0;
temp_a0 = temp_v0->unk8 + temp_v0->count;
for (var_v1 = temp_v0->unk8; var_v1 < temp_a0; var_v1++) {
temp_f2 = arg0[2] - var_v1->unk0[2];
temp_f14 = arg0[0] - var_v1->unk0[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->unkC * var_v1->unkC)) {
temp_f2 = arg0[2] - var_v1->position[2];
temp_f14 = arg0[0] - var_v1->position[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->radius * var_v1->radius)) {
return var_v1 - temp_v0->unk8;
}
}
@@ -1871,8 +1861,8 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
min = sp4C[1] - arg3 / 2;
if (arg4 & 1) {
if (var_s0->unk10_3 & arg4) {
if (!(max < var_s0->unk0[1]) && (min < var_s0->unk0[1])) {
if (func_80259328(sp4C, var_s0->unk0, var_s0->unkC)) {
if (!(max < var_s0->position[1]) && (min < var_s0->position[1])) {
if (func_80259328(sp4C, var_s0->position, var_s0->radius)) {
return arg2;
}
}
@@ -1880,24 +1870,24 @@ s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
}
else{
if( (var_s0->unk10_3 & arg4))
if( ((var_s0->unk10_3 & 2) || (!(max < var_s0->unk0[1]) && (min < var_s0->unk0[1]))))
if( func_80259328(&sp4C, var_s0->unk0, var_s0->unkC))
if( ((var_s0->unk10_3 & 2) || (!(max < var_s0->position[1]) && (min < var_s0->position[1]))))
if( func_80259328(&sp4C, var_s0->position, var_s0->radius))
return arg2;
}
if (arg4 & 1) {
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->unk0; var_s0++){
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->count; var_s0++){
if (var_s0->unk10_3 & arg4)
if (!(max < var_s0->unk0[1]) && (min < var_s0->unk0[1]))
if(func_80259328(&sp4C, var_s0, var_s0->unkC))
if (!(max < var_s0->position[1]) && (min < var_s0->position[1]))
if(func_80259328(&sp4C, var_s0, var_s0->radius))
return (var_s0 - temp_s1->unk8);
}
}
else{
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->unk0; var_s0++){
for(var_s0 = temp_s1->unk8; var_s0 < temp_s1->unk8 + temp_s1->count; var_s0++){
if ((var_s0->unk10_3 & arg4))
if(((var_s0->unk10_3 & 2) || (!(max < var_s0->unk0[1]) && (min < var_s0->unk0[1]))))
if(func_80259328(&sp4C, var_s0, var_s0->unkC))
if(((var_s0->unk10_3 & 2) || (!(max < var_s0->position[1]) && (min < var_s0->position[1]))))
if(func_80259328(&sp4C, var_s0, var_s0->radius))
return var_s0 - temp_s1->unk8;
}
}
@@ -2424,9 +2414,9 @@ void func_80308984(void) {
void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
s32 phi_s4;
s32 phi_s0;
s32 sp54[3];
s32 vp_pos[3];
Cube *temp_s3;
s32 temp_lo;
s32 vp_cube_index;
func_8032F464(1);
phi_s4 = 0;
@@ -2435,9 +2425,9 @@ void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
if (!func_80308F54(D_80382150[phi_s4])) {
temp_s3 = &D_80381FA0.cube_list[D_80382150[phi_s4]];
if (func_8024D8F4(temp_s3)) {
func_8024C5F0(sp54);
temp_lo = cube_atPosition_s32(sp54) - D_80381FA0.cube_list;
for(phi_s0 = 0; (phi_s0 < D_80382150[phi_s4 + 1]) && (temp_lo != D_80382150[phi_s0 + 2]); phi_s0++) {
veiwport_get_position_vec3w(vp_pos);
vp_cube_index = cube_atPosition_s32(vp_pos) - D_80381FA0.cube_list;
for(phi_s0 = 0; (phi_s0 < D_80382150[phi_s4 + 1]) && (vp_cube_index != D_80382150[phi_s0 + 2]); phi_s0++) {
}
if (phi_s0 < (s32) D_80382150[phi_s4 + 1]) {
func_80301F10(temp_s3, gfx, mtx, vtx);

View File

@@ -218,7 +218,7 @@ s32 func_8030CDE4(struct45s *arg0){
f32 temp_f0;
f32 pad;
viewport_getPosition(&sp44);
viewport_get_position_vec3f(&sp44);
func_8024C5A8(&sp38);
sp2C[0] = arg0->position[0] - sp44[0];
sp2C[1] = arg0->position[1] - sp44[1];

View File

@@ -10,13 +10,14 @@ extern void gczoombox_open(gczoombox_t *);
extern void gczoombox_minimize(gczoombox_t *);
extern void gczoombox_close(gczoombox_t *);
extern bool func_803188B4(gczoombox_t *);
extern char *dialogBin_get(enum asset_e text_id);
s8 D_8036C4D0[] = {1, 0x1E, 0x14, 0xF, 0xB, 8, 6, 4, 3, 2, -1, -1};
/* .bss */
struct {
char output[0x100];
u8 *unk100;
u8 *dialog_bin_ptr;
struct13s *string_list[2]; //string ptr
char *string[2]; //current_string
u8 string_count[2]; //zoombox string_count
@@ -74,7 +75,7 @@ void gcdialog_init(void) {
s32 i;
struct14s *i_ptr;
D_80382E20.unk100 = 0;
D_80382E20.dialog_bin_ptr = 0;
for( i = 0; i < 2; i++){
D_80382E20.string_list[i] = NULL;
@@ -134,9 +135,9 @@ void func_8030F078(void){
D_80382E20.string_list[i] = NULL;
}
if(D_80382E20.unk130 != -1){
func_8031B6D8(D_80382E20.unk130);
dialogBin_release(D_80382E20.unk130);
}
D_80382E20.unk100 = NULL;
D_80382E20.dialog_bin_ptr = NULL;
}
void func_8030F130(void){
@@ -579,7 +580,7 @@ void func_80310574(s32 text_id){
char ch;
s32 len;
txt = D_80382E20.unk100 = func_8031B66C(text_id);
txt = D_80382E20.dialog_bin_ptr = dialogBin_get(text_id);
for(i = 0; i < 2; i++){
D_80382E20.string_count[i] = *(txt++);
@@ -637,7 +638,7 @@ void func_803106BC(s32 text_id, s32 arg1, ActorMarker *marker, void(*callback)(A
D_80382E20.unk11A[j].unk0_5 = 0;
if(D_80382E20.string_list[j][i].cmd >= 0){
if(!D_80382E20.unk11A[j].unk0_7){
D_80382E20.zoombox[j] = gczoombox_new(D_80382E20.unk124[j], D_80382E20.string_list[j][i].cmd + 0xC, 0, func_803106A4(j), func_8030F754);
D_80382E20.zoombox[j] = gczoombox_new(D_80382E20.unk124[j], D_80382E20.string_list[j][i].cmd + 0xC, 0, func_803106A4(j), (void *)func_8030F754);
if( j == 1 ){
func_80347A14(0);
}
@@ -674,7 +675,7 @@ void func_803106BC(s32 text_id, s32 arg1, ActorMarker *marker, void(*callback)(A
D_80382E20.caller = marker;
D_80382E20.unk13C = callback;
D_80382E20.unk140 = arg4;
D_80382E20.unk144 = arg5;
D_80382E20.unk144 = (void *)arg5;
D_80382E20.unk138 = (marker != NULL )? ((marker->unk5C)? marker->unk5C : -1) : 0;
gcdialog_setState(((func_802E4A08() || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)) && D_80382E20.unk128_3) ? 6 : 1);
//L803109EC
@@ -835,7 +836,7 @@ int func_80311174(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*ca
return 0;
if(!func_803114B0()){
func_80310B1C(text_id, arg1, marker, callback, arg5, arg6);
func_80310B1C(text_id, arg1, marker, (void *)callback, (void *)arg5, arg6);
if(arg1 & 8){
if(!(func_802E4A08() || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)) || !D_80382E20.unk128_3){//L80311214
if(pos != NULL){
@@ -877,8 +878,8 @@ int func_80311174(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*ca
}
D_80382E20.unk148[temp_v1].unk10 = marker;
D_80382E20.unk148[temp_v1].unk14 = (marker != NULL )? ((marker->unk5C)? marker->unk5C : -1) : 0;
D_80382E20.unk148[temp_v1].unk18 = callback;
D_80382E20.unk148[temp_v1].unk1C = arg5;
D_80382E20.unk148[temp_v1].unk18 = (void *)callback;
D_80382E20.unk148[temp_v1].unk1C = (void *)arg5;
D_80382E20.unk148[temp_v1].unk20 = arg6;
D_80382E20.unk12C_15++;
if(arg1 & 0x08){

View File

@@ -8,20 +8,20 @@ s32 D_80383150;
s32 pad_80383154;
struct {
u8 unk0;
void *unk4;
s32 unk8;
char *ptr;
s32 index;
}
D_80383158;
s_dialogBin;
s32 func_8031B5B0(void) {
return D_80383158.unk0;
return s_dialogBin.unk0;
}
s32 func_8031B5BC(void){ return 1; }
void func_8031B5C4(s32 arg0) {
if ((arg0 >= 0) && (arg0 < func_8031B5BC())) {
D_80383158.unk0 = (s8) arg0;
s_dialogBin.unk0 = (s8) arg0;
}
D_80383150 = 1;
}
@@ -31,40 +31,41 @@ bool func_8031B604(char *arg0) {
}
void func_8031B62C(void) {
D_80383158.unk0 = (u8)0;
s_dialogBin.unk0 = (u8)0;
}
s32 func_8031B638(void) {
return D_80383150;
}
void func_8031B644(void){
D_80383158.unk4 = NULL;
D_80383158.unk8 = -1;
void dialogBin_initialize(void){
s_dialogBin.ptr = NULL;
s_dialogBin.index = -1;
}
void func_8031B65C(void){}
void dialogBin_update(void){}
void func_8031B664(void){}
void dialogBin_terminate(void){}
char *func_8031B66C(enum asset_e text_id) {
char *dialogBin_get(enum asset_e text_id) {
char *sp1C;
s32 var_v0;
s32 var_a0;
char *var_v0;
s32 var_a0; //offset where text starts (normally 0x3)
D_80383158.unk4 = assetcache_get(text_id);
sp1C = (s32)D_80383158.unk4 + 1;
//get text_bin from asset cache
s_dialogBin.ptr = assetcache_get(text_id);
sp1C = s_dialogBin.ptr + 1;
sp1C += func_8031B5B0()*2;
var_a0 = *(sp1C++);
var_a0 += *(sp1C++)<< 8;
if(sp1C);
var_v0 = (s32)D_80383158.unk4 + var_a0;
D_80383158.unk8 = text_id;
var_v0 = s_dialogBin.ptr + var_a0;
s_dialogBin.index = text_id;
return var_v0;
}
void func_8031B6D8(s32 arg0){
assetcache_release(D_80383158.unk4);
D_80383158.unk4 = NULL;
D_80383158.unk8 = -1;
void dialogBin_release(s32 arg0){
assetcache_release(s_dialogBin.ptr);
s_dialogBin.ptr = NULL;
s_dialogBin.index = -1;
}

View File

@@ -4,8 +4,8 @@
void func_8031FFAC(void);
void fileProgressFlag_set(s32 index, s32 set);
s32 func_803200A4(u8 *array, s32 index);
s32 func_803200E4(u8 *array, s32 offset, s32 numBits);
s32 bitfield_get_bit(u8 *array, s32 index);
s32 bitfield_get_n_bits(u8 *array, s32 offset, s32 numBits);
void func_8032015C(u8 *array, s32 index, s32 set);
void func_803201C8(u8 *array, s32 startIndex, s32 set, s32 length);
void func_8032048C(void);
@@ -108,11 +108,11 @@ void func_8031FEC0(void) {
}
bool fileProgressFlag_get(enum file_progress_e index) {
return func_803200A4(D_803831A0.unk8, index);
return bitfield_get_bit(D_803831A0.unk8, index);
}
s32 fileProgressFlag_getN(s32 offset, s32 numBits) {
return func_803200E4(D_803831A0.unk8, offset, numBits);
return bitfield_get_n_bits(D_803831A0.unk8, offset, numBits);
}
s32 fileProgressFlag_getAndSet(s32 index, s32 set) {
@@ -151,7 +151,7 @@ void func_8032008C(s32 *arg0, u8 **arg1) {
}
// Returns a single bit from a byte array
s32 func_803200A4(u8 *array, s32 index) {
s32 bitfield_get_bit(u8 *array, s32 index) {
s32 ret;
if (array[index / 8] & (1 << (index & 7))) {
ret = 1;
@@ -162,12 +162,12 @@ s32 func_803200A4(u8 *array, s32 index) {
}
// Extracts an integer of the given number of bits from a byte array at the starting bit offset
s32 func_803200E4(u8 *array, s32 offset, s32 numBits) {
s32 bitfield_get_n_bits(u8 *array, s32 offset, s32 numBits) {
s32 ret = 0;
s32 i;
for (i = 0; i < numBits; i++) {
ret |= (func_803200A4(array, offset + i) << i);
ret |= (bitfield_get_bit(array, offset + i) << i);
}
return ret;
}
@@ -246,11 +246,11 @@ void func_803203A0(void) {
}
s32 func_803203FC(s32 index) {
return func_803200A4(D_803831D0.unk8, index);
return bitfield_get_bit(D_803831D0.unk8, index);
}
void func_80320424(s32 index, s32 numBits) {
func_803200E4(D_803831D0.unk8, index, numBits);
bitfield_get_n_bits(D_803831D0.unk8, index, numBits);
}
s32 func_80320454(s32 index, s32 arg1) {

View File

@@ -310,7 +310,7 @@ Actor *func_80325CAC(ActorMarker *marker, Gfx **gfx, Gfx **mtx, Vtx **vtx) {
this->position[1] -= D_8036E58C[1];
this->position[2] -= D_8036E58C[2];
}
viewport_getRotation(rotation);
viewport_get_rotation_vec3f(rotation);
rotation[2] += this->roll;
func_80338338(0xFF, 0xFF, 0xFF);
if (this->unk124_11 != 0) {
@@ -1054,7 +1054,7 @@ static void __actor_free(ActorMarker *arg0, Actor *arg1){
}
Actor *func_8032811C(enum actor_e id, s32 (* pos)[3], s32 rot){
return func_803056FC(id, pos, rot);
return spawn_actor(id, pos, rot);
}
Actor *func_8032813C(enum actor_e id, f32 pos[3], s32 rot){
@@ -1063,7 +1063,7 @@ Actor *func_8032813C(enum actor_e id, f32 pos[3], s32 rot){
for(i = 0; i< 3; i++){
sp24[i] = pos[i];
}
func_803056FC(id, &sp24, rot);
spawn_actor(id, &sp24, rot);
}
Actor * spawn_child_actor(enum actor_e id, Actor ** parent){
@@ -1073,7 +1073,7 @@ Actor * spawn_child_actor(enum actor_e id, Actor ** parent){
sp1C[0] = (*parent)->position_x;
sp1C[1] = (*parent)->position_y;
sp1C[2] = (*parent)->position_z;
child = func_803056FC(id, sp1C, (*parent)->yaw);
child = spawn_actor(id, sp1C, (*parent)->yaw);
*parent = marker_getActor(sp28);
return child;
}
@@ -1097,7 +1097,7 @@ Actor *func_803282AC(enum actor_e id, s16 (* pos)[3], s32 yaw){
for(i = 0; i< 3; i++){
sp24[i] = (*pos)[i];
}
return func_803056FC(id, &sp24, yaw);
return spawn_actor(id, &sp24, yaw);
}
void marker_despawn(ActorMarker *marker){

View File

@@ -100,7 +100,7 @@ void func_8032CB50(Cube *cube, bool global) {
if (cube->prop2Cnt >= 2) {
if (global == 0) {
func_8024C5F0(ref_position); //distance from viewport
veiwport_get_position_vec3w(ref_position); //distance from viewport
} else {
ref_position[0] = 0;
ref_position[1] = 0;
@@ -649,7 +649,7 @@ bool func_8032E178(Cube *arg0, s32 *arg1, s32 arg2) {
&& (var_v1->unk6.bit6 == 6)
&& (arg2 == var_v1->unk8)
) {
*arg1 = var_v1->unk6.bit15;
*arg1 = var_v1->unk6.radius;
return TRUE;
}
var_v1++;
@@ -1314,7 +1314,7 @@ void func_80330208(Cube *cube) {
actor = func_803055E0(i_prop->unk8, position, i_prop->unkC_31, i_prop->unk10_31, i_prop->unk10_19);
if (actor != NULL) {
actor->unk78_13 = i_prop->unk10_31;
actor->unkF4_8 = i_prop->unk6.bit15;
actor->unkF4_8 = i_prop->unk6.radius;
func_8032AA58(actor, (i_prop->unkC_22 != 0) ? ((f32)i_prop->unkC_22 * 0.01) : 1.0);
}
}
@@ -1337,17 +1337,17 @@ void func_803303B8(Cube *cube) {
sp4C[0] = (s32) var_s0->x;
sp4C[1] = (s32) var_s0->y;
sp4C[2] = (s32) var_s0->z;
func_803065E4(var_s0->unk8, sp4C, var_s0->unk6.bit15, var_s0->unk10_31, var_s0->unk10_7);
func_803065E4(var_s0->unk8, sp4C, var_s0->unk6.radius, var_s0->unk10_31, var_s0->unk10_7);
} else if (var_s0->unk6.bit6 == 9) {
sp4C[0] = (s32) var_s0->x;
sp4C[1] = (s32) var_s0->y;
sp4C[2] = (s32) var_s0->z;
func_8030688C(var_s0->unk8, sp4C, var_s0->unk6.bit15, var_s0->unk10_0);
func_8030688C(var_s0->unk8, sp4C, var_s0->unk6.radius, var_s0->unk10_0);
} else if (var_s0->unk6.bit6 == 0xA) {
sp4C[0] = (s32) var_s0->x;
sp4C[1] = (s32) var_s0->y;
sp4C[2] = (s32) var_s0->z;
func_80306AA8(var_s0->unk8, sp4C, var_s0->unk6.bit15);
func_80306AA8(var_s0->unk8, sp4C, var_s0->unk6.radius);
}
var_s0++;
}
@@ -1606,7 +1606,7 @@ s32 func_80330F94(NodeProp *arg0, s32 arg1[3]){
arg1[0] = arg0->x;
arg1[1] = arg0->y;
arg1[2] = arg0->z;
return arg0->unk6.bit15;
return arg0->unk6.radius;
}
void func_80330FBC(UNK_TYPE(void *)arg0, s32 arg1){
@@ -1766,9 +1766,9 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
f32 *new_var2;
s32 spD8;
Actor *temp_v0_6;
BKModelBin *temp_v0_2;
BKModelBin *model_bin;
BKVertexList *temp_a1;
BKCollisionList *temp_v0_3;
BKCollisionList *model_collision_list;
f32 spBC[3];
f32 spB0[3];
u32 var_s3;
@@ -1789,13 +1789,13 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
{
if (((!var_s0->markerFlag) && var_s0->unk8_1) && var_s0->unk8_4)
{
temp_v0_2 = func_8030A4B4(((u32) (*((u16 *) (&var_s0->modelProp)))) >> 4);
if (temp_v0_2 == 0)
model_bin = func_8030A4B4(((u32) (*((u16 *) (&var_s0->modelProp)))) >> 4);
if (model_bin == 0)
{
continue;
}
temp_v0_3 = model_getCollisionList(temp_v0_2);
if (temp_v0_3 == 0)
model_collision_list = model_getCollisionList(model_bin);
if (model_collision_list == 0)
{
continue;
}
@@ -1806,7 +1806,10 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
spB0[1] = (f32) (var_s0->modelProp.unk0_15 * 2);
new_var = spB0;
spB0[2] = (f32) (var_s0->modelProp.unk0_7 * 2);
var_v0 = func_802E9118(temp_v0_3, model_getVtxList(temp_v0_2), spBC, new_var, (f32) (((f32) var_s0->modelProp.unkA) / 100.0), arg1, arg2, arg3, arg4, arg5, flags);
var_v0 = func_802E9118(model_collision_list, model_getVtxList(model_bin),
spBC, new_var, (f32) (((f32) var_s0->modelProp.unkA) / 100.0),
arg1, arg2, arg3, arg4, arg5, flags
);
if (var_v0 != 0)
{
spD8 = var_v0;
@@ -1815,14 +1818,14 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
else
if ((var_s0->markerFlag && var_s0->unk8_3) && var_s0->unk8_4)
{
temp_v0_3 = func_80330DE4(var_s0->actorProp.marker);
pad9C = temp_v0_3;
if (temp_v0_3 == 0)
model_collision_list = func_80330DE4(var_s0->actorProp.marker);
pad9C = model_collision_list;
if (model_collision_list == 0)
{
continue;
}
temp_v0_2 = model_getCollisionList(pad9C);
if (temp_v0_2 == 0)
model_bin = model_getCollisionList(pad9C);
if (model_bin == 0)
{
continue;
}
@@ -1835,7 +1838,7 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
sp8C[0] = (f32) var_s0->actorProp.marker->pitch;
sp8C[1] = (f32) var_s0->actorProp.marker->yaw;
sp8C[2] = (f32) var_s0->actorProp.marker->roll;
var_v0 = func_802E9118(temp_v0_2, temp_a1, sp98, new_var2, temp_v0_6->scale, arg1, arg2, arg3, arg4, arg5, flags);
var_v0 = func_802E9118(model_bin, temp_a1, sp98, new_var2, temp_v0_6->scale, arg1, arg2, arg3, arg4, arg5, flags);
}
if (var_v0 != 0)
{
@@ -1865,16 +1868,16 @@ s32 func_80331638(Cube *cube, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3], s
return spD8;
}
BKCollisionTri *func_803319C0(Cube *arg0, f32 arg1[3], f32 arg2, s32 arg3, f32 arg4[3], u32 arg5){
BKCollisionTri *func_803319C0(Cube *cube, f32 position[3], f32 radius, s32 arg3, f32 arg4[3], u32 arg5){
BKCollisionTri *var_s7;
BKCollisionTri *var_v0;
s32 var_s3;
Prop *var_s0;
BKCollisionList *temp_v0_3;
BKCollisionList *model_collision_list;
BKVertexList *temp_a1;
f32 spAC[3];
f32 spA0[3];
BKModelBin *temp_v0_2;
BKModelBin *model_bin;
BKModelBin *new_var;
ModelProp *mProp;
f32 sp88[3];
@@ -1883,25 +1886,25 @@ BKCollisionTri *func_803319C0(Cube *arg0, f32 arg1[3], f32 arg2, s32 arg3, f32 a
ActorProp *aProp = &var_s0->actorProp;
var_s7 = 0;
var_s0 = arg0->prop2Ptr;
for (var_s3 = arg0->prop2Cnt; var_s3 != 0; var_s3--, var_s0++) {
var_s0 = cube->prop2Ptr;
for (var_s3 = cube->prop2Cnt; var_s3 != 0; var_s3--, var_s0++) {
if (((!var_s0->markerFlag) && var_s0->unk8_1) && var_s0->unk8_4)
{
mProp = &var_s0->modelProp;
new_var = func_8030A4B4(mProp->unk0_31);
if (1) { } if (1) { } if (1) { }
temp_v0_2 = new_var;
if (temp_v0_2 != 0){
temp_v0_3 = model_getCollisionList(temp_v0_2);
if (temp_v0_3 != 0){
model_bin = new_var;
if (model_bin != 0){
model_collision_list = model_getCollisionList(model_bin);
if (model_collision_list != 0){
spAC[0] = (f32) mProp->unk4[0];
spAC[1] = (f32) mProp->unk4[1];
spAC[2] = (f32) mProp->unk4[2];
spA0[0] = 0.0f;
spA0[1] = (f32) (mProp->unk0_15 * 2);
temp_v0_2 = temp_v0_2;
model_bin = model_bin;
spA0[2] = (f32) (mProp->unk0_7 * 2);
var_v0 = func_802E9DD8(temp_v0_3, model_getVtxList(temp_v0_2), spAC, spA0, ((f32) mProp->unkA) / 100.0, arg1, arg2, arg3, arg4);
var_v0 = func_802E9DD8(model_collision_list, model_getVtxList(model_bin), spAC, spA0, ((f32) mProp->unkA) / 100.0, position, radius, arg3, arg4);
if (var_v0 != 0)
var_s7 = var_v0;
}
@@ -1910,10 +1913,9 @@ BKCollisionTri *func_803319C0(Cube *arg0, f32 arg1[3], f32 arg2, s32 arg3, f32 a
aProp = &var_s0->actorProp;
if ((var_s0->markerFlag && var_s0->unk8_3) && var_s0->unk8_4)
{
temp_v0_2 = func_80330DE4(aProp->marker);
if (temp_v0_2 != 0)
{
new_var = model_getCollisionList(temp_v0_2);
model_bin = func_80330DE4(aProp->marker);
if (model_bin != 0) {
new_var = model_getCollisionList(model_bin);
if (new_var != 0)
{
@@ -1925,7 +1927,7 @@ BKCollisionTri *func_803319C0(Cube *arg0, f32 arg1[3], f32 arg2, s32 arg3, f32 a
sp7C[0] = aProp->marker->pitch;
sp7C[1] = aProp->marker->yaw;
sp7C[2] = aProp->marker->roll;
var_v0 = func_802E9DD8(new_var, temp_a1, sp88, sp7C, temp_v0_6->scale, arg1, arg2, arg3, arg4);
var_v0 = func_802E9DD8(new_var, temp_a1, sp88, sp7C, temp_v0_6->scale, position, radius, arg3, arg4);
if (var_v0 != 0)
{
var_s7 = var_v0;
@@ -1942,7 +1944,7 @@ BKCollisionTri *func_803319C0(Cube *arg0, f32 arg1[3], f32 arg2, s32 arg3, f32 a
{
if (temp_v0_7->unk8 != 0)
{
var_v0 = temp_v0_7->unk8(aProp->marker, arg1, arg2, arg3, arg4);
var_v0 = temp_v0_7->unk8(aProp->marker, position, radius, arg3, arg4);
if (var_v0 != 0)
{
var_s7 = var_v0;

View File

@@ -174,7 +174,7 @@ void func_80334910(void) {
if (func_802E4A08() == 0) {
itemPrint_free();
}
func_8031B664();
dialogBin_terminate();
func_802986D0();
if (func_80322914() == 0) {
func_8024F7C4(func_803226E8(D_803835D0.map_4));
@@ -211,7 +211,7 @@ void func_80334B20(enum map_e arg0, s32 arg1, s32 arg2) {
if (func_802E4A08() == 0) {
itemPrint_init();
}
func_8031B644();
dialogBin_initialize();
spawnQueue_malloc();
func_803329AC();
func_80350BFC();
@@ -345,7 +345,7 @@ s32 func_80334ECC(void) {
}
AnimTextureListCache_update();
func_80350CA4();
func_8031B65C();
dialogBin_update();
func_80310D2C();
gcparade_update();
overlay_update();

View File

@@ -443,7 +443,7 @@ void func_803380F8(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
f32 sp2C[3];
f32 sp20[3];
viewport_getPosition(sp2C);
viewport_get_position_vec3f(sp2C);
sp20[0] = arg2[0] - sp2C[0];
sp20[1] = arg2[1] - sp2C[1];
sp20[2] = arg2[2] - sp2C[2];
@@ -457,7 +457,7 @@ void func_803381B4(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
f32 sp2C[3];
f32 sp20[3];
viewport_getPosition(sp2C);
viewport_get_position_vec3f(sp2C);
sp20[0] = arg2[0] - sp2C[0];
sp20[1] = arg2[1] - sp2C[1];
sp20[2] = arg2[2] - sp2C[2];
@@ -525,4 +525,4 @@ void func_80338370(void){
void func_8033837C(s32 arg0){
D_8037033C = arg0;
}
}

View File

@@ -6,7 +6,7 @@
#include "animation.h"
extern f32 glspline_catmull_rom_interpolate(f32, s32, f32 *);
extern BKSpriteDisplayData * func_80344A1C(BKSprite *arg0);
f32 D_803709E0[] = {
0.0f, 0.0f, 0.0f, 1.0f,
1.0f, 1.0f, 0.0f, 0.0f,

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void mlMtxRotate(f32, f32, f32);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void func_80252330(f32, f32, f32);
extern void mlMtxApply(Mtx *);
@@ -40,7 +40,7 @@ void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(sp54->unk28_23 != 1){
ml_vec3f_copy(sp48, sp54->unk4);
sp48[1] += (sp54->unk1C*sp54->unk20[1])/100.0;
viewport_getPosition(sp3C);
viewport_get_position_vec3f(sp3C);
ml_vec3f_diff_copy(sp30, sp48, sp3C);
if(sp54->unk28_12){
mlMtxSet(func_8024DD90());
@@ -48,7 +48,7 @@ void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
else{
mlMtxIdent();
}
mlMtxRotate(sp54->unk10[0], sp54->unk10[1], sp54->unk10[2]);
mlMtxRotatePYR(sp54->unk10[0], sp54->unk10[1], sp54->unk10[2]);
func_80252330(sp30[0], sp30[1], sp30[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@@ -4,7 +4,7 @@
extern void spriteRender_drawWithSegment(Gfx**, Vtx**, BKSprite *, s32, s32);
extern void func_80252330(f32, f32, f32);
extern void mlMtxRotate(f32, f32, f32);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void mlMtxApply(Mtx *);
extern void func_80349AD0(void);
extern void func_8024C5A8(f32[3]);
@@ -51,7 +51,7 @@ void func_80344138(BKSpriteDisplayData *self, s32 frame, s32 mirrored, f32 posit
f32 sp38;
f32 sp34;
viewport_getPosition(sp6C);
viewport_get_position_vec3f(sp6C);
func_8024C5A8(sp60);
sp50[0] = position[0] - sp6C[0];
sp50[1] = position[1] - sp6C[1];
@@ -109,7 +109,7 @@ void func_80344424(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
f32 sp38;
f32 sp34;
viewport_getPosition(sp6C);
viewport_get_position_vec3f(sp6C);
func_8024C5A8(sp60);
sp50[0] = position[0] - sp6C[0];
sp50[1] = position[1] - sp6C[1];
@@ -141,7 +141,7 @@ void func_80344424(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
D_80371EC0.unk0(D_80371EC0.unk4);
}
mlMtxSet(func_8024DD90());
mlMtxRotate(0.0f, 0.0f, rotation);
mlMtxRotatePYR(0.0f, 0.0f, rotation);
func_80252330(sp50[0], sp50[1], sp50[2]);
if ((scale != NULL) || mirrored) {
mlMtxScale_xyz((mirrored) ? -scale[0] : scale[0], sp38, sp34);
@@ -167,7 +167,7 @@ void func_80344720(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
f32 var_f14;
BKSpriteFrameDisplayData *temp_a3;
viewport_getPosition(sp5C);
viewport_get_position_vec3f(sp5C);
func_8024C5A8(sp50);
sp40[0] = position[0] - sp5C[0];
sp40[1] = position[1] - sp5C[1];
@@ -191,7 +191,7 @@ void func_80344720(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi
}
mlMtxIdent();
func_80252330(sp40[0], sp40[1], sp40[2]);
mlMtxRotate(rotation[0], rotation[1], rotation[2]);
mlMtxRotatePYR(rotation[0], rotation[1], rotation[2]);
mlMtxScale_xyz((mirrored) ? -scale[0] : scale[0], scale[1], scale[2]);
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@@ -202,7 +202,7 @@ void func_80345C78(f32 arg0[4], f32 arg1[3]) {
mlMtxRotYaw(arg1[1]);
mlMtxRotPitch(arg1[0]);
mlMtxRotRoll(arg1[2]);
func_80345A44(arg0, func_80251488());
func_80345A44(arg0, mlMtx_get_stack_pointer());
}
void func_80345CD4(f32 arg0[4], f32 arg1[4]){
@@ -210,7 +210,7 @@ void func_80345CD4(f32 arg0[4], f32 arg1[4]){
mlMtxRotRoll(arg1[2]);
mlMtxRotYaw(arg1[1]);
mlMtxRotPitch(arg1[0]);
func_80345A44(arg0, func_80251488());
func_80345A44(arg0, mlMtx_get_stack_pointer());
}
void func_80345D30(f32 arg0[4], f32 arg1[4], f32 arg2[4]) {

View File

@@ -237,7 +237,7 @@ void func_803465E4(void){
}//L8034667C
if(D_80385FE0){
if(gctransition_8030BD98() || func_803203FC(0)){
if(gctransition_done() || func_803203FC(0)){
if(D_80385FE4){
item_dec(ITEM_16_LIFE);
func_802FACA4(ITEM_14_HEALTH);

View File

@@ -148,7 +148,7 @@ void func_8034B580(s32 arg0) {
f32 sp1C;
sp1C = D_80386128;
if (gctransition_8030BD98() != 0) {
if (gctransition_done() != 0) {
D_80386128 += time_getDelta();
}
if ((getGameMode() != GAME_MODE_8_BOTTLES_BONUS) && (getGameMode() != GAME_MODE_A_SNS_PICTURE)) {
@@ -278,7 +278,7 @@ void func_8034BB08(bool arg0) {
}
bool func_8034BB48(void) {
if (D_80386120 && gctransition_8030BD98()) {
if (D_80386120 && gctransition_done()) {
D_80386120 = FALSE;
return TRUE;
}
@@ -290,7 +290,7 @@ void func_8034BB90(void) {
s32 sp18;
sp1C = gctransition_8030BDC0();
sp18 = gctransition_8030BD98();
sp18 = gctransition_done();
if (!D_80386118) {
func_8034B834();
func_8034B4E4(D_80386114->unk1);

View File

@@ -3,7 +3,7 @@
#include "variables.h"
extern bool func_8028F170(f32, f32);
extern void viewport_getPosition(f32[3]);
extern void viewport_get_position_vec3f(f32[3]);
typedef struct {
f32 unk0;
@@ -129,8 +129,8 @@ void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
temp_s1 = D_80386170.unk4;
if (( temp_s1 != NULL) && D_8038617C.unk0) {
viewport_getPosition(spDC);
viewport_getRotation(spD0);
viewport_get_position_vec3f(spDC);
viewport_get_rotation_vec3f(spD0);
sp9C[0] = temp_s1->unk4[0];
sp9C[1] = temp_s1->unk4[1];
sp9C[2] = temp_s1->unk4[2];
@@ -196,7 +196,7 @@ void func_80350CA4(void) {
s32 var_v0;
if (D_80386170.unk4 != NULL) {
viewport_getPosition(sp54);
viewport_get_position_vec3f(sp54);
sp48[0] = D_80386170.unk4->unk4[0];
sp48[1] = D_80386170.unk4->unk4[1];
sp48[2] = D_80386170.unk4->unk4[2];

View File

@@ -94,4 +94,4 @@ void func_802C02D4(f32 arg0[3]) {
func_802C02B4(arg0);
break;
}
}
}

View File

@@ -1218,7 +1218,7 @@ void __gcpausemenu_drawSprite(Gfx** gdl, Mtx** mptr, Vtx** vptr, BKSprite* sprit
func_80338338(0xFF, 0xFF, 0xFF);
func_803382FC(a);
func_8033837C(0);
viewport_getPosition(sp50);
viewport_get_position_vec3f(sp50);
sp34 = func_8024DE1C(x, y, sp5C, sp44);
mlMtxIdent(); //matrix_stack_identity
@@ -1337,8 +1337,8 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp8C[0] = 0.0f;
sp8C[1] = 0.0f;
sp8C[2] = 0.0f;
viewport_setPosition(sp98);
viewport_setRotation(sp8C);
viewport_set_position_vec3f(sp98);
viewport_set_rotation_vec3f(sp8C);
viewport_update();
func_8024C904(gfx, mtx);
sp98[0] = 0.0f;
@@ -1382,8 +1382,8 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp8C[1] = 0.0f;
sp8C[2] = 0.0f;
viewport_setPosition(sp98);
viewport_setRotation(sp8C);
viewport_set_position_vec3f(sp98);
viewport_set_rotation_vec3f(sp8C);
viewport_update();
func_8024C904(gfx, mtx);

View File

@@ -78,7 +78,7 @@ void sky_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(gcSky.model_bins[0]){
func_80254084(gfx, 0, 0, (s32)(f32) framebuffer_width, (s32)(f32)framebuffer_height,0, 0, 0); //fill screen with black
func_8024C904(gfx, mtx);
viewport_getPosition(position);
viewport_get_position_vec3f(position);
for(i = 0; i < 3; i++){
iAsset = gcSky.model_bins[i];
if(iAsset){

View File

@@ -9,73 +9,125 @@ void func_8025AC20(s32, s32, s32, f32, char*, s32);
f32 func_80257618(void);
void func_8024CE60(f32, f32);
typedef enum {
TRANSITION_ID_1_BLACK_IN = 1,
TRANSITION_ID_2_BLACK_OUT,
TRANSITION_ID_3_CIRCLE_IN,
TRANSITION_ID_4_CIRCLE_OUT,
TRANSITION_ID_5_JIGGY_IN,
TRANSITION_ID_6_JIGGY_OUT,
TRANSITION_ID_7,
TRANSITION_ID_8_WHITE_IN,
TRANSITION_ID_9_WHITE_OUT,
TRANSITION_ID_A_WITCH_HEAD_OUT,
TRANSITION_ID_B_CIRCLE_IN_FAST,
TRANSITION_ID_C_CIRCLE_OUT_FAST,
TRANSITION_ID_D,
TRANSITION_ID_E_CIRCLE_IN_SLOW,
TRANSITION_ID_F_CIRCLE_OUT_SLOW,
TRANSITION_ID_10_FALLING_PIECES_IN,
TRANSITION_ID_11_FALLING_PIECES_OUT,
TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW,
TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW,
TRANSITION_ID_14_CIRCLE_IN_SUPER_SLOW,
TRANSITION_ID_15_CIRCLE_OUT_SUPER_SLOW,
} TransitionId;
typedef enum {
TRANSITION_STATE_0_NONE,
TRANSITION_STATE_1_LOADING,
TRANSITION_STATE_2_BLACK_IN,
TRANSITION_STATE_3_BLACK_OUT,
TRANSITION_STATE_4_FADE_IN,
TRANSITION_STATE_5_FADE_OUT,
TRANSITION_STATE_6_LOADING_WHITE,
TRANSITION_STATE_7_WHITE_IN,
TRANSITION_STATE_8_WHITE_OUT
} TransitionState;
typedef struct {
u8 uid;
u8 state;
u8 next_state;
// u8 pad3[1];
f32 duration;
s32 model_index;
s32 anim_index;
f32 scale;
}TransitionInfo;
typedef struct {
u8 map_indx;
u8 in_index;
u8 out_index;
}MapTransitionInfo;
/* .data */
struct9s D_8036C150[0x16]= {
{0x1, 2, 0, 0.1f, 0, 0, 0.0f},
{0x2, 3, 1, 0.1f, 0, 0, 0.0f},
{0x3, 4, 0, 0.5f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x4, 5, 1, 0.5f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x5, 4, 0, 2.5f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{0x6, 5, 1, 0.9f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{0x7, 0, 0, 0.0f, 0, 0, 0.0f},
{0x8, 7, 0, 1.1f, 0, 0, 0.0f},
{0x9, 8, 6, 0.7f, 0, 0, 0.0f},
{0xA, 5, 1, 3.5f, ASSET_7D4_MODEL_TRANSITION_WITCH, 0, 3.7f},
{0xB, 4, 0, 0.3f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0xC, 5, 1, 0.3f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0xD, 2, 0, 0.6f, 0, 0, 0.0f},
{0xE, 4, 0, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0xF, 5, 1, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x10, 4, 0, 2.5f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{0x11, 5, 1, 2.0f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{0x12, 4, 0, 1.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x13, 5, 1, 1.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x14, 5, 1, 2.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x15, 4, 0, 2.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
TransitionInfo D_8036C150[0x16]= {
{TRANSITION_ID_1_BLACK_IN, TRANSITION_STATE_2_BLACK_IN, TRANSITION_STATE_0_NONE, 0.1f, 0, 0, 0.0f},
{TRANSITION_ID_2_BLACK_OUT, TRANSITION_STATE_3_BLACK_OUT, TRANSITION_STATE_1_LOADING, 0.1f, 0, 0, 0.0f},
{TRANSITION_ID_3_CIRCLE_IN, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 0.5f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_4_CIRCLE_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 0.5f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_5_JIGGY_IN, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 2.5f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{TRANSITION_ID_6_JIGGY_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 0.9f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{TRANSITION_ID_7, TRANSITION_STATE_0_NONE, TRANSITION_STATE_0_NONE, 0.0f, 0, 0, 0.0f},
{TRANSITION_ID_8_WHITE_IN, TRANSITION_STATE_7_WHITE_IN, TRANSITION_STATE_0_NONE, 1.1f, 0, 0, 0.0f},
{TRANSITION_ID_9_WHITE_OUT, TRANSITION_STATE_8_WHITE_OUT, TRANSITION_STATE_6_LOADING_WHITE, 0.7f, 0, 0, 0.0f},
{TRANSITION_ID_A_WITCH_HEAD_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 3.5f, ASSET_7D4_MODEL_TRANSITION_WITCH, 0, 3.7f},
{TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 0.3f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_C_CIRCLE_OUT_FAST, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 0.3f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_D, TRANSITION_STATE_2_BLACK_IN, TRANSITION_STATE_0_NONE, 0.6f, 0, 0, 0.0f},
{TRANSITION_ID_E_CIRCLE_IN_SLOW, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_F_CIRCLE_OUT_SLOW, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_10_FALLING_PIECES_IN, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 2.5f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{TRANSITION_ID_11_FALLING_PIECES_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 2.0f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 1.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 1.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_14_CIRCLE_IN_SUPER_SLOW, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 2.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_15_CIRCLE_OUT_SUPER_SLOW, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 2.2f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
0
};
struct9s D_8036C308[0xC] = {
{0xA, 5, 1, 3.5f, ASSET_7D4_MODEL_TRANSITION_WITCH, 0, 3.7f},
{0x10, 4, 0, 2.5f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{0x11, 5, 1, 2.0f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{0x6, 5, 1, 0.9f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{0x5, 4, 0, 2.5f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{0x9, 8, 6, 0.7f, 0, 0, 0.0f},
{0x8, 7, 0, 0.7f, 0, 0, 0.0f},
{0xE, 4, 0, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0xF, 5, 1, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{0x7, 0, 0, 0.0f, 0, 0, 0.0f},
{0x8, 7, 0, 1.1f, 0, 0, 0.0f},
{0x9, 8, 6, 1.5f, 0, 0, 0.0f}
TransitionInfo D_8036C308[0xC] = {
{TRANSITION_ID_A_WITCH_HEAD_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 3.5f, ASSET_7D4_MODEL_TRANSITION_WITCH, 0, 3.7f},
{TRANSITION_ID_10_FALLING_PIECES_IN, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 2.5f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{TRANSITION_ID_11_FALLING_PIECES_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 2.0f, ASSET_467_MODEL_TRANSITION_FALLING_JIGGIES, ASSET_1F5_ANIM_TRANSITION_FALLING_JIGGIES, 0.269645989f},
{TRANSITION_ID_6_JIGGY_OUT, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 0.9f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{TRANSITION_ID_5_JIGGY_IN, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 2.5f, ASSET_7D0_MODEL_TRANSITION_JIGGY, 0, 3.5f},
{TRANSITION_ID_9_WHITE_OUT, TRANSITION_STATE_8_WHITE_OUT, TRANSITION_STATE_6_LOADING_WHITE, 0.7f, 0, 0, 0.0f},
{TRANSITION_ID_8_WHITE_IN, TRANSITION_STATE_7_WHITE_IN, TRANSITION_STATE_0_NONE, 0.7f, 0, 0, 0.0f},
{TRANSITION_ID_E_CIRCLE_IN_SLOW, TRANSITION_STATE_4_FADE_IN, TRANSITION_STATE_0_NONE, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_F_CIRCLE_OUT_SLOW, TRANSITION_STATE_5_FADE_OUT, TRANSITION_STATE_1_LOADING, 1.0f, ASSET_7CF_MODEL_TRANSITION_UNKNOWN, 0, 25.0f},
{TRANSITION_ID_7, TRANSITION_STATE_0_NONE, TRANSITION_STATE_0_NONE, 0.0f, 0, 0, 0.0f},
{TRANSITION_ID_8_WHITE_IN, TRANSITION_STATE_7_WHITE_IN, TRANSITION_STATE_0_NONE, 1.1f, 0, 0, 0.0f},
{TRANSITION_ID_9_WHITE_OUT, TRANSITION_STATE_8_WHITE_OUT, TRANSITION_STATE_6_LOADING_WHITE, 1.5f, 0, 0, 0.0f}
};
struct10s D_8036C3F8[0x18] = {
{MAP_20_CS_END_NOT_100, 0x12, 0x13},
{MAP_1F_CS_START_RAREWARE, 0x15, 0x09},
{MAP_1E_CS_START_NINTENDO, 0x08, 0x13},
{MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0x0B, 0x0C},
{MAP_7E_CS_SPIRAL_MOUNTAIN_2, 0x0B, 0x0C},
{MAP_85_CS_SPIRAL_MOUNTAIN_3, 0x12, 0x0C},
{MAP_86_CS_SPIRAL_MOUNTAIN_4, 0x0B, 0x0C},
{MAP_87_CS_SPIRAL_MOUNTAIN_5, 0x12, 0x13},
{MAP_88_CS_SPIRAL_MOUNTAIN_6, 0x12, 0x13},
{MAP_94_CS_INTRO_SPIRAL_7, 0x12, 0x13},
{MAP_95_CS_END_ALL_100, 0x12, 0x13},
{MAP_98_CS_END_SPIRAL_MOUNTAIN_1, 0x12, 0x0A},
{MAP_99_CS_END_SPIRAL_MOUNTAIN_2, 0x12, 0x0A},
{MAP_7B_CS_INTRO_GL_DINGPOT_1, 0x0B, 0x0C},
{MAP_81_CS_INTRO_GL_DINGPOT_2, 0x0B, 0x0C},
{MAP_82_CS_ENTERING_GL_MACHINE_ROOM, 0x12, 0x0A},
{MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0x12, 0x13},
{MAP_84_CS_UNUSED_MACHINE_ROOM, 0x12, 0x0C},
{MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0x0B, 0x0C},
{MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0x0B, 0x0A},
{MAP_8A_CS_INTRO_BANJOS_HOUSE_3, 0x01, 0x02},
{MAP_96_CS_END_BEACH_1, 0x12, 0x13},
{MAP_97_CS_END_BEACH_2, 0x08, 0x14},
{0, 0x05, 0x06}
MapTransitionInfo D_8036C3F8[0x18] = {
{MAP_20_CS_END_NOT_100, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_1F_CS_START_RAREWARE, TRANSITION_ID_15_CIRCLE_OUT_SUPER_SLOW, TRANSITION_ID_9_WHITE_OUT},
{MAP_1E_CS_START_NINTENDO, TRANSITION_ID_8_WHITE_IN, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_7D_CS_SPIRAL_MOUNTAIN_1, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_7E_CS_SPIRAL_MOUNTAIN_2, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_85_CS_SPIRAL_MOUNTAIN_3, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_86_CS_SPIRAL_MOUNTAIN_4, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_87_CS_SPIRAL_MOUNTAIN_5, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_88_CS_SPIRAL_MOUNTAIN_6, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_94_CS_INTRO_SPIRAL_7, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_95_CS_END_ALL_100, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_98_CS_END_SPIRAL_MOUNTAIN_1, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_A_WITCH_HEAD_OUT},
{MAP_99_CS_END_SPIRAL_MOUNTAIN_2, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_A_WITCH_HEAD_OUT},
{MAP_7B_CS_INTRO_GL_DINGPOT_1, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_81_CS_INTRO_GL_DINGPOT_2, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_82_CS_ENTERING_GL_MACHINE_ROOM, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_A_WITCH_HEAD_OUT},
{MAP_83_CS_GAME_OVER_MACHINE_ROOM, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_84_CS_UNUSED_MACHINE_ROOM, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_7C_CS_INTRO_BANJOS_HOUSE_1, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_C_CIRCLE_OUT_FAST},
{MAP_89_CS_INTRO_BANJOS_HOUSE_2, TRANSITION_ID_B_CIRCLE_IN_FAST, TRANSITION_ID_A_WITCH_HEAD_OUT},
{MAP_8A_CS_INTRO_BANJOS_HOUSE_3, TRANSITION_ID_1_BLACK_IN, TRANSITION_ID_2_BLACK_OUT},
{MAP_96_CS_END_BEACH_1, TRANSITION_ID_12_CIRCLE_IN_EXTRA_SLOW, TRANSITION_ID_13_CIRCLE_OUT_EXTRA_SLOW},
{MAP_97_CS_END_BEACH_2, TRANSITION_ID_8_WHITE_IN, TRANSITION_ID_14_CIRCLE_IN_SUPER_SLOW},
{0, TRANSITION_ID_5_JIGGY_IN, TRANSITION_ID_6_JIGGY_OUT}
};
f32 D_8036C440 = 63.6026115f;
f32 D_8036C444 = 500.0f;
@@ -84,19 +136,19 @@ f32 D_8036C444 = 500.0f;
/* .bss */
struct{
s32 unk0; //times drawn?
struct9s *unk4;
u8 unk8; //state
u8 pad9[3]; //not needed
void * unkC; //asset_ptr
TransitionInfo *transistion_info;
u8 state;
//u8 pad9[3]; //not needed
void * model_ptr; //asset_ptr
f32 rotation;
f32 timer;
AnimCtrl *animctrl;
s32 unk1C; //times update called?
} D_80382430;
s32 substate; //times update called?
} s_current_transition;
/* .code */
struct9s *_gctranstion_8030B400(s32 arg0){
struct9s * i;
TransitionInfo *_gctranstion_8030B400(s32 arg0){
TransitionInfo * i;
for(i = D_8036C150; i->uid != 0; i++){
if(i->uid == arg0)
return i;
@@ -104,8 +156,8 @@ struct9s *_gctranstion_8030B400(s32 arg0){
return NULL;
}
struct10s *_gctranstion_8030B44C(s32 map_indx){
struct10s * i;
MapTransitionInfo *_gctranstion_get_map_transition_info(s32 map_indx){
MapTransitionInfo * i;
for(i = D_8036C3F8; i->map_indx != 0; i++){
if(i->map_indx == map_indx)
return i;
@@ -113,54 +165,57 @@ struct10s *_gctranstion_8030B44C(s32 map_indx){
return i;
}
void _gctranstion_changeState(s32 state, struct9s *arg1){
if(D_80382430.unkC != NULL){
func_8033BD20(&D_80382430.unkC);
void _gctranstion_changeState(s32 state, TransitionInfo *desc){
if(s_current_transition.model_ptr != NULL){
func_8033BD20(&s_current_transition.model_ptr);
}
if(D_80382430.animctrl != NULL){
animctrl_free(D_80382430.animctrl);
D_80382430.animctrl = NULL;
if(s_current_transition.animctrl != NULL){
animctrl_free(s_current_transition.animctrl);
s_current_transition.animctrl = NULL;
}
D_80382430.unk0 = 0;
D_80382430.unk4 = arg1;
D_80382430.unk8 = state;
D_80382430.timer = 0.0f;
if(state == 1)
D_80382430.unkC = assetcache_get(0x7D2);
else if(state == 6)
D_80382430.unkC = assetcache_get(0x7D3);
else if(arg1 != NULL && arg1->unk8 != 0)
D_80382430.unkC = assetcache_get(arg1->unk8);
s_current_transition.unk0 = 0;
s_current_transition.transistion_info = desc;
s_current_transition.state = state;
s_current_transition.timer = 0.0f;
//Loading screen model??
if(state == TRANSITION_STATE_1_LOADING)
s_current_transition.model_ptr = assetcache_get(0x7D2); //scene transition black
else if(state == TRANSITION_STATE_6_LOADING_WHITE)
s_current_transition.model_ptr = assetcache_get(0x7D3); //scene transition white
else if(desc != NULL && desc->model_index != 0)
s_current_transition.model_ptr = assetcache_get(desc->model_index);
if(arg1 != NULL && arg1->unkC != NULL){
D_80382430.animctrl = animctrl_new(0);
animctrl_reset(D_80382430.animctrl);
animctrl_setIndex(D_80382430.animctrl, arg1->unkC);
animctrl_setDuration(D_80382430.animctrl, arg1->unk4);
animctrl_setPlaybackType(D_80382430.animctrl, ANIMCTRL_ONCE);
if(state == 5){
animctrl_setDirection(D_80382430.animctrl, 0);
//load transistion animation
if(desc != NULL && desc->anim_index != NULL){
s_current_transition.animctrl = animctrl_new(0);
animctrl_reset(s_current_transition.animctrl);
animctrl_setIndex(s_current_transition.animctrl, desc->anim_index);
animctrl_setDuration(s_current_transition.animctrl, desc->duration);
animctrl_setPlaybackType(s_current_transition.animctrl, ANIMCTRL_ONCE);
if(state == TRANSITION_STATE_5_FADE_OUT){
animctrl_setDirection(s_current_transition.animctrl, 0);
func_8028F7C8(1); //player_noControl(true)
func_80335110(0); //objects_update(false)
}
else{
osViBlack(1);
animctrl_setAnimTimer(D_80382430.animctrl, 0.25f); //set animation timer
animctrl_setAnimTimer(s_current_transition.animctrl, 0.25f); //set animation timer
}
animctrl_start(D_80382430.animctrl, "gctransition.c", 0x125);
animctrl_start(s_current_transition.animctrl, "gctransition.c", 0x125);
}
if(state == 4){
if(state == TRANSITION_STATE_4_FADE_IN){
if(func_802D4608()==0){
func_8025A70C(COMUSIC_4E_IN_TRANSITION);
func_8025AC20(COMUSIC_4E_IN_TRANSITION, 0, 1000, 0.4f, "gctransition.c", 0x12d);
func_8025AABC(COMUSIC_4E_IN_TRANSITION);
}
}//L8030B67C
else if(state == 5){
if(D_80382430.unk4->uid == 0xA){
else if(state == TRANSITION_STATE_5_FADE_OUT){
if(s_current_transition.transistion_info->uid == 0xA){
func_8030E704(SFX_EB_GRUNTY_LAUGH_2);
}
else{
@@ -171,167 +226,178 @@ void _gctranstion_changeState(s32 state, struct9s *arg1){
}
}
}
else if(state == 0){
else if(state == TRANSITION_STATE_0_NONE){
func_80335128(1);
func_80335110(1);
if(func_8028F070())
func_8028F7C8(0);
}
D_80382430.unk1C = 0;
s_current_transition.substate = 0;
}
void gctransition_8030B740(void){
if(D_80382430.unkC != NULL)
D_80382430.unkC = defrag_asset(D_80382430.unkC);
void gctransition_defrag(void){
if(s_current_transition.model_ptr != NULL)
s_current_transition.model_ptr = defrag_asset(s_current_transition.model_ptr);
}
void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){
f32 sp74[3];
f32 sp68[3];
f32 sp64;
f32 vp_position[3];
f32 vp_rotation[3];
f32 percentage;
f32 sp58[3];
f32 tmp;
f32 scale;
D_80382430.unk0++;
if(D_80382430.unk8 == 0)
s_current_transition.unk0++;
if(s_current_transition.state == 0)
return;
func_8024E258();
if(D_80382430.animctrl != NULL){
sp74[0] = 0.0f;
sp74[1] = 0.0f;
sp74[2] = 350.0f;
if(s_current_transition.animctrl != NULL){
vp_position[0] = 0.0f;
vp_position[1] = 0.0f;
vp_position[2] = 350.0f;
}else{
sp74[0] = 0.0f;
sp74[1] = 0.0f;
sp74[2] = 300.0f;
vp_position[0] = 0.0f;
vp_position[1] = 0.0f;
vp_position[2] = 300.0f;
}
sp68[0] = 0.0f;
sp68[1] = 0.0f;
sp68[2] = 0.0f;
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
vp_rotation[2] = 0.0f;
func_8024CE60(D_8036C440, D_8036C444);
viewport_setPosition(sp74); //viewport_getPosition
viewport_setRotation(sp68); //viewport_getRotation
viewport_set_position_vec3f(vp_position); //viewport_get_position_vec3f
viewport_set_rotation_vec3f(vp_rotation); //viewport_get_rotation_vec3f
viewport_update(); //camera_updateNormal
func_8024C904(gdl, mptr);
sp58[0] = 0.0f;
sp58[1] = 0.0f;
sp58[2] = 0.0f;
if(D_80382430.animctrl != NULL){
if(s_current_transition.animctrl != NULL){
gDPSetTextureFilter((*gdl)++, G_TF_POINT);
gDPSetColorDither((*gdl)++, G_CD_DISABLE);
animctrl_drawSetup(D_80382430.animctrl, sp58, 1);
animctrl_drawSetup(s_current_transition.animctrl, sp58, 1);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
}
if(D_80382430.unk8 == 1 || D_80382430.unk8 == 6){
modelRender_draw(gdl, mptr, sp58, sp68, 1.0f, 0, D_80382430.unkC);
if(D_80382430.animctrl != NULL){
//complex animation (from animation bin file)
if(s_current_transition.state == 1 || s_current_transition.state == 6){
modelRender_draw(gdl, mptr, sp58, vp_rotation, 1.0f, 0, s_current_transition.model_ptr);
if(s_current_transition.animctrl != NULL){
gDPSetTextureFilter((*gdl)++, G_TF_BILERP);
gDPSetColorDither((*gdl)++, G_CD_MAGICSQ);
}
return;
}
else{
sp64 = D_80382430.timer/(D_80382430.unk4->unk4);
if(D_80382430.unk8 == 4){
if(D_80382430.unk4->uid == 0x10){
tmp = D_80382430.unk4->unk10;
}
else{
sp68[2] = D_80382430.rotation - 90.0f*sp64;
tmp = sp64*D_80382430.unk4->unk10 + 0.1;
}
modelRender_draw(gdl, mptr, sp58, sp68, tmp, 0, D_80382430.unkC);
percentage = s_current_transition.timer/(s_current_transition.transistion_info->duration);
if(s_current_transition.state == TRANSITION_STATE_4_FADE_IN){
//rotate and zoom in
if(s_current_transition.transistion_info->uid == 0x10){
scale = s_current_transition.transistion_info->scale;
}
else if(D_80382430.unk8 == 5){//L8030B9EC
switch (D_80382430.unk4->uid)
{
else{
vp_rotation[2] = s_current_transition.rotation - 90.0f*percentage;
scale = percentage*s_current_transition.transistion_info->scale + 0.1;
}
modelRender_draw(gdl, mptr, sp58, vp_rotation, scale, 0, s_current_transition.model_ptr);
}
else if(s_current_transition.state == TRANSITION_STATE_5_FADE_OUT){//L8030B9EC
switch (s_current_transition.transistion_info->uid)
{
default:
sp68[2] = D_80382430.rotation - 90.0f*sp64;
tmp = (1.0f - sp64)*D_80382430.unk4->unk10 + 0.1;
//rotate and zoom out
vp_rotation[2] = s_current_transition.rotation - 90.0f*percentage;
scale = (1.0f - percentage)*s_current_transition.transistion_info->scale + 0.1;
break;
case 0x11:
tmp = D_80382430.unk4->unk10;
//static
scale = s_current_transition.transistion_info->scale;
break;
case 0xA:
sp68[2] = 0.0f;
tmp = (1.0f - func_80257618())*D_80382430.unk4->unk10 + 0.1;
//zoom out only
vp_rotation[2] = 0.0f;
scale = (1.0f - func_80257618())*s_current_transition.transistion_info->scale + 0.1;
break;
}
if(!(D_80382430.unk1C < 3) || D_80382430.unk4->uid != 0x11){
modelRender_draw(gdl, mptr, sp58, sp68, tmp, 0, D_80382430.unkC);
}
else{
modelRender_reset();
}
}
else if(D_80382430.unk8 == 2){//L8030BAF4
gcbound_reset();
gcbound_alpha((1.0f - sp64)*255.0f + 0.5);
gcbound_color(0,0,0);
gcbound_draw(gdl);
if(!(s_current_transition.substate < 3) || s_current_transition.transistion_info->uid != 0x11){
modelRender_draw(gdl, mptr, sp58, vp_rotation, scale, 0, s_current_transition.model_ptr);
}
else if(D_80382430.unk8 == 3){//L8030BB6C
gcbound_reset();
gcbound_alpha(sp64*255.0f + 0.5);
gcbound_color(0,0,0);
gcbound_draw(gdl);
}
else if(D_80382430.unk8 == 7){//L8030BBD8
sp64 = (sp64 <= 0.5)? 1.0 : 1.0 - (sp64-0.5)/0.5;
gcbound_reset();
gcbound_alpha(sp64*255.0f + 0.5);
gcbound_color(0xff,0xff,0xff);
gcbound_draw(gdl);
}
else if(D_80382430.unk8 == 8){//L8030BC8C
gcbound_reset();
gcbound_alpha(sp64*255.0f + 0.5);
gcbound_color(0xff,0xff,0xff);
gcbound_draw(gdl);
}//L8030BD00
else{
modelRender_reset();
}
if(D_80382430.animctrl != NULL){
gDPSetTextureFilter((*gdl)++, G_TF_BILERP);
}
func_8024E2FC();
func_8024C904(gdl, mptr);
}
else if(s_current_transition.state == TRANSITION_STATE_2_BLACK_IN){//L8030BAF4
//fade in black (i.e. get less black)
gcbound_reset();
gcbound_alpha((1.0f - percentage)*255.0f + 0.5);
gcbound_color(0,0,0);
gcbound_draw(gdl);
}
else if(s_current_transition.state == TRANSITION_STATE_3_BLACK_OUT){//L8030BB6C
//fade out black (i.e. get more black)
gcbound_reset();
gcbound_alpha(percentage*255.0f + 0.5);
gcbound_color(0,0,0);
gcbound_draw(gdl);
}
else if(s_current_transition.state == TRANSITION_STATE_7_WHITE_IN){//L8030BBD8
//fade in white (i.e. get less white)
percentage = (percentage <= 0.5)? 1.0 : 1.0 - (percentage-0.5)/0.5;
gcbound_reset();
gcbound_alpha(percentage*255.0f + 0.5);
gcbound_color(0xff,0xff,0xff);
gcbound_draw(gdl);
}
else if(s_current_transition.state == TRANSITION_STATE_8_WHITE_OUT){//L8030BC8C
//fade out white (i.e. get more white)
gcbound_reset();
gcbound_alpha(percentage*255.0f + 0.5);
gcbound_color(0xff,0xff,0xff);
gcbound_draw(gdl);
}//L8030BD00
else{
}
if(s_current_transition.animctrl != NULL){
gDPSetTextureFilter((*gdl)++, G_TF_BILERP);
}
func_8024E2FC();
func_8024C904(gdl, mptr);
}
void gctransition_8030BD4C(void){
struct10s *tmp_10s;
struct9s *tmp_a1;
tmp_10s = _gctranstion_8030B44C(map_get());
tmp_a1 = _gctranstion_8030B400(tmp_10s->unk1);
_gctranstion_changeState(tmp_a1->unk1, tmp_a1);
MapTransitionInfo *tmp_10s;
TransitionInfo *tmp_a1;
tmp_10s = _gctranstion_get_map_transition_info(map_get());
tmp_a1 = _gctranstion_8030B400(tmp_10s->in_index);
_gctranstion_changeState(tmp_a1->state, tmp_a1);
}
f32 gctransition_8030BD88(void){
return 300.0f;
}
int gctransition_8030BD98(void){
return D_80382430.unk8 == 0;
int gctransition_done(void){
return s_current_transition.state == TRANSITION_STATE_0_NONE;
}
int gctransition_8030BDAC(void){
return D_80382430.unk8 != 0;
int gctransition_active(void){
return s_current_transition.state != TRANSITION_STATE_0_NONE;
}
int gctransition_8030BDC0(void){
return ( D_80382430.unk8 == 0x3)
|| (( D_80382430.unk8 == 1) && (D_80382430.unk0 < 2))
|| ( D_80382430.unk8 == 5)
|| ( D_80382430.unk8 == 8)
|| (( D_80382430.unk8 == 6) && (D_80382430.unk0 < 2));
return ( s_current_transition.state == TRANSITION_STATE_3_BLACK_OUT)
|| (( s_current_transition.state == TRANSITION_STATE_1_LOADING) && (s_current_transition.unk0 < 2))
|| ( s_current_transition.state == TRANSITION_STATE_5_FADE_OUT)
|| ( s_current_transition.state == TRANSITION_STATE_8_WHITE_OUT)
|| (( s_current_transition.state == TRANSITION_STATE_6_LOADING_WHITE) && (s_current_transition.unk0 < 2));
}
void gctransition_8030BE3C(void){
@@ -339,37 +405,37 @@ void gctransition_8030BE3C(void){
}
void gctransition_8030BE60(void){
struct9s *tmp_a1;
tmp_a1 = _gctranstion_8030B400(_gctranstion_8030B44C(map_get())->unk2);
TransitionInfo *tmp_a1;
tmp_a1 = _gctranstion_8030B400(_gctranstion_get_map_transition_info(map_get())->out_index);
func_8030C180();
_gctranstion_changeState(tmp_a1->unk1, tmp_a1);
_gctranstion_changeState(tmp_a1->state, tmp_a1);
}
void gctransition_8030BEA4(s32 arg0){
_gctranstion_changeState(D_8036C308[arg0].unk1, &D_8036C308[arg0]);
_gctranstion_changeState(D_8036C308[arg0].state, &D_8036C308[arg0]);
}
void gctransition_reset(void){
D_80382430.unk4 = NULL;
D_80382430.unk8 = 0;
D_80382430.unkC = NULL;
D_80382430.rotation = 0.0f;
s_current_transition.transistion_info = NULL;
s_current_transition.state = TRANSITION_STATE_0_NONE;
s_current_transition.model_ptr = NULL;
s_current_transition.rotation = 0.0f;
_gctranstion_changeState(0,0);
}
void gctransition_update(void){
f32 sp24;
f32 dt;
f32 tmp;
sp24 = time_getDelta();
if(D_80382430.unk4 == NULL)
dt = time_getDelta();
if(s_current_transition.transistion_info == NULL)
return;
if(D_80382430.animctrl != NULL){
animctrl_update(D_80382430.animctrl);
if(D_80382430.unk8 == 4){
switch(D_80382430.unk1C){
if(s_current_transition.animctrl != NULL){
animctrl_update(s_current_transition.animctrl);
if(s_current_transition.state == TRANSITION_STATE_4_FADE_IN){
switch(s_current_transition.substate){
case 0:
break;
case 1:
@@ -380,27 +446,27 @@ void gctransition_update(void){
func_80335128(0);
break;
case 3:
func_802FEF48(D_80382430.unkC); //framebuffer to model texture list
func_802FEF48(s_current_transition.model_ptr); //framebuffer to model texture list
break;
case 4:
osViBlack(0);
break;
default:
D_80382430.timer += sp24;
s_current_transition.timer += dt;
break;
}
}
else{//L8030BFEC
switch(D_80382430.unk1C){
switch(s_current_transition.substate){
default:
D_80382430.timer += sp24;
s_current_transition.timer += dt;
break;
case 0:
case 1:
break;
case 2:
func_80335128(0);
func_802FEF48(D_80382430.unkC); //framebuffer to model texture list
func_802FEF48(s_current_transition.model_ptr); //framebuffer to model texture list
break;
}
@@ -408,25 +474,26 @@ void gctransition_update(void){
}
}
else{//L8030C034
D_80382430.timer += sp24;
s_current_transition.timer += dt;
}
if(D_80382430.unk4->unk4 < D_80382430.timer
|| (D_80382430.animctrl!= NULL && animctrl_isStopped(D_80382430.animctrl))
if(s_current_transition.transistion_info->duration < s_current_transition.timer
|| (s_current_transition.animctrl!= NULL && animctrl_isStopped(s_current_transition.animctrl))
){
D_80382430.timer = D_80382430.unk4->unk4;
if(D_80382430.unk8 == 4 || D_80382430.unk8 == 5){
D_80382430.rotation -= 90.0f;
if (D_80382430.rotation < -360.0f)
D_80382430.rotation += 360.0f;
if (360.0f < D_80382430.rotation)
D_80382430.rotation -= 360.0f;
s_current_transition.timer = s_current_transition.transistion_info->duration;
//update next transition rotation
if(s_current_transition.state == TRANSITION_STATE_4_FADE_IN || s_current_transition.state == TRANSITION_STATE_5_FADE_OUT){
s_current_transition.rotation -= 90.0f;
if (s_current_transition.rotation < -360.0f)
s_current_transition.rotation += 360.0f;
if (360.0f < s_current_transition.rotation)
s_current_transition.rotation -= 360.0f;
}//L8030C104
_gctranstion_changeState(D_80382430.unk4->unk2, 0);
if(D_80382430.unk8 == 4)
_gctranstion_changeState(s_current_transition.transistion_info->next_state, 0);
if(s_current_transition.state == TRANSITION_STATE_4_FADE_IN)
func_8030C180();
if(D_80382430.animctrl != NULL)
if(s_current_transition.animctrl != NULL)
func_80334ECC();
}
D_80382430.unk1C++;
s_current_transition.substate++;
}

View File

@@ -61,11 +61,11 @@ void _levelSpecificFlags_updateCRC2(void) {
}
s32 levelSpecificFlags_get(s32 i){
return func_803200A4(D_80383320.unk8, i);
return bitfield_get_bit(D_80383320.unk8, i);
}
s32 levelSpecificFlags_getN(s32 i, s32 n){
return func_803200E4(D_80383320.unk8, i, n);
return bitfield_get_n_bits(D_80383320.unk8, i, n);
}
s32 levelSpecificFlags_getSet(s32 arg0, s32 arg1){

View File

@@ -498,7 +498,7 @@ BKCollisionTri *func_80309C74(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 flagFil
}
bool func_80309D58(f32 arg0[3], UNK_TYPE(s32) arg1) {
BKMeshList *temp_v0;
BKModelUnk14List *temp_v0;
temp_v0 = func_8033A12C(mapModel.model_bin_opa);
if (temp_v0 != NULL) {

View File

@@ -9,15 +9,15 @@
extern bool func_802ED420(BKModelUnk20List *arg0, u8 *arg1, u32 arg2);
extern void func_802ED52C(BKModelUnk20List *, f32[3], f32);
extern void func_80252AF0(f32[3], f32[3], f32[3], f32, f32[3]);
extern void mlMtxRotate(f32, f32, f32);
extern void viewport_getPosition(f32[3]);
extern void viewport_getRotation(f32[3]);
extern void viewport_setPosition(f32[3]);
extern void viewport_setRotation(f32[3]);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void viewport_get_position_vec3f(f32[3]);
extern void viewport_get_rotation_vec3f(f32[3]);
extern void viewport_set_position_vec3f(f32[3]);
extern void viewport_set_rotation_vec3f(f32[3]);
extern void viewport_update(void);
extern void func_8033BD4C(BKModelBin *);
extern s32 func_8024DB50(f32[3], f32);
extern void func_80251788(f32, f32, f32);
extern void mlMtx_push_translation(f32, f32, f32);
extern void mlMtxScale(f32);
extern void mlMtxApply(Mtx* mtx);
extern AnimMtxList *animMtxList_new();
@@ -696,8 +696,8 @@ void modelRender_reset(void){
func_8033A45C(1,1);
func_8033A45C(2,0);
if(D_80383758.unk18){
viewport_setPosition(D_80383758.unk1C);
viewport_setRotation(D_80383758.unk28);
viewport_set_position_vec3f(D_80383758.unk1C);
viewport_set_rotation_vec3f(D_80383758.unk28);
viewport_update();
}
}
@@ -714,7 +714,7 @@ void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){
if(cmd->unk8){
func_8025235C(sp30, cmd->unkC);
func_80251788(sp30[0], sp30[1], sp30[2]);
mlMtx_push_translation(sp30[0], sp30[1], sp30[2]);
mlMtxRotYaw(modelRenderCameraRotation[1]);
if(!cmd->unkA){
mlMtxRotPitch(modelRenderCameraRotation[0]);
@@ -795,7 +795,7 @@ void func_803387F8(Gfx **gfx, Mtx **mtx, void *arg2){
GeoCmd2 *cmd = (GeoCmd2 *)arg2;
if(D_8038371C){
func_802519C8(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk9));
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk9));
if(D_80370990){
mlMtxApply(*mtx);
gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -875,7 +875,7 @@ void func_80338BFC(Gfx **gfx, Mtx **mtx, void *arg2){
if(D_80383650){
if(D_8038371C){
func_802519C8(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unkA));
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unkA));
func_8025235C(sp20, cmd->unkC);
mlMtxPop();
}
@@ -970,7 +970,7 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp30 = (f32)cmd->unkE*modelRenderScale;
if(D_8038371C){
func_802519C8(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk12));
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk12));
func_8025235C(sp34, sp34);
mlMtxPop();
}
@@ -1034,8 +1034,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
}
D_80370990 = 0;
viewport_getPosition(modelRenderCameraPosition);
viewport_getRotation(modelRenderCameraRotation);
viewport_get_position_vec3f(modelRenderCameraPosition);
viewport_get_rotation_vec3f(modelRenderCameraRotation);
if(D_80383758.unk18){
D_80383758.unk1C[0] = modelRenderCameraPosition[0];
D_80383758.unk1C[1] = modelRenderCameraPosition[1];
@@ -1075,8 +1075,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
modelRenderCameraRotation[0] = D_80383758.unkC[0],
modelRenderCameraRotation[1] = D_80383758.unkC[1],
modelRenderCameraRotation[2] = D_80383758.unkC[2];
viewport_setPosition(modelRenderCameraPosition);
viewport_setRotation(modelRenderCameraRotation);
viewport_set_position_vec3f(modelRenderCameraPosition);
viewport_set_rotation_vec3f(modelRenderCameraRotation);
viewport_update();
camera_focus[0] = object_position[0] - modelRenderCameraPosition[0];
camera_focus[1] = object_position[1] - modelRenderCameraPosition[1];
@@ -1264,7 +1264,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation
}
if(D_803837B0.unk0){
mlMtxRotate(D_803837B0.unk4[0], D_803837B0.unk4[1], D_803837B0.unk4[2]);
mlMtxRotatePYR(D_803837B0.unk4[0], D_803837B0.unk4[1], D_803837B0.unk4[2]);
}
mlMtxGet(&D_80383BF8);
@@ -1420,8 +1420,8 @@ void func_8033A28C(bool arg0){
void func_8033A298(bool arg0){
D_80383758.unk18 = arg0;
if(arg0){
viewport_getPosition(D_80383758.unk0);
viewport_getRotation(D_80383758.unkC);
viewport_get_position_vec3f(D_80383758.unk0);
viewport_get_rotation_vec3f(D_80383758.unkC);
}
}

View File

@@ -7,8 +7,8 @@ void ncDynamicCamF_init(void){
f32 sp24[3];
f32 sp12[3];
viewport_getPosition(sp24);
viewport_getRotation(sp12);
viewport_get_position_vec3f(sp24);
viewport_get_rotation_vec3f(sp12);
ncDynamicCamera_setPosition(sp24);
ncDynamicCamera_setRotation(sp12);
player_getPosition(__playerStartPosition);

View File

@@ -212,8 +212,8 @@ void func_802BCBD4(void) {
func_802C0120();
func_802C2258();
func_802C0F4C();
viewport_getRotation(cameraRotation);
viewport_getPosition(cameraPosition);
viewport_get_rotation_vec3f(cameraRotation);
viewport_get_position_vec3f(cameraPosition);
ml_vec3f_copy(D_8037D948, cameraPosition);
ml_vec3f_clear(D_8037D9C8);
ml_vec3f_clear(D_8037D9E0);
@@ -366,8 +366,8 @@ void ncDynamicCamera_update(void){
if(dynamicCameraInFirstPerson){
ncFirstPersonCamera_getPositionAndRotation(sp24, sp18);
}
viewport_setPosition(sp24);
viewport_setRotation(sp18);
viewport_set_position_vec3f(sp24);
viewport_set_rotation_vec3f(sp18);
}
int ncDynamicCamera_getState(void){
@@ -940,8 +940,8 @@ void func_802BE720(void){
f32 sp28[3];
f32 sp1C[3];
viewport_getPosition(sp28);
viewport_getRotation(sp1C);
viewport_get_position_vec3f(sp28);
viewport_get_rotation_vec3f(sp1C);
ncDynamicCamera_setPosition(sp28);
ncDynamicCamera_setRotation(sp1C);
@@ -961,8 +961,8 @@ void func_802BE794(void){
sp2C[1] += 100.0f;
player_getRotation(sp20);
sp20[1] = mlNormalizeAngle(sp20[1] + 180.0f);
viewport_setPosition(sp2C);
viewport_setRotation(sp20);
viewport_set_position_vec3f(sp2C);
viewport_set_rotation_vec3f(sp20);
func_8024C510(300.0f);
func_802BE720();
}//L802BE828

View File

@@ -15,8 +15,8 @@ void ncRandomCamera_init(void) {
s32 sp24[3];
s32 sp18[3];
viewport_getPosition(D_8037DA50.storedPosition);
viewport_getRotation(D_8037DA50.storedRotation);
viewport_get_position_vec3f(D_8037DA50.storedPosition);
viewport_get_rotation_vec3f(D_8037DA50.storedRotation);
mapModel_getBounds(sp24, sp18);
D_8037DA50.minPosition[0] = (f32) sp24[0];
@@ -30,8 +30,8 @@ void ncRandomCamera_init(void) {
void ncRandomCamera_end(void){
viewport_setPosition(D_8037DA50.storedPosition);
viewport_setRotation(D_8037DA50.storedRotation);
viewport_set_position_vec3f(D_8037DA50.storedPosition);
viewport_set_rotation_vec3f(D_8037DA50.storedRotation);
}
void ncRandomCamera_update(void) {
@@ -45,6 +45,6 @@ void ncRandomCamera_update(void) {
sp18[0] = randf2(-90.0f, 90.0f);\
sp18[1] = randf2(0.0f, 360.0f);\
sp18[2] = 0.0f;
viewport_setPosition(sp24);
viewport_setRotation(sp18);
viewport_set_position_vec3f(sp24);
viewport_set_rotation_vec3f(sp18);
}

View File

@@ -33,8 +33,8 @@ void ncStaticCamera_setPosition(f32 arg0[3]){
}
void ncStaticCamera_update(void){
viewport_setPosition(ncStaticCameraPosition);
viewport_setRotation(ncStaticCameraRotation);
viewport_set_position_vec3f(ncStaticCameraPosition);
viewport_set_rotation_vec3f(ncStaticCameraRotation);
}
void __ncStaticCamera_setToNode(s32 camera_node_index){

View File

@@ -9,7 +9,7 @@ u8* quizQuestionAskedBitfield;
/* .code */
bool quizQuestionAskedBitfield_get(s32 index){
return func_803200A4(quizQuestionAskedBitfield, index);
return bitfield_get_bit(quizQuestionAskedBitfield, index);
}
void quizQuestionAskedBitfield_free(void){