diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index 5e43eef3..5ccb9ce9 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -524,7 +524,7 @@ segments: - [0xF603C0, c, ba/model] #DONE - [0xF60FB0, c, code_B650] #DONE - [0xF611B0, c, code_B850] #DONE - - [0xF614B0, c, code_BB50] #DONE + - [0xF614B0, c, eggshatter] #DONE - [0xF61680, c, code_BD20] #DONE - [0xF61A40, c, code_C0E0] #DONE - [0xF61D50, c, code_C3F0] #DONE @@ -616,29 +616,33 @@ segments: - [0xF89050, c, code_336F0] #DONE - [0xF89410, c, code_33AB0] #DONE - [0xF89590, c, code_33C30] #DONE - - [0xF896A0, c, code_33D40] #DONE + - [0xF896A0, c, nc/staticCamera] #DONE - [0xF898F0, c, code_33F90] #DONE - [0xF89C70, c, code_34310] #DONE - [0xF8A0F0, c, code_34790] #DONE - [0xF8AE80, c, code_35520] #DONE - - [0xF8B010, c, code_356B0] #DONE + - [0xF8B010, c, nc/dynamicCamera] #DONE - [0xF8D310, c, code_379B0] #DONE - - [0xF8D630, c, code_37CD0] #DONE + - [0xF8D630, c, nc/randomCamera] #DONE - [0xF8D7B0, c, code_37E50] #DONE - - [0xF8DAB0, c, code_38150] #DONE - - [0xF8DC40, c, code_382E0] #DONE - - [0xF8DDC0, c, code_38460] #DONE - - [0xF8DF90, c, code_38630] #DONE - - [0xF8E240, c, code_388E0] #DONE - - [0xF8E430, c, code_38AD0] #DONE - - [0xF8E8A0, c, code_38F40] #DONE - - [0xF8EAF0, c, code_39190] #DONE - - [0xF8F010, c, code_396B0] #DONE - - [0xF8F370, c, code_39A10] #DONE - - [0xF8F850, c, code_39EF0] #DONE - - [0xF90770, c, code_3AE10] #DONE + - [0xF8DAB0, c, nc/dynamicCam10] #DONE + - [0xF8DC40, c, nc/dynamicCamD] #DONE + - [0xF8DDC0, c, nc/dynamicCam5] #DONE + - [0xF8DF90, c, nc/dynamicCam11] #DONE + - [0xF8E240, c, nc/dynamicCam8] #DONE + - [0xF8E430, c, nc/dynamicCam4] #DONE + - [0xF8E8A0, c, nc/dynamicCamC] #DONE + - [0xF8EAF0, c, code_F8EAF0] #DONE + - [0xF8ED40, c, nc/dynamicCamB] #DONE + - [0xF8F010, c, nc/dynamicCam13] #DONE + - [0xF8F370, c, nc/dynamicCam9] #DONE + - [0xF8F850, c, nc/dynamicCam12] #DONE + - [0xF90280, c, nc/dynamicCam1] #DONE + - [0xF904A0, c, nc/dynamicCam3] #DONE + - [0xF90770, c, nc/dynamicCamA] #DONE - [0xF90C20, c, code_3B2C0] #DONE - - [0xF90F20, c, code_3B5C0] #DONE + - [0xF90E30, c, nc/dynamicCamF] #DONE + - [0xF90F20, c, nc/firstpersoncamera] #DONE - [0xF914E0, c, spawnqueue] #DONE - [0xF92D30, c, ch/gameSelect] #DONE - [0xF94430, c, code_3EAD0] #DONE @@ -899,7 +903,7 @@ segments: - [0x10320A0, .data, code_90E0] - [0x1032150, .data, ba/model] - [0x1032150, .data, code_B850] - - [0x1032170, .data, code_BB50] + - [0x1032170, .data, eggshatter] - [0x10321C0, .data, code_C0E0] - [0x10321F0, .data, code_E910] - [0x1032E10, .data, code_FD60] @@ -933,10 +937,10 @@ segments: - [0x1034160, .data, code_34310] - [0x10341B0, .data, code_34790] - [0x1034200, .data, code_35520] - - [0x10346A0, .data, code_356B0] + - [0x10346A0, .data, nc/dynamicCamera] - [0x1034730, .data, code_37E50] - - [0x1034760, .data, code_382E0] - - [0x1034770, .data, code_3AE10] + - [0x1034760, .data, nc/dynamicCamD] + - [0x1034770, .data, nc/dynamicCamA] - [0x1034790, .data, spawnqueue] - [0x10347A0, .data, ch/gameSelect] - [0x1034900, .data, code_3EAD0] @@ -1197,18 +1201,20 @@ segments: - [0x10446E0, .rodata, code_33F90] - [0x1044700, .rodata, code_34310] - [0x1044710, .rodata, code_34790] - - [0x1044740, .rodata, code_356B0] + - [0x1044740, .rodata, nc/dynamicCamera] - [0x1044890, .rodata, code_37E50] - - [0x10448B0, .rodata, code_38150] - - [0x10448C0, .rodata, code_382E0] - - [0x10448D0, .rodata, code_38460] - - [0x10448E0, .rodata, code_38AD0] - - [0x10448F0, .rodata, code_38F40] - - [0x1044900, .rodata, code_39190] - - [0x1044920, .rodata, code_396B0] - - [0x1044930, .rodata, code_39A10] - - [0x1044950, .rodata, code_39EF0] - - [0x1044990, .rodata, code_3AE10] + - [0x10448B0, .rodata, nc/dynamicCam10] + - [0x10448C0, .rodata, nc/dynamicCamD] + - [0x10448D0, .rodata, nc/dynamicCam5] + - [0x10448E0, .rodata, nc/dynamicCam4] + - [0x10448F0, .rodata, nc/dynamicCamC] + - [0x1044900, .rodata, code_F8EAF0] + - [0x1044910, .rodata, nc/dynamicCamB] + - [0x1044920, .rodata, nc/dynamicCam13] + - [0x1044930, .rodata, nc/dynamicCam9] + - [0x1044950, .rodata, nc/dynamicCam12] + - [0x1044980, .rodata, nc/dynamicCam3] + - [0x1044990, .rodata, nc/dynamicCamA] - [0x10449A0, .rodata, spawnqueue] - [0x10449F0, .rodata, ch/gameSelect] - [0x1044B70, .rodata, ch/bubble] @@ -1380,7 +1386,7 @@ segments: - [0x1048560, .bss, statetimer] - [0x1048560, .bss, ba/model] - [0x1048560, .bss, code_B650] - - [0x1048560, .bss, code_BB50] + - [0x1048560, .bss, eggshatter] - [0x1048560, .bss, code_BD20] - [0x1048560, .bss, code_C0E0] - [0x1048560, .bss, code_C3F0] @@ -1462,26 +1468,29 @@ segments: - [0x1048560, .bss, bs/washy] - [0x1048560, .bss, nc/cameranodelist] - [0x1048560, .bss, code_33C30] - - [0x1048560, .bss, code_33D40] + - [0x1048560, .bss, nc/staticCamera] - [0x1048560, .bss, code_34310] - [0x1048560, .bss, code_34790] - [0x1048560, .bss, code_35520] - - [0x1048560, .bss, code_356B0] + - [0x1048560, .bss, nc/dynamicCamera] - [0x1048560, .bss, code_379B0] - - [0x1048560, .bss, code_37CD0] + - [0x1048560, .bss, nc/randomCamera] - [0x1048560, .bss, code_37E50] - - [0x1048560, .bss, code_38150] - - [0x1048560, .bss, code_38460] - - [0x1048560, .bss, code_38630] - - [0x1048560, .bss, code_388E0] - - [0x1048560, .bss, code_38AD0] - - [0x1048560, .bss, code_38F40] - - [0x1048560, .bss, code_39190] - - [0x1048560, .bss, code_396B0] - - [0x1048560, .bss, code_39A10] - - [0x1048560, .bss, code_39EF0] + - [0x1048560, .bss, nc/dynamicCam10] + - [0x1048560, .bss, nc/dynamicCam5] + - [0x1048560, .bss, nc/dynamicCam11] + - [0x1048560, .bss, nc/dynamicCam8] + - [0x1048560, .bss, nc/dynamicCam4] + - [0x1048560, .bss, nc/dynamicCamC] + - [0x1048560, .bss, code_F8EAF0] + - [0x1048560, .bss, nc/dynamicCamB] + - [0x1048560, .bss, nc/dynamicCam13] + - [0x1048560, .bss, nc/dynamicCam9] + - [0x1048560, .bss, nc/dynamicCam12] + - [0x1048560, .bss, nc/dynamicCam3] - [0x1048560, .bss, code_3B2C0] - - [0x1048560, .bss, code_3B5C0] + - [0x1048560, .bss, nc/dynamicCamF] + - [0x1048560, .bss, nc/firstpersoncamera] - [0x1048560, .bss, ch/gameSelect] - [0x1048560, .bss, code_41460] - [0x1048560, .bss, code_41FB0] diff --git a/include/core2/nc/camera.h b/include/core2/nc/camera.h new file mode 100644 index 00000000..e6934dd4 --- /dev/null +++ b/include/core2/nc/camera.h @@ -0,0 +1,11 @@ +#ifndef __CORE2_NC_CAMERA_H__ +#define __CORE2_NC_CAMERA_H__ + +enum camera_type_e{ + CAMERA_TYPE_1_UNKNOWN = 1, + CAMERA_TYPE_2_DYNAMIC = 2, + CAMERA_TYPE_3_STATIC = 3, + CAMERA_TYPE_4_RANDOM = 4 +}; + +#endif \ No newline at end of file diff --git a/include/functions.h b/include/functions.h index 76faadd7..f5c57858 100644 --- a/include/functions.h +++ b/include/functions.h @@ -385,11 +385,11 @@ void func_802BD8A4(f32, f32, f32); f32 func_802BD8D4(void); void func_802BE244(f32, f32); void func_802BE230(f32, f32); -void func_802BF2C0(f32); +void ncDynamicCamD_func_802BF2C0(f32); f32 func_802B6F9C(void); void func_802C1B20(f32); -int func_802C1DB0(f32); +int ncDynamicCamA_func_802C1DB0(f32); void func_802D6264(f32, enum map_e, s32, s32, s32, enum file_progress_e); @@ -526,8 +526,8 @@ void func_8032AA58(Actor *, f32); void func_80324E38(f32, s32); void timed_playSfx(f32, enum sfx_e, f32, s32); f32 ml_distance_vec3f(f32 [3], f32 [3]); -void timed_setCameraToNode(f32, s32); -void func_80324E88(f32); +void timed_setStaticCameraToNode(f32, s32); +void timed_exitStaticCamera(f32); int actor_animationIsAt(Actor*, f32); void rumbleManager_80250E94(f32, f32, f32, f32, f32, f32); diff --git a/src/BGS/ch/code_2270.c b/src/BGS/ch/code_2270.c index b6566344..74627173 100644 --- a/src/BGS/ch/code_2270.c +++ b/src/BGS/ch/code_2270.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void BGS_func_803888E4(Actor *this, s32 arg1); typedef struct{ @@ -93,7 +93,7 @@ void func_80388784(ActorMarker *this, enum asset_e text_id, s32 arg2){ break; case 0xc7b: timedFunc_set_0(0.0f, BGS_func_8038868C); - func_80324E88(2.5f); + timed_exitStaticCamera(2.5f); func_80324E38(2.5f, 0); break; } @@ -159,7 +159,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ unqPtr->unk0 = 0; vector_clear(unqPtr->unk4); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.5f, 0); + timed_setStaticCameraToNode(0.5f, 0); tmpf = 0.5f; i = 0; prev_member = 0; @@ -172,7 +172,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ prev_member = rand2; }//L80388B7C - func_80324E88(tmpf += 2.5); + timed_exitStaticCamera(tmpf += 2.5); if(!unqPtr->unkA && !func_803203FC(2)){ func_80324DBC(tmpf + 0.5, 0xc73, 0xe, this->position, this->marker, func_80388784, 0); unqPtr->unkA = 1; @@ -189,7 +189,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ unqPtr->unk0 = 0; func_80324E38(0.0f, 3); - timed_setCameraToNode(0.5f, 0); + timed_setStaticCameraToNode(0.5f, 0); tmpf = 0.5f; for(j = 0; j < vector_size(unqPtr->unk4); j++){ s1 = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4,j); @@ -197,7 +197,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ timedFunc_set_2(tmpf, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), s1->unk0); timedFunc_set_2(tmpf + 0.1, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), 0); } - func_80324E88(tmpf += 2.5); + timed_exitStaticCamera(tmpf += 2.5); func_80324E38(tmpf + 0.6,0); vector_clear(unqPtr->unk4); this->state = 0x05; @@ -207,7 +207,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); } func_80324E38(0.5f, 3); - timed_setCameraToNode(1.5f, 1); + timed_setStaticCameraToNode(1.5f, 1); func_80324DBC(2.0f, D_8039085C[unqPtr->unkA++], 0xF, this->position, this->marker, func_80388784, 0); } } diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c index ed4cc378..ce907dc1 100644 --- a/src/BGS/ch/croctus.c +++ b/src/BGS/ch/croctus.c @@ -96,12 +96,12 @@ void func_80387E68(ActorMarker *caller, enum asset_e text_id, s32 arg2){ func_80326310(this); bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE; timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, reinterpret_cast(s32, bgs_D_803907B8[this->unkF4_8])); - timed_setCameraToNode(0.8f, 9); + timed_setStaticCameraToNode(0.8f, 9); func_80324DBC(3.4f, 0xC87, 0xE, NULL, NULL, func_80387E68, NULL); __spawnQueue_add_2((GenMethod_2) func_80387D18, reinterpret_cast(s32, this->marker), 0x46); } else{ - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_8028F918(0); } } diff --git a/src/BGS/ch/frogminigame.c b/src/BGS/ch/frogminigame.c index 5f2ae2c0..f42acb3b 100644 --- a/src/BGS/ch/frogminigame.c +++ b/src/BGS/ch/frogminigame.c @@ -6,7 +6,7 @@ void chfrogminigame_update(Actor *); void chFrogMinigame_setState(Actor * arg0, u32 next_state); void func_8025A58C(u32, u32); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); ActorInfo chFrogMinigame = {MARKER_C4_YELLOW_FLIBBIT_CTRL, ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, 0x00, @@ -97,9 +97,9 @@ void chFrogMinigame_setState(Actor * arg0, u32 next_state){ } if(next_state == 5){ func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0x27); + timed_setStaticCameraToNode(0.0f, 0x27); timedFunc_set_0(0.2f, __chFrogMinigame_spawnJiggy); - func_80324E88(3.0f); + timed_exitStaticCamera(3.0f); func_80324E38(3.0f, 0); next_state = 6; } diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index c8c3b935..cac039f9 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -4,7 +4,7 @@ #include "prop.h" -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32); @@ -72,7 +72,7 @@ s32 func_8038F570(s16 *arg0){ } void func_8038F5E4(ActorMarker *marker, enum asset_e text_id, s32 arg2){ - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); } void func_8038F610(Actor *this) { @@ -195,7 +195,7 @@ void func_8038F6A4(Actor *this) case 3: if (actor_animationIsAt(this, 0.1f) != 0) { - timed_setCameraToNode(0.0f, 0xD); + timed_setStaticCameraToNode(0.0f, 0xD); } if (actor_animationIsAt(this, 0.55f) != 0) { diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c index 4d150523..0259c0ac 100644 --- a/src/BGS/code_3420.c +++ b/src/BGS/code_3420.c @@ -111,7 +111,7 @@ void BGS_func_80389850(Actor *this, s32 arg1) { break; } } - func_802BAE6C(sp94, sp88); + ncStaticCamera_setPositionAndRotation(sp94, sp88); } void func_80389B48(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -146,7 +146,7 @@ void func_80389BF8(ActorMarker *marker, enum asset_e text_id, s32 arg2) { this = marker_getActor(marker); local = (ActorLocal_BGS_3420 *)&this->local; - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); local->unkC--; func_8038A068(this, 7); @@ -166,7 +166,7 @@ void BGS_func_80389CD8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ Actor *this; this = marker_getActor(marker); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); func_8038A068(this, 5); } @@ -190,7 +190,7 @@ void func_80389DF8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ Actor *this; this = marker_getActor(marker); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); func_8038A068(this, 1); } @@ -212,7 +212,7 @@ void func_80389EAC(ActorMarker *marker, enum asset_e text_id, s32 arg2){ this = marker_getActor(marker); local = (ActorLocal_BGS_3420 *)&this->local; - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); local->unkC = 3; func_8038A068(this, 1); diff --git a/src/BGS/code_9750.c b/src/BGS/code_9750.c index 9d92a6cd..e957e349 100644 --- a/src/BGS/code_9750.c +++ b/src/BGS/code_9750.c @@ -3,7 +3,7 @@ #include "variables.h" -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32); void func_8028E668(f32[3], f32, f32, f32); diff --git a/src/CC/code_13C0.c b/src/CC/code_13C0.c index 3c09037c..140e8941 100644 --- a/src/CC/code_13C0.c +++ b/src/CC/code_13C0.c @@ -149,7 +149,7 @@ void func_80387CC0(void){ if(getGameMode() == GAME_MODE_7_ATTRACT_DEMO) return; - func_8024C764(sp1C); + viewport_getRotation(sp1C); tmp_v0 = func_8023DB4C(0x7F); if(tmp_v0 >= 0x40){ tmp_v0 = 0x7F - tmp_v0; @@ -158,7 +158,7 @@ void func_80387CC0(void){ if(360.0f <= sp1C[2]){ sp1C[2] -= 360.0f; } - func_8024CE18(sp1C); + viewport_setRotation(sp1C); } diff --git a/src/CC/code_1B90.c b/src/CC/code_1B90.c index 05109eec..d5fcd5bf 100644 --- a/src/CC/code_1B90.c +++ b/src/CC/code_1B90.c @@ -86,10 +86,10 @@ void func_8038817C(void){ if(ml_timer_update(&D_80389F90.unk8, sp20)){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); func_80324E38(0.0f, 3); - timed_setCameraToNode(2.0f, 0); + timed_setStaticCameraToNode(2.0f, 0); timedJiggySpawn(2.1f, JIGGY_1C_CC_RINGS, D_80389BF0); func_80324E38(5.0f, 0); - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); tmp_v0 = func_8034C5AC(0x131); if(tmp_v0){ func_8034E78C(tmp_v0, 0x190, 12.0f); diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index 854023e7..6d6daf2a 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -8,7 +8,7 @@ extern BKCollisionTri *func_8028EF48(void); extern void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6); extern void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6); extern void func_8031CE28(s32, s32, f32); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); extern int func_802E805C(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, s32, s32); extern void func_80340200(s32, f32[3], s32, f32, s32, s32, BKVertexList *, s32); extern void func_802E9118(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, f32, s32, s32, s32); @@ -18,7 +18,7 @@ extern int func_80340020(s32, f32[3], s32, f32, s32, BKVertexList *, f32[3], f32 extern void func_8033A670(s32, s32, f32[3]); extern void func_8033A928(s32, s32, f32[3]); extern void func_8033A9A8(s32, s32, f32[3]); -extern void func_8024C5CC(f32[3]); +extern void viewport_getPosition(f32[3]); extern void ml_vec3f_normalize(f32[3]); extern void func_8033A45C(s32, s32); extern void func_8033A238(s32); @@ -115,16 +115,16 @@ void func_80388664(void) { void CC_func_8038868C(void) { func_80324E38(0, 3); - timed_setCameraToNode(0, 0); - timed_setCameraToNode(5.5f, 1); - timed_setCameraToNode(7.0f, 2); - timed_setCameraToNode(12.5f, 3); + timed_setStaticCameraToNode(0, 0); + timed_setStaticCameraToNode(5.5f, 1); + timed_setStaticCameraToNode(7.0f, 2); + timed_setStaticCameraToNode(12.5f, 3); timedFunc_set_0(13.0f, &func_80388664); - timed_setCameraToNode(16.0f, 1); + timed_setStaticCameraToNode(16.0f, 1); if (jiggyscore_isCollected(JIGGY_17_CC_CLANKER_RAISED) == 0) { func_80324DBC(18.0f, 0xD2C, 4, NULL, NULL, NULL, 0); } - func_80324E88(18.0f); + timed_exitStaticCamera(18.0f); func_80324E38(18.0f, 0); } @@ -146,7 +146,7 @@ void CC_func_80388760(Gfx **gfx, Mtx **mtx, Vtx **vtx){ if(D_80389FA0.unk21 == 0) return; - func_8024C5CC(sp98); + viewport_getPosition(sp98); if(sp98[0] < -2600.0f || 11600.0f < sp98[0]) return; diff --git a/src/CCW/code_160.c b/src/CCW/code_160.c index f8d2ec09..e8e8dc71 100644 --- a/src/CCW/code_160.c +++ b/src/CCW/code_160.c @@ -68,9 +68,9 @@ void func_803865F4(Actor *this, s32 next_state) { func_8025AABC(COMUSIC_4B_CCW_ZUBBA_FIGHT); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); func_80324E38(0.0f, 3); - timed_setCameraToNode(2.0f, 4); + timed_setStaticCameraToNode(2.0f, 4); timedFunc_set_1(2.0f, (GenMethod_1)CCW_func_80386550, (s32) this->marker); - func_80324E88(4.0f); + timed_exitStaticCamera(4.0f); func_80324E38(4.0f, 0); } } @@ -162,7 +162,7 @@ void func_8038687C(Actor *this) { if (local->unk0 != NULL) { other = marker_getActor(local->unk0); - func_8024C5CC(sp78); + viewport_getPosition(sp78); sp6C[0] = this->position[0] - sp78[0]; sp6C[1] = this->position[1] - sp78[1]; sp6C[2] = this->position[2] - sp78[2]; diff --git a/src/CCW/code_1B20.c b/src/CCW/code_1B20.c index ac1e374b..a5c35ca0 100644 --- a/src/CCW/code_1B20.c +++ b/src/CCW/code_1B20.c @@ -61,17 +61,17 @@ void func_80387F64(Actor *this, s32 next_state){ if (map_get() == MAP_43_CCW_SPRING) { func_80324E38(0.0f, 3); } - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); for( phi_f22 = 0.0f; phi_f22 <= 1.0f; phi_f22 += 0.1) { timed_playSfx(phi_f22 * 5.7, 0x2C, phi_f22 * 0.3 + 0.7, (s32) (32000.0f - phi_f22 * 5000.0f)); } if (local->unk0->unkA != 0) { - timed_setCameraToNode(6.0f, 1); + timed_setStaticCameraToNode(6.0f, 1); timedFunc_set_0(6.1f, func_80387F10); timedFunc_set_2(8.0f, func_80387F38, (s32) this->marker, 3); } else { if (map_get() == MAP_43_CCW_SPRING) { - func_80324E88(7.0f); + timed_exitStaticCamera(7.0f); func_80324E38(7.0f, 0); } timedFunc_set_2(7.0f, func_80387F38, (s32) this->marker, 3); diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c index 3bae5fcb..8a46fac3 100644 --- a/src/CCW/code_2270.c +++ b/src/CCW/code_2270.c @@ -55,7 +55,7 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f); func_80335A8C(local->unk4, 2); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, (map_get() == MAP_44_CCW_SUMMER) ? 1 : 2); + timed_setStaticCameraToNode(0.0f, (map_get() == MAP_44_CCW_SUMMER) ? 1 : 2); timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000); timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000); timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000); @@ -68,7 +68,7 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { if (next_state == 4) { func_80335924(this->unk148, ASSET_176_ANIM_GOBI_YAWN, 0.5f, 4.0f); func_80335A8C(this->unk148, 2); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); } if (next_state == 5) { @@ -76,14 +76,14 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { func_80311480((s32) local->unk0->unk6, 4, NULL, NULL, NULL, NULL); } func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.23f, 0.5f); - timed_setCameraToNode(0.0f, 3); + timed_setStaticCameraToNode(0.0f, 3); } if (next_state == 6) { func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.1f, 0.71f); func_80335A8C(this->unk148, 1); } if (next_state == 7) { - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); marker_despawn(this->marker); } diff --git a/src/CCW/code_3050.c b/src/CCW/code_3050.c index 4cb1ebfe..f71f4c0e 100644 --- a/src/CCW/code_3050.c +++ b/src/CCW/code_3050.c @@ -19,8 +19,8 @@ void func_80389440(Actor *this, s32 next_state) { func_80335924(this->unk148, 0x187, 0.0f, 2.0f); func_80335A8C(this->unk148, 2); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 2); - func_80324E88(8.0f); + timed_setStaticCameraToNode(0.0f, 2); + timed_exitStaticCamera(8.0f); func_80324E38(8.0f, 0); } this->state = next_state; diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index 8c973f46..5bdee665 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -103,7 +103,7 @@ f32 D_8038FDE0[3]; /* .code */ void func_80389700(ActorMarker *marker, enum asset_e text_id, s32 arg2) { - func_80324E88(0.5f); + timed_exitStaticCamera(0.5f); func_80324E38(0.5f, 0); } @@ -144,8 +144,8 @@ void func_803897B8(Actor *this, s32 next_state) { func_80335924(this->unk148, local->unk0->unkE, 0.2f, 8.0f); func_80335A8C(this->unk148, 2); func_80324E38(0.5f, 3); - timed_setCameraToNode(0.5f, local->unk0->unk24); - func_80324E88(16.5f); + timed_setStaticCameraToNode(0.5f, local->unk0->unk24); + timed_exitStaticCamera(16.5f); func_80324E38(16.5f, 0); local->unk8 = local->unk0->unk10; } @@ -261,7 +261,7 @@ void CCW_func_80389BFC(Actor *this) { ){ this->unk138_24 = TRUE; func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, local->unk0->unk24); + timed_setStaticCameraToNode(0.0f, local->unk0->unk24); func_80324DBC(0.0f, local->unk0->unk28, 6, NULL, this->marker, func_80389700, NULL); } local->unkC[0] = (s32) sp4C[0]; diff --git a/src/CCW/code_4530.c b/src/CCW/code_4530.c index 88abf1a2..61aace7e 100644 --- a/src/CCW/code_4530.c +++ b/src/CCW/code_4530.c @@ -50,7 +50,7 @@ void func_8038A950(Actor *this, s32 next_state) { func_80335924(this->unk148, 0x19A, 0.0f, 7.0f); func_80335A8C(this->unk148, 2); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); } if (next_state == 4) { mapSpecificFlags_set(5, 1); diff --git a/src/CCW/code_4960.c b/src/CCW/code_4960.c index 65e12705..e96e5e99 100644 --- a/src/CCW/code_4960.c +++ b/src/CCW/code_4960.c @@ -31,7 +31,7 @@ void func_8038AD50(Actor *this, s32 next_state) { func_80311480(0xCDD, 0, NULL, NULL, NULL, NULL); if (this->state == 1) { mapSpecificFlags_set(6, 0); - timed_setCameraToNode(0.0f, 1); + timed_setStaticCameraToNode(0.0f, 1); } func_80335924(this->unk148, 0x21D, 0.2f, 0.5f); func_80335A8C(this->unk148, 1); @@ -41,7 +41,7 @@ void func_8038AD50(Actor *this, s32 next_state) { func_80335A8C(this->unk148, 2); } if (next_state == 4) { - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); marker_despawn(this->marker); } diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 30ee1830..8d6c1d8f 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -48,7 +48,7 @@ void chnabnut_setState(Actor *this, s32 next_state) { func_80335924(this->unk148, ASSET_22D_ANIM_NABNUT_BACKFLIP, 0.2f, 3.13f); func_80335A8C(this->unk148, 2); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0xB); + timed_setStaticCameraToNode(0.0f, 0xB); func_80311480(0xCCC, 0x20, this->position, NULL, NULL, NULL); } @@ -65,7 +65,7 @@ void chnabnut_setState(Actor *this, s32 next_state) { if (next_state == NABNUT_STATE_6_DESPAWN) { func_80324E38(0.0f, 0); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); marker_despawn(this->marker); } diff --git a/src/CCW/code_7120.c b/src/CCW/code_7120.c index 181b73f7..3fa6743a 100644 --- a/src/CCW/code_7120.c +++ b/src/CCW/code_7120.c @@ -77,9 +77,9 @@ void func_8038D6D8(Actor *this, s32 next_state) { FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 15000); FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 15000); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.5f, 3); + timed_setStaticCameraToNode(0.5f, 3); timedFunc_set_2(0.5f, levelSpecificFlags_set, 0x25, TRUE); - func_80324E88(4.0f); + timed_exitStaticCamera(4.0f); func_80324E38(4.0f, 0); local->unk0 = 0.5f; marker_despawn(this->marker); diff --git a/src/FP/ch/boggy1.c b/src/FP/ch/boggy1.c index 9ce72f1c..cad9e803 100644 --- a/src/FP/ch/boggy1.c +++ b/src/FP/ch/boggy1.c @@ -141,7 +141,7 @@ void func_8038794C(Actor *this){ if(mapSpecificFlags_get(0x1)){ func_8028F94C(1, this->position); - timed_setCameraToNode(0.0f, 0x12); + timed_setStaticCameraToNode(0.0f, 0x12); func_80324DBC(1.0f, 0xc00, 0xe, NULL, this->marker, func_80387828, func_803877A8); func_803876A4(this); break; @@ -188,7 +188,7 @@ void func_8038794C(Actor *this){ if(0.99 <= this->unk48){ func_8028F918(0); func_80324CD8(0.0f); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_803876F8(this); } break; diff --git a/src/FP/ch/boggy2.c b/src/FP/ch/boggy2.c index b84077f3..c38260c4 100644 --- a/src/FP/ch/boggy2.c +++ b/src/FP/ch/boggy2.c @@ -116,7 +116,7 @@ void func_80388A50(Actor *this){ ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; func_80328B8C(this, 2, 0.0001f, 1); - timed_setCameraToNode(0.0f, 4); + timed_setStaticCameraToNode(0.0f, 4); local->unk18 = 0; } @@ -192,7 +192,7 @@ void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); switch(text_id){ case 0xc03: case 0xc06: diff --git a/src/FP/ch/scarfsled.c b/src/FP/ch/scarfsled.c index 23754bd7..2712a7e4 100644 --- a/src/FP/ch/scarfsled.c +++ b/src/FP/ch/scarfsled.c @@ -25,18 +25,18 @@ void __chScarfSled_setState(Actor *this, s32 next_state){ if(next_state == 2){ mapSpecificFlags_set(0xB, TRUE); - timed_setCameraToNode(0.0f, 0x27); + timed_setStaticCameraToNode(0.0f, 0x27); timed_playSfx(0.6f, SFX_52_BANJO_YAH_OH, 1.0f, 28000); timed_playSfx(1.25f, SFX_31_BANJO_OHHWAAOOO, 1.0f, 28000); - timed_setCameraToNode(1.5f, 0x26); - timed_setCameraToNode(2.75f, 0x25); + timed_setStaticCameraToNode(1.5f, 0x26); + timed_setStaticCameraToNode(2.75f, 0x25); timed_playSfx(3.5f, SFX_63_BANJO_UWAAAAOOH, 1.0f, 28000); - timed_setCameraToNode(3.75f, 0x24); + timed_setStaticCameraToNode(3.75f, 0x24); timed_playSfx(4.25f, SFX_A7_WOODEN_SWOSH, 1.2f, 18000); timed_playSfx(4.45f, SFX_C1_BUZZBOMB_ATTACK, 1.0f, 0x7fff); - timed_setCameraToNode(4.75f, 0x23); + timed_setStaticCameraToNode(4.75f, 0x23); } } diff --git a/src/FP/ch/twinklybox.c b/src/FP/ch/twinklybox.c index f37fce55..83d168cd 100644 --- a/src/FP/ch/twinklybox.c +++ b/src/FP/ch/twinklybox.c @@ -244,7 +244,7 @@ void func_8038D51C(ActorMarker *marker){ FUNC_8030E624(SFX_416, 0.8f, 32000); func_8028F8F8(7, 0); this->unk1C[1] = 1.0f; - func_80324E88(1.7f); + timed_exitStaticCamera(1.7f); func_80324E38(1.7f, 0); timedFunc_set_1(2.3f, (GenMethod_1)func_8038D294, (s32)this->marker); this->velocity[1] = 1.0f; @@ -257,7 +257,7 @@ void func_8038D5C8(ActorMarker *this_marker, ActorMarker *other_marker){ if(this->state == 1 || this->state == 2){ actor_collisionOff(this); - timed_setCameraToNode(0.0f, 0xa); + timed_setStaticCameraToNode(0.0f, 0xa); func_80324CD8(0.1f); func_8028F784(1); func_8028F490(D_8039237C); @@ -360,7 +360,7 @@ void func_8038D6C8(Actor *this){ if(this->velocity[0] != 0.0f) break; - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_8028F784(0); func_80328B8C(this, 4, 0.999f, 1); actor_playAnimationOnce(this); @@ -386,7 +386,7 @@ void func_8038D6C8(Actor *this){ func_8038D3D8(); func_80324E38(0.0f, 3); timedFunc_set_1(1.3f, (GenMethod_1)func_8038D51C, (s32)this->marker); - timed_setCameraToNode(0.9f, 0xC); + timed_setStaticCameraToNode(0.9f, 0xC); item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); func_80347A14(1); break; diff --git a/src/FP/ch/twinklymuncher.c b/src/FP/ch/twinklymuncher.c index 7d444e92..9d07d783 100644 --- a/src/FP/ch/twinklymuncher.c +++ b/src/FP/ch/twinklymuncher.c @@ -92,7 +92,7 @@ Actor *func_8038DF34(Actor *this){ void func_8038E040(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); - func_80324E88(0.5f); + timed_exitStaticCamera(0.5f); func_80328B8C(this, 7, 0.03f, 1); actor_playAnimationOnce(this); } @@ -126,7 +126,7 @@ void func_8038E094(Actor *this){ if(sp38->unk1C[1] == 1.0f){ if(this->unkF4_8 == 1 && !fileProgressFlag_get(FILEPROG_13)){ if(this->state != 6 && this->state != 7 && 0.0f == this->velocity[0]){ - timed_setCameraToNode(0.5f, 0xd); + timed_setStaticCameraToNode(0.5f, 0xd); func_80311480(ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST, 0x2b, this->position, this->marker, func_8038E040, NULL); this->velocity[0] = 1.0f; func_80328B8C(this, 6, 0.03f, 1); diff --git a/src/FP/ch/wozza.c b/src/FP/ch/wozza.c index 135a231c..2ba78c5e 100644 --- a/src/FP/ch/wozza.c +++ b/src/FP/ch/wozza.c @@ -70,11 +70,11 @@ void func_8038F330(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); switch(text_id){ case 0xC1B: - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); break; case 0xC1C: - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_8038F2F0(this); break; } @@ -105,7 +105,7 @@ void func_8038F454(Actor *this){ mapSpecificFlags_set(7, TRUE); func_80328A84(this, 2); actor_loopAnimation(this); - timed_setCameraToNode(0.0f, 0x2e); + timed_setStaticCameraToNode(0.0f, 0x2e); func_80324DBC(0.0f, 0xc1b, 0x2a, this->position, this->marker, func_8038F330, NULL); timedFunc_set_1(2.5f, (GenMethod_1)func_8038F3F4, (s32)this->marker); } @@ -301,7 +301,7 @@ void FP_func_8038F7AC(Actor *this){ if(func_80329530(this, 500) && !this->unk138_24){ if(func_80311480(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ - timed_setCameraToNode(0.0f, 0x2E); + timed_setStaticCameraToNode(0.0f, 0x2E); this->unk138_24 = TRUE; } break; diff --git a/src/FP/ch/xmastreeice.c b/src/FP/ch/xmastreeice.c index 9ddd8edb..21e70ba8 100644 --- a/src/FP/ch/xmastreeice.c +++ b/src/FP/ch/xmastreeice.c @@ -78,7 +78,7 @@ void func_80390B2C(ActorMarker *marker){ void func_80390B70(Actor *this){ func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); timedFunc_set_1(0.6f, (GenMethod_1)func_80390ABC, reinterpret_cast(s32, this->marker)); timedFunc_set_1(2.5f, (GenMethod_1)func_80390B2C, reinterpret_cast(s32, this->marker)); } diff --git a/src/FP/racectrl.c b/src/FP/racectrl.c index 319251c6..aaff1e4b 100644 --- a/src/FP/racectrl.c +++ b/src/FP/racectrl.c @@ -215,18 +215,18 @@ void func_8038B1C4(void){ } void func_8038B1D0(enum jiggy_e jiggy_id){ - timed_setCameraToNode(0.0f, 3); + timed_setStaticCameraToNode(0.0f, 3); timedFunc_set_0(0.0f, func_8038AEA0); timedFunc_set_0(0.0f, FP_func_8038B0B8); timedFunc_set_1(0.1f, (GenMethod_1) func_8038B130, jiggy_id); timedFunc_set_0(5.0f, func_8038B190); timedFunc_set_0(5.0f, func_8038B1C4); - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); } void func_8038B268(void){ - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); timedFunc_set_0(0.0f, func_8038AEA0); timedFunc_set_0(0.0f, FP_func_8038B0B8); func_8028FA14(map_get(), 0x11); @@ -273,7 +273,7 @@ void func_8038B39C(void){ func_8025A6EC(COMUSIC_3B_MINIGAME_VICTORY, 28000); FP_func_8038AB60(0); func_8038ABDC(); - timed_setCameraToNode(0.0f, 1); + timed_setStaticCameraToNode(0.0f, 1); } void func_8038B410(void){ @@ -288,12 +288,12 @@ void func_8038B410(void){ FP_func_8038AB60(0); func_8038ABDC(); if(!jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ - timed_setCameraToNode(0.0f, 1); + timed_setStaticCameraToNode(0.0f, 1); timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000); func_80324DBC(2.0f, 0xC04, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL); }//L8038B4E0 else{ - timed_setCameraToNode(0.0f, 1); + timed_setStaticCameraToNode(0.0f, 1); timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000); func_80324DBC(2.0f, 0xC0b, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL); diff --git a/src/GV/ch/gobi1.c b/src/GV/ch/gobi1.c index 46ebdc22..26ee5d20 100644 --- a/src/GV/ch/gobi1.c +++ b/src/GV/ch/gobi1.c @@ -154,7 +154,7 @@ void chGobi1_update(Actor *this){ if(ml_timer_update(&local->unk14, tick)){ local->unk10 = 0.75f; local->unk8 = 7.5f; - timed_setCameraToNode(0.5f, 0xa); + timed_setStaticCameraToNode(0.5f, 0xa); timed_playSfx(1.0f, SFX_84_GOBI_CRYING, 1.1f, 30000); timed_playSfx(2.0f, SFX_84_GOBI_CRYING, 1.3f, 30000); timed_playSfx(2.5f, SFX_74_WALKING_NOISE_5, 0.5f, 30000); @@ -162,7 +162,7 @@ void chGobi1_update(Actor *this){ timed_playSfx(5.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); timed_playSfx(5.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); timed_playSfx(6.5f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); - func_80324E88(7.6f); + timed_exitStaticCamera(7.6f); } if(this->state == 1 || this->state == 2){ diff --git a/src/GV/ch/gobi2.c b/src/GV/ch/gobi2.c index bb7355f2..3189ded3 100644 --- a/src/GV/ch/gobi2.c +++ b/src/GV/ch/gobi2.c @@ -48,14 +48,14 @@ void GV_func_80387A00(ActorMarker *this_marker){ } void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ - timed_setCameraToNode(0.0f, 0xC); + timed_setStaticCameraToNode(0.0f, 0xC); timedFunc_set_1(0.5f, (GenMethod_1) func_80387984, reinterpret_cast(s32, caller)); timed_playSfx(0.5f, SFX_2C_PULLING_NOISE, 0.9f, 32000); timed_playSfx(1.8f, SFX_2C_PULLING_NOISE, 1.0f, 32000); timed_playSfx(2.5f, SFX_2C_PULLING_NOISE, 1.1f, 32000); - timed_setCameraToNode(3.0f, 0xd); + timed_setStaticCameraToNode(3.0f, 0xd); timedFunc_set_0(3.5f, __chGobi2_spawnJIggy); - func_80324E88(6.0f); + timed_exitStaticCamera(6.0f); timedFunc_set_1(6.0f, (GenMethod_1) GV_func_80387A00, reinterpret_cast(s32, caller)); func_80324E38(6.0f, 0); } @@ -81,7 +81,7 @@ void chGobi2_setState(Actor *this, s32 next_state){ timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000); func_80324E38(0.051f, 1); timedFunc_set_1(0.06f, (GenMethod_1)func_803879D4, reinterpret_cast(s32, this->marker)); - timed_setCameraToNode(0.86f, 0xb); + timed_setStaticCameraToNode(0.86f, 0xb); timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000); timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000); timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000); diff --git a/src/GV/ch/gobi3.c b/src/GV/ch/gobi3.c index ea8b9680..19b5e06e 100644 --- a/src/GV/ch/gobi3.c +++ b/src/GV/ch/gobi3.c @@ -44,7 +44,7 @@ void __chGobi3_runaway(ActorMarker *caller, enum asset_e text_id, s32 arg2){ timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000); timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000); - func_80324E88(3.0f); + timed_exitStaticCamera(3.0f); func_80324E38(3.0f, 0); } @@ -64,7 +64,7 @@ void chGobi3_setState(Actor *this, s32 next_state){ if(next_state == 3){ func_80324E38(0.0f, 3); timedFunc_set_1(0.02f, (GenMethod_1)__chGobi3_func_80388270, (s32)this); - timed_setCameraToNode(0.1f, 0x12); + timed_setStaticCameraToNode(0.1f, 0x12); timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000); timedFunc_set_1(0.2f, (GenMethod_1)__chGobi3_spawnHoneyComb, (s32)this); func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f); diff --git a/src/GV/ch/mazectrl.c b/src/GV/ch/mazectrl.c index 71f91de3..4133d80e 100644 --- a/src/GV/ch/mazectrl.c +++ b/src/GV/ch/mazectrl.c @@ -74,10 +74,10 @@ void __chMazeCtrl_setState(Actor *this, s32 next_state){ FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 25000); if(1500.0f < plyr_pos[0]){ func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 8); + timed_setStaticCameraToNode(0.0f, 8); timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000); func_80324CD8(1.2f); - func_80324E88(1.2f); + timed_exitStaticCamera(1.2f); func_80324E38(1.2f, 0); } else{//L8038F754 diff --git a/src/GV/code_6370.c b/src/GV/code_6370.c index 7f682405..fd22ede0 100644 --- a/src/GV/code_6370.c +++ b/src/GV/code_6370.c @@ -47,17 +47,17 @@ void func_8038C760(Actor *this, s32 arg1){ FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000); FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); - timed_setCameraToNode(0.0f, 8); + timed_setStaticCameraToNode(0.0f, 8); if(arg1 < 3){ - timed_setCameraToNode(3.5f, arg1 + 0x15); + timed_setStaticCameraToNode(3.5f, arg1 + 0x15); timedFunc_set_3(3.5f, (GenMethod_3)fileProgressFlag_setN, FILEPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); - func_80324E88(6.5f); + timed_exitStaticCamera(6.5f); func_80324E38(6.5f, 0); } else{ timedFunc_set_2(3.5f, (GenMethod_2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); timedFunc_set_3(3.5f, (GenMethod_3)fileProgressFlag_setN, FILEPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); - func_80324E88(6.0f); + timed_exitStaticCamera(6.0f); func_80324E38(6.0f, 0); } } diff --git a/src/GV/code_9C10.c b/src/GV/code_9C10.c index fd680354..5afb2d1d 100644 --- a/src/GV/code_9C10.c +++ b/src/GV/code_9C10.c @@ -12,9 +12,9 @@ void func_80390000(s32 arg0){ GV_D_80391AD0 = arg0; if(GV_D_80391AD0 == 1){ - set_camera_to_node(0x14); + ncStaticCamera_setToNode(0x14); func_80324E38(0.0f, 3); - timed_setCameraToNode(4.0f, 0x15); + timed_setStaticCameraToNode(4.0f, 0x15); func_80324E38(8.0f, 0); tmp_v0 = func_8034C5AC(0x130); diff --git a/src/GV/matchinggame.c b/src/GV/matchinggame.c index 0d9450f4..8fb1cf3b 100644 --- a/src/GV/matchinggame.c +++ b/src/GV/matchinggame.c @@ -99,9 +99,9 @@ void __matchingGame_setState(s32 next_state){ func_8035D490(matchingGame.mummy_marker); } func_80324E38(0.5f, 3); - timed_setCameraToNode(1.5f, 2); + timed_setStaticCameraToNode(1.5f, 2); timedFunc_set_0(1.7f, __matchingGame_spawnJIggy); - func_80324E88(4.0f); + timed_exitStaticCamera(4.0f); func_80324E38(4.0f, 0); } diff --git a/src/GV/waterctrl.c b/src/GV/waterctrl.c index 6672d31b..02a91bad 100644 --- a/src/GV/waterctrl.c +++ b/src/GV/waterctrl.c @@ -23,9 +23,9 @@ void __waterCtrl_setState(s32 arg0){ GV_D_80391B00.state = arg0; if(GV_D_80391B00.state == 2){ func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); timedFunc_set_0(3.0f, func_80390880); - timed_setCameraToNode(3.0f, 1); + timed_setStaticCameraToNode(3.0f, 1); func_80324E38(6.0f, 0); tmp_v0 = func_8034C528(400); if(tmp_v0){ diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index f2172baa..c2517d94 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -19,7 +19,7 @@ void func_80328FB0(Actor *, f32); void func_80328B8C(Actor*, s32, f32, s32); void func_802C8F70(f32); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); Actor *func_8032811C(s32 actor_id, s32 position[3], s32 yaw); void MM_func_80387F44(void); @@ -129,7 +129,7 @@ void func_80387168(ActorMarker *marker, ActorMarker *other_marker){ && !jiggyscore_isCollected(JIGGY_A_MM_CONGA) ){ func_80328B8C(actorPtr, 8, 0 ,1); - timed_setCameraToNode(0.0f, 0x10); + timed_setStaticCameraToNode(0.0f, 0x10); func_80324E38(0.0f, 3); FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750); FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750); @@ -160,8 +160,8 @@ int func_803872EC(void){ void func_80387370(ActorMarker *this, enum asset_e text_id, s32 arg2){ marker_getActor(this)->velocity_x = 9.0f; - timed_setCameraToNode(0.0f, 0x11); - func_80324E88(3.2f); + timed_setStaticCameraToNode(0.0f, 0x11); + timed_exitStaticCamera(3.2f); func_80324E38(3.2f, 0); } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index 28c91d10..eec70d05 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -5,9 +5,9 @@ void func_8028E668(f32 *, f32, f32, f32); int actor_animationIsAt(Actor *, f32); void func_80328B8C(Actor *, s32, f32, s32); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void func_80324E38(f32,s32); -void timed_setCameraToNode(f32, s32); +void timed_setStaticCameraToNode(f32, s32); s32 func_8028F31C(f32 *, f32, s32, Actor **); void func_8028FA34(s32, Actor *); @@ -38,7 +38,7 @@ void func_80388300(Actor **arg0){ ){ func_8028FA34(0xc6, *arg0); (*arg0)->unk138_24 = 1; - timed_setCameraToNode(1.2f, 0xF); + timed_setStaticCameraToNode(1.2f, 0xF); func_80324E38(1.2f, 3); } if(arg0); @@ -71,9 +71,9 @@ void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2){ Actor * actor = marker_getActor(marker); mapSpecificFlags_set(4,1); func_80328A84(actor, 3); - timed_setCameraToNode(2.3f, 0x12); + timed_setStaticCameraToNode(2.3f, 0x12); timedFunc_set_3(2.9f,__chLMonkey_spawnJiggy, actor->position_x, actor->position_y + 150.0f, actor->position_z); - func_80324E88(4.3f); + timed_exitStaticCamera(4.3f); func_80324E38(4.3f, 0); } diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index 47bdd698..91ee5530 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -153,7 +153,7 @@ void chnapper_update(Actor *this){ }//L80386DF4 if(this->state != 4){ - func_8024C5CC(sp58); + viewport_getPosition(sp58); sp4C[0] = this->position_x - sp58[0]; sp4C[1] = this->position_y - sp58[1]; sp4C[2] = this->position_z - sp58[2]; diff --git a/src/MMM/code_3120.c b/src/MMM/code_3120.c index 695bc678..b3d0f8b1 100644 --- a/src/MMM/code_3120.c +++ b/src/MMM/code_3120.c @@ -56,12 +56,12 @@ void func_803895B0(s32 arg0) { void func_803895D8(ActorMarker *caller, enum asset_e text_id, s32 arg2) { if (text_id == 0xAD7) { timed_playSfx(0.1f, SFX_3F5_UNKNOWN, 1.0f, 30000); - func_80324E88(1.5f); + timed_exitStaticCamera(1.5f); func_80324E38(1.5f, 0); return; } MMM_D_8038C4E0.unk0 = 1; - func_80324E88(1.5f); + timed_exitStaticCamera(1.5f); func_80324E38(1.5f, 0); } @@ -80,7 +80,7 @@ void func_8038966C(void){ ){ MMM_D_8038C4E0.unk2 = TRUE; func_80324E38(0.0f, 3); - timed_setCameraToNode(0.2f, 1); + timed_setStaticCameraToNode(0.2f, 1); func_80324DBC(0.2f, 0xad9, 6, NULL, NULL, func_803895D8, NULL); }//L80389700 @@ -106,7 +106,7 @@ void func_8038966C(void){ MMM_D_8038C4E0.unk1 = 2; if(!levelSpecificFlags_get(0x1b)){ func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); func_80324DBC(0.0f, 0xad7, 6, NULL, NULL, func_803895D8, NULL); levelSpecificFlags_set(0x1b, TRUE); } diff --git a/src/MMM/code_3420.c b/src/MMM/code_3420.c index 796f105f..04d9ddae 100644 --- a/src/MMM/code_3420.c +++ b/src/MMM/code_3420.c @@ -177,10 +177,10 @@ void func_803898EC() { void func_80389910() { func_80311480(0xAD5, 0xE, NULL, NULL, MMM_func_80389810, NULL); timedFunc_set_2(0.0f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); - timed_setCameraToNode(2.0f, 0); + timed_setStaticCameraToNode(2.0f, 0); timedFunc_set_0(2.1f, MMM_func_803898A0); timedFunc_set_0(6.0f, func_803898EC); - func_80324E88(6.0f); + timed_exitStaticCamera(6.0f); func_80324E38(6.0f, 0); } diff --git a/src/MMM/code_3D50.c b/src/MMM/code_3D50.c index 80d5266d..c1b327ed 100644 --- a/src/MMM/code_3D50.c +++ b/src/MMM/code_3D50.c @@ -71,10 +71,10 @@ struct { void func_8038A140(UNK_TYPE(s32) arg0) { if (arg0 == 2) { func_80324E38(0.3f, 3); - timed_setCameraToNode(0.3f, 1); + timed_setStaticCameraToNode(0.3f, 1); timedFunc_set_2(0.3f, mapSpecificFlags_set, 3, 1); func_80324E38(3.0f, 0); - func_80324E88(3.0f); + timed_exitStaticCamera(3.0f); timedFunc_set_1(3.0f, func_8038A140, 3); } if (arg0 == 3) { diff --git a/src/MMM/code_47D0.c b/src/MMM/code_47D0.c index b5a9c6ba..72bd0b34 100644 --- a/src/MMM/code_47D0.c +++ b/src/MMM/code_47D0.c @@ -128,7 +128,7 @@ void func_8038AF90(Struct_MMM_47D0_0 *arg0, Struct68s *arg1, f32 arg2) { func_8028F66C(BS_INTR_D_SURF); } if (sp3C && ((sp40[0] != 0.0f) || (sp40[1] != 0.0f))) { - func_8024C764(sp70); + viewport_getRotation(sp70); sp64[0] = sp40[0]; sp64[1] = 0.0f; sp64[2] = -sp40[1]; @@ -147,7 +147,7 @@ void func_8038AF90(Struct_MMM_47D0_0 *arg0, Struct68s *arg1, f32 arg2) { func_80351B28(arg1, sp54); func_8035179C(arg1, sp54); if (arg0->unk0 != NULL) { - func_8024C5CC(sp7C); + viewport_getPosition(sp7C); sp64[0] = sp54[0] - sp7C[0]; sp64[2] = sp54[2] - sp7C[2]; sp64[1] = 0.0f; diff --git a/src/RBB/ch/anchorctrl.c b/src/RBB/ch/anchorctrl.c index 621b50ff..603878bf 100644 --- a/src/RBB/ch/anchorctrl.c +++ b/src/RBB/ch/anchorctrl.c @@ -32,13 +32,13 @@ void __chAnchorCtrl_spawnJiggy(ActorMarker *marker, s32 arg1, s32 arg2){ Actor *actor = marker_getActor(marker); jiggySpawn(JIGGY_53_RBB_SNORKEL, &D_80390B34); - timed_setCameraToNode(0.5f, 0xb); + timed_setStaticCameraToNode(0.5f, 0xb); __chAnchorCtrl_setState(actor, 3); } void __chAnchorCtrl_setState(Actor *this, s32 new_state){ if(new_state == 2){ - set_camera_to_node(0xC); + ncStaticCamera_setToNode(0xC); func_80324E38(0.0f, 3); timedFunc_set_0(1.0f, func_8038C000); timedFunc_set_2(1.0f, (GenMethod_2)mapSpecificFlags_set, 8, TRUE); @@ -63,7 +63,7 @@ void chAnchorCtrl_update(Actor *this){ }//L8038C27C if(this->state == 3 && !mapSpecificFlags_get(4)){ - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); timedFunc_set_0(0.0f, func_803228D8); timedFunc_set_3(0.0f, (GenMethod_3)func_802E4078, MAP_8B_RBB_ANCHOR_ROOM, 2, 0); diff --git a/src/RBB/ch/bossboombox.c b/src/RBB/ch/bossboombox.c index ed3228bc..784926d6 100644 --- a/src/RBB/ch/bossboombox.c +++ b/src/RBB/ch/bossboombox.c @@ -227,7 +227,7 @@ void func_8038CB34(ActorMarker *marker, s32 arg1, s32 arg2){ void func_8038CB68(ActorMarker *marker, s32 arg1, s32 arg2){ Actor *actor = marker_getActor(marker); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); timedFunc_set_2(0.0f, (GenMethod_2)RBB_func_8038C370, actor->marker, 3); } @@ -309,7 +309,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ func_80335924(this->unk148, ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR, 0.0f, 2.4f); func_80335A8C(this->unk148, 2); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 0); + timed_setStaticCameraToNode(0.0f, 0); timed_playSfx(0.5f, SFX_3F5_UNKNOWN, 1.0f, 0x7fc6); timed_playSfx(1.25f, SFX_6C_LOCKUP_CLOSING, 1.05f, 0x7d00); timed_playSfx(1.35f, SFX_6C_LOCKUP_CLOSING, 1.0f, 0x7d00); @@ -317,7 +317,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ if(func_803203FC(2)){ item_set(ITEM_6_HOURGLASS, 1); item_set(ITEM_0_HOURGLASS_TIMER, 0x1067); - func_80324E88(2.4f); + timed_exitStaticCamera(2.4f); func_80324E38(2.4f, 0); timedFunc_set_2(2.4f, (GenMethod_2)RBB_func_8038C370, (s32)this->marker, 3); } diff --git a/src/RBB/ch/eggtoll1.c b/src/RBB/ch/eggtoll1.c index 85095a8a..ae2552b6 100644 --- a/src/RBB/ch/eggtoll1.c +++ b/src/RBB/ch/eggtoll1.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern void func_80324E88(f32); +extern void timed_exitStaticCamera(f32); /* typedefs and declarations */ typedef struct { @@ -93,9 +93,9 @@ void func_803865D0(ActorMarker *marker){ Actor* actor = marker_getActor(marker); ActorLocal_RBB_0 * local = (ActorLocal_RBB_0 *) &actor->local; RBB_func_803863F0(actor, 1); - timed_setCameraToNode(0.0f, D_80390074[local->unk4].unk0); + timed_setStaticCameraToNode(0.0f, D_80390074[local->unk4].unk0); timedFunc_set_2(0.75*D_80390074[local->unk4].unk4, (GenMethod_2) func_803865A4, actor->marker, 4); - func_80324E88(0.75*D_80390074[local->unk4].unk4); + timed_exitStaticCamera(0.75*D_80390074[local->unk4].unk4); func_80324E38(0.75*D_80390074[local->unk4].unk4, 0); timed_playSfx(D_80390074[local->unk4].unk4, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x7fd0); } diff --git a/src/RBB/ch/enginefanswitch.c b/src/RBB/ch/enginefanswitch.c index 14601381..6110f4db 100644 --- a/src/RBB/ch/enginefanswitch.c +++ b/src/RBB/ch/enginefanswitch.c @@ -22,9 +22,9 @@ void chEngineFanSwitch_setState(Actor * this, s32 arg1){ func_8030E6D4(SFX_90_SWITCH_PRESS); this->position_y -= 35.0f; func_80324E38(1.0f, 3); - timed_setCameraToNode(1.0f, 0); + timed_setStaticCameraToNode(1.0f, 0); timedFunc_set_0(1.0f, RBB_func_803898A0); - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); func_80324E38(5.0f, 0); } } diff --git a/src/RBB/ch/propellor.c b/src/RBB/ch/propellor.c index f833c3e6..313bc667 100644 --- a/src/RBB/ch/propellor.c +++ b/src/RBB/ch/propellor.c @@ -91,10 +91,10 @@ void chPropellor_update(Actor *this){ local->unkC = 0.0f; __chPropellor_setState(this, 1); if(levelSpecificFlags_get(local->unk8 ? 4 : 3)){ - set_camera_to_node(9); + ncStaticCamera_setToNode(9); func_80324E38(0.0f, 3); timedFunc_set_2(0.1f, (GenMethod_2)levelSpecificFlags_set, local->unk8 ? 0x28 : 0x27, 1); - func_80324E88(4.5f); + timed_exitStaticCamera(4.5f); func_80324E38(4.5f, 0); timedFunc_set_2(4.5f, (GenMethod_2)levelSpecificFlags_set, local->unk8 ? 0x4 : 0x3, 0); timedFunc_set_3(4.5f, (GenMethod_3)func_802E4078, MAP_34_RBB_ENGINE_ROOM, !local->unk8 ? 3 : 2, 0); diff --git a/src/RBB/ch/whistlectrl.c b/src/RBB/ch/whistlectrl.c index d2bacaa7..97737055 100644 --- a/src/RBB/ch/whistlectrl.c +++ b/src/RBB/ch/whistlectrl.c @@ -43,9 +43,9 @@ void __chWhistleCtrl_wrong(ActorMarker *marker){ void __chWhistleCtrl_complete(void){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); func_80324E38(1.0f, 3); - timed_setCameraToNode(2.0f, 10); + timed_setStaticCameraToNode(2.0f, 10); timedFunc_set_0(2.2f, __chWhistleCtrl_soundWhistle); - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); func_80324E38(5.0f, 0); } diff --git a/src/RBB/code_1570.c b/src/RBB/code_1570.c index e6af72d9..e71f1867 100644 --- a/src/RBB/code_1570.c +++ b/src/RBB/code_1570.c @@ -186,7 +186,7 @@ void func_80387F88(ActorMarker *marker){ timed_playSfx(1.0f, SFX_1A_BIG_THINGS_FALL_OVER, 1.0f, 22000); timed_playSfx(2.0f, SFX_1A_BIG_THINGS_FALL_OVER, 0.8f, 22000); timed_playSfx(3.0f, SFX_1A_BIG_THINGS_FALL_OVER, 0.6f, 22000); - func_80324E88(4.0f); + timed_exitStaticCamera(4.0f); func_80324E38(4.0f, 0); timedFunc_set_2(4.0f, (GenMethod_2) RBB_func_80387F18, (s32) actor->marker, 3); } @@ -197,7 +197,7 @@ void func_80388154(ActorMarker *marker){ timedFunc_set_0(0.0f, (GenMethod_0) RBB_func_80387F44); timed_playSfx(0.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x7fc6); timedFunc_set_2(1.2f, (GenMethod_2) func_80387B8C, 0x19f, 0); - timed_setCameraToNode(1.2f, 8); + timed_setStaticCameraToNode(1.2f, 8); timedFunc_set_1(1.5f, (GenMethod_1) func_80387F88, (s32) actor->marker); } @@ -208,7 +208,7 @@ void func_803881E8(Actor *this, s32 arg1){ timedFunc_set_2(0.05f, (GenMethod_2)func_80387BEC, 0x19f, 0x1f4); timedFunc_set_2(0.1f, (GenMethod_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); func_80324E38(0.2f, 3); - timed_setCameraToNode(1.1f, 7); + timed_setStaticCameraToNode(1.1f, 7); timedFunc_set_1(1.6f, (GenMethod_1)func_80388154, (s32)this->marker); levelSpecificFlags_set(0x2D, 1); } diff --git a/src/RBB/code_640.c b/src/RBB/code_640.c index a98902c0..3df80c2a 100644 --- a/src/RBB/code_640.c +++ b/src/RBB/code_640.c @@ -139,7 +139,7 @@ void func_80386A7C(Actor *this){ func_802D3D74(this); this->depth_mode = 1; - func_8024C5CC(&sp2C); + viewport_getPosition(&sp2C); sp28 = func_80386A30(&this->position); temp_v0 = func_80386A30(&sp2C); this->unk38_0 = 0; diff --git a/src/RBB/code_9670.c b/src/RBB/code_9670.c index 55f0ea22..b95943a4 100644 --- a/src/RBB/code_9670.c +++ b/src/RBB/code_9670.c @@ -27,9 +27,9 @@ void func_8038FA9C(Actor *this, s32 arg1){ if(arg1 == 3){ func_80324E38(0.0f, 3); timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); - timed_setCameraToNode(1.8f, 1); + timed_setStaticCameraToNode(1.8f, 1); timedFunc_set_1(2.0f, (GenMethod_1) RBB_func_8038FA60, (s32)this->marker); - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); func_80324E38(5.0f, 0); } this->state = arg1; diff --git a/src/RBB/code_CA0.c b/src/RBB/code_CA0.c index e9c7a2ec..5260af4e 100644 --- a/src/RBB/code_CA0.c +++ b/src/RBB/code_CA0.c @@ -54,15 +54,15 @@ void func_8038718C(ActorMarker *marker){ func_8034DDF0(sp44, &sp38, &sp2C, 4.0f, 1); func_8034E1A4(sp44, SFX_D8_CRANE, 1.0f, 1.0f); } - timed_setCameraToNode(0.0f, 4); - timed_setCameraToNode(2.5f, 5); + timed_setStaticCameraToNode(0.0f, 4); + timed_setStaticCameraToNode(2.5f, 5); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.5f, 19000); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.6f, 19000); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.7f, 19000); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 19000); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.9f, 19000); timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 19000);\ - func_80324E88(5.0f); + timed_exitStaticCamera(5.0f); func_80324E38(5.0f, 0); timedFunc_set_2(5.0f, (GenMethod_2) func_80387090, (s32) marker, 3); } @@ -89,7 +89,7 @@ void func_80387308(ActorMarker *marker){ timedFunc_set_2(0.5f, (GenMethod_2) func_80387090, (s32) actor->marker, 1); timedFunc_set_2(1.5f, (GenMethod_2) func_803870BC, 0x19d, 0x1f4); - func_80324E88(1.5f); + timed_exitStaticCamera(1.5f); func_80324E38(1.5f, 0); } @@ -107,7 +107,7 @@ void func_80387488(ActorMarker *marker){ } } func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 6); + timed_setStaticCameraToNode(0.0f, 6); timedFunc_set_1(0.5f, (GenMethod_1) func_80387308, (s32) actor->marker); } diff --git a/src/SM/ch/attacktutorial.c b/src/SM/ch/attacktutorial.c index 06811790..d90a23ec 100644 --- a/src/SM/ch/attacktutorial.c +++ b/src/SM/ch/attacktutorial.c @@ -5,7 +5,7 @@ /* chAttackTutorial - controls bottle teaching moves in spiral*/ //external -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void func_8028F918(s32); //public @@ -64,7 +64,7 @@ void func_80387288(ActorMarker *marker, enum asset_e text_id, s32 arg2){ chAttackTutorial_setState(actor, 2); break; }//L803872FC - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); } void chAttackTutorial_setState(Actor * this, s32 arg1){ @@ -170,7 +170,7 @@ void func_80387690(ActorMarker *marker, enum asset_e text_id, s32 arg2){ chAttackTutorial_setState(actor, 3); break; } - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); }//*/ void func_80387764(ActorMarker * marker){ @@ -211,7 +211,7 @@ void func_80387764(ActorMarker * marker){ sp34 = 0xE12; }//L80387898 if(temp_a2){ - timed_setCameraToNode(0.0f, 6); + timed_setStaticCameraToNode(0.0f, 6); }//L803878B0 func_80311480(sp34, sp2C, actor->unk1C, actor->marker, func_80387690, NULL); diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index ba542ea1..89075caa 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -7,7 +7,7 @@ Actor *func_802D94B4(ActorMarker*, Gfx**, Mtx**, Vtx**); void func_8028E668(f32*, f32, f32, f32); void func_80328FB0(Actor *, f32); void func_8030DA44(u8); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); void func_80328B8C(Actor *, s32, f32, s32); //static types @@ -93,10 +93,10 @@ void func_80388EB0(void){ void func_80388F24(Actor *this){ if(this->unkF4_8 == 1 && !mapSpecificFlags_get(1)){ - timed_setCameraToNode(0.0f, 0x12); + timed_setStaticCameraToNode(0.0f, 0x12); } else{ //L80388F68 - timed_setCameraToNode(0.0f, D_8038AFB4[this->unkF4_8 -1].unk4); + timed_setStaticCameraToNode(0.0f, D_8038AFB4[this->unkF4_8 -1].unk4); } } @@ -169,13 +169,13 @@ void func_80389214(ActorMarker *marker, enum asset_e text_id, s32 arg2){ Actor *actor = marker_getActor(marker); switch(arg2){ case 3: - timed_setCameraToNode(0.0f, 2); + timed_setStaticCameraToNode(0.0f, 2); break; case 4: mapSpecificFlags_set(4,1); break; case 5: - timed_setCameraToNode(0.0f, 0x12); + timed_setStaticCameraToNode(0.0f, 0x12); break; case 6: func_8025A70C(COMUSIC_2B_DING_B); @@ -196,7 +196,7 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ }//L8038933C else{ if( !(text_id == 0xdf3 || text_id == 0xe1f || text_id == 0xe1d) ){ - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); } switch(text_id){ case 0xd38: diff --git a/src/SM/code_4070.c b/src/SM/code_4070.c index 2b76f4b0..ba5f06ff 100644 --- a/src/SM/code_4070.c +++ b/src/SM/code_4070.c @@ -4,7 +4,7 @@ //extern Actor *func_802D94B4(ActorMarker *, Gfx **, Mtx **, Vtx**); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); //public void SM_func_8038A5D8(Actor *this); @@ -19,7 +19,7 @@ ActorInfo D_8038B0B0 = { 0x1ED, 0x3B9, 0, 1, NULL, /* .code */ void func_8038A460(Actor *this){ - timed_setCameraToNode(0.0f,4); + timed_setStaticCameraToNode(0.0f,4); } void func_8038A488(ActorMarker *caller, enum asset_e text_id, s32 arg2){ @@ -27,7 +27,7 @@ void func_8038A488(ActorMarker *caller, enum asset_e text_id, s32 arg2){ if(text_id == 0xdf9 || text_id == 0xe12){ func_8038A4DC(actor, 3); } - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); } void func_8038A4DC(Actor *this, s32 arg1){ diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index 18432020..049ecd52 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -95,7 +95,7 @@ void func_80387678(Actor *this){ this->yaw_ideal = (f32) func_80329784(this); mapSpecificFlags_set(3, TRUE); func_8028F918(2); - timed_setCameraToNode(0.0f, 4); + timed_setStaticCameraToNode(0.0f, 4); timedFunc_set_1(1.0f, (GenMethod_1)func_803875D4, (s32)this->marker); func_80328B8C(this, 1, 0.0f, 1); } @@ -241,7 +241,7 @@ void TTC_func_80387CF4(Actor *this){ func_80343DEC(this); if(0.99 <= this->unk48){ func_8028F918(0); - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); marker_despawn(this->marker); } func_80387830(this, 0.5f, 0.97f); diff --git a/src/TTC/ch/leaky.c b/src/TTC/ch/leaky.c index 6d596ab6..1f10d54e 100644 --- a/src/TTC/ch/leaky.c +++ b/src/TTC/ch/leaky.c @@ -90,7 +90,7 @@ void __chLeaky_startCutscene(ActorMarker *caller, enum asset_e text_id, s32 arg2 } func_80324E38(0.0f, 3); - timed_setCameraToNode(0.5f, 7); + timed_setStaticCameraToNode(0.5f, 7); timedFunc_set_0(1.0f, func_80388F88); func_80324E38(2.5f, 0); timedFunc_set_1(2.5f, func_8028F9DC, 2); diff --git a/src/TTC/ch/nipper.c b/src/TTC/ch/nipper.c index aacf8a39..467c0592 100644 --- a/src/TTC/ch/nipper.c +++ b/src/TTC/ch/nipper.c @@ -87,7 +87,7 @@ void TTC_func_80387FB0(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this; this = marker_getActor(caller); TTC_func_80387F18(this); - func_802BAE4C(); + ncStaticCamera_exit(); comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 300); } @@ -238,7 +238,7 @@ void func_80388434(Actor *this){ this->unk138_24 = TRUE; } comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300); - set_camera_to_node(11); + ncStaticCamera_setToNode(11); } else{//L803886B0 TTC_func_80387F18(this); diff --git a/src/TTC/code_3E30.c b/src/TTC/code_3E30.c index ca3ab1a6..7ebd8704 100644 --- a/src/TTC/code_3E30.c +++ b/src/TTC/code_3E30.c @@ -404,8 +404,8 @@ void func_8038B094(void){ if(levelSpecificFlags_get(5)){ func_8034E71C(sp2C, -500, 10.0f); func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 1); - func_80324E88(2.0f); + timed_setStaticCameraToNode(0.0f, 1); + timed_exitStaticCamera(2.0f); func_80324E38(2.0f, 0); func_803228D8(); timedFunc_set_3(2.0f, (GenMethod_3) func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0); diff --git a/src/core1/code_18350.c b/src/core1/code_18350.c index 91f759bc..1b822f8d 100644 --- a/src/core1/code_18350.c +++ b/src/core1/code_18350.c @@ -30,7 +30,7 @@ f32 ml_acosValTbl[90] = { //D_80276CBC 0.0871559978, 0.0697569996, 0.0523359999, 0.0348990001, 0.0174519997 }; -f32 func_8024C788(void); +f32 viewport_getYaw(void); // .h void func_80257918(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3]); @@ -1223,29 +1223,29 @@ void ml_vec3f_to_vec3h(s16 dst[3], f32 src[3]) dst[2] = src[2]; } -void func_80258E60(f32 dst[3], f32 src[3], f32 amount) +void ml_translate_y_local(f32 position[3], f32 rotation[3], f32 dy) { f32 vec[3]; vec[0] = 0; - vec[1] = amount; + vec[1] = dy; vec[2] = 0; - ml_vec3f_pitch_rotate_copy(vec, vec, src[0]); - ml_vec3f_yaw_rotate_copy(vec, vec, src[1]); + ml_vec3f_pitch_rotate_copy(vec, vec, rotation[0]); + ml_vec3f_yaw_rotate_copy(vec, vec, rotation[1]); - dst[0] += vec[0]; - dst[1] += vec[1]; - dst[2] += vec[2]; + position[0] += vec[0]; + position[1] += vec[1]; + position[2] += vec[2]; } -void func_80258EF4(f32 dst[3], f32 src[3], f32 amount) +void ml_translate_z_local(f32 dst[3], f32 src[3], f32 dz) { f32 vec[3]; vec[0] = 0; vec[1] = 0; - vec[2] = amount; + vec[2] = dz; ml_vec3f_pitch_rotate_copy(vec, vec, src[0]); ml_vec3f_yaw_rotate_copy(vec, vec, src[1]); @@ -1255,11 +1255,11 @@ void func_80258EF4(f32 dst[3], f32 src[3], f32 amount) dst[2] += vec[2]; } -void func_80258F88(f32 dst[3], f32 src[3], f32 amount) +void ml_translate_x_local(f32 dst[3], f32 src[3], f32 dx) { f32 vec[3]; - vec[0] = amount; + vec[0] = dx; vec[1] = 0; vec[2] = 0; @@ -1481,7 +1481,7 @@ void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]) s32 func_8025975C(f32 a0) { - f32 val = (s32)(func_8024C788() - a0); + f32 val = (s32)(viewport_getYaw() - a0); while (val < 0) val += 360; diff --git a/src/core1/code_2FA0.c b/src/core1/code_2FA0.c index 223ff49c..f6fa3936 100644 --- a/src/core1/code_2FA0.c +++ b/src/core1/code_2FA0.c @@ -17,7 +17,7 @@ void func_802409C0(f32 arg0[3], f32 arg1){ sp30[1] = 0.0f; sp30[2] = -(sp28[1] * sp24); - func_8024C764(&sp3C); + viewport_getRotation(&sp3C); ml_vec3f_yaw_rotate_copy(sp30, sp30, sp3C[1]); arg0[0] = arg0[0] + sp30[0]; @@ -59,7 +59,7 @@ void func_80240AC8(f32 arg0[3], f32 arg1){ sp30[1] = 0.0f; sp30[2] = -(sp28[1] * sp24); - func_8024C764(&sp3C); + viewport_getRotation(&sp3C); ml_vec3f_yaw_rotate_copy(sp30, sp30, sp3C[1]); arg0[0] = arg0[0] + sp30[0]; diff --git a/src/core1/code_3A70.c b/src/core1/code_3A70.c index 317601ea..bbd00db8 100644 --- a/src/core1/code_3A70.c +++ b/src/core1/code_3A70.c @@ -162,7 +162,7 @@ void func_802424D4(Gfx **gfx, Mtx **mtx, Vtx **vtx, f32 arg3[3], f32 arg4[3], f3 sp68[1] *= arg5; sp68[2] *= arg5; - func_8024C5CC(sp5C); + viewport_getPosition(sp5C); gSPDisplayList((*gfx)++, D_80275880); gSPSetGeometryMode((*gfx)++, G_ZBUFFER); gSPVertex((*gfx)++, *vtx, 8, 0); @@ -209,7 +209,7 @@ void func_80242BE8(Gfx **gfx, Vtx **arg1, f32 arg2[2][2][2][3], s32 arg3[3], s32 s32 i; s32 j; s32 k; - func_8024C5CC(sp84); + viewport_getPosition(sp84); gSPDisplayList((*gfx)++, D_80275880); if (arg5){ gSPSetGeometryMode((*gfx)++, G_CULL_BACK); diff --git a/src/core1/code_EAF0.c b/src/core1/code_EAF0.c index 53a12cd7..c04a2689 100644 --- a/src/core1/code_EAF0.c +++ b/src/core1/code_EAF0.c @@ -13,8 +13,8 @@ f32 D_80275D2C = 4000.0f; //far /* .data */ f32 D_80280EA0[3]; -f32 D_80280EB0[3]; -f32 D_80280EC0[3]; +f32 viewportPosition[3]; +f32 viewportRotation[3]; f32 D_80280ECC; f32 D_80280ED0[4][4]; Vp D_80280F10[8]; @@ -41,48 +41,48 @@ void func_80256E24(f32 [3], f32, f32, f32, f32, f32); /* .code */ void func_8024C510(f32 arg0){ f32 sp24[3]; - func_80256E24(sp24, D_80280EC0[0], D_80280EC0[1], 0.0f, 0.0f, arg0); - D_80280EB0[0] += sp24[0]; - D_80280EB0[1] += sp24[1]; - D_80280EB0[2] += sp24[2]; + func_80256E24(sp24, viewportRotation[0], viewportRotation[1], 0.0f, 0.0f, arg0); + viewportPosition[0] += sp24[0]; + viewportPosition[1] += sp24[1]; + viewportPosition[2] += sp24[2]; } -void func_8024C584(f32 arg0[3]){ - ml_distance_vec3f(arg0, D_80280EB0); +f32 viewport_getDistance(f32 arg0[3]){ + ml_distance_vec3f(arg0, viewportPosition); } void func_8024C5A8(f32 arg0[3]){ ml_vec3f_copy(arg0, D_80280EA0); } -void func_8024C5CC(f32 arg0[3]){ - ml_vec3f_copy(arg0, D_80280EB0); +void viewport_getPosition(f32 arg0[3]){ + ml_vec3f_copy(arg0, viewportPosition); } void func_8024C5F0(s32 dst[3]){ - dst[0] = ((f32)(s32)(D_80280EB0[0]*500.0))/500.0; - dst[1] = ((f32)(s32)(D_80280EB0[1]*500.0))/500.0; - dst[2] = ((f32)(s32)(D_80280EB0[2]*500.0))/500.0; + dst[0] = ((f32)(s32)(viewportPosition[0]*500.0))/500.0; + dst[1] = ((f32)(s32)(viewportPosition[1]*500.0))/500.0; + dst[2] = ((f32)(s32)(viewportPosition[2]*500.0))/500.0; } void func_8024C6A0(s16 dst[3]){ - dst[0] = ((f32)(s32)(D_80280EB0[0]*500.0))/500.0; - dst[1] = ((f32)(s32)(D_80280EB0[1]*500.0))/500.0; - dst[2] = ((f32)(s32)(D_80280EB0[2]*500.0))/500.0; + dst[0] = ((f32)(s32)(viewportPosition[0]*500.0))/500.0; + dst[1] = ((f32)(s32)(viewportPosition[1]*500.0))/500.0; + dst[2] = ((f32)(s32)(viewportPosition[2]*500.0))/500.0; } -void func_8024C764(f32 arg0[3]){ - ml_vec3f_copy(arg0, D_80280EC0); +void viewport_getRotation(f32 arg0[3]){ + ml_vec3f_copy(arg0, viewportRotation); } -f32 func_8024C788(void){ - return D_80280EC0[1]; +f32 viewport_getYaw(void){ + return viewportRotation[1]; } void func_8024C794(f32 *arg0, f32 *arg1, f32 *arg2){ - *arg0 = D_80280EC0[0]; - *arg1 = D_80280EC0[1]; - *arg2 = D_80280EC0[2]; + *arg0 = viewportRotation[0]; + *arg1 = viewportRotation[1]; + *arg2 = viewportRotation[2]; } void func_8024C7B8(Gfx **gfx, Mtx **mtx){ @@ -115,13 +115,13 @@ void func_8024C964(Gfx **gfx, Mtx **mtx, f32 near, f32 far){ gSPPerspNormalize((*gfx)++, sp5e); gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - guRotate(*mtx, -D_80280EC0[2], 0.0f, 0.0f, -1.0f); + guRotate(*mtx, -viewportRotation[2], 0.0f, 0.0f, -1.0f); gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - guRotate(*mtx, -D_80280EC0[0], 1.0f, 0.0f, 0.0f); + guRotate(*mtx, -viewportRotation[0], 1.0f, 0.0f, 0.0f); gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - guRotate(*mtx, -D_80280EC0[1], 0.0f, 1.0f, 0.0f); + guRotate(*mtx, -viewportRotation[1], 0.0f, 1.0f, 0.0f); gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); guTranslate(*mtx, 0.0f, 0.0f, 0.0f); @@ -166,30 +166,30 @@ void func_8024CD7C(int arg0){ D_80280F90 = arg0; } -void func_8024CD88(f32 src[3]){ - ml_vec3f_copy(D_80280EB0, src); +void viewport_setPosition(f32 src[3]){ + ml_vec3f_copy(viewportPosition, src); } void func_8024CDB0(s32 src[3]){ - D_80280EB0[0] = (f32)src[0]; - D_80280EB0[1] = (f32)src[1]; - D_80280EB0[2] = (f32)src[2]; + viewportPosition[0] = (f32)src[0]; + viewportPosition[1] = (f32)src[1]; + viewportPosition[2] = (f32)src[2]; } void func_8024CDF8(f32 arg0, f32 arg1, f32 arg2){ - D_80280EB0[0] = arg0; - D_80280EB0[1] = arg1; - D_80280EB0[2] = arg2; + viewportPosition[0] = arg0; + viewportPosition[1] = arg1; + viewportPosition[2] = arg2; } -void func_8024CE18(f32 src[3]){ - ml_vec3f_copy(D_80280EC0, src); +void viewport_setRotation(f32 src[3]){ + ml_vec3f_copy(viewportRotation, src); } void func_8024CE40(f32 arg0, f32 arg1, f32 arg2){ - D_80280EC0[0] = arg0; - D_80280EC0[1] = arg1; - D_80280EC0[2] = arg2; + viewportRotation[0] = arg0; + viewportRotation[1] = arg1; + viewportRotation[2] = arg2; } void func_8024CE60(f32 near, f32 far){ @@ -223,22 +223,22 @@ void func_8024CF10(f32 arg0, f32 arg1, f32 arg2, f32 arg3){ osWritebackDCache(&D_80280F10[D_80281018], sizeof(Vp)*8); } -void func_8024CFD4(void){ - func_80256E24(D_80280ED0[0], D_80280EC0[0], D_80280EC0[1], -89.21774f, 0.0f, 45.168514251708984f); - func_80256E24(D_80280ED0[1], D_80280EC0[0], D_80280EC0[1], 89.21774f, 0.0f, 45.168514251708984f); - func_80256E24(D_80280ED0[2], D_80280EC0[0], D_80280EC0[1], 0.0f, 93.9692611694336f, 34.20201110839844f); - func_80256E24(D_80280ED0[3], D_80280EC0[0], D_80280EC0[1], 0.0f, -93.9692611694336f, 34.20201110839844f); +void viewport_update(void){ + func_80256E24(D_80280ED0[0], viewportRotation[0], viewportRotation[1], -89.21774f, 0.0f, 45.168514251708984f); + func_80256E24(D_80280ED0[1], viewportRotation[0], viewportRotation[1], 89.21774f, 0.0f, 45.168514251708984f); + func_80256E24(D_80280ED0[2], viewportRotation[0], viewportRotation[1], 0.0f, 93.9692611694336f, 34.20201110839844f); + func_80256E24(D_80280ED0[3], viewportRotation[0], viewportRotation[1], 0.0f, -93.9692611694336f, 34.20201110839844f); ml_vec3f_normalize(D_80280ED0[0]); ml_vec3f_normalize(D_80280ED0[1]); ml_vec3f_normalize(D_80280ED0[2]); ml_vec3f_normalize(D_80280ED0[3]); - D_80280ED0[0][3] = -(D_80280EB0[0]*D_80280ED0[0][0] + D_80280EB0[1]*D_80280ED0[0][1] + D_80280EB0[2]*D_80280ED0[0][2]); - D_80280ED0[1][3] = -(D_80280EB0[0]*D_80280ED0[1][0] + D_80280EB0[1]*D_80280ED0[1][1] + D_80280EB0[2]*D_80280ED0[1][2]); - D_80280ED0[2][3] = -(D_80280EB0[0]*D_80280ED0[2][0] + D_80280EB0[1]*D_80280ED0[2][1] + D_80280EB0[2]*D_80280ED0[2][2]); - D_80280ED0[3][3] = -(D_80280EB0[0]*D_80280ED0[3][0] + D_80280EB0[1]*D_80280ED0[3][1] + D_80280EB0[2]*D_80280ED0[3][2]); + D_80280ED0[0][3] = -(viewportPosition[0]*D_80280ED0[0][0] + viewportPosition[1]*D_80280ED0[0][1] + viewportPosition[2]*D_80280ED0[0][2]); + D_80280ED0[1][3] = -(viewportPosition[0]*D_80280ED0[1][0] + viewportPosition[1]*D_80280ED0[1][1] + viewportPosition[2]*D_80280ED0[1][2]); + D_80280ED0[2][3] = -(viewportPosition[0]*D_80280ED0[2][0] + viewportPosition[1]*D_80280ED0[2][1] + viewportPosition[2]*D_80280ED0[2][2]); + D_80280ED0[3][3] = -(viewportPosition[0]*D_80280ED0[3][0] + viewportPosition[1]*D_80280ED0[3][1] + viewportPosition[2]*D_80280ED0[3][2]); mlMtxIdent(); - mlMtxRotYaw(D_80280EC0[1]); - mlMtxRotPitch(D_80280EC0[0]); + mlMtxRotYaw(viewportRotation[1]); + mlMtxRotPitch(viewportRotation[0]); mlMtxGet(&D_80280F98); D_80280EA0[0] = 0.0f; D_80280EA0[1] = 0.0f; @@ -332,9 +332,9 @@ bool func_8024D9B0(Cube *cube) { if (cube->x == -0x10) { return TRUE; } - sp1C[0] = (f32) ((cube->x * 1000) + 500) - D_80280EB0[0]; - sp1C[1] = (f32) ((cube->y * 1000) + 500) - D_80280EB0[1]; - sp1C[2] = (f32) ((cube->z * 1000) + 500) - D_80280EB0[2]; + sp1C[0] = (f32) ((cube->x * 1000) + 500) - viewportPosition[0]; + sp1C[1] = (f32) ((cube->y * 1000) + 500) - viewportPosition[1]; + sp1C[2] = (f32) ((cube->z * 1000) + 500) - viewportPosition[2]; if (LENGTH_SQ_VEC3F(sp1C) > 1.6e7f) { return FALSE; } @@ -351,9 +351,9 @@ bool func_8024DB50(f32 arg0[3], f32 arg1) { f32 sp3C[3]; s32 i; - sp3C[0] = arg0[0] - D_80280EB0[0]; - sp3C[1] = arg0[1] - D_80280EB0[1]; - sp3C[2] = arg0[2] - D_80280EB0[2]; + sp3C[0] = arg0[0] - viewportPosition[0]; + sp3C[1] = arg0[1] - viewportPosition[1]; + sp3C[2] = arg0[2] - viewportPosition[2]; for(i = 0; i < 4; i++){ if(arg1 <= ml_dotProduct_vec3f(sp3C, D_80280ED0[i])){ return FALSE; @@ -409,7 +409,7 @@ f32 func_8024DDCC(void){ } f32 func_8024DDD8(s32 arg0, f32 arg1){ - return mlNormalizeAngle((D_80280EC0[1] + arg1) + 90.0); + return mlNormalizeAngle((viewportRotation[1] + arg1) + 90.0); } f32 func_8024DE1C(f32 arg0, f32 arg1, f32 arg2[3], f32 arg3[3]) { @@ -426,18 +426,18 @@ f32 func_8024DE1C(f32 arg0, f32 arg1, f32 arg2[3], f32 arg3[3]) { } arg0 = arg0 - (framebuffer_width / (f32)2); arg1 = (framebuffer_height / (f32)2) - arg1; - arg3[0] = D_80280EC0[0]; - arg3[1] = D_80280EC0[1]; - arg3[2] = D_80280EC0[2]; + arg3[0] = viewportRotation[0]; + arg3[1] = viewportRotation[1]; + arg3[2] = viewportRotation[2]; arg2[0] = arg0 * D_80281024; arg2[1] = arg1 * D_80281024; arg2[2] = (-500.0 - D_80275D28); ml_vec3f_pitch_rotate_copy(arg2, arg2, arg3[0]); ml_vec3f_yaw_rotate_copy(arg2, arg2, arg3[1]); - arg2[0] += D_80280EB0[0]; - arg2[1] += D_80280EB0[1]; - arg2[2] += D_80280EB0[2]; + arg2[0] += viewportPosition[0]; + arg2[1] += viewportPosition[1]; + arg2[2] += viewportPosition[2]; return D_80281024; } @@ -457,11 +457,11 @@ bool func_8024E030(f32 arg0[3], f32 *arg1) f32 temp_f2; f32 sp28; sp28 = (D_80275D20 * 3.14159265358979323846) / 360.0; - sp34[0] = arg0[0] - D_80280EB0[0]; - sp34[1] = arg0[1] - D_80280EB0[1]; - sp34[2] = arg0[2] - D_80280EB0[2]; - ml_vec3f_yaw_rotate_copy(sp34, sp34, -D_80280EC0[1]); - ml_vec3f_pitch_rotate_copy(sp34, sp34, -D_80280EC0[0]); + sp34[0] = arg0[0] - viewportPosition[0]; + sp34[1] = arg0[1] - viewportPosition[1]; + sp34[2] = arg0[2] - viewportPosition[2]; + ml_vec3f_yaw_rotate_copy(sp34, sp34, -viewportRotation[1]); + ml_vec3f_pitch_rotate_copy(sp34, sp34, -viewportRotation[0]); if ((-D_80275D28) <= sp34[2]) { return 0; } @@ -480,8 +480,8 @@ bool func_8024E030(f32 arg0[3], f32 *arg1) void func_8024E258(void){ s32 i, j; - func_8024C5CC(D_80281028); - func_8024C764(D_80281038); + viewport_getPosition(D_80281028); + viewport_getRotation(D_80281038); func_8024D1EC(D_80281048, D_80281058, D_80281068, D_80281078); func_8024C5A8(D_80281088); for(i = 0; i < 4; i++){ @@ -493,8 +493,8 @@ void func_8024E258(void){ void func_8024E2FC(void){ s32 i, j; - func_8024CD88(D_80281028); - func_8024CE18(D_80281038); + viewport_setPosition(D_80281028); + viewport_setRotation(D_80281038); func_8024D2B0(D_80281048, D_80281058, D_80281068, D_80281078); ml_vec3f_copy(D_80280EA0, D_80281088); for(i = 0; i < 4; i++){ @@ -504,9 +504,10 @@ void func_8024E2FC(void){ } } +//moves the point(arg0) some distance (arg1) further away from the camera void func_8024E3A8(f32 arg0[3], f32 arg1){ f32 sp1C[3]; - ml_vec3f_diff_copy(sp1C, D_80280EB0, arg0); + ml_vec3f_diff_copy(sp1C, viewportPosition, arg0); ml_vec3f_set_length_copy(sp1C, sp1C, arg1); arg0[0] += sp1C[0]; arg0[1] += sp1C[1]; diff --git a/src/core2/bs/ant.c b/src/core2/bs/ant.c index 6eacc946..d3f9ae95 100644 --- a/src/core2/bs/ant.c +++ b/src/core2/bs/ant.c @@ -395,7 +395,7 @@ void bsant_die_init(void){ gravity_set(-1200.0f); pitch_setAngVel(1000.0f, 12.0f); func_802914CC(0xd); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029C984(); D_8037D294 = 0; baMarker_collisionOff(); diff --git a/src/core2/bs/bFly.c b/src/core2/bs/bFly.c index 8f9b098e..37233efd 100644 --- a/src/core2/bs/bFly.c +++ b/src/core2/bs/bFly.c @@ -5,7 +5,7 @@ extern void func_8028FDC8(f32); extern void baModel_setYDisplacement(f32); extern f32 func_8029B2D0(void); -extern void func_802BFE50(f32, f32, f32); +extern void ncDynamicCam4_func_802BFE50(f32, f32, f32); extern void func_80354030(f32[3], f32); @@ -35,7 +35,7 @@ int func_802A3350(void){ void func_802A339C(f32 arg0[3], f32 arg1[3], f32 arg2){ func_8024C5A8(arg0); ml_vec3f_scale(arg0, arg2); - func_8024C764(arg1); + viewport_getRotation(arg1); } void func_802A33D8(void){ @@ -330,7 +330,7 @@ void func_802A3F9C(void){ pitch_setIdeal(sp1C[0]); func_8029E070(1); func_802914CC(4); - func_802BFE74(1); + ncDynamicCam4_func_802BFE74(1); func_802A3430(); FUNC_8030E624(SFX_52_BANJO_YAH_OH, 1.0f, 28000); D_8037D345 = 0; @@ -377,7 +377,7 @@ void func_802A411C(void) { if (animctrl_isAt(sp58, 0.6905f)) { func_802978DC(8); func_802914CC(5); - func_802BF590(&D_8037D338); + ncDynamicCam5_func_802BF590(&D_8037D338); animctrl_setDuration(sp58, 0.05f); func_80299CF4(SFX_50_KAZOOIE_RRRUH, 1.3f, 0x7FFF); D_8037D345 = 1; @@ -573,7 +573,7 @@ void func_802A48B4(void) { if (item_getCount(ITEM_14_HEALTH) == 0) { func_8029C984(); func_8029151C(0xD); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029B930(); func_8029E3C0(0, 2.5f); D_8037D344 = 2; @@ -652,7 +652,7 @@ void func_802A4A78(s32 arg0) { func_80297BF8(-4000.0f); func_8029E070(1); func_802914CC(4); - func_802BFE50(12.0f, 10000.0f, 800.0f); + ncDynamicCam4_func_802BFE50(12.0f, 10000.0f, 800.0f); baMarker_collisionOff(); func_802A3430(); } @@ -728,7 +728,7 @@ void func_802A4D90(void) { gravity_set(-1800.0f); baMarker_collisionOff(); func_802914CC(4); - func_802BFE50(12.0f, 10000.0f, 800.0f); + ncDynamicCam4_func_802BFE50(12.0f, 10000.0f, 800.0f); } void func_802A4EC8(void) { diff --git a/src/core2/bs/bSwim.c b/src/core2/bs/bSwim.c index 194f349d..f536cd78 100644 --- a/src/core2/bs/bSwim.c +++ b/src/core2/bs/bSwim.c @@ -441,7 +441,7 @@ void func_802A8098(void) { } if (func_8029E284(1, 1.9f)) { func_802914CC(0xD); - func_802BF2C0(80.0f); + ncDynamicCamD_func_802BF2C0(80.0f); if (D_8037D394) { func_8029E3C0(0, 0.5f); } else { diff --git a/src/core2/bs/beeFly.c b/src/core2/bs/beeFly.c index 2c3f7321..f6f15945 100644 --- a/src/core2/bs/beeFly.c +++ b/src/core2/bs/beeFly.c @@ -10,7 +10,7 @@ void func_80297970(f32); void baModel_setYDisplacement(f32); void func_80297BF8(f32); -void func_802BFE50(f32, f32, f32); +void ncDynamicCam4_func_802BFE50(f32, f32, f32); void yaw_setVelocityBounded(f32, f32); f32 func_8029B2D0(void); f32 func_8029B2DC(void); @@ -123,7 +123,7 @@ void _bsBeeFly_updateYaw(void){ f32 sp30; f32 stickX; stickX = func_8029B2D0(); - func_802BFE50(2.0f, 2000.0f, 350.0f); + ncDynamicCam4_func_802BFE50(2.0f, 2000.0f, 350.0f); if(button_held(BUTTON_R)){ yaw_setVelocityBounded(500.0f, 30.0f); sp34 = 6.0f; diff --git a/src/core2/bs/beeMain.c b/src/core2/bs/beeMain.c index 8a1fb0e9..675d4cc1 100644 --- a/src/core2/bs/beeMain.c +++ b/src/core2/bs/beeMain.c @@ -9,7 +9,7 @@ void yaw_applyIdeal(void); void func_8029797C(f32); f32 func_80297A64(void); void func_802979AC(f32, f32); -void func_802BF2C0(f32); +void ncDynamicCamD_func_802BF2C0(f32); f32 baanim_getTimer(void); void baanim_setEndAndDuration(f32, f32); @@ -425,7 +425,7 @@ void bsbeemain_die_init(void){ baMarker_collisionOff(); func_80292E48(); func_802914CC(0xd); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029C984(); func_8030E58C(SFX_36_BANJO_DOH, 1.8f); func_8029E3C0(0, 2.9f); diff --git a/src/core2/bs/croc.c b/src/core2/bs/croc.c index 513d87d0..a7748f1c 100644 --- a/src/core2/bs/croc.c +++ b/src/core2/bs/croc.c @@ -443,7 +443,7 @@ void bscroc_die_init(void){ baMarker_collisionOff(); func_80292E48(); func_802914CC(0xd); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029C984(); func_8030E58C(SFX_36_BANJO_DOH, 1.8f); func_8029E3C0(0, 2.9f); diff --git a/src/core2/bs/die.c b/src/core2/bs/die.c index 5cba9b7c..21ff2bed 100644 --- a/src/core2/bs/die.c +++ b/src/core2/bs/die.c @@ -53,7 +53,7 @@ void bsdie_init(void){ pitch_setAngVel(1000.0f, 12.0f); func_8029E070(1); func_8029151C(0xd); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029C984(); func_8029E3C0(0,2.9f); D_8037D414 = 0; diff --git a/src/core2/bs/dronelook.c b/src/core2/bs/dronelook.c index 88fb4733..9678720f 100644 --- a/src/core2/bs/dronelook.c +++ b/src/core2/bs/dronelook.c @@ -21,14 +21,14 @@ void bsDroneLook_init(void) { func_8029C7F4(1, 1, 3, 2); func_80297970(0.0f); func_80297A0C(0); - func_802BE8D8(); + ncDynamicCamera_enterFirstPerson(); __bsDroneLook_getEyePos(eye_position); - func_802C2A64(eye_position); + ncFirstPersonCamera_setZoomedOutPosition(eye_position); player_getRotation(eye_rotation); eye_rotation[0] = 0.0f; eye_rotation[1] += 180.0f; eye_rotation[2] = 0.0f; - func_802C2A8C(eye_rotation); + ncFirstPersonCamera_setZoomedOutRotation(eye_rotation); miscflag_set(0x17); } @@ -41,13 +41,13 @@ void bsDroneLook_update(void) { next_state = 0; dt = time_getDelta(); - if (func_802C2B00() == 2) { - func_802C2ADC(eye_rotation); + if (ncFirstPersonCamera_getState() == 2) { + ncFirstPersonCamera_getZoomedInRotation(eye_rotation); eye_rotation[0] -= func_8029B2DC() * 90.0f * dt; eye_rotation[1] -= func_8029B2D0() * 90.0f * dt; eye_rotation[2] = 0.0f; eye_rotation[0] = (eye_rotation[0] > 180.0f) ? ml_max_f(305.0f, eye_rotation[0]) : ml_min_f(70.0f, eye_rotation[0]); - func_802C2A8C(eye_rotation); + ncFirstPersonCamera_setZoomedOutRotation(eye_rotation); yaw_setIdeal(eye_rotation[1] + 180.0f); exit_first_person = FALSE; if (button_pressed(BUTTON_B) || button_pressed(BUTTON_A) || button_pressed(BUTTON_C_UP)) { @@ -65,7 +65,7 @@ void bsDroneLook_update(void) { } } __bsDroneLook_getEyePos(eye_position); - func_802C2A64(eye_position); + ncFirstPersonCamera_setZoomedOutPosition(eye_position); bs_setState(next_state); } @@ -73,6 +73,6 @@ void bsDroneLook_end(void) { if (func_80298850() == 0) { func_80299D2C(SFX_12E_CAMERA_ZOOM_MEDIUM, 1.2f, 12000); } - func_802BE91C(); + ncDynamicCamera_exitFirstPerson(); miscflag_clear(0x17); } diff --git a/src/core2/bs/pumpkin.c b/src/core2/bs/pumpkin.c index 779978fb..21b0ab8b 100644 --- a/src/core2/bs/pumpkin.c +++ b/src/core2/bs/pumpkin.c @@ -454,7 +454,7 @@ void bspumpkin_die_init(void) { gravity_set(-1200.0f); pitch_setAngVel(1000.0f, 12.0f); func_802914CC(0xD); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8029C984(); baMarker_collisionOff(); func_80292E48(); diff --git a/src/core2/bs/timeout.c b/src/core2/bs/timeout.c index 0a3da324..4c628f00 100644 --- a/src/core2/bs/timeout.c +++ b/src/core2/bs/timeout.c @@ -5,7 +5,7 @@ void func_80292E80(s32, f32); f32 func_8029B41C(void); -void func_802BF2C0(f32); +void ncDynamicCamD_func_802BF2C0(f32); void func_802B6270(void){ baanim_playForDuration_once(ASSET_77_ANIM_BSTIMEOUT, 3.2f); @@ -13,7 +13,7 @@ void func_802B6270(void){ func_80297970(0.0f); func_802914CC(0xd); yaw_setIdeal(func_8029B41C() + 35.0f); - func_802BF2C0(80.0f); + ncDynamicCamD_func_802BF2C0(80.0f); func_8025A58C(0,0xfa0); func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); func_8024BD08(0); @@ -54,7 +54,7 @@ void func_802B63F8(void){ func_80297970(0.0f); func_802914CC(0xd); yaw_setIdeal(func_8029B41C() + 35.0f); - func_802BF2C0(80.0f); + ncDynamicCamD_func_802BF2C0(80.0f); func_8025A58C(0,0xfa0); func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); func_8024BD08(0); diff --git a/src/core2/bs/walrus.c b/src/core2/bs/walrus.c index b4996fce..8ea906d4 100644 --- a/src/core2/bs/walrus.c +++ b/src/core2/bs/walrus.c @@ -463,7 +463,7 @@ void bswalrus_die_init(void){ gravity_set(-1200.0f); pitch_setAngVel(1000.0f, 12.0f); func_802914CC(0xd); - func_802BF2C0(30.0f); + ncDynamicCamD_func_802BF2C0(30.0f); func_8025AB00(); func_8025A2FC(0, 0xfa0); func_8025A70C(0x1A); @@ -727,7 +727,7 @@ void bswalrus_timeout_init(void) { func_8029C7F4(1, 1, 3, 7); func_80297970(0.0f); func_802914CC(0xD); - func_802BF2C0(60.0f); + ncDynamicCamD_func_802BF2C0(60.0f); func_8025A58C(0, 4000); func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); func_8024BD08(0); diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index cf6ab983..97a25916 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -87,7 +87,7 @@ f32 func_802D7038(Actor *this) { void func_802D7124(Actor *actor, f32 arg1) { f32 sp1C[3]; - func_8024C5CC(&sp1C); + viewport_getPosition(&sp1C); if ((actor->position[0] - sp1C[0]) * (actor->position[0] - sp1C[0]) + (actor->position[2] - sp1C[2]) * (actor->position[2] - sp1C[2]) < 12250000.0f) { func_802D729C(actor, arg1); } diff --git a/src/core2/ch/bottlesbonus.c b/src/core2/ch/bottlesbonus.c index eebaf37c..7847bcd5 100644 --- a/src/core2/ch/bottlesbonus.c +++ b/src/core2/ch/bottlesbonus.c @@ -135,9 +135,9 @@ void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) { sp18[1] = 270.0f; sp18[2] = 0.0f; } - func_8024CD88(sp24); - func_8024CE18(sp18); - func_8024CFD4(); + viewport_setPosition(sp24); + viewport_setRotation(sp18); + viewport_update(); func_8024C904(gfx, mtx); } diff --git a/src/core2/ch/clucker.c b/src/core2/ch/clucker.c index 9b36449a..7b070e9b 100644 --- a/src/core2/ch/clucker.c +++ b/src/core2/ch/clucker.c @@ -22,7 +22,7 @@ extern ActorInfo D_80372870 = { }; /* .code */ -void func_80357150(Actor *this){ +void __clucker_setDeathCutsceneCamera(Actor *this){ f32 sp34[3]; f32 sp28[3]; f32 sp1C[3]; @@ -44,7 +44,7 @@ void func_80357150(Actor *this){ sp28[0] = -50.0f; sp28[1] = this->yaw + 20.0f; sp28[2] = 0.0f; - func_802BAE6C(sp34, sp28); + ncStaticCamera_setPositionAndRotation(sp34, sp28); } void func_80357264(Actor *this, s32 next_state){ @@ -95,8 +95,8 @@ void func_80357264(Actor *this, s32 next_state){ ){ levelSpecificFlags_set(0x14, TRUE); func_80324E38(0.0f, 3); - func_80357150(this); - func_80324E88(2.0f); + __clucker_setDeathCutsceneCamera(this); + timed_exitStaticCamera(2.0f); func_80324E38(2.0f, 0); }//L80357518 func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2); diff --git a/src/core2/ch/code_468E0.c b/src/core2/ch/code_468E0.c index 2977b98f..0d96f9f3 100644 --- a/src/core2/ch/code_468E0.c +++ b/src/core2/ch/code_468E0.c @@ -27,7 +27,7 @@ void func_802CD870(Actor *this){ void func_802CD898(Actor *this){ marker_despawn(this->marker); - func_802BBC58(2); + camera_setType(2); } void func_802CD8C0(Actor *this){ @@ -76,8 +76,8 @@ void func_802CD8C0(Actor *this){ mapSpecificFlags_set(4, TRUE); } else{ - func_802BBC58(2); - func_802BD0D8(0xf); + camera_setType(2); + ncDynamicCamera_setState(0xf); } marker_despawn(this->marker); } @@ -87,12 +87,12 @@ void func_802CD8C0(Actor *this){ void func_802CDAC4(Actor *this){ f32 sp1C[3]; - func_802BBC58(1); - func_8024CD88(this->position); + camera_setType(1); + viewport_setPosition(this->position); sp1C[0] = this->pitch; sp1C[1] = this->yaw; sp1C[2] = 0.0f; - func_8024CE18(sp1C); + viewport_setRotation(sp1C); } void func_802CDB18(Actor *this){ diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index 417efa01..d8c06e3b 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -146,9 +146,9 @@ void __chCrab_spawn_mutant_crab_jiggy(void) { void __chCrab_mutantTextCallback(ActorMarker *caller, enum asset_e text_id, s32 model_id){ if (text_id == ASSET_D33_DIALOG_MUTANT_CRAB_DEFEAT) { func_80324E38(0.0f, 3); - timed_setCameraToNode(0.0f, 4); + timed_setStaticCameraToNode(0.0f, 4); timedFunc_set_0(0.1f, __chCrab_spawn_mutant_crab_jiggy); - func_80324E88(3.0f); + timed_exitStaticCamera(3.0f); func_80324E38(3.0f, 0); return; } diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index 8103803d..960939b2 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -528,7 +528,7 @@ void func_802C4C14(Actor *this){ ml_vec3f_copy(D_80365DD0[i], sp34); } } - func_802BAEB4( + ncStaticCamera_setPositionAndTarget( func_802C44EC(D_80365DD0[D_8037DCE8], D_80365DD0[D_80365E00], D_8037DD30), func_802C44EC(D_80365E04[D_8037DCE8], D_80365E04[D_80365E00], D_8037DD30) ); diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index 52142896..f041fd61 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -136,7 +136,7 @@ void func_802D9600(Actor * this){ } void func_802D9658(Actor *this){ - timed_setCameraToNode(0.0f, D_80367DC4[this->unkF4_8-9].camera_node); + timed_setStaticCameraToNode(0.0f, D_80367DC4[this->unkF4_8-9].camera_node); } void func_802D9698(ActorMarker *marker, enum asset_e arg1, s32 arg2){ @@ -155,7 +155,7 @@ void func_802D9698(ActorMarker *marker, enum asset_e arg1, s32 arg2){ func_80347A14(1); actor->unk138_24 = FALSE; } - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); if(actor->state == 5){ func_8028F918(0); func_802D9600(actor); @@ -170,7 +170,7 @@ void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2){ Actor *actor = marker_getActor(marker); switch(arg2){ case 1: - timed_setCameraToNode(0.0f, 0x11); + timed_setStaticCameraToNode(0.0f, 0x11); levelSpecificFlags_set(0x1A, 1); break; case 2: @@ -178,7 +178,7 @@ void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2){ func_802D9658(actor); break; case 3: - timed_setCameraToNode(0.0f, 0x29); + timed_setStaticCameraToNode(0.0f, 0x29); levelSpecificFlags_set(0x1A, 1); break; case 4: diff --git a/src/core2/ch/overlaynocontroller.c b/src/core2/ch/overlaynocontroller.c index a1ddc297..f455dac3 100644 --- a/src/core2/ch/overlaynocontroller.c +++ b/src/core2/ch/overlaynocontroller.c @@ -40,9 +40,9 @@ 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;}; - func_8024CD88(sp58); - func_8024CE18(sp4C); - func_8024CFD4(); + viewport_setPosition(sp58); + viewport_setRotation(sp4C); + viewport_update(); func_8024C904(gdl, mptr); {sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;}; {sp34[0] = 0.0f; sp34[1] = 165.0f; sp34[2] = 0.0f;}; diff --git a/src/core2/ch/overlaypressstart.c b/src/core2/ch/overlaypressstart.c index f367f12c..c63550e3 100644 --- a/src/core2/ch/overlaypressstart.c +++ b/src/core2/ch/overlaypressstart.c @@ -50,9 +50,9 @@ 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;}; - func_8024CD88(sp58); - func_8024CE18(sp4C); - func_8024CFD4(); + viewport_setPosition(sp58); + viewport_setRotation(sp4C); + viewport_update(); func_8024C904(gdl, mptr); {sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;}; {sp34[0] = 0.0f; sp34[1] = 400.0f; sp34[2] = 0.0f;}; diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 928fc80d..66f63737 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -52,7 +52,7 @@ void __chTermite_updateWalkSFX(Actor *this) { f32 sp24[3]; f32 sp20; - func_8024C5CC(&sp24); + viewport_getPosition(&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 diff --git a/src/core2/code_14420.c b/src/core2/code_14420.c index 0d46c4d0..4d04aa83 100644 --- a/src/core2/code_14420.c +++ b/src/core2/code_14420.c @@ -202,7 +202,7 @@ f32 func_8029B41C(void){ f32 sp1C; player_getPosition(sp2C); - func_8024C5CC(sp20); + viewport_getPosition(sp20); func_80257F18(sp2C, sp20, &sp1C); return sp1C; } @@ -362,7 +362,7 @@ void func_8029B984(f32 dst[3]){ f32 sp18[3]; _player_getPosition(plyr_pos); - func_8024C5CC(sp18); + viewport_getPosition(sp18); ml_vec3f_diff_copy(dst, sp18, plyr_pos); } @@ -722,9 +722,9 @@ void func_8029C674(void) { if (func_80298850() == 4) { D_8037D1E8 = TRUE; miscflag_set(0x17); - func_802BE8D8(); + ncDynamicCamera_enterFirstPerson(); func_8028E9C4(5, sp1C); - func_802C2A64(sp1C); + ncFirstPersonCamera_setZoomedOutPosition(sp1C); } } @@ -736,18 +736,18 @@ void func_8029C6D0(void) { if (func_80298850() == 4 && D_8037D1E8) { func_8028E9C4(5, sp18); - func_802C2A64(sp18); + ncFirstPersonCamera_setZoomedOutPosition(sp18); func_8028E9C4(5, sp30); func_80298800(sp24); func_802BC434(sp3C, sp24, sp30); - func_802C2A8C(sp3C); + ncFirstPersonCamera_setZoomedOutRotation(sp3C); } } void func_8029C748(void) { if (D_8037D1E8) { miscflag_clear(0x17); - func_802BE91C(); + ncDynamicCamera_exitFirstPerson(); } } diff --git a/src/core2/code_33AB0.c b/src/core2/code_33AB0.c index 4e95af12..96b785cb 100644 --- a/src/core2/code_33AB0.c +++ b/src/core2/code_33AB0.c @@ -4,49 +4,49 @@ typedef struct { - f32 unk0[3]; - f32 unkC[3]; -} Struct_core2_33AB0_0; + f32 position[3]; + f32 rotation[3]; +} CameraNodeType2; -void func_802BAAD4(Struct_core2_33AB0_0 *this, f32 src[3]); -void func_802BAB1C(Struct_core2_33AB0_0 *this, f32 src[3]); +void ncCameraNodeType2_setPosition(CameraNodeType2 *this, f32 src[3]); +void ncCameraNodeType2_setRotation(CameraNodeType2 *this, f32 src[3]); /* .code */ -Struct_core2_33AB0_0 *func_802BAA40(void){ - Struct_core2_33AB0_0 *this; +CameraNodeType2 *ncCameraNodeType2_new(void){ + CameraNodeType2 *this; f32 sp18[3]; - this = (Struct_core2_33AB0_0 *)malloc(sizeof(Struct_core2_33AB0_0)); + this = (CameraNodeType2 *)malloc(sizeof(CameraNodeType2)); ml_vec3f_clear(sp18); - func_802BAAD4(this, sp18); - func_802BAB1C(this, sp18); + ncCameraNodeType2_setPosition(this, sp18); + ncCameraNodeType2_setRotation(this, sp18); return this; } -void func_802BAA88(Struct_core2_33AB0_0 *this){ +void ncCameraNodeType2_free(CameraNodeType2 *this){ free(this); } -void func_802BAAA8(Struct_core2_33AB0_0 *this, f32 dst[3]){\ - ml_vec3f_copy(dst, this->unk0); +void ncCameraNodeType2_getPosition(CameraNodeType2 *this, f32 dst[3]){\ + ml_vec3f_copy(dst, this->position); } -void func_802BAAD4(Struct_core2_33AB0_0 *this, f32 src[3]){ - ml_vec3f_copy(this->unk0, src); +void ncCameraNodeType2_setPosition(CameraNodeType2 *this, f32 src[3]){ + ml_vec3f_copy(this->position, src); } -void func_802BAAF4(Struct_core2_33AB0_0 *this, f32 dst[3]){\ - ml_vec3f_copy(dst, this->unkC); +void ncCameraNodeType2_getRotation(CameraNodeType2 *this, f32 dst[3]){\ + ml_vec3f_copy(dst, this->rotation); } -void func_802BAB1C(Struct_core2_33AB0_0 *this, f32 src[3]){ - ml_vec3f_copy(this->unkC, src); +void ncCameraNodeType2_setRotation(CameraNodeType2 *this, f32 src[3]){ + ml_vec3f_copy(this->rotation, src); } -void func_802BAB3C(Struct61s *file_ptr, Struct_core2_33AB0_0 *arg1){ +void ncCameraNodeType2_fromFile(Struct61s *file_ptr, CameraNodeType2 *arg1){ while(!file_isNextByteExpected(file_ptr, 0)){ - if(!file_getNFloats_ifExpected(file_ptr, 1, arg1->unk0, 3)){ - file_getNFloats_ifExpected(file_ptr, 2, arg1->unkC, 3); + if(!file_getNFloats_ifExpected(file_ptr, 1, arg1->position, 3)){ + file_getNFloats_ifExpected(file_ptr, 2, arg1->rotation, 3); }//L802BAA0C } } diff --git a/src/core2/code_33C30.c b/src/core2/code_33C30.c index db8007f2..5e49c797 100644 --- a/src/core2/code_33C30.c +++ b/src/core2/code_33C30.c @@ -33,8 +33,8 @@ void func_802BAC58(void) { f32 sp28[3]; f32 sp1C[3]; - func_8024C5CC(sp34); - func_8024C764(sp28); + viewport_getPosition(sp34); + viewport_getRotation(sp28); func_802BEA4C(sp28, sp34, 150.0f, sp1C); if (D_8037D810 == NULL) { D_8037D810 = func_8032FBE4(sp1C, func_802BABC0, 1, 0x15D); diff --git a/src/core2/code_33D40.c b/src/core2/code_33D40.c deleted file mode 100644 index 2c7465e4..00000000 --- a/src/core2/code_33D40.c +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -extern void func_8025727C(f32, f32, f32, f32, f32, f32, f32*, f32*); - -/* .bss */ -f32 D_8037D820[4]; -f32 D_8037D830[4]; - -/* .code */ -void func_802BACD0(void){ - ml_vec3f_clear(D_8037D820); - ml_vec3f_clear(D_8037D830); -} - -void func_802BAD00(void){} - -void func_802BAD08(f32 arg0[3]){ - func_8025727C( - arg0[0], arg0[1], arg0[2], - D_8037D820[0], D_8037D820[1], D_8037D820[2], - &D_8037D830[0], &D_8037D830[1] - ); - D_8037D830[0] = mlNormalizeAngle(-D_8037D830[0]); - D_8037D830[2] = 0.0f; -} - -void func_802BAD84(f32 arg0[3]){ - ml_vec3f_copy(D_8037D820, arg0); -} - -void func_802BADAC(void){ - func_8024CD88(D_8037D820); - func_8024CE18(D_8037D830); -} - -void func_802BADDC(s32 camera_node_index){ - UNK_TYPE(s32) sp1C; - - sp1C = func_802B9E70(camera_node_index); - func_802BAAA8(sp1C, D_8037D820); - func_802BAAF4(sp1C, D_8037D830); -} - -void set_camera_to_node(s32 camera_node_index){ - func_802BBC58(3); - func_802BADDC(camera_node_index); -} - -void func_802BAE4C(void){ - func_802BBC58(2); -} - -void func_802BAE6C(f32 arg0[3], f32 arg1[3]){ - func_802BBC58(3); - ml_vec3f_copy(D_8037D820, arg0); - ml_vec3f_copy(D_8037D830, arg1); -} - -void func_802BAEB4(f32 arg0[3], f32 arg1[3]){ - func_802BBC58(3); - ml_vec3f_copy(D_8037D820, arg0); - func_802BAD08(arg1); -} - -void func_802BAEF4(f32 dst[3]){ - dst[0] = D_8037D820[0]; - dst[1] = D_8037D820[1]; - dst[2] = D_8037D820[2]; -} diff --git a/src/core2/code_33F90.c b/src/core2/code_33F90.c index 2e430e2a..29a3a49e 100644 --- a/src/core2/code_33F90.c +++ b/src/core2/code_33F90.c @@ -2,10 +2,6 @@ #include "functions.h" #include "variables.h" -extern void rumbleManager_80250E6C(f32, f32); -extern void func_80258E60(f32[3], f32[3], f32); -extern void func_80258EF4(f32[3], f32[3], f32); -extern void func_80258F88(f32[3], f32[3], f32); extern void func_802BE720(void); typedef struct { @@ -454,7 +450,7 @@ void func_802BAFE4(s32 arg0) { break; default: - timed_setCameraToNode(temp_f0, D_803654B8[arg0][phi_s1 + 1]); + timed_setStaticCameraToNode(temp_f0, D_803654B8[arg0][phi_s1 + 1]); break; } } @@ -462,7 +458,7 @@ void func_802BAFE4(s32 arg0) { if (D_803654B8[arg0][phi_s1] == -4) { func_80324E38(temp_f0, 4); } else { - func_80324E88(temp_f0); + timed_exitStaticCamera(temp_f0); } for(phi_s1 = 0; phi_s1 < phi_s0; phi_s1++){ func_80324E38(temp_f0, 0); diff --git a/src/core2/code_34310.c b/src/core2/code_34310.c index 95ccd5ff..82a63b29 100644 --- a/src/core2/code_34310.c +++ b/src/core2/code_34310.c @@ -4,9 +4,9 @@ extern void rumbleManager_80250E6C(f32, f32); -extern void func_80258E60(f32[3], f32[3], f32); -extern void func_80258EF4(f32[3], f32[3], f32); -extern void func_80258F88(f32[3], f32[3], f32); +extern void ml_translate_y_local(f32[3], f32[3], f32); +extern void ml_translate_z_local(f32[3], f32[3], f32); +extern void ml_translate_x_local(f32[3], f32[3], f32); extern void func_802BE720(void); typedef struct { @@ -84,57 +84,57 @@ void func_802BB41C(s32 arg0){ D_8037D840[arg0].unk1C = 1; } -void func_802BB434(s32 arg0, f32 dst[3], f32 src[3], f32 arg3) { +void func_802BB434(s32 arg0, f32 position[3], f32 rotation[3], f32 delta) { switch (arg0) { case 1: - func_80258F88(dst, src, arg3); + ml_translate_x_local(position, rotation, delta); return; case 0: - func_80258E60(dst, src, arg3); + ml_translate_y_local(position, rotation, delta); return; case 2: - func_80258EF4(dst, src, arg3); + ml_translate_z_local(position, rotation, delta); return; case 3: - dst[1] += arg3; + position[1] += delta; return; } } -void func_802BB4D8(s32 arg0, s32 arg1) { +void func_802BB4D8(f32 position[3], f32 rotation[3]) { f32 temp_f0; - f32 temp_f22; + f32 dt; s32 phi_s1; - temp_f22 = time_getDelta(); + dt = time_getDelta(); for(phi_s1 = 0; phi_s1 < 4; phi_s1++){ switch (D_8037D840[phi_s1].unk1C) { - case 2: - if (D_8037D840[phi_s1].unk10 >= 0.0f) { - D_8037D840[phi_s1].unk14 = 1.0f; - } else { - D_8037D840[phi_s1].unk14 = -1.0f; - } - func_802BB434(phi_s1, arg0, arg1, D_8037D840[phi_s1].unk10); - D_8037D840[phi_s1].unk1C = 3; - break; - case 3: - if (D_8037D840[phi_s1].unk18 != 0.0f) { - temp_f0 = ml_max_f(0.0f, D_8037D840[phi_s1].unk18 - temp_f22); - D_8037D840[phi_s1].unk18 = temp_f0; - D_8037D840[phi_s1].unk10 = ml_map_f(temp_f0, D_8037D840[phi_s1].unk0, 0.0f, D_8037D840[phi_s1].unkC, D_8037D840[phi_s1].unk8); - } else { - D_8037D840[phi_s1].unk10 *= D_8037D840[phi_s1].unk4; - } - if (level_get() != LEVEL_D_CUTSCENE) { - rumbleManager_80250E6C(D_8037D840[phi_s1].unk10 * 0.25, temp_f22); - } - func_802BB434(phi_s1, arg0, arg1, D_8037D840[phi_s1].unk14*D_8037D840[phi_s1].unk10); - D_8037D840[phi_s1].unk14 = (f32) -D_8037D840[phi_s1].unk14; - if (((f64) D_8037D840[phi_s1].unk4 != 1.0) && ((f64) mlAbsF(D_8037D840[phi_s1].unk10) < 0.001)) { - D_8037D840[phi_s1].unk1C = 1U; - } - break; + case 2: + if (D_8037D840[phi_s1].unk10 >= 0.0f) { + D_8037D840[phi_s1].unk14 = 1.0f; + } else { + D_8037D840[phi_s1].unk14 = -1.0f; + } + func_802BB434(phi_s1, position, rotation, D_8037D840[phi_s1].unk10); + D_8037D840[phi_s1].unk1C = 3; + break; + case 3: + if (D_8037D840[phi_s1].unk18 != 0.0f) { + temp_f0 = ml_max_f(0.0f, D_8037D840[phi_s1].unk18 - dt); + D_8037D840[phi_s1].unk18 = temp_f0; + D_8037D840[phi_s1].unk10 = ml_map_f(temp_f0, D_8037D840[phi_s1].unk0, 0.0f, D_8037D840[phi_s1].unkC, D_8037D840[phi_s1].unk8); + } else { + D_8037D840[phi_s1].unk10 *= D_8037D840[phi_s1].unk4; + } + if (level_get() != LEVEL_D_CUTSCENE) { + rumbleManager_80250E6C(D_8037D840[phi_s1].unk10 * 0.25, dt); + } + func_802BB434(phi_s1, position, rotation, D_8037D840[phi_s1].unk14*D_8037D840[phi_s1].unk10); + D_8037D840[phi_s1].unk14 = (f32) -D_8037D840[phi_s1].unk14; + if (((f64) D_8037D840[phi_s1].unk4 != 1.0) && ((f64) mlAbsF(D_8037D840[phi_s1].unk10) < 0.001)) { + D_8037D840[phi_s1].unk1C = 1U; + } + break; } } } diff --git a/src/core2/code_34790.c b/src/core2/code_34790.c index afcbd30a..9a1351d3 100644 --- a/src/core2/code_34790.c +++ b/src/core2/code_34790.c @@ -1,6 +1,7 @@ #include #include "functions.h" #include "variables.h" +#include "core2/nc/camera.h" extern Actor *func_80328230(enum actor_e, f32[3], f32[3]); extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]); @@ -22,7 +23,7 @@ s16 D_803657E0[] = { }; /* .bss */ -s32 D_8037D8C0; +s32 ncCameraType; u8 D_8037D8C4; u8 D_8037D8C5; u8 D_8037D8C6; @@ -112,17 +113,17 @@ f32 func_802BB938(f32 arg0[3], f32 arg1[3]) { } void func_802BBA84(void) { - f32 sp54[3]; + f32 vp_position[3]; f32 sp48[3]; - f32 sp3C[3]; - f32 sp30[3]; - f32 sp24[3]; + f32 vp_rotation[3]; + f32 min[3]; + f32 max[3]; - mapModel_getBounds(sp30, sp24); - func_8024C5CC(sp54); - func_8024C764(sp3C); + mapModel_getBounds(min, max); + viewport_getPosition(vp_position); + viewport_getRotation(vp_rotation); func_8024C5A8(sp48); - D_8037D8CC = (f32) func_8033EAF8(sp30, sp24, sp54, sp48); + D_8037D8CC = (f32) func_8033EAF8(min, max, vp_position, sp48); D_8037D8CC += 100.0f; if (D_8037D8CC < 1000.0f) { D_8037D8CC = 1000.0f; @@ -143,33 +144,33 @@ void func_802BBA84(void) { D_8037D8C8 = 10.0f; return; } - D_8037D8C8 = ml_min_f(D_8037D8C8, func_802BB938(sp54, sp3C)); + D_8037D8C8 = ml_min_f(D_8037D8C8, func_802BB938(vp_position, vp_rotation)); } -void func_802BBC58(s32 arg0) { - switch (D_8037D8C0) { - case 3: - func_802BAD00(); +void camera_setType(enum camera_type_e camera_type) { + switch (ncCameraType) { + case CAMERA_TYPE_3_STATIC: + ncStaticCamera_end(); break; - case 4: - func_802BED00(); + case CAMERA_TYPE_4_RANDOM: + ncRandomCamera_end(); break; - case 1: - case 2: + case CAMERA_TYPE_1_UNKNOWN: + case CAMERA_TYPE_2_DYNAMIC: break; } - switch (arg0) { - case 3: - func_802BACD0(arg0); + switch (camera_type) { + case CAMERA_TYPE_3_STATIC: + ncStaticCamera_init(); break; - case 4: - func_802BEC60(arg0); + case CAMERA_TYPE_4_RANDOM: + ncRandomCamera_init(); break; - case 1: - case 2: + case CAMERA_TYPE_1_UNKNOWN: + case CAMERA_TYPE_2_DYNAMIC: break; } - D_8037D8C0 = arg0; + ncCameraType = camera_type; } @@ -259,47 +260,47 @@ void func_802BC044(void) { func_802BCBD4(); func_802BEF78(); func_802BB2A8(); - D_8037D8C0 = 0; - func_802BBC58(2); + ncCameraType = 0; + camera_setType(2); } void func_802BC10C(void){ func_802BB2A0(); - func_802BBC58(1); + camera_setType(1); func_802BCD30(); func_802BEF70(); func_802BABD8(); } -void func_802BC14C(void){ +void ncCamera_update(void){ f32 sp2C[3]; f32 sp20[3]; s32 v0; - v0 = D_8037D8C0; + v0 = ncCameraType; if(!D_8037D8C5 && !D_8037D8C6){ v0 = 0; } switch(v0){ - case 2: - func_802BCEC4(); + case CAMERA_TYPE_2_DYNAMIC://dynamic viewport position + ncDynamicCamera_update(); break; - case 3: - func_802BADAC(); + case CAMERA_TYPE_3_STATIC://set viewport to static location + ncStaticCamera_update(); break; - case 4: - func_802BED30(); + case CAMERA_TYPE_4_RANDOM: //set viewport to random location + ncRandomCamera_update(); break; } - func_8024C5CC(sp2C); - func_8024C764(sp20); + viewport_getPosition(sp2C); + viewport_getRotation(sp20); func_802BB4D8(sp2C, sp20); - func_8024CD88(sp2C); - func_8024CE18(sp20); - func_8024CFD4(); + viewport_setPosition(sp2C); + viewport_setRotation(sp20); + viewport_update(); func_802BEFB0(); func_802BBA84(); } @@ -313,13 +314,13 @@ void func_802BC21C(s32 arg0, s32 arg1){ } } -s32 func_802BC248(void){ - return D_8037D8C0; +s32 ncCamera_getType(void){ + return ncCameraType; } void func_802BC254(void){ D_8037D8C6 = 1; - func_802BC14C(); + ncCamera_update(); D_8037D8C6 = 0; } @@ -341,21 +342,21 @@ void func_802BC2CC(s32 arg0) { func_80347A14(0); } if (func_80320454(0xE, 0) || func_802D686C() || (arg0 == 0x63) || !func_802BB720(arg0, D_8037D908, D_8037D918, &sp1C)) { - if (D_8037D8C0 == 2) { + if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) { func_802BE794(); } func_802BC254(); func_802BC254(); return; } - if (D_8037D8C0 == 2) { + if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) { func_802BE894(D_8037D918, D_8037D908); } - func_8024CD88(D_8037D908); - func_8024CE18(D_8037D918); - func_8024CFD4(); + viewport_setPosition(D_8037D908); + viewport_setRotation(D_8037D918); + viewport_update(); __spawnQueue_add_2((GenMethod_2)func_802BC2A0, reinterpret_cast(s32, sp24), reinterpret_cast(s32, sp20)); - if (D_8037D8C0 == 2) { + if (ncCameraType == CAMERA_TYPE_2_DYNAMIC) { func_802BE720(); if (sp1C != 0x63) { func_802BC254(); diff --git a/src/core2/code_3480.c b/src/core2/code_3480.c index a2d3b524..b054919a 100644 --- a/src/core2/code_3480.c +++ b/src/core2/code_3480.c @@ -3,7 +3,7 @@ #include "variables.h" s32 func_80259254(f32 *, f32, f32, f32); -void func_802C2ADC(f32 *); +void ncFirstPersonCamera_getZoomedInRotation(f32 *); extern u8 D_8037DCCA; extern u8 D_8037DCCB; @@ -98,7 +98,7 @@ s32 func_8028A5C0(void){ D_8037DCCC = 1; }//L8028A764 else if(jiggyscore_isCollected(0x10)){ - func_802C2ADC(sp30); + ncFirstPersonCamera_getZoomedInRotation(sp30); if( (((D_8036361C[0] <= sp30[0])? (sp30[0] - D_8036361C[0]) : -(sp30[0] - D_8036361C[0])) < 4.0f) && (((D_8036361C[1] <= sp30[1])? (sp30[1] - D_8036361C[1]) : -(sp30[1] - D_8036361C[1])) < 20.0f) ){ diff --git a/src/core2/code_37CD0.c b/src/core2/code_37CD0.c deleted file mode 100644 index 5d3a66df..00000000 --- a/src/core2/code_37CD0.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -/* .bss */ -struct { - f32 unk0[3]; - f32 unkC[3]; - f32 unk18[3]; - f32 unk24[3]; -}D_8037DA50; - -/* .code */ -void func_802BEC60(void) { - s32 sp24[3]; - s32 sp18[3]; - - func_8024C5CC(D_8037DA50.unk0); - func_8024C764(D_8037DA50.unkC); - mapModel_getBounds(sp24, sp18); - - D_8037DA50.unk18[0] = (f32) sp24[0]; - D_8037DA50.unk18[1] = (f32) sp24[1]; - D_8037DA50.unk18[2] = (f32) sp24[2]; - - D_8037DA50.unk24[0] = (f32) sp18[0]; - D_8037DA50.unk24[1] = (f32) sp18[1]; - D_8037DA50.unk24[2] = (f32) sp18[2]; -} - - -void func_802BED00(void){ - func_8024CD88(D_8037DA50.unk0); - func_8024CE18(D_8037DA50.unkC); -} - -void func_802BED30(void) { - f32 sp24[3]; - f32 sp18[3]; - - sp24[0] = randf2(D_8037DA50.unk18[0], D_8037DA50.unk24[0]);\ - sp24[1] = randf2(D_8037DA50.unk18[1], D_8037DA50.unk24[1]);\ - sp24[2] = randf2(D_8037DA50.unk18[2], D_8037DA50.unk24[2]); - - sp18[0] = randf2(-90.0f, 90.0f);\ - sp18[1] = randf2(0.0f, 360.0f);\ - sp18[2] = 0.0f; - func_8024CD88(sp24); - func_8024CE18(sp18); -} diff --git a/src/core2/code_37E50.c b/src/core2/code_37E50.c index ade78fb8..5daea25c 100644 --- a/src/core2/code_37E50.c +++ b/src/core2/code_37E50.c @@ -94,7 +94,7 @@ void func_802BEFB0(void) { return; } D_8037DA80.unk10 += time_getDelta(); - func_8024C5CC(sp30); + viewport_getPosition(sp30); sp24[0] = sp30[0]; sp24[1] = sp30[1] + 10000.0f; sp24[2] = sp30[2]; diff --git a/src/core2/code_39190.c b/src/core2/code_39190.c deleted file mode 100644 index 31d5ef6f..00000000 --- a/src/core2/code_39190.c +++ /dev/null @@ -1,183 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -extern f32 func_802BD51C(void); - - -void func_802C0150(s32 arg0); - -/* .bss */ -u8 D_8037DB40; -f32 D_8037DB48[3]; -f32 D_8037DB58[3]; -f32 D_8037DB70; -f32 D_8037DB78[3]; -f32 D_8037DB84[3]; -f32 D_8037DB90[3]; -f32 D_8037DB9C; - -/* .code */ -void func_802C0120(void){ - D_8037DB40 = 0; - func_802C0150(2); -} - -void func_802C0148(void){} - -void func_802C0150(s32 arg0) { - D_8037DB40 = arg0; - if (arg0 == 6) { - func_802BD4C0(D_8037DB48); - ml_vec3f_clear(D_8037DB58); - } -} - -s32 func_802C0190(void){ - return D_8037DB40; -} - -void func_802C019C(f32 arg0[3]){ - func_802BD3CC(arg0); -} - -void func_802C01BC(f32 arg0[3]){ - func_802BD4C0(arg0); -} - -void func_802C01DC(f32 arg0[3]) { - f32 sp1C[3]; - - func_8028E7EC(sp1C); - player_getPosition(arg0); - arg0[0] = sp1C[0]; - arg0[1] += 90.0f; - arg0[2] = sp1C[2]; -} - -void func_802C0234(f32 arg0[3]) { - player_getPosition(arg0); - arg0[1] += 60.0f; -} - -void func_802C026C(f32 arg0[3]) { - f32 sp1C[3]; - - func_802BD4C0(arg0); - player_getPosition(sp1C); - arg0[1] = sp1C[1]; - arg0[1] += 60.0f; -} - -void func_802C02B4(f32 arg0[3]){ - func_802BD4C0(arg0); -} - -void func_802C02D4(f32 arg0[3]) { - switch(D_8037DB40){ - case 1: - func_802C019C(arg0); - break; - - case 2: - func_802C01BC(arg0); - break; - - case 3: - func_802C01DC(arg0); - break; - - case 4: - func_802C0234(arg0); - break; - - case 5: - func_802C026C(arg0); - break; - - case 6: - func_802C02B4(arg0); - break; - } -} - - -void func_802C0370(){ - func_802BD384(D_8037DB84); -} - -void func_802C0394(f32 src[3]){ - ml_vec3f_copy(D_8037DB90, src); -} - -void func_802C03BC(void) { - f32 sp2C[3]; - f32 sp20[3]; - f32 sp1C; - - func_802BD384(D_8037DB78); - ml_vec3f_diff_copy(sp20, D_8037DB90, D_8037DB84); - ml_vec3f_diff_copy(sp2C, D_8037DB78, D_8037DB84); - ml_vec3f_normalize(sp20); - ml_vec3f_normalize(sp2C); - sp1C = sp20[0]*sp2C[0] + sp20[1]*sp2C[1] + sp20[2]*sp2C[2]; - if (sp1C < 0.0f || D_8037DB9C < 0.0f) { - func_802BD334(D_8037DB84); - } - D_8037DB9C = sp1C; -} - -void func_802C0490(f32 arg0[3]){ - func_802C02D4(arg0); -} - -void func_802C04B0(void) { - f32 sp34[3]; - f32 sp28[3]; - f32 sp1C[3]; - - func_802BD384(sp34); - func_802C0490(sp1C); - ml_vec3f_diff_copy(sp28,sp34, sp1C); - func_8025801C(sp28, &D_8037DB70); -} - -void func_802C04F8(void) { - func_802BE244(5.0f, 10.0f); - func_802BE230(3.0f, 8.0f); - func_802C0150(2); - func_802C04B0(); -} - -void func_802C0550(void){} - -void func_802C0558(void) { - f32 sp4C[3]; - f32 sp40[3]; - f32 sp34[3]; - f32 sp28[3]; - s32 sp24; - - func_802C0370(); - func_802C0490(sp4C); - func_80256E24(sp34, 0.0f, D_8037DB70, 0.0f, 0.0f, func_802BD8D4()); - ml_vec3f_add(sp40, sp4C, sp34); - sp40[1] = func_802BD51C(); - func_802C0394(sp40); - func_802BE190(sp40); - sp24 = 0; - if (func_802BE60C() != 0) { - if (func_802BC84C(1) != 0) { - sp24 = 1; - } else { - func_802C03BC(); - } - func_802C04B0(); - } - func_802C0490(sp4C); - func_802BE6FC(sp28, sp4C); - if (sp24) { - func_802BD35C(sp28); - } - func_802BD904(sp28); -} diff --git a/src/core2/code_39D0.c b/src/core2/code_39D0.c index 765db98f..69c690d7 100644 --- a/src/core2/code_39D0.c +++ b/src/core2/code_39D0.c @@ -110,7 +110,7 @@ int func_8028ACD8(void){ return 0; } - if(func_802C2B00() == 3) + if(ncFirstPersonCamera_getState() == 3) return 0; if(!func_8028B2E8() && !player_inWater()) diff --git a/src/core2/code_3B2C0.c b/src/core2/code_3B2C0.c index 4ee6c03f..4673124e 100644 --- a/src/core2/code_3B2C0.c +++ b/src/core2/code_3B2C0.c @@ -12,7 +12,6 @@ f32 D_8037DC30[3]; f32 D_8037DC3C; f32 D_8037DC40; u8 D_8037DC44; -f32 D_8037DC50[3]; /* .code */ void func_802C2250(void){} @@ -24,8 +23,8 @@ void func_802C2258(void){ void func_802C2264(f32 arg0){ D_8037DC40 = arg0; D_8037DC3C = D_8037DC40; - func_802BD384(D_8037DC20); - func_802BD3A8(D_8037DC30); + ncDynamicCamera_getPosition(D_8037DC20); + ncDynamicCamera_getRotation(D_8037DC30); D_8037DC44 = 1; } @@ -34,7 +33,7 @@ void func_802C22B4(void){ } -void func_802C22C0(f32 *arg0, f32 *arg1){ +void func_802C22C0(f32 vp_position[3], f32 vp_rotation[3]){ f32 tmpf_1[3]; f32 tmpf_2[3]; f32 tmp; @@ -43,9 +42,9 @@ void func_802C22C0(f32 *arg0, f32 *arg1){ return; if(D_8037DC44 == 1){ - ml_vec3f_diff(D_8037DC20, arg0); - D_8037DC30[0] = mlDiffDegF(D_8037DC30[0], arg1[0]); - D_8037DC30[1] = mlDiffDegF(D_8037DC30[1], arg1[1]); + ml_vec3f_diff(D_8037DC20, vp_position); + D_8037DC30[0] = mlDiffDegF(D_8037DC30[0], vp_rotation[0]); + D_8037DC30[1] = mlDiffDegF(D_8037DC30[1], vp_rotation[1]); D_8037DC30[2] = 0.0f; D_8037DC44 = 2; } @@ -56,42 +55,16 @@ void func_802C22C0(f32 *arg0, f32 *arg1){ tmp = ml_map_f(D_8037DC3C, 0.0f, D_8037DC40, 0.0f, 1.0f); ml_vec3f_scale_copy(tmpf_1, D_8037DC20, tmp); ml_vec3f_scale_copy(tmpf_2, D_8037DC30, tmp); - arg0[0] += tmpf_1[0]; - arg0[1] += tmpf_1[1]; - arg0[2] += tmpf_1[2]; - arg1[0] += tmpf_2[0]; - arg1[1] += tmpf_2[1]; - arg1[2] += tmpf_2[2]; - arg1[0] = mlNormalizeAngle(arg1[0]); - arg1[1] = mlNormalizeAngle(arg1[1]); - arg1[2] = 0.0f; + vp_position[0] += tmpf_1[0]; + vp_position[1] += tmpf_1[1]; + vp_position[2] += tmpf_1[2]; + vp_rotation[0] += tmpf_2[0]; + vp_rotation[1] += tmpf_2[1]; + vp_rotation[2] += tmpf_2[2]; + vp_rotation[0] = mlNormalizeAngle(vp_rotation[0]); + vp_rotation[1] = mlNormalizeAngle(vp_rotation[1]); + vp_rotation[2] = 0.0f; } } -void func_802C2460(void){ - f32 sp24[3]; - f32 sp12[3]; - - func_8024C5CC(sp24); - func_8024C764(sp12); - func_802BD334(sp24); - func_802BD35C(sp12); - player_getPosition(D_8037DC50); - func_80291488(5); -} - -void func_802C24AC(void){} - -void func_802C24B4(void){ - f32 sp24[3]; - f32 sp18[3]; - - player_getPosition(sp24); - ml_vec3f_diff_copy(sp18, D_8037DC50, sp24); - if( !(gu_sqrtf(sp18[0]*sp18[0] + sp18[1]*sp18[1] + sp18[2]*sp18[2]) < 2.0f)){ - func_80291488(2); - func_802BD0D8(0xB); - func_802BE720(); - } -} diff --git a/src/core2/code_3B5C0.c b/src/core2/code_3B5C0.c deleted file mode 100644 index 5bf1610c..00000000 --- a/src/core2/code_3B5C0.c +++ /dev/null @@ -1,134 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -extern void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); -extern f32 func_80257CF8(f32, f32, f32, f32, f32); - -void func_802C29A0(s32 arg0); - -/* .bss */ -struct{ - f32 unk0[3]; - f32 unkC[3]; - f32 unk18[3]; - f32 unk24[3]; - f32 unk30[3]; - f32 unk3C[3]; - f32 unk48; - u8 unk4C; -} D_8037DC60; - -/* .code */ -bool func_802C2550(void) { - return (ml_distance_vec3f(D_8037DC60.unk0, D_8037DC60.unk18) < 40.0f); -} - -void func_802C2598(f32 arg0[3], f32 arg1[3]) { - s32 i; - - func_80259430(&D_8037DC60.unk48); - for( i = 0; i<3; i++){ - D_8037DC60.unk0[i] = func_80257CF8(D_8037DC60.unk48, 1.0f, 0.0f, D_8037DC60.unk30[i], D_8037DC60.unk18[i]); - D_8037DC60.unkC[i] = mlNormalizeAngle(D_8037DC60.unk3C[i] + func_80257CF8(D_8037DC60.unk48, 0.5f, 0.0f, 0.0f, mlDiffDegF(D_8037DC60.unk24[i], D_8037DC60.unk3C[i]))); - } - if (D_8037DC60.unk48 == 0.0f) { - func_802C29A0(2); - } - if (func_802C2550() && func_8028F150()) { - func_8028FCC8(0); - } - ml_vec3f_copy(arg0, D_8037DC60.unk0); - ml_vec3f_copy(arg1, D_8037DC60.unkC); -} - - -void func_802C26D8(f32 arg0[3], f32 arg1[3]) { - s32 i; - - func_80259430(&D_8037DC60.unk48); - for( i = 0; i<3; i++){ - D_8037DC60.unk0[i] = func_80257CF8(D_8037DC60.unk48, 1.0f, 0.0f, D_8037DC60.unk18[i], arg0[i]); - D_8037DC60.unkC[i] = mlNormalizeAngle(D_8037DC60.unk24[i] + func_80257CF8(D_8037DC60.unk48, 1.0f, 0.5f, 0.0f, mlDiffDegF(arg1[i], D_8037DC60.unk24[i]))); - } - if (D_8037DC60.unk48 == 0.0f) { - func_802C29A0(4); - } - if (!func_802C2550() && !func_8028F150()) { - func_8028FCC8(1); - } - ml_vec3f_copy(arg0, D_8037DC60.unk0); - ml_vec3f_copy(arg1, D_8037DC60.unkC); -} - - -void func_802C2838(f32 arg0[3], f32 arg1[3]) { - ml_vec3f_copy(D_8037DC60.unk0, D_8037DC60.unk18); - func_802BD780(D_8037DC60.unk24, D_8037DC60.unkC, 10.0f, 20.0f, 120.0f, 200.0f); - D_8037DC60.unkC[2] = 0.0f; - ml_vec3f_copy(arg0, D_8037DC60.unk0); - ml_vec3f_copy(arg1, D_8037DC60.unkC); -} - -void func_802C28C8(void){ - ml_vec3f_clear(D_8037DC60.unk0); - ml_vec3f_clear(D_8037DC60.unkC); - ml_vec3f_clear(D_8037DC60.unk18); - ml_vec3f_clear(D_8037DC60.unk24); - ml_vec3f_clear(D_8037DC60.unk30); - ml_vec3f_clear(D_8037DC60.unk3C); - D_8037DC60.unk4C = 0; -} - -void func_802C292C(f32 arg0[3], f32 arg1[3]) { - switch (D_8037DC60.unk4C) { - case 1: - func_802C2598(arg0, arg1); - break; - case 2: - func_802C2838(arg0, arg1); - break; - case 3: - func_802C26D8(arg0, arg1); - /* fallthrough */ - case 4: - break; - } -} - -void func_802C29A0(s32 arg0) { - if (arg0 == 1) { - if (D_8037DC60.unk4C == 3) { - ml_vec3f_copy(D_8037DC60.unk30, D_8037DC60.unk0); - ml_vec3f_copy(D_8037DC60.unk3C, D_8037DC60.unkC); - } else { - func_802BD384(D_8037DC60.unk0); - func_802BD3A8(D_8037DC60.unkC); - func_802BD384(D_8037DC60.unk30); - func_802BD3A8(D_8037DC60.unk3C); - } - D_8037DC60.unk48 = 1.0f; - } - if (arg0 == 3) { - D_8037DC60.unk48 = 1.0f; - } - D_8037DC60.unk4C = arg0; -} - -void func_802C2A64(f32 src[3]){ - ml_vec3f_copy(D_8037DC60.unk18, src); -} - -void func_802C2A8C(f32 src[3]){ - D_8037DC60.unk24[0] = mlNormalizeAngle(src[0]); - D_8037DC60.unk24[1] = mlNormalizeAngle(src[1]); - D_8037DC60.unk24[2] = mlNormalizeAngle(src[2]); -} - -void func_802C2ADC(f32 dst[3]){ - ml_vec3f_copy(dst, D_8037DC60.unk24); -} - -s32 func_802C2B00(void){ - return D_8037DC60.unk4C; -} diff --git a/src/core2/code_43800.c b/src/core2/code_43800.c index 0191a439..afc28825 100644 --- a/src/core2/code_43800.c +++ b/src/core2/code_43800.c @@ -25,7 +25,7 @@ Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ Actor *this; f32 sp60; f32 sp54[3]; - f32 sp48[3]; + f32 rotation[3]; f32 sp44; f32 sp40; f32 sp34[3]; @@ -48,12 +48,12 @@ Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ func_80258108(sp34, &this->yaw, &this->pitch); - sp48[0] = this->pitch; - sp48[1] = this->yaw; - sp48[2] = this->roll; + rotation[0] = this->pitch; + rotation[1] = this->yaw; + rotation[2] = this->roll; sp44 = ml_map_f(sp54[1] - sp40, 0.0f, 300.0f, 0.43f, 0.28f); modelRender_preDraw((GenMethod_1)func_802CA790, (s32)this); - modelRender_draw(gfx, mtx, this->position, sp48, sp44, NULL, func_80330B1C(marker)); + modelRender_draw(gfx, mtx, this->position, rotation, sp44, NULL, func_80330B1C(marker)); return this; } @@ -63,7 +63,7 @@ void func_802CA92C(Actor *this){ f32 sp28[3]; this->marker->collidable = FALSE; player_getPosition(this->position); - func_8024C5CC(sp34); + viewport_getPosition(sp34); ml_vec3f_diff_copy(sp28, sp34, this->position); ml_vec3f_set_length_copy(sp28, sp28, 180.0f); this->position_x += sp28[0]; diff --git a/src/core2/code_45310.c b/src/core2/code_45310.c index 865cd809..fe4e7a2f 100644 --- a/src/core2/code_45310.c +++ b/src/core2/code_45310.c @@ -435,7 +435,7 @@ void func_802CCC5C(Actor *this) { } if (this->state == 1) { player_getPosition(sp8C); - func_8024C5CC(sp80); + viewport_getPosition(sp80); func_8024C5A8(sp74); sp5C[0] = this->position[0] - sp80[0]; sp5C[1] = this->position[1] - sp80[1]; diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 69db521a..f203942c 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -1167,8 +1167,8 @@ void func_802D6344(void){ void func_802D6388(void){ timedFunc_set_0(5.0f, func_802D6114); - func_802BBC58(1); - set_camera_to_node(D_80367688); + camera_setType(1); + ncStaticCamera_setToNode(D_80367688); D_8037DE08 = 0.5f; } @@ -1188,7 +1188,7 @@ void func_802D63D4(void){ break; case 0x2D: //L802D6440 func_802D6388(); - func_802BAEF4(sp1C); + ncStaticCamera_getPosition(sp1C); func_8028F85C(sp1C); break; default: //L802D6460 diff --git a/src/core2/code_55390.c b/src/core2/code_55390.c index d4a59c9f..4e25999d 100644 --- a/src/core2/code_55390.c +++ b/src/core2/code_55390.c @@ -23,32 +23,32 @@ ActorMarker *D_8037DE40; /* .code */ Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ Actor *this; - f32 sp58[3]; - f32 sp4C[3]; - f32 sp40[3]; + f32 vp_position[3]; + f32 vp_rotation[3]; + f32 model_position[3]; f32 sp34[3]; this = marker_getActor(marker); modelRender_preDraw( (GenMethod_1)func_803253A0, (s32)this); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker); func_8024E258(); - sp58[0] = 0.0f; - sp58[1] = 0.0f; - sp58[2] = 937.5f; - sp4C[0] = 0.0f; - sp4C[1] = 0.0f; - sp4C[2] = 0.0f; - func_8024CD88(sp58); - func_8024CE18(sp4C); - func_8024CFD4(); + vp_position[0] = 0.0f; + vp_position[1] = 0.0f; + vp_position[2] = 937.5f; + vp_rotation[0] = 0.0f; + vp_rotation[1] = 0.0f; + vp_rotation[2] = 0.0f; + viewport_setPosition(vp_position); + viewport_setRotation(vp_rotation); + viewport_update(); func_8024C904(gfx, mtx); - sp40[0] = 0.0f; - sp40[1] = 0.0f; - sp40[2] = 0.0f; + model_position[0] = 0.0f; + model_position[1] = 0.0f; + model_position[2] = 0.0f; sp34[0] = 0.0f; sp34[1] = 137.5f; sp34[2] = 0.0f; - modelRender_draw(gfx, mtx, sp40, NULL, 1.0f, sp34, func_80330B1C(marker)); + modelRender_draw(gfx, mtx, model_position, NULL, 1.0f, sp34, func_80330B1C(marker)); func_8024E2FC(); func_8024C904(gfx, mtx); return this; diff --git a/src/core2/code_55850.c b/src/core2/code_55850.c index c060e638..84e1c57f 100644 --- a/src/core2/code_55850.c +++ b/src/core2/code_55850.c @@ -37,9 +37,9 @@ Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f; - func_8024CD88(sp58); - func_8024CE18(sp4C); - func_8024CFD4(); + viewport_setPosition(sp58); + viewport_setRotation(sp4C); + viewport_update(); func_8024C904(gfx, mtx); sp40[0] = 0.0f; sp40[1] = 0.0f; diff --git a/src/core2/code_59780.c b/src/core2/code_59780.c index a9d3601a..d1059b9f 100644 --- a/src/core2/code_59780.c +++ b/src/core2/code_59780.c @@ -145,6 +145,6 @@ void func_802E08F0(Actor *this) { if (actor_animationIsAt(this, 0.99f) != 0) { marker_despawn(this->marker); } - func_8024C764(sp24); + viewport_getRotation(sp24); this->yaw = sp24[1]; } diff --git a/src/core2/code_5C870.c b/src/core2/code_5C870.c index 2d34ef8b..bb0ee16d 100644 --- a/src/core2/code_5C870.c +++ b/src/core2/code_5C870.c @@ -67,7 +67,7 @@ void func_802E3800(void){ func_8024CDF8(0.0f, 0.0f, 0.0f); func_8024CE40(-30.0f, 30.0f, 0.0f); func_8024C510(3000.0f); - func_8024CFD4(); + viewport_update(); } void func_802E3854(void){ diff --git a/src/core2/code_654C0.c b/src/core2/code_654C0.c index 5ead4413..a57ae508 100644 --- a/src/core2/code_654C0.c +++ b/src/core2/code_654C0.c @@ -215,7 +215,7 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 arg3[3 f32 temp_f0; s32 pad40; - func_8024C5CC(sp74); + viewport_getPosition(sp74); func_8024C5A8(sp68); mlMtxIdent(); func_80252CC4(arg2, arg3, 1.0f, NULL); diff --git a/src/core2/code_6A4B0.c b/src/core2/code_6A4B0.c index 64599b98..3e5a5871 100644 --- a/src/core2/code_6A4B0.c +++ b/src/core2/code_6A4B0.c @@ -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); - func_8024C5CC(spC0); + viewport_getPosition(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; - func_8024C5CC(sp78); + viewport_getPosition(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); diff --git a/src/core2/code_6B030.c b/src/core2/code_6B030.c index 51b643e2..ac530c4b 100644 --- a/src/core2/code_6B030.c +++ b/src/core2/code_6B030.c @@ -67,7 +67,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { s32 width; s32 height; - func_8024C5CC(spDC); + viewport_getPosition(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) { - func_8024C764(sp38); + viewport_getRotation(sp38); mlMtxIdent(); mlMtxRotPitch(-sp38[0]); mlMtxRotYaw(-sp38[1]); diff --git a/src/core2/code_6D270.c b/src/core2/code_6D270.c index 967f39b0..8476014f 100644 --- a/src/core2/code_6D270.c +++ b/src/core2/code_6D270.c @@ -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; - func_8024C5CC(sp38); + viewport_getPosition(sp38); sp44[0] = sp38[0] - sp2C[0]; sp44[2] = sp38[2] - sp2C[2]; sp44[1] = 0.0f; diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index 345730f3..0d217387 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -820,7 +820,7 @@ void func_8028F85C(f32 arg0[3]){ func_8028A8D0(); func_8028B71C(); func_80290B6C(); - func_80291358(); + cameraMode_update(); } void func_8028F8A4(f32 rotation[3]){ diff --git a/src/core2/code_70F20.c b/src/core2/code_70F20.c index a17b7b28..96ba9485 100644 --- a/src/core2/code_70F20.c +++ b/src/core2/code_70F20.c @@ -20,7 +20,7 @@ void func_802F7EB0(struct3s *this){ player_getPosition(plyrPos); func_8024C5A8(camNorm); - func_8024C764(camRot); + viewport_getRotation(camRot); sp50 = vector_pushBackNew(&this->unk20); tmpf = randf2(50.0f, 1100.0f); sp4C[0] = 0.0f; diff --git a/src/core2/code_71820.c b/src/core2/code_71820.c index 379c1ae9..0164dbb9 100644 --- a/src/core2/code_71820.c +++ b/src/core2/code_71820.c @@ -21,7 +21,7 @@ void func_802F87B0(struct6s *this){ player_getPosition(plyrPos); func_8024C5A8(camNorm); - func_8024C764(camRot); + viewport_getRotation(camRot); ptr = vector_pushBackNew(&this->unk1C); f20 = randf2(50.0f, 1200.0f); sp4C[0] = 0.0f; diff --git a/src/core2/code_72060.c b/src/core2/code_72060.c index 4074727e..91af09ad 100644 --- a/src/core2/code_72060.c +++ b/src/core2/code_72060.c @@ -7,7 +7,7 @@ typedef struct { f32 unkC[3]; }Struct_core2_72060_0; -extern f32 func_8024C788(); +extern f32 viewport_getYaw(); extern int func_8024DD34(f32, f32, f32); extern void func_80251B5C(f32, f32, f32); extern void func_80251F8C(f32); @@ -166,7 +166,7 @@ void func_802F919C(void) { } else { var_f20 = 70.0f; } - ml_vec3f_yaw_rotate_copy(sp4C, sp4C, func_8024C788() + randf2(-var_f20, var_f20)); + ml_vec3f_yaw_rotate_copy(sp4C, sp4C, viewport_getYaw() + 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)) { - func_8024C5CC(D_80381050); - func_8024C764(D_80381060); + viewport_getPosition(D_80381050); + viewport_getRotation(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 = func_802EC920(temp_s3); diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index c457ad8d..f525e021 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -384,8 +384,8 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { return; func_8032D3A8(); - func_8024C5CC(sp6C); - func_8024C764(sp54); + viewport_getPosition(sp6C); + viewport_getRotation(sp54); func_80256664(sp54); cube_positionToIndices(sp60, sp6C); sp60[0] -= D_80381FA0.min[0];\ diff --git a/src/core2/code_85800.c b/src/core2/code_85800.c index 39f02ccc..f3dc6043 100644 --- a/src/core2/code_85800.c +++ b/src/core2/code_85800.c @@ -218,7 +218,7 @@ s32 func_8030CDE4(struct45s *arg0){ f32 temp_f0; f32 pad; - func_8024C5CC(&sp44); + viewport_getPosition(&sp44); func_8024C5A8(&sp38); sp2C[0] = arg0->position[0] - sp44[0]; sp2C[1] = arg0->position[1] - sp44[1]; diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index fb9a7b61..b00aa834 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -183,7 +183,7 @@ void func_8031CD44(s32 arg0, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { sp30[0] = sp24[0]; sp30[1] = arg2; sp30[2] = sp24[2]; - func_802BD328(0); + ncDynamicCamera_setUpdateEnabled(0); func_8031CB50(arg0, arg1, 1); func_8028F3D8(sp30, 1.0f, NULL, NULL); } @@ -216,7 +216,7 @@ void func_8031CE70(f32 *arg0, s32 arg1, s32 arg2) { } if (ml_distance_vec3f(arg0, sp38) < phi_f2) { if (phi_s0->unk8 == 0x184) { - func_802BD328(0); + ncDynamicCamera_setUpdateEnabled(0); func_8031CB50(arg1, arg2, 1); func_8028F3D8(sp38, 1.0f, NULL, NULL); } else if (phi_s0->unk8 == 0x185) { diff --git a/src/core2/code_9B180.c b/src/core2/code_9B180.c index 318428ce..8e70782c 100644 --- a/src/core2/code_9B180.c +++ b/src/core2/code_9B180.c @@ -63,7 +63,7 @@ void func_80322130(Struct_core2_9B180_0 *arg0) { } sp1C[1] = D_80383334; func_8028FAB0(sp1C); - func_802BD0D8(6); + ncDynamicCamera_setState(6); } } diff --git a/src/core2/code_9BD0.c b/src/core2/code_9BD0.c index 5eef2d32..6c93ac41 100644 --- a/src/core2/code_9BD0.c +++ b/src/core2/code_9BD0.c @@ -83,7 +83,7 @@ int func_80290D48(void){ if(bsBeeFly_inSet(sp1C) && !func_802BA4D0(func_802B9E48(camera_node_index))){ return FALSE; } - func_802BD0D8(0x11); + ncDynamicCamera_setState(0x11); func_802BF798(camera_node_index); func_80291488(0x9); return TRUE; @@ -91,8 +91,8 @@ int func_80290D48(void){ if(bsBeeFly_inSet(sp1C) && !func_802BA89C(func_802B9E5C(camera_node_index))){ return FALSE; } - func_802BD0D8(0x8); - func_802BF9B8(camera_node_index); + ncDynamicCamera_setState(0x8); + ncDynamicCam8_func_802BF9B8(camera_node_index); func_80291488(0x9); return TRUE; default://L80290E7C @@ -106,7 +106,7 @@ int func_80290E8C(void){ if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER) return FALSE; - func_802BD0D8(3); + ncDynamicCamera_setState(3); func_80291488(0xB); if( map_get() == MAP_B_CC_CLANKERS_CAVERN && player_getYPosition() < 1201.0f @@ -154,13 +154,13 @@ int func_8029105C(s32 arg0){ if(func_80298850()) return FALSE; - if(should_rotate_camera_left() && func_802C1DB0(-45.0f)){ + if(should_rotate_camera_left() && ncDynamicCamA_func_802C1DB0(-45.0f)){ func_80291488(arg0); func_8029103C(); return TRUE; } - if(should_rotate_camera_right() && func_802C1DB0(45.0f)){ + if(should_rotate_camera_right() && ncDynamicCamA_func_802C1DB0(45.0f)){ func_80291488(arg0); func_8029103C(); return TRUE; @@ -171,7 +171,7 @@ int func_8029105C(s32 arg0){ //_camera_mode_1_update void func_80291108(void){ - if(!func_80290D48() && func_802BD0CC() == 0x10){ + if(!func_80290D48() && ncDynamicCamera_getState() == 0x10){ func_80290F14(); func_8029105C(8); } @@ -182,7 +182,7 @@ void func_80291154(void){ int tmp; if(!func_80290D48() && !func_80290E8C()){ if(button_held(BUTTON_R)){ - func_802BD0D8(0x13); + ncDynamicCamera_setState(0x13); func_80291488(0x4); func_80290F14(); } @@ -190,7 +190,7 @@ void func_80291154(void){ tmp = func_8029105C(7); func_80290F14(); if(!tmp) - func_802BD0D8(0xB); + ncDynamicCamera_setState(0xB); } } } @@ -213,7 +213,7 @@ void func_802911E0(void){ void func_80291268(void){ if( !func_80290D48() && !func_80290E8C()){ func_80290F14(); - if(!func_8029105C(7) && func_802C1EE0()){ + if(!func_8029105C(7) && ncDynamicCamA_func_802C1EE0()){ func_80291488(2); } } @@ -223,7 +223,7 @@ void func_80291268(void){ void func_802912D0(void){ if(!func_80290D48()){ func_80290F14(); - if(!func_8029105C(8) && func_802C1EE0()){ + if(!func_8029105C(8) && ncDynamicCamA_func_802C1EE0()){ func_802914CC(0x10); } @@ -238,7 +238,7 @@ void func_80291328(void){ } /* camera update */ -void func_80291358(void){ +void cameraMode_update(void){ func_8029E1A8(7); func_80290298(); func_8029028C(0); @@ -248,7 +248,7 @@ void func_80291358(void){ break; if(D_8037C060){ func_80291488(1); - func_802BD0D8(D_8037C060); + ncDynamicCamera_setState(D_8037C060); } else{ func_80291488(2); @@ -276,7 +276,7 @@ void func_80291358(void){ default://80291438 if(D_8037C060){ func_80291488(1); - func_802BD0D8(D_8037C060); + ncDynamicCamera_setState(D_8037C060); } else{ func_80291154(); @@ -305,13 +305,13 @@ void func_802914CC(s32 arg0){ D_8037C060 = arg0; if(D_8037C062 != 9 && D_8037C062 != 0xa){ func_80291488(1); - func_802BD0D8(arg0); + ncDynamicCamera_setState(arg0); } } void func_8029151C(s32 arg0){ func_80291488(6); - func_802BD0D8(arg0); + ncDynamicCamera_setState(arg0); } void func_80291548(void){ diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index c8924ca5..b34bb5c9 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -309,7 +309,7 @@ Actor *func_80325CAC(ActorMarker *marker, Gfx **gfx, Gfx **mtx, Vtx **vtx) { this->position[1] -= D_8036E58C[1]; this->position[2] -= D_8036E58C[2]; } - func_8024C764(rotation); + viewport_getRotation(rotation); rotation[2] += this->roll; func_80338338(0xFF, 0xFF, 0xFF); if (this->unk124_11 != 0) { diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c index c2f2bd36..24ef9fa2 100644 --- a/src/core2/code_AD5B0.c +++ b/src/core2/code_AD5B0.c @@ -329,7 +329,7 @@ s32 func_80334ECC(void) { func_802F11E8(); func_80288210(); func_80288834(); - func_802BC14C(); + ncCamera_update(); func_803045D8(); func_80332E08(); func_803465E4(); diff --git a/src/core2/code_AEDA0.c b/src/core2/code_AEDA0.c index 2681703a..f27d90f6 100644 --- a/src/core2/code_AEDA0.c +++ b/src/core2/code_AEDA0.c @@ -443,7 +443,7 @@ void func_803380F8(Gfx **gfx, Mtx **mtx, f32 arg2[3]) { f32 sp2C[3]; f32 sp20[3]; - func_8024C5CC(sp2C); + viewport_getPosition(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]; - func_8024C5CC(sp2C); + viewport_getPosition(sp2C); sp20[0] = arg2[0] - sp2C[0]; sp20[1] = arg2[1] - sp2C[1]; sp20[2] = arg2[2] - sp2C[2]; diff --git a/src/core2/code_B7B20.c b/src/core2/code_B7B20.c index 0520db10..9ad2a674 100644 --- a/src/core2/code_B7B20.c +++ b/src/core2/code_B7B20.c @@ -11,29 +11,29 @@ void func_8033EAB0(s32 arg0[3], s32 arg1[3], s32 arg2[3], s32 arg3[3]) { } } -s32 func_8033EAF8(s32 arg0[3], s32 arg1[3], f32 arg2[3], f32 arg3[3]) { - f32 sp14[3]; - f32 temp_f2; - f32 var_f0; - s32 var_a0; - s32 var_v0; - s32 var_v1; +s32 func_8033EAF8(s32 min_coord[3], s32 max_coord[3], f32 position[3], f32 arg3[3]) { + f32 dCorner[3]; + f32 dot_product; + f32 max; + s32 ix; + s32 iy; + s32 iz; - var_f0 = 0.0f; - for(var_v0 = 0; var_v0 < 2; var_v0++){ - for(var_v1 = 0; var_v1 < 2; var_v1++){ - for(var_a0 = 0; var_a0 < 2; var_a0++){ - sp14[0] = (f32)((var_v0) ? arg0[0] : arg1[0]) - arg2[0]; - sp14[1] = (f32)((var_v1) ? arg0[1] : arg1[1]) - arg2[1]; - sp14[2] = (f32)((var_a0) ? arg0[2] : arg1[2]) - arg2[2]; - temp_f2 = (arg3[0] * sp14[0]) + (arg3[1] * sp14[1]) + (arg3[2] * sp14[2]); - if (var_f0 < temp_f2) { - var_f0 = temp_f2; + max = 0.0f; + for(ix = 0; ix < 2; ix++){ + for(iy = 0; iy < 2; iy++){ + for(iz = 0; iz < 2; iz++){ + dCorner[0] = ((ix) ? min_coord[0] : max_coord[0]) - position[0]; + dCorner[1] = ((iy) ? min_coord[1] : max_coord[1]) - position[1]; + dCorner[2] = ((iz) ? min_coord[2] : max_coord[2]) - position[2]; + dot_product = (arg3[0] * dCorner[0]) + (arg3[1] * dCorner[1]) + (arg3[2] * dCorner[2]); + if (max < dot_product) { + max = dot_product; } } } } - return (s32) var_f0; + return (s32) max; } bool func_8033EC10(s32 arg0[3], s32 arg1[3], s32 arg2[3]) { diff --git a/src/core2/code_B8860.c b/src/core2/code_B8860.c index aa55c902..b6a474aa 100644 --- a/src/core2/code_B8860.c +++ b/src/core2/code_B8860.c @@ -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; - func_8024C5CC(sp3C); + viewport_getPosition(sp3C); ml_vec3f_diff_copy(sp30, sp48, sp3C); if(sp54->unk28_12){ func_80251BCC(func_8024DD90()); diff --git a/src/core2/code_BD100.c b/src/core2/code_BD100.c index 98bdc7c3..d6570418 100644 --- a/src/core2/code_BD100.c +++ b/src/core2/code_BD100.c @@ -51,7 +51,7 @@ void func_80344138(BKSpriteDisplayData *self, s32 frame, s32 mirrored, f32 posit f32 sp38; f32 sp34; - func_8024C5CC(sp6C); + viewport_getPosition(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; - func_8024C5CC(sp6C); + viewport_getPosition(sp6C); func_8024C5A8(sp60); sp50[0] = position[0] - sp6C[0]; sp50[1] = position[1] - sp6C[1]; @@ -167,7 +167,7 @@ void func_80344720(BKSpriteDisplayData *arg0, s32 frame, bool mirrored, f32 posi f32 var_f14; BKSpriteFrameDisplayData *temp_a3; - func_8024C5CC(sp5C); + viewport_getPosition(sp5C); func_8024C5A8(sp50); sp40[0] = position[0] - sp5C[0]; sp40[1] = position[1] - sp5C[1]; diff --git a/src/core2/code_BEF20.c b/src/core2/code_BEF20.c index 6c0b3941..41f8410b 100644 --- a/src/core2/code_BEF20.c +++ b/src/core2/code_BEF20.c @@ -233,7 +233,7 @@ void func_803465E4(void){ if(func_80334904() != 2) return; if(D_80385FE8){ - if( func_802BC248() != 3 + if( ncCamera_getType() != 3 //CAMERA_TYPE_3_STATIC && func_8028F070() && map_get() != MAP_33_UNUSED && map_get() != MAP_91_FILE_SELECT diff --git a/src/core2/code_C97F0.c b/src/core2/code_C97F0.c index ebf483fe..b568052a 100644 --- a/src/core2/code_C97F0.c +++ b/src/core2/code_C97F0.c @@ -3,7 +3,7 @@ #include "variables.h" extern bool func_8028F170(f32, f32); -extern void func_8024C5CC(f32[3]); +extern void viewport_getPosition(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) { - func_8024C5CC(spDC); - func_8024C764(spD0); + viewport_getPosition(spDC); + viewport_getRotation(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) { - func_8024C5CC(sp54); + viewport_getPosition(sp54); sp48[0] = D_80386170.unk4->unk4[0]; sp48[1] = D_80386170.unk4->unk4[1]; sp48[2] = D_80386170.unk4->unk4[2]; diff --git a/src/core2/code_E910.c b/src/core2/code_E910.c index d05bfc2c..822fcf71 100644 --- a/src/core2/code_E910.c +++ b/src/core2/code_E910.c @@ -309,7 +309,7 @@ void func_80295C14(void){ func_8029D968(); func_80297CF8(); func_80294E60(); - func_80291358();//camera_update + cameraMode_update(); func_802919A0(); if(D_8037C3B0){ D_8037C3B0(); diff --git a/src/core2/code_F8EAF0.c b/src/core2/code_F8EAF0.c new file mode 100644 index 00000000..768e7980 --- /dev/null +++ b/src/core2/code_F8EAF0.c @@ -0,0 +1,97 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BD51C(void); + + +void func_802C0150(s32 arg0); + +/* .bss */ +u8 D_8037DB40; +f32 D_8037DB48[3]; +f32 D_8037DB58[3]; + +/* .code */ +void func_802C0120(void){ + D_8037DB40 = 0; + func_802C0150(2); +} + +void func_802C0148(void){} + +void func_802C0150(s32 arg0) { + D_8037DB40 = arg0; + if (arg0 == 6) { + func_802BD4C0(D_8037DB48); + ml_vec3f_clear(D_8037DB58); + } +} + +s32 func_802C0190(void){ + return D_8037DB40; +} + +void func_802C019C(f32 arg0[3]){ + func_802BD3CC(arg0); +} + +void func_802C01BC(f32 arg0[3]){ + func_802BD4C0(arg0); +} + +void func_802C01DC(f32 arg0[3]) { + f32 sp1C[3]; + + func_8028E7EC(sp1C); + player_getPosition(arg0); + arg0[0] = sp1C[0]; + arg0[1] += 90.0f; + arg0[2] = sp1C[2]; +} + +void func_802C0234(f32 arg0[3]) { + player_getPosition(arg0); + arg0[1] += 60.0f; +} + +void func_802C026C(f32 arg0[3]) { + f32 sp1C[3]; + + func_802BD4C0(arg0); + player_getPosition(sp1C); + arg0[1] = sp1C[1]; + arg0[1] += 60.0f; +} + +void func_802C02B4(f32 arg0[3]){ + func_802BD4C0(arg0); +} + +void func_802C02D4(f32 arg0[3]) { + switch(D_8037DB40){ + case 1: + func_802C019C(arg0); + break; + + case 2: + func_802C01BC(arg0); + break; + + case 3: + func_802C01DC(arg0); + break; + + case 4: + func_802C0234(arg0); + break; + + case 5: + func_802C026C(arg0); + break; + + case 6: + func_802C02B4(arg0); + break; + } +} \ No newline at end of file diff --git a/src/core2/code_BB50.c b/src/core2/eggshatter.c similarity index 100% rename from src/core2/code_BB50.c rename to src/core2/eggshatter.c diff --git a/src/core2/gc/parade.c b/src/core2/gc/parade.c index a21cc2cb..cbecc8dd 100644 --- a/src/core2/gc/parade.c +++ b/src/core2/gc/parade.c @@ -356,8 +356,8 @@ void gcparade_init(void) { var_s2 = FALSE; D_803830F0.unk5 = 0; if(D_803830F0.parade_element->exit >= 0) { - func_802BBC58(1); - set_camera_to_node(D_803830F0.parade_element->exit); + camera_setType(1); + ncStaticCamera_setToNode(D_803830F0.parade_element->exit); if (D_803830F0.parade_element->unk8 > 0) { temp_v0 = func_80304FC4(&D_8036DDAC, &D_80383100, 0x14); for(var_s0 = 0;(var_s0 < temp_v0) && !var_s2; var_s0++ ){ @@ -369,7 +369,7 @@ void gcparade_init(void) { } } if (!var_s2) { - func_802BAEF4(sp40); + ncStaticCamera_getPosition(sp40); func_8028F85C(sp40); } } diff --git a/src/core2/gc/pauseMenu.c b/src/core2/gc/pauseMenu.c index 7588a1ee..0b9de21b 100644 --- a/src/core2/gc/pauseMenu.c +++ b/src/core2/gc/pauseMenu.c @@ -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); - func_8024C5CC(sp50); + viewport_getPosition(sp50); sp34 = func_8024DE1C(x, y, sp5C, sp44); mlMtxIdent(); //matrix_stack_identity @@ -1337,9 +1337,9 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { sp8C[0] = 0.0f; sp8C[1] = 0.0f; sp8C[2] = 0.0f; - func_8024CD88(sp98); - func_8024CE18(sp8C); - func_8024CFD4(); + viewport_setPosition(sp98); + viewport_setRotation(sp8C); + viewport_update(); func_8024C904(gfx, mtx); sp98[0] = 0.0f; sp98[1] = 0.0f; @@ -1382,9 +1382,9 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { sp8C[1] = 0.0f; sp8C[2] = 0.0f; - func_8024CD88(sp98); - func_8024CE18(sp8C); - func_8024CFD4(); + viewport_setPosition(sp98); + viewport_setRotation(sp8C); + viewport_update(); func_8024C904(gfx, mtx); sp98[0] = 0.0f; diff --git a/src/core2/gc/sky.c b/src/core2/gc/sky.c index 1647c8cd..8a3e1199 100644 --- a/src/core2/gc/sky.c +++ b/src/core2/gc/sky.c @@ -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); - func_8024C5CC(position); + viewport_getPosition(position); for(i = 0; i < 3; i++){ iAsset = gcSky.model_bins[i]; if(iAsset){ diff --git a/src/core2/gc/transition.c b/src/core2/gc/transition.c index a1afddf7..59bb88a8 100644 --- a/src/core2/gc/transition.c +++ b/src/core2/gc/transition.c @@ -211,9 +211,9 @@ void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){ sp68[1] = 0.0f; sp68[2] = 0.0f; func_8024CE60(D_8036C440, D_8036C444); - func_8024CD88(sp74); //camera_setPosition - func_8024CE18(sp68); //camera_setRotation - func_8024CFD4(); //camera_updateNormal + viewport_setPosition(sp74); //viewport_getPosition + viewport_setRotation(sp68); //viewport_getRotation + viewport_update(); //camera_updateNormal func_8024C904(gdl, mptr); sp58[0] = 0.0f; diff --git a/src/core2/modelRender.c b/src/core2/modelRender.c index b28dd5d2..beabb569 100644 --- a/src/core2/modelRender.c +++ b/src/core2/modelRender.c @@ -9,11 +9,11 @@ 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 func_8024C5CC(f32[3]); -extern void func_8024C764(f32[3]); -extern void func_8024CD88(f32[3]); -extern void func_8024CE18(f32[3]); -extern void func_8024CFD4(void); +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 viewport_update(void); extern void func_8033BD4C(BKModelBin *); extern s32 func_8024DB50(f32[3], f32); extern void func_80251788(f32, f32, f32); @@ -695,9 +695,9 @@ void modelRender_reset(void){ func_8033A45C(1,1); func_8033A45C(2,0); if(D_80383758.unk18){ - func_8024CD88(D_80383758.unk1C); - func_8024CE18(D_80383758.unk28); - func_8024CFD4(); + viewport_setPosition(D_80383758.unk1C); + viewport_setRotation(D_80383758.unk28); + viewport_update(); } } @@ -1033,8 +1033,8 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation } D_80370990 = 0; - func_8024C5CC(modelRenderCameraPosition); - func_8024C764(modelRenderCameraRotation); + viewport_getPosition(modelRenderCameraPosition); + viewport_getRotation(modelRenderCameraRotation); if(D_80383758.unk18){ D_80383758.unk1C[0] = modelRenderCameraPosition[0]; D_80383758.unk1C[1] = modelRenderCameraPosition[1]; @@ -1074,9 +1074,9 @@ 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]; - func_8024CD88(modelRenderCameraPosition); - func_8024CE18(modelRenderCameraRotation); - func_8024CFD4(); + viewport_setPosition(modelRenderCameraPosition); + viewport_setRotation(modelRenderCameraRotation); + viewport_update(); camera_focus[0] = object_position[0] - modelRenderCameraPosition[0]; camera_focus[1] = object_position[1] - modelRenderCameraPosition[1]; camera_focus[2] = object_position[2] - modelRenderCameraPosition[2]; @@ -1418,8 +1418,8 @@ void func_8033A28C(bool arg0){ void func_8033A298(bool arg0){ D_80383758.unk18 = arg0; if(arg0){ - func_8024C5CC(D_80383758.unk0); - func_8024C764(D_80383758.unkC); + viewport_getPosition(D_80383758.unk0); + viewport_getRotation(D_80383758.unkC); } } diff --git a/src/core2/nc/cameranodelist.c b/src/core2/nc/cameranodelist.c index 1041f01a..31a4d3e8 100644 --- a/src/core2/nc/cameranodelist.c +++ b/src/core2/nc/cameranodelist.c @@ -92,7 +92,7 @@ void func_802B9EBC(s32 camera_node_index, s32 arg1){ func_802BA76C(ncCameraNodeList[camera_node_index].data_ptr); break; case 2:// L802B9F38 - func_802BAA88(ncCameraNodeList[camera_node_index].data_ptr); + ncCameraNodeType2_free(ncCameraNodeList[camera_node_index].data_ptr); break; case 0:// L802B9F40 break; @@ -112,7 +112,7 @@ void func_802B9EBC(s32 camera_node_index, s32 arg1){ ncCameraNodeList[camera_node_index].data_ptr = func_802BA6D4(); break; case 2:// L802B9FB0 - ncCameraNodeList[camera_node_index].data_ptr = func_802BAA40(); + ncCameraNodeList[camera_node_index].data_ptr = ncCameraNodeType2_new(); break; case 0:// L802B9FBC break; @@ -136,7 +136,7 @@ void __ncCameraNodeList_nodeFromFile(Struct61s *file_ptr, s32 arg1){ func_802BA93C(file_ptr, func_802B9E5C(arg1)); break; case 2:// L802BA084 - func_802BAB3C(file_ptr, func_802B9E70(arg1)); + ncCameraNodeType2_fromFile(file_ptr, func_802B9E70(arg1)); break; case 0:// L802BA098 break; diff --git a/src/core2/nc/dynamicCam1.c b/src/core2/nc/dynamicCam1.c new file mode 100644 index 00000000..1714290e --- /dev/null +++ b/src/core2/nc/dynamicCam1.c @@ -0,0 +1,47 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80259198(f32, f32); +extern f32 func_802BD51C(void); +extern f32 player_getYaw(void); +extern void func_802BD870(f32, f32, f32, f32); + +void ncDynamicCam1_init(void){ + func_802BD870(12.0f, 10.0f, 120.0f, 120.0f); +} + +void ncDynamicCam1_end(void){} + +void ncDynamicCam1_update(void) { + f32 sp8C[3]; + f32 sp80[3]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp4C; + f32 sp48; + f32 temp_f20; + f32 sp40; + f32 sp3C; + + ncDynamicCamera_getPosition(sp74); + func_802BD4C0(sp8C); + sp3C = func_802BD8D4(); + temp_f20 = time_getDelta(); + ml_vec3f_diff_copy(sp50, sp74, sp8C); + sp4C = gu_sqrtf((sp50[0] * sp50[0]) + (sp50[2] * sp50[2])); + sp4C += func_80259198((sp3C - sp4C) * temp_f20 * 2, temp_f20 * 120.0f); + func_8025801C(sp50, &sp48); + sp40 = func_80259198(mlDiffDegF(mlNormalizeAngle(180.0f + player_getYaw()), sp48) * (temp_f20 * 1), temp_f20 * 50.0f); + sp48 = mlNormalizeAngle(sp48 + sp40); + func_80256E24(sp68, 0.0f, sp48, 0.0f, 0.0f, sp4C); + ml_vec3f_add(sp80, sp8C, sp68); + sp80[1] = sp74[1] + ((func_802BD51C() - sp74[1]) * temp_f20 * 2); + ncDynamicCamera_setPosition(sp80); + func_8025727C(sp8C[0], sp8C[1], sp8C[2], sp80[0], sp80[1], sp80[2], &sp5C[0], &sp5C[1]); + sp5C[0] = -sp5C[0]; + sp5C[2] = 0.0f; + func_802BD720(sp5C); +} diff --git a/src/core2/code_38150.c b/src/core2/nc/dynamicCam10.c similarity index 87% rename from src/core2/code_38150.c rename to src/core2/nc/dynamicCam10.c index d8c8bd43..f65676c9 100644 --- a/src/core2/code_38150.c +++ b/src/core2/nc/dynamicCam10.c @@ -21,22 +21,22 @@ void func_802BF12C(void){ f32 sp28[3]; f32 sp1C[3]; - func_802BD384(sp34); + ncDynamicCamera_getPosition(sp34); func_802BF0E0(sp1C); ml_vec3f_diff_copy(sp28, sp34, sp1C); func_8025801C(sp28, &D_8037DAA0); } -void func_802BF174(void){ +void ncDynamicCam10_init(void){ func_802BE244(4.0f, 16.0f); func_802BE230(1.1f, 14.0f); func_802C0150(3); func_802BF12C(); } -void func_802BF1CC(void){} +void ncDynamicCam10_end(void){} -void func_802BF1D4(void){ +void ncDynamicCam10_update(void){ f32 sp5C[3]; f32 sp50[3]; f32 sp44[3]; diff --git a/src/core2/code_38630.c b/src/core2/nc/dynamicCam11.c similarity index 91% rename from src/core2/code_38630.c rename to src/core2/nc/dynamicCam11.c index 14beca18..ac325890 100644 --- a/src/core2/code_38630.c +++ b/src/core2/nc/dynamicCam11.c @@ -16,14 +16,14 @@ f32 D_8037DAE8; f32 D_8037DAEC; /* .code */ -void func_802BF5C0(void){ +void ncDynamicCam11_init(void){ D_8037DAE5 = TRUE; func_802C0150(1); } -void func_802BF5EC(void){} +void ncDynamicCam11_end(void){} -void func_802BF5F4(void) { +void ncDynamicCam11_update(void) { f32 sp64[3]; f32 sp58[3]; f32 sp4C[3]; @@ -35,7 +35,7 @@ void func_802BF5F4(void) { if (D_8037DAE5 == 0) { func_802C02D4(sp64); - func_802BD384(sp58); + ncDynamicCamera_getPosition(sp58); ml_vec3f_diff_copy(sp24, sp58, sp64); sp24[1] = 0.0f; sp20 = gu_sqrtf( sp24[0]*sp24[0] + sp24[2]*sp24[2] ); @@ -59,7 +59,7 @@ void func_802BF5F4(void) { if (D_8037DAE4) { func_802BE60C(); } - func_802BD384(sp58); + ncDynamicCamera_getPosition(sp58); func_802BC434(sp4C, sp64, sp58); func_802BC434(sp40, sp64, D_8037DAD0); if (sp30 < 150.0f) { diff --git a/src/core2/code_39EF0.c b/src/core2/nc/dynamicCam12.c similarity index 72% rename from src/core2/code_39EF0.c rename to src/core2/nc/dynamicCam12.c index 6acf5100..38a4db66 100644 --- a/src/core2/code_39EF0.c +++ b/src/core2/nc/dynamicCam12.c @@ -34,7 +34,6 @@ struct { u8 unk2E; u8 unk2F; }D_8037DBE0; -f32 D_8037DC10; /* .code */ bool __is_flying_in_FP(void){ @@ -62,14 +61,14 @@ void func_802C0F4C(void){ func_802C0EE4(); } -void func_802C0F6C(void){ +void dynamicCam12_init(void){ func_802C0150(4); func_802BE244(5.0f, 10.0f); func_802BE230(3.0f, 8.0f); func_802BD82C(100.0f, 100.0f); } -void func_802C0FCC(void){ +void ncDynamicCam12_end(void){ func_802C0EE4(); func_802BD840(); } @@ -176,7 +175,7 @@ s32 func_802C11C8(f32 arg0[3]) { return 2; } -void func_802C14E0(void) { +void ncDynamicCam12_update(void) { f32 sp5C[3]; f32 sp50[3]; f32 sp4C; @@ -187,7 +186,7 @@ void func_802C14E0(void) { if (D_8037DBE0.unk2C == 1) { D_8037DBE0.unk2C = 2; } - func_802BD384(sp40); + ncDynamicCamera_getPosition(sp40); if ((D_8037DBE0.unk28 == -1) || (func_802C11C8(sp40) == 0) || __is_flying_in_FP()) { D_8037DBE0.unk28 = 0; return; @@ -202,7 +201,7 @@ void func_802C14E0(void) { ml_vec3f_add(sp40, D_8037DBE0.unkC, sp50); } } - func_802BD334(sp40); + ncDynamicCamera_setPosition(sp40); func_802C02D4(sp5C); func_802BE6FC(sp34, sp5C); func_802BD904(sp34); @@ -253,8 +252,8 @@ void func_802C16CC(s32 arg0) { D_8037DBE0.unk2F = 1; break; } - D_8037DBE0.unk2D = func_802BD0CC(); - func_802BD384(sp3C); + D_8037DBE0.unk2D = ncDynamicCamera_getState(); + ncDynamicCamera_getPosition(sp3C); ml_vec3f_copy(D_8037DBE0.unkC, sp3C); D_8037DBE0.unk18 = 0.0f; D_8037DBE0.unk28 = sp38; @@ -264,7 +263,7 @@ void func_802C16CC(s32 arg0) { D_8037DBE0.unk2C = 1; func_80323240(func_802C0EC0(), D_8037DBE0.unk8, D_8037DBE0.unk1C); if (func_802C11C8(D_8037DBE0.unk1C) == 1) { - func_802BD0D8(0x12); + ncDynamicCamera_setState(0x12); func_80291488(0xA); return; } @@ -278,95 +277,3 @@ void func_802C16CC(s32 arg0) { bool func_802C189C(void){ return D_8037DBE0.unk28 < 1; } - -void func_802C18B0(void){ - func_802BD870(12.0f, 10.0f, 120.0f, 120.0f); -} - -void func_802C18F0(void){} - -void func_802C18F8(void) { - f32 sp8C[3]; - f32 sp80[3]; - f32 sp74[3]; - f32 sp68[3]; - f32 sp5C[3]; - f32 sp50[3]; - f32 sp4C; - f32 sp48; - f32 temp_f20; - f32 sp40; - f32 sp3C; - - func_802BD384(sp74); - func_802BD4C0(sp8C); - sp3C = func_802BD8D4(); - temp_f20 = time_getDelta(); - ml_vec3f_diff_copy(sp50, sp74, sp8C); - sp4C = gu_sqrtf((sp50[0] * sp50[0]) + (sp50[2] * sp50[2])); - sp4C += func_80259198((sp3C - sp4C) * temp_f20 * 2, temp_f20 * 120.0f); - func_8025801C(sp50, &sp48); - sp40 = func_80259198(mlDiffDegF(mlNormalizeAngle(180.0f + player_getYaw()), sp48) * (temp_f20 * 1), temp_f20 * 50.0f); - sp48 = mlNormalizeAngle(sp48 + sp40); - func_80256E24(sp68, 0.0f, sp48, 0.0f, 0.0f, sp4C); - ml_vec3f_add(sp80, sp8C, sp68); - sp80[1] = sp74[1] + ((func_802BD51C() - sp74[1]) * temp_f20 * 2); - func_802BD334(sp80); - func_8025727C(sp8C[0], sp8C[1], sp8C[2], sp80[0], sp80[1], sp80[2], &sp5C[0], &sp5C[1]); - sp5C[0] = -sp5C[0]; - sp5C[2] = 0.0f; - func_802BD720(sp5C); -} - -void func_802C1AD0(void){} - -void func_802C1AD8(void){ - func_802BD870(10.0f, 20.0f, 120.0f, 200.0f); - func_802C0150(4); - D_8037DC10 = 600.0f; -} - -void func_802C1B20(f32 arg0){ - D_8037DC10 = arg0; -} - -void func_802C1B2C(void) { - f32 sp7C[3]; - f32 sp70[3]; - f32 sp64[3]; - f32 sp58[3]; - f32 sp4C[3]; - f32 sp40[3]; - f32 sp3C; - f32 sp38; - f32 sp34; - f32 sp30; - - - func_802BD384(sp64); - sp34 = D_8037DC10; - func_802C02D4(sp7C); - sp30 = time_getDelta(); - if (sp30); - ml_vec3f_diff_copy(sp40, sp64, sp7C); - sp3C = gu_sqrtf(sp40[0]*sp40[0] + sp40[2]*sp40[2]); - sp3C += func_80259198(sp30*(sp34 - sp3C)*2 , sp30 * 800.0f); - func_8025727C(sp7C[0], sp7C[1], sp7C[2], sp64[0], sp64[1], sp64[2], &sp4C[0], &sp4C[1]); - sp40[1] = sp30 * 0.77 * mlDiffDegF(mlNormalizeAngle(player_getYaw() + 180.0f), sp4C[1]); - sp40[1] = func_80259198(sp40[1], sp30 * 300.0f); - sp4C[1] = mlNormalizeAngle(sp4C[1] + sp40[1]); - func_80256E24(&sp58, 0.0f, sp4C[1], 0.0f, 0.0f, sp3C); - sp70[0] = sp7C[0] + sp58[0]; - sp70[1] = sp64[1]; - sp70[2] = sp7C[2] + sp58[2]; - sp40[1] = sp7C[1] - sp64[1]; - if (mlAbsF(sp40[1]) > 200.0f) { - sp70[1] = sp64[1] - ((sp40[1] > 0.0f) ? sp30 * (200.0f - sp40[1]) * 2 : sp30 * (-200.0f - sp40[1]) * 2); - } - func_802BD334(sp70); - if (func_802BE60C()) { - func_802BC84C(0); - } - func_802BE6FC(sp4C, sp7C); - func_802BD720(sp4C); -} diff --git a/src/core2/code_396B0.c b/src/core2/nc/dynamicCam13.c similarity index 86% rename from src/core2/code_396B0.c rename to src/core2/nc/dynamicCam13.c index 7fc1ec04..0798d448 100644 --- a/src/core2/code_396B0.c +++ b/src/core2/nc/dynamicCam13.c @@ -21,14 +21,14 @@ bool func_802C0640(void){ return mlAbsF(mlDiffDegF(D_8037DBA4, D_8037DBA8)) < 4.0; } -void func_802C0694(void){} +void ncDynamicCam13_end(void){} void func_802C069C(void) { f32 sp34[3]; f32 sp28[3]; f32 sp1C[3]; - func_802BD384(sp34); + ncDynamicCamera_getPosition(sp34); func_802C02D4(sp1C); ml_vec3f_diff_copy(sp28, sp34, sp1C); D_8037DBA0 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]); @@ -36,7 +36,7 @@ void func_802C069C(void) { D_8037DBAC = 0.0f; } -void func_802C0710(void) { +void ncDynamicCam13_init(void) { func_802BE230(5.0f, 8.0f); func_802BE244(8.0f, 15.0f); func_802C0150(6); @@ -49,7 +49,7 @@ f32 func_802C0780(void){ return func_802BD51C(); } -void func_802C07A0(void) { +void ncDynamicCam13_update(void) { f32 sp84[3]; f32 sp78[3]; f32 sp6C[3]; @@ -61,7 +61,7 @@ void func_802C07A0(void) { f32 sp34[3]; f32 sp28[3]; - func_802BD384(sp54); + ncDynamicCamera_getPosition(sp54); func_802C02D4(sp84); sp44 = time_getDelta(); func_802BDB30(D_8037DBA4, &D_8037DBA8, &D_8037DBAC, 800.0f, 160.0f, 100.0f); @@ -71,17 +71,17 @@ void func_802C07A0(void) { func_80256E24(sp60, 0.0f, D_8037DBA8, 0.0f, 0.0f, sp40); ml_vec3f_add(sp78, sp84, sp60); sp78[1] = sp54[1] + (func_802C0780() - sp54[1]) * sp44 * 2; - func_802BD334(sp78); + ncDynamicCamera_setPosition(sp78); if (func_802BE60C() && func_802BC84C(0)) { func_802C069C(); } func_802BE6FC(sp48, sp84); - func_802BD3A8(sp34); + ncDynamicCamera_getRotation(sp34); sp28[0] = mlDiffDegF(sp48[0], sp34[0]); sp28[1] = mlDiffDegF(sp48[1], sp34[1]); sp28[2] = 0.0f; sp48[0] = sp34[0] + (sp28[0] * sp44 * 4); - func_802BD35C(sp48); + ncDynamicCamera_setRotation(sp48); } void func_802C095C(void){ diff --git a/src/core2/nc/dynamicCam3.c b/src/core2/nc/dynamicCam3.c new file mode 100644 index 00000000..a89d634d --- /dev/null +++ b/src/core2/nc/dynamicCam3.c @@ -0,0 +1,62 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80259198(f32, f32); +extern f32 player_getYaw(void); +extern void func_802BD870(f32, f32, f32, f32); + +f32 D_8037DC10; + +void ncDynamicCam3_end(void){} + +void ncDynamicCam3_init(void){ + func_802BD870(10.0f, 20.0f, 120.0f, 200.0f); + func_802C0150(4); + D_8037DC10 = 600.0f; +} + +void func_802C1B20(f32 arg0){ + D_8037DC10 = arg0; +} + +void ncDynamicCam3_update(void) { + f32 sp7C[3]; + f32 sp70[3]; + f32 sp64[3]; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp30; + + + ncDynamicCamera_getPosition(sp64); + sp34 = D_8037DC10; + func_802C02D4(sp7C); + sp30 = time_getDelta(); + if (sp30); + ml_vec3f_diff_copy(sp40, sp64, sp7C); + sp3C = gu_sqrtf(sp40[0]*sp40[0] + sp40[2]*sp40[2]); + sp3C += func_80259198(sp30*(sp34 - sp3C)*2 , sp30 * 800.0f); + func_8025727C(sp7C[0], sp7C[1], sp7C[2], sp64[0], sp64[1], sp64[2], &sp4C[0], &sp4C[1]); + sp40[1] = sp30 * 0.77 * mlDiffDegF(mlNormalizeAngle(player_getYaw() + 180.0f), sp4C[1]); + sp40[1] = func_80259198(sp40[1], sp30 * 300.0f); + sp4C[1] = mlNormalizeAngle(sp4C[1] + sp40[1]); + func_80256E24(&sp58, 0.0f, sp4C[1], 0.0f, 0.0f, sp3C); + sp70[0] = sp7C[0] + sp58[0]; + sp70[1] = sp64[1]; + sp70[2] = sp7C[2] + sp58[2]; + sp40[1] = sp7C[1] - sp64[1]; + if (mlAbsF(sp40[1]) > 200.0f) { + sp70[1] = sp64[1] - ((sp40[1] > 0.0f) ? sp30 * (200.0f - sp40[1]) * 2 : sp30 * (-200.0f - sp40[1]) * 2); + } + ncDynamicCamera_setPosition(sp70); + if (func_802BE60C()) { + func_802BC84C(0); + } + func_802BE6FC(sp4C, sp7C); + func_802BD720(sp4C); +} diff --git a/src/core2/code_38AD0.c b/src/core2/nc/dynamicCam4.c similarity index 81% rename from src/core2/code_38AD0.c rename to src/core2/nc/dynamicCam4.c index 71bf4eaf..0400100e 100644 --- a/src/core2/code_38AD0.c +++ b/src/core2/nc/dynamicCam4.c @@ -7,8 +7,8 @@ extern f32 player_getYaw(void); extern f32 player_getPitch(void); extern void func_802BD870(f32, f32, f32, f32); -void func_802BFE50(f32 arg0, f32 arg1, f32 arg2); -void func_802BFE74(bool); +void ncDynamicCam4_func_802BFE50(f32 arg0, f32 arg1, f32 arg2); +void ncDynamicCam4_func_802BFE74(bool); /* .bss */ f32 D_8037DB10; @@ -18,19 +18,19 @@ f32 D_8037DB1C; f32 D_8037DB20; /* .code */ -void func_802BFA60(void) { +void ncDynamicCam4_init(void) { func_802BD870(10.0f, 20.0f, 120.0f, 200.0f); if (map_get() == MAP_90_GL_BATTLEMENTS) { - func_802BFE50(10.0f, 800.0f, 1350.0f); + ncDynamicCam4_func_802BFE50(10.0f, 800.0f, 1350.0f); } else { - func_802BFE50(2.0f, 800.0f, 350.0f); + ncDynamicCam4_func_802BFE50(2.0f, 800.0f, 350.0f); } - func_802BFE74(0); + ncDynamicCam4_func_802BFE74(0); } -void func_802BFAE8(void){} +void ncDynamicCam4_end(void){} -void func_802BFAF0(void) { +void ncDynamicCam4_update(void) { f32 sp84[3]; f32 sp78[3]; f32 sp6C[3]; @@ -43,7 +43,7 @@ void func_802BFAF0(void) { f32 sp38; f32 sp34; - func_802BD384(sp6C); + ncDynamicCamera_getPosition(sp6C); func_802BD4C0(sp84); sp84[1] += 40.0f; sp34 = player_getPitch(); @@ -75,20 +75,20 @@ void func_802BFAF0(void) { func_80256E24(sp60, -sp54[0], sp54[1], 0.0f, 0.0f, sp44); ml_vec3f_add(sp78, sp84, sp60); - func_802BD334(sp78); + ncDynamicCamera_setPosition(sp78); func_8025727C(sp84[0], sp84[1], sp84[2], sp78[0], sp78[1], sp78[2], &sp54[0], &sp54[1]); sp54[0] = -sp54[0]; sp54[2] = 0.0f; func_802BD720(sp54); } -void func_802BFE50(f32 arg0, f32 arg1, f32 arg2){ +void ncDynamicCam4_func_802BFE50(f32 arg0, f32 arg1, f32 arg2){ D_8037DB10 = arg0; D_8037DB14 = arg1; D_8037DB18 = arg2; } -void func_802BFE74(bool arg0) { +void ncDynamicCam4_func_802BFE74(bool arg0) { if (arg0) { D_8037DB1C = 6.0f; D_8037DB20 = 270.0f; diff --git a/src/core2/code_38460.c b/src/core2/nc/dynamicCam5.c similarity index 81% rename from src/core2/code_38460.c rename to src/core2/nc/dynamicCam5.c index bacf20f1..8e9875cc 100644 --- a/src/core2/code_38460.c +++ b/src/core2/nc/dynamicCam5.c @@ -7,16 +7,16 @@ f32 D_8037DAB0[3]; f32 D_8037DABC; /* .code */ -void func_802BF3F0(void) { +void ncDynamicCam5_init(void) { func_802BE244(5.0f, 10.0f); func_802BE230(5.0f, 8.0f); ml_vec3f_clear(D_8037DAB0); D_8037DABC = 0.0f; } -void func_802BF44C(void){} +void ncDynamicCam5_end(void){} -void func_802BF454(void) { +void ncDynamicCam5_update(void) { f32 sp74[3]; f32 sp68[3]; f32 sp5C[3]; @@ -26,7 +26,7 @@ void func_802BF454(void) { s32 pad34; f32 sp30; - func_802BD384(sp44); + ncDynamicCamera_getPosition(sp44); player_getPosition(sp74); sp74[1] += 60.0f; ml_vec3f_diff_copy(sp5C, sp44, sp74); @@ -35,13 +35,13 @@ void func_802BF454(void) { ml_vec3f_scale_copy(sp50, D_8037DAB0, sp30); ml_vec3f_diff_copy(sp68, sp74, sp50); func_802BE190(sp68); - func_802BD384(sp68); + ncDynamicCamera_getPosition(sp68); func_8025727C(sp74[0], sp74[1], sp74[2], sp68[0], sp68[1], sp68[2], &sp38[0], &sp38[1]); sp38[0] = -sp38[0]; sp38[2] = 0.0f; func_802BD904(sp38); } -void func_802BF590(f32 arg0[3]){ +void ncDynamicCam5_func_802BF590(f32 arg0[3]){ ml_vec3f_normalize_copy(D_8037DAB0, arg0); } diff --git a/src/core2/code_388E0.c b/src/core2/nc/dynamicCam8.c similarity index 86% rename from src/core2/code_388E0.c rename to src/core2/nc/dynamicCam8.c index a5654504..b3f2de07 100644 --- a/src/core2/code_388E0.c +++ b/src/core2/nc/dynamicCam8.c @@ -13,13 +13,13 @@ u8 D_8037DB0D; u8 D_8037DB0E; /* .code */ -void func_802BF870(void){ +void ncDynamicCam8_init(void){ D_8037DB0E = TRUE; } -void func_802BF880(void){} +void ncDynamicCam8_end(void){} -void func_802BF888(void) { +void ncDynamicCam8_update(void) { f32 sp5C[3]; f32 sp50[3]; f32 sp44[3]; @@ -31,7 +31,7 @@ void func_802BF888(void) { if(D_8037DB0E) return; - func_802BD384(sp44); + ncDynamicCamera_getPosition(sp44); sp20[0] = D_8037DB00[0]; sp20[1] = D_8037DB00[1]; sp20[2] = D_8037DB00[2]; @@ -46,7 +46,7 @@ void func_802BF888(void) { if (D_8037DB0D) { func_802BE60C(); } - func_802BD384(sp44); + ncDynamicCamera_getPosition(sp44); func_802BD4C0(sp5C); ml_vec3f_diff_copy(sp50, sp5C, sp44); func_802BC434(sp38, sp5C, sp44); @@ -58,7 +58,7 @@ void func_802BF888(void) { } -void func_802BF9B8(s32 arg0) { +void ncDynamicCam8_func_802BF9B8(s32 arg0) { f32 sp2C; f32 sp28; s32 temp_s0; diff --git a/src/core2/code_39A10.c b/src/core2/nc/dynamicCam9.c similarity index 55% rename from src/core2/code_39A10.c rename to src/core2/nc/dynamicCam9.c index 60056fd9..2328a096 100644 --- a/src/core2/code_39A10.c +++ b/src/core2/nc/dynamicCam9.c @@ -12,25 +12,25 @@ f32 D_8037DBC0; f32 D_8037DBC8[3]; /* .code */ -void func_802C09A0(void) { +void ncDynamicCam9_init(void) { func_802BD870(6.0f, 10.0f, 50.0f, 120.0f); - func_802BD384(D_8037DBC8); + ncDynamicCamera_getPosition(D_8037DBC8); } -void func_802C09E0(void){} +void ncDynamicCam9_end(void){} -f32 func_802C09E8(void) { - f32 sp2C[3]; - f32 sp20[3]; +f32 ncDynamicCam9_func_802C09E8(void) { + f32 d_pos[3]; + f32 player_position[3]; - player_getPosition(sp20); - sp2C[0] = D_8037DBB0[0] - sp20[0]; - sp2C[1] = 0.0f; - sp2C[2] = D_8037DBB0[2] - sp20[2]; - return ml_min_f(gu_sqrtf(sp2C[0]*sp2C[0] + sp2C[2]*sp2C[2]), D_8037DBBC) / D_8037DBBC; + player_getPosition(player_position); + d_pos[0] = D_8037DBB0[0] - player_position[0]; + d_pos[1] = 0.0f; + d_pos[2] = D_8037DBB0[2] - player_position[2]; + return ml_min_f(gu_sqrtf(d_pos[0]*d_pos[0] + d_pos[2]*d_pos[2]), D_8037DBBC) / D_8037DBBC; } -void func_802C0A60(f32 arg0[3]) { +void ncDynamicCam9_func_802C0A60(f32 arg0[3]) { f32 sp54[3]; f32 sp48[3]; f32 sp3C[3]; @@ -48,32 +48,32 @@ void func_802C0A60(f32 arg0[3]) { arg0[2] += sp3C[2]; } -void func_802C0B70(f32 arg0[3], f32 arg1[3]) { +void ncDynamicCam9_func_802C0B70(f32 arg0[3], f32 arg1[3]) { f32 sp3C[3]; f32 sp30[3]; - f32 sp2C; + f32 dt; - sp2C = time_getDelta(); - func_802BD384(sp30); + dt = time_getDelta(); + ncDynamicCamera_getPosition(sp30); ml_vec3f_diff_copy(sp3C, arg1, sp30); - sp3C[0] *= sp2C * 1.5; - sp3C[1] *= sp2C * 1.0; - sp3C[2] *= sp2C * 1.5; - sp3C[0] = func_80259198(sp3C[0], sp2C * 1000.0); - sp3C[1] = func_80259198(sp3C[1], sp2C * 1000.0); - sp3C[2] = func_80259198(sp3C[2], sp2C * 1000.0); + sp3C[0] *= dt * 1.5; + sp3C[1] *= dt * 1.0; + sp3C[2] *= dt * 1.5; + sp3C[0] = func_80259198(sp3C[0], dt * 1000.0); + sp3C[1] = func_80259198(sp3C[1], dt * 1000.0); + sp3C[2] = func_80259198(sp3C[2], dt * 1000.0); ml_vec3f_add(arg0, sp30, sp3C); - func_802BD334(arg0); + ncDynamicCamera_setPosition(arg0); } -void func_802C0C5C(f32 arg0[3], f32 arg1[3]) { +void ncDynamicCam9_func_802C0C5C(f32 arg0[3], f32 arg1[3]) { f32 sp54[3]; f32 sp48[3]; f32 sp3C[3]; f32 sp38; f32 temp_f14; - sp38 = func_802C09E8(); + sp38 = ncDynamicCam9_func_802C09E8(); func_802BD4C0(sp48); ml_vec3f_diff_copy(sp3C, sp48, D_8037DBB0); ml_vec3f_scale(sp3C, ml_map_f(sp38, 0.4f, 0.75f, 0.5f, 1.0f)); @@ -84,29 +84,29 @@ void func_802C0C5C(f32 arg0[3], f32 arg1[3]) { arg0[2] = 0.0f; } -void func_802C0D60(void) { +void ncDynamicCam9_update(void) { f32 sp44[3]; f32 sp38[3]; f32 sp2C[3]; f32 sp20[3]; f32 temp_f0; - func_802BD384(sp44); - func_802BD3A8(sp38); - if (func_802C09E8() > 0.25){ - func_802C0A60(sp2C); - func_802C0C5C(sp20, sp2C); + ncDynamicCamera_getPosition(sp44); + ncDynamicCamera_getRotation(sp38); + if (ncDynamicCam9_func_802C09E8() > 0.25){ + ncDynamicCam9_func_802C0A60(sp2C); + ncDynamicCam9_func_802C0C5C(sp20, sp2C); temp_f0 = mlNormalizeAngle(sp20[1] - sp38[1]); if((temp_f0 > 200.0f) || (temp_f0 < 160.0f)) { ml_vec3f_copy(D_8037DBC8, sp2C); } } - func_802C0B70(sp2C, D_8037DBC8); - func_802C0C5C(sp20, sp2C); + ncDynamicCam9_func_802C0B70(sp2C, D_8037DBC8); + ncDynamicCam9_func_802C0C5C(sp20, sp2C); func_802BD720(sp20); } -void func_802C0E38(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4){ +void ncDynamicCam9_func_802C0E38(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4){ D_8037DBB0[0] = arg0; D_8037DBB0[1] = arg1; D_8037DBB0[2] = arg2; diff --git a/src/core2/code_3AE10.c b/src/core2/nc/dynamicCamA.c similarity index 74% rename from src/core2/code_3AE10.c rename to src/core2/nc/dynamicCamA.c index b87b8c7c..14432334 100644 --- a/src/core2/code_3AE10.c +++ b/src/core2/nc/dynamicCamA.c @@ -6,7 +6,7 @@ extern f32 func_802BD51C(void); extern void func_802BDCE0(f32, f32*, f32*, f32, f32); extern void func_802BDE88(f32*, f32*, f32, f32, f32); extern void func_802589E4(f32[3], f32, f32); -extern void func_802BD0D8(s32); +extern void ncDynamicCamera_setState(s32); /* .data */ f32 D_80365DA0 = 0.0f; @@ -17,21 +17,21 @@ u8 D_80365DB0 = 0; f32 D_80365DB4 = 0.0f; /* .code */ -void func_802C1DA0(void){} +void ncDynamicCamA_init(void){} -void func_802C1DA8(void){} +void ncDynamicCamA_end(void){} -bool func_802C1DB0(f32 arg0) { +bool ncDynamicCamA_func_802C1DB0(f32 arg0) { f32 pad4C; - f32 sp40[3]; + f32 camera_position[3]; f32 sp34[3]; f32 sp28[3]; f32 sp1C[3]; - func_802BD384(sp40); + ncDynamicCamera_getPosition(camera_position); func_802C02D4(sp28); - ml_vec3f_diff_copy(sp34, sp40, sp28); + ml_vec3f_diff_copy(sp34, camera_position, sp28); D_80365DAC = gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]); func_8025801C(sp34, &D_80365DA4); D_80365DA8 = 0.0f; @@ -41,24 +41,24 @@ bool func_802C1DB0(f32 arg0) { func_802589E4(sp1C, mlNormalizeAngle(D_80365DA4 + pad4C), D_80365DAC); sp1C[0] += sp28[0]; sp1C[2] += sp28[2]; - pad4C = sp40[1]; + pad4C = camera_position[1]; sp1C[1] = pad4C; - if (func_802BCE0C(sp40, sp1C)) { - func_802BD0D8(0xA); + if (func_802BCE0C(camera_position, sp1C)) { + ncDynamicCamera_setState(0xA); return TRUE; } return FALSE; } -bool func_802C1EE0(void){ +bool ncDynamicCamA_func_802C1EE0(void){ return D_80365DB0; } -f32 func_802C1EEC(void){ +f32 ncDynamicCamA_func_802C1EEC(void){ f32 sp1C[3]; if(func_802C0190() == 3){ - func_802BD384(sp1C); + ncDynamicCamera_getPosition(sp1C); return sp1C[1]; } else{ @@ -66,7 +66,7 @@ f32 func_802C1EEC(void){ } } -void func_802C1F30(void) { +void ncDynamicCamA_update(void) { f32 spB4[3]; f32 spA8[3]; f32 sp9C[3]; @@ -84,8 +84,8 @@ void func_802C1F30(void) { f32 sp2C[3]; s32 phi_a0; - func_802BD384(sp6C); - func_802BD384(sp9C); + ncDynamicCamera_getPosition(sp6C); + ncDynamicCamera_getPosition(sp9C); func_802C02D4(spB4); sp80 = time_getDelta(); @@ -100,8 +100,8 @@ void func_802C1F30(void) { func_802BDE88(&D_80365DB4, &D_80365DAC, func_802BD8D4(), 0.01f, 0.008f); func_80256E24(sp90, 0.0f, D_80365DA4, 0.0f, 0.0f, D_80365DAC); ml_vec3f_add(spA8, spB4, sp90); - spA8[1] = sp9C[1] + ((func_802C1EEC() - sp9C[1]) * sp80 * 2); - func_802BD334(spA8); + spA8[1] = sp9C[1] + ((ncDynamicCamA_func_802C1EEC() - sp9C[1]) * sp80 * 2); + ncDynamicCamera_setPosition(spA8); sp78 = 0; sp7C = 0; if (func_802BE60C() != 0) { @@ -117,22 +117,22 @@ void func_802C1F30(void) { } func_802BE6FC(sp84, spB4); if (sp7C != 0) { - func_802BD384(sp44); + ncDynamicCamera_getPosition(sp44); ml_vec3f_diff_copy(sp50, sp44, spB4); D_80365DAC = gu_sqrtf((sp50[0] * sp50[0]) + (sp50[2] * sp50[2])); } if (sp78 != 0) { D_80365DB0 = 1; - func_802BD35C(sp84); + ncDynamicCamera_setRotation(sp84); return; } - func_802BD3A8(sp38); + ncDynamicCamera_getRotation(sp38); sp2C[0] = mlDiffDegF(sp84[0], sp38[0]); sp2C[1] = mlDiffDegF(sp84[1], sp38[1]); sp2C[2] = 0.0f; sp84[0] = sp38[0] + (sp2C[0] * sp80 * 4.0f); sp84[1] = sp38[1] + sp2C[1]; - func_802BD35C(sp84); + ncDynamicCamera_setRotation(sp84); if (D_80365DB0 != 0) { D_80365DB4 = 0.0f; } diff --git a/src/core2/nc/dynamicCamB.c b/src/core2/nc/dynamicCamB.c new file mode 100644 index 00000000..83bc5f4b --- /dev/null +++ b/src/core2/nc/dynamicCamB.c @@ -0,0 +1,95 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BD51C(void); +extern void func_802C0150(s32 arg0); + +f32 D_8037DB70; +struct { + f32 D_8037DB78[3]; + f32 D_8037DB84[3]; + f32 D_8037DB90[3]; +}cameraStateB; + +void func_802C0370(){ + ncDynamicCamera_getPosition(cameraStateB.D_8037DB84); +} + +void func_802C0394(f32 src[3]){ + ml_vec3f_copy(cameraStateB.D_8037DB90, src); +} + +void func_802C03BC(void) { + f32 sp2C[3]; + f32 sp20[3]; + f32 sp1C; + static f32 D_8037DB9C; + + + ncDynamicCamera_getPosition(cameraStateB.D_8037DB78); + ml_vec3f_diff_copy(sp20, cameraStateB.D_8037DB90, cameraStateB.D_8037DB84); + ml_vec3f_diff_copy(sp2C, cameraStateB.D_8037DB78, cameraStateB.D_8037DB84); + ml_vec3f_normalize(sp20); + ml_vec3f_normalize(sp2C); + sp1C = sp20[0]*sp2C[0] + sp20[1]*sp2C[1] + sp20[2]*sp2C[2]; + if (sp1C < 0.0f || D_8037DB9C < 0.0f) { + ncDynamicCamera_setPosition(cameraStateB.D_8037DB84); + } + D_8037DB9C = sp1C; +} + +void func_802C0490(f32 arg0[3]){ + func_802C02D4(arg0); +} + +void func_802C04B0(void) { + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + ncDynamicCamera_getPosition(sp34); + func_802C0490(sp1C); + ml_vec3f_diff_copy(sp28,sp34, sp1C); + func_8025801C(sp28, &D_8037DB70); +} + +void ncDynamicCamB_init(void) { + func_802BE244(5.0f, 10.0f); + func_802BE230(3.0f, 8.0f); + func_802C0150(2); + func_802C04B0(); +} + +void ncDynamicCamB_end(void){} + +void ncDynamicCamB_update(void) { + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + s32 sp24; + + func_802C0370(); + func_802C0490(sp4C); + func_80256E24(sp34, 0.0f, D_8037DB70, 0.0f, 0.0f, func_802BD8D4()); + ml_vec3f_add(sp40, sp4C, sp34); + sp40[1] = func_802BD51C(); + func_802C0394(sp40); + func_802BE190(sp40); + sp24 = 0; + if (func_802BE60C() != 0) { + if (func_802BC84C(1) != 0) { + sp24 = 1; + } else { + func_802C03BC(); + } + func_802C04B0(); + } + func_802C0490(sp4C); + func_802BE6FC(sp28, sp4C); + if (sp24) { + ncDynamicCamera_setRotation(sp28); + } + func_802BD904(sp28); +} diff --git a/src/core2/code_38F40.c b/src/core2/nc/dynamicCamC.c similarity index 89% rename from src/core2/code_38F40.c rename to src/core2/nc/dynamicCamC.c index adec1b83..75b9eb2f 100644 --- a/src/core2/code_38F40.c +++ b/src/core2/nc/dynamicCamC.c @@ -16,26 +16,26 @@ void func_802BFED0(void){ f32 sp1C[3]; player_getPosition(sp28); - func_802BD384(sp1C); + ncDynamicCamera_getPosition(sp1C); func_80257F18(sp28, sp1C, &sp34); D_8037DB30.unk8 = sp34; D_8037DB30.unk4 = 0.0f; } -void func_802BFF1C(void) { +void ncDynamicCamC_init(void) { func_802BE244(4.0f, 16.0f); func_802BE230(1.8f, 14.0f); D_8037DB30.unk0 = 290.0f; func_802BFED0(); } -void func_802BFF78(void){} +void ncDynamicCamC_end(void){} void func_802BFF80(f32 arg0){ D_8037DB30.unk0 = arg0; } -void func_802BFF8C(void) { +void ncDynamicCamC_update(void) { f32 sp54[3]; f32 sp48[3]; f32 sp3C[3]; @@ -66,7 +66,7 @@ void func_802BFF8C(void) { } break; } - func_802BD384(sp54); + ncDynamicCamera_getPosition(sp54); player_getPosition(sp3C); sp3C[1] += 100.0f; func_8025727C(sp3C[0], sp3C[1], sp3C[2], sp54[0], sp54[1], sp54[2], &sp48[0], &sp48[1]); diff --git a/src/core2/code_382E0.c b/src/core2/nc/dynamicCamD.c similarity index 77% rename from src/core2/code_382E0.c rename to src/core2/nc/dynamicCamD.c index fac44a79..61f3413c 100644 --- a/src/core2/code_382E0.c +++ b/src/core2/nc/dynamicCamD.c @@ -6,18 +6,18 @@ f32 D_80365D90 = 30.0f; /* .code */ -void func_802BF270(void){ +void ncDynamicCamD_init(void){ func_802BE244(4.0f, 16.0f); func_802BE230(1.4f, 14.0f); } -void func_802BF2B8(void){} +void ncDynamicCamD_end(void){} -void func_802BF2C0(f32 arg0){ +void ncDynamicCamD_func_802BF2C0(f32 arg0){ D_80365D90 = arg0; } -void func_802BF2CC(void) { +void ncDynamicCamD_update(void) { f32 sp54[3]; f32 sp48[3]; f32 sp3C[3]; @@ -26,14 +26,14 @@ void func_802BF2CC(void) { player_getPosition(sp3C); sp3C[1] += 120.0f; - func_802BD384(sp54); + ncDynamicCamera_getPosition(sp54); func_80257F18(sp3C, sp54, &sp2C); func_80256E24(sp30, 0.0f, sp2C, 0.0f, 0.0f, 200.0f); sp3C[0] += sp30[0]; sp3C[1] += sp30[1]; sp3C[2] += sp30[2]; func_802BE190(sp3C); - func_802BD384(sp54); + ncDynamicCamera_getPosition(sp54); player_getPosition(sp3C); sp3C[1] += D_80365D90; func_8025727C(sp3C[0], sp3C[1], sp3C[2], sp54[0], sp54[1], sp54[2], &sp48[0], &sp48[1]); diff --git a/src/core2/nc/dynamicCamF.c b/src/core2/nc/dynamicCamF.c new file mode 100644 index 00000000..df6c7be3 --- /dev/null +++ b/src/core2/nc/dynamicCamF.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" + +static f32 __playerStartPosition[3]; + +void ncDynamicCamF_init(void){ + f32 sp24[3]; + f32 sp12[3]; + + viewport_getPosition(sp24); + viewport_getRotation(sp12); + ncDynamicCamera_setPosition(sp24); + ncDynamicCamera_setRotation(sp12); + player_getPosition(__playerStartPosition); + func_80291488(5); +} + +void ncDynamicCamF_end(void){} + +void ncDynamicCamF_update(void){ + f32 player_position[3]; + f32 d_position[3]; + + player_getPosition(player_position); + ml_vec3f_diff_copy(d_position, __playerStartPosition, player_position); + if( !(gu_sqrtf(d_position[0]*d_position[0] + d_position[1]*d_position[1] + d_position[2]*d_position[2]) < 2.0f)){ + func_80291488(2); + ncDynamicCamera_setState(0xB); + func_802BE720(); + } +} diff --git a/src/core2/code_356B0.c b/src/core2/nc/dynamicCamera.c similarity index 77% rename from src/core2/code_356B0.c rename to src/core2/nc/dynamicCamera.c index cb7a1842..5b982cc8 100644 --- a/src/core2/code_356B0.c +++ b/src/core2/nc/dynamicCamera.c @@ -19,9 +19,9 @@ typedef struct { s32 unk4; }Struct_core2_356B0_0; -void func_802BD0D8(s32 arg0); -void func_802BD334(f32 arg0[3]); -void func_802BD384(f32 arg0[3]); +void ncDynamicCamera_setState(s32 state); +void ncDynamicCamera_setPosition(f32 arg0[3]); +void ncDynamicCamera_getPosition(f32 arg0[3]); void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); void func_802BD840(void); void func_802BD870(f32 arg0, f32 arg1, f32 arg2, f32 arg3); @@ -39,8 +39,8 @@ Struct_core2_356B0_0 D_80365D58 = {D_80365D00, 18}; /* .bss */ s32 D_8037D940; f32 D_8037D948[3]; -f32 D_8037D958[3]; -f32 D_8037D968[3]; +f32 cameraPosition[3]; +f32 cameraRotation[3]; f32 D_8037D96C; f32 D_8037D974; f32 D_8037D978; @@ -62,10 +62,10 @@ f32 D_8037D9D8; f32 D_8037D9E0[3]; f32 D_8037D9EC; f32 D_8037D9F0; -u8 D_8037D9F4; -u8 D_8037D9F5; +u8 dynamicCameraState; +u8 cameraUpdateEnabled; u8 D_8037D9F6; -u8 D_8037D9F7; +u8 dynamicCameraInFirstPerson; /* .code */ bool func_802BC640(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3) { @@ -103,7 +103,7 @@ bool func_802BC640(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3) { func_80244D94(arg0, sp78, sp88, 0x9E0000, 40.0f); func_8024575C(arg0, sp78, 40.0f, sp88, 4, 0x9E0000); if (phi_f26 < func_80258708(arg0, sp78)) { - func_802BD334(sp78); + ncDynamicCamera_setPosition(sp78); ml_vec3f_clear(D_8037D9C8); ml_vec3f_clear(D_8037D9E0); return TRUE; @@ -130,7 +130,7 @@ s32 func_802BC84C(s32 arg0){ else{ func_8028EC64(sp50); } - func_802BD384(sp38); + ncDynamicCamera_getPosition(sp38); ml_vec3f_diff_copy(sp5C, sp50, sp38); ml_vec3f_normalize_copy(sp68, sp5C); ml_vec3f_copy(sp44, sp50); @@ -183,10 +183,10 @@ void func_802BCA58(void) { s32 pad44; s32 pad40; f32 sp34[3]; - f32 sp28[3]; + f32 player_position[3]; - player_getPosition(sp28); - ml_vec3f_diff_copy(sp34, sp28, D_8037D958); + player_getPosition(player_position); + ml_vec3f_diff_copy(sp34, player_position, cameraPosition); sp4C = player_getYaw(); sp48 = ml_map_f(mlAbsF((f32) (mlNormalizeAngle(D_8037D96C - sp4C) - 180.0)), 0.0f, 180.0f, D_8037D97C, D_8037D980); func_80256E24(D_8037D9A8, 0.0f, sp4C, 0.0f, 0.0f, ml_map_f(gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]), 300.0f, 450.0f, 0.0f, sp48)); @@ -203,18 +203,18 @@ void func_802BCA58(void) { void func_802BCBD4(void) { D_8037D940 = 0; - D_8037D9F5 = 1; + cameraUpdateEnabled = TRUE; func_802BD8EC(130.0f); func_802BD870(10.0f, 10.0f, 120.0f, 120.0f); func_802BE230(1.4f, 14.0f); func_802BD840(); - func_802C28C8(); + ncFirstPersonCamera_reset(); func_802C0120(); func_802C2258(); func_802C0F4C(); - func_8024C764(D_8037D968); - func_8024C5CC(D_8037D958); - ml_vec3f_copy(D_8037D948, D_8037D958); + viewport_getRotation(cameraRotation); + viewport_getPosition(cameraPosition); + ml_vec3f_copy(D_8037D948, cameraPosition); ml_vec3f_clear(D_8037D9C8); ml_vec3f_clear(D_8037D9E0); ml_vec3f_clear(D_8037D9A8); @@ -225,12 +225,12 @@ void func_802BCBD4(void) { D_8037D9A0 = 0.0f; D_8037D9F6 = 0; D_8037D978 = 100.0f; - D_8037D9F4 = 0; - func_802BD0D8(1); + dynamicCameraState = 0; + ncDynamicCamera_setState(1); } void func_802BCD30(void){ - func_802BD0D8(0); + ncDynamicCamera_setState(0); func_802C2250(); func_802C0148(); } @@ -243,7 +243,7 @@ f32 func_802BCD60(void) { if ((D_8037D940 & 1) && !func_802BC428()) return D_8037D9A0; - ml_vec3f_copy(sp28, D_8037D958); + ml_vec3f_copy(sp28, cameraPosition); temp_v0 = func_80245314(sp28, sp34, 10.0f, -600.0f, 0x800000); if (temp_v0 == 0) { D_8037D9A0 = sp28[1] - 600.0f; @@ -276,36 +276,36 @@ void func_802BCE94(void){ func_802BC84C(0); } -void func_802BCEC4(void){ +void ncDynamicCamera_update(void){ f32 sp24[3]; f32 sp18[3]; - if(!D_8037D9F5) + if(!cameraUpdateEnabled) return; func_802BCD60(); - D_8037D948[0] = D_8037D958[0]; - D_8037D948[1] = D_8037D958[1]; - D_8037D948[2] = D_8037D958[2]; + D_8037D948[0] = cameraPosition[0]; + D_8037D948[1] = cameraPosition[1]; + D_8037D948[2] = cameraPosition[2]; func_802BCA58(); - switch(D_8037D9F4){ + switch(dynamicCameraState){ case 1:// L802BCF3C - func_802C18F8(); + ncDynamicCam1_update(); func_802BCE94(); break; case 3:// L802BCF54 - func_802C1B2C(); + ncDynamicCam3_update(); break; case 4:// L802BCF64 - func_802BFAF0(); + ncDynamicCam4_update(); func_802BCE94(); break; case 5:// L802BCF7C - func_802BF454(); + ncDynamicCam5_update(); func_802BCE94(); break; @@ -314,215 +314,215 @@ void func_802BCEC4(void){ break; case 8:// L802BCFA4 - func_802BF888(); + ncDynamicCam8_update(); break; case 9:// L802BCFB4 - func_802C0D60(); + ncDynamicCam9_update(); func_802BCE94(); break; case 0xA:// L802BCFCC - func_802C1F30(); + ncDynamicCamA_update(); break; case 0xB:// L802BCFDC - func_802C0558(); + ncDynamicCamB_update(); break; case 0xC:// L802BCFEC - func_802BFF8C(); + ncDynamicCamC_update(); func_802BCE94(); break; case 0xD:// L802BD004 - func_802BF2CC(); + ncDynamicCamD_update(); func_802BCE94(); break; case 0xF:// L802BD01C - func_802C24B4(); + ncDynamicCamF_update(); break; case 0x10:// L802BD02C - func_802BF1D4(); + ncDynamicCam10_update(); break; case 0x11:// L802BD03C - func_802BF5F4(); + ncDynamicCam11_update(); break; case 0x12:// L802BD04C - func_802C14E0(); + ncDynamicCam12_update(); break; case 0x13:// L802BD05C - func_802C07A0(); + ncDynamicCam13_update(); break; }//// L802BD064 - ml_vec3f_copy(sp24, D_8037D958); - ml_vec3f_copy(sp18, D_8037D968); + ml_vec3f_copy(sp24, cameraPosition); + ml_vec3f_copy(sp18, cameraRotation); func_802C22C0(sp24, sp18); - if(D_8037D9F7){ - func_802C292C(sp24, sp18); + if(dynamicCameraInFirstPerson){ + ncFirstPersonCamera_getPositionAndRotation(sp24, sp18); } - func_8024CD88(sp24); - func_8024CE18(sp18); + viewport_setPosition(sp24); + viewport_setRotation(sp18); } -int func_802BD0CC(void){ - return D_8037D9F4; +int ncDynamicCamera_getState(void){ + return dynamicCameraState; } -void func_802BD0D8(s32 arg0){ - if(arg0 == D_8037D9F4) +void ncDynamicCamera_setState(s32 state){ + if(state == dynamicCameraState) return; - switch(D_8037D9F4){ + switch(dynamicCameraState){ case 0x1://L802BD114 - func_802C18F0(); + ncDynamicCam1_end(); break; case 0x3://L802BD124 - func_802C1AD0(); + ncDynamicCam3_end(); break; case 0x4://L802BD134 - func_802BFAE8(); + ncDynamicCam4_end(); break; case 0x5://L802BD144 - func_802BF44C(); + ncDynamicCam5_end(); break; case 0x8://L802BD154 - func_802BF880(); + ncDynamicCam8_end(); break; case 0x9://L802BD164 - func_802C09E0(); + ncDynamicCam9_end(); break; case 0xa://L802BD174 - func_802C1DA8(); + ncDynamicCamA_end(); break; case 0xb://L802BD184 - func_802C0550(); + ncDynamicCamB_end(); break; case 0xc://L802BD194 - func_802BFF78(); + ncDynamicCamC_end(); break; case 0xd://L802BD1A4 - func_802BF2B8(); + ncDynamicCamD_end(); break; case 0xf://L802BD1B4 - func_802C24AC(); + ncDynamicCamF_end(); break; case 0x10://L802BD1C4 - func_802BF1CC(); + ncDynamicCam10_end(); break; case 0x11://L802BD1D4 - func_802BF5EC(); + ncDynamicCam11_end(); break; case 0x12://L802BD1E4 - func_802C0FCC(); + ncDynamicCam12_end(); break; case 0x13://L802BD1F4 - func_802C0694(); + ncDynamicCam13_end(); break; }//L802BD1FC - switch (arg0) + switch (state) { case 0x1: //L802BD224 - func_802C18B0(); + ncDynamicCam1_init(); break; case 0x3: //L802BD234 - func_802C1AD8(); + ncDynamicCam3_init(); break; case 0x4: //L802BD244 - func_802BFA60(); + ncDynamicCam4_init(); break; case 0x5: //L802BD254 - func_802BF3F0(); + ncDynamicCam5_init(); break; case 0x8: //L802BD264 - func_802BF870(); + ncDynamicCam8_init(); break; case 0x9: //L802BD274 - func_802C09A0(); + ncDynamicCam9_init(); break; case 0xa: //L802BD284 - func_802C1DA0(); + ncDynamicCamA_init(); break; case 0xb: //L802BD294 - func_802C04F8(); + ncDynamicCamB_init(); break; case 0xc: //L802BD2A4 - func_802BFF1C(); + ncDynamicCamC_init(); break; case 0xd: //L802BD2B4 - func_802BF270(); + ncDynamicCamD_init(); break; case 0xf: //L802BD2C4 - func_802C2460(); + ncDynamicCamF_init(); break; case 0x10: //L802BD2D4 - func_802BF174(); + ncDynamicCam10_init(); break; case 0x11: //L802BD2E4 - func_802BF5C0(); + ncDynamicCam11_init(); break; case 0x12: //L802BD2F4 - func_802C0F6C(); + dynamicCam12_init(); break; case 0x13: //L802BD304 - func_802C0710(); + ncDynamicCam13_init(); break; } - D_8037D9F4 = arg0; + dynamicCameraState = state; } -void func_802BD328(s32 arg0){ - D_8037D9F5 = arg0; +void ncDynamicCamera_setUpdateEnabled(bool arg0){ + cameraUpdateEnabled = arg0; } -void func_802BD334(f32 arg0[3]){ - ml_vec3f_copy(D_8037D958, arg0); +void ncDynamicCamera_setPosition(f32 arg0[3]){ + ml_vec3f_copy(cameraPosition, arg0); } -void func_802BD35C(f32 arg0[3]){ - ml_vec3f_copy(D_8037D968, arg0); +void ncDynamicCamera_setRotation(f32 arg0[3]){ + ml_vec3f_copy(cameraRotation, arg0); } -void func_802BD384(f32 arg0[3]){ - ml_vec3f_copy(arg0, D_8037D958); +void ncDynamicCamera_getPosition(f32 arg0[3]){ + ml_vec3f_copy(arg0, cameraPosition); } -void func_802BD3A8(f32 arg0[3]){ - ml_vec3f_copy(arg0, D_8037D968); +void ncDynamicCamera_getRotation(f32 arg0[3]){ + ml_vec3f_copy(arg0, cameraRotation); } void func_802BD3CC(f32 arg0[3]) { @@ -591,9 +591,9 @@ void func_802BD610(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32 arg4, f32 a void func_802BD720(f32 arg0[3]) { f32 sp24[3]; - func_802BD3A8(sp24); + ncDynamicCamera_getRotation(sp24); func_802BD780(arg0, sp24, D_8037D984, D_8037D988, D_8037D98C, D_8037D990); - func_802BD35C(sp24); + ncDynamicCamera_setRotation(sp24); } void func_802BD780(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32 arg4, f32 arg5) { @@ -649,27 +649,27 @@ f32 func_802BD8F8(void){ return D_8037D974; } -void func_802BD904(f32 arg0[3]) { - f32 sp5C[3]; +void func_802BD904(f32 target_rotation[3]) { + f32 camera_rotation[3]; f32 sp50[3]; f32 sp44[3]; f32 sp38[3]; - f32 sp34; + f32 dt; f32 sp30; if (func_802BC428()) { ml_vec3f_clear(D_8037D9C8); - func_802BD35C(arg0); + ncDynamicCamera_setRotation(target_rotation); return; } - sp34 = time_getDelta(); - func_802BD3A8(sp5C); - sp50[0] = mlDiffDegF(arg0[0], sp5C[0]); - sp50[1] = mlDiffDegF(arg0[1], sp5C[1]); + dt = time_getDelta(); + ncDynamicCamera_getRotation(camera_rotation); + sp50[0] = mlDiffDegF(target_rotation[0], camera_rotation[0]); + sp50[1] = mlDiffDegF(target_rotation[1], camera_rotation[1]); sp50[2] = 0.0f; - sp44[0] = sp50[0] * sp34 * D_8037D9D4; - sp44[1] = sp50[1] * sp34 * D_8037D9D4; + sp44[0] = sp50[0] * dt * D_8037D9D4; + sp44[1] = sp50[1] * dt * D_8037D9D4; sp44[2] = 0.0f; sp38[0] = sp44[0] - D_8037D9C8[0]; sp38[1] = sp44[1] - D_8037D9C8[1]; @@ -681,16 +681,16 @@ void func_802BD904(f32 arg0[3]) { sp30 = mlAbsF(D_8037D9C8[0]); if ((mlAbsF(sp50[0]) < sp30) && (D_8037D9C8[0]*sp50[0] > 0.0f)) { D_8037D9C8[0] = 0.0f; - sp5C[0] = arg0[0]; + camera_rotation[0] = target_rotation[0]; } sp30 = mlAbsF(D_8037D9C8[1]); if ((mlAbsF(sp50[1]) < sp30) && (D_8037D9C8[1]*sp50[1] > 0.0f)) { D_8037D9C8[1] = 0.0f; - sp5C[1] = arg0[1]; + camera_rotation[1] = target_rotation[1]; } - sp5C[0] = mlNormalizeAngle(sp5C[0] + D_8037D9C8[0]); - sp5C[1] = mlNormalizeAngle(sp5C[1] + D_8037D9C8[1]); - func_802BD35C(sp5C); + camera_rotation[0] = mlNormalizeAngle(camera_rotation[0] + D_8037D9C8[0]); + camera_rotation[1] = mlNormalizeAngle(camera_rotation[1] + D_8037D9C8[1]); + ncDynamicCamera_setRotation(camera_rotation); } void func_802BDB30(f32 arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5) { @@ -822,16 +822,16 @@ void func_802BE190(f32 arg0[3]){ if(func_802BC428()){ ml_vec3f_clear(D_8037D9E0); - func_802BD334(arg0); + ncDynamicCamera_setPosition(arg0); return; } end = func_8033DD90()*5; - func_802BD384(sp34); + ncDynamicCamera_getPosition(sp34); for(i = 0; i < end; i++){ func_802BDF5C(arg0, sp34); } - func_802BD334(sp34); + ncDynamicCamera_setPosition(sp34); } void func_802BE230(f32 arg0, f32 arg1){ @@ -926,13 +926,13 @@ int func_802BE60C(void){ if(map_get() == MAP_91_FILE_SELECT) return 0; - ml_vec3f_copy(sp1C, D_8037D958); - func_802BE484(D_8037D948, D_8037D958); - return !(sp1C[0] == D_8037D958[0]) || !(sp1C[1] == D_8037D958[1]) || !(sp1C[2] == D_8037D958[2]); + ml_vec3f_copy(sp1C, cameraPosition); + func_802BE484(D_8037D948, cameraPosition); + return !(sp1C[0] == cameraPosition[0]) || !(sp1C[1] == cameraPosition[1]) || !(sp1C[2] == cameraPosition[2]); } void func_802BE6FC(f32 arg0[3], f32 arg1[3]){ - func_802BC434(arg0, arg1, D_8037D958); + func_802BC434(arg0, arg1, cameraPosition); } void func_802BE720(void){ @@ -940,29 +940,29 @@ void func_802BE720(void){ f32 sp28[3]; f32 sp1C[3]; - func_8024C5CC(sp28); - func_8024C764(sp1C); - func_802BD334(sp28); - func_802BD35C(sp1C); + viewport_getPosition(sp28); + viewport_getRotation(sp1C); + ncDynamicCamera_setPosition(sp28); + ncDynamicCamera_setRotation(sp1C); - sp34 = func_802BD0CC(); - func_802BD0D8(0); - func_802BD0D8(sp34); + sp34 = ncDynamicCamera_getState(); + ncDynamicCamera_setState(0); + ncDynamicCamera_setState(sp34); ml_vec3f_clear(D_8037D9C8); ml_vec3f_clear(D_8037D9E0); - func_802C28C8(); + ncFirstPersonCamera_reset(); } void func_802BE794(void){ f32 sp2C[3]; f32 sp20[3]; - if(D_8037D9F4 == 1 || D_8037D9F4 == 0xb || D_8037D9F4 == 3){ + if(dynamicCameraState == 1 || dynamicCameraState == 0xb || dynamicCameraState == 3){ player_getPosition(sp2C); sp2C[1] += 100.0f; player_getRotation(sp20); sp20[1] = mlNormalizeAngle(sp20[1] + 180.0f); - func_8024CD88(sp2C); - func_8024CE18(sp20); + viewport_setPosition(sp2C); + viewport_setRotation(sp20); func_8024C510(300.0f); func_802BE720(); }//L802BE828 @@ -983,20 +983,20 @@ int func_802BE834(f32 arg0[3]){ } -void func_802BE894(f32 arg0[3], f32 arg1[3]){ +void func_802BE894(f32 position[3], f32 rotation[3]){ f32 sp1C[3]; func_802C02D4(sp1C); - func_802BC434(arg0, sp1C, arg1); - arg0[2] = 0.0f; + func_802BC434(position, sp1C, rotation); + position[2] = 0.0f; } -void func_802BE8D8(void){ - D_8037D9F7 = 1; - func_802C29A0(1); - func_802C2A64(D_8037D958); - func_802C2A8C(D_8037D968); +void ncDynamicCamera_enterFirstPerson(void){ + dynamicCameraInFirstPerson = TRUE; + ncFirstPersonCamera_setState(1); + ncFirstPersonCamera_setZoomedOutPosition(cameraPosition); + ncFirstPersonCamera_setZoomedOutRotation(cameraRotation); } -void func_802BE91C(void){ - func_802C29A0(3); +void ncDynamicCamera_exitFirstPerson(void){ + ncFirstPersonCamera_setState(3); } diff --git a/src/core2/nc/firstpersoncamera.c b/src/core2/nc/firstpersoncamera.c new file mode 100644 index 00000000..fc98870c --- /dev/null +++ b/src/core2/nc/firstpersoncamera.c @@ -0,0 +1,143 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); +extern f32 func_80257CF8(f32, f32, f32, f32, f32); + + +enum nc_first_person_state{ + FIRSTPERSON_STATE_1_ENTER = 1, + FIRSTPERSON_STATE_2_IDLE, + FIRSTPERSON_STATE_3_EXIT, + FIRSTPERSON_STATE_4_DONE, +}; + +void ncFirstPersonCamera_setState(enum nc_first_person_state state); + +/* .bss */ +struct{ + f32 position[3]; //first_person_position + f32 rotation[3]; + f32 zoomed_in_position[3]; + f32 zoomed_in_rotation[3]; + f32 zoomed_out_position[3]; + f32 zoomed_out_rotation[3]; + f32 transistion_timer; + u8 state; +} D_8037DC60; + +/* .code */ +bool __ncFirstPersonCamera_fullyZoomedIn(void) { + return (ml_distance_vec3f(D_8037DC60.position, D_8037DC60.zoomed_in_position) < 40.0f); +} + +void __ncFirstPersonCamera_getPositionAndRotation_entering(f32 arg0[3], f32 arg1[3]) { + s32 i; + + func_80259430(&D_8037DC60.transistion_timer); + for( i = 0; i<3; i++){ + D_8037DC60.position[i] = func_80257CF8(D_8037DC60.transistion_timer, 1.0f, 0.0f, D_8037DC60.zoomed_out_position[i], D_8037DC60.zoomed_in_position[i]); + D_8037DC60.rotation[i] = mlNormalizeAngle(D_8037DC60.zoomed_out_rotation[i] + func_80257CF8(D_8037DC60.transistion_timer, 0.5f, 0.0f, 0.0f, mlDiffDegF(D_8037DC60.zoomed_in_rotation[i], D_8037DC60.zoomed_out_rotation[i]))); + } + if (D_8037DC60.transistion_timer == 0.0f) { + ncFirstPersonCamera_setState(2); + } + if (__ncFirstPersonCamera_fullyZoomedIn() && func_8028F150()) { + func_8028FCC8(0); + } + ml_vec3f_copy(arg0, D_8037DC60.position); + ml_vec3f_copy(arg1, D_8037DC60.rotation); +} + + +void __ncFirstPersonCamera_getPositionAndRotation_exiting(f32 arg0[3], f32 arg1[3]) { + s32 i; + + func_80259430(&D_8037DC60.transistion_timer); + for( i = 0; i<3; i++){ + D_8037DC60.position[i] = func_80257CF8(D_8037DC60.transistion_timer, 1.0f, 0.0f, D_8037DC60.zoomed_in_position[i], arg0[i]); + D_8037DC60.rotation[i] = mlNormalizeAngle(D_8037DC60.zoomed_in_rotation[i] + func_80257CF8(D_8037DC60.transistion_timer, 1.0f, 0.5f, 0.0f, mlDiffDegF(arg1[i], D_8037DC60.zoomed_in_rotation[i]))); + } + if (D_8037DC60.transistion_timer == 0.0f) { + ncFirstPersonCamera_setState(4); + } + if (!__ncFirstPersonCamera_fullyZoomedIn() && !func_8028F150()) { + func_8028FCC8(1); + } + ml_vec3f_copy(arg0, D_8037DC60.position); + ml_vec3f_copy(arg1, D_8037DC60.rotation); +} + + +void __ncFirstPersonCamera_getPositionAndRotation_idle(f32 arg0[3], f32 arg1[3]) { + ml_vec3f_copy(D_8037DC60.position, D_8037DC60.zoomed_in_position); + func_802BD780(D_8037DC60.zoomed_in_rotation, D_8037DC60.rotation, 10.0f, 20.0f, 120.0f, 200.0f); + D_8037DC60.rotation[2] = 0.0f; + ml_vec3f_copy(arg0, D_8037DC60.position); + ml_vec3f_copy(arg1, D_8037DC60.rotation); +} + +void ncFirstPersonCamera_reset(void){ + ml_vec3f_clear(D_8037DC60.position); + ml_vec3f_clear(D_8037DC60.rotation); + ml_vec3f_clear(D_8037DC60.zoomed_in_position); + ml_vec3f_clear(D_8037DC60.zoomed_in_rotation); + ml_vec3f_clear(D_8037DC60.zoomed_out_position); + ml_vec3f_clear(D_8037DC60.zoomed_out_rotation); + D_8037DC60.state = 0; +} + +void ncFirstPersonCamera_getPositionAndRotation(f32 position[3], f32 rotation[3]) { + switch (D_8037DC60.state) { + case FIRSTPERSON_STATE_1_ENTER: + __ncFirstPersonCamera_getPositionAndRotation_entering(position, rotation); + break; + case FIRSTPERSON_STATE_2_IDLE: + __ncFirstPersonCamera_getPositionAndRotation_idle(position, rotation); + break; + case FIRSTPERSON_STATE_3_EXIT: + __ncFirstPersonCamera_getPositionAndRotation_exiting(position, rotation); + /* fallthrough */ + case FIRSTPERSON_STATE_4_DONE: + break; + } +} + +void ncFirstPersonCamera_setState(enum nc_first_person_state next_state) { + if (next_state == FIRSTPERSON_STATE_1_ENTER) { + if (D_8037DC60.state == FIRSTPERSON_STATE_3_EXIT) { + ml_vec3f_copy(D_8037DC60.zoomed_out_position, D_8037DC60.position); + ml_vec3f_copy(D_8037DC60.zoomed_out_rotation, D_8037DC60.rotation); + } else { + ncDynamicCamera_getPosition(D_8037DC60.position); + ncDynamicCamera_getRotation(D_8037DC60.rotation); + ncDynamicCamera_getPosition(D_8037DC60.zoomed_out_position); + ncDynamicCamera_getRotation(D_8037DC60.zoomed_out_rotation); + } + D_8037DC60.transistion_timer = 1.0f; + } + if (next_state == FIRSTPERSON_STATE_3_EXIT) { + D_8037DC60.transistion_timer = 1.0f; + } + D_8037DC60.state = next_state; +} + +void ncFirstPersonCamera_setZoomedOutPosition(f32 src[3]){ + ml_vec3f_copy(D_8037DC60.zoomed_in_position, src); +} + +void ncFirstPersonCamera_setZoomedOutRotation(f32 src[3]){ + D_8037DC60.zoomed_in_rotation[0] = mlNormalizeAngle(src[0]); + D_8037DC60.zoomed_in_rotation[1] = mlNormalizeAngle(src[1]); + D_8037DC60.zoomed_in_rotation[2] = mlNormalizeAngle(src[2]); +} + +void ncFirstPersonCamera_getZoomedInRotation(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037DC60.zoomed_in_rotation); +} + +s32 ncFirstPersonCamera_getState(void){ + return D_8037DC60.state; +} diff --git a/src/core2/nc/randomCamera.c b/src/core2/nc/randomCamera.c new file mode 100644 index 00000000..19df9e44 --- /dev/null +++ b/src/core2/nc/randomCamera.c @@ -0,0 +1,50 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + f32 storedPosition[3]; + f32 storedRotation[3]; + f32 minPosition[3]; + f32 maxPosition[3]; +}D_8037DA50; + +/* .code */ +void ncRandomCamera_init(void) { + s32 sp24[3]; + s32 sp18[3]; + + viewport_getPosition(D_8037DA50.storedPosition); + viewport_getRotation(D_8037DA50.storedRotation); + mapModel_getBounds(sp24, sp18); + + D_8037DA50.minPosition[0] = (f32) sp24[0]; + D_8037DA50.minPosition[1] = (f32) sp24[1]; + D_8037DA50.minPosition[2] = (f32) sp24[2]; + + D_8037DA50.maxPosition[0] = (f32) sp18[0]; + D_8037DA50.maxPosition[1] = (f32) sp18[1]; + D_8037DA50.maxPosition[2] = (f32) sp18[2]; +} + + +void ncRandomCamera_end(void){ + viewport_setPosition(D_8037DA50.storedPosition); + viewport_setRotation(D_8037DA50.storedRotation); +} + +void ncRandomCamera_update(void) { + f32 sp24[3]; + f32 sp18[3]; + + sp24[0] = randf2(D_8037DA50.minPosition[0], D_8037DA50.maxPosition[0]);\ + sp24[1] = randf2(D_8037DA50.minPosition[1], D_8037DA50.maxPosition[1]);\ + sp24[2] = randf2(D_8037DA50.minPosition[2], D_8037DA50.maxPosition[2]); + + sp18[0] = randf2(-90.0f, 90.0f);\ + sp18[1] = randf2(0.0f, 360.0f);\ + sp18[2] = 0.0f; + viewport_setPosition(sp24); + viewport_setRotation(sp18); +} diff --git a/src/core2/nc/staticCamera.c b/src/core2/nc/staticCamera.c new file mode 100644 index 00000000..574e22dc --- /dev/null +++ b/src/core2/nc/staticCamera.c @@ -0,0 +1,73 @@ +#include +#include "functions.h" +#include "variables.h" +#include "core2/nc/camera.h" + + +extern void func_8025727C(f32, f32, f32, f32, f32, f32, f32*, f32*); + +/* .bss */ +static f32 ncStaticCameraPosition[3]; +static f32 ncStaticCameraRotation[3]; + +/* .code */ +void ncStaticCamera_init(void){ + ml_vec3f_clear(ncStaticCameraPosition); + ml_vec3f_clear(ncStaticCameraRotation); +} + +void ncStaticCamera_end(void){} + +void ncStaticCamera_rotateToTarget(f32 target[3]){ + func_8025727C( + target[0], target[1], target[2], + ncStaticCameraPosition[0], ncStaticCameraPosition[1], ncStaticCameraPosition[2], + &ncStaticCameraRotation[0], &ncStaticCameraRotation[1] + ); + ncStaticCameraRotation[0] = mlNormalizeAngle(-ncStaticCameraRotation[0]); + ncStaticCameraRotation[2] = 0.0f; +} + +void ncStaticCamera_setPosition(f32 arg0[3]){ + ml_vec3f_copy(ncStaticCameraPosition, arg0); +} + +void ncStaticCamera_update(void){ + viewport_setPosition(ncStaticCameraPosition); + viewport_setRotation(ncStaticCameraRotation); +} + +void __ncStaticCamera_setToNode(s32 camera_node_index){ + UNK_TYPE(s32) sp1C; + + sp1C = func_802B9E70(camera_node_index); + ncCameraNodeType2_getPosition(sp1C, ncStaticCameraPosition); + ncCameraNodeType2_getRotation(sp1C, ncStaticCameraRotation); +} + +void ncStaticCamera_setToNode(s32 camera_node_index){ + camera_setType(CAMERA_TYPE_3_STATIC); + __ncStaticCamera_setToNode(camera_node_index); +} + +void ncStaticCamera_exit(void){ + camera_setType(CAMERA_TYPE_2_DYNAMIC); +} + +void ncStaticCamera_setPositionAndRotation(f32 arg0[3], f32 arg1[3]){ + camera_setType(CAMERA_TYPE_3_STATIC); + ml_vec3f_copy(ncStaticCameraPosition, arg0); + ml_vec3f_copy(ncStaticCameraRotation, arg1); +} + +void ncStaticCamera_setPositionAndTarget(f32 arg0[3], f32 arg1[3]){ + camera_setType(CAMERA_TYPE_3_STATIC); + ml_vec3f_copy(ncStaticCameraPosition, arg0); + ncStaticCamera_rotateToTarget(arg1); +} + +void ncStaticCamera_getPosition(f32 dst[3]){ + dst[0] = ncStaticCameraPosition[0]; + dst[1] = ncStaticCameraPosition[1]; + dst[2] = ncStaticCameraPosition[2]; +} diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c index 311b5ce0..362dba87 100644 --- a/src/core2/timedfuncqueue.c +++ b/src/core2/timedfuncqueue.c @@ -4,8 +4,8 @@ #include "core2/timedfunc.h" -void func_802BAE4C(void); -void set_camera_to_node(s32); +void ncStaticCamera_exit(void); +void ncStaticCamera_setToNode(s32); typedef struct timed_function_queue_s{ f32 time; @@ -215,12 +215,12 @@ void func_80324E38(f32 time, s32 arg0){ timedFunc_set_1(time, (GenMethod_1) func_80324BA0, arg0); } -void timed_setCameraToNode(f32 time, s32 arg0){ - timedFunc_set_1(time, (GenMethod_1) set_camera_to_node, arg0); +void timed_setStaticCameraToNode(f32 time, s32 arg0){ + timedFunc_set_1(time, (GenMethod_1) ncStaticCamera_setToNode, arg0); } -void func_80324E88(f32 time){ - timedFunc_set_0(time, (GenMethod_0) func_802BAE4C); +void timed_exitStaticCamera(f32 time){ + timedFunc_set_0(time, (GenMethod_0) ncStaticCamera_exit); } void timedFunc_set_0(f32 time, GenMethod_0 funcPtr){ diff --git a/src/fight/chbossjinjo.c b/src/fight/chbossjinjo.c index b1fa47e3..67bb5010 100644 --- a/src/fight/chbossjinjo.c +++ b/src/fight/chbossjinjo.c @@ -4,7 +4,7 @@ #include "core2/particle.h" -extern void func_8024C5CC(f32 (*)[3]); +extern void viewport_getPosition(f32 (*)[3]); extern void func_80328B8C(Actor *, s32, f32, s32); extern void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]); extern void func_80324CFC(f32, enum comusic_e, s32); @@ -324,7 +324,7 @@ void func_8038CED8(f32 arg0[3], enum asset_e model_id, f32 arg2, f32 arg3){ f32 sp40[3]; f32 sp34[3]; - func_8024C5CC(&sp40); + viewport_getPosition(&sp40); sp34[0] = sp40[0] - arg0[0]; sp34[1] = sp40[1] - arg0[1]; diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index f780fc7f..8ee43bd0 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -17,7 +17,7 @@ Actor *func_8032813C(); void fight_func_803900DC(ActorMarker *, f32 *, f32, f32); extern Actor* func_80329958(ActorMarker *this, s32 arg1); extern void func_803298D8(); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); extern void func_80324CFC(f32, enum comusic_e, s32); extern void sfxsource_setSampleRate(u8, s32); extern void func_80328FF0(Actor *arg0, f32 arg1); @@ -478,7 +478,7 @@ void fight_func_80386CF8(Actor *actor) { func_8025727C(sp28[0], sp28[1], sp28[2], sp4C[0], sp4C[1], sp4C[2], &sp40[0], &sp40[1]); sp40[0] = 360.0f - sp40[0]; sp40[2] = 0.0f; - func_802BAE6C(sp4C, sp40); + ncStaticCamera_setPositionAndRotation(sp4C, sp40); } void __chfinalboss_dropHealth(ActorMarker *arg0) { @@ -692,9 +692,9 @@ void chfinalboss_setPhase(ActorMarker *this, u32 phase_id) { case 0: func_80328B8C(actor, 1, 0.0001f, 1); - timed_setCameraToNode(0.0f, 0); - func_80324E88(2.0f); - timed_setCameraToNode(2.0f, 1); + timed_setStaticCameraToNode(0.0f, 0); + timed_exitStaticCamera(2.0f); + timed_setStaticCameraToNode(2.0f, 1); timedFunc_set_1(2.0f, (GenMethod_1)func_8038B780, reinterpret_cast(s32, actor->marker)); return; @@ -891,7 +891,7 @@ void func_80388110(ActorMarker *marker, enum asset_e text_id, s32 arg2) { actor = marker_getActor(marker); actorLocal = (ActorLocal_fight_180 *)&actor->local; - func_802BAE4C(); + ncStaticCamera_exit(); func_80311480(randi2(0, 5) + 0x1101, 4, NULL, actor->marker, func_803880E0, NULL); actorLocal->unk9 = (u8)1; } @@ -1371,7 +1371,7 @@ void chfinalboss_phase3_endTextCallback(ActorMarker *marker, enum asset_e text_i Actor *actor; actor = marker_getActor(marker); - func_802BAE4C(); + ncStaticCamera_exit(); func_80324E38(0, 0); chfinalboss_setPhase(actor->marker, 4); } @@ -1602,17 +1602,17 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) { D_803927C4 = 1; func_80324E38(0.0f, 1); timedFunc_set_1(0.0f, chfinalboss_spawnStatue, BOSSJINJO_ORANGE); - timed_setCameraToNode(0.0f, 4); - func_80324E88(2.2f); + timed_setStaticCameraToNode(0.0f, 4); + timed_exitStaticCamera(2.2f); timedFunc_set_1(2.2f, chfinalboss_spawnStatue, BOSSJINJO_GREEN); - timed_setCameraToNode(2.2f, 5); - func_80324E88(4.4f); + timed_setStaticCameraToNode(2.2f, 5); + timed_exitStaticCamera(4.4f); timedFunc_set_1(4.4f, chfinalboss_spawnStatue, BOSSJINJO_PINK); - timed_setCameraToNode(4.4f, 6); - func_80324E88(6.6f); + timed_setStaticCameraToNode(4.4f, 6); + timed_exitStaticCamera(6.6f); timedFunc_set_1(6.6f, chfinalboss_spawnStatue, BOSSJINJO_YELLOW); - timed_setCameraToNode(6.6f, 7); - func_80324E88(8.8f); + timed_setStaticCameraToNode(6.6f, 7); + timed_exitStaticCamera(8.8f); timedFunc_set_0(8.8f, func_80389F54); func_80324E38(8.8f, 0); break; @@ -1645,14 +1645,14 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) { this->velocity[2] = sp3C[2] / 1.7; func_8028F94C(2, this->position, local); if (local->mirror_phase5 == 0) { - timed_setCameraToNode(0.0f, 0xA); - func_80324E88(1.7f); - timed_setCameraToNode(1.7f, 0xB); + timed_setStaticCameraToNode(0.0f, 0xA); + timed_exitStaticCamera(1.7f); + timed_setStaticCameraToNode(1.7f, 0xB); } else{ - timed_setCameraToNode(0.0f, 0xC); - func_80324E88(1.7f); - timed_setCameraToNode(1.7f, 0xD); + timed_setStaticCameraToNode(0.0f, 0xC); + timed_exitStaticCamera(1.7f); + timed_setStaticCameraToNode(1.7f, 0xD); } break; case 34: @@ -1728,7 +1728,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) { if (!fileProgressFlag_get(FILEPROG_D1_HAS_ACTIVATED_A_JINJO_STATUE_IN_FINAL_FIGHT)) { fileProgressFlag_set(FILEPROG_D1_HAS_ACTIVATED_A_JINJO_STATUE_IN_FINAL_FIGHT, TRUE); D_803927C4 = 0; - func_80324E88(1.0f); + timed_exitStaticCamera(1.0f); func_80324E38(1.0f, 0); } if (local->hits == 0) { @@ -1837,7 +1837,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) { func_8030E6A4(SFX_C5_TWINKLY_POP, randf2(0.95f, 1.05f), 32000); } else if (actor_animationIsAt(this, 0.9999f)) { - func_80324E88(0.0f); + timed_exitStaticCamera(0.0f); func_80324E38(0.0f, 0); chfinalboss_setPhase(this->marker, 5); func_8030DA44(this->unk44_31); @@ -1872,8 +1872,8 @@ void chfinalboss_phase5_setState(Actor *this, s32 next_state) { } func_8028F94C(2, this->position); timedFunc_set_1(0.0f, chfinalboss_spawnStatue, 5); - timed_setCameraToNode(0.0f, sp28); - func_80324E88(7.5f); + timed_setStaticCameraToNode(0.0f, sp28); + timed_exitStaticCamera(7.5f); timedFunc_set_1(7.5f, (GenMethod_1)func_8038AC50, (s32) this->marker); func_80324E38(7.5f, 0); break; @@ -1963,17 +1963,17 @@ void chfinalboss_phase5_update(ActorMarker *marker) { } if (0xA > __chFinalBossJinjonatorHits) { func_802BB3DC(0, 18.0f, 0.9f); - func_80324E88(0.6f); - timed_setCameraToNode(0.6f, sp38 + 3 + __chFinalBossJinjonatorHits); + timed_exitStaticCamera(0.6f); + timed_setStaticCameraToNode(0.6f, sp38 + 3 + __chFinalBossJinjonatorHits); chjinjonator_attack(jinjonator_marker, __chFinalBossJinjonatorHits, local->mirror_phase5); chfinalboss_phase5_setState(this, 0x2A); if (__chFinalBossJinjonatorHits == 9) { sp2C = 0x16; if(local->mirror_phase5) sp2C = 0x25; timedFunc_set_1(2.4f, (GenMethod_1)func_8038AF84, (s32) this->marker); - timed_setCameraToNode(2.4f, sp2C); - func_80324E88(4.4f); - timed_setCameraToNode(4.4f, sp38 + 3 + __chFinalBossJinjonatorHits); + timed_setStaticCameraToNode(2.4f, sp2C); + timed_exitStaticCamera(4.4f); + timed_setStaticCameraToNode(4.4f, sp38 + 3 + __chFinalBossJinjonatorHits); } } else { static f32 D_803917E0[3] = {0.0f, 186.0f, 0.0f}; @@ -1983,8 +1983,8 @@ void chfinalboss_phase5_update(ActorMarker *marker) { func_8030E6D4(SFX_HEAVY_THUNDERSTORM_01); func_8025A6EC(COMUSIC_A3_JINJONATOR_HITS_GRUNTY_J, 20000); chfinalboss_phase5_setState(this, 0x2B); - func_80324E88(0.0f); - timed_setCameraToNode(0.0f, sp38 + 0xD); + timed_exitStaticCamera(0.0f); + timed_setStaticCameraToNode(0.0f, sp38 + 0xD); func_8028F85C(D_803917E0); D_803928C8[0] = 0.0f; D_803928C8[1] = func_80257204(D_803917E0[0], D_803917E0[2], this->position[0], this->position[2]); @@ -2110,13 +2110,13 @@ void chfinalboss_phase5_update(ActorMarker *marker) { func_803872F8(this); } if (actor_animationIsAt(this, 0.9f)) { - func_802BAE4C(); + ncStaticCamera_exit(); if (local->mirror_phase5 == 0) { static f32 D_803917EC[3] = {-827.0f, 793.0f, 1700.0f}; - func_802BAEB4(D_803917EC, this->position); + ncStaticCamera_setPositionAndTarget(D_803917EC, this->position); } else { static f32 D_803917F8[3] = {827.0f, 793.0f, -1700.0f}; - func_802BAEB4(D_803917F8, this->position); + ncStaticCamera_setPositionAndTarget(D_803917F8, this->position); } func_8038FC2C(1); timedFunc_set_0(4.8, func_8038AFB0); @@ -2133,7 +2133,7 @@ void chfinalboss_phase0_endTextCallback(ActorMarker *marker, enum asset_e text_i sp1C = marker_getActor(marker); func_802BE720(); - func_80324E88(0); + timed_exitStaticCamera(0); func_8028F784(0); chfinalboss_setPhase(sp1C->marker, 1); } @@ -2403,7 +2403,7 @@ void func_8038C138() { f32 chjinjonator_80391234(); f32 func_8038DFA0(); -void func_80324E88(f32); +void timed_exitStaticCamera(f32); f32 chjinjonator_80391240(); void func_8038C148(void) { @@ -2428,17 +2428,17 @@ void func_8038C148(void) { chfinalboss_phase5_setState(sp4C, 0x27); sp48->unk8 = (u8)1; func_80324E38(0, 1); - timed_setCameraToNode(0, camera_node); - func_80324E88(temp_f20); + timed_setStaticCameraToNode(0, camera_node); + timed_exitStaticCamera(temp_f20); timedFunc_set_0(temp_f20 * 0.08, &func_8038C138); - timed_setCameraToNode(temp_f20, camera_node + 1); + timed_setStaticCameraToNode(temp_f20, camera_node + 1); - func_80324E88(temp_f20 + sp40); + timed_exitStaticCamera(temp_f20 + sp40); timedFunc_set_1(temp_f20 + sp40, func_8038C10C, (s32)sp4C->marker); - timed_setCameraToNode(temp_f20 + sp40, camera_node + 2); + timed_setStaticCameraToNode(temp_f20 + sp40, camera_node + 2); - func_80324E88(temp_f20 + sp40 + 2.88f); - timed_setCameraToNode(temp_f20 + sp40 + 2.88f, camera_node + 3); + timed_exitStaticCamera(temp_f20 + sp40 + 2.88f); + timed_setStaticCameraToNode(temp_f20 + sp40 + 2.88f, camera_node + 3); } void func_8038C27C(s32 arg0) { diff --git a/src/fight/chspellfireball.c b/src/fight/chspellfireball.c index 1331ca42..7d7197a7 100644 --- a/src/fight/chspellfireball.c +++ b/src/fight/chspellfireball.c @@ -303,7 +303,7 @@ void func_8038F620(Actor *this){ } }//L8038F79C if(D_803928E5 && this->marker->unk14_20 == MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){ - func_802BAD08(this->position); + ncStaticCamera_rotateToTarget(this->position); }//L8038F7D4 switch(this->state){ diff --git a/src/fight/chstonejinjo.c b/src/fight/chstonejinjo.c index 5343c089..80d8bf19 100644 --- a/src/fight/chstonejinjo.c +++ b/src/fight/chstonejinjo.c @@ -127,9 +127,9 @@ void chstonejinjo_breakOpen(ActorMarker *marker){ fight_func_8038C0DC(&sp24); func_8028F94C(2, &sp24); func_8038C27C(1); - timed_setCameraToNode(0 * sp30, sp38); - func_80324E88(1 * sp30); - timed_setCameraToNode(1 * sp30, sp38 + 1); + timed_setStaticCameraToNode(0 * sp30, sp38); + timed_exitStaticCamera(1 * sp30); + timed_setStaticCameraToNode(1 * sp30, sp38 + 1); } }//L8038DF8C } diff --git a/src/lair/code_5ED0.c b/src/lair/code_5ED0.c index 3c476497..a38955f4 100644 --- a/src/lair/code_5ED0.c +++ b/src/lair/code_5ED0.c @@ -3,6 +3,8 @@ #include "variables.h" #include "core2/code_C9E70.h" +#include "core2/nc/camera.h" + #define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0]))) @@ -587,8 +589,8 @@ void lair_func_8038CD48(void) void func_8038CE00(void) { - func_802BBC58(1); - set_camera_to_node(0); + camera_setType(CAMERA_TYPE_1_UNKNOWN); + ncStaticCamera_setToNode(0); } void func_8038CE28(void) @@ -822,7 +824,7 @@ void func_8038D3F0(s32 a0, s32 a1) void func_8038D48C(void) { func_8028F918(0); - func_802BAE4C(); + ncStaticCamera_exit(); func_802BC280(); } diff --git a/src/lair/code_C1C0.c b/src/lair/code_C1C0.c index c1ff70b5..37482c18 100644 --- a/src/lair/code_C1C0.c +++ b/src/lair/code_C1C0.c @@ -1,6 +1,7 @@ #include #include "functions.h" #include "variables.h" +#include "core2/nc/camera.h" Actor *func_803925B0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); void func_80392700(Actor *this); @@ -33,11 +34,11 @@ void func_80392610(ActorMarker *marker, enum asset_e text_id, s32 arg2){ else{ mapSpecificFlags_set(5, FALSE); } - set_camera_to_node(arg2); + ncStaticCamera_setToNode(arg2); } void func_80392664(ActorMarker *marker, enum asset_e text_id, s32 arg2){ - func_802BBC58(2); + camera_setType(CAMERA_TYPE_2_DYNAMIC); } void func_80392690(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -57,7 +58,7 @@ void func_80392700(Actor *this) { func_80311480(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610); } else { func_802BC280(); - set_camera_to_node(0x1F); + ncStaticCamera_setToNode(0x1F); func_80311480(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610); fileProgressFlag_set(FILEPROG_F4_ENTER_FF_CUTSCENE, TRUE); } @@ -66,7 +67,7 @@ void func_80392700(Actor *this) { if (mapSpecificFlags_get(6)) { func_8025A70C(COMUSIC_A8_KLUNGO_BY_FALLEN_GRUNTY); func_802BC280(); - set_camera_to_node(9); + ncStaticCamera_setToNode(9); mapSpecificFlags_set(9, 1); func_8028F94C(2, this->position); func_80311480(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610); @@ -105,7 +106,7 @@ void func_80392918(Actor *this) { func_80326224(this); if ((this->unk48 > 0.5) && !this->unk138_24) { this->unk138_24 = TRUE; - set_camera_to_node(0x1E); + ncStaticCamera_setToNode(0x1E); } if ((0.999 < this->unk48) && !this->unk38_0) { comusic_8025AB44(COMUSIC_A8_KLUNGO_BY_FALLEN_GRUNTY, 0, 2000); diff --git a/src/lair/code_C6C0.c b/src/lair/code_C6C0.c index 3a95672d..4c2d7221 100644 --- a/src/lair/code_C6C0.c +++ b/src/lair/code_C6C0.c @@ -17,7 +17,7 @@ void func_80392AB0(ActorMarker *marker, enum asset_e text_id, s32 arg2){ } void func_80392AF4(ActorMarker *marker, enum asset_e text_id, s32 arg2){ - set_camera_to_node(arg2); + ncStaticCamera_setToNode(arg2); } void func_80392B1C(ActorMarker *marker) { @@ -49,7 +49,7 @@ void func_80392B6C(Actor *this) { func_8025A70C(COMUSIC_A9_TOOTY); mapSpecificFlags_set(7, 0); mapSpecificFlags_set(9, 1); - set_camera_to_node(0x10); + ncStaticCamera_setToNode(0x10); func_8028F918(0); func_8028F85C(this->position); func_8028F3D8(this->unk1C, (f32) sp28, &func_80392B1C, this->marker);