diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b93183cd..7666fe4b 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3066,13 +3066,13 @@ entry__16dEnemySwordMdl_cFP12dAcObjBase_cP15dShadowCircle_cP7mQuat_c = .text:0x8 doCreate__13dCameraBase_cFl = .text:0x8006BBE0; // type:function size:0x70 doRemove__13dCameraBase_cFv = .text:0x8006BC50; // type:function size:0x18 doExecute__13dCameraBase_cFv = .text:0x8006BC70; // type:function size:0xA8 -onBecomeActive__13dCameraBase_cFv = .text:0x8006BD20; // type:function size:0x4 +onBecomeActive__13dCameraBase_cFv = .text:0x8006BD20; // type:function size:0x4 scope:weak doDraw__13dCameraBase_cFv = .text:0x8006BD30; // type:function size:0x24 -setView__13dCameraBase_cFRC7CamView = .text:0x8006BD60; // type:function size:0x44 -deactivate__13dCameraBase_cFv = .text:0x8006BDB0; // type:function size:0xC -activate__13dCameraBase_cFv = .text:0x8006BDC0; // type:function size:0xC -getView__13dCameraBase_cFv = .text:0x8006BDD0; // type:function size:0x8 -__dt__7CamViewFv = .text:0x8006BDE0; // type:function size:0x40 +setView__13dCameraBase_cFRC7CamView = .text:0x8006BD60; // type:function size:0x44 scope:weak +deactivate__13dCameraBase_cFv = .text:0x8006BDB0; // type:function size:0xC scope:weak +activate__13dCameraBase_cFv = .text:0x8006BDC0; // type:function size:0xC scope:weak +getView__13dCameraBase_cFv = .text:0x8006BDD0; // type:function size:0x8 scope:weak +__dt__7CamViewFv = .text:0x8006BDE0; // type:function size:0x40 scope:weak __dt__17dCameraGame_HIO_cFv = .text:0x8006BE20; // type:function size:0x40 debugNotif = .text:0x8006BE60; // type:function size:0x50 debugPrintf4__FPCce = .text:0x8006BEB0; // type:function size:0x50 @@ -3088,60 +3088,60 @@ getStyleIndex__13dCameraGame_cFUl = .text:0x8006C110; // type:function size:0x48 cacheIdxes__13dCameraGame_cFv = .text:0x8006C160; // type:function size:0x208 initCamParamDat__13dCameraGame_cFv = .text:0x8006C370; // type:function size:0xEC fn_8006C460 = .text:0x8006C460; // type:function size:0x6DC -fn_8006CB40 = .text:0x8006CB40; // type:function size:0x9C -fn_8006CBE0 = .text:0x8006CBE0; // type:function size:0x8 -fn_8006CBF0 = .text:0x8006CBF0; // type:function size:0x78 -fn_8006CC70 = .text:0x8006CC70; // type:function size:0x10 -fn_8006CC80 = .text:0x8006CC80; // type:function size:0x8 +doInit__17GameCameraHandlerFP13dCameraGame_cUsi = .text:0x8006CB40; // type:function size:0x9C +init__17GameCameraHandlerFv = .text:0x8006CBE0; // type:function size:0x8 +doExecute__17GameCameraHandlerFv = .text:0x8006CBF0; // type:function size:0x78 +vt_0x0C__17GameCameraHandlerFv = .text:0x8006CC70; // type:function size:0x10 +vt_0x10__17GameCameraHandlerFv = .text:0x8006CC80; // type:function size:0x8 fn_8006CC90 = .text:0x8006CC90; // type:function size:0x48 fn_8006CCE0 = .text:0x8006CCE0; // type:function size:0x164 searchForBossActor = .text:0x8006CE50; // type:function size:0xD8 -fn_8006CF30 = .text:0x8006CF30; // type:function size:0x2F4 -fn_8006D230 = .text:0x8006D230; // type:function size:0x1618 +init__19GameCameraHandler03Fv = .text:0x8006CF30; // type:function size:0x2F4 +vt_0x10__19GameCameraHandler03Fv = .text:0x8006D230; // type:function size:0x1618 fn_8006E850 = .text:0x8006E850; // type:function size:0x130 fn_8006E980 = .text:0x8006E980; // type:function size:0x108 fn_8006EA90 = .text:0x8006EA90; // type:function size:0x294 -fn_8006ED30 = .text:0x8006ED30; // type:function size:0x2F8 -fn_8006F030 = .text:0x8006F030; // type:function size:0x814 -fn_8006F850 = .text:0x8006F850; // type:function size:0x1F04 -fn_80071760 = .text:0x80071760; // type:function size:0x340 -fn_80071AA0 = .text:0x80071AA0; // type:function size:0x198 -fn_80071C40 = .text:0x80071C40; // type:function size:0x10F4 +init__19GameCameraHandler01Fv = .text:0x8006ED30; // type:function size:0x2F8 +vt_0x0C__19GameCameraHandler01Fv = .text:0x8006F030; // type:function size:0x814 +vt_0x10__19GameCameraHandler01Fv = .text:0x8006F850; // type:function size:0x1F04 +init__19GameCameraHandler02Fv = .text:0x80071760; // type:function size:0x340 +vt_0x0C__19GameCameraHandler02Fv = .text:0x80071AA0; // type:function size:0x198 +vt_0x10__19GameCameraHandler02Fv = .text:0x80071C40; // type:function size:0x10F4 fn_80072D40 = .text:0x80072D40; // type:function size:0x4E8 fn_80073230 = .text:0x80073230; // type:function size:0x414 -fn_80073650 = .text:0x80073650; // type:function size:0x384 -fn_800739E0 = .text:0x800739E0; // type:function size:0x1F0 -fn_80073BD0 = .text:0x80073BD0; // type:function size:0x760 -fn_80074330 = .text:0x80074330; // type:function size:0x698 -fn_800749D0 = .text:0x800749D0; // type:function size:0x748 +init__19GameCameraHandler04Fv = .text:0x80073650; // type:function size:0x384 +vt_0x10__19GameCameraHandler04Fv = .text:0x800739E0; // type:function size:0x1F0 +init__19GameCameraHandler05Fv = .text:0x80073BD0; // type:function size:0x760 +vt_0x0C__19GameCameraHandler05Fv = .text:0x80074330; // type:function size:0x698 +vt_0x10__19GameCameraHandler05Fv = .text:0x800749D0; // type:function size:0x748 fn_80075120 = .text:0x80075120; // type:function size:0x14 fn_80075140 = .text:0x80075140; // type:function size:0x14 fn_80075160 = .text:0x80075160; // type:function size:0x78 -fn_800751E0 = .text:0x800751E0; // type:function size:0x3C4 -fn_800755B0 = .text:0x800755B0; // type:function size:0xAE8 -fn_800760A0 = .text:0x800760A0; // type:function size:0x1BD4 -fn_80077C80 = .text:0x80077C80; // type:function size:0x2EC -fn_80077F70 = .text:0x80077F70; // type:function size:0x2D0 -fn_80078240 = .text:0x80078240; // type:function size:0x2F4 -fn_80078540 = .text:0x80078540; // type:function size:0x13C -fn_80078680 = .text:0x80078680; // type:function size:0x2E4 -fn_80078970 = .text:0x80078970; // type:function size:0x954 +init__19GameCameraHandler06Fv = .text:0x800751E0; // type:function size:0x3C4 +vt_0x0C__19GameCameraHandler06Fv = .text:0x800755B0; // type:function size:0xAE8 +vt_0x10__19GameCameraHandler06Fv = .text:0x800760A0; // type:function size:0x1BD4 +init__19GameCameraHandler07Fv = .text:0x80077C80; // type:function size:0x2EC +vt_0x0C__19GameCameraHandler07Fv = .text:0x80077F70; // type:function size:0x2D0 +vt_0x10__19GameCameraHandler07Fv = .text:0x80078240; // type:function size:0x2F4 +init__19GameCameraHandler08Fv = .text:0x80078540; // type:function size:0x13C +vt_0x0C__19GameCameraHandler08Fv = .text:0x80078680; // type:function size:0x2E4 +vt_0x10__19GameCameraHandler08Fv = .text:0x80078970; // type:function size:0x954 fn_800792D0 = .text:0x800792D0; // type:function size:0x254 -fn_80079530 = .text:0x80079530; // type:function size:0x28C -fn_800797C0 = .text:0x800797C0; // type:function size:0x56C -fn_80079D30 = .text:0x80079D30; // type:function size:0x1128 -fn_8007AE60 = .text:0x8007AE60; // type:function size:0x34 -fn_8007AEA0 = .text:0x8007AEA0; // type:function size:0x8 -fn_8007AEB0 = .text:0x8007AEB0; // type:function size:0x10 +init__19GameCameraHandler09Fv = .text:0x80079530; // type:function size:0x28C +vt_0x0C__19GameCameraHandler09Fv = .text:0x800797C0; // type:function size:0x56C +vt_0x10__19GameCameraHandler09Fv = .text:0x80079D30; // type:function size:0x1128 +init__19GameCameraHandler10Fv = .text:0x8007AE60; // type:function size:0x34 +vt_0x0C__19GameCameraHandler10Fv = .text:0x8007AEA0; // type:function size:0x8 +vt_0x10__19GameCameraHandler10Fv = .text:0x8007AEB0; // type:function size:0x10 fn_8007AEC0 = .text:0x8007AEC0; // type:function size:0xFC -fn_8007AFC0 = .text:0x8007AFC0; // type:function size:0x2E8 -fn_8007B2B0 = .text:0x8007B2B0; // type:function size:0x684 -fn_8007B940 = .text:0x8007B940; // type:function size:0x17CC -fn_8007D110 = .text:0x8007D110; // type:function size:0xAC -fn_8007D1C0 = .text:0x8007D1C0; // type:function size:0xADC -fn_8007DCA0 = .text:0x8007DCA0; // type:function size:0xE8 -fn_8007DD90 = .text:0x8007DD90; // type:function size:0x10 -fn_8007DDA0 = .text:0x8007DDA0; // type:function size:0x30 +init__19GameCameraHandler11Fv = .text:0x8007AFC0; // type:function size:0x2E8 +vt_0x0C__19GameCameraHandler11Fv = .text:0x8007B2B0; // type:function size:0x684 +vt_0x10__19GameCameraHandler11Fv = .text:0x8007B940; // type:function size:0x17CC +init__19GameCameraHandler12Fv = .text:0x8007D110; // type:function size:0xAC +vt_0x10__19GameCameraHandler12Fv = .text:0x8007D1C0; // type:function size:0xADC +loadStyle__8CamStyleFUs = .text:0x8007DCA0; // type:function size:0xE8 +getFloat__8CamStyleCFl = .text:0x8007DD90; // type:function size:0x10 +getFlag__8CamStyleCFl = .text:0x8007DDA0; // type:function size:0x30 __ct__17dCameraGame_HIO_cFv = .text:0x8007DDD0; // type:function size:0x33C create__17dCameraGame_HIO_cFv = .text:0x8007E110; // type:function size:0x4 remove__17dCameraGame_HIO_cFv = .text:0x8007E120; // type:function size:0x4 @@ -3150,26 +3150,26 @@ fn_8007E1B0__12UnkCamChecksFP12dAcObjBase_c = .text:0x8007E1B0; // type:function __ct__13dCameraGame_cFv = .text:0x8007E6D0; // type:function size:0x1CC create__13dCameraGame_cFv = .text:0x8007E8A0; // type:function size:0x230 execute__13dCameraGame_cFv = .text:0x8007EAD0; // type:function size:0x75C -fn_8007F230 = .text:0x8007F230; // type:function size:0x94 -fn_8007F2D0 = .text:0x8007F2D0; // type:function size:0x38 -fn_8007F310 = .text:0x8007F310; // type:function size:0x1EC -linChkAttentionTarget__FRC7mVec3_cRC7mVec3_cR11dBgS_LinChki = .text:0x8007F500; // type:function size:0xF4 +chkCamera__FR7mVec3_cR7mVec3_cP12dAcObjBase_c = .text:0x8007F230; // type:function size:0x94 +chkCo__FRC7mVec3_c = .text:0x8007F2D0; // type:function size:0x38 +chkCameraPoint__FRC7mVec3_cRC7mVec3_cR7mVec3_cP12dAcObjBase_c = .text:0x8007F310; // type:function size:0x1EC +linCrossAttentionTarget__FRC7mVec3_cRC7mVec3_cR11dBgS_LinChki = .text:0x8007F500; // type:function size:0xF4 linCross__FR11dBgS_LinChki = .text:0x8007F600; // type:function size:0x34 -camLinChkAttentionTarget__FRC7mVec3_cRC7mVec3_ci = .text:0x8007F640; // type:function size:0x70 +linCrossAttentionTarget__FRC7mVec3_cRC7mVec3_ci = .text:0x8007F640; // type:function size:0x70 linCrossAttentionTarget__FRC7mVec3_cRC7mVec3_cR7mVec3_c = .text:0x8007F6B0; // type:function size:0x130 -fn_8007F7E0 = .text:0x8007F7E0; // type:function size:0x384 -fn_8007FB70 = .text:0x8007FB70; // type:function size:0x168 -fn_8007FCE0 = .text:0x8007FCE0; // type:function size:0x128 -fn_8007FE10 = .text:0x8007FE10; // type:function size:0x268 +unkCamLineChk__FR14dBgS_CamLinChkR14dBgS_CamLinChkUl = .text:0x8007F7E0; // type:function size:0x384 +unkCamCallback1__FP11dBgS_SphChkP10cBgD_Vtx_tiiiP8cM3dGPlaPv = .text:0x8007FB70; // type:function size:0x168 +unkCamCallback2__FP11dBgS_SphChkP10cBgD_Vtx_tiiiP8cM3dGPlaPv = .text:0x8007FCE0; // type:function size:0x128 +fn_8007FE10__FR7mVec3_cR7mVec3_cR7mVec3_cf = .text:0x8007FE10; // type:function size:0x268 fn_80080080 = .text:0x80080080; // type:function size:0x10 fn_80080090 = .text:0x80080090; // type:function size:0x86C draw__13dCameraGame_cFv = .text:0x80080900; // type:function size:0x8 remove__13dCameraGame_cFv = .text:0x80080910; // type:function size:0x44 -fn_80080960__13dCameraGame_cFllScl = .text:0x80080960; // type:function size:0x118 -fn_80080A80 = .text:0x80080A80; // type:function size:0x6C -fn_80080AF0 = .text:0x80080AF0; // type:function size:0x10 +overrideCam__13dCameraGame_cFllsb = .text:0x80080960; // type:function size:0x118 +setCam__13dCameraGame_cFss = .text:0x80080A80; // type:function size:0x6C +setCam__13dCameraGame_cFRC5CamId = .text:0x80080AF0; // type:function size:0x10 clearCamIds__13dCameraGame_cFv = .text:0x80080B00; // type:function size:0x6C -fn_80080B70 = .text:0x80080B70; // type:function size:0x220 +getCamId__13dCameraGame_cFv = .text:0x80080B70; // type:function size:0x220 fn_80080D90 = .text:0x80080D90; // type:function size:0x7C8 getNewStyle = .text:0x80081560; // type:function size:0x34 getNewMode = .text:0x800815A0; // type:function size:0x440 @@ -3180,20 +3180,20 @@ doStyleChange = .text:0x80081F80; // type:function size:0x58 isCurrentTrend__13dCameraGame_cCFPCc = .text:0x80081FE0; // type:function size:0x40 setView__13dCameraGame_cFRC7CamView = .text:0x80082020; // type:function size:0xB4 onBecomeActive__13dCameraGame_cFv = .text:0x800820E0; // type:function size:0xC8 -fn_800821B0 = .text:0x800821B0; // type:function size:0xC0 +onBecomeInactive__13dCameraGame_cFv = .text:0x800821B0; // type:function size:0xC0 fn_80082270 = .text:0x80082270; // type:function size:0x44 fn_800822C0 = .text:0x800822C0; // type:function size:0x10 fn_800822D0 = .text:0x800822D0; // type:function size:0x24 fn_80082300 = .text:0x80082300; // type:function size:0xC __dt__13dCameraGame_cFv = .text:0x80082310; // type:function size:0xB0 __sinit_\d_camera_game_cpp = .text:0x800823C0; // type:function size:0xCF8 -fn_800830C0 = .text:0x800830C0; // type:function size:0x60 -fn_80083120 = .text:0x80083120; // type:function size:0x60 -fn_80083180 = .text:0x80083180; // type:function size:0x60 -fn_800831E0 = .text:0x800831E0; // type:function size:0x70 -fn_80083250 = .text:0x80083250; // type:function size:0x60 -fn_800832B0 = .text:0x800832B0; // type:function size:0x60 -fn_80083310 = .text:0x80083310; // type:function size:0x60 +__dt__19GameCameraHandler06Fv = .text:0x800830C0; // type:function size:0x60 +__dt__19GameCameraHandler08Fv = .text:0x80083120; // type:function size:0x60 +__dt__19GameCameraHandler02Fv = .text:0x80083180; // type:function size:0x60 +__dt__19GameCameraHandler03Fv = .text:0x800831E0; // type:function size:0x70 +__dt__19GameCameraHandler05Fv = .text:0x80083250; // type:function size:0x60 +__dt__19GameCameraHandler07Fv = .text:0x800832B0; // type:function size:0x60 +__dt__19GameCameraHandler11Fv = .text:0x80083310; // type:function size:0x60 debugPrintf = .text:0x80083370; // type:function size:0x50 debugErrorf = .text:0x800833C0; // type:function size:0x50 debugPrintMaybe = .text:0x80083410; // type:function size:0x54 @@ -19761,8 +19761,8 @@ CalcParticleAngle__4dCcSFP8cCcD_ObjP8cCcD_ObjP7mAng3_cb = .text:0x80356D20; // t fn_80356fd0__4dCcSFP7mVec3_cP8cCcD_ObjP8cCcD_Obj = .text:0x80356FD0; // type:function size:0x184 ProcAtTgHitmark__4dCcSFP8cCcD_ObjP8cCcD_ObjP7mVec3_cUlP7mVec3_c = .text:0x80357160; // type:function size:0x21C SetAtTgObjInf__4dCcSFbbP8cCcD_ObjP8cCcD_ObjP7mVec3_cb = .text:0x80357380; // type:function size:0x274 -ChkCamera__4dCcSFR7mVec3_cR7mVec3_cP12dAcObjBase_cP12dAcObjBase_cP12dAcObjBase_cf = .text:0x80357600; // type:function size:0x1E8 -ChkCameraPoint__4dCcSFRC7mVec3_cRC7mVec3_cR7mVec3_cP12dAcObjBase_cP12dAcObjBase_cP12dAcObjBase_cf = .text:0x803577F0; // type:function size:0x2D4 +ChkCamera__4dCcSFR7mVec3_cR7mVec3_cfP12dAcObjBase_cP12dAcObjBase_cP12dAcObjBase_c = .text:0x80357600; // type:function size:0x1E8 +ChkCameraPoint__4dCcSFRC7mVec3_cRC7mVec3_cR7mVec3_cfP12dAcObjBase_cP12dAcObjBase_cP12dAcObjBase_c = .text:0x803577F0; // type:function size:0x2D4 ChkCo__4dCcSFRC7mVec3_cP12dAcObjBase_c = .text:0x80357AD0; // type:function size:0x1B4 fn_80357c90__4dCcSFRC7mVec3_cRC7mVec3_cUlPPv = .text:0x80357C90; // type:function size:0x218 Set__4dCcSFP8cCcD_Obj = .text:0x80357EB0; // type:function size:0x13C @@ -30925,7 +30925,7 @@ lbl_8050E678 = .data:0x8050E678; // type:object size:0x40 lbl_8050E6B8 = .data:0x8050E6B8; // type:object size:0x7C lbl_8050E734 = .data:0x8050E734; // type:object size:0xA data:string lbl_8050E740 = .data:0x8050E740; // type:object size:0xB data:string -lbl_8050E750 = .data:0x8050E750; // type:object size:0xD0 +sCamDefs = .data:0x8050E750; // type:object size:0xD0 lbl_8050E820 = .data:0x8050E820; // type:object size:0xB data:string lbl_8050E82C = .data:0x8050E82C; // type:object size:0xE data:string lbl_8050E83C = .data:0x8050E83C; // type:object size:0x1D data:string @@ -30933,10 +30933,23 @@ lbl_8050E85C = .data:0x8050E85C; // type:object size:0x16 data:string lbl_8050E874 = .data:0x8050E874; // type:object size:0x15 data:string lbl_8050E88C = .data:0x8050E88C; // type:object size:0x16 data:string lbl_8050E8A4 = .data:0x8050E8A4; // type:object size:0xE data:string -lbl_8050E8B4 = .data:0x8050E8B4; // type:object size:0x110 -lbl_8050E9C4 = .data:0x8050E9C4; // type:object size:0xC -lbl_8050E9D0 = .data:0x8050E9D0; // type:object size:0x34 -lbl_8050EA04 = .data:0x8050EA04; // type:object size:0x14 +lbl_8050E8B4 = .data:0x8050E8B4; // type:object size:0xA data:string +__vt__19GameCameraHandler12 = .data:0x8050E8C0; // type:object size:0x14 +__vt__19GameCameraHandler11 = .data:0x8050E8D4; // type:object size:0x14 +__vt__19GameCameraHandler10 = .data:0x8050E8E8; // type:object size:0x14 +__vt__19GameCameraHandler09 = .data:0x8050E8FC; // type:object size:0x14 +__vt__19GameCameraHandler08 = .data:0x8050E910; // type:object size:0x14 +__vt__19GameCameraHandler07 = .data:0x8050E924; // type:object size:0x14 +__vt__19GameCameraHandler06 = .data:0x8050E938; // type:object size:0x14 +__vt__19GameCameraHandler05 = .data:0x8050E94C; // type:object size:0x14 +__vt__19GameCameraHandler04 = .data:0x8050E960; // type:object size:0x14 +__vt__19GameCameraHandler02 = .data:0x8050E974; // type:object size:0x14 +__vt__19GameCameraHandler01 = .data:0x8050E988; // type:object size:0x14 +__vt__19GameCameraHandler03 = .data:0x8050E99C; // type:object size:0x14 +__vt__17GameCameraHandler = .data:0x8050E9B0; // type:object size:0x14 +__vt__17dCameraGame_HIO_c = .data:0x8050E9C4; // type:object size:0xC +__vt__13dCameraGame_c = .data:0x8050E9D0; // type:object size:0x34 +__vt__19GameCameraHandler00 = .data:0x8050EA04; // type:object size:0x14 lbl_8050EA18 = .data:0x8050EA18; // type:object size:0x13 data:string lbl_8050EA2C = .data:0x8050EA2C; // type:object size:0x60 lbl_8050EA8C = .data:0x8050EA8C; // type:object size:0x54 @@ -51243,34 +51256,50 @@ sRumblePreset10__9dRumble_c = .bss:0x805A07F0; // type:object size:0xC data:4byt @LOCAL@getCurrentStageDirectory__22CurrentStageArcManagerFv@sStageDirTmp = .bss:0x805A0868; // type:object size:0x40 scope:local data:byte s_roomArcTmp = .bss:0x805A08A8; // type:object size:0x20 scope:local data:byte sHio = .bss:0x805A08C8; // type:object size:0x138 scope:local data:2byte -lbl_805A0A00 = .bss:0x805A0A00; // type:object size:0x28 data:byte -lbl_805A0A28 = .bss:0x805A0A28; // type:object size:0x28 data:byte -lbl_805A0A50 = .bss:0x805A0A50; // type:object size:0x28 data:byte -lbl_805A0A78 = .bss:0x805A0A78; // type:object size:0x28 data:byte -lbl_805A0AA0 = .bss:0x805A0AA0; // type:object size:0x28 data:byte -lbl_805A0AC8 = .bss:0x805A0AC8; // type:object size:0x28 data:byte -lbl_805A0AF0 = .bss:0x805A0AF0; // type:object size:0x28 data:byte -lbl_805A0B18 = .bss:0x805A0B18; // type:object size:0x28 data:byte -lbl_805A0B40 = .bss:0x805A0B40; // type:object size:0x28 data:byte -lbl_805A0B68 = .bss:0x805A0B68; // type:object size:0x28 data:byte -lbl_805A0B90 = .bss:0x805A0B90; // type:object size:0x28 data:byte -lbl_805A0BB8 = .bss:0x805A0BB8; // type:object size:0x28 data:byte -lbl_805A0BE0 = .bss:0x805A0BE0; // type:object size:0x28 data:byte -sTrendIdxes__13dCameraGame_c = .bss:0x805A0C08; // type:object size:0x90 data:4byte -lbl_805A0C98 = .bss:0x805A0C98; // type:object size:0x208 data:4byte -lbl_805A0EA0 = .bss:0x805A0EA0; // type:object size:0x28 data:byte -lbl_805A0EC8 = .bss:0x805A0EC8; // type:object size:0xD0 data:byte -lbl_805A0F98 = .bss:0x805A0F98; // type:object size:0x120 data:byte -lbl_805A10B8 = .bss:0x805A10B8; // type:object size:0xA8 data:byte -lbl_805A1160 = .bss:0x805A1160; // type:object size:0x84 data:byte -lbl_805A11E4 = .bss:0x805A11E4; // type:object size:0x9C data:byte -lbl_805A1280 = .bss:0x805A1280; // type:object size:0xC8 data:byte -lbl_805A1348 = .bss:0x805A1348; // type:object size:0x78 data:byte -lbl_805A13C0 = .bss:0x805A13C0; // type:object size:0xA0 data:byte -lbl_805A1460 = .bss:0x805A1460; // type:object size:0xA0 data:byte -lbl_805A1500 = .bss:0x805A1500; // type:object size:0x38 data:byte -lbl_805A1538 = .bss:0x805A1538; // type:object size:0xD8 data:byte -lbl_805A1610 = .bss:0x805A1610; // type:object size:0x50 data:byte +style00 = .bss:0x805A0A00; // type:object size:0x28 data:byte +style01 = .bss:0x805A0A28; // type:object size:0x28 data:byte +style02 = .bss:0x805A0A50; // type:object size:0x28 data:byte +style03 = .bss:0x805A0A78; // type:object size:0x28 data:byte +style04 = .bss:0x805A0AA0; // type:object size:0x28 data:byte +style05 = .bss:0x805A0AC8; // type:object size:0x28 data:byte +style06 = .bss:0x805A0AF0; // type:object size:0x28 data:byte +style07 = .bss:0x805A0B18; // type:object size:0x28 data:byte +style08 = .bss:0x805A0B40; // type:object size:0x28 data:byte +style09 = .bss:0x805A0B68; // type:object size:0x28 data:byte +style10 = .bss:0x805A0B90; // type:object size:0x28 data:byte +style11 = .bss:0x805A0BB8; // type:object size:0x28 data:byte +style12 = .bss:0x805A0BE0; // type:object size:0x28 data:byte +sTrendIdxes__13dCameraGame_c = .bss:0x805A0C08; // type:object size:0x84 data:4byte +lbl_805A0C8C = .bss:0x805A0C8C; // type:object size:0xC data:4byte +sRef = .bss:0x805A0C98; // type:object size:0xC scope:local data:4byte +sVecs1 = .bss:0x805A0CA8; // type:object size:0x20 scope:local data:4byte +sVecs2 = .bss:0x805A0CC8; // type:object size:0x20 scope:local data:4byte +sVecs3 = .bss:0x805A0CE8; // type:object size:0x20 scope:local data:4byte +sVecs4 = .bss:0x805A0D08; // type:object size:0x20 scope:local data:4byte +lbl_805A0D28 = .bss:0x805A0D28; // type:object size:0xC data:4byte +camHandlerUnused00 = .bss:0x805A0D38; // type:object size:0xB8 data:4byte +lbl_805A0DF0 = .bss:0x805A0DF0; // type:object size:0xC data:byte +camHandlerUnused01 = .bss:0x805A0E00; // type:object size:0xA0 data:byte +camHandler00 = .bss:0x805A0EA0; // type:object size:0x28 data:byte +camHandler01 = .bss:0x805A0EC8; // type:object size:0xC0 data:byte +lbl_805A0F88 = .bss:0x805A0F88; // type:object size:0xC data:byte +camHandler02 = .bss:0x805A0F98; // type:object size:0x110 data:byte +lbl_805A10A8 = .bss:0x805A10A8; // type:object size:0xC data:byte +camHandler03 = .bss:0x805A10B8; // type:object size:0xA8 data:byte +camHandler04 = .bss:0x805A1160; // type:object size:0x78 data:byte +lbl_805A11D8 = .bss:0x805A11D8; // type:object size:0xC data:byte +camHandler05 = .bss:0x805A11E4; // type:object size:0x8C data:byte +lbl_805A1270 = .bss:0x805A1270; // type:object size:0xC data:byte +camHandler06 = .bss:0x805A1280; // type:object size:0xB8 data:byte +lbl_805A1338 = .bss:0x805A1338; // type:object size:0xC data:byte +camHandler07 = .bss:0x805A1348; // type:object size:0x68 data:byte +lbl_805A13B0 = .bss:0x805A13B0; // type:object size:0xC data:byte +camHandler08 = .bss:0x805A13C0; // type:object size:0xA0 data:byte +camHandler09 = .bss:0x805A1460; // type:object size:0xA0 data:byte +camHandler10 = .bss:0x805A1500; // type:object size:0x28 data:byte +lbl_805A1528 = .bss:0x805A1528; // type:object size:0xC data:byte +camHandler11 = .bss:0x805A1538; // type:object size:0xD8 data:byte +camHandler12 = .bss:0x805A1610; // type:object size:0x50 data:byte lbl_805A1660 = .bss:0x805A1660; // type:object size:0x20 lbl_805A1680 = .bss:0x805A1680; // type:object size:0xF68 lbl_805A25E8 = .bss:0x805A25E8; // type:object size:0x50 diff --git a/configure.py b/configure.py index b686b70b..73b8c9be 100644 --- a/configure.py +++ b/configure.py @@ -484,7 +484,7 @@ config.libs = [ Object(Matching, "toBeSorted/actor_info.cpp"), Object(NonMatching, "toBeSorted/d_sword_swing_effect_mgr.cpp"), Object(NonMatching, "toBeSorted/d_enemy_sword_mdl.cpp"), - Object(NonMatching, "toBeSorted/d_camera_base.cpp"), + Object(Matching, "toBeSorted/d_camera_base.cpp"), Object(NonMatching, "toBeSorted/d_camera_game.cpp"), Object(NonMatching, "toBeSorted/d_camera_event.cpp"), Object(Matching, "toBeSorted/d_camera_map.cpp"), diff --git a/include/d/col/bg/d_bg_s_sph_chk.h b/include/d/col/bg/d_bg_s_sph_chk.h index b7c3a592..969918e3 100644 --- a/include/d/col/bg/d_bg_s_sph_chk.h +++ b/include/d/col/bg/d_bg_s_sph_chk.h @@ -8,7 +8,7 @@ struct cBgD_Vtx_t; class dBgS_SphChk; -typedef void *(*SphChk_Callback)(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); +typedef void (*SphChk_Callback)(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk { public: diff --git a/include/d/col/cc/d_cc_s.h b/include/d/col/cc/d_cc_s.h index 54f53be1..65b6d518 100644 --- a/include/d/col/cc/d_cc_s.h +++ b/include/d/col/cc/d_cc_s.h @@ -64,9 +64,9 @@ public: static u32 ProcAtTgHitmark(cCcD_Obj *, cCcD_Obj *, mVec3_c *, u32, mVec3_c *); static void SetAtTgObjInf(bool, bool, cCcD_Obj *, cCcD_Obj *, mVec3_c *, bool); - bool ChkCamera(mVec3_c &, mVec3_c &, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *, f32); + bool ChkCamera(mVec3_c &, mVec3_c &, f32, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *); bool - ChkCameraPoint(const mVec3_c &, const mVec3_c &, mVec3_c &, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *, f32); + ChkCameraPoint(const mVec3_c &, const mVec3_c &, mVec3_c &, f32, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *); bool ChkCo(const mVec3_c &, dAcObjBase_c *); bool fn_80357c90(const mVec3_c &, const mVec3_c &, u32, cCcD_ShapeAttr **, f32); diff --git a/include/toBeSorted/d_camera_base.h b/include/toBeSorted/d_camera_base.h index 53438ea4..1cff0e82 100644 --- a/include/toBeSorted/d_camera_base.h +++ b/include/toBeSorted/d_camera_base.h @@ -37,18 +37,10 @@ public: // vt at 0x28 /* vt 0x08 */ virtual void onBecomeActive() {} /* vt 0x0C */ virtual void onBecomeInactive() {} - /* vt 0x10 */ virtual bool create() { - return true; - } - /* vt 0x14 */ virtual bool remove() { - return true; - } - /* vt 0x18 */ virtual bool execute() { - return true; - } - /* vt 0x1C */ virtual bool draw() { - return true; - } + /* vt 0x10 */ virtual bool create(); + /* vt 0x14 */ virtual bool remove(); + /* vt 0x18 */ virtual bool execute(); + /* vt 0x1C */ virtual bool draw(); /* vt 0x20 */ virtual ~dCameraBase_c() {} /* vt 0x24 */ virtual CamView &getView() { // TODO - const? diff --git a/include/toBeSorted/d_camera_game.h b/include/toBeSorted/d_camera_game.h index 00f7832c..422451d7 100644 --- a/include/toBeSorted/d_camera_game.h +++ b/include/toBeSorted/d_camera_game.h @@ -10,6 +10,8 @@ #include "toBeSorted/d_camera_base.h" #include "toBeSorted/deg_angle_util.h" +class dCamera_c; + // Size: 0xC struct CamParamHeader { /* 0x00 */ u32 magic; @@ -22,8 +24,10 @@ struct CamParamHeader { // Size: 0xA #pragma pack(push, 2) struct CamParamStyle { - /* 0x00 */ u32 id; - /* 0x04 */ u8 _0x04[6]; + /* 0x00 */ u8 id[4]; + /* 0x04 */ u8 _0x04[2]; + /* 0x06 */ u16 floatParamOffset; + /* 0x08 */ u16 flagParamOffset; }; #pragma pack(pop) @@ -91,7 +95,7 @@ struct CamId { field_0x04 = 0; } - bool someCheck() const { + bool isValid() const { if (field_0x04 < 3 && roomId != dAcPy_c::GetLinkM()->mRoomID) { return false; } else { @@ -129,6 +133,44 @@ struct UnkCamChecks { void fn_8007E1B0(dAcObjBase_c *ac); }; +class CamStyle { +public: + void loadStyle(u16 styleIdx); + f32 getFloat(s32 idx) const; + bool getFlag(s32 idx) const; + + // TODO: Probably wrong + CamStyle(const UNKWORD &u1, const UNKWORD &u2, f32 *pFloats, s32 numFloats, u16 *pFlags, s32 numFlags) + : field_0x08(u1), + mpFloats(pFloats), + mpParamFloats(pFloats), + mNumFloats(numFloats), + mpFlags(pFlags), + mpParamFlags(pFlags), + mNumFlags(numFlags), + field_0x18(u1) { + mId[0] = '?'; + // TODO maybe implicitly generated + mId[4] = '\0'; + mId[3] = '\0'; + mId[2] = '\0'; + mId[1] = '\0'; + mStyleIndex = -1; + } + +private: + /* 0x00 */ u8 mId[5]; + /* 0x06 */ u16 mStyleIndex; + /* 0x08 */ UNKWORD field_0x08; + /* 0x0C */ f32 *mpFloats; + /* 0x10 */ const f32 *mpParamFloats; + /* 0x14 */ s32 mNumFloats; + /* 0x18 */ UNKWORD field_0x18; + /* 0x1C */ u16 *mpFlags; + /* 0x20 */ const u16 *mpParamFlags; + /* 0x24 */ s32 mNumFlags; +}; + class dCameraGame_c : public dCameraBase_c { public: static bool initCamParamDat(); @@ -138,6 +180,18 @@ public: static s32 sTrendIdxes[CAM_TREND_IDX_MAX]; static s32 sStyleIdxes[CAM_STYLE_IDX_MAX]; + static const CamParamStyle *getStyle(s32 idx) { + return &sStyles[idx]; + } + + static const f32 *getFloats(s32 idx) { + return &sFloats[idx]; + } + + static const u16 *getFlags(s32 idx) { + return &sFlags[idx]; + } + dCameraGame_c(); /* vt 0x08 */ virtual void onBecomeActive() override; /* vt 0x0C */ virtual void onBecomeInactive() override; @@ -155,16 +209,14 @@ public: bool getField_0x078() const { return field_0x078; } - + f32 getField_0x0AC() const { return field_0x0AC; } void clearCamIds(); - - bool isCurrentTrend(const char *name) const; - void fn_80080960(s32, s32, s8, s32); + bool isCurrentTrend(const char *name) const; void onFlag(u32 flag) { mFlags |= flag; @@ -174,7 +226,13 @@ public: mFlags &= ~flag; } + void overrideCam(s32 camId, s32 priority, s16 roomId, bool unk); + private: + CamId getCamId(); + void setCam(const CamId &id); + void setCam(s16 roomCamId, s16 roomId); + static void cacheIdxes(); static CamParamHeader *sHeader; diff --git a/src/REL/d/t/d_t_gate_to_ground.cpp b/src/REL/d/t/d_t_gate_to_ground.cpp index affb3d5e..281109b3 100644 --- a/src/REL/d/t/d_t_gate_to_ground.cpp +++ b/src/REL/d/t/d_t_gate_to_ground.cpp @@ -56,7 +56,8 @@ int dTgGateToGround_c::actorExecute() { } } else { if (params_00_00_00_FF != -1) { - dScGame_c::getCamera(0)->getGameCam1()->fn_80080960(params_00_00_00_FF, 0, mRoomID, 0); + // TODO Cast is maybe fake but I can't get overrideCam to match otherwise + dScGame_c::getCamera(0)->getGameCam1()->overrideCam(params_00_00_00_FF, 0, (u16)mRoomID, false); } delayFrames = 0; } diff --git a/src/d/col/bg/d_bg_s_acch.cpp b/src/d/col/bg/d_bg_s_acch.cpp index 39bc610a..63242f60 100644 --- a/src/d/col/bg/d_bg_s_acch.cpp +++ b/src/d/col/bg/d_bg_s_acch.cpp @@ -401,7 +401,7 @@ void dBgS_Acch::LineCheck(dBgS &bgs) { } while (i < GetTblSize()); } -extern "C" void *fn_80359C80(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); +extern "C" void fn_80359C80(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); void dBgS_Acch::SphCheck() { f32 height = field_0x1D0; diff --git a/src/d/col/cc/d_cc_s.cpp b/src/d/col/cc/d_cc_s.cpp index 01e67d6a..e5789bcd 100644 --- a/src/d/col/cc/d_cc_s.cpp +++ b/src/d/col/cc/d_cc_s.cpp @@ -98,11 +98,10 @@ u32 dCcS::ProcAtTgHitmark(cCcD_Obj *, cCcD_Obj *, mVec3_c *, u32, mVec3_c *) {} void dCcS::SetAtTgObjInf(bool, bool, cCcD_Obj *, cCcD_Obj *, mVec3_c *, bool) {} -bool dCcS::ChkCamera(mVec3_c &, mVec3_c &, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *, f32) {} +bool dCcS::ChkCamera(mVec3_c &, mVec3_c &, f32, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *) {} -bool dCcS::ChkCameraPoint( - const mVec3_c &, const mVec3_c &, mVec3_c &, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *, f32 -) {} +bool dCcS:: + ChkCameraPoint(const mVec3_c &, const mVec3_c &, mVec3_c &, f32, dAcObjBase_c *, dAcObjBase_c *, dAcObjBase_c *) {} bool dCcS::ChkCo(const mVec3_c &, dAcObjBase_c *) {} diff --git a/src/toBeSorted/d_camera_base.cpp b/src/toBeSorted/d_camera_base.cpp index 7949c539..986ba226 100644 --- a/src/toBeSorted/d_camera_base.cpp +++ b/src/toBeSorted/d_camera_base.cpp @@ -2,12 +2,21 @@ #include "common.h" -// TODO: Weak function order (CamView dtor needs to appear after a bunch of weak functions) -// TODO: I'm not sure why all those weak functions even got emitted here, there's nothing -// that forces the compiler to put anything here so using this as a hack. I really believe the -// text split is correct, and this file doesn't appear to have any other sections. -void CreatedCameraBase_cHack() { - dCameraBase_c *c = new dCameraBase_c(); +// All of these base functions and the vtable got stripped +bool dCameraBase_c::create() { + return true; +} + +bool dCameraBase_c::remove() { + return true; +} + +bool dCameraBase_c::execute() { + return true; +} + +bool dCameraBase_c::draw() { + return true; } bool dCameraBase_c::doCreate(s32 index) { diff --git a/src/toBeSorted/d_camera_game.cpp b/src/toBeSorted/d_camera_game.cpp index ba8677c3..4fc7d1a0 100644 --- a/src/toBeSorted/d_camera_game.cpp +++ b/src/toBeSorted/d_camera_game.cpp @@ -3,11 +3,14 @@ #include "toBeSorted/d_camera_game.h" #include "common.h" +#include "d/a/d_a_base.h" #include "d/a/d_a_player.h" #include "d/a/obj/d_a_obj_base.h" #include "d/col/bg/d_bg_s.h" #include "d/col/bg/d_bg_s_lin_chk.h" #include "d/col/bg/d_bg_s_roof_chk.h" +#include "d/col/bg/d_bg_s_sph_chk.h" +#include "d/col/cc/d_cc_s.h" #include "d/d_bzs_types.h" #include "d/d_player_act.h" #include "d/d_room.h" @@ -15,6 +18,7 @@ #include "d/d_stage.h" #include "m/m_angle.h" #include "m/m_vec.h" +#include "nw4r/math/math_types.h" #include "sized_string.h" #include "toBeSorted/arc_managers/oarc_manager.h" #include "toBeSorted/attention.h" @@ -28,15 +32,333 @@ public: void remove(); public: - /* 0x004 */ u8 _0x004[0x0E8 - 0x004]; + /* 0x004 */ u8 _0x004[0x0CE - 0x004]; + + /* 0x0CE */ s16 field_0x0CE; + + /* 0x0D0 */ u8 _0x0D0[0x0E8 - 0x0D0]; /* 0x0E8 */ f32 field_0x0E8; /* 0x0EC */ u8 _0x0EC[0x138 - 0x0EC]; }; -static dCameraGame_HIO_c sHio; dCameraGame_HIO_c::~dCameraGame_HIO_c() {} +static dCameraGame_HIO_c sHio; + +class GameCameraHandler { +public: + GameCameraHandler() : field_0x00(false), mStyleIdx(0), field_0x0C(0), mCounter(0) {} + + bool doInit(dCameraGame_c *cam, u16 u3, UNKWORD u4); + bool doExecute(); + +protected: + /* 0x00 */ bool field_0x00; + // vtable at 0x04 + /* vt 0x08 */ virtual bool init() { + return true; + } + /* vt 0x0C */ virtual bool vt_0x0C() { + return vt_0x10(); + } + /* vt 0x10 */ virtual bool vt_0x10() { + return true; + } + + /* 0x08 */ u16 mStyleIdx; + /* 0x0C */ UNKWORD field_0x0C; + /* 0x10 */ CamId field_0x10; + /* 0x18 */ dCamera_c *mpCamera; + /* 0x1C */ dCameraGame_c *mpGameCamera; + /* 0x20 */ dAcObjBase_c *field_0x20; + /* 0x24 */ UNKWORD mCounter; +}; + +// "Lockon" +class GameCameraHandler03 : public GameCameraHandler { +public: + GameCameraHandler03() {} + + virtual bool init() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ dAcRef_c field_0x28; + /* 0x34 */ dAcRef_c field_0x34; + /* 0x40 */ dPolar field_0x40; + /* 0x4C */ u8 _0x4C[0xA8 - 0x4C]; +}; + +class GameCameraHandler00 : public GameCameraHandler { +public: +private: +}; + +// "Chase" +class GameCameraHandler01 : public GameCameraHandler { +public: + GameCameraHandler01() : field_0x2C(0.0f), field_0xAC(0.0f), field_0xB0(0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ u8 _0x28[0x2C - 0x28]; + /* 0x2C */ f32 field_0x2C; + /* 0x30 */ u8 _0x30[0xAC - 0x30]; + /* 0xAC */ f32 field_0xAC; + /* 0xB0 */ f32 field_0xB0; + /* 0xB4 */ u8 _0xB4[0xC0 - 0xB4]; +}; + +class GameCameraHandler02 : public GameCameraHandler { +public: + GameCameraHandler02() : field_0x6C(0.0f, 0.0f, 0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + struct UnkStruct { + UnkStruct() : field_0x04(0.0f), field_0x08(0.0f), field_0x0C(0.0f) {} + + /* 0x00 */ u8 _0x00[0x04 - 0x00]; + /* 0x04 */ f32 field_0x04; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ f32 field_0x0C; + /* 0x10 */ u8 _0x10[0x18 - 0x10]; + }; + + /* 0x28 */ u8 _0x28[0x6C - 0x28]; + /* 0x6C */ mVec3_c field_0x6C; + /* 0x78 */ u8 _0x88[0x88 - 0x78]; + /* 0x88 */ dAcRef_c mRef; // not sure + /* 0x94 */ u8 _0x94[0xB0 - 0x94]; + /* 0xB0 */ UnkStruct field_0xB0[4]; +}; + +class GameCameraHandler04 : public GameCameraHandler { +public: + virtual bool init() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ u8 _0x28[0x6C - 0x28]; + /* 0x6C */ dPolar field_0x6C; +}; + +class GameCameraHandler05 : public GameCameraHandler { +public: + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ u8 _0x28[0x6C - 0x28]; + /* 0x6C */ dPolar field_0x6C; + /* 0x78 */ dAcRef_c field_0x78; + /* 0x84 */ u8 _0x84[0x8C - 0x84]; +}; + +class GameCameraHandler06 : public GameCameraHandler { +public: + GameCameraHandler06() : field_0x70(0.0f), field_0x9C(0.0f), field_0xA0(0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ dAcRef_c field_0x28; + /* 0x34 */ u8 _0x34[0x4C - 0x34]; + /* 0x4C */ dPolar field_0x4C; + /* 0x58 */ u8 _0x58[0x70 - 0x58]; + /* 0x70 */ f32 field_0x70; + /* 0x74 */ u8 _0x74[0x9C - 0x74]; + /* 0x9C */ f32 field_0x9C; + /* 0xA0 */ f32 field_0xA0; + /* 0xA4 */ u8 _0xA4[0xB8 - 0xA4]; +}; + +class GameCameraHandler07 : public GameCameraHandler { +public: + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ dAcRef_c field_0x28; + /* 0x34 */ u8 _0x34[0x68 - 0x34]; +}; + +class GameCameraHandler08 : public GameCameraHandler { +public: + GameCameraHandler08() : field_0x78(0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ dAcRef_c field_0x28; + /* 0x34 */ u8 _0x34[0x4C - 0x34]; + /* 0x4C */ dPolar field_0x4C; + /* 0x58 */ u8 _0x58[0x78 - 0x58]; + /* 0x78 */ f32 field_0x78; + /* 0x7C */ u8 _0x7C[0x94 - 0x7C]; + /* 0x94 */ dPolar field_0x94; +}; + +class GameCameraHandler09 : public GameCameraHandler { +public: + GameCameraHandler09() : field_0x2C(0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ u8 _0x28[0x2C - 0x28]; + /* 0x2C */ f32 field_0x2C; + /* 0x30 */ u8 _0x30[0xA0 - 0x30]; +}; + +class GameCameraHandler10 : public GameCameraHandler { +public: + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: +}; + +class GameCameraHandler11 : public GameCameraHandler { +public: + GameCameraHandler11() : field_0x38(0.0f), field_0xC4(0.0f) {} + + virtual bool init() override; + virtual bool vt_0x0C() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ dAcRef_c field_0x28; + /* 0x34 */ u8 _0x34[0x38 - 0x24]; + /* 0x38 */ f32 field_0x38; + /* 0x3C */ u8 _0x3C[0xC4 - 0x3C]; + /* 0xC4 */ f32 field_0xC4; +}; + +class GameCameraHandler12 : public GameCameraHandler { +public: + virtual bool init() override; + virtual bool vt_0x10() override; + +private: + /* 0x28 */ u8 _0x28[0x50 - 0x28]; +}; + +// TODO this sinit function is awful + +f32 floats00[] = {0.0f}; +u16 flags00[] = {0}; +CamStyle style00(0, 0, floats00, ARRAY_LENGTH(floats00), flags00, 1); +static UNKWORD word00; + +f32 floats01[] = { + 0.0f, 400.0f, 400.0f, 0.5f, 20.0f, 20.0f, 0.25f, 10.0f, 10.0f, 0.25f, + 60.0f, 60.0f, 0.15f, 0.4f, 0.5f, 1.0f, 25.0f, 0.0f, 1.0f, +}; +u16 flags01[] = {0x96}; +CamStyle style01(0, 0, floats01, ARRAY_LENGTH(floats01), flags01, 16); +static UNKWORD word01; + +f32 floats02[] = { + 0.0f, 0.0f, 20.0f, 0.0f, 50.0f, 0.0f, 20.0f, 8.0f, +}; +u16 flags02[] = {0}; +CamStyle style02(0, 0, floats02, ARRAY_LENGTH(floats02), flags02, 14); +static UNKWORD word02; + +f32 floats03[] = { + 0.0f, 100.0f, 1000.0f, 0.1f, 400.0f, 400.0f, 0.2f, 0.0f, 0.0f, 0.4f, 10.0f, 10.0f, + 0.2f, 50.0f, 20.0f, 0.2f, 50.0f, 50.0f, 0.2f, 0.6f, 0.0f, 1.0f, 0.0f, +}; +u16 flags03[] = {0x4A}; +CamStyle style03(0, 0, floats03, ARRAY_LENGTH(floats03), flags03, 8); +static UNKWORD word03; + +f32 floats04[] = { + 0.0f, 1.0f, 1.0f, 0.5f, 40.0f, 1000.0f, +}; +u16 flags04[] = {0x00}; +CamStyle style04(0, 0, floats04, ARRAY_LENGTH(floats04), flags04, 2); +static UNKWORD word04; + +f32 floats05[] = { + 0.0f, + 50.0f, + 1.0f, + 1.0f, +}; +u16 flags05[] = {0x2}; +CamStyle style05(0, 0, floats05, ARRAY_LENGTH(floats05), flags05, 4); +static UNKWORD word05; + +f32 floats06[] = { + 0.0f, 5.0f, 20.0f, 400.0f, 400.0f, 0.5f, 20.0f, 20.0f, 0.25f, 10.0f, 10.0f, 0.25f, 60.0f, + 60.0f, 0.15f, 0.4f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.2f, +}; +u16 flags06[] = {0x202}; +CamStyle style06(0, 0, floats06, ARRAY_LENGTH(floats06), flags06, 14); +static UNKWORD word06; + +f32 floats07[] = { + 0.0f, -1.0f, 0.0f, 1.0f, 0.5f, +}; +u16 flags07[] = {0x2}; +CamStyle style07(0, 0, floats07, ARRAY_LENGTH(floats07), flags07, 4); +static UNKWORD word07; + +f32 floats08[] = { + 0.0f, 5.0f, 20.0f, 400.0f, 400.0f, 0.5f, 20.0f, 20.0f, 0.25f, 10.0f, 10.0f, + 0.25f, 60.0f, 60.0f, 0.15f, 0.4f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, +}; +u16 flags08[] = {0x6}; +CamStyle style08(0, 0, floats08, ARRAY_LENGTH(floats08), flags08, 3); +static UNKWORD word08; + +f32 floats09[] = { + 0.0f, 400.0f, 400.0f, 0.5f, 20.0f, 20.0f, 0.25f, 60.0f, 10.0f, 0.25f, 60.0f, 60.0f, + 0.15f, 0.4f, 0.5f, 0.75f, 25.0f, 1.0f, 500.0f, 150.0f, 250.0f, 0.0f, 150.0f, 1.0f, +}; +u16 flags09[] = {0x46}; +CamStyle style09(0, 0, floats09, ARRAY_LENGTH(floats09), flags09, 7); +static UNKWORD word09; + +f32 floats10[] = { + 0.0f, +}; +u16 flags10[] = {0x00}; +CamStyle style10(0, 0, floats10, ARRAY_LENGTH(floats10), flags10, 1); +static UNKWORD word10; + +f32 floats11[] = { + 0.0f, 1000.0f, 5000.0f, 400.0f, 400.0f, 0.5f, 20.0f, 20.0f, 0.25f, 10.0f, 10.0f, 0.25f, 60.0f, + 60.0f, 0.15f, 0.4f, 0.5f, 1.0f, 25.0f, 0.0f, 1.0f, 75.0f, 0.0f, 0.0f, 300.0f, 1500.0f, +}; +u16 flags11[] = {0x116}; +CamStyle style11(0, 0, floats11, ARRAY_LENGTH(floats11), flags11, 10); +static UNKWORD word11; + +f32 floats12[] = { + 0.0f, 500.0f, 50.0f, 0.4f, 0.1f, 0.25f, +}; +u16 flags12[] = {0x00}; +CamStyle style12(0, 0, floats12, ARRAY_LENGTH(floats12), flags12, 2); +static UNKWORD word12; CamParamHeader *dCameraGame_c::sHeader; f32 *dCameraGame_c::sFloats; @@ -47,10 +369,55 @@ CamParamTrend *dCameraGame_c::sTrends; s32 dCameraGame_c::sTrendIdxes[CAM_TREND_IDX_MAX]; s32 dCameraGame_c::sStyleIdxes[CAM_STYLE_IDX_MAX]; +dAcRef_c sRef; + +struct CamVecBundleNotSure { + CamVecBundleNotSure(mVec3_c _00, mVec3_c _01, f32 _02, f32 _03) + : field_0x00(_00), field_0x0C(_01), field_0x18(_02), field_0x1C(_03) {} + /* 0x00 */ mVec3_c field_0x00; + /* 0x0C */ mVec3_c field_0x0C; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ f32 field_0x1C; +}; + +CamVecBundleNotSure sVecs1(mVec3_c(-550.0f, 500.0f, -1000.0f), mVec3_c(-150.0f, 320.0f, -350.0f), 60.0f, 0.0f); +CamVecBundleNotSure sVecs2(mVec3_c(-550.0f, 500.0f, -1000.0f), mVec3_c(-150.0f, -100.0f, -350.0f), 60.0f, 0.0f); +CamVecBundleNotSure sVecs3(mVec3_c(-900.0f, 680.0f, 850.0f), mVec3_c(-440.0f, 380.0f, 280.0f), 60.0f, 0.0f); +CamVecBundleNotSure sVecs4(mVec3_c(-90.0f, 80.0f, -285.0f), mVec3_c(0.0f, 100.0f, 0.0f), 55.0f, 0.0f); + +GameCameraHandler06 camHandlerUnused00; +GameCameraHandler08 camHandlerUnused01; + +GameCameraHandler00 camHandler00; +GameCameraHandler01 camHandler01; +GameCameraHandler02 camHandler02; +GameCameraHandler03 camHandler03; +GameCameraHandler04 camHandler04; +GameCameraHandler05 camHandler05; +GameCameraHandler06 camHandler06; +GameCameraHandler07 camHandler07; +GameCameraHandler08 camHandler08; +GameCameraHandler09 camHandler09; +GameCameraHandler10 camHandler10; +GameCameraHandler11 camHandler11; +GameCameraHandler12 camHandler12; + +// clang-format off +///////////////////////////////////////////////////////////////// +// // +// START ACTUAL CODE // +// // +///////////////////////////////////////////////////////////////// +// clang-format on + void debugPrintf4(const char *fmt, ...) { // no-op } +void debugPrintf6(UNKWORD a, UNKWORD b, const char *fmt, ...) { + // no-op +} + static s32 getCurrentRoomId() { return dAcPy_c::GetLinkM()->mRoomID; } @@ -84,8 +451,8 @@ s32 dCameraGame_c::getTrendIndex(const char *name) { s32 dCameraGame_c::getStyleIndex(u32 id) { for (int i = 0; i < sHeader->numStyles; i++) { - // Temp needed... inline? - s32 otherId = sStyles[i].id; + // Temp needed... + u32 otherId = *(u32 *)sStyles[i].id; if (otherId == id) { return i; } @@ -157,6 +524,246 @@ bool dCameraGame_c::initCamParamDat() { return true; } +bool GameCameraHandler::doInit(dCameraGame_c *cam, u16 u3, UNKWORD u4) { + mStyleIdx = u3; + field_0x0C = u4; + mCounter = 0; + field_0x00 = 0; + field_0x20 = dAcPy_c::GetLinkM(); + mpCamera = dScGame_c::getCamera(); + mpGameCamera = cam; + field_0x10 = cam->getCamId0x60(); + init(); + return true; +} + +bool GameCameraHandler::doExecute() { + field_0x20 = dAcPy_c::GetLinkM(); + if (!field_0x00) { + field_0x00 = vt_0x0C(); + } else { + field_0x00 = vt_0x10(); + } + mCounter++; + return field_0x00; +} + +bool GameCameraHandler03::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler03::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler01::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler01::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler01::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler02::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler02::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler02::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler04::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler04::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler05::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler05::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler05::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler06::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler06::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler06::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler07::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler07::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler07::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler08::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler08::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler08::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler09::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler09::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler09::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler10::init() { + // TODO - ... + // style10.loadStyle(mStyleIdx); + return true; +} + +bool GameCameraHandler10::vt_0x0C() { + return true; +} + +bool GameCameraHandler10::vt_0x10() { + field_0x20 = dAcPy_c::GetLinkM(); + return true; +} + +bool GameCameraHandler11::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler11::vt_0x0C() { + // TODO - ... + return true; +} + +bool GameCameraHandler11::vt_0x10() { + // TODO - ... + return true; +} + +bool GameCameraHandler12::init() { + // TODO - ... + return true; +} + +bool GameCameraHandler12::vt_0x10() { + // TODO - ... + return true; +} + +struct CameraDefinition { + /* 0x00 */ GameCameraHandler *pHandler; + /* 0x04 */ UNKWORD id; + /* 0x08 */ UNKWORD unk; + /* 0x0C */ CamStyle *pStyle; +}; + +CameraDefinition sCamDefs[] = { + {&camHandler00, 0, word00, &style00}, + {&camHandler01, 1, word01, &style01}, + {&camHandler02, 2, word02, &style02}, + {&camHandler03, 3, word03, &style03}, + {&camHandler04, 4, word04, &style04}, + {&camHandler05, 5, word05, &style05}, + {&camHandler06, 6, word06, &style06}, + {&camHandler07, 7, word07, &style07}, + {&camHandler08, 8, word08, &style08}, + {&camHandler09, 9, word09, &style09}, + {&camHandler10, 10, word10, &style10}, + {&camHandler11, 11, word11, &style11}, + {&camHandler12, 12, word12, &style12}, +}; + +void CamStyle::loadStyle(u16 styleIdx) { + mStyleIndex = styleIdx; + mId[0] = dCameraGame_c::getStyle(styleIdx)->id[0]; + mId[1] = dCameraGame_c::getStyle(styleIdx)->id[1]; + mId[2] = dCameraGame_c::getStyle(styleIdx)->id[2]; + mId[3] = dCameraGame_c::getStyle(styleIdx)->id[3]; + mId[4] = '\0'; + mpParamFloats = dCameraGame_c::getFloats(dCameraGame_c::getStyle(styleIdx)->floatParamOffset); + mpParamFlags = dCameraGame_c::getFlags(dCameraGame_c::getStyle(styleIdx)->flagParamOffset); + + for (int i = 0; i < mNumFloats; i++) { + mpFloats[i] = mpParamFloats[i]; + } + + // TODO: Why 14??? + for (int i = 0; i < mNumFlags; i += 14) { + mpFlags[i] = mpParamFlags[i]; + } +} + +f32 CamStyle::getFloat(s32 idx) const { + return mpFloats[idx]; +} + +bool CamStyle::getFlag(s32 flag) const { + return ((1 << (flag & ((1 << 14) - 1))) & mpFlags[flag >> 14]) != 0; +} + dCameraGame_HIO_c::dCameraGame_HIO_c() { // TODO - ... } @@ -243,7 +850,7 @@ void UnkCamChecks::fn_8007E1B0(dAcObjBase_c *ac) { if (mChk1.field_0x000 && ac == link && link->checkActionFlags(daPlayerActBase_c::FLG0_IN_WATER)) { mChk1.camId.roomCamId = dBgS::GetInstance()->GetRoomCamId(mChk1.chk); mChk1.camId.roomId = dBgS::GetInstance()->GetRoomId(mChk1.chk); - if (!mChk1.camId.someCheck()) { + if (!mChk1.camId.isValid()) { mChk1.camId.clear(); } } else { @@ -255,7 +862,7 @@ void UnkCamChecks::fn_8007E1B0(dAcObjBase_c *ac) { } else if (mChk2.field_0x000) { mChk2.camId.roomCamId = dBgS::GetInstance()->GetRoomCamId(mChk2.chk); mChk2.camId.roomId = dBgS::GetInstance()->GetRoomId(mChk2.chk); - if (!mChk2.camId.someCheck()) { + if (!mChk2.camId.isValid()) { mChk2.camId.clear(); } } else { @@ -352,42 +959,221 @@ bool dCameraGame_c::create() { return true; } -bool dCameraGame_c::draw() { - return true; +bool dCameraGame_c::execute() { + // TODO - ... } // TODO: make these static when they're actually used -inline bool linChkAttentionTarget_(const mVec3_c &from, const mVec3_c &to, dBgS_LinChk &chk) { +bool chkCamera(mVec3_c &v1, mVec3_c &v2, dAcObjBase_c *obj) { + dAcPy_c *link = dAcPy_c::GetLinkM(); + bool isNotLink = obj != nullptr && obj != link; + return dCcS::GetInstance()->ChkCamera( + v1, v2, 15.0f, link, isNotLink ? obj : nullptr, (dAcObjBase_c *)link->getLinkage().mControllingActor.p_owner + ); +} + +bool chkCo(const mVec3_c &v1) { + dAcPy_c *link = dAcPy_c::GetLinkM(); + return dCcS::GetInstance()->ChkCo(v1, link); +} + +bool chkCameraPoint(const mVec3_c &p2, const mVec3_c &p3, mVec3_c &result, dAcObjBase_c *obj) { + mVec3_c v1 = p3; + + // This matches but not sure about regalloc... + dAcPy_c *link = dAcPy_c::LINK; + int i; + + dAcObjBase_c *other = nullptr; + + if (obj != nullptr && obj != link) { + other = obj; + } + + mVec3_c v2 = p3; + + bool found; + dAcObjBase_c *controllingActor = (dAcObjBase_c *)link->getLinkage().mControllingActor.p_owner; + found = false; + + mVec3_c ret; + mVec3_c v3 = v2 - p2; + v3.normalize(); + v3 *= 2.0f; + + for (i = 0; i < 10; i++) { + ret = v1; + if (!dCcS::GetInstance()->ChkCameraPoint(p2, v2, v1, 15.0f, link, other, controllingActor)) { + break; + } + + if (p2 == v1) { + break; + } + found = true; + v2 = v1 - v3; + } + + if (found) { + debugPrintf6(400, 300, "CO %d", i); + result = ret; + } + return found; +} + +inline bool linCrossAttentionTarget_(const mVec3_c &from, const mVec3_c &to, dBgS_LinChk &chk) { dAcObjBase_c *ac = AttentionManager::GetInstance()->getTargetedActor(); chk.Set(&from, &to, ac); return dBgS::GetInstance()->LineCross(&chk); } -bool linChkAttentionTarget(const mVec3_c &from, const mVec3_c &to, dBgS_LinChk &chk, UNKWORD _ignored) { - return linChkAttentionTarget_(from, to, chk); +bool linCrossAttentionTarget(const mVec3_c &from, const mVec3_c &to, dBgS_LinChk &chk, UNKWORD _ignored) { + return linCrossAttentionTarget_(from, to, chk); } bool linCross(dBgS_LinChk &chk, UNKWORD _ignored) { return dBgS::GetInstance()->LineCross(&chk); } -bool camLinChkAttentionTarget(const mVec3_c &from, const mVec3_c &to, UNKWORD _ignored) { +bool linCrossAttentionTarget(const mVec3_c &from, const mVec3_c &to, UNKWORD _ignored) { dBgS_CamLinChk chk; - return linChkAttentionTarget(from, to, chk, _ignored); + return linCrossAttentionTarget(from, to, chk, _ignored); } bool linCrossAttentionTarget(const mVec3_c &from, const mVec3_c &to, mVec3_c &result) { dBgS_CamLinChk chk; - bool ret = linChkAttentionTarget_(from, to, chk); + bool ret = linCrossAttentionTarget_(from, to, chk); if (ret) { result = chk.GetLinEnd(); } return ret; } -bool dCameraGame_c::execute() { +u8 unkCamLineChk(dBgS_CamLinChk &chk1, dBgS_CamLinChk &chk2, u32 flags) { // TODO - ... + return 'W'; +} + +struct UnkCallbackArg { + UnkCallbackArg() : field_0x08(nullptr) {} + + void set(mVec3_c *v1, mVec3_c *v3, f32 f) { + field_0x00 = v1; + field_0x10 = v3; + field_0x14 = mVec3_c::Zero; + field_0x20 = mVec3_c::Zero; + field_0x04 = f; + field_0x08 = 0; + field_0x0C = 0.0f; + } + + /* 0x00 */ mVec3_c *field_0x00; + /* 0x04 */ f32 field_0x04; + /* 0x08 */ UNKWORD field_0x08; + /* 0x0C */ f32 field_0x0C; + /* 0x10 */ mVec3_c *field_0x10; + /* 0x14 */ mVec3_c field_0x14; + /* 0x20 */ mVec3_c field_0x20; +}; + + +void unkCamCallback1(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *plane, void *cbArg) { + UnkCallbackArg *arg = static_cast(cbArg); + f32 f = cM3d_SignedLenPlaAndPos(plane, arg->field_0x00); + + // TODO Regswap + if (plane->mD + nw4r::math::VEC3Dot(plane->mNormal, arg->field_0x10) >= -2.0f && f > -arg->field_0x04 && f < arg->field_0x04) { + mVec3_c n = plane->mNormal; + f32 t2 = (arg->field_0x04 + 0.001f - f); + + if (arg->field_0x0C < t2) { + arg->field_0x0C = t2; + } + + mVec3_c tmp = n * t2; + arg->field_0x08++; + if (tmp.x > arg->field_0x14.x) { + arg->field_0x14.x = tmp.x; + } + if (tmp.y > arg->field_0x14.y) { + arg->field_0x14.y = tmp.y; + } + if (tmp.z > arg->field_0x14.z) { + arg->field_0x14.z = tmp.z; + } + if (tmp.x < arg->field_0x20.x) { + arg->field_0x20.x = tmp.x; + } + if (tmp.y < arg->field_0x20.y) { + arg->field_0x20.y = tmp.y; + } + if (tmp.z < arg->field_0x20.z) { + arg->field_0x20.z = tmp.z; + } + } +} + +void unkCamCallback2(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *plane, void *cbArg) { + UnkCallbackArg *arg = static_cast(cbArg); + f32 f = cM3d_SignedLenPlaAndPos(plane, arg->field_0x00); + + // TODO Regswap + if (plane->mD + nw4r::math::VEC3Dot(plane->mNormal, arg->field_0x10) >= -2.0f && f > -arg->field_0x04 && f < arg->field_0x04) { + mVec3_c n = plane->mNormal; + mVec3_c tmp = n * (arg->field_0x04 + 0.001f - f); + arg->field_0x08++; + if (std::fabsf(tmp.x) > arg->field_0x14.x) { + arg->field_0x14.x = tmp.x; + } + if (std::fabsf(tmp.y) > arg->field_0x14.y) { + arg->field_0x14.y = tmp.y; + } + if (std::fabsf(tmp.z) > arg->field_0x14.z) { + arg->field_0x14.z = tmp.z; + } + } +} + + +void fn_8007FE10(mVec3_c &v1, mVec3_c &v2, mVec3_c &v3, f32 f) { + v1 = v2; + + dBgS_CamSphChk chk; + UnkCallbackArg arg; + + chk.mCallback = unkCamCallback1; + + for (int i = 0; i < sHio.field_0x0CE; i++) { + arg.set(&v1, &v3, f); + + chk.Set(&v1, f); + + if (!dBgS::GetInstance()->SphChk(&chk, &arg)) { + break; + } + + if (arg.field_0x0C < 0.0f) { + break; + } + + arg.field_0x14 += arg.field_0x20; + arg.field_0x14.normalize(); + arg.field_0x14 *= arg.field_0x0C; + v1 += arg.field_0x14; + } + + chk.mCallback = unkCamCallback2; + chk.Set(&v1, f); + arg.set(&v1, &v3, f); + + if (dBgS::GetInstance()->SphChk(&chk, &arg)) { + v1 += arg.field_0x14; + } +} + +bool dCameraGame_c::draw() { + return true; } bool dCameraGame_c::remove() { @@ -400,6 +1186,46 @@ bool dCameraGame_c::remove() { return true; } +void dCameraGame_c::overrideCam(s32 camId, s32 priority, s16 roomId, bool unk) { + if (priority < field_0x094) { + return; + } + + field_0x094 = priority; + if (roomId < 0) { + roomId = getCurrentRoomId(); + } + + if (camId == -1) { + if (field_0x086.isValid()) { + field_0x086.clear(); + } + } else { + (void)getCam(camId, roomId); + field_0x086.roomCamId = camId; + field_0x086.roomId = roomId; + s16 val = 1; + if (unk) { + val = 2; + } + field_0x086.field_0x04 = val; + } +} + +void dCameraGame_c::setCam(s16 roomCamId, s16 roomId) { + if (roomId < 0) { + roomId = getCurrentRoomId(); + } + (void)getCam(roomCamId, roomId); + field_0x080.roomCamId = roomCamId; + field_0x080.roomId = roomId; + field_0x080.field_0x04 = 3; +} + +void dCameraGame_c::setCam(const CamId &id) { + setCam(id.roomCamId, id.roomId); +} + void dCameraGame_c::clearCamIds() { field_0x086.clear(); field_0x080.clear(); @@ -407,6 +1233,23 @@ void dCameraGame_c::clearCamIds() { mChk.field_0x16C.clear(); } +CamId dCameraGame_c::getCamId() { + CamId ret = field_0x060; + if (field_0x080.isValid()) { + ret = field_0x080; + } else if (field_0x086.isValid()) { + ret = field_0x086; + } else if (mChk.field_0x164.isValid()) { + ret = mChk.field_0x164; + } else if (mChk.field_0x16C.isValid()) { + ret = mChk.field_0x16C; + } else { + ret.clear(); + } + + return ret; +} + bool dCameraGame_c::isCurrentTrend(const char *name) const { return getTrendIndex(name) == mCurrentTrendIdx; } diff --git a/src/toBeSorted/d_camera_map.cpp b/src/toBeSorted/d_camera_map.cpp index 7adec892..9e29822e 100644 --- a/src/toBeSorted/d_camera_map.cpp +++ b/src/toBeSorted/d_camera_map.cpp @@ -74,7 +74,7 @@ mVec3_c fn_800929C0(const mVec3_c &p2, const mVec3_c &p3, dAcObjBase_c *obj) { for (int i = 0; i < 3; i++) { ret = v1; - if (!dCcS::GetInstance()->ChkCameraPoint(p2, v2, v1, link, other, controllingActor, 15.0f)) { + if (!dCcS::GetInstance()->ChkCameraPoint(p2, v2, v1, 15.0f, link, other, controllingActor)) { break; } if (p2 == v1) {