summaryrefslogtreecommitdiff
path: root/src/d
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-19 15:54:06 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-19 15:54:06 -0400
commit0fdc3a3f3b1bd96ad65ccee764967e964b3a7eab (patch)
tree9ef686e600e7f192b24036d3d0303f12f3de07aa /src/d
parent9f18a6f34c4d96e54e52abdbcf287a7bfcf6c8e4 (diff)
Cleanup/documentation for various photo-related code
Diffstat (limited to 'src/d')
-rw-r--r--src/d/actor/d_a_npc_ah.cpp2
-rw-r--r--src/d/actor/d_a_npc_bmsw.cpp2
-rw-r--r--src/d/actor/d_a_npc_bs1.cpp2
-rw-r--r--src/d/actor/d_a_npc_btsw.cpp2
-rw-r--r--src/d/actor/d_a_npc_btsw2.cpp2
-rw-r--r--src/d/actor/d_a_npc_cb1.cpp2
-rw-r--r--src/d/actor/d_a_npc_fa1.cpp2
-rw-r--r--src/d/actor/d_a_npc_ho.cpp2
-rw-r--r--src/d/actor/d_a_npc_hr.cpp2
-rw-r--r--src/d/actor/d_a_npc_ji1.cpp2
-rw-r--r--src/d/actor/d_a_npc_km1.cpp2
-rw-r--r--src/d/actor/d_a_npc_ls1.cpp2
-rw-r--r--src/d/actor/d_a_npc_md.cpp2
-rw-r--r--src/d/actor/d_a_npc_mk.cpp2
-rw-r--r--src/d/actor/d_a_npc_mt.cpp37
-rw-r--r--src/d/actor/d_a_npc_people.cpp409
-rw-r--r--src/d/actor/d_a_npc_photo.cpp2
-rw-r--r--src/d/actor/d_a_npc_roten.cpp2
-rw-r--r--src/d/actor/d_a_npc_rsh1.cpp2
-rw-r--r--src/d/actor/d_a_npc_tt.cpp2
-rw-r--r--src/d/actor/d_a_npc_zl1.cpp2
-rw-r--r--src/d/d_kankyo_rain.cpp6
-rw-r--r--src/d/d_msg.cpp14
-rw-r--r--src/d/d_picture_box.cpp197
-rw-r--r--src/d/d_snap.cpp68
25 files changed, 413 insertions, 356 deletions
diff --git a/src/d/actor/d_a_npc_ah.cpp b/src/d/actor/d_a_npc_ah.cpp
index 38052147..50451613 100644
--- a/src/d/actor/d_a_npc_ah.cpp
+++ b/src/d/actor/d_a_npc_ah.cpp
@@ -339,7 +339,7 @@ bool daNpcAh_c::_draw() {
mObjAcch.GetGroundH(),
mObjAcch.m_gnd,
&tevStr);
- dSnap_RegistFig(DSNAP_TYPE_UNK7F, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_AH, this, 1.0f, 1.0f, 1.0f);
return true;
}
diff --git a/src/d/actor/d_a_npc_bmsw.cpp b/src/d/actor/d_a_npc_bmsw.cpp
index 08208942..dea9cfb7 100644
--- a/src/d/actor/d_a_npc_bmsw.cpp
+++ b/src/d/actor/d_a_npc_bmsw.cpp
@@ -1065,7 +1065,7 @@ BOOL daNpc_Bmsw_c::_draw() {
}
mpShopCursor->draw();
- dSnap_RegistFig(DSNAP_TYPE_BMSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_BMSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp
index b14f3a28..8e6d044f 100644
--- a/src/d/actor/d_a_npc_bs1.cpp
+++ b/src/d/actor/d_a_npc_bs1.cpp
@@ -2065,7 +2065,7 @@ BOOL daNpc_Bs1_c::_draw() {
}
}
- dSnap_RegistFig(DSNAP_TYPE_BS, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_BS1, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_btsw.cpp b/src/d/actor/d_a_npc_btsw.cpp
index 984a9378..5f1c8d35 100644
--- a/src/d/actor/d_a_npc_btsw.cpp
+++ b/src/d/actor/d_a_npc_btsw.cpp
@@ -917,7 +917,7 @@ BOOL daNpc_Btsw_c::_draw() {
}
mpShopCursor->draw();
- dSnap_RegistFig(DSNAP_TYPE_BTSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_BTSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_btsw2.cpp b/src/d/actor/d_a_npc_btsw2.cpp
index 5704d27b..3d0515fd 100644
--- a/src/d/actor/d_a_npc_btsw2.cpp
+++ b/src/d/actor/d_a_npc_btsw2.cpp
@@ -629,7 +629,7 @@ BOOL daNpc_Btsw2_c::_draw() {
current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr
);
- dSnap_RegistFig(DSNAP_TYPE_BTSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_BTSW, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_cb1.cpp b/src/d/actor/d_a_npc_cb1.cpp
index 586fe34f..d4e4bb85 100644
--- a/src/d/actor/d_a_npc_cb1.cpp
+++ b/src/d/actor/d_a_npc_cb1.cpp
@@ -3081,7 +3081,7 @@ BOOL daNpc_Cb1_c::draw() {
}
}
- dSnap_RegistFig(DSNAP_TYPE_CB1, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_CB1, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_fa1.cpp b/src/d/actor/d_a_npc_fa1.cpp
index df65cf12..500f5547 100644
--- a/src/d/actor/d_a_npc_fa1.cpp
+++ b/src/d/actor/d_a_npc_fa1.cpp
@@ -308,7 +308,7 @@ BOOL daNpc_Fa1_c::_draw() {
dComIfGd_setSimpleShadow(&current.pos, ground_y, 10.0f, &m774, 0, 1.0f,
dDlst_shadowControl_c::getSimpleTex());
}
- dSnap_RegistFig(DSNAP_TYPE_FA, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_FA1, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_ho.cpp b/src/d/actor/d_a_npc_ho.cpp
index 6c60b653..f43a07fd 100644
--- a/src/d/actor/d_a_npc_ho.cpp
+++ b/src/d/actor/d_a_npc_ho.cpp
@@ -779,7 +779,7 @@ BOOL daNpc_Ho_c::_draw() {
current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr
);
- dSnap_RegistFig(DSNAP_TYPE_HO, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_HO, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_hr.cpp b/src/d/actor/d_a_npc_hr.cpp
index 32351e9b..68c962ff 100644
--- a/src/d/actor/d_a_npc_hr.cpp
+++ b/src/d/actor/d_a_npc_hr.cpp
@@ -1976,7 +1976,7 @@ BOOL daNpc_Hr_c::_draw() {
mpAntennaMorf->updateDL();
mBtpAnm.remove(modelData);
if (getShapeType() == 1 && mState == HR_STATE_RT_ANGRY) {
- dSnap_RegistFig(DSNAP_TYPE_HR, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_HR, this, 1.0f, 1.0f, 1.0f);
}
return TRUE;
diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp
index 212ade85..152c59b0 100644
--- a/src/d/actor/d_a_npc_ji1.cpp
+++ b/src/d/actor/d_a_npc_ji1.cpp
@@ -4990,7 +4990,7 @@ BOOL daNpc_Ji1_c::_draw() {
dComIfGd_addRealShadow(mShadowId, mpSpearMorf->getModel());
}
- dSnap_RegistFig(DSNAP_TYPE_JI1, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_JI1, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return true;
}
diff --git a/src/d/actor/d_a_npc_km1.cpp b/src/d/actor/d_a_npc_km1.cpp
index 368fde64..856877df 100644
--- a/src/d/actor/d_a_npc_km1.cpp
+++ b/src/d/actor/d_a_npc_km1.cpp
@@ -639,7 +639,7 @@ BOOL daNpc_Km1_c::_draw() {
dComIfG_Bgsp()->GetTriPla(mObjAcch.m_gnd)->GetNP()
);
}
- dSnap_RegistFig(DSNAP_TYPE_KM1,this,1.0f,1.0f,1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_KM1,this,1.0f,1.0f,1.0f);
// Color literals for debug drawing. Unused in non-debug builds.
(GXColor){0xFF,0x00, 0x00, 0x80};
diff --git a/src/d/actor/d_a_npc_ls1.cpp b/src/d/actor/d_a_npc_ls1.cpp
index 6eb584b7..b34d80e8 100644
--- a/src/d/actor/d_a_npc_ls1.cpp
+++ b/src/d/actor/d_a_npc_ls1.cpp
@@ -2106,7 +2106,7 @@ BOOL daNpc_Ls1_c::_draw() {
}
shadowDraw();
- dSnap_RegistFig(DSNAP_TYPE_LS1, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_LS1, this, 1.0f, 1.0f, 1.0f);
// Does nothing
if (l_HIO.mPrm.m18) {
diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp
index 8df4779e..1f3282a2 100644
--- a/src/d/actor/d_a_npc_md.cpp
+++ b/src/d/actor/d_a_npc_md.cpp
@@ -5786,7 +5786,7 @@ BOOL daNpc_Md_c::draw() {
}
}
- dSnap_RegistFig(DSNAP_TYPE_MD, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_MD, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_mk.cpp b/src/d/actor/d_a_npc_mk.cpp
index c3f25a15..6059246c 100644
--- a/src/d/actor/d_a_npc_mk.cpp
+++ b/src/d/actor/d_a_npc_mk.cpp
@@ -1530,7 +1530,7 @@ BOOL daNpc_Mk_c::_draw() {
current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr
);
- dSnap_RegistFig(DSNAP_TYPE_MK, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_MK, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_mt.cpp b/src/d/actor/d_a_npc_mt.cpp
index bd608380..5f8f347a 100644
--- a/src/d/actor/d_a_npc_mt.cpp
+++ b/src/d/actor/d_a_npc_mt.cpp
@@ -913,25 +913,23 @@ u16 daNpcMt_c::next_msgStatus(u32* pMsgNo) {
/* 00001A8C-00001FC8 .text getMsg__9daNpcMt_cFv */
u32 daNpcMt_c::getMsg() {
- u8 uVar2;
-
u32 msgNo = 0;
mpMsgTbl = NULL;
if (g_dComIfG_gameInfo.play.getEvent()->chkPhoto()){
- uVar2 = changePhotoNo(dComIfGp_getPictureResult());
- if ((uVar2 <= 0x48) || (uVar2 >= 0xcf)) {
- uVar2 = 0xff;
+ u8 photoNo = changePhotoNo(dComIfGp_getPictureResult());
+ if ((photoNo <= DSNAP_TYPE_UNK48) || (photoNo >= DSNAP_TYPE_UNKCF)) {
+ photoNo = 0xff;
}
else {
- uVar2 = dSnap_PhotoIndex2TableIndex(uVar2) & 0xff;
+ photoNo = dSnap_PhotoIndex2TableIndex(photoNo);
}
- if (dComIfGp_getPictureFormat() == 0 || dComIfGp_getPictureFormat() == 1) {
+ if (dComIfGp_getPictureFormat() == GX_TF_I4 || dComIfGp_getPictureFormat() == GX_TF_I8) {
mpMsgTbl = l_msg_mt_no_color;
}
- else if (uVar2 == 0xff) {
+ else if (photoNo == 0xff) {
mpMsgTbl = l_msg_mt_no_figure;
}
- else if (isFigureGet(uVar2)) {
+ else if (isFigureGet(photoNo)) {
mpMsgTbl = l_msg_mt_maked;
}
else if (dComIfGp_getPictureResultDetail() == 1) {
@@ -940,19 +938,20 @@ u32 daNpcMt_c::getMsg() {
else if (dComIfGp_getPictureResultDetail() == 2) {
mpMsgTbl = l_msg_mt_body_ng;
}
+ // !@bug: dComIfGp_getPictureResultDetail() == 3 is never checked
else {
dComIfGs_onEventBit(dSv_event_flag_c::UNK_2F01);
dComIfGs_onEventBit(dSv_event_flag_c::UNK_3401);
- dComIfGs_setEventReg(dSv_event_flag_c::UNK_A9FF, uVar2);
+ dComIfGs_setEventReg(dSv_event_flag_c::UNK_A9FF, photoNo);
s32 bVar1 = 0;
if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_3A01)) {
bVar1 = 1;
}
- switch(uVar2) {
- case 0x5e:
+ switch(photoNo) {
+ case DSNAP_TYPE_NPC_PHOTO:
mpMsgTbl = l_msg_mt_make_mt[bVar1];
break;
- case 0x5f:
+ case DSNAP_TYPE_NPC_RSH1:
mpMsgTbl = l_msg_mt_make_mn[bVar1];
break;
default:
@@ -1404,14 +1403,14 @@ BOOL daNpcMt_c::isComp() {
/* 00002D08-00002D4C .text changePhotoNo__9daNpcMt_cFUc */
u8 daNpcMt_c::changePhotoNo(u8 photoNo) {
switch(photoNo) {
- case 2:
- photoNo = 0x69;
+ case DSNAP_TYPE_BIKUTSUKI:
+ photoNo = DSNAP_TYPE_NPC_UO2;
break;
- case 4:
- photoNo = 0x67;
+ case DSNAP_TYPE_UNK04:
+ photoNo = DSNAP_TYPE_NPC_UW2;
break;
- case 6:
- photoNo = 0x6d;
+ case DSNAP_TYPE_UNK06:
+ photoNo = DSNAP_TYPE_NPC_UB4;
}
return photoNo;
}
diff --git a/src/d/actor/d_a_npc_people.cpp b/src/d/actor/d_a_npc_people.cpp
index 4e98a599..9cde0d5f 100644
--- a/src/d/actor/d_a_npc_people.cpp
+++ b/src/d/actor/d_a_npc_people.cpp
@@ -24,6 +24,28 @@
#include "res/Object/Sa.h"
#include "res/Object/Ug.h"
+enum NpcNo_e {
+ /* 0x00 */ NPC_UO1,
+ /* 0x01 */ NPC_UO2,
+ /* 0x02 */ NPC_UO3,
+ /* 0x03 */ NPC_UB1,
+ /* 0x04 */ NPC_UB2,
+ /* 0x05 */ NPC_UB3,
+ /* 0x06 */ NPC_UB4,
+ /* 0x07 */ NPC_UW1,
+ /* 0x08 */ NPC_UW2,
+ /* 0x09 */ NPC_UM1,
+ /* 0x0A */ NPC_UM2,
+ /* 0x0B */ NPC_UM3,
+ /* 0x0C */ NPC_SA1,
+ /* 0x0D */ NPC_SA2,
+ /* 0x0E */ NPC_SA3,
+ /* 0x0F */ NPC_SA4,
+ /* 0x10 */ NPC_SA5,
+ /* 0x11 */ NPC_UG1,
+ /* 0x12 */ NPC_UG2,
+};
+
static char* l_npc_staff_id[] = {
"Uo1",
"Uo2",
@@ -3851,7 +3873,7 @@ struct PsoData {
/* 0x14 */ s16 field_0x14;
/* 0x16 */ u8 field_0x16;
/* 0x17 */ u8 field_0x17;
- /* 0x18 */ u8 field_0x18;
+ /* 0x18 */ u8 photoNo;
}; // Size: 0x19
static PsoData l_pso_uo2 = {
@@ -3863,7 +3885,7 @@ static PsoData l_pso_uo2 = {
0x0000,
0xFF,
0x04,
- 0x02,
+ DSNAP_TYPE_BIKUTSUKI,
};
static PsoData l_pso_uo3 = {
@@ -3875,7 +3897,7 @@ static PsoData l_pso_uo3 = {
0x0000,
0xFF,
0x04,
- 0x01,
+ DSNAP_TYPE_POST,
};
static PsoData l_pso_ub4 = {
@@ -3891,7 +3913,7 @@ static PsoData l_pso_ub4 = {
0x0000,
0xFF,
0x04,
- 0x06,
+ DSNAP_TYPE_UNK06,
};
static PsoData l_pso_uw2 = {
@@ -3903,7 +3925,7 @@ static PsoData l_pso_uw2 = {
0x0000,
0xFF,
0x04,
- 0x03,
+ DSNAP_TYPE_COUPLE_LOOK,
};
static PsoData l_pso_uw2_2 = {
@@ -3915,7 +3937,7 @@ static PsoData l_pso_uw2_2 = {
0x0000,
0xFF,
0x04,
- 0x04,
+ DSNAP_TYPE_UNK04,
};
static PsoData l_pso_um2 = {
@@ -3927,7 +3949,7 @@ static PsoData l_pso_um2 = {
0x0000,
0xFF,
0x04,
- 0x03,
+ DSNAP_TYPE_COUPLE_LOOK,
};
static PsoData* l_pso_tbl[] = {
@@ -4159,30 +4181,30 @@ static const int l_pig_para[] = {
};
static const u8 l_photo_no[] = {
- DSNAP_TYPE_UNK68,
- DSNAP_TYPE_UNK69,
- DSNAP_TYPE_UNK6A,
- DSNAP_TYPE_UNK6B,
- DSNAP_TYPE_UNK6B,
- DSNAP_TYPE_UNK6C,
- DSNAP_TYPE_UNK6D,
- DSNAP_TYPE_UNK66,
- DSNAP_TYPE_UNK67,
- DSNAP_TYPE_UNK64,
- DSNAP_TYPE_UNK63,
- DSNAP_TYPE_UNK65,
- DSNAP_TYPE_UNK82,
- DSNAP_TYPE_UNK6E,
- DSNAP_TYPE_UNK6F,
- DSNAP_TYPE_UNK71,
- DSNAP_TYPE_UNK70,
- DSNAP_TYPE_UNK62,
- DSNAP_TYPE_UNK62,
+ DSNAP_TYPE_NPC_UO1,
+ DSNAP_TYPE_NPC_UO2,
+ DSNAP_TYPE_NPC_UO3,
+ DSNAP_TYPE_NPC_UB1_UB2,
+ DSNAP_TYPE_NPC_UB1_UB2,
+ DSNAP_TYPE_NPC_UB3,
+ DSNAP_TYPE_NPC_UB4,
+ DSNAP_TYPE_NPC_UW1,
+ DSNAP_TYPE_NPC_UW2,
+ DSNAP_TYPE_NPC_UM1,
+ DSNAP_TYPE_NPC_UM2,
+ DSNAP_TYPE_NPC_UM3,
+ DSNAP_TYPE_NPC_SA1,
+ DSNAP_TYPE_NPC_SA2,
+ DSNAP_TYPE_NPC_SA3,
+ DSNAP_TYPE_NPC_SA4,
+ DSNAP_TYPE_NPC_SA5,
+ DSNAP_TYPE_NPC_UG1_UG2,
+ DSNAP_TYPE_NPC_UG1_UG2,
};
/* 00000078-00000274 .text __ct__13daNpcPeople_cFv */
daNpcPeople_c::daNpcPeople_c() {
- mNpcType = getPrmNpcNo();
+ mNpcNo = getPrmNpcNo();
mResFlag = 0;
m78F = 0;
m740 = 0.0f;
@@ -4199,7 +4221,7 @@ daNpcPeople_c::daNpcPeople_c() {
mEtcFlag = 0;
m7A1 = 0;
mbIsNight = dKy_daynight_check() & dKy_TIME_NIGHT_e; // this is weird but it generates the clrlwi
- mpNpcDat = l_npc_dat[mNpcType][mbIsNight];
+ mpNpcDat = l_npc_dat[mNpcNo][mbIsNight];
m730 = NULL;
}
@@ -4240,7 +4262,7 @@ static cPhs_State phase_1(daNpcPeople_c* i_this) {
s16 arg0 = i_this->getPrmArg0();
switch(i_this->getNpcNo()) {
- case 0x6:
+ case NPC_UB4:
if(strcmp(dComIfGp_getStartStageName(), "Ocmera") == 0) {
if(dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_20_e) || arg0 != dComIfGp_getStartStagePoint()) {
return cPhs_STOP_e;
@@ -4250,8 +4272,8 @@ static cPhs_State phase_1(daNpcPeople_c* i_this) {
}
break;
- case 0x8:
- case 0xA:
+ case NPC_UW2:
+ case NPC_UM2:
#if VERSION == VERSION_DEMO
if(arg0 != 0xFF && (u32)((arg0 << 1) & 0xFE) != (dComIfGs_getEventReg(dSv_event_flag_c::UNK_B907)))
#else
@@ -4262,8 +4284,8 @@ static cPhs_State phase_1(daNpcPeople_c* i_this) {
}
break;
- case 0x11:
- case 0x12: {
+ case NPC_UG1:
+ case NPC_UG2: {
int day = dKy_get_dayofweek();
switch(arg0) {
@@ -4328,25 +4350,25 @@ cPhs_State daNpcPeople_c::_create() {
/* 00000990-00000E0C .text createHeap__13daNpcPeople_cFv */
BOOL daNpcPeople_c::createHeap() {
- J3DModelData* bodyModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], l_bmd_ix_tbl[mNpcType]));
+ J3DModelData* bodyModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_bmd_ix_tbl[mNpcNo]));
mpMorf = new mDoExt_McaMorf(
bodyModelData,
NULL, NULL,
- (J3DAnmTransformKey*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], getBck(m793))),
+ (J3DAnmTransformKey*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], getBck(m793))),
J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1,
NULL,
0x00080000,
- l_diff_flag_tbl[mNpcType]
+ l_diff_flag_tbl[mNpcNo]
);
if(mpMorf == NULL || mpMorf->getModel() == NULL) {
return false;
}
- J3DModelData* headModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], l_head_bmd_ix_tbl[mNpcType]));
+ J3DModelData* headModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_head_bmd_ix_tbl[mNpcNo]));
int headBck = getHeadBck(0);
if(headBck < 0) {
- mpHeadModel = mDoExt_J3DModel__create(headModelData, 0x80000, l_head_diff_flag_tbl[mNpcType]);
+ mpHeadModel = mDoExt_J3DModel__create(headModelData, 0x80000, l_head_diff_flag_tbl[mNpcNo]);
if(mpHeadModel == NULL) {
return false;
}
@@ -4355,11 +4377,11 @@ BOOL daNpcPeople_c::createHeap() {
mpHeadMorf = new mDoExt_McaMorf(
headModelData,
NULL, NULL,
- (J3DAnmTransformKey*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], getHeadBck(m793))),
+ (J3DAnmTransformKey*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], getHeadBck(m793))),
J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1,
NULL,
0x00080000,
- l_head_diff_flag_tbl[mNpcType]
+ l_head_diff_flag_tbl[mNpcNo]
);
if(mpHeadMorf == NULL || mpHeadMorf->getModel() == NULL) {
@@ -4387,8 +4409,8 @@ BOOL daNpcPeople_c::createHeap() {
mAcchCir.SetWall(30.0f, 30.0f);
mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this));
- if(l_etc_bmd_ix_tbl[mNpcType][mbIsNight] >= 0) {
- J3DModelData* etcModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], l_etc_bmd_ix_tbl[mNpcType][mbIsNight]));
+ if(l_etc_bmd_ix_tbl[mNpcNo][mbIsNight] >= 0) {
+ J3DModelData* etcModelData = (J3DModelData*)(dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_etc_bmd_ix_tbl[mNpcNo][mbIsNight]));
mpEtcModel = mDoExt_J3DModel__create(etcModelData, 0x80000, 0x11000002);
if(mpEtcModel == NULL) {
return false;
@@ -4444,13 +4466,13 @@ cPhs_State daNpcPeople_c::createInit() {
m766[i] = -1;
}
- switch(mNpcType) {
- case 0x0:
+ switch(mNpcNo) {
+ case NPC_UO1:
m766[0] = dComIfGp_evmng_getEventIdx("UO1_GET_ITEM");
break;
- case 0x3:
- case 0x4:
+ case NPC_UB1:
+ case NPC_UB2:
m766[0] = dComIfGp_evmng_getEventIdx("UB1_TALK");
m766[1] = dComIfGp_evmng_getEventIdx("UB1_TALK_XY");
m766[1] = dComIfGp_evmng_getEventIdx("UB1_TALK_PHOTO");
@@ -4459,20 +4481,20 @@ cPhs_State daNpcPeople_c::createInit() {
m79C = 0;
break;
- case 0x6:
+ case NPC_UB4:
m766[0] = dComIfGp_evmng_getEventIdx("UB4_GET_ITEM");
break;
- case 0x8:
+ case NPC_UW2:
m766[0] = dComIfGp_evmng_getEventIdx("UW2_GET_ITEM");
break;
- case 0x9:
+ case NPC_UM1:
m766[0] = dComIfGp_evmng_getEventIdx("UM1_GET_ITEM");
m766[1] = dComIfGp_evmng_getEventIdx("UM1_TALK");
break;
- case 0xB:
+ case NPC_UM3:
m766[0] = dComIfGp_evmng_getEventIdx("UM3_TELESCOPE_TALK");
m766[1] = dComIfGp_evmng_getEventIdx("UM3_GET_ITEM");
@@ -4481,11 +4503,11 @@ cPhs_State daNpcPeople_c::createInit() {
}
break;
- case 0xE:
+ case NPC_SA3:
m766[0] = dComIfGp_evmng_getEventIdx("SA3_GET_ITEM");
break;
- case 0x10: {
+ case NPC_SA5: {
m766[0] = dComIfGp_evmng_getEventIdx("SA5_TALK_XY");
m766[1] = dComIfGp_evmng_getEventIdx("SA5_GET_ITEM");
@@ -4501,14 +4523,14 @@ cPhs_State daNpcPeople_c::createInit() {
}
// Fall-through
}
- case 0xF:
+ case NPC_SA4:
if(mbIsNight) {
mEtcFlag |= 0x40000000;
}
break;
- case 0x11:
- case 0x12:
+ case NPC_UG1:
+ case NPC_UG2:
if(getPrmArg0() == 0) {
temp = 0x50;
m76E = 1;
@@ -4519,13 +4541,13 @@ cPhs_State daNpcPeople_c::createInit() {
m7A1 = 1;
break;
- case 0x1:
- case 0x2:
- case 0x5:
- case 0x7:
- case 0xA:
- case 0xC:
- case 0xD:
+ case NPC_UO2:
+ case NPC_UO3:
+ case NPC_UB3:
+ case NPC_UW1:
+ case NPC_UM2:
+ case NPC_SA1:
+ case NPC_SA2:
default:
break;
}
@@ -4541,7 +4563,7 @@ cPhs_State daNpcPeople_c::createInit() {
setCollision(&mCyl, current.pos, m74C, mpNpcDat->field_0x40);
#endif
- mEventCut.setActorInfo2(l_npc_staff_id[mNpcType], this);
+ mEventCut.setActorInfo2(l_npc_staff_id[mNpcNo], this);
m784 = 0;
mTalk = 0;
@@ -4551,13 +4573,13 @@ cPhs_State daNpcPeople_c::createInit() {
fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -70.0f, 0.0f, -70.0f, 70.0f, 200.0f, 70.0f);
fopAcM_setCullSizeFar(this, mpNpcDat->field_0x30 / mDoLib_clipper::getFar());
- attention_info.distances[fopAc_Attn_TYPE_TALK_e] = l_npc_dist_tbl[mNpcType][mbIsNight];
- attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = l_npc_dist_tbl[mNpcType][mbIsNight];
+ attention_info.distances[fopAc_Attn_TYPE_TALK_e] = l_npc_dist_tbl[mNpcNo][mbIsNight];
+ attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = l_npc_dist_tbl[mNpcNo][mbIsNight];
attention_info.flags = fopAc_Attn_UNK1000000_e | fopAc_Attn_ACTION_SPEAK_e | fopAc_Attn_LOCKON_TALK_e;
m_jnt.setParam(mpNpcDat->field_0x04, mpNpcDat->field_0x06, mpNpcDat->field_0x0C, mpNpcDat->field_0x0E, mpNpcDat->field_0x00, mpNpcDat->field_0x02, mpNpcDat->field_0x08, mpNpcDat->field_0x0A, mpNpcDat->field_0x10);
- if(mNpcType == 0xB && !mbIsNight) {
+ if(mNpcNo == NPC_UM3 && !mbIsNight) {
dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_15_e);
}
@@ -4569,7 +4591,7 @@ cPhs_State daNpcPeople_c::createInit() {
m778 = mpNpcDat->field_0x36;
m74C = mpNpcDat->field_0x3C;
- if(mNpcType != 0xB) {
+ if(mNpcNo != NPC_UM3) {
mObjAcch.CrrPos(*dComIfG_Bgsp());
#if VERSION > VERSION_DEMO
if(-G_CM3D_F_INF != mObjAcch.GetGroundH())
@@ -4599,7 +4621,7 @@ bool daNpcPeople_c::_delete() {
if (mResFlag != 0)
#endif
{
- dComIfG_resDeleteDemo(&mPhase, l_arcname_tbl[mNpcType]);
+ dComIfG_resDeleteDemo(&mPhase, l_arcname_tbl[mNpcNo]);
}
#if VERSION > VERSION_DEMO
if(heap != NULL)
@@ -4635,12 +4657,12 @@ bool daNpcPeople_c::_draw() {
g_env_light.setLightTevColorType(mpMorf->getModel(), &tevStr);
g_env_light.setLightTevColorType(headModel, &tevStr);
- if(l_btp_ix_tbl[mNpcType] >= 0) {
+ if(l_btp_ix_tbl[mNpcNo] >= 0) {
mBtpAnm.entry(headModelData, m78E);
}
- if(l_bmt_ix_tbl[mNpcType] >= 0) {
- mpMorf->updateDL((J3DMaterialTable*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], l_bmt_ix_tbl[mNpcType]));
+ if(l_bmt_ix_tbl[mNpcNo] >= 0) {
+ mpMorf->updateDL((J3DMaterialTable*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_bmt_ix_tbl[mNpcNo]));
}
else {
mpMorf->updateDL();
@@ -4655,7 +4677,7 @@ bool daNpcPeople_c::_draw() {
mpHeadMorf->updateDL();
}
- if(l_btp_ix_tbl[mNpcType] >= 0) {
+ if(l_btp_ix_tbl[mNpcNo] >= 0) {
mBtpAnm.remove(headModelData);
}
@@ -4680,14 +4702,14 @@ bool daNpcPeople_c::_draw() {
PsoData* pso = l_pso_tbl[m7A6];
cXyz temp(pso->field_0x00, pso->field_0x04, pso->field_0x08);
temp += current.pos;
- obj.SetInf(pso->field_0x18, this, pso->field_0x16, pso->field_0x17, 0x7FFF);
+ obj.SetInf(pso->photoNo, this, pso->field_0x16, pso->field_0x17, 0x7FFF);
obj.SetGeo(temp, pso->field_0x0C, pso->field_0x10, pso->field_0x14 + current.angle.y);
dSnap_RegistSnapObj(obj);
m7A6 = 0xFF;
}
else {
- dSnap_RegistFig(l_photo_no[mNpcType], this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(l_photo_no[mNpcNo], this, 1.0f, 1.0f, 1.0f);
}
return true;
@@ -4735,9 +4757,9 @@ static MoveProc_t moveProc[] = {
bool daNpcPeople_c::_execute() {
warp();
- switch(mNpcType) {
- case 0x11:
- case 0x12:
+ switch(mNpcNo) {
+ case NPC_UG1:
+ case NPC_UG2:
if(getPrmArg0() == 0) {
cXyz diff = current.pos - home.pos;
f32 mag = diff.abs();
@@ -4767,8 +4789,8 @@ bool daNpcPeople_c::_execute() {
if(!eventInfo.checkCommandTalk()) {
mNoTalk = 0;
if(!mbIsNight) {
- switch(mNpcType) {
- case 0x3:
+ switch(mNpcNo) {
+ case NPC_UB1:
if(mAnmFlag & 0x3) {
mAnmFlag &= ~0x3;
u8 rand = getRand(8);
@@ -4781,7 +4803,7 @@ bool daNpcPeople_c::_execute() {
}
break;
- case 0x4:
+ case NPC_UB2:
if(mAnmFlag & 0x3) {
mAnmFlag &= ~0x3;
u8 rand = getRand(8);
@@ -4794,7 +4816,7 @@ bool daNpcPeople_c::_execute() {
}
break;
- case 0xB:
+ case NPC_UM3:
if(!dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_15_e) && (mAnmFlag & 0x3)) {
mAnmFlag &= ~0x3;
u8 rand = getRand(8);
@@ -4810,8 +4832,8 @@ bool daNpcPeople_c::_execute() {
}
}
else {
- switch(mNpcType) {
- case 0xE:
+ switch(mNpcNo) {
+ case NPC_SA3:
if(mAnmFlag & 0x3) {
mAnmFlag &= ~0x3;
u8 rand;
@@ -4834,7 +4856,7 @@ bool daNpcPeople_c::_execute() {
}
break;
- case 0x10:
+ case NPC_SA5:
if(mAnmFlag & 0x3) {
mAnmFlag &= ~0x3;
u8 rand;
@@ -4900,9 +4922,9 @@ bool daNpcPeople_c::executeCommon() {
if(m78B != 0 && mNoTalk == 0) {
mOrderEventNum = 1;
- switch(mNpcType) {
- case 0x11:
- case 0x12:
+ switch(mNpcNo) {
+ case NPC_UG1:
+ case NPC_UG2:
if(!eventInfo.checkCommandTalk()) {
cXyz diff = current.pos - home.pos;
diff.y = 0;
@@ -4980,14 +5002,14 @@ void daNpcPeople_c::executeWait() {
}
}
- switch(mNpcType) {
- case 0x6:
+ switch(mNpcNo) {
+ case NPC_UB4:
m7A6 = 2;
break;
- case 0x8:
+ case NPC_UW2:
m7A6 = 5;
break;
- case 0xB:
+ case NPC_UM3:
if(mbIsNight && (!dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) || dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e))) {
if(dComIfGp_checkPlayerStatus0(0, daPyStts0_TELESCOPE_LOOK_e)) {
m748 = (s16)(mpNpcDat->field_0x28 * 2.0f);
@@ -5033,11 +5055,11 @@ void daNpcPeople_c::executeWait() {
}
break;
- case 0x10:
+ case NPC_SA5:
checkPig();
break;
- case 0x11:
- case 0x12:
+ case NPC_UG1:
+ case NPC_UG2:
if((mEtcFlag & 0x1000) && m76E != 0) {
m76E--;
if(m76E == 0) {
@@ -5106,7 +5128,7 @@ void daNpcPeople_c::executeTalk() {
}
else {
m77E |= 0x8000;
- if(mNpcType == 3 || mNpcType == 4) {
+ if(mNpcNo == NPC_UB1 || mNpcNo == NPC_UB2) {
m79C = 0;
}
}
@@ -5165,7 +5187,7 @@ void daNpcPeople_c::executeWalk() {
}
}
}
- else if(mNpcType != 2 || mPathRun.getDir() == 0) {
+ else if(mNpcNo != NPC_UO3 || mPathRun.getDir() == 0) {
mEtcFlag |= 4;
mPathRun.turnDir();
executeSetMode(0);
@@ -5473,7 +5495,7 @@ void daNpcPeople_c::executeUgWalk() {
m71C = getDirDistToPos(getRand(0x10000), cM_rndF(180.0f)) + home.pos;
}
else {
- if((mNpcType != 0x12 && (getRand(100) < 0x19 && !(mEtcFlag & 0x8000))) || (mEtcFlag & 0x2000)) {
+ if((mNpcNo != NPC_UG2 && (getRand(100) < 0x19 && !(mEtcFlag & 0x8000))) || (mEtcFlag & 0x2000)) {
mEtcFlag &= ~0x2000;
executeSetMode(0xC);
}
@@ -5494,11 +5516,11 @@ void daNpcPeople_c::executeUgWalk() {
}
if(mCyl.ChkCoHit()) {
- daNpcPeople_c* pActor = (daNpcPeople_c*)mCyl.GetCoHitAc();
- if(pActor && fopAcM_GetProfName(pActor) == fpcNm_NPC_PEOPLE_e) {
- u8 type = pActor->getNpcNo();
- if((mNpcType == 0x11 && type == 0x12) || (mNpcType == 0x12 && type == 0x11)) {
- pActor->setEtcFlag(0x60000);
+ daNpcPeople_c* otherNpc = (daNpcPeople_c*)mCyl.GetCoHitAc();
+ if(otherNpc && fopAcM_GetProfName(otherNpc) == fpcNm_NPC_PEOPLE_e) {
+ u8 otherNpcNo = otherNpc->getNpcNo();
+ if((mNpcNo == NPC_UG1 && otherNpcNo == NPC_UG2) || (mNpcNo == NPC_UG2 && otherNpcNo == NPC_UG1)) {
+ otherNpc->setEtcFlag(0x60000);
mEtcFlag |= 0x42000;
executeSetMode(0xB);
}
@@ -5561,7 +5583,7 @@ s32 daNpcPeople_c::executeUgTurnInit() {
mEtcFlag &= ~0x40000;
fopAc_ac_c* pActor;
- if(mNpcType == 0x11) {
+ if(mNpcNo == NPC_UG1) {
pActor = fopAcM_searchFromName(l_npc_staff_id[18], 0, 0);
}
else {
@@ -5727,7 +5749,7 @@ void daNpcPeople_c::checkOrder() {
mTalk = 1;
}
}
- else if(mNpcType == 9) {
+ else if(mNpcNo == NPC_UM1) {
if(!mbIsNight) {
eventInfo.setEventId(-1);
m79C = 1;
@@ -5752,7 +5774,7 @@ void daNpcPeople_c::eventOrder() {
mTalk = 0;
mAnmFlag |= 2;
dComIfGp_event_reset();
- if(mNpcType == 8) {
+ if(mNpcNo == NPC_UW2) {
m77A = home.angle.y;
}
}
@@ -5830,7 +5852,7 @@ void daNpcPeople_c::privateCut() {
"MES_SET_PO",
};
- int staffIdx = dComIfGp_evmng_getMyStaffId(l_npc_staff_id[mNpcType]);
+ int staffIdx = dComIfGp_evmng_getMyStaffId(l_npc_staff_id[mNpcNo]);
if(staffIdx != -1) {
m797 = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0);
if(m797 == -1) {
@@ -6204,15 +6226,15 @@ bool daNpcPeople_c::eventUb2Talk() {
/* 000050D0-0000518C .text eventUbSetAnm__13daNpcPeople_cFv */
bool daNpcPeople_c::eventUbSetAnm() {
- switch(mNpcType) {
- case 0x3:
+ switch(mNpcNo) {
+ case NPC_UB1:
if(mAnmFlag & 3) {
mAnmFlag &= ~0x3;
setAnmTbl(l_npc_anm_ub1_tbl[getRand(8)], 1);
}
break;
- case 0x4:
+ case NPC_UB2:
if(mAnmFlag & 3) {
mAnmFlag &= ~0x3;
setAnmTbl(l_npc_anm_ub2_tbl[getRand(8)], 1);
@@ -6384,7 +6406,7 @@ u16 daNpcPeople_c::talk2(int param_1, fopAc_ac_c* param_2) {
m730 = NULL;
}
#else
- if(m730 && mNpcType == 0x3) {
+ if(m730 && mNpcNo == NPC_UB1) {
if(dComIfGp_event_getTalkPartner() == this) {
m730 = (daNpcPeople_c*)fopAcM_searchFromName("Ub2", 0, 0);
}
@@ -6738,8 +6760,8 @@ u32 daNpcPeople_c::getMsg() {
m734 = NULL;
if(g_dComIfG_gameInfo.play.getEvent()->chkPhoto()) {
- switch(mNpcType) {
- case 2:
+ switch(mNpcNo) {
+ case NPC_UO3:
if(dComIfGp_getPictureResult() == 1) {
m734 = l_msg_xy_uo3_photo;
}
@@ -6748,7 +6770,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 6:
+ case NPC_UB4:
if(dComIfGp_getPictureResult() != 5 && dComIfGp_getPictureResult() != 6 && dComIfGp_getPictureResult() != 0x6D) {
m734 = l_msg_xy_ub4_no_photo;
}
@@ -6766,7 +6788,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xA:
+ case NPC_UM2:
if(dComIfGp_getPictureResult() != 4) {
m734 = l_msg_xy_um2_talk1;
}
@@ -6784,7 +6806,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xB:
+ case NPC_UM3:
if(dComIfGp_getPictureResult() != 7) {
if(dComIfGp_getPictureResult() == 8) {
m734 = l_msg_xy_um3_no_full_moon;
@@ -6805,7 +6827,7 @@ u32 daNpcPeople_c::getMsg() {
break;
#if VERSION > VERSION_JPN
- case 0x10:
+ case NPC_SA5:
m734 = l_msg_xy_sa5_no_skull_necklace;
break;
#endif
@@ -6813,18 +6835,18 @@ u32 daNpcPeople_c::getMsg() {
}
else if(dComIfGp_event_chkTalkXY()) {
u32 itemNo = dComIfGp_event_getPreItemNo();
- switch(mNpcType) {
- case 0x3:
- case 0x4:
+ switch(mNpcNo) {
+ case NPC_UB1:
+ case NPC_UB2:
msgNo = 0x2C9D;
break;
- case 0x5:
+ case NPC_UB3:
msgNo = 0x2CF7;
break;
- case 0x6:
+ case NPC_UB4:
msgNo = 0x2D63;
break;
- case 0x10:
+ case NPC_SA5:
if(itemNo != dItemNo_SKULL_NECKLACE_e) {
m734 = l_msg_xy_sa5_no_skull_necklace;
}
@@ -6840,8 +6862,8 @@ u32 daNpcPeople_c::getMsg() {
}
else {
cXyz diff;
- switch(mNpcType) {
- case 0:
+ switch(mNpcNo) {
+ case NPC_UO1:
if(!dComIfGs_checkGetItem(dItemNo_DELIVERY_BAG_e)) {
if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_2501)) {
dComIfGs_onEventBit(dSv_event_flag_c::UNK_2501);
@@ -6872,7 +6894,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 1:
+ case NPC_UO2:
if(m79A & 0x1) {
m79A &= ~0x1;
m734 = l_msg_uo2_surprise;
@@ -6889,7 +6911,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 2:
+ case NPC_UO3:
if(m793 == 3 || (mEtcFlag & 0x8)) {
m734 = l_msg_uo3_kyoro;
}
@@ -6911,7 +6933,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 5:
+ case NPC_UB3:
if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_1D20)) {
m734 = l_msg_ub3_1st_talk;
dComIfGs_onEventBit(dSv_event_flag_c::UNK_1D20);
@@ -6935,7 +6957,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 6:
+ case NPC_UB4:
if(mEtcFlag & 0x40) {
m734 = l_msg_ub4_photo_house;
}
@@ -6954,7 +6976,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 7:
+ case NPC_UW1:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x2DC9;
}
@@ -6984,7 +7006,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 8:
+ case NPC_UW2:
if(dComIfGs_getEventReg(dSv_event_flag_c::UNK_B907) < 2) {
if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_2101)) {
m734 = l_msg_uw2_1st_talk1;
@@ -7022,7 +7044,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 9:
+ case NPC_UM1:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x2FBD;
}
@@ -7045,7 +7067,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xA:
+ case NPC_UM2:
if(dComIfGs_getEventReg(dSv_event_flag_c::UNK_B907) < 2) {
if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_2208)) {
m734 = l_msg_um2_1st_talk1;
@@ -7092,7 +7114,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xB:
+ case NPC_UM3:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x347B;
}
@@ -7129,7 +7151,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xC:
+ case NPC_SA1:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x2E82;
}
@@ -7142,7 +7164,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xD:
+ case NPC_SA2:
if(!mbIsNight) {
if(!dComIfGs_isEventBit(dSv_event_flag_c::UNK_2302)) {
m734 = l_msg_sa2_1st_talk;
@@ -7163,7 +7185,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xE:
+ case NPC_SA3:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x30E4;
}
@@ -7184,7 +7206,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0xF:
+ case NPC_SA4:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x321E;
}
@@ -7205,7 +7227,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0x10:
+ case NPC_SA5:
if(dComIfGs_isEventBit(dSv_event_flag_c::ENDLESS_NIGHT) && !dComIfGs_checkGetItem(dItemNo_PEARL_NAYRU_e)) {
msgNo = 0x3299;
}
@@ -7283,7 +7305,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0x11:
+ case NPC_UG1:
diff = (current.pos - home.pos);
diff.y = 0.0f;
if(diff.abs() >= 200.0f) {
@@ -7301,7 +7323,7 @@ u32 daNpcPeople_c::getMsg() {
}
break;
- case 0x12:
+ case NPC_UG2:
diff = (current.pos - home.pos);
diff.y = 0.0f;
if(diff.abs() >= 200.0f) {
@@ -7334,8 +7356,8 @@ u32 daNpcPeople_c::getMsg3() {
u32 msgNo = 0;
m734 = NULL;
- switch(mNpcType) {
- case 0xB:
+ switch(mNpcNo) {
+ case NPC_UM3:
switch(m7A7) {
case 0:
default:
@@ -7418,7 +7440,7 @@ void daNpcPeople_c::setMessageUb(sUbMsgDat* param_1) {
void daNpcPeople_c::setAnmFromMsgTag() {
int temp = dComIfGp_getMesgAnimeAttrInfo();
if(temp != 0x32) {
- (this->*l_anm_set_sub[mNpcType])(temp);
+ (this->*l_anm_set_sub[mNpcNo])(temp);
}
dComIfGp_setMesgAnimeAttrInfo(0x32);
@@ -7669,7 +7691,7 @@ void daNpcPeople_c::chkAttention() {
m_jnt.setTrn();
}
- if(mNpcType == 0x5 && mTalk == 0) {
+ if(mNpcNo == NPC_UB3 && mTalk == 0) {
setAnmTbl(l_npc_anm_wait, 1);
}
}
@@ -7717,7 +7739,7 @@ void daNpcPeople_c::chkAttention() {
if(!mPathRun.isPath()) {
if(m770 != 0) {
m770--;
- if(m770 == 0 && mNpcType == 0x5) {
+ if(m770 == 0 && mNpcNo == NPC_UB3) {
setWaitAnm();
}
}
@@ -7783,7 +7805,7 @@ void daNpcPeople_c::lookBack() {
BOOL daNpcPeople_c::initTexPatternAnm(bool param_1) {
m_head_tex_pattern = NULL;
- if(l_btp_ix_tbl[mNpcType] >= 0) {
+ if(l_btp_ix_tbl[mNpcNo] >= 0) {
J3DModelData* modelData;
if(mpHeadModel) {
modelData = mpHeadModel->getModelData();
@@ -7792,7 +7814,7 @@ BOOL daNpcPeople_c::initTexPatternAnm(bool param_1) {
modelData = mpHeadMorf->getModel()->getModelData();
}
- m_head_tex_pattern = (J3DAnmTexPattern*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], l_btp_ix_tbl[mNpcType]);
+ m_head_tex_pattern = (J3DAnmTexPattern*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], l_btp_ix_tbl[mNpcNo]);
JUT_ASSERT(VERSION_SELECT(8951, 8977, 8989, 9009), m_head_tex_pattern != NULL);
if(!mBtpAnm.init(modelData, m_head_tex_pattern, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, param_1, FALSE)) {
@@ -7845,12 +7867,12 @@ void daNpcPeople_c::playAnm() {
/* 000083F0-0000841C .text getBck__13daNpcPeople_cFUc */
int daNpcPeople_c::getBck(u8 param_1) {
- return l_bck_ix_tbl[mNpcType][mbIsNight][param_1];
+ return l_bck_ix_tbl[mNpcNo][mbIsNight][param_1];
}
/* 0000841C-00008458 .text getHeadBck__13daNpcPeople_cFUc */
int daNpcPeople_c::getHeadBck(u8 param_1) {
- int* tbl = l_head_bck_ix_tbl[mNpcType][mbIsNight];
+ int* tbl = l_head_bck_ix_tbl[mNpcNo][mbIsNight];
if(tbl == NULL) {
return -1;
}
@@ -7860,7 +7882,7 @@ int daNpcPeople_c::getHeadBck(u8 param_1) {
/* 00008458-00008608 .text setAnm__13daNpcPeople_cFUciff */
void daNpcPeople_c::setAnm(u8 param_1, int param_2, f32 morf, f32 param_4) {
- if(mNpcType == 7) {
+ if(mNpcNo == NPC_UW1) {
if(m793 == 4 && param_1 == 0) {
morf = 12.0f;
}
@@ -7874,10 +7896,10 @@ void daNpcPeople_c::setAnm(u8 param_1, int param_2, f32 morf, f32 param_4) {
m744 = -1.0f;
}
- J3DAnmTransformKey* pAnm = (J3DAnmTransformKey*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], getBck(param_1));
+ J3DAnmTransformKey* pAnm = (J3DAnmTransformKey*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], getBck(param_1));
mpMorf->setAnm(pAnm, param_2, morf, param_4, 0.0f, -1.0f, NULL);
if(mpHeadMorf && getHeadBck(0) >= 0) {
- J3DAnmTransformKey* pHeadAnm = (J3DAnmTransformKey*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcType], getHeadBck(param_1));
+ J3DAnmTransformKey* pHeadAnm = (J3DAnmTransformKey*)dComIfG_getObjectIDRes(l_arcname_tbl[mNpcNo], getHeadBck(param_1));
mpHeadMorf->setAnm(pHeadAnm, param_2, morf, param_4, 0.0f, -1.0f, NULL);
}
@@ -7887,13 +7909,13 @@ void daNpcPeople_c::setAnm(u8 param_1, int param_2, f32 morf, f32 param_4) {
/* 00008608-00008764 .text setAnmTbl__13daNpcPeople_cFP13sPeopleAnmDati */
bool daNpcPeople_c::setAnmTbl(sPeopleAnmDat* param_1, int param_2) {
- if(mNpcType == 0x10 && m793 == 1) {
+ if(mNpcNo == NPC_SA5 && m793 == 1) {
m744 = 16.0f;
}
- else if(mNpcType == 0xF && m793 == 1) {
+ else if(mNpcNo == NPC_SA4 && m793 == 1) {
m744 = 13.0f;
}
- else if(mNpcType == 0xB && m793 == 5) {
+ else if(mNpcNo == NPC_UM3 && m793 == 5) {
m744 = 13.0f;
if(param_1->field_0x00 == 1) {
m744 = 6.0f;
@@ -7928,17 +7950,17 @@ bool daNpcPeople_c::setAnmTbl(sPeopleAnmDat* param_1, int param_2) {
/* 00008764-0000884C .text setWaitAnm__13daNpcPeople_cFv */
void daNpcPeople_c::setWaitAnm() {
- if(mNpcType == 5 && m789 != 0) {
+ if(mNpcNo == NPC_UB3 && m789 != 0) {
setAnmTbl(l_npc_anm_wait, 0);
}
- else if(mNpcType == 0xB && !mbIsNight && dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_15_e)) {
+ else if(mNpcNo == NPC_UM3 && !mbIsNight && dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_15_e)) {
setAnmTbl(l_npc_anm_um3_wait3, 1);
}
- else if(mNpcType == 8 && m793 == 1) {
+ else if(mNpcNo == NPC_UW2 && m793 == 1) {
setAnmTbl(l_npc_anm_talkH2, 1);
}
else {
- setAnmTbl(l_npc_anm_wait_tbl[mNpcType][mbIsNight], 1);
+ setAnmTbl(l_npc_anm_wait_tbl[mNpcNo][mbIsNight], 1);
}
}
@@ -7946,16 +7968,16 @@ void daNpcPeople_c::setWaitAnm() {
s16 daNpcPeople_c::XyCheckCB(int i_itemBtn) {
u8 itemNo = dComIfGp_getSelectItem(i_itemBtn);
- switch(mNpcType) {
- case 0x2:
- case 0xA:
+ switch(mNpcNo) {
+ case NPC_UO3:
+ case NPC_UM2:
if(isPhoto(itemNo)) {
return true;
}
break;
- case 0x3:
- case 0x4:
+ case NPC_UB1:
+ case NPC_UB2:
if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_2102) && isPhoto(itemNo)) {
return true;
}
@@ -7965,13 +7987,13 @@ s16 daNpcPeople_c::XyCheckCB(int i_itemBtn) {
}
break;
- case 0x5:
+ case NPC_UB3:
if(itemNo == dItemNo_JOY_PENDANT_e) {
return true;
}
break;
- case 0x6:
+ case NPC_UB4:
if(!(mEtcFlag & 0x40) && isPhoto(itemNo)) {
return true;
}
@@ -7981,13 +8003,13 @@ s16 daNpcPeople_c::XyCheckCB(int i_itemBtn) {
}
break;
- case 0xB:
+ case NPC_UM3:
if(!mbIsNight && isPhoto(itemNo) && dComIfGs_isEventBit(dSv_event_flag_c::UNK_2310) && !dComIfGs_checkGetItem(dItemNo_COLLECT_MAP_15_e)) {
return true;
}
break;
- case 0x10:
+ case NPC_SA5:
#if VERSION > VERSION_JPN
if(isPhoto(itemNo)) {
return false;
@@ -8015,9 +8037,9 @@ s16 daNpcPeople_c::XyEventCB(int i_itemBtn) {
s16 ret = -1;
u8 itemNo = dComIfGp_getSelectItem(i_itemBtn);
- switch(mNpcType) {
- case 0x3:
- case 0x4:
+ switch(mNpcNo) {
+ case NPC_UB1:
+ case NPC_UB2:
if(itemNo != dItemNo_JOY_PENDANT_e) {
ret = m766[1];
m79C = 0;
@@ -8028,7 +8050,7 @@ s16 daNpcPeople_c::XyEventCB(int i_itemBtn) {
m79C = 1;
break;
- case 0x10:
+ case NPC_SA5:
if(itemNo == dItemNo_SKULL_NECKLACE_e) {
ret = m766[0];
m79C = 0;
@@ -8045,9 +8067,9 @@ s16 daNpcPeople_c::XyEventCB(int i_itemBtn) {
/* 00008AC8-00008B3C .text photoCB__13daNpcPeople_cFi */
s16 daNpcPeople_c::photoCB(int) {
s16 ret = -1;
- switch(mNpcType) {
- case 0x3:
- case 0x4:
+ switch(mNpcNo) {
+ case NPC_UB1:
+ case NPC_UB2:
if(dComIfGp_getPictureResult() == 5 && !is1GetMap20()) {
ret = m766[3];
}
@@ -8080,12 +8102,13 @@ BOOL daNpcPeople_c::isPhoto(u8 param_1) {
/* 00008BD8-00008C04 .text isColor__13daNpcPeople_cFv */
BOOL daNpcPeople_c::isColor() {
- u8 format = dComIfGp_getPictureFormat();
- if(format == 0xE) {
- return true;
+ if(dComIfGp_getPictureFormat() == GX_TF_CMPR) {
+ return TRUE;
}
-
- return format == 0x4 ? TRUE : FALSE;
+ if (dComIfGp_getPictureFormat() == GX_TF_RGB565) {
+ return TRUE;
+ }
+ return FALSE;
}
/* 00008C04-00008C7C .text setCollision__13daNpcPeople_cFP8dCcD_Cyl4cXyzff */
@@ -8098,7 +8121,7 @@ void daNpcPeople_c::setCollision(dCcD_Cyl* cyl, cXyz center, f32 radius, f32 hei
/* 00008C7C-00008DB0 .text chkSurprise__13daNpcPeople_cFv */
BOOL daNpcPeople_c::chkSurprise() {
- if(mNpcType == 0x1 && m78F != 1) {
+ if(mNpcNo == NPC_UO2 && m78F != 1) {
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
if(player->checkFrontRollCrash()) {
cXyz delta = current.pos - player->current.pos;
@@ -8117,16 +8140,16 @@ BOOL daNpcPeople_c::chkSurprise() {
/* 00008DB0-000090D0 .text chkEndEvent__13daNpcPeople_cFv */
BOOL daNpcPeople_c::chkEndEvent() {
- switch(mNpcType) {
- case 0:
+ switch(mNpcNo) {
+ case NPC_UO1:
if(dComIfGp_evmng_endCheck(m766[0])) {
m77E |= 0x8000;
return true;
}
break;
- case 3:
- case 4:
+ case NPC_UB1:
+ case NPC_UB2:
if(dComIfGp_evmng_endCheck(m766[0]) || dComIfGp_evmng_endCheck(m766[1]) || dComIfGp_evmng_endCheck(m766[3])) {
m77E |= 0x8000;
m748 = mpNpcDat->field_0x28;
@@ -8137,7 +8160,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 6:
+ case NPC_UB4:
if(dComIfGp_evmng_endCheck(m766[0])) {
m77E |= 0x8000;
@@ -8145,7 +8168,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 8:
+ case NPC_UW2:
if(dComIfGp_evmng_endCheck(m766[0])) {
m77E |= 0x8000;
@@ -8153,7 +8176,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 9:
+ case NPC_UM1:
if(dComIfGp_evmng_endCheck(m766[1])) {
if(m77E & 0x8) {
m77E &= ~0x8;
@@ -8173,7 +8196,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 0xB:
+ case NPC_UM3:
if(dComIfGp_evmng_endCheck(m766[0])) {
dCam_getBody()->ScopeViewMsgModeOff();
m77E |= 0x8000;
@@ -8188,7 +8211,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 0xE:
+ case NPC_SA3:
if(dComIfGp_evmng_endCheck(m766[0])) {
m77E |= 0x8000;
@@ -8196,7 +8219,7 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 0x10:
+ case NPC_SA5:
if(dComIfGp_evmng_endCheck(m766[0]) || dComIfGp_evmng_endCheck(m766[1])) {
if(mEtcFlag & 0x100000) {
mEtcFlag &= ~0x100000;
@@ -8210,8 +8233,8 @@ BOOL daNpcPeople_c::chkEndEvent() {
}
break;
- case 0x11:
- case 0x12:
+ case NPC_UG1:
+ case NPC_UG2:
if(dComIfGp_evmng_endCheck(m766[0])) {
m77E |= 0x8000;
initUgSearchArea();
diff --git a/src/d/actor/d_a_npc_photo.cpp b/src/d/actor/d_a_npc_photo.cpp
index 156f6076..6e4eaa2c 100644
--- a/src/d/actor/d_a_npc_photo.cpp
+++ b/src/d/actor/d_a_npc_photo.cpp
@@ -819,7 +819,7 @@ bool daNpcPhoto_c::_draw() {
l_pso_photo.field_0x08
);
temp += current.pos;
- obj.SetInf(5, this, l_pso_photo.field_0x16, l_pso_photo.field_0x17, 0x7FFF);
+ obj.SetInf(DSNAP_TYPE_UNK05, this, l_pso_photo.field_0x16, l_pso_photo.field_0x17, 0x7FFF);
obj.SetGeo(temp, l_pso_photo.field_0x0C, l_pso_photo.field_0x10, l_pso_photo.field_0x14 + current.angle.y);
dSnap_RegistSnapObj(obj);
} else {
diff --git a/src/d/actor/d_a_npc_roten.cpp b/src/d/actor/d_a_npc_roten.cpp
index 39597ec5..e933af89 100644
--- a/src/d/actor/d_a_npc_roten.cpp
+++ b/src/d/actor/d_a_npc_roten.cpp
@@ -1838,7 +1838,7 @@ bool daNpcRoten_c::_draw() {
dComIfGd_addRealShadow(mShadowId, field_0x6D4);
}
- dSnap_RegistFig(DSNAP_TYPE_ROTEN, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_ROTEN, this, 1.0f, 1.0f, 1.0f);
return true;
}
diff --git a/src/d/actor/d_a_npc_rsh1.cpp b/src/d/actor/d_a_npc_rsh1.cpp
index e57cbd67..6d83d6f5 100644
--- a/src/d/actor/d_a_npc_rsh1.cpp
+++ b/src/d/actor/d_a_npc_rsh1.cpp
@@ -1681,7 +1681,7 @@ BOOL daNpc_Rsh1_c::_draw() {
mpShopCursor->draw();
}
- dSnap_RegistFig(DSNAP_TYPE_RSH1, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_RSH1, this, current.pos, current.angle.y, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_tt.cpp b/src/d/actor/d_a_npc_tt.cpp
index d839d1ad..52d7d03f 100644
--- a/src/d/actor/d_a_npc_tt.cpp
+++ b/src/d/actor/d_a_npc_tt.cpp
@@ -790,7 +790,7 @@ BOOL daNpc_Tt_c::_draw() {
#endif
dComIfGd_set3DlineMat(&mLineKe.mLineMat);
- dSnap_RegistFig(DSNAP_TYPE_TT, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_TT, this, 1.0f, 1.0f, 1.0f);
return TRUE;
}
diff --git a/src/d/actor/d_a_npc_zl1.cpp b/src/d/actor/d_a_npc_zl1.cpp
index 2a39b672..4c9da119 100644
--- a/src/d/actor/d_a_npc_zl1.cpp
+++ b/src/d/actor/d_a_npc_zl1.cpp
@@ -2770,7 +2770,7 @@ BOOL daNpc_Zl1_c::_draw() {
}
shadowDraw();
- dSnap_RegistFig(DSNAP_TYPE_ZL1, this, 1.0f, 1.0f, 1.0f);
+ dSnap_RegistFig(DSNAP_TYPE_NPC_ZL1, this, 1.0f, 1.0f, 1.0f);
// doesnt do anything?
cXyz temp;
diff --git a/src/d/d_kankyo_rain.cpp b/src/d/d_kankyo_rain.cpp
index 2fb04d0b..d185baed 100644
--- a/src/d/d_kankyo_rain.cpp
+++ b/src/d/d_kankyo_rain.cpp
@@ -1798,11 +1798,11 @@ void snap_sunmoon_proc(cXyz* pPos, int type) {
snapObj.SetGeoSph(pos, 8000.0f);
if (type == 9)
- snapObj.SetInf(9, NULL, 0xFF, 4, 0x7FFF);
+ snapObj.SetInf(DSNAP_TYPE_UNK09, NULL, 0xFF, 4, 0x7FFF);
else if (type == 0)
- snapObj.SetInf(7, NULL, 0xFF, 4, 0x7FFF);
+ snapObj.SetInf(DSNAP_TYPE_UNK07, NULL, 0xFF, 4, 0x7FFF);
else
- snapObj.SetInf(8, NULL, 0xFF, 4, 0x7FFF);
+ snapObj.SetInf(DSNAP_TYPE_UNK08, NULL, 0xFF, 4, 0x7FFF);
dSnap_RegistSnapObj(snapObj);
}
}
diff --git a/src/d/d_msg.cpp b/src/d/d_msg.cpp
index f5e97e64..3a46c3a0 100644
--- a/src/d/d_msg.cpp
+++ b/src/d/d_msg.cpp
@@ -1572,7 +1572,6 @@ void dMsg_tactGuideShow(sub_msg_class* i_Msg, u8 param_2) {
/* 80210AA0-80210CA4 .text dMsg_numberInput__FP13sub_msg_class */
void dMsg_numberInput(sub_msg_class* i_Msg) {
static char* num_str[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
- u8 uVar2;
for (s32 i = 0; i < 8; i++) {
if (i_Msg->mMsgDataProc.field_0x281[i] == 0x16) {
@@ -1581,11 +1580,9 @@ void dMsg_numberInput(sub_msg_class* i_Msg) {
}
}
if (i_Msg->mMsgNo == 0x1cfa) {
- uVar2 = i_Msg->mMsgDataProc.inputNumber(3);
- i_Msg->mSelectNum = uVar2;
+ i_Msg->mSelectNum = i_Msg->mMsgDataProc.inputNumber(3);
} else {
- uVar2 = i_Msg->mMsgDataProc.inputNumber(2);
- i_Msg->mSelectNum = uVar2;
+ i_Msg->mSelectNum = i_Msg->mMsgDataProc.inputNumber(2);
}
i_Msg->mMsgDataProc.colorAnime(maskPane);
numberPane[2]->setString(num_str[dComIfGp_getMessageSetNumber() / 100]);
@@ -2027,7 +2024,6 @@ s32 dMsg_selectProc(sub_msg_class* i_Msg) {
int uVar1;
s16 sVar3;
u8 cVar6;
- u8 uVar7;
J2DTextBox* pJVar8;
u8 uVar9;
int iVar10;
@@ -2083,8 +2079,7 @@ s32 dMsg_selectProc(sub_msg_class* i_Msg) {
goto end;
}
if (i_Msg->mStatus == fopMsgStts_SELECT_2_e) {
- uVar7 = i_Msg->mMsgDataProc.selectCheck2(arrowPane, iVar10, iVar11 + uVar1 + ((int)uVar1 / 2), uVar1);
- i_Msg->mSelectNum = uVar7;
+ i_Msg->mSelectNum = i_Msg->mMsgDataProc.selectCheck2(arrowPane, iVar10, iVar11 + uVar1 + ((int)uVar1 / 2), uVar1);
i_Msg->m026C[8].mUserArea++;
if (i_Msg->m026C[8].mUserArea >= 0x14) {
i_Msg->m026C[8].mUserArea = 0;
@@ -2104,8 +2099,7 @@ s32 dMsg_selectProc(sub_msg_class* i_Msg) {
fopMsgM_paneTrans(&i_Msg->m01FC, 0.0f, i_Msg->mSelectNum * uVar1);
fopMsgM_paneTrans(&i_Msg->m0234, 0.0f, i_Msg->mSelectNum * uVar1);
} else if (i_Msg->mStatus == fopMsgStts_SELECT_3_e) {
- uVar7 = i_Msg->mMsgDataProc.selectCheck3(arrowPane, iVar10, iVar11, uVar1);
- i_Msg->mSelectNum = uVar7;
+ i_Msg->mSelectNum = i_Msg->mMsgDataProc.selectCheck3(arrowPane, iVar10, iVar11, uVar1);
i_Msg->m026C[8].mUserArea++;
if (i_Msg->m026C[8].mUserArea >= 0x14) {
i_Msg->m026C[8].mUserArea = 0;
diff --git a/src/d/d_picture_box.cpp b/src/d/d_picture_box.cpp
index 9560f344..2da1d6f0 100644
--- a/src/d/d_picture_box.cpp
+++ b/src/d/d_picture_box.cpp
@@ -50,6 +50,8 @@ void dPb_erasePicture() {
dComIfGs_setEventReg(dSv_event_flag_c::UNK_89FF, evReg2);
dComIfGp_setItemPictureNumCount(-1);
}
+ // !@bug: This function does not set the picture flags, meaning the removing pictures are never cleared from the memcard.
+ // This was fixed for PAL.
#if VERSION >= VERSION_PAL
dComIfGp_onPictureFlag(0);
dComIfGp_onPictureFlag(1);
@@ -192,18 +194,57 @@ void dJle_Pb_c::screenSet2() {
((J2DTextBox *)(pane_tx[2].pane))->setFont(font0);
((J2DTextBox *)(pane_tx[3].pane))->setFont(font1);
+#if VERSION <= VERSION_JPN
+ J2DTextBox::TFontSize fontSize;
+ if (g_msgDHIO.field_0x08 == 0) {
+ fontSize.mSizeX = fontSize.mSizeY = (int)g_msgHIO.field_0x58;
+ J2DTextBox::TFontSize fontSize2;
+ fontSize2.mSizeX = fontSize2.mSizeY = g_msgHIO.field_0x68;
+
+ ((J2DTextBox *)(pane_tx[0].pane))->setFontSize(fontSize);
+ ((J2DTextBox *)(pane_tx[1].pane))->setFontSize(fontSize2);
+ ((J2DTextBox *)(pane_tx[2].pane))->setFontSize(fontSize);
+ ((J2DTextBox *)(pane_tx[3].pane))->setFontSize(fontSize2);
+ } else {
+ fontSize.mSizeX = fontSize.mSizeY = g_msgHIO.field_0x70;
+
+ ((J2DTextBox *)(pane_tx[0].pane))->setFontSize(fontSize);
+ ((J2DTextBox *)(pane_tx[2].pane))->setFontSize(fontSize);
+ }
+#else
J2DTextBox::TFontSize fontSize;
fontSize.mSizeX = fontSize.mSizeY = g_msgHIO.field_0x70;
((J2DTextBox *)(pane_tx[0].pane))->setFontSize(fontSize);
((J2DTextBox *)(pane_tx[2].pane))->setFontSize(fontSize);
+#endif
+#if VERSION <= VERSION_JPN
+ ((J2DTextBox *)(pane_tx[0].pane))->setCharSpace(-2.0f);
+ ((J2DTextBox *)(pane_tx[1].pane))->setCharSpace(-1.0f);
+ ((J2DTextBox *)(pane_tx[2].pane))->setCharSpace(-2.0f);
+ ((J2DTextBox *)(pane_tx[3].pane))->setCharSpace(-1.0f);
+#else
((J2DTextBox *)(pane_tx[0].pane))->setCharSpace(0.0f);
((J2DTextBox *)(pane_tx[1].pane))->setCharSpace(0.0f);
((J2DTextBox *)(pane_tx[2].pane))->setCharSpace(0.0f);
((J2DTextBox *)(pane_tx[3].pane))->setCharSpace(0.0f);
+#endif
+
+#if VERSION <= VERSION_JPN
+ if (g_msgDHIO.field_0x08 == 0) {
+ ((J2DTextBox *)(pane_tx[0].pane))->setLineSpace(42.0f);
+ ((J2DTextBox *)(pane_tx[1].pane))->setLineSpace(42.0f);
+ ((J2DTextBox *)(pane_tx[2].pane))->setLineSpace(42.0f);
+ ((J2DTextBox *)(pane_tx[3].pane))->setLineSpace(42.0f);
+ } else {
+ ((J2DTextBox *)(pane_tx[0].pane))->setLineSpace(g_msgHIO.field_0x5e);
+ ((J2DTextBox *)(pane_tx[2].pane))->setLineSpace(g_msgHIO.field_0x5e);
+ }
+#else
((J2DTextBox *)(pane_tx[0].pane))->setLineSpace(28.0f);
((J2DTextBox *)(pane_tx[2].pane))->setLineSpace(28.0f);
+#endif
}
/* 8022616C-802262CC .text cameraAlphaInc__9dJle_Pb_cFf */
@@ -513,8 +554,8 @@ void dJle_Pb_c::clickShutterMode() {
}
else if (mShutterCounter == iVar3) {
if (mDoGph_getCaptureStep() == 5) {
- mShutterCounter++;
- dMenu_flagSet(1);
+ mShutterCounter++;
+ dMenu_flagSet(1);
}
dVar8 = 1.0f;
}
@@ -542,9 +583,9 @@ void dJle_Pb_c::clickShutterMode() {
/* 80227520-802277A0 .text selectMode__9dJle_Pb_cFv */
void dJle_Pb_c::selectMode() {
u8 pictureNum;
- int selection = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
+ u8 selection = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
- if ((u8)selection != mSelectedChoiceIndex) {
+ if (selection != mSelectedChoiceIndex) {
mSelectedChoiceIndex = selection;
mDoAud_seStart(JA_SE_TALK_CURSOR);
}
@@ -553,9 +594,9 @@ void dJle_Pb_c::selectMode() {
if (mDoGph_getCaptureStep() == 5) {
mDoGph_setCaptureStep(6);
- if ((u8)selection == 0) {
+ if (selection == 0) {
pictureNum = dComIfGs_getPictureNum();
- dPbPhotoSlotData * dst = mPhotoBuffer[pictureNum];
+ card_pictdata* pict = mPhotoBuffer[pictureNum];
#if VERSION <= VERSION_JPN
dComIfGp_onPictureFlag(pictureNum);
@@ -565,16 +606,15 @@ void dJle_Pb_c::selectMode() {
dComIfGp_onPictureFlag(2);
#endif
- dst->mSnapResultId = dSnap_GetResult();
- dst->mSnapResultDetail = dSnap_GetResultDetail();
- dst->mPhotoFormat = mCaptureFormat;
-
- memcpy(dst, mDoGph_getCaptureTextureBuffer(), 0x1ee0);
+ pict->snap_result = dSnap_GetResult();
+ pict->snap_result_detail = dSnap_GetResultDetail();
+ pict->capture_format = mCaptureFormat;
+ memcpy(pict->tex_buffer, mDoGph_getCaptureTextureBuffer(), sizeof(pict->tex_buffer));
#if VERSION <= VERSION_JPN
- DCFlushRangeNoSync(dst, 0x1ee0);
+ DCFlushRangeNoSync(pict->tex_buffer, sizeof(pict->tex_buffer));
#else
- DCStoreRangeNoSync(dst, 0x1ee0);
+ DCStoreRangeNoSync(pict->tex_buffer, sizeof(pict->tex_buffer));
#endif
dComIfGp_setItemPictureNumCount(1);
@@ -658,7 +698,7 @@ void dJle_Pb_c::pictureDraw(u8 mono_color_1_alpha, int img_index) {
Mtx44 mtx;
GXTexObj tex_obj;
- dPbPhotoSlotData* img = mPhotoBuffer[img_index];
+ card_pictdata* pict = mPhotoBuffer[img_index];
u32 index = (img_index == 3) ? 0 : img_index;
f32 f2 = pane_no[index].mPosTopLeft.x + REG6_F(0);
f32 f3 = pane_no[index].mPosTopLeft.y + REG6_F(1);
@@ -711,7 +751,7 @@ void dJle_Pb_c::pictureDraw(u8 mono_color_1_alpha, int img_index) {
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGB8, 0);
- GXInitTexObj(&tex_obj, img, 0x98, 0x68, GX_TF_CMPR, GX_CLAMP, GX_CLAMP, GX_FALSE);
+ GXInitTexObj(&tex_obj, pict->tex_buffer, 0x98, 0x68, GX_TF_CMPR, GX_CLAMP, GX_CLAMP, GX_FALSE);
GXLoadTexObj(&tex_obj, GX_TEXMAP0);
s32 r31 = (s32)r30 - 0x98;
@@ -746,14 +786,14 @@ void dJle_Pb_c::pictureDraw(u8 mono_color_1_alpha, int img_index) {
/* 80227D34-80227ED8 .text pictureEraseWait__9dJle_Pb_cFv */
void dJle_Pb_c::pictureEraseWait() {
- int bVar1 = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
- if ((u8)bVar1 != mSelectedChoiceIndex) {
+ u8 bVar1 = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
+ if (bVar1 != mSelectedChoiceIndex) {
mSelectedChoiceIndex = bVar1;
mDoAud_seStart(JA_SE_TALK_CURSOR);
}
if (CPad_CHECK_TRIG_A(0)) {
- if ((u8)bVar1 == 0) {
+ if (bVar1 == 0) {
pictureErase();
mDoAud_seStart(JA_SE_UTUSHIE_B_DEL_PIC);
}
@@ -775,19 +815,19 @@ void dJle_Pb_c::pictureEraseWait() {
/* 80227ED8-802280C8 .text pictureDecide__9dJle_Pb_cFv */
void dJle_Pb_c::pictureDecide() {
- int bVar2 = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
- if ((u8)bVar2 != mSelectedChoiceIndex) {
+ u8 bVar2 = mMsgDataProc.selectCheckYoko(mMsgSelectArrowPic, mChoiceCursorX0, mChoiceCursorY, mChoiceCursorX1 - mChoiceCursorX0);
+ if (bVar2 != mSelectedChoiceIndex) {
mSelectedChoiceIndex = bVar2;
mDoAud_seStart(JA_SE_TALK_CURSOR);
}
if (CPad_CHECK_TRIG_A(0)) {
- if ((u8)bVar2 == 0) {
- dPbPhotoSlotData* tmp = mPhotoBuffer[(u8)mSelectedPhotoSlot];
+ if (bVar2 == 0) {
+ card_pictdata* pict = mPhotoBuffer[mSelectedPhotoSlot];
dComIfGp_setSelectPicture(mSelectedPhotoSlot);
- dComIfGp_setPictureFormat(tmp->mPhotoFormat);
+ dComIfGp_setPictureFormat(pict->capture_format);
dComIfGp_setPictureStatus(1);
- dComIfGp_setPictureResult(tmp->mSnapResultId);
- dComIfGp_setPictureResultDetail(tmp->mSnapResultDetail);
+ dComIfGp_setPictureResult(pict->snap_result);
+ dComIfGp_setPictureResultDetail(pict->snap_result_detail);
#if VERSION <= VERSION_JPN
mDoAud_seStart(JA_SE_UTUSHIE_B_DEL_PIC);
@@ -982,12 +1022,12 @@ void dJle_Pb_c::moveCamera() {
dComIfGp_setDoStatusForce(dActStts_TAKE_PHOTO_e);
}
else {
- dComIfGp_setDoStatusForce(dActStts_BLANK_e);
+ dComIfGp_setDoStatusForce(dActStts_BLANK_e);
}
dComIfGp_setAStatusForce(dActStts_RETURN_e);
- if (dComIfGp_getPictureStatus() != 2 && dComIfGp_getPictureStatus() != 3) {
+ if (dComIfGp_getPictureStatus() != 2 && dComIfGp_getPictureStatus() != 3) {
dComIfGp_setRStatusForce(dActStts_SWAP_MODES_e);
}
}
@@ -1061,9 +1101,13 @@ void dJle_Pb_c::moveBrowse() {
dComIfGp_setAStatusForce(dActStts_RETURN_e);
+#if VERSION == VERSION_DEMO
+ dComIfGp_setRStatusForce(dActStts_SWAP_MODES_e);
+#else
if (dComIfGp_getPictureStatus() != 2 && dComIfGp_getPictureStatus() != 3) {
dComIfGp_setRStatusForce(dActStts_SWAP_MODES_e);
}
+#endif
} else if (mModeSubState == PB_SUB_CONFIRM_e) {
pictureEraseWait();
@@ -1175,12 +1219,11 @@ void dJle_Pb_c::getBrowse() {
dComIfGp_onPictureFlag(2);
#endif
- memcpy(mPhotoBuffer[dComIfGs_getPictureNum()], mPhotoBuffer[3], 0x2000);
-
+ memcpy(mPhotoBuffer[dComIfGs_getPictureNum()], mPhotoBuffer[3], sizeof(card_pictdata));
#if VERSION <= VERSION_JPN
- DCFlushRangeNoSync(mPhotoBuffer[dComIfGs_getPictureNum()], 0x2000);
+ DCFlushRangeNoSync(mPhotoBuffer[dComIfGs_getPictureNum()], sizeof(card_pictdata));
#else
- DCStoreRangeNoSync(mPhotoBuffer[dComIfGs_getPictureNum()], 0x2000);
+ DCStoreRangeNoSync(mPhotoBuffer[dComIfGs_getPictureNum()], sizeof(card_pictdata));
#endif
dComIfGp_setItemPictureNumCount(1);
@@ -1334,19 +1377,19 @@ void dJle_Pb_c::setColorAnime(u8 param_1) {
}
- icnWhite.r = (u8)(icn_white.r - t * (icn_white.r - 255.0f));
- icnWhite.g = (u8)(icn_white.g - t * (icn_white.g - 60.0f));
- icnWhite.b = (u8)(icn_white.b - t * (icn_white.b - 60.0f));
+ icnWhite.r = (icn_white.r - t * (icn_white.r - 255.0f));
+ icnWhite.g = (icn_white.g - t * (icn_white.g - 60.0f));
+ icnWhite.b = (icn_white.b - t * (icn_white.b - 60.0f));
icnWhite.a = 0xFF;
- empWhite.r = (u8)(emp_white.r - t * (emp_white.r - 255.0f));
- empWhite.g = (u8)(emp_white.g - t * (emp_white.g - 60.0f));
- empWhite.b = (u8)(emp_white.b - t * (emp_white.b - 60.0f));
+ empWhite.r = (emp_white.r - t * (emp_white.r - 255.0f));
+ empWhite.g = (emp_white.g - t * (emp_white.g - 60.0f));
+ empWhite.b = (emp_white.b - t * (emp_white.b - 60.0f));
empWhite.a = 0xFF;
- empBlack.r = (u8)(emp_black.r - t * (emp_black.r - 255.0f));
- empBlack.g = (u8)(emp_black.g - t * (emp_black.g - 60.0f));
- empBlack.b = (u8)(emp_black.b - t * (emp_black.b - 60.0f));
+ empBlack.r = (emp_black.r - t * (emp_black.r - 255.0f));
+ empBlack.g = (emp_black.g - t * (emp_black.g - 60.0f));
+ empBlack.b = (emp_black.b - t * (emp_black.b - 60.0f));
empBlack.a = 0;
((J2DPicture*)pane_icn[param_1].pane)->setWhite(icnWhite);
@@ -1368,15 +1411,15 @@ void dJle_Pb_c::changeData() {
if(i != j) {
mPhotoSlotOccupied[i] = 0;
mPhotoSlotOccupied[j] = 1;
- memcpy(mPhotoBuffer[j], mPhotoBuffer[i], 0x2000);
+ memcpy(mPhotoBuffer[j], mPhotoBuffer[i], sizeof(card_pictdata));
#if VERSION <= VERSION_JPN
- DCFlushRangeNoSync(mPhotoBuffer[j], 0x2000);
+ DCFlushRangeNoSync(mPhotoBuffer[j], sizeof(card_pictdata));
#else
- DCStoreRangeNoSync(mPhotoBuffer[j], 0x2000);
+ DCStoreRangeNoSync(mPhotoBuffer[j], sizeof(card_pictdata));
#endif
}
mDoMemCdRWm_SetCheckSumPictData((u8*)mPhotoBuffer[i]);
- JKRMainRamToAram((u8*)mPhotoBuffer[i], dComIfGp_getPictureBoxData(j), 0x2000, EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1);
+ JKRMainRamToAram((u8*)mPhotoBuffer[i], dComIfGp_getPictureBoxData(j), sizeof(card_pictdata), EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1);
j++;
}
}
@@ -1552,11 +1595,10 @@ void dJle_Pb_c::shutterLineMove() {
determinant = a1 * b2 - x2OrA2 * b1;
if (determinant) {
- intersectionX[i] =
- (b2 * c1 - b1 * xNext) / determinant;
-
- intersectionY[i] =
- (-x2OrA2 * c1 + a1 * xNext) / determinant;
+ f32 temp1 = (b2 * c1 - b1 * xNext) / determinant;
+ f32 temp2 = (-x2OrA2 * c1 + a1 * xNext) / determinant;;
+ intersectionX[i] = temp1;
+ intersectionY[i] = temp2;
} else {
intersectionX[i] = x1;
intersectionY[i] = mShutterLineY1[i];
@@ -1613,7 +1655,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) {
}
head_p = msgGet.getMesgHeader(msgNo);
- JUT_ASSERT(VERSION_SELECT(1836, 1836, 1881, 1908), head_p);
+ JUT_ASSERT(VERSION_SELECT(1841, 1836, 1881, 1908), head_p);
const char* text = msgGet.getMessage(head_p);
mMsgEntry = msgGet.getMesgEntry(head_p);
@@ -1671,7 +1713,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) {
mMsgDataProc.stringSet();
for (int i = 0; i < 4; i++) {
- ((J2DTextBox*)pane_tx[i].pane)->setString((char*)mMsgTextBuffer[i]);
+ ((J2DTextBox*)pane_tx[i].pane)->setString(mMsgTextBuffer[i]);
}
for (int i = 0; i < 15; i++) {
@@ -1697,7 +1739,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) {
mMsgSelectArrowPic->show();
mMsgSelectArrowPic->setAlpha(0xFF);
- mChoiceArrowIconIdx = (u8)i;
+ mChoiceArrowIconIdx = i;
if (firstChoiceSeen == 0) {
firstChoiceSeen = 1;
@@ -1723,7 +1765,7 @@ void dJle_Pb_c::messageSet(u32 msgNo) {
mMsgSelectArrowPic->show();
mMsgSelectArrowPic->setAlpha(0xFF);
- mChoiceArrowIconIdx = (u8)i;
+ mChoiceArrowIconIdx = i;
if (firstChoiceSeen != 0) {
mSelectedChoiceIndex = 1;
@@ -1808,25 +1850,25 @@ void dJle_Pb_c::_create(JKRExpHeap* i_heap) {
int k = 0;
scrn = new J2DScreen();
- JUT_ASSERT(VERSION_SELECT(2033, 2033, 2086, 2113), scrn != NULL);
+ JUT_ASSERT(VERSION_SELECT(2038, 2033, 2086, 2113), scrn != NULL);
scrn->set("wipe_01_01.blo", dComIfGp_getCameraResArchive());
scrn1 = new J2DScreen();
- JUT_ASSERT(VERSION_SELECT(2037, 2037, 2090, 2117), scrn1 != NULL);
+ JUT_ASSERT(VERSION_SELECT(2042, 2037, 2090, 2117), scrn1 != NULL);
scrn1->set("wipe_01_02.blo", dComIfGp_getCameraResArchive());
scrn2 = new J2DScreen();
- JUT_ASSERT(VERSION_SELECT(2041, 2041, 2094, 2121), scrn2 != NULL);
+ JUT_ASSERT(VERSION_SELECT(2046, 2041, 2094, 2121), scrn2 != NULL);
scrn2->set("hukidashi_08.blo", dComIfGp_getMsgArchive());
font0 = mDoExt_getMesgFont();
- JUT_ASSERT(VERSION_SELECT(2045, 2045, 2098, 2125), font0 != NULL);
+ JUT_ASSERT(VERSION_SELECT(2050, 2045, 2098, 2125), font0 != NULL);
font1 = mDoExt_getRubyFont();
- JUT_ASSERT(VERSION_SELECT(2048, 2048, 2102, 2129), font1 != NULL);
+ JUT_ASSERT(VERSION_SELECT(2053, 2048, 2102, 2129), font1 != NULL);
- stick = new STControl(5, 2, 3, 2, 0.9f, 0.5f, 0, 0x2000);
- JUT_ASSERT(VERSION_SELECT(2051, 2051, 2107, 2134), stick != NULL);
+ stick = new STControl(5, 2, 3, 2);
+ JUT_ASSERT(VERSION_SELECT(2056, 2051, 2107, 2134), stick != NULL);
mMsgIconFontMainPic = new J2DPicture("font_07_02.bti");
mMsgIconFontSubPic = new J2DPicture("font_07_02.bti");
@@ -1894,7 +1936,7 @@ void dJle_Pb_c::_create(JKRExpHeap* i_heap) {
JKRAramToMainRam(
dComIfGp_getPictureBoxData(mPictureSlotSortMap[i]),
(u8*)mPhotoBuffer[k],
- 0x2000
+ sizeof(card_pictdata)
);
j++;
k++;
@@ -1960,28 +2002,27 @@ void dJle_Pb_c::_gopen() {
messageSet(0xee5);
}
- s16 counter = mFadeTimer;
- if (counter >= 10) {
+ if (mFadeTimer >= 10) {
if (mImportedPhotoLoadReq->sync() != 0) {
- dPbPhotoSlotData* dst = mPhotoBuffer[3];
- memcpy(dst, mImportedPhotoLoadReq->getMemAddress(), 0x1EE0);
+ card_pictdata* pict = mPhotoBuffer[3];
+ memcpy(pict->tex_buffer, mImportedPhotoLoadReq->getMemAddress(), sizeof(pict->tex_buffer));
#if VERSION <= VERSION_JPN
- DCFlushRangeNoSync(dst, 0x1EE0);
+ DCFlushRangeNoSync(pict->tex_buffer, sizeof(pict->tex_buffer));
#else
- DCStoreRangeNoSync(dst, 0x1EE0);
+ DCStoreRangeNoSync(pict->tex_buffer, sizeof(pict->tex_buffer));
#endif
-
+
u8 picNo = dComIfGp_getGetPictureNum();
- dst->mSnapResultId = photo_idx[picNo];
- dst->mSnapResultDetail = 0;
- dst->mPhotoFormat = GX_TF_CMPR;
-
+ pict->snap_result = photo_idx[picNo];
+ pict->snap_result_detail = 0;
+ pict->capture_format = GX_TF_CMPR;
+
dComIfGp_setScopeMesgStatus(fopMsgStts_UNKB_e);
mExecState = PB_EXEC_GET_MOVE_e;
mDoAud_seStart(JA_SE_ITM_SUBMENU_IN_2);
}
} else {
- mFadeTimer = counter + 1;
+ mFadeTimer++;
getAlphaInc(fopMsgM_valueIncrease(10, mFadeTimer, 0));
}
@@ -2246,7 +2287,7 @@ void dJle_Pb_c::_delete(JKRExpHeap* i_heap) {
}
if (mImportedPhotoLoadReq != NULL) {
- delete mImportedPhotoLoadReq;
+ delete mImportedPhotoLoadReq;
}
delete scrn;
@@ -2348,22 +2389,22 @@ static cPhs_State dPb_Create(msg_class* i_this) {
i_Pb->heap = dComIfGp_getExpHeap2D();
dComIfGp_setHeapLockFlag(6);
- JUT_ASSERT(VERSION_SELECT(2725, 2725, 2796, 2823), i_Pb->heap != NULL);
+ JUT_ASSERT(VERSION_SELECT(2716, 2725, 2796, 2823), i_Pb->heap != NULL);
JKRHeap* oldHeap = mDoExt_setCurrentHeap(i_Pb->heap);
i_Pb->dPb_c = new dJle_Pb_c();
for(int i = 0; i < 4; i++) {
- i_Pb->buffer[i] = (dPbPhotoSlotData*)i_Pb->heap->alloc(0x2000, 0x20);
- JUT_ASSERT(VERSION_SELECT(2734, 2734, 2805, 2832), i_Pb->buffer[i] != NULL);
+ i_Pb->buffer[i] = (card_pictdata*)i_Pb->heap->alloc(sizeof(card_pictdata), 0x20);
+ JUT_ASSERT(VERSION_SELECT(2725, 2734, 2805, 2832), i_Pb->buffer[i] != NULL);
i_Pb->dPb_c->getMemory(i_Pb->buffer[i], i);
}
for(int i = 0; i < 4; i++) {
char* buffer = (char*)i_Pb->heap->alloc(1000, 4);
i_Pb->dPb_c->setTextArea(buffer, i);
- JUT_ASSERT(VERSION_SELECT(2741, 2741, 2812, 2839), buffer != NULL);
+ JUT_ASSERT(VERSION_SELECT(2732, 2741, 2812, 2839), buffer != NULL);
}
i_Pb->dPb_c->_create(i_Pb->heap);
diff --git a/src/d/d_snap.cpp b/src/d/d_snap.cpp
index 620687da..783d688e 100644
--- a/src/d/d_snap.cpp
+++ b/src/d/d_snap.cpp
@@ -1457,7 +1457,7 @@ int dSnap_GetFigRoomId(int tableIndex) {
/* 800CD00C-800CD068 .text __ct__9dSnap_ObjFv */
dSnap_Obj::dSnap_Obj() {
mActorPID = fpcM_ERROR_PROCESS_ID_e;
- mPhoto = 0;
+ mPhotoNo = 0;
field_0x19 = 4;
field_0x1a = -1;
field_0x1b = 0;
@@ -1703,8 +1703,8 @@ void dSnap_Obj::SetGeoSph(const Vec& center, f32 radius) {
}
/* 800CDB68-800CDB94 .text SetInf__9dSnap_ObjFUcPC10fopAc_ac_cUcUcs */
-void dSnap_Obj::SetInf(u8 photoIndex, const fopAc_ac_c* r5, u8 r6, u8 r7, s16 cullAngle) {
- mPhoto = photoIndex;
+void dSnap_Obj::SetInf(u8 photoNo, const fopAc_ac_c* r5, u8 r6, u8 r7, s16 cullAngle) {
+ mPhotoNo = photoNo;
mActorPID = fopAcM_GetID(const_cast<fopAc_ac_c*>(r5));
field_0x1a = r6;
field_0x19 = r7;
@@ -1736,8 +1736,8 @@ void dSnap_Obj::SetArea(s16 x, s16 y) {
}
/* 800CDC04-800CDC18 .text ChkPhoto__9dSnap_ObjFi */
-bool dSnap_Obj::ChkPhoto(int r4) {
- return mPhoto == r4 ? TRUE : FALSE;
+bool dSnap_Obj::ChkPhoto(int photoNo) {
+ return mPhotoNo == photoNo ? TRUE : FALSE;
}
/* 800CDC18-800CDC40 .text ChkSuccess__9dSnap_ObjFlf */
@@ -1973,12 +1973,12 @@ void dSnap_packet::Judge() {
}
/* 800CE610-800CE6A4 .text FindPhoto__12dSnap_packetFii */
-int dSnap_packet::FindPhoto(int r4, int r5) {
+int dSnap_packet::FindPhoto(int r4, int photoNo) {
if (r4 < 0 || r4 >= field_0x14) {
return -1;
}
for (int col = r4; col < field_0x14; col++) {
- if (m_tbl[col].m_obj.ChkPhoto(r5)) {
+ if (m_tbl[col].m_obj.ChkPhoto(photoNo)) {
return col;
}
}
@@ -1987,7 +1987,7 @@ int dSnap_packet::FindPhoto(int r4, int r5) {
/* 800CE6A4-800CE70C .text JudgePost__12dSnap_packetFv */
int dSnap_packet::JudgePost() {
- int col = FindPhoto(0, 1);
+ int col = FindPhoto(0, DSNAP_TYPE_POST);
if (col == -1) {
return 0;
}
@@ -2000,7 +2000,7 @@ int dSnap_packet::JudgePost() {
/* 800CE70C-800CE77C .text JudgeBikutsuki__12dSnap_packetFv */
int dSnap_packet::JudgeBikutsuki() {
- int col = FindPhoto(0, 2);
+ int col = FindPhoto(0, DSNAP_TYPE_BIKUTSUKI);
if (col == -1) {
return 0;
}
@@ -2013,11 +2013,11 @@ int dSnap_packet::JudgeBikutsuki() {
/* 800CE77C-800CE83C .text JudgeCoupleLook__12dSnap_packetFv */
int dSnap_packet::JudgeCoupleLook() {
- int col1 = FindPhoto(0, 3);
+ int col1 = FindPhoto(0, DSNAP_TYPE_COUPLE_LOOK);
if (col1 == -1) {
return 0;
}
- int col2 = FindPhoto(col1+1, 3);
+ int col2 = FindPhoto(col1+1, DSNAP_TYPE_COUPLE_LOOK);
if (col2 == -1) {
return 0;
}
@@ -2032,7 +2032,7 @@ int dSnap_packet::JudgeCoupleLook() {
/* 800CE83C-800CE8AC .text JudgeGF__12dSnap_packetFv */
int dSnap_packet::JudgeGF() {
- int col = FindPhoto(0, 4);
+ int col = FindPhoto(0, DSNAP_TYPE_UNK04);
if (col == -1) {
return 0;
}
@@ -2045,7 +2045,7 @@ int dSnap_packet::JudgeGF() {
/* 800CE8AC-800CE96C .text JudgeGenzo__12dSnap_packetFv */
int dSnap_packet::JudgeGenzo() {
- int col1 = FindPhoto(0, 5);
+ int col1 = FindPhoto(0, DSNAP_TYPE_UNK05);
if (col1 == -1) {
return 0;
}
@@ -2068,11 +2068,11 @@ int dSnap_packet::JudgeGenzo() {
/* 800CE96C-800CEA08 .text JudgeObasan4__12dSnap_packetFv */
int dSnap_packet::JudgeObasan4() {
- int col1 = FindPhoto(0, 6);
+ int col1 = FindPhoto(0, DSNAP_TYPE_UNK06);
if (col1 == -1) {
return 0;
}
- int col2 = FindPhoto(0, 5);
+ int col2 = FindPhoto(0, DSNAP_TYPE_UNK05);
if (col2 != -1) {
return 0;
}
@@ -2090,12 +2090,12 @@ int dSnap_packet::JudgeTestM() {
/* 800CEA10-800CEA80 .text JudgeGene__12dSnap_packetFv */
int dSnap_packet::JudgeGene() {
- int col = FindPhoto(0, field_0x10);
+ int col = FindPhoto(0, mPhotoNo);
if (col == -1) {
return 0;
}
if (m_tbl[col].m_obj.ChkSuccess(4000, 0.5f)) {
- return field_0x10;
+ return mPhotoNo;
} else {
return 0;
}
@@ -2110,17 +2110,17 @@ int dSnap_packet::JudgeFigure(int col) {
m_tbl[col].m_obj.mActorPID = m_tbl[col].m_obj.mActorPID;
#endif
- if (field_0x10 >= 0xD0) {
+ if (mPhotoNo >= DSNAP_TYPE_LAST_INDEX) {
return 0;
}
- if (field_0x10 >= 0xCF) {
+ if (mPhotoNo >= DSNAP_TYPE_UNKCF) {
return 0;
}
int minPixels;
f32 minRatio;
- if (field_0x10 > 0x48) {
- int tableIndex = dSnap_PhotoIndex2TableIndex(field_0x10);
+ if (mPhotoNo > DSNAP_TYPE_UNK48) {
+ int tableIndex = dSnap_PhotoIndex2TableIndex(mPhotoNo);
minPixels = l_CharaData[tableIndex].minPixels;
minRatio = l_CharaData[tableIndex].minRatio / 1000.0f;
} else {
@@ -2139,16 +2139,16 @@ int dSnap_packet::JudgeFigure(int col) {
mResultDetail |= 1;
}
- return field_0x10;
+ return mPhotoNo;
}
/* 800CEB80-800CED0C .text SetResult__12dSnap_packetFv */
void dSnap_packet::SetResult() {
mResult = 0;
mResultDetail = 0;
- u8 sp8[0xB];
+ bool sp8[ARRAY_SIZE(m_judge_tbl)];
for (int i = 0; i < ARRAY_SIZE(sp8); i++) {
- sp8[i] = 0;
+ sp8[i] = false;
}
int r30 = -1;
for (int col = 0; col < field_0x14; col++) {
@@ -2156,22 +2156,22 @@ void dSnap_packet::SetResult() {
continue;
}
JUT_ASSERT(VERSION_SELECT(2273, 2325, 2327, 2327), 0 <= m_tbl[col].m_obj.GetPhoto() && m_tbl[col].m_obj.GetPhoto() < DSNAP_TYPE_LAST_INDEX);
- if (m_tbl[col].m_obj.GetPhoto() < (s32)ARRAY_SIZE(sp8)) {
- if (sp8[m_tbl[col].m_obj.GetPhoto()] != 0) {
+ if (m_tbl[col].m_obj.GetPhoto() < ARRAY_SSIZE(sp8)) {
+ if (sp8[m_tbl[col].m_obj.GetPhoto()]) {
continue;
}
- if (m_judge_tbl[m_tbl[col].m_obj.GetPhoto()] != 0) {
- field_0x10 = m_tbl[col].m_obj.GetPhoto();
+ if (m_judge_tbl[m_tbl[col].m_obj.GetPhoto()] != NULL) {
+ mPhotoNo = m_tbl[col].m_obj.GetPhoto();
mResult = (this->*m_judge_tbl[m_tbl[col].m_obj.GetPhoto()])();
r30 = m_tbl[col].m_obj.mCapturedPixels;
if (mResult != 0) {
return;
}
}
- sp8[m_tbl[col].m_obj.GetPhoto()] = 1;
+ sp8[m_tbl[col].m_obj.GetPhoto()] = true;
} else {
if (r30 < m_tbl[col].m_obj.mCapturedPixels) {
- field_0x10 = m_tbl[col].m_obj.GetPhoto();
+ mPhotoNo = m_tbl[col].m_obj.GetPhoto();
mResult = JudgeFigure(col);
r30 = m_tbl[col].m_obj.mCapturedPixels;
}
@@ -2215,15 +2215,15 @@ void dSnap_RegistFig(u8 photoIndex, fopAc_ac_c* actor, f32 f1, f32 f2, f32 f3) {
}
/* 800CEDF8-800CEFD4 .text dSnap_RegistFig__FUcP10fopAc_ac_cRC3Vecsfff */
-void dSnap_RegistFig(u8 photoIndex, fopAc_ac_c* actor, const Vec& pos, s16 angleY, f32 f1, f32 f2, f32 f3) {
+void dSnap_RegistFig(u8 photoNo, fopAc_ac_c* actor, const Vec& pos, s16 angleY, f32 f1, f32 f2, f32 f3) {
if (!l_snap.ChkReleaseShutter()) {
return;
}
- if (photoIndex >= 0xCF) {
+ if (photoNo >= DSNAP_TYPE_UNKCF) {
return;
}
- int tableIndex = dSnap_PhotoIndex2TableIndex(photoIndex);
+ int tableIndex = dSnap_PhotoIndex2TableIndex(photoNo);
const CharaData& chara = l_CharaData[tableIndex];
mDoMtx_stack_c::YrotS(angleY);
cXyz sp14;
@@ -2240,7 +2240,7 @@ void dSnap_RegistFig(u8 photoIndex, fopAc_ac_c* actor, const Vec& pos, s16 angle
int angY = angleY;
dSnap_Obj sp20;
sp20.SetGeo(sp14, chara.radius*f2, chara.height*f1, angY);
- sp20.SetInf(photoIndex, actor, 0, 4, chara.cullAngle);
+ sp20.SetInf(photoNo, actor, 0, 4, chara.cullAngle);
dSnap_RegistSnapObj(sp20);
}