diff --git a/include/JSystem/J2DGraph/J2DWindow.h b/include/JSystem/J2DGraph/J2DWindow.h index a56ff6ab1..b98718455 100644 --- a/include/JSystem/J2DGraph/J2DWindow.h +++ b/include/JSystem/J2DGraph/J2DWindow.h @@ -36,18 +36,22 @@ public: void drawContentsTexture(f32, f32, f32, f32); void setTevMode(JUTTexture*, JUtility::TColor, JUtility::TColor); - void getBlack() const {} + const JUtility::TColor& getBlack() const { return mBlack; } void getContentsColor(TContentsColor& param_0) const { param_0.mTL = mColorTL; param_0.mTR = mColorTR; param_0.mBL = mColorBL; param_0.mBR = mColorBR; } - void getWhite() const {} - void setBlack(JUtility::TColor) {} - void setContentsColor(TContentsColor) {} - void setContentsColor(JUtility::TColor) {} - void setWhite(JUtility::TColor) {} + const JUtility::TColor& getWhite() const { return mWhite; } + bool setBlack(JUtility::TColor black) { mBlack = black; return true; } + void setContentsColor(TContentsColor c) { + setContentsColor(c.mTL, c.mTR, c.mBL, c.mBR); + } + void setContentsColor(JUtility::TColor c) { + setContentsColor(c, c, c, c); + } + bool setWhite(JUtility::TColor white) { mWhite = white; return true; } public: /* 0x0CC */ JUTTexture* mpFrameTexture1; diff --git a/include/d/d_menu_dmap.h b/include/d/d_menu_dmap.h index 4fe357933..9dd12c4c5 100644 --- a/include/d/d_menu_dmap.h +++ b/include/d/d_menu_dmap.h @@ -30,7 +30,7 @@ struct dMap_pane_c { class dMenu_Dmap_c : public dMenu_base_c { public: void alphaChange(fopMsgM_pane_class*, float) {} - virtual void draw() {} + virtual void draw() { _draw(); } void setArchive(JKRArchive* arc) { mpArc = arc; } void setFont(JUTFont* font, JUTFont* rfont) { mFont = font; @@ -89,14 +89,14 @@ public: /* 0x069C */ fopMsgM_pane_class mCarPanes[4]; /* 0x077C */ fopMsgM_pane_class mNm00Pane; /* 0x07B4 */ fopMsgM_pane_class mNm01Pane; - /* 0x07EC */ fopMsgM_pane_class mItmnPane; + /* 0x07EC */ fopMsgM_pane_class mItnmPane; /* 0x0824 */ fopMsgM_pane_class mItnkPane; /* 0x085C */ fopMsgM_pane_class mMsk0Pane; /* 0x0894 */ fopMsgM_pane_class mStr0Pane; /* 0x08CC */ fopMsgM_pane_class mSt00Pane; /* 0x0904 */ fopMsgM_pane_class mNt00Pane; /* 0x093C */ fopMsgM_pane_class mNk00Pane; - /* 0x0974 */ fopMsgM_pane_class mNo01Pane; + /* 0x0974 */ fopMsgM_pane_class mNo11Pane; /* 0x09AC */ fopMsgM_pane_class mDtlePane; /* 0x09E4 */ fopMsgM_pane_class mDt00Pane; /* 0x0A1C */ fopMsgM_pane_class mDk00Pane; @@ -113,16 +113,16 @@ public: /* 0x0E7C */ fopMsgM_pane_class mFlPanes[6]; /* 0x0FCC */ fopMsgM_pane_class mFbPanes[6]; /* 0x111C */ fopMsgM_pane_class mFbkPanes[6]; - /* 0x126C */ fopMsgM_pane_class field_0x126C; - /* 0x12A4 */ fopMsgM_pane_class field_0x12A4; - /* 0x12DC */ fopMsgM_pane_class field_0x12DC; - /* 0x1314 */ fopMsgM_pane_class field_0x1314; - /* 0x134C */ fopMsgM_pane_class field_0x134C; - /* 0x1384 */ fopMsgM_pane_class field_0x1384; - /* 0x13BC */ fopMsgM_pane_class field_0x13BC; - /* 0x13F4 */ fopMsgM_pane_class field_0x13F4; - /* 0x142C */ fopMsgM_pane_class field_0x142C; - /* 0x1464 */ fopMsgM_pane_class field_0x1464; + /* 0x126C */ fopMsgM_pane_class mFw00Pane; + /* 0x12A4 */ fopMsgM_pane_class mFw01Pane; + /* 0x12DC */ fopMsgM_pane_class mCc38Pane; + /* 0x1314 */ fopMsgM_pane_class mCc31Pane; + /* 0x134C */ fopMsgM_pane_class mCc24Pane; + /* 0x1384 */ fopMsgM_pane_class mCc17Pane; + /* 0x13BC */ fopMsgM_pane_class mCc10Pane; + /* 0x13F4 */ fopMsgM_pane_class mCc05pane; + /* 0x142C */ fopMsgM_pane_class mCc00Pane; + /* 0x1464 */ fopMsgM_pane_class mMskPane; /* 0x149C */ STControl* stick; /* 0x14A0 */ dMap_Dmap_c* dmap_c; /* 0x14A4 */ JKRArchive* mpArc; diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index 243aba3d4..49ce0fcd4 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -8,38 +8,10 @@ #include "d/d_stage.h" #include "f_op/f_op_msg_mng.h" #include "JSystem/J2DGraph/J2DTextBox.h" +#include "JSystem/J2DGraph/J2DWindow.h" dMd_HIO_c g_mdHIO; -const char* floor_name[] = { - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B3.bti", - "hierarchy_num_B2.bti", - "hierarchy_num_B1.bti", - "hierarchy_num_1.bti", - "hierarchy_num_2.bti", - "hierarchy_num_3.bti", - "hierarchy_num_4.bti", - "hierarchy_num_5.bti", - "hierarchy_num_6.bti", - "hierarchy_num_7.bti", - "hierarchy_num_7.bti", - "hierarchy_num_7.bti", - "hierarchy_num_7.bti", -}; - -const char* itmTex[] = { - "dungeon_map.bti", - "boss_key.bti", - "compass.bti", -}; - /* 801A86A4-801A87CC .text __ct__9dMd_HIO_cFv */ dMd_HIO_c::dMd_HIO_c() { field_0x06 = 0; @@ -103,6 +75,29 @@ dMd_HIO_c::dMd_HIO_c() { /* 801A87CC-801A8818 .text changeFloorTexture__12dMenu_Dmap_cFP7J2DPanei */ void dMenu_Dmap_c::changeFloorTexture(J2DPane* i_pane, int i_floor) { + static const char* floor_name[] = { + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B3.bti", + "hierarchy_num_B2.bti", + "hierarchy_num_B1.bti", + "hierarchy_num_1.bti", + "hierarchy_num_2.bti", + "hierarchy_num_3.bti", + "hierarchy_num_4.bti", + "hierarchy_num_5.bti", + "hierarchy_num_6.bti", + "hierarchy_num_7.bti", + "hierarchy_num_7.bti", + "hierarchy_num_7.bti", + "hierarchy_num_7.bti", + }; + if (i_floor < 0 || i_floor >= 20) { i_floor = 0; } @@ -111,6 +106,11 @@ void dMenu_Dmap_c::changeFloorTexture(J2DPane* i_pane, int i_floor) { /* 801A8818-801A92D4 .text screenSet__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::screenSet() { + static const char* itmTex[] = { + "dungeon_map.bti", + "boss_key.bti", + "compass.bti", + }; static const u32 l_ft[] = { 'ft00', 'ft01', 'ft02', 'ft03', 'ft04', @@ -124,124 +124,154 @@ void dMenu_Dmap_c::screenSet() { 'fd10', 'fd11', 'fd12', 'fd13', 'fd14', }; + static const u32 l_car[] = { 'car1', 'car2', 'car3', 'car4' }; + static const u32 l_it[] = { 'it00', 'it01', 'it02' }; + static const u32 l_ik[] = { 'ik00', 'ik01', 'ik02' }; + static const u32 l_ip[] = { 'ip06', 'ip04', 'ip02', 'ip01' }; + static const u32 l_lnk[] = { 'lnk0', 'lnk1', 'lnk2' }; + static const u32 l_fl[] = { 'f001', 'f002', 'f003', 'f004', 'f005', 'f006' }; + static const u32 l_fb[] = { 'fb01', 'fb02', 'fb03', 'fb04', 'fb05', 'fb06' }; + static const u32 l_fbk[] = { 'fbk1', 'fbk2', 'fbk3', 'fbk4', 'fbk5', 'fbk6' }; + for (int i = 0; i < 15; i++) { fopMsgM_setPaneData(&mFtPanes[i], scrn2, l_ft[i]); fopMsgM_setPaneData(&mFdPanes[i], scrn2, l_fd[i]); } - static const u32 l_car[] = { - 'car1', 'car2', 'car3', 'car4', - }; - for (int i = 0; i < 4; i++) { - fopMsgM_setPaneData(&mCarPanes[i], scrn2, l_car[i]); + fopMsgM_setPaneData(&mCarPanes[i], scrn, l_car[i]); } fopMsgM_setPaneData(&mNm00Pane, scrn2, 'nm00'); ((J2DTextBox*)mNm00Pane.pane)->setFont(mFont); fopMsgM_setPaneData(&mNm01Pane, scrn2, 'nm01'); ((J2DTextBox*)mNm01Pane.pane)->setFont(mFont); - fopMsgM_setPaneData(&mItmnPane, scrn2, 'itmn'); + fopMsgM_setPaneData(&mItnmPane, scrn2, 'itnm'); fopMsgM_setPaneData(&mItnkPane, scrn2, 'itnk'); fopMsgM_setPaneData(&mStr0Pane, scrn2, 'str0'); fopMsgM_setPaneData(&mSt00Pane, scrn2, 'st00'); - if (dComIfGs_getOptRuby() != 0) { + if (dComIfGs_getOptRuby()) { fopMsgM_paneTrans(&mSt00Pane, 0.0f, -4.0f); } fopMsgM_setPaneData(&mNt00Pane, scrn2, 'nt00'); fopMsgM_setPaneData(&mNk00Pane, scrn2, 'nk00'); - fopMsgM_setPaneData(&mNo01Pane, scrn2, 'no01'); + fopMsgM_setPaneData(&mNo11Pane, scrn2, 'no11'); fopMsgM_setPaneData(&mMsk0Pane, scrn2, 'msk0'); - mNo01Pane.mUserArea = mNo01Pane.pane->getRotate(); + mNo11Pane.mUserArea = mNo11Pane.pane->mRotation; ((J2DTextBox*)mStr0Pane.pane)->setFont(mRFont); ((J2DTextBox*)mSt00Pane.pane)->setFont(mFont); - - fopMsgM_setPaneData(&mDtlePane,scrn2, 'dtle'); + ((J2DTextBox*)(mStr0Pane).pane)->setWhite(0xFFFFFFFF); + ((J2DTextBox*)(mStr0Pane).pane)->setCharColor(0x000000FF); + ((J2DTextBox*)(mStr0Pane).pane)->setGradColor(0x000000FF); + ((J2DTextBox*)(mSt00Pane).pane)->setWhite(0xFFFFFFFF); + ((J2DTextBox*)(mSt00Pane).pane)->setCharColor(0x000000FF); + ((J2DTextBox*)(mSt00Pane).pane)->setGradColor(0x000000FF); + + fopMsgM_setPaneData(&mDtlePane, scrn2, 'dtle'); ((J2DTextBox*)mDtlePane.pane)->setFont(mFont); dnameSet(); - fopMsgM_setPaneData(&mDt00Pane,scrn2, 'dt00'); - fopMsgM_setPaneData(&mDk00Pane,scrn2, 'dk00'); - - - static const u32 l_it[] = { - 'it00', 'it01', 'it02', - }; - - static const u32 l_ik[] = { - 'ik00', 'ik01', 'ik02', - }; - - static const u32 l_ip[] = { - 'ip06', 'ip04', 'ip02', 'ip01', - }; + fopMsgM_setPaneData(&mDt00Pane, scrn2, 'dt00'); + fopMsgM_setPaneData(&mDk00Pane, scrn2, 'dk00'); for (int i = 0; i < 3; i++) { - fopMsgM_setPaneData(&mItPanes[0], scrn, l_it[i]); - fopMsgM_setPaneData(&mIkPanes[0], scrn, l_ik[i]); + fopMsgM_setPaneData(&mItPanes[i], scrn, l_it[i]); + fopMsgM_setPaneData(&mIkPanes[i], scrn, l_ik[i]); - JKRArchive::readTypeResource(mpTIMG[i], 0xC00, 'TIMG', itmTex[i], dComIfGp_getItemIconArchive()); + JKRArchive* arc = dComIfGp_getItemIconArchive(); + JKRArchive::readTypeResource(mpTIMG[i], 0xC00, 'TIMG', itmTex[i], arc); ((J2DPicture*)mItPanes[i].pane)->changeTexture(mpTIMG[i], 0); ((J2DPicture*)mIkPanes[i].pane)->changeTexture(mpTIMG[i], 0); - fopMsgM_setPaneData(&mIpPanes[0], scrn, l_ip[i]); + fopMsgM_setPaneData(&mIpPanes[i], scrn, l_ip[i]); } fopMsgM_setPaneData(&mIp01Pane, scrn, 'ip01'); - static const u32 l_lnk[] = { - 'lnk0', 'lnk1', 'lnk2', - }; - for (int i = 0; i < 3; i++) { fopMsgM_setPaneData(&mLnkPanes[i], scrn, l_lnk[i]); } - + fopMsgM_setPaneData(&mBey1Pane, scrn, 'bey1'); fopMsgM_setPaneData(&mBey2Pane, scrn, 'bey2'); fopMsgM_setPaneData(&mBossPane, scrn, 'boss'); fopMsgM_setPaneData(&mBos2Pane, scrn, 'bos2'); - static const u32 l_fl[] = { - 'f001', 'f002', 'f003', 'f004', 'f005', 'f006', - }; - - static const u32 l_fb[] = { - 'fb01', 'fb02', 'fb03', 'fb04', 'fb05', 'fb06', - }; - - static const u32 l_fbk[] = { - 'fbk1', 'fbk2', 'fbk3', 'fbk4', 'fbk5', 'fbk6', - }; - for (int i = 0; i < 6; i++) { fopMsgM_setPaneData(&mFlPanes[i], scrn, l_fl[i]); fopMsgM_setPaneData(&mFbPanes[i], scrn, l_fb[i]); fopMsgM_setPaneData(&mFbkPanes[i], scrn, l_fbk[i]); } - //TODO missing lines + J2DWindow::TContentsColor contentsColor; + J2DWindow* win = (J2DWindow*)mFbPanes[0].pane; + win->getContentsColor(contentsColor); + field_0x14B8 = contentsColor.mTL; + field_0x14C0 = JUtility::TColor(((J2DWindow*)mFbPanes[0].pane)->mWhite.toUInt32()); + field_0x14C8 = JUtility::TColor(((J2DWindow*)mFbPanes[0].pane)->mBlack.toUInt32()); - fopMsgM_setPaneData(&field_0x126C, scrn, 'fw00'); - fopMsgM_setPaneData(&field_0x12A4, scrn, 'fw1'); + win = (J2DWindow*)mFbPanes[5].pane; + win->getContentsColor(contentsColor); + field_0x14B4 = contentsColor.mTL; + field_0x14BC = JUtility::TColor(((J2DWindow*)mFbPanes[5].pane)->mWhite.toUInt32()); + field_0x14C4 = JUtility::TColor(((J2DWindow*)mFbPanes[5].pane)->mBlack.toUInt32()); + + for (int i = 4; i < 6; i++) { + mFlPanes[i].mSizeOrig.x = mFlPanes[i].mSize.x = mFlPanes[0].mSizeOrig.x; + mFlPanes[i].mSizeOrig.y = mFlPanes[i].mSize.y = mFlPanes[0].mSizeOrig.y; + fopMsgM_cposMove(&mFlPanes[i]); + mFbPanes[i].mSizeOrig.x = mFbPanes[i].mSize.x = mFbPanes[0].mSizeOrig.x; + mFbPanes[i].mSizeOrig.y = mFbPanes[i].mSize.y = mFbPanes[0].mSizeOrig.y; + ((J2DWindow*)mFbPanes[i].pane)->setContentsColor(field_0x14B8); + ((J2DWindow*)mFbPanes[i].pane)->mWhite = JUtility::TColor(field_0x14C0.toUInt32()); + ((J2DWindow*)mFbPanes[i].pane)->mBlack = JUtility::TColor(field_0x14C8.toUInt32()); + fopMsgM_cposMove(&mFbPanes[i]); + mFbkPanes[i].mSizeOrig.x = mFbkPanes[i].mSize.x = mFbkPanes[0].mSizeOrig.x; + mFbkPanes[i].mSizeOrig.y = mFbkPanes[i].mSize.y = mFbkPanes[0].mSizeOrig.y; + fopMsgM_cposMove(&mFbkPanes[i]); + } + + fopMsgM_setPaneData(&mFw00Pane, scrn, 'fw00'); + fopMsgM_setPaneData(&mFw01Pane, scrn, 'fw01'); scrn->search('mpmk')->hide(); scrn->search('mpp2')->hide(); scrn->search('mpp1')->hide(); scrn->search('mpp0')->hide(); - fopMsgM_setPaneData(&field_0x12DC, scrn, 'cc38'); - fopMsgM_setPaneData(&field_0x1314, scrn, 'cc31'); - fopMsgM_setPaneData(&field_0x134C, scrn, 'cc34'); - fopMsgM_setPaneData(&field_0x1384, scrn, 'cc37'); - fopMsgM_setPaneData(&field_0x13BC, scrn, 'cc30'); - fopMsgM_setPaneData(&field_0x13F4, scrn, 'cc35'); - fopMsgM_setPaneData(&field_0x142C, scrn, 'cc30'); - fopMsgM_setPaneData(&field_0x1464, scrn, 'msk'); - // fopMsgM_setPaneData(&fStack_d4, scrn, 0x6d706d6b); - // fopMsgM_setPaneData(&fStack_10c, scrn, 0x6d707031); + fopMsgM_setPaneData(&mCc38Pane, scrn, 'cc38'); + fopMsgM_setPaneData(&mCc31Pane, scrn, 'cc31'); + fopMsgM_setPaneData(&mCc24Pane, scrn, 'cc24'); + fopMsgM_setPaneData(&mCc17Pane, scrn, 'cc17'); + fopMsgM_setPaneData(&mCc10Pane, scrn, 'cc10'); + fopMsgM_setPaneData(&mCc05pane, scrn, 'cc05'); + fopMsgM_setPaneData(&mCc00Pane, scrn, 'cc00'); + fopMsgM_setPaneData(&mMskPane, scrn, 'msk'); + + fopMsgM_pane_class mpmk; + fopMsgM_pane_class mpp1pane; + fopMsgM_setPaneData(&mpmk, scrn, 'mpmk'); + fopMsgM_setPaneData(&mpp1pane, scrn, 'mpp1'); + + mMskPane.mInitAlpha = 0x82; + mMsk0Pane.mInitAlpha = 0x82; + + field_0x1E16 = mpmk.mPosCenterOrig.x; + field_0x1E18 = mpmk.mPosCenterOrig.y; + field_0x1E1A = mpmk.mSizeOrig.x; + field_0x1E1C = mpmk.mSizeOrig.y; + field_0x1E1E = mpp1pane.mPosCenterOrig.x; + field_0x1E20 = mpp1pane.mPosCenterOrig.y; + field_0x1E22 = mpp1pane.mSizeOrig.x; + field_0x1E24 = mpp1pane.mSizeOrig.y; + + J2DPane* p2 = scrn->search('mpp2'); + f32 h = p2->getHeight(); + p2 = scrn->search('mpp2'); + J2DPane* p1 = scrn->search('mpp1'); + field_0x1E26 = p1->mBounds.i.y - (p2->mBounds.i.y + h); } /* 801A92D4-801A9364 .text dMap_isBossDoor__FP21stage_tgsc_data_class */ diff --git a/src/d/d_menu_window.cpp b/src/d/d_menu_window.cpp index 77a307a1a..4ae698a88 100644 --- a/src/d/d_menu_window.cpp +++ b/src/d/d_menu_window.cpp @@ -529,7 +529,7 @@ void dMs_dmap_create(sub_ms_screen_class* i_Ms) { JUT_ASSERT(2480, dMd_c != NULL); for (int i = 0; i < 3; i++) { - dMd_c->arr_0x1AFC[i] = i_Ms->buffer_p[i]; + dMd_c->mpTIMG[i] = (ResTIMG*)i_Ms->buffer_p[i]; } dMd_c->setArchive(i_Ms->arc);