diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-05-25 13:29:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-25 23:29:53 +0300 |
| commit | 0e35bbddb929763e929b4b189b4b7e865561ede8 (patch) | |
| tree | c2099473b4f26de13caa7e3050c735e81f9b76b4 /src/d/d_menu_dmap.cpp | |
| parent | de30e871af895a1c8227b0a3a5da213861bab9e6 (diff) | |
d_menu_dmap mostly done (#2456)
* d_menu_dmap mostly done
* d_npc_lib equivalent
* m_Do_printf matching
Diffstat (limited to 'src/d/d_menu_dmap.cpp')
| -rw-r--r-- | src/d/d_menu_dmap.cpp | 2116 |
1 files changed, 1386 insertions, 730 deletions
diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index 3429a3967b..e135452a2a 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -1,17 +1,4 @@ -// -// Generated By: dol2asm -// Translation Unit: d/d_menu_dmap -// - #include "d/d_menu_dmap.h" -#include "d/actor/d_a_player.h" -#include "d/d_item.h" -#include "d/d_menu_item_explain.h" -#include "d/d_msg_object.h" -#include "d/d_meter_HIO.h" -#include "d/d_meter2_info.h" -#include "d/d_lib.h" -#include "d/d_menu_dmap_map.h" #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DOrthoGraph.h" @@ -21,271 +8,33 @@ #include "JSystem/JKernel/JKRExpHeap.h" #include "JSystem/JKernel/JKRMemArchive.h" #include "SSystem/SComponent/c_math.h" -#include "string.h" -#include "dol2asm.h" -#include "dolphin/types.h" +#include "d/actor/d_a_player.h" +#include "d/d_item.h" +#include "d/d_menu_item_explain.h" +#include "d/d_msg_object.h" +#include "d/d_meter_HIO.h" +#include "d/d_meter2_info.h" +#include "d/d_lib.h" +#include "d/d_menu_dmap_map.h" #include "d/d_msg_string.h" #include "d/d_meter_haihai.h" +#include "d/d_menu_window.h" #include "f_op/f_op_msg_mng.h" #include "m_Do/m_Do_graphic.h" -// -// Forward References: -// - -extern "C" void __ct__14dMenu_DmapBg_cFP10JKRExpHeapP9STControl(); -extern "C" void mapScreenInit__14dMenu_DmapBg_cFv(); -extern "C" void mapScreenAnime__14dMenu_DmapBg_cFv(); -extern "C" void mapIconScaleSet__14dMenu_DmapBg_cFUc(); -extern "C" void iconScaleAnmInit__14dMenu_DmapBg_cFffUc(); -extern "C" void iconScaleAnm__14dMenu_DmapBg_cFv(); -extern "C" void buttonIconScreenInit__14dMenu_DmapBg_cFv(); -extern "C" void setAButtonString__14dMenu_DmapBg_cFUl(); -extern "C" void setBButtonString__14dMenu_DmapBg_cFUl(); -extern "C" void setCButtonString__14dMenu_DmapBg_cFUl(); -extern "C" void setJButtonString__14dMenu_DmapBg_cFUl(); -extern "C" void createExplain__14dMenu_DmapBg_cFv(); -extern "C" void deleteExplain__14dMenu_DmapBg_cFv(); -extern "C" void baseScreenInit__14dMenu_DmapBg_cFv(); -extern "C" void setFloorMessage__14dMenu_DmapBg_cFv(); -extern "C" bool dpdMove__14dMenu_DmapBg_cFScScScPUcUc(); -extern "C" void __dt__14dMenu_DmapBg_cFv(); -extern "C" void setAllAlphaRate__14dMenu_DmapBg_cFfb(); -extern "C" void setGoldAnimation__14dMenu_DmapBg_cFb(); -extern "C" void setGoldFrameAlphaRate__14dMenu_DmapBg_cFf(); -extern "C" void addGoldFrameAlphaRate__14dMenu_DmapBg_cFv(); -extern "C" void decGoldFrameAlphaRate__14dMenu_DmapBg_cFv(); -extern "C" void draw__14dMenu_DmapBg_cFv(); -extern "C" void update__14dMenu_DmapBg_cFv(); -extern "C" void calcCursor__14dMenu_DmapBg_cFv(); -extern "C" void drawCursor__14dMenu_DmapBg_cFv(); -extern "C" void __ct__12dMenu_Dmap_cFP10JKRExpHeapP9STControlP10CSTControlUcUc(); -extern "C" void screenInit__12dMenu_Dmap_cFv(); -extern "C" void getPlayerIconPos__12dMenu_Dmap_cFScf(); -extern "C" void getIconPos__12dMenu_Dmap_cFScf(); -extern "C" void __dt__12dMenu_Dmap_cFv(); -extern "C" void __dt__19dMenu_DmapMapCtrl_cFv(); -extern "C" void getCurFloorPos__12dMenu_Dmap_cFv(); -extern "C" void getDefaultCurFloorPos__12dMenu_Dmap_cFv(); -extern "C" void iconMoveCalc__12dMenu_Dmap_cFv(); -extern "C" void drawFloorScreenBack__12dMenu_Dmap_cFP9J2DScreenffP13J2DOrthoGraph(); -extern "C" void drawFloorScreenTop__12dMenu_Dmap_cFP9J2DScreenffP13J2DOrthoGraph(); -extern "C" void isMapMoveState__12dMenu_Dmap_cFv(); -extern "C" void floorChangeMode__12dMenu_Dmap_cFv(); -extern "C" void _create__12dMenu_Dmap_cFv(); -extern "C" void append__10J2DPictureFPC7ResTIMGf(); -extern "C" void insert__10J2DPictureFPC7ResTIMGUcf(); -extern "C" void _move__12dMenu_Dmap_cFv(); -extern "C" void setMapTexture__12dMenu_Dmap_cFv(); -extern "C" void mapBgAnime__12dMenu_Dmap_cFv(); -extern "C" void mapControl__12dMenu_Dmap_cFv(); -extern "C" void isOpen__12dMenu_Dmap_cFv(); -extern "C" void isClose__12dMenu_Dmap_cFv(); -extern "C" void _draw__12dMenu_Dmap_cFv(); -extern "C" void itemInfo_init_proc__12dMenu_Dmap_cFv(); -extern "C" void itemInfo_proc__12dMenu_Dmap_cFv(); -extern "C" void itemSelect__12dMenu_Dmap_cFv(); -extern "C" void getNextItem__12dMenu_Dmap_cFi(); -extern "C" void itemSelectAnmInit__12dMenu_Dmap_cFv(); -extern "C" void itemSelectAnm__12dMenu_Dmap_cFv(); -extern "C" void itemInfoOpenAnm__12dMenu_Dmap_cFv(); -extern "C" void itemInfoWait__12dMenu_Dmap_cFv(); -extern "C" void itemInfoCloseAnm__12dMenu_Dmap_cFv(); -extern "C" void getNextStatus__12dMenu_Dmap_cFv(); -extern "C" void isSync__12dMenu_Dmap_cFv(); -extern "C" void isKeyCheck__12dMenu_Dmap_cFv(); -extern "C" void infoModeChange_init_proc__12dMenu_Dmap_cFv(); -extern "C" void infoModeChange_proc__12dMenu_Dmap_cFv(); -extern "C" void mapModeChange_init_proc__12dMenu_Dmap_cFv(); -extern "C" void mapModeChange_proc__12dMenu_Dmap_cFv(); -extern "C" void lv5_talk_init_proc__12dMenu_Dmap_cFv(); -extern "C" void lv5_talk_proc__12dMenu_Dmap_cFv(); -extern "C" void mapMode_init_proc__12dMenu_Dmap_cFv(); -extern "C" void mapMode_proc__12dMenu_Dmap_cFv(); -extern "C" void floorSelect_init_proc__12dMenu_Dmap_cFv(); -extern "C" void floorSelect_proc__12dMenu_Dmap_cFv(); -extern "C" void itemCarryCheck__12dMenu_Dmap_cFv(); -extern "C" void floorChange_init_proc__12dMenu_Dmap_cFv(); -extern "C" void floorChange_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomWait_init_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomWait_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomIn_init_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomIn_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomOut_init_proc__12dMenu_Dmap_cFv(); -extern "C" void zoomOut_proc__12dMenu_Dmap_cFv(); -extern "C" void __dt__15renderingDmap_cFv(); -extern "C" void __dt__20dMenu_StageMapCtrl_cFv(); -extern "C" void __dt__15dMenu_DmapMap_cFv(); -extern "C" void __ct__15renderingDmap_cFv(); -extern "C" void __sinit_d_menu_dmap_cpp(); -extern "C" static void func_801C0844(); -extern "C" extern char const* const d_menu_d_menu_dmap__stringBase0; -extern "C" u8 myclass__12dMenu_Dmap_c[4 + 4 /* padding */]; - -// -// External References: -// - -extern "C" void mDoExt_getJ2dHeap__Fv(); -extern "C" void mDoExt_destroyExpHeap__FP10JKRExpHeap(); -extern "C" void mDoExt_setCurrentHeap__FP7JKRHeap(); -extern "C" void mDoExt_getMesgFont__Fv(); -extern "C" void mDoExt_getSubFont__Fv(); -extern "C" void create__24mDoDvdThd_mountArchive_cFPCcUcP7JKRHeap(); -extern "C" void fopMsgM_valueIncrease__FiiUc(); -extern "C" void dComIfGp_isLightDropMapVisible__Fv(); -extern "C" void __ct__9STControlFssssffss(); -extern "C" void checkTrigger__9STControlFv(); -extern "C" void checkLeftTrigger__9STControlFv(); -extern "C" void checkRightTrigger__9STControlFv(); -extern "C" void checkUpTrigger__9STControlFv(); -extern "C" void checkDownTrigger__9STControlFv(); -extern "C" void isSwitch__12dSv_memBit_cCFi(); -extern "C" void isDungeonItem__12dSv_memBit_cCFi(); -extern "C" void isEventBit__11dSv_event_cCFUs(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void set__12dDlst_list_cFRPP12dDlst_base_cRPP12dDlst_base_cP12dDlst_base_c(); -extern "C" void checkItemGet__FUci(); -extern "C" void getBossIconFloorNo__7dTres_cFPi(); -extern "C" void __ct__16dSelect_cursor_cFUcfP10JKRArchive(); -extern "C" void setPos__16dSelect_cursor_cFffP7J2DPaneb(); -extern "C" void setParam__16dSelect_cursor_cFfffff(); -extern "C" void setAlphaRate__16dSelect_cursor_cFf(); -extern "C" void getMapBlendPer__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelStageSizeX__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelStageSizeZ__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelCenterX__20dMenu_StageMapCtrl_cCFv(); -extern "C" void getPixelCenterZ__20dMenu_StageMapCtrl_cCFv(); -extern "C" void initGetTreasureList__20dMenu_StageMapCtrl_cFUcSc(); -extern "C" void getTreasureList__20dMenu_StageMapCtrl_cFPfPfPScPUcPSc(); -extern "C" void getPlayerDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs(); -extern "C" void getRestartDrawInfo__20dMenu_StageMapCtrl_cCFPfPfPs(); -extern "C" void setPlusNowStayFloorNo__20dMenu_StageMapCtrl_cFScUc(); -extern "C" void initZoomIn__20dMenu_StageMapCtrl_cFUc(); -extern "C" void initZoomIn__20dMenu_StageMapCtrl_cFUcff(); -extern "C" void initZoomInCenterHold__20dMenu_StageMapCtrl_cFUc(); -extern "C" void initZoomOut__20dMenu_StageMapCtrl_cFUc(); -extern "C" void initZoomWait__20dMenu_StageMapCtrl_cFff(); -extern "C" void move__20dMenu_StageMapCtrl_cFv(); -extern "C" void getPlayerStayFloorNo__20dMenu_StageMapCtrl_cCFv(); -extern "C" void _create__20dMenu_StageMapCtrl_cFUsUsUsUsPv(); -extern "C" void _create__20dMenu_StageMapCtrl_cFUsUsUsUsScPv(); -extern "C" void _delete__20dMenu_StageMapCtrl_cFv(); -extern "C" void isEnableZoomIn__20dMenu_StageMapCtrl_cFv(); -extern "C" void isEnableZoomOut__20dMenu_StageMapCtrl_cFv(); -extern "C" void setPlusZoomCenterX__20dMenu_StageMapCtrl_cFf(); -extern "C" void setPlusZoomCenterZ__20dMenu_StageMapCtrl_cFf(); -extern "C" void __ct__16dMenuMapCommon_cFv(); -extern "C" void __dt__16dMenuMapCommon_cFv(); -extern "C" void initiate__16dMenuMapCommon_cFP10JKRArchive(); -extern "C" void drawIcon__16dMenuMapCommon_cFffff(); -extern "C" void iconScale__16dMenuMapCommon_cFifff(); -extern "C" void setIconInfo__16dMenuMapCommon_cFUcfffffUc(); -extern "C" void clearIconInfo__16dMenuMapCommon_cFv(); -extern "C" void __ct__19dMenu_ItemExplain_cFP10JKRExpHeapP10JKRArchiveP9STControlb(); -extern "C" void move__19dMenu_ItemExplain_cFv(); -extern "C" void draw__19dMenu_ItemExplain_cFP13J2DOrthoGraph(); -extern "C" void openExplainDmap__19dMenu_ItemExplain_cFUcUcUcbUc(); -extern "C" void dMw_LEFT_TRIGGER__Fv(); -extern "C" void dMw_RIGHT_TRIGGER__Fv(); -extern "C" void dMw_B_TRIGGER__Fv(); -extern "C" void __ct__14dMeterHaihai_cFUc(); -extern "C" void drawHaihai__14dMeterHaihai_cFUcffff(); -extern "C" void setScale__14dMeterHaihai_cFf(); -extern "C" void getString__13dMeter2Info_cFUlPcP14JMSMesgEntry_c(); -extern "C" void getStringKanji__13dMeter2Info_cFUlPcP14JMSMesgEntry_c(); -extern "C" void -readItemTexture__13dMeter2Info_cFUcPvP10J2DPicturePvP10J2DPicturePvP10J2DPicturePvP10J2DPicturei(); -extern "C" void dMeter2Info_getNumberTextureName__Fi(); -extern "C" void setTalkHeap__12dMsgObject_cFPv(); -extern "C" void getTalkHeap__12dMsgObject_cFv(); -extern "C" void getStatus__12dMsgObject_cFv(); -extern "C" void __ct__12dMsgString_cFv(); -extern "C" void __dt__12dMsgString_cFv(); -extern "C" void __ct__10dMsgFlow_cFv(); -extern "C" void __dt__10dMsgFlow_cFv(); -extern "C" void init__10dMsgFlow_cFP10fopAc_ac_ciiPP10fopAc_ac_c(); -extern "C" void doFlow__10dMsgFlow_cFP10fopAc_ac_cPP10fopAc_ac_ci(); -extern "C" void __ct__8CPaneMgrFv(); -extern "C" void __ct__8CPaneMgrFP9J2DScreenUxUcP10JKRExpHeap(); -extern "C" void __dt__8CPaneMgrFv(); -extern "C" void paneTrans__8CPaneMgrFff(); -extern "C" void scaleAnime__8CPaneMgrFsffUc(); -extern "C" void getGlobalVtx__8CPaneMgrFP7J2DPanePA3_A4_fUcbs(); -extern "C" void getGlobalVtxCenter__8CPaneMgrFP7J2DPanebs(); -extern "C" void dPaneClass_showNullPane__FP9J2DScreen(); -extern "C" void __ct__13CPaneMgrAlphaFP9J2DScreenUxUcP10JKRExpHeap(); -extern "C" void show__13CPaneMgrAlphaFv(); -extern "C" void hide__13CPaneMgrAlphaFv(); -extern "C" void setAlphaRate__13CPaneMgrAlphaFf(); -extern "C" void alphaAnime__13CPaneMgrAlphaFsUcUcUc(); -extern "C" void __ct__17CPaneMgrAlphaMorfFP9J2DScreenUxUcP10JKRExpHeap(); -extern "C" void setBackupAlpha__17CPaneMgrAlphaMorfFv(); -extern "C" void setAlphaMorfRate__17CPaneMgrAlphaMorfFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void seStartLevel__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void alloc__7JKRHeapFUli(); -extern "C" void free__7JKRHeapFPv(); -extern "C" void getFreeSize__7JKRHeapFv(); -extern "C" void getTotalFreeSize__7JKRHeapFv(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void create__10JKRExpHeapFUlP7JKRHeapb(); -extern "C" void getGlbResource__13JKRFileLoaderFPCcP13JKRFileLoader(); -extern "C" void func_802E90C0(); -extern "C" void getBounds__7J2DPaneFv(); -extern "C" void setBasePosition__7J2DPaneF15J2DBasePosition(); -extern "C" void __ct__9J2DScreenFv(); -extern "C" void setPriority__9J2DScreenFPCcUlP10JKRArchive(); -extern "C" void draw__9J2DScreenFffPC14J2DGrafContext(); -extern "C" void animation__9J2DScreenFv(); -extern "C" void __ct__10J2DPictureFPC7ResTIMG(); -extern "C" void getStringPtr__10J2DTextBoxCFv(); -extern "C" void setString__10J2DTextBoxFsPCce(); -extern "C" void load__20J2DAnmLoaderDataBaseFPCv(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_22(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_22(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__12dDlst_base_c[3]; -extern "C" extern void* __vt__28dDrawPathWithNormalPattern_c[16]; -extern "C" extern void* __vt__15dRenderingMap_c[23]; -extern "C" extern void* __vt__18dRenderingFDAmap_c[26]; -extern "C" extern void* __vt__11dDrawPath_c[16]; -extern "C" extern void* __vt__19renderingPlusDoor_c[41]; -extern "C" extern void* __vt__16renderingDAmap_c[38]; -extern "C" extern void* __vt__19dMenu_DmapMapCtrl_c[10 + 51 /* padding */]; -extern "C" extern void* __vt__15renderingDmap_c[43 + 1 /* padding */]; -extern "C" u8 m_cpadInfo__8mDoCPd_c[256]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" f32 mAllSizeX__8dMpath_c; -extern "C" f32 mAllSizeZ__8dMpath_c; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// +#if (PLATFORM_WII || PLATFORM_SHIELD) +#define POINTER_OPT dComIfGs_getOptPointer() +#else +#define POINTER_OPT 0 +#endif /* 803BC7E0-803BC7EC 019900 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { +static u8 cNullVec__6Z2Calc[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; typedef void (dMenu_Dmap_c::*ProcFunc)(); -/* 803BC7EC-803BC7F8 -00001 000C+00 0/1 0/0 0/0 .data @4861 */ static ProcFunc init_process[5] = { &dMenu_Dmap_c::itemInfo_init_proc, &dMenu_Dmap_c::mapMode_init_proc, @@ -294,7 +43,6 @@ static ProcFunc init_process[5] = { &dMenu_Dmap_c::lv5_talk_init_proc, }; -/* 803BC864-803BC870 -00001 000C+00 0/1 0/0 0/0 .data @4866 */ static ProcFunc move_process[5] = { &dMenu_Dmap_c::itemInfo_proc, &dMenu_Dmap_c::mapMode_proc, @@ -335,47 +83,58 @@ static ProcFunc map_move_process[3] = { /* 801B7F20-801B8110 1B2860 01F0+00 1/1 0/0 0/0 .text * __ct__14dMenu_DmapBg_cFP10JKRExpHeapP9STControl */ -dMenu_DmapBg_c::dMenu_DmapBg_c(JKRExpHeap* param_1, STControl* param_2) { - field_0xc98 = param_1; - field_0xca0 = param_2; +dMenu_DmapBg_c::dMenu_DmapBg_c(JKRExpHeap* i_heap, STControl* i_stick) { + mpHeap = i_heap; + mpStick = i_stick; field_0xd94 = 0.0f; field_0xd98 = 0.0f; field_0xd9c = 0.0f; field_0xda8 = 1.0f; field_0xdb4 = 0.0f; field_0xdb8 = 0.0f; - field_0xdd3 = 0xff; - field_0xdd4 = 0x9d; - field_0xdd6 = 0x9d; - field_0xdd5 = 0xff; + field_0xdd3 = 0xFF; + field_0xdd4 = 0x9D; + field_0xdd6 = 0x9D; + field_0xdd5 = 0xFF; field_0xdd7 = 0; field_0xdd8 = 1; + mString = new dMsgString_c(); JUT_ASSERT(621, mString != 0); - mpTalkHeap = JKRCreateExpHeap(0x32000, field_0xc98, 0); + + mpTalkHeap = JKRCreateExpHeap(0x32000, mpHeap, false); JUT_ASSERT(624, mpTalkHeap != 0); + mpItemExplain = NULL; + mpMeterHaihai = new dMeterHaihai_c(2); JUT_ASSERT(630, mpMeterHaihai != 0); + field_0xdda = 0; - OS_REPORT("remain ===> %d\n", field_0xc98->getTotalFreeSize()); + + OS_REPORT("remain ===> %d\n", mpHeap->getTotalFreeSize()); + baseScreenInit(); mapScreenInit(); - char amStack_38[32]; - strcpy(amStack_38, "/res/FieldMap/D_MN10.arc"); - char acStack_40[8]; - strcpy(acStack_40, dComIfGp_getStartStageName()); - amStack_38[18] = acStack_40[4]; - amStack_38[19] = acStack_40[5]; + + char archive_path[32]; + strcpy(archive_path, "/res/FieldMap/D_MN10.arc"); + char stage_name[8]; + strcpy(stage_name, dComIfGp_getStartStageName()); + archive_path[18] = stage_name[4]; + archive_path[19] = stage_name[5]; + if (dComIfGs_isDungeonItemMap() || dComIfGs_isDungeonItemCompass()) { - field_0xd1c = mDoDvdThd_mountArchive_c::create(amStack_38, 2, mDoExt_getJ2dHeap()); + mpArchiveMount = mDoDvdThd_mountArchive_c::create(archive_path, 2, mDoExt_getJ2dHeap()); } else { - field_0xd1c = NULL; + mpArchiveMount = NULL; } - field_0xd20 = 0; - mpBackTexture = 0; + + mpArchive = NULL; + mpBackTexture = NULL; field_0xdbc = 0.0f; - memset(field_0xd80, 0, 0x14); + + memset(&field_0xd80, 0, 20); buttonIconScreenInit(); field_0xdd0 = 0; } @@ -386,13 +145,14 @@ void dMenu_DmapBg_c::mapScreenInit() { for (int i = 0; i < 2; i++) { mMapScreen[i] = new J2DScreen(); JUT_ASSERT(689, mMapScreen[i] != 0); - bool fg = mMapScreen[i]->setPriority("zelda_dungeon_map_map.blo", 0x20000, - dComIfGp_getDmapResArchive()); + + bool fg = mMapScreen[i]->setPriority("zelda_dungeon_map_map.blo", 0x20000, dComIfGp_getDmapResArchive()); JUT_ASSERT(693, fg != false); + dPaneClass_showNullPane(mMapScreen[i]); } - #ifdef DEBUG + #if (PLATFORM_WII || PLATFORM_SHIELD) mpBlack = new CPaneMgrAlpha(mMapScreen[0], 'm_black', 2, NULL); JUT_ASSERT(699, mpBlack != 0); mpBlack->setAlphaRate(0.0f); @@ -413,43 +173,54 @@ void dMenu_DmapBg_c::mapScreenInit() { mMapScreen[1]->search('center_n')->hide(); mMapScreen[1]->search('map_ai_n')->setBasePosition(J2DBasePosition_0); mMapScreen[0]->search('center_n')->setBasePosition(J2DBasePosition_4); + OSInitFastCast(); { - Mtx mtxVar1; - CPaneMgr aCStack_84; - Vec local_184 = aCStack_84.getGlobalVtx(mMapScreen[1]->search('map_icon'), &mtxVar1, 0, false, 0); - field_0xdc0 = local_184.x; - field_0xdc4 = local_184.y; + Mtx m; + CPaneMgr pane; + Vec vtx = pane.getGlobalVtx(mMapScreen[1]->search('map_icon'), &m, 0, false, 0); + field_0xdc0 = vtx.x; + field_0xdc4 = vtx.y; } + for (int i = 0; i < 2; i++) { mpMapRoot[i] = new CPaneMgrAlphaMorf(mMapScreen[i], 'ROOT', 2, NULL); JUT_ASSERT(751, mpMapRoot[i] != 0); } + void* btk0 = JKRGetNameResource("zelda_dungeon_map_map.btk", dComIfGp_getDmapResArchive()); JUT_ASSERT(766, btk0 != 0); + field_0xd28[0] = (J2DAnmTextureSRTKey*)J2DAnmLoaderDataBase::load(btk0); field_0xd28[0]->searchUpdateMaterialID(mMapScreen[0]); field_0xdc8[0] = 0.0f; field_0xd28[0]->setFrame(field_0xdc8[0]); + mMapScreen[0]->animation(); setGoldAnimation(true); - field_0xcc4 = (J2DPicture*)mMapScreen[1]->search('map_aria'); - field_0xcc4->setCornerColor(JUtility::TColor(0xff, 0xff, 0xff, 0xff)); - field_0xcc4->setWhite(JUtility::TColor(0xff, 0xff, 0xff, 0xff)); - CPaneMgr aCStack_f0; - Mtx mtxVar1; - Vec vec1 = aCStack_f0.getGlobalVtx(field_0xcc4, &mtxVar1, 0, false, 0); - Vec vec2 = aCStack_f0.getGlobalVtx(field_0xcc4, &mtxVar1, 3, false, 0); - field_0xda0 = vec2.x - vec1.x; - field_0xda4 = vec2.y - vec1.y; - J2DPicture* local_1ac = (J2DPicture*) mMapScreen[1]->search('map_icon'); - local_1ac->setBasePosition(J2DBasePosition_4); - local_1ac->setCornerColor(JUtility::TColor(0xff, 0xff, 0xff, 0xff)); - local_1ac->setAlpha(0); + + mMapPane = (J2DPicture*)mMapScreen[1]->search('map_aria'); + mMapPane->setCornerColor(JUtility::TColor(0xFF, 0xFF, 0xFF, 0xFF)); + mMapPane->setWhite(JUtility::TColor(0xFF, 0xFF, 0xFF, 0xFF)); + + CPaneMgr pane; + Mtx m; + Vec vtx0 = pane.getGlobalVtx(mMapPane, &m, 0, false, 0); + Vec vtx3 = pane.getGlobalVtx(mMapPane, &m, 3, false, 0); + mMapWidth = vtx3.x - vtx0.x; + mMapHeight = vtx3.y - vtx0.y; + + J2DPicture* map_icon_pic = (J2DPicture*)mMapScreen[1]->search('map_icon'); + map_icon_pic->setBasePosition(J2DBasePosition_4); + map_icon_pic->setCornerColor(JUtility::TColor(0xFF, 0xFF, 0xFF, 0xFF)); + map_icon_pic->setAlpha(0); + initiate(dComIfGp_getDmapResArchive()); + for (int i = 0; i < 2; i++) { mpMapSpace[i] = new CPaneMgr(mMapScreen[i], 'mapspace', 0, NULL); JUT_ASSERT(817, mpMapSpace[i] != 0); + mpMapSpace[i]->paneTrans(0.0f, -15.0f); } } @@ -480,6 +251,7 @@ void dMenu_DmapBg_c::mapIconScaleSet(u8 param_1) { fVar1 = 1.0f; fVar2 = 0.0f; } + iconScale(1, fVar1, fVar1, fVar2); } @@ -497,6 +269,7 @@ bool dMenu_DmapBg_c::iconScaleAnm() { if (field_0xdd2 > field_0xdd1) { return true; } + f32 dVar7 = fopMsgM_valueIncrease(field_0xdd1, field_0xdd2, 4); f32 dVar8; f32 dVar1; @@ -508,11 +281,14 @@ bool dMenu_DmapBg_c::iconScaleAnm() { dVar8 = dVar7; dVar1 = 1.0f - dVar7; } + iconScale(1, dVar7, dVar8, dVar1); + field_0xdd2++; if (field_0xdd2 >= field_0xdd1) { rv = true; } + return rv; } @@ -526,16 +302,19 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { mButtonScreen = new J2DScreen(); JUT_ASSERT(916, mButtonScreen != 0); + bool fg = mButtonScreen->setPriority("zelda_dungeon_map_spot_button.blo", 0x20000, dComIfGp_getDmapResArchive()); JUT_ASSERT(922, fg != false); dPaneClass_showNullPane(mButtonScreen); - #ifdef DEBUG + #if (PLATFORM_WII || PLATFORM_SHIELD) mDecorateScreen = new J2DScreen(); JUT_ASSERT(926, mDecorateScreen != 0); + fg = mDecorateScreen->setPriority("zelda_dungeon_map_decoration_revo.blo", 0x20000, dComIfGp_getDmapResArchive()); JUT_ASSERT(930, fg != false); dPaneClass_showNullPane(mDecorateScreen); + mpDecorateRoot = new CPaneMgrAlphaMorf(mDecorateScreen, 'ROOT', 2, NULL); JUT_ASSERT(934, mpDecorateRoot != 0); #else @@ -548,6 +327,7 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { mpButtonRoot = new CPaneMgrAlphaMorf(mButtonScreen, 'ROOT', 2, NULL); JUT_ASSERT(952, mpButtonRoot != 0); + for (int i = 0; i < 2; i++) { mpButtonAB[i] = NULL; mpButtonText[i] = NULL; @@ -565,43 +345,48 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->hide(); ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->hide(); } + field_0xcf4 = new CPaneMgr(mButtonScreen, 'c_n', 2, NULL); field_0xcf8 = NULL; + J2DTextBox* textBox; for (int i = 0; i < 2; i++) { textBox = ((J2DTextBox*)mButtonScreen->search(c_tag[i])); textBox->setFont(mDoExt_getMesgFont()); textBox->setString(32, ""); } + if (field_0xcf4 != NULL) { field_0xcf4->show(); } + if (field_0xcf8 != NULL) { field_0xcf8->paneTrans(160.0f, 0.0f); } + field_0xcf4->paneTrans(321.0f, 0.0f); } /* 801B8DE4-801B8EBC 1B3724 00D8+00 7/7 0/0 0/0 .text setAButtonString__14dMenu_DmapBg_cFUl */ -void dMenu_DmapBg_c::setAButtonString(u32 param_1) { +void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { static u64 const cont_at[5] = {'font_at', 'font_at1', 'font_at2', 'font_at3', 'font_at4'}; for (int i = 0; i < 5; i++) { - if (param_1 == 0) { + if (i_msgNo == 0) { strcpy(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), ""); } else { - dMeter2Info_getStringKanji(param_1, ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), NULL); } } } /* 801B8EBC-801B8F94 1B37FC 00D8+00 8/8 0/0 0/0 .text setBButtonString__14dMenu_DmapBg_cFUl */ -void dMenu_DmapBg_c::setBButtonString(u32 param_1) { +void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) { static u64 const cont_bt[5] = {'font_bt', 'font_bt1', 'font_bt2', 'font_bt3', 'font_bt4'}; for (int i = 0; i < 5; i++) { - if (param_1 == 0) { + if (i_msgNo == 0) { strcpy(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), ""); } else { - dMeter2Info_getStringKanji(param_1, ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), NULL); } } } @@ -616,30 +401,32 @@ static f32 player_py; dMenu_Dmap_c* dMenu_Dmap_c::myclass; /* 801B8F94-801B90BC 1B38D4 0128+00 1/1 0/0 0/0 .text setCButtonString__14dMenu_DmapBg_cFUl */ -void dMenu_DmapBg_c::setCButtonString(u32 param_1) { +void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { static u64 const c_tag[2] = {'f_text_s', 'f_text'}; int i; - u32 r26; + + u32 msgNo; if (!dMenu_Dmap_c::myclass->isMapMoveState()) { - r26 = 0; + msgNo = 0; } else { - r26 = dMenu_Dmap_c::myclass->getCMessasgeNum(); + msgNo = dMenu_Dmap_c::myclass->getCMessasgeNum(); } - if (r26 == 0) { + + if (msgNo == 0) { for (i = 0; i < 2; i++) { strcpy(((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), ""); } mpCButton->setAlphaRate(0.5f); } else { for (i = 0; i < 2; i++) { - dMeter2Info_getStringKanji(r26, ((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(msgNo, ((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), NULL); } mpCButton->setAlphaRate(1.0f); } } /* 801B90BC-801B90E0 1B39FC 0024+00 1/1 0/0 0/0 .text setJButtonString__14dMenu_DmapBg_cFUl */ -void dMenu_DmapBg_c::setJButtonString(u32 param_0) { +void dMenu_DmapBg_c::setJButtonString(u32 i_msgNo) { dMenu_Dmap_c::myclass->isMapMoveState(); } @@ -648,8 +435,9 @@ void dMenu_DmapBg_c::setJButtonString(u32 param_0) { void dMenu_DmapBg_c::createExplain() { if (mpItemExplain == NULL) { JKRHeap* prevHeap = mDoExt_setCurrentHeap(mpTalkHeap); - mpItemExplain = new dMenu_ItemExplain_c(mpTalkHeap, dComIfGp_getDmapResArchive(), field_0xca0, true); + mpItemExplain = new dMenu_ItemExplain_c(mpTalkHeap, dComIfGp_getDmapResArchive(), mpStick, true); JUT_ASSERT(1308, mpItemExplain != 0); + mDoExt_setCurrentHeap(prevHeap); } } @@ -670,31 +458,41 @@ void dMenu_DmapBg_c::deleteExplain() { void dMenu_DmapBg_c::baseScreenInit() { mBaseScreen = new J2DScreen(); JUT_ASSERT(1336, mBaseScreen != 0); + bool fg = mBaseScreen->setPriority("zelda_dungeon_map_base.blo", 0x20000, dComIfGp_getDmapResArchive()); JUT_ASSERT(1347, fg != false); dPaneClass_showNullPane(mBaseScreen); + mFloorScreen = new J2DScreen(); JUT_ASSERT(1351, mFloorScreen != 0); + fg = mFloorScreen->setPriority("zelda_dungeon_map_floor_parts.blo", 0x20000, dComIfGp_getDmapResArchive()); JUT_ASSERT(1362, fg != false); dPaneClass_showNullPane(mFloorScreen); + mBaseScreen->search('w_btn_n')->hide(); + mpBaseRoot = new CPaneMgrAlphaMorf(mBaseScreen, 'ROOT', 2, NULL); JUT_ASSERT(1396, mpBaseRoot != 0); + mpFloorRoot = new CPaneMgrAlphaMorf(mFloorScreen, 'ROOT', 2, NULL); JUT_ASSERT(1399, mpFloorRoot != 0); + mpDrawCursor = new dSelect_cursor_c(2, 1.0f, NULL); JUT_ASSERT(1403, mpDrawCursor != 0); + mpDrawCursor->setAlphaRate(1.0f); mpDrawCursor->setParam(0.95f, 0.9f, 0.1f, 0.6f, 0.5f); + J2DTextBox* uVar9 = (J2DTextBox*)mBaseScreen->search('f_t_00'); mBaseScreen->search('t_t00')->hide(); uVar9->setFont(mDoExt_getSubFont()); uVar9->setString(32, ""); - u32 stageTitleNo = dStage_stagInfo_GetStageTitleNo(dComIfGp_getStage()->getStagInfo()); + + u16 stageTitleNo = (u16)dStage_stagInfo_GetStageTitleNo(dComIfGp_getStage()->getStagInfo()); if (stageTitleNo != 0) { - mString->getString((u16)stageTitleNo, uVar9, NULL, NULL, NULL, 0); + mString->getString(stageTitleNo, uVar9, NULL, NULL, NULL, 0); } else { JUT_WARN(1426, "stage title message index zero!"); } @@ -703,211 +501,236 @@ void dMenu_DmapBg_c::baseScreenInit() { /* 801B944C-801BA0B4 1B3D8C 0C68+00 1/1 0/0 0/0 .text setFloorMessage__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::setFloorMessage() { - char acStack_98[128]; - J2DTextBox* local_b8[8]; - J2DTextBox* local_d8[8]; - J2DTextBox* local_f8[8]; - s16 local_118[13] = { + int var_r26 = -5; + + char floor_msg_buf[128]; + J2DTextBox* floor_textbox_1[8]; + J2DTextBox* floor_textbox_2[8]; + J2DTextBox* floor_textbox_3[8]; + s16 floor_msg_no[13] = { 0, 0, 0x03DB, 0x03DA, 0x036B, 0x036C, 0x036D, 0x036E, 0x036F, 0x03DC, 0x03DD, 0x03D9, 0x03D8, }; - local_b8[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_1'); - local_d8[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_2'); - local_f8[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_3'); + floor_textbox_1[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_1'); + floor_textbox_2[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_2'); + floor_textbox_3[0] = (J2DTextBox*)mFloorScreen->search('ffoor7_3'); mFloorScreen->search('floor7_1')->hide(); mFloorScreen->search('floor7_2')->hide(); mFloorScreen->search('floor7_3')->hide(); - local_b8[0]->setFont(mDoExt_getSubFont()); - local_d8[0]->setFont(mDoExt_getSubFont()); - local_f8[0]->setFont(mDoExt_getSubFont()); + floor_textbox_1[0]->setFont(mDoExt_getSubFont()); + floor_textbox_2[0]->setFont(mDoExt_getSubFont()); + floor_textbox_3[0]->setFont(mDoExt_getSubFont()); - local_b8[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_1'); - local_d8[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_2'); - local_f8[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_3'); + floor_textbox_1[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_1'); + floor_textbox_2[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_2'); + floor_textbox_3[1] = (J2DTextBox*)mFloorScreen->search('ffoor0_3'); mFloorScreen->search('floor0_1')->hide(); mFloorScreen->search('floor0_2')->hide(); mFloorScreen->search('floor0_3')->hide(); - local_b8[1]->setFont(mDoExt_getSubFont()); - local_d8[1]->setFont(mDoExt_getSubFont()); - local_f8[1]->setFont(mDoExt_getSubFont()); + floor_textbox_1[1]->setFont(mDoExt_getSubFont()); + floor_textbox_2[1]->setFont(mDoExt_getSubFont()); + floor_textbox_3[1]->setFont(mDoExt_getSubFont()); - local_b8[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_1'); - local_d8[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_2'); - local_f8[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_3'); + floor_textbox_1[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_1'); + floor_textbox_2[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_2'); + floor_textbox_3[2] = (J2DTextBox*)mFloorScreen->search('ffoor1_3'); mFloorScreen->search('floor1_1')->hide(); mFloorScreen->search('floor1_2')->hide(); mFloorScreen->search('floor1_3')->hide(); - local_b8[2]->setFont(mDoExt_getSubFont()); - local_d8[2]->setFont(mDoExt_getSubFont()); - local_f8[2]->setFont(mDoExt_getSubFont()); + floor_textbox_1[2]->setFont(mDoExt_getSubFont()); + floor_textbox_2[2]->setFont(mDoExt_getSubFont()); + floor_textbox_3[2]->setFont(mDoExt_getSubFont()); - local_b8[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_1'); - local_d8[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_2'); - local_f8[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_3'); + floor_textbox_1[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_1'); + floor_textbox_2[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_2'); + floor_textbox_3[3] = (J2DTextBox*)mFloorScreen->search('ffoor2_3'); mFloorScreen->search('floor2_1')->hide(); mFloorScreen->search('floor2_2')->hide(); mFloorScreen->search('floor2_3')->hide(); - local_b8[3]->setFont(mDoExt_getSubFont()); - local_d8[3]->setFont(mDoExt_getSubFont()); - local_f8[3]->setFont(mDoExt_getSubFont()); + floor_textbox_1[3]->setFont(mDoExt_getSubFont()); + floor_textbox_2[3]->setFont(mDoExt_getSubFont()); + floor_textbox_3[3]->setFont(mDoExt_getSubFont()); - local_b8[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_1'); - local_d8[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_2'); - local_f8[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_3'); + floor_textbox_1[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_1'); + floor_textbox_2[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_2'); + floor_textbox_3[4] = (J2DTextBox*)mFloorScreen->search('ffoor3_3'); mFloorScreen->search('floor3_1')->hide(); mFloorScreen->search('floor3_2')->hide(); mFloorScreen->search('floor3_3')->hide(); - local_b8[4]->setFont(mDoExt_getSubFont()); - local_d8[4]->setFont(mDoExt_getSubFont()); - local_f8[4]->setFont(mDoExt_getSubFont()); + floor_textbox_1[4]->setFont(mDoExt_getSubFont()); + floor_textbox_2[4]->setFont(mDoExt_getSubFont()); + floor_textbox_3[4]->setFont(mDoExt_getSubFont()); - local_b8[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_1'); - local_d8[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_2'); - local_f8[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_3'); + floor_textbox_1[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_1'); + floor_textbox_2[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_2'); + floor_textbox_3[5] = (J2DTextBox*)mFloorScreen->search('ffoor4_3'); mFloorScreen->search('floor4_1')->hide(); mFloorScreen->search('floor4_2')->hide(); mFloorScreen->search('floor4_3')->hide(); - local_b8[5]->setFont(mDoExt_getSubFont()); - local_d8[5]->setFont(mDoExt_getSubFont()); - local_f8[5]->setFont(mDoExt_getSubFont()); + floor_textbox_1[5]->setFont(mDoExt_getSubFont()); + floor_textbox_2[5]->setFont(mDoExt_getSubFont()); + floor_textbox_3[5]->setFont(mDoExt_getSubFont()); - local_b8[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_1'); - local_d8[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_2'); - local_f8[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_3'); + floor_textbox_1[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_1'); + floor_textbox_2[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_2'); + floor_textbox_3[6] = (J2DTextBox*)mFloorScreen->search('ffoor5_3'); mFloorScreen->search('floor5_1')->hide(); mFloorScreen->search('floor5_2')->hide(); mFloorScreen->search('floor5_3')->hide(); - local_b8[6]->setFont(mDoExt_getSubFont()); - local_d8[6]->setFont(mDoExt_getSubFont()); - local_f8[6]->setFont(mDoExt_getSubFont()); + floor_textbox_1[6]->setFont(mDoExt_getSubFont()); + floor_textbox_2[6]->setFont(mDoExt_getSubFont()); + floor_textbox_3[6]->setFont(mDoExt_getSubFont()); - local_b8[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_1'); - local_d8[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_2'); - local_f8[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_3'); + floor_textbox_1[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_1'); + floor_textbox_2[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_2'); + floor_textbox_3[7] = (J2DTextBox*)mFloorScreen->search('ffoor6_3'); mFloorScreen->search('floor6_1')->hide(); mFloorScreen->search('floor6_2')->hide(); mFloorScreen->search('floor6_3')->hide(); - local_b8[7]->setFont(mDoExt_getSubFont()); - local_d8[7]->setFont(mDoExt_getSubFont()); - local_f8[7]->setFont(mDoExt_getSubFont()); + floor_textbox_1[7]->setFont(mDoExt_getSubFont()); + floor_textbox_2[7]->setFont(mDoExt_getSubFont()); + floor_textbox_3[7]->setFont(mDoExt_getSubFont()); OS_REPORT("floor ===> %d\n", dMenu_Dmap_c::myclass->getFloorAll()); + for (int i = 0; i < 8; i++) { - int bottomFloor = dMenu_Dmap_c::myclass->getBottomFloor(); - u32 floorAll = dMenu_Dmap_c::myclass->getFloorAll(); - u32 temp = (s8)((s8)floorAll - bottomFloor + 1); - if (i < (int)temp) { - bottomFloor += i; - if ((bottomFloor += 5) < 0 || bottomFloor >= 0xd) { - JUT_WARN(1609, "floor message index zero! %d", bottomFloor); - local_b8[i]->setString(16, ""); - local_d8[i]->setString(16, ""); - local_f8[i]->setString(16, ""); + if (i < dMenu_Dmap_c::myclass->getFloorAll()) { + int floor_msg_index = (dMenu_Dmap_c::myclass->getBottomFloor() - var_r26) + i; + if (floor_msg_index < 0 || floor_msg_index >= 13) { + JUT_WARN(1609, "floor message index zero! %d", floor_msg_index); + floor_textbox_1[i]->setString(16, ""); + floor_textbox_2[i]->setString(16, ""); + floor_textbox_3[i]->setString(16, ""); } else { - dMeter2Info_getString(local_118[bottomFloor], acStack_98,NULL); - local_b8[i]->setString(16, acStack_98); - local_d8[i]->setString(16, acStack_98); - local_f8[i]->setString(16, acStack_98); + dMeter2Info_getString(floor_msg_no[floor_msg_index], floor_msg_buf, NULL); + floor_textbox_1[i]->setString(16, floor_msg_buf); + floor_textbox_2[i]->setString(16, floor_msg_buf); + floor_textbox_3[i]->setString(16, floor_msg_buf); } } else { - local_b8[i]->setString(16, ""); - local_d8[i]->setString(16, ""); - local_f8[i]->setString(16, ""); + floor_textbox_1[i]->setString(16, ""); + floor_textbox_2[i]->setString(16, ""); + floor_textbox_3[i]->setString(16, ""); } } } /* 801BA0B4-801BA0BC 1B49F4 0008+00 1/1 0/0 0/0 .text dpdMove__14dMenu_DmapBg_cFScScScPUcUc */ bool dMenu_DmapBg_c::dpdMove(s8 param_0, s8 param_1, s8 param_2, u8* param_3, u8 param_4) { - return false; + bool var_r31 = false; + return var_r31; } /* 801BA0BC-801BA60C 1B49FC 0550+00 2/1 0/0 0/0 .text __dt__14dMenu_DmapBg_cFv */ dMenu_DmapBg_c::~dMenu_DmapBg_c() { dComIfGp_getDmapResArchive()->removeResourceAll(); delete mString; + if (mpMeterHaihai != NULL) { delete mpMeterHaihai; mpMeterHaihai = NULL; } + delete mBaseScreen; mBaseScreen = NULL; + delete mFloorScreen; mFloorScreen = NULL; + delete mpBaseRoot; mpBaseRoot = NULL; + delete mpFloorRoot; mpFloorRoot = NULL; + delete mpDrawCursor; mpDrawCursor = NULL; for (int i = 0; i < 2; i++) { delete mMapScreen[i]; mMapScreen[i] = NULL; + delete mpMapSpace[i]; mpMapSpace[i] = NULL; + delete mpMapRoot[i]; mpMapRoot[i] = NULL; } + if (mpBlack != NULL) { delete mpBlack; mpBlack = NULL; } + for (int i = 0; i < 1; i++) { delete field_0xd28[i]; } + for (int i = 0; i < 2; i++) { delete mpMapSpace[i]; mpMapSpace[i] = NULL; } + if (field_0xcf4 != NULL) { delete field_0xcf4; field_0xcf4 = NULL; } + if (field_0xcf8 != NULL) { delete field_0xcf8; field_0xcf8 = NULL; } deleteExplain(); - if (field_0xd20 != NULL) { - JKRUnmountArchive(field_0xd20); - field_0xd20 = NULL; + + if (mpArchive != NULL) { + JKRUnmountArchive(mpArchive); + mpArchive = NULL; } - if (field_0xd1c != NULL) { - JKRUnmountArchive(field_0xd1c->getArchive()); - field_0xd1c->destroy(); - field_0xd1c = NULL; + + if (mpArchiveMount != NULL) { + JKRUnmountArchive(mpArchiveMount->getArchive()); + mpArchiveMount->destroy(); + mpArchiveMount = NULL; } + if (mpBackTexture != NULL) { delete mpBackTexture; mpBackTexture = NULL; } + delete mButtonScreen; mButtonScreen = NULL; + if (mDecorateScreen != NULL) { delete mDecorateScreen; mDecorateScreen = NULL; } + if (mpDecorateRoot != NULL) { delete mpDecorateRoot; mpDecorateRoot = NULL; } + delete mpButtonRoot; mpButtonRoot = NULL; + for (int i = 0; i < 2; i++) { if (mpButtonAB[i] != NULL) { delete mpButtonAB[i]; mpButtonAB[i] = NULL; } + if (mpButtonText[i] != NULL) { delete mpButtonText[i]; mpButtonText[i] = NULL; } } + delete mpCButton; mpCButton = NULL; + if (mpJButton != NULL) { delete mpJButton; mpJButton = NULL; @@ -923,27 +746,35 @@ dMenu_DmapBg_c::~dMenu_DmapBg_c() { } /* 801BA60C-801BA700 1B4F4C 00F4+00 2/2 0/0 0/0 .text setAllAlphaRate__14dMenu_DmapBg_cFfb */ -void dMenu_DmapBg_c::setAllAlphaRate(f32 param_1, bool param_2) { - field_0xd9c = param_1; +void dMenu_DmapBg_c::setAllAlphaRate(f32 i_rate, bool param_2) { + field_0xd9c = i_rate; + if (param_2) { mpBaseRoot->setBackupAlpha(); mpFloorRoot->setBackupAlpha(); + for (int i = 0; i < 2; i++) { mpMapRoot[i]->setBackupAlpha(); } + mpButtonRoot->setBackupAlpha(); + if (mpDecorateRoot != NULL) { mpDecorateRoot->setBackupAlpha(); } } - mpBaseRoot->setAlphaMorfRate(param_1); - mpFloorRoot->setAlphaMorfRate(param_1); + + mpBaseRoot->setAlphaMorfRate(i_rate); + mpFloorRoot->setAlphaMorfRate(i_rate); + for (int i = 0; i < 2; i++) { - mpMapRoot[i]->setAlphaMorfRate(param_1); + mpMapRoot[i]->setAlphaMorfRate(i_rate); } - mpButtonRoot->setAlphaMorfRate(param_1); + + mpButtonRoot->setAlphaMorfRate(i_rate); + if (mpDecorateRoot != NULL) { - mpDecorateRoot->setAlphaMorfRate(param_1); + mpDecorateRoot->setAlphaMorfRate(i_rate); } } @@ -951,6 +782,7 @@ void dMenu_DmapBg_c::setAllAlphaRate(f32 param_1, bool param_2) { void dMenu_DmapBg_c::setGoldAnimation(bool param_1) { J2DPane* gold0 = mMapScreen[0]->search('gold00_0'); J2DPane* gold1 = mMapScreen[0]->search('gold00_1'); + if (param_1) { gold0->setAnimation(field_0xd28[0]); gold1->setAnimation(field_0xd28[0]); @@ -961,116 +793,125 @@ void dMenu_DmapBg_c::setGoldAnimation(bool param_1) { } /* 801BA7F0-801BA974 1B5130 0184+00 3/3 0/0 0/0 .text setGoldFrameAlphaRate__14dMenu_DmapBg_cFf */ -void dMenu_DmapBg_c::setGoldFrameAlphaRate(f32 param_1) { - if (0.0f == param_1) { +void dMenu_DmapBg_c::setGoldFrameAlphaRate(f32 i_rate) { + if (0.0f == i_rate) { mMapScreen[0]->search('gold00_0')->hide(); mMapScreen[0]->search('gold00_1')->hide(); } else { mMapScreen[0]->search('gold00_0')->show(); mMapScreen[0]->search('gold00_1')->show(); - mMapScreen[0]->search('gold00_0')->setAlpha(param_1 * 255.0f); - mMapScreen[0]->search('gold00_1')->setAlpha(param_1 * 255.0f); + mMapScreen[0]->search('gold00_0')->setAlpha(i_rate * 255.0f); + mMapScreen[0]->search('gold00_1')->setAlpha(i_rate * 255.0f); } } /* 801BA974-801BAA4C 1B52B4 00D8+00 1/1 0/0 0/0 .text addGoldFrameAlphaRate__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::addGoldFrameAlphaRate() { - f32 dVar4; + f32 rate; if (field_0xdd7 >= g_fmapHIO.mDisplayFrameNum) { - dVar4 = 1.0f; + rate = 1.0f; setGoldAnimation(true); } else { field_0xdd7++; if (field_0xdd7 == g_fmapHIO.mDisplayFrameNum) { setGoldAnimation(true); } - dVar4 = (f32)(field_0xdd7 * field_0xdd7) / (f32)(g_fmapHIO.mDisplayFrameNum * g_fmapHIO.mDisplayFrameNum); + rate = (f32)(field_0xdd7 * field_0xdd7) / (f32)(g_fmapHIO.mDisplayFrameNum * g_fmapHIO.mDisplayFrameNum); } - setGoldFrameAlphaRate(dVar4); + + setGoldFrameAlphaRate(rate); } /* 801BAA4C-801BAB10 1B538C 00C4+00 1/1 0/0 0/0 .text decGoldFrameAlphaRate__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::decGoldFrameAlphaRate() { - f32 dVar4; + f32 rate; setGoldAnimation(false); + if (field_0xdd7 >= g_fmapHIO.mUndisplayFrameNum) { field_0xdd7 = g_fmapHIO.mUndisplayFrameNum / 2; } + field_0xdd7 = 0; if (field_0xdd7 == 0) { - dVar4 = 0.0f; + rate = 0.0f; } else { field_0xdd7--; - dVar4 = (f32)(field_0xdd7 * field_0xdd7) / (f32)(g_fmapHIO.mUndisplayFrameNum * g_fmapHIO.mUndisplayFrameNum); + rate = (f32)(field_0xdd7 * field_0xdd7) / (f32)(g_fmapHIO.mUndisplayFrameNum * g_fmapHIO.mUndisplayFrameNum); } - setGoldFrameAlphaRate(dVar4); + setGoldFrameAlphaRate(rate); } /* 801BAB10-801BB334 1B5450 0824+00 1/0 0/0 0/0 .text draw__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::draw() { - u32 local_270; - u32 local_274; - u32 local_278; - u32 local_27c; + u32 scissor_left; + u32 scissor_top; + u32 scissor_width; + u32 scissor_height; + J2DOrthoGraph* grafContext = (J2DOrthoGraph*)dComIfGp_getCurrentGrafPort(); grafContext->setup2D(); - GXGetScissor(&local_270, &local_274, &local_278, &local_27c); + + GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height); grafContext->scissor(field_0xd94, 0.0f, 608.0f, 448.0f); grafContext->setScissor(); + mBaseScreen->draw(field_0xd94, field_0xd98, grafContext); dMenu_Dmap_c::myclass->drawFloorScreenBack(mFloorScreen, field_0xd94, field_0xd98, grafContext); + f32 dVar21 = mDoGph_gInf_c::getWidthF() / 608.0f; f32 dVar16 = mDoGph_gInf_c::getHeightF() / 448.0f; mMapScreen[0]->draw(field_0xd94, field_0xd98, grafContext); - if (mpBackTexture != 0) { - J2DPane* local_280 = mMapScreen[0]->search('center_n'); - CPaneMgr afStack_124; + + if (mpBackTexture != NULL) { + J2DPane* center_pane = mMapScreen[0]->search('center_n'); + CPaneMgr pane; Mtx mtx; - Vec local_200 = afStack_124.getGlobalVtx(local_280, &mtx, 0, false, 0); - Vec local_20c = afStack_124.getGlobalVtx(local_280, &mtx, 3, false, 0); - grafContext->scissor( - ((local_200.x - mDoGph_gInf_c::getMinXF()) / dVar21), ((local_200.y / dVar16) / dVar16), - ((local_20c.x - local_200.x) / dVar21), 2.0f + (local_20c.y - local_200.y)); + Vec local_200 = pane.getGlobalVtx(center_pane, &mtx, 0, false, 0); + Vec local_20c = pane.getGlobalVtx(center_pane, &mtx, 3, false, 0); + grafContext->scissor(((local_200.x - mDoGph_gInf_c::getMinXF()) / dVar21), ((local_200.y / dVar16) / dVar16), + ((local_20c.x - local_200.x) / dVar21), 2.0f + (local_20c.y - local_200.y)); grafContext->setScissor(); + f32 dVar17 = field_0xd8c / 255.0f; - JUtility::TColor local_284; - JUtility::TColor local_288; - local_284.set(field_0xd91, field_0xd92, field_0xd93, 0xff); - local_288.set(field_0xd8d, field_0xd8e, field_0xd8f, 0xff); + JUtility::TColor color_black; + JUtility::TColor color_white; + color_black.set(field_0xd91, field_0xd92, field_0xd93, 0xFF); + color_white.set(field_0xd8d, field_0xd8e, field_0xd8f, 0xFF); mpBackTexture->setAlpha(dVar17 * (field_0xdbc * field_0xd9c)); + f32 local_28c = mpBackTexture->getBounds().i.x; - mpBackTexture->setBlackWhite(local_284, local_288); - mpBackTexture->draw( - local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(), - mpBackTexture->getHeight(), false, false, false); + mpBackTexture->setBlackWhite(color_black, color_white); + mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(), + mpBackTexture->getHeight(), false, false, false); + grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), - local_274, mDoGph_gInf_c::getWidthF(), - local_27c); + scissor_top, mDoGph_gInf_c::getWidthF(), + scissor_height); grafContext->setScissor(); } + mMapScreen[1]->draw(field_0xd94, field_0xd98, grafContext); - J2DPane* local_290 = mMapScreen[1]->search('center_n'); - CPaneMgr afStack_190; + + J2DPane* center_pane = mMapScreen[1]->search('center_n'); + CPaneMgr pane; Mtx local_110; - Vec local_218 = afStack_190.getGlobalVtx(local_290, &local_110, 0, false, 0); - Vec local_224 = afStack_190.getGlobalVtx(local_290, &local_110, 3, false, 0); + Vec local_218 = pane.getGlobalVtx(center_pane, &local_110, 0, false, 0); + Vec local_224 = pane.getGlobalVtx(center_pane, &local_110, 3, false, 0); f32 local_294 = ((local_218.x - mDoGph_gInf_c::getMinXF()) / dVar21); f32 local_298 = ((local_218.y / dVar16) / dVar16); f32 local_29c = ((local_224.x - local_218.x) / dVar21); f32 local_2a0 = 2.0f + (local_224.y - local_218.y); grafContext->scissor(local_294, local_298, local_29c, local_2a0); grafContext->setScissor(); - //local_2a4 = field_0xd9c * field_0xda8; - Vec local_26c = afStack_190.getGlobalVtx(field_0xcc4, &local_110, 0, false, 0); + + Vec local_26c = pane.getGlobalVtx(mMapPane, &local_110, 0, false, 0); drawIcon(local_26c.x + field_0xd94, local_26c.y, field_0xda8, 1.0f); - grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), - local_274, - mDoGph_gInf_c::getWidthF(), - local_27c); + grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), scissor_top, mDoGph_gInf_c::getWidthF(), scissor_height); grafContext->setScissor(); - grafContext->scissor(local_270, local_274, local_278, local_27c); + grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height); grafContext->setScissor(); + if (field_0xdda != 0 && mpMeterHaihai != NULL) { mpMeterHaihai->setScale(0.7f); f32 x1 = 0.0f; @@ -1082,39 +923,43 @@ void dMenu_DmapBg_c::draw() { -35.0f + (local_224.y - local_218.y)); field_0xdda = 0; } + dMenu_Dmap_c::myclass->drawFloorScreenTop(mFloorScreen, field_0xd94, field_0xd98, grafContext); + if (0.0f == field_0xd94 && 0.0f == field_0xd98) { drawCursor(); } + if (mDecorateScreen != NULL) { mDecorateScreen->draw(field_0xd94, field_0xd98, grafContext); } + if (field_0xdd0 != 0 && mpItemExplain != NULL) { mpItemExplain->draw(grafContext); } + mButtonScreen->draw(field_0xd94, field_0xd98, grafContext); - grafContext->scissor( - local_270, - local_274, - local_278, - local_27c); + grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height); grafContext->setScissor(); grafContext->setup2D(); } /* 801BB334-801BB464 1B5C74 0130+00 1/1 0/0 0/0 .text update__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::update() { - if (field_0xd1c !=NULL) { - if (field_0xd1c->sync() && field_0xd20 == NULL) { - field_0xd20 = field_0xd1c->getArchive(); - field_0xd1c->destroy(); - field_0xd1c = NULL; - ResTIMG* mp_image = (ResTIMG*) field_0xd20->getResource("tex/bg.bti"); + if (mpArchiveMount != NULL) { + if (mpArchiveMount->sync() && mpArchive == NULL) { + mpArchive = mpArchiveMount->getArchive(); + mpArchiveMount->destroy(); + mpArchiveMount = NULL; + + ResTIMG* mp_image = (ResTIMG*)mpArchive->getResource("tex/bg.bti"); JUT_ASSERT(2321, mp_image != 0); + mpBackTexture = new J2DPicture(mp_image); JUT_ASSERT(2323, mpBackTexture != 0); - void* uVar1 = field_0xd20->getResource("spec/spec.dat"); - memcpy(field_0xd80, uVar1, 20); + + void* spec = mpArchive->getResource("spec/spec.dat"); + memcpy(&field_0xd80, spec, 20); } } @@ -1127,9 +972,7 @@ void dMenu_DmapBg_c::update() { } /* 801BB464-801BB468 1B5DA4 0004+00 1/1 0/0 0/0 .text calcCursor__14dMenu_DmapBg_cFv */ -void dMenu_DmapBg_c::calcCursor() { - /* empty function */ -} +void dMenu_DmapBg_c::calcCursor() {} /* 801BB468-801BB498 1B5DA8 0030+00 1/1 0/0 0/0 .text drawCursor__14dMenu_DmapBg_cFv */ void dMenu_DmapBg_c::drawCursor() { @@ -1139,40 +982,46 @@ void dMenu_DmapBg_c::drawCursor() { /* 801BB498-801BB634 1B5DD8 019C+00 0/0 1/1 0/0 .text * __ct__12dMenu_Dmap_cFP10JKRExpHeapP9STControlP10CSTControlUcUc */ dMenu_Dmap_c::dMenu_Dmap_c(JKRExpHeap* param_1, STControl* param_2, CSTControl* param_3, - u8 param_4, u8 param_5) { + u8 param_4, u8 param_5) { dMeter2Info_setMapDrugFlag(0); dMenu_Dmap_c::myclass = this; field_0xe8 = param_1; mpStick = param_2; mpCStick = param_3; mZoomState = param_4; - mpDrawBg[0] = NULL; + mpDrawBg = NULL; mDmapHeap = NULL; mItemTexBuf = NULL; mSelStick = NULL; field_0x94 = NULL; - field_0x17c = 0; + m_itemSubProcess = 0; + for (int i = 0; i < 8; i++) { mSelFloor[i] = NULL; } + for (int i = 0; i < 8; i++) { mSelFloor[i] = NULL; mIconLinkPos[i] = NULL; mIconBossPos[i] = NULL; } + for (int i = 0; i < 2; i++) { mStayIcon[i] = NULL; } + field_0x10 = NULL; for (int i = 0; i < 3; i++) { field_0x7c[i] = NULL; field_0x88[i]= NULL; } + field_0x98 = NULL; mMapCtrl = NULL; field_0x144 = 0.0f; field_0x148 = 0.0f; field_0x181 = 0; + if (param_5 == 1) { field_0x104 = -mDoGph_gInf_c::getWidthF(); field_0x108 = 0.0f; @@ -1189,6 +1038,7 @@ dMenu_Dmap_c::dMenu_Dmap_c(JKRExpHeap* param_1, STControl* param_2, CSTControl* field_0x104 = 0.0f; field_0x108 = 0.0f; } + field_0x10c = 0.0f; field_0x110 = 0.0f; field_0x134 = 0.0f; @@ -1200,12 +1050,11 @@ dMenu_Dmap_c::dMenu_Dmap_c(JKRExpHeap* param_1, STControl* param_2, CSTControl* field_0x185 = 0; field_0x180 = 0; mMapCtrl = 0; - field_0xe0 = 0; - field_0xe4 = 0; + mpDresArchiveMount = 0; + mpDresArchive = 0; } /* 801BB634-801BC788 1B5F74 1154+00 1/1 0/0 0/0 .text screenInit__12dMenu_Dmap_cFv */ -// NONMATCHING float reg issues void dMenu_Dmap_c::screenInit() { static u64 const floor_tag[8] = {'floor7_n', 'floor0_n', 'floor1_n', 'floor2_n', 'floor3_n', 'floor4_n', 'floor5_n', 'floor6_n'}; @@ -1218,32 +1067,34 @@ void dMenu_Dmap_c::screenInit() { static u64 const key_tag[3] = {'key_00', 'key_01', 'key_02'}; static u64 const item_tag[3] = {'map000', 'con000', 'i_key_n'}; - field_0x10 = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'floo_s_n', 0, NULL); + field_0x10 = new CPaneMgr(mpDrawBg->mBaseScreen, 'floo_s_n', 0, NULL); + for (int i = 0; i < 8; i++) { field_0x114[i] = 0.0f; - mSelFloor[i] = new CPaneMgr(mpDrawBg[0]->mFloorScreen, floor_tag[i], 3, NULL); + mSelFloor[i] = new CPaneMgr(mpDrawBg->mFloorScreen, floor_tag[i], 3, NULL); JUT_ASSERT(2654, mSelFloor[i] != 0); - mIconLinkPos[i] = new CPaneMgr(mpDrawBg[0]->mFloorScreen, icon_tag[i], 0, NULL); + mIconLinkPos[i] = new CPaneMgr(mpDrawBg->mFloorScreen, icon_tag[i], 0, NULL); JUT_ASSERT(2657, mIconLinkPos[i] != 0); - mIconBossPos[i] = new CPaneMgr(mpDrawBg[0]->mFloorScreen, boss_tag[i], 0, NULL); + mIconBossPos[i] = new CPaneMgr(mpDrawBg->mFloorScreen, boss_tag[i], 0, NULL); JUT_ASSERT(2660, mIconBossPos[i] != 0); } + for (int i = 0; i < 2; i++) { - mStayIcon[i] = new CPaneMgr(mpDrawBg[0]->mFloorScreen, stay_tag[i], 0, NULL); + mStayIcon[i] = new CPaneMgr(mpDrawBg->mFloorScreen, stay_tag[i], 0, NULL); JUT_ASSERT(2665, mStayIcon[i] != 0); mStayIcon[i]->hide(); + field_0x14c[i] = mStayIcon[i]->getGlobalVtxCenter(false, 0); + if (i == 0) { - f32 dVar16; - f32 dVar17 = mpDrawBg[0]->mFloorScreen->search('rink')->getBounds().i.y; - dVar16 = mpDrawBg[0]->mFloorScreen->search('rink')->getBounds().i.x; - mpDrawBg[0]->mFloorScreen->search('wolf')->move(dVar16, dVar17); + mpDrawBg->mFloorScreen->search('wolf')->move((f32)mpDrawBg->mFloorScreen->search('rink')->getBounds().i.x, (f32)mpDrawBg->mFloorScreen->search('rink')->getBounds().i.y); + if (daPy_py_c::checkNowWolf()) { - mpDrawBg[0]->mFloorScreen->search('wolf')->show(); - mpDrawBg[0]->mFloorScreen->search('rink')->hide(); + mpDrawBg->mFloorScreen->search('wolf')->show(); + mpDrawBg->mFloorScreen->search('rink')->hide(); } else { - mpDrawBg[0]->mFloorScreen->search('wolf')->hide(); - mpDrawBg[0]->mFloorScreen->search('rink')->show(); + mpDrawBg->mFloorScreen->search('wolf')->hide(); + mpDrawBg->mFloorScreen->search('rink')->show(); } } } @@ -1253,124 +1104,138 @@ void dMenu_Dmap_c::screenInit() { mSelFloor[i]->hide(); } else if (i == getCurFloorPos()) { mSelFloor[i]->getPanePtr()->scale(1.0f, 1.0f); - mSelFloor[i]->setAlpha(0xff); + mSelFloor[i]->setAlpha(0xFF); } else { mSelFloor[i]->getPanePtr()->scale(0.9f, 0.9f); mSelFloor[i]->setAlpha(0x80); } } - f32 dVar16 = mpDrawBg[0]->mFloorScreen->search('s_n_all')->getHeight(); - f32 dVar17 = mSelFloor[0]->getPanePtr()->getHeight(); - f32 dVar18 = mFloorAll - mBottomFloor + 1; - f32 fVar1 = (dVar16 - (7.0f * (dVar18 - 1.0f) + dVar18 * dVar17)) / 2 + dVar17 / 2; - fVar1 -= (dVar16 / 2); + f32 var_f29; + f32 var_f28 = 7.0f; + + var_f29 = mpDrawBg->mFloorScreen->search('s_n_all')->getHeight(); + f32 var_f30 = mSelFloor[0]->getPanePtr()->getHeight(); + + f32 var_f27 = mFloorAll - mBottomFloor + 1; + + f32 var_f26 = (var_f27 * var_f30) + ((var_f27 - 1.0f) * var_f28); + + f32 var_f31 = (var_f30 / 2) + ((var_f29 - var_f26) / 2); + var_f31 -= var_f29 / 2; + for (int i = mFloorAll - mBottomFloor; i >= 0; i--) { - mSelFloor[i]->getPanePtr()->translate(mSelFloor[i]->getPanePtr()->getTranslateX(), fVar1); - fVar1 += 7.0f + dVar17; + mSelFloor[i]->getPanePtr()->translate(mSelFloor[i]->getPanePtr()->getTranslateX(), var_f31); + var_f31 += var_f30 + var_f28; } - field_0x10->getPanePtr()->translate(mSelFloor[getCurFloorPos()]->getTranslateX(), mSelFloor[getCurFloorPos()]->getTranslateY()); + field_0x10->getPanePtr()->translate(mSelFloor[getCurFloorPos()]->getPanePtr()->getTranslateX(), mSelFloor[getCurFloorPos()]->getPanePtr()->getTranslateY()); iconMoveCalc(); Vec local_b0 = mSelFloor[getDefaultCurFloorPos()]->getGlobalVtxCenter(false, 0); - mpDrawBg[0]->mpDrawCursor->setPos(local_b0.x + field_0x104, local_b0.y, mSelFloor[getDefaultCurFloorPos()]->getPanePtr(), true); - field_0x94 = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'item_s_n', 0, NULL); - field_0x7c[0] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'map_n', 3, NULL); - field_0x7c[1] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'con_n', 3, NULL); - field_0x7c[2] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'key_n', 3, NULL); - field_0x88[0] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'map000', 3, NULL); - field_0x88[1] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'con000', 3, NULL); + mpDrawBg->mpDrawCursor->setPos(local_b0.x + field_0x104, local_b0.y, mSelFloor[getDefaultCurFloorPos()]->getPanePtr(), true); + field_0x94 = new CPaneMgr(mpDrawBg->mBaseScreen, 'item_s_n', 0, NULL); + field_0x7c[0] = new CPaneMgr(mpDrawBg->mBaseScreen, 'map_n', 3, NULL); + field_0x7c[1] = new CPaneMgr(mpDrawBg->mBaseScreen, 'con_n', 3, NULL); + field_0x7c[2] = new CPaneMgr(mpDrawBg->mBaseScreen, 'key_n', 3, NULL); + field_0x88[0] = new CPaneMgr(mpDrawBg->mBaseScreen, 'map000', 3, NULL); + field_0x88[1] = new CPaneMgr(mpDrawBg->mBaseScreen, 'con000', 3, NULL); if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == 0x11) { - field_0x88[2] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'i_key_n', 3, NULL); + field_0x88[2] = new CPaneMgr(mpDrawBg->mBaseScreen, 'i_key_n', 3, NULL); } else if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == 0x14) { - field_0x88[2] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'lv5_k_n', 3, NULL); + field_0x88[2] = new CPaneMgr(mpDrawBg->mBaseScreen, 'lv5_k_n', 3, NULL); } else { - field_0x88[2] = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'nor_k_n', 3, NULL); + field_0x88[2] = new CPaneMgr(mpDrawBg->mBaseScreen, 'nor_k_n', 3, NULL); } + for (int i = 0; i < 3; i++) { field_0x88[i]->scale(0.9f, 0.9f); } + if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == 0x11) { - mpDrawBg[0]->mBaseScreen->search('lv5_k_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('nor_k_n')->hide(); - u8 local_13f = 0; - if (checkItemGet(0xf9, 1)) { - local_13f = 1; + mpDrawBg->mBaseScreen->search('lv5_k_n')->hide(); + mpDrawBg->mBaseScreen->search('nor_k_n')->hide(); + + u8 key_num = 0; + if (checkItemGet(fpcNm_ITEM_L2_KEY_PIECES1, 1)) { + key_num = 1; } - if (checkItemGet(0xfa, 1)) { - local_13f++; + if (checkItemGet(fpcNm_ITEM_L2_KEY_PIECES2, 1)) { + key_num++; } - if (checkItemGet(0xfb, 1)) { - local_13f++; + if (checkItemGet(fpcNm_ITEM_L2_KEY_PIECES3, 1)) { + key_num++; } + for (int i = 0; i < 3; i++) { - if (i == local_13f - 1) { - mpDrawBg[0]->mBaseScreen->search(key_tag[i])->show(); + if (i == key_num - 1) { + mpDrawBg->mBaseScreen->search(key_tag[i])->show(); } else { - mpDrawBg[0]->mBaseScreen->search(key_tag[i])->hide(); + mpDrawBg->mBaseScreen->search(key_tag[i])->hide(); } } - if (local_13f != 0) { + + if (key_num != 0) { field_0x174[2] = 0x26; } else { field_0x174[2] = 0; } - if (local_13f == 0 || dMeter2Info_isTempBit(0)) { - mpDrawBg[0]->mBaseScreen->search('key_n_n')->hide(); + + if (key_num == 0 || dMeter2Info_isTempBit(0)) { + mpDrawBg->mBaseScreen->search('key_n_n')->hide(); } else { - ResTIMG* uVar20 = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', dMeter2Info_getNumberTextureName(local_13f)); - ((J2DPicture*)mpDrawBg[0]->mBaseScreen->search('c_n_2_s'))->changeTexture(uVar20, 0); - ((J2DPicture*)mpDrawBg[0]->mBaseScreen->search('c_n_2'))->changeTexture(uVar20, 0); - uVar20 = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', dMeter2Info_getNumberTextureName(3)); - ((J2DPicture*)mpDrawBg[0]->mBaseScreen->search('c_n_1_s'))->changeTexture(uVar20, 0); - ((J2DPicture*)mpDrawBg[0]->mBaseScreen->search('c_n_1'))->changeTexture(uVar20, 0); + ResTIMG* tex = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', dMeter2Info_getNumberTextureName(key_num)); + ((J2DPicture*)mpDrawBg->mBaseScreen->search('c_n_2_s'))->changeTexture(tex, 0); + ((J2DPicture*)mpDrawBg->mBaseScreen->search('c_n_2'))->changeTexture(tex, 0); + tex = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', dMeter2Info_getNumberTextureName(3)); + ((J2DPicture*)mpDrawBg->mBaseScreen->search('c_n_1_s'))->changeTexture(tex, 0); + ((J2DPicture*)mpDrawBg->mBaseScreen->search('c_n_1'))->changeTexture(tex, 0); } } else if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == 0x14) { - mpDrawBg[0]->mBaseScreen->search('i_key_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('nor_k_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('key_n_n')->hide(); - u8 local_140 = 0xff; + mpDrawBg->mBaseScreen->search('i_key_n')->hide(); + mpDrawBg->mBaseScreen->search('nor_k_n')->hide(); + mpDrawBg->mBaseScreen->search('key_n_n')->hide(); + + u8 itemNo = fpcNm_ITEM_NONE; field_0x174[2] = 0; + if (g_fmapHIO.mMapIconHIO.mLV5DungeonItemDebug) { - local_140 = g_fmapHIO.mMapIconHIO.mLV5DungeonItem; - if (local_140 != 0xff) { - field_0x174[2] = local_140; + itemNo = g_fmapHIO.mMapIconHIO.mLV5DungeonItem; + if (itemNo != fpcNm_ITEM_NONE) { + field_0x174[2] = itemNo; } } else { if (dComIfGs_isDungeonItemBossKey()) { - local_140 = 0xf6; - field_0x174[2] = (u8)dComIfGs_isDungeonItemBossKey() ? 0xf6 : 0; - } else { - if (checkItemGet(0xf4, 1) && !dComIfGs_isEventBit(2)) { - local_140 = 0xf4; - field_0x174[2] = 0xf4; - } else { - if (checkItemGet(0xf5, 1) && !dComIfGs_isEventBit(1)) { - local_140 = 0xf5; - field_0x174[2] = 0xf5; - } - } + itemNo = fpcNm_ITEM_LV5_BOSS_KEY; + field_0x174[2] = (u8)dComIfGs_isDungeonItemBossKey() ? fpcNm_ITEM_LV5_BOSS_KEY : 0; + } else if (checkItemGet(fpcNm_ITEM_TOMATO_PUREE, 1) && !dComIfGs_isEventBit(2)) { + itemNo = fpcNm_ITEM_TOMATO_PUREE; + field_0x174[2] = fpcNm_ITEM_TOMATO_PUREE; + } else if (checkItemGet(fpcNm_ITEM_TASTE, 1) && !dComIfGs_isEventBit(1)) { + itemNo = fpcNm_ITEM_TASTE; + field_0x174[2] = fpcNm_ITEM_TASTE; } } - switch (local_140) { - case 0xf4: - case 0xf5: - dMeter2Info_readItemTexture(local_140, mItemTexBuf, - (J2DPicture*)mpDrawBg[0]->mBaseScreen->search('lv5_boss'), NULL, NULL, NULL, NULL, + + switch (itemNo) { + case fpcNm_ITEM_TOMATO_PUREE: + case fpcNm_ITEM_TASTE: + dMeter2Info_readItemTexture(itemNo, mItemTexBuf, + (J2DPicture*)mpDrawBg->mBaseScreen->search('lv5_boss'), NULL, NULL, NULL, NULL, NULL, NULL, -1); break; } } else { - mpDrawBg[0]->mBaseScreen->search('i_key_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('lv5_k_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('key_n_n')->hide(); - field_0x174[2] = (u8)dComIfGs_isDungeonItemBossKey() ? 0x26 : 0; + mpDrawBg->mBaseScreen->search('i_key_n')->hide(); + mpDrawBg->mBaseScreen->search('lv5_k_n')->hide(); + mpDrawBg->mBaseScreen->search('key_n_n')->hide(); + field_0x174[2] = (u8)dComIfGs_isDungeonItemBossKey() ? fpcNm_ITEM_BOSS_KEY : 0; } - field_0x174[0] = (u8)dComIfGs_isDungeonItemMap() ? 0x23 : 0; - field_0x174[1] = (u8)dComIfGs_isDungeonItemCompass() ? 0x24 : 0; + field_0x174[0] = (u8)dComIfGs_isDungeonItemMap() ? fpcNm_ITEM_MAP : 0; + field_0x174[1] = (u8)dComIfGs_isDungeonItemCompass() ? fpcNm_ITEM_COMPUS : 0; field_0x177 = 0; + int bVar6 = 0; for (int i = 0; i < 3; i++) { if (field_0x174[i] != 0) { @@ -1380,160 +1245,183 @@ void dMenu_Dmap_c::screenInit() { } field_0x88[i]->getPanePtr()->scale(0.9f, 0.9f); } else { - mpDrawBg[0]->mBaseScreen->search(item_tag[i])->hide(); - mpDrawBg[0]->mBaseScreen->search(waku_tag[i])->hide(); + mpDrawBg->mBaseScreen->search(item_tag[i])->hide(); + mpDrawBg->mBaseScreen->search(waku_tag[i])->hide(); + if (i == 2) { - mpDrawBg[0]->mBaseScreen->search('lv5_k_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('nor_k_n')->hide(); - mpDrawBg[0]->mBaseScreen->search('key_n_n')->hide(); + mpDrawBg->mBaseScreen->search('lv5_k_n')->hide(); + mpDrawBg->mBaseScreen->search('nor_k_n')->hide(); + mpDrawBg->mBaseScreen->search('key_n_n')->hide(); } } } + if (bVar6 == true) { - field_0x94->translate(field_0x7c[field_0x177]->getTranslateX(), field_0x7c[field_0x177]->getTranslateY()); + field_0x94->getPanePtr()->translate(field_0x7c[field_0x177]->getPanePtr()->getTranslateX(), field_0x7c[field_0x177]->getPanePtr()->getTranslateY()); } + field_0x94->hide(); - field_0x98 = new CPaneMgr(mpDrawBg[0]->mBaseScreen, 'so_s_n', 0, NULL); + field_0x98 = new CPaneMgr(mpDrawBg->mBaseScreen, 'so_s_n', 0, NULL); field_0x98->hide(); } /* 801BC788-801BC848 1B70C8 00C0+00 1/1 0/0 0/0 .text getPlayerIconPos__12dMenu_Dmap_cFScf */ -void dMenu_Dmap_c::getPlayerIconPos(s8 param_1, f32 param_2) { - if (param_1 == field_0x172) { - f32 local_18; - f32 local_1c; - s16 local_20; - mMapCtrl->getPlayerDrawInfo(&local_18, &local_1c, &local_20); - mpDrawBg[0]->setIconInfo(17, local_18, local_1c, param_2, cM_sht2d(local_20), 1.0f, 1); - player_px = local_18; - player_py = local_1c; +void dMenu_Dmap_c::getPlayerIconPos(s8 i_floorNo, f32 param_2) { + if (i_floorNo == field_0x172) { + f32 pos_x; + f32 pos_y; + s16 rotation; + mMapCtrl->getPlayerDrawInfo(&pos_x, &pos_y, &rotation); + mpDrawBg->setIconInfo(ICON_LINK_e, pos_x, pos_y, param_2, cM_sht2d(rotation), 1.0f, 1); + player_px = pos_x; + player_py = pos_y; } } /* 801BC848-801BCDF4 1B7188 05AC+00 2/2 0/0 0/0 .text getIconPos__12dMenu_Dmap_cFScf */ -void dMenu_Dmap_c::getIconPos(s8 param_1, f32 param_2) { - f32 local_34; - f32 local_38; - f32 local_3c = mpDrawBg[0]->getMapWidth(); - f32 local_40 = mpDrawBg[0]->getMapHeight(); +void dMenu_Dmap_c::getIconPos(s8 i_floorNo, f32 param_2) { + f32 pos_x; + f32 pos_y; + f32 map_width = mpDrawBg->getMapWidth(); + f32 map_height = mpDrawBg->getMapHeight(); s8 cStack_45; - mMapCtrl->initGetTreasureList(1, param_1); + + mMapCtrl->initGetTreasureList(1, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, &cStack_45, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, &cStack_45, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(20, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_DUNGEON_ENTER_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(8, param_1); + + mMapCtrl->initGetTreasureList(8, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, &cStack_45, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, &cStack_45, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(22, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_LV8_WARP_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(3, param_1); - if (mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL) == 1) { - mpDrawBg[0]->setIconInfo(4, local_34, local_38, param_2, 0.0f, 1.0f, 1); + + mMapCtrl->initGetTreasureList(3, i_floorNo); + if (mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL) == 1) { + mpDrawBg->setIconInfo(ICON_BOSS_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(0, param_1); + + mMapCtrl->initGetTreasureList(0, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(19, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_TREASURE_CHEST_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(5, param_1); + + mMapCtrl->initGetTreasureList(5, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(18, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_DESTINATION_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } + if (dComIfGp_isLightDropMapVisible()) { - mMapCtrl->initGetTreasureList(4, param_1); + mMapCtrl->initGetTreasureList(4, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(5, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_LIGHT_DROP_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } } - mMapCtrl->initGetTreasureList(12, param_1); + + mMapCtrl->initGetTreasureList(12, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(6, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_LIGHT_BALL_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(11, param_1); + + mMapCtrl->initGetTreasureList(11, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(7, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_CANNON_BALL_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(2, param_1); + + mMapCtrl->initGetTreasureList(2, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(14, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_KEY_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(9, param_1); + + mMapCtrl->initGetTreasureList(9, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(12, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_MONKEY_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(15, param_1); + + mMapCtrl->initGetTreasureList(15, i_floorNo); while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, NULL, NULL)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, NULL, NULL)) { break; } - mpDrawBg[0]->setIconInfo(8, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_COPY_STATUE_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } - mMapCtrl->initGetTreasureList(16, param_1); - s16 local_44; - u8 local_46; - s8 local_47; + + mMapCtrl->initGetTreasureList(16, i_floorNo); + s16 rotation; + u8 swbit; + s8 roomNo; while (true) { - if (!mMapCtrl->getTreasureList(&local_34, &local_38, NULL, &local_46, &local_47)) { + if (!mMapCtrl->getTreasureList(&pos_x, &pos_y, NULL, &swbit, &roomNo)) { break; } - if (local_46 == 0xff || (local_46 != 0xff && dComIfGs_isSwitch(local_46, (int)local_47))) { - mpDrawBg[0]->setIconInfo(15, local_34, local_38, param_2, 0.0f, 1.0f, 1); + if (swbit == 0xFF || (swbit != 0xFF && dComIfGs_isSwitch(swbit, (int)roomNo))) { + mpDrawBg->setIconInfo(ICON_OOCCOO_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } else { - mpDrawBg[0]->setIconInfo(16, local_34, local_38, param_2, 0.0f, 1.0f, 1); + mpDrawBg->setIconInfo(ICON_OOCCOO_JR_e, pos_x, pos_y, param_2, 0.0f, 1.0f, 1); } } - s32 drawInfo = mMapCtrl->getRestartDrawInfo(&local_34, &local_38, &local_44); - if (drawInfo == param_1) { - mpDrawBg[0]->setIconInfo(21, local_34, local_38, param_2, cM_sht2d(local_44), 1.0f, 1); + + s32 drawInfo = mMapCtrl->getRestartDrawInfo(&pos_x, &pos_y, &rotation); + if (drawInfo == i_floorNo) { + mpDrawBg->setIconInfo(ICON_LINK_ENTER_e, pos_x, pos_y, param_2, cM_sht2d(rotation), 1.0f, 1); } - getPlayerIconPos(param_1, param_2); + + getPlayerIconPos(i_floorNo, param_2); } /* 801BCDF4-801BD144 1B7734 0350+00 1/0 0/0 0/0 .text __dt__12dMenu_Dmap_cFv */ dMenu_Dmap_c::~dMenu_Dmap_c() { s32 iVar2 = field_0xe8->getTotalFreeSize(); s32 iVar4 = field_0xe8->getTotalFreeSize(); - if (mpDrawBg[0] != NULL) { - delete mpDrawBg[0]; - mpDrawBg[0] = NULL; + + if (mpDrawBg != NULL) { + delete mpDrawBg; + mpDrawBg = NULL; } + if (mDmapHeap != NULL) { mDmapHeap->free(mItemTexBuf); mItemTexBuf = NULL; } + OS_REPORT("mpDrawBg free ==================> %d bytes use, %d bytes remain\n", field_0xe8->getTotalFreeSize() - iVar4, field_0xe8->getTotalFreeSize()); + if (mSelStick != NULL) { delete mSelStick; } + if (field_0x94 != NULL) { delete field_0x94; } + for (int i = 0; i < 8; i++) { if (mSelFloor[i] != NULL) { delete mSelFloor[i]; @@ -1548,15 +1436,18 @@ dMenu_Dmap_c::~dMenu_Dmap_c() { mIconBossPos[i] = NULL; } } + for (int i = 0; i < 2; i++) { if (mStayIcon[i] != NULL) { delete mStayIcon[i]; mStayIcon[i] = NULL; } } + if (field_0x10 != NULL) { delete field_0x10; } + for (int i = 0; i < 3; i++) { if (field_0x7c[i] != NULL) { delete field_0x7c[i]; @@ -1567,29 +1458,36 @@ dMenu_Dmap_c::~dMenu_Dmap_c() { field_0x88[i] = NULL; } } + if (field_0x98 != NULL) { delete field_0x98; } + if (mMapCtrl != NULL) { mMapCtrl->_delete(); delete mMapCtrl; } - if (field_0xe0 != NULL) { - JKRUnmountArchive(field_0xe0->getArchive()); - field_0xe0->destroy(); - field_0xe0 = NULL; + + if (mpDresArchiveMount != NULL) { + JKRUnmountArchive(mpDresArchiveMount->getArchive()); + mpDresArchiveMount->destroy(); + mpDresArchiveMount = NULL; } - if (field_0xe4 != NULL) { - JKRUnmountArchive(field_0xe4); - field_0xe4 = 0; + + if (mpDresArchive != NULL) { + JKRUnmountArchive(mpDresArchive); + mpDresArchive = NULL; } + if (mDmapHeap != NULL) { mDoExt_destroyExpHeap(mDmapHeap); - mDmapHeap = 0; + mDmapHeap = NULL; } - dMeter2Info_setMapDrugFlag(0); + + dMeter2Info_setMapDrugFlag(false); OS_REPORT("MenuDmap free ==================> %d bytes use, %d bytes remain\n", field_0xe8->getTotalFreeSize() - iVar2, field_0xe8->getTotalFreeSize()); + dMenu_Dmap_c::myclass = NULL; } @@ -1610,16 +1508,20 @@ s8 dMenu_Dmap_c::getDefaultCurFloorPos() { void dMenu_Dmap_c::iconMoveCalc() { s32 iVar7 = ((s16)field_0x172 - (s16)mBottomFloor); mStayIcon[0]->show(); + Vec local_3c = field_0x14c[0]; Vec local_6c = mIconLinkPos[iVar7]->getGlobalVtxCenter(false, 0); mStayIcon[0]->paneTrans(local_6c.x - local_3c.x, local_6c.y - local_3c.y); + // !@bug Uses ScaleX for y coordinate f32 yscale = mSelFloor[iVar7]->getPanePtr()->getScaleX(); f32 xscale = mSelFloor[iVar7]->getPanePtr()->getScaleX(); mStayIcon[0]->scale(xscale, yscale); + if (field_0x173 != -99) { iVar7 = field_0x173 - (s16)mBottomFloor; mStayIcon[1]->show(); + Vec local_54 = field_0x14c[1]; Vec local_78 = mIconBossPos[iVar7]->getGlobalVtxCenter(false, 0); mStayIcon[1]->paneTrans(local_78.x - local_54.x, local_78.y - local_54.y); @@ -1629,20 +1531,22 @@ void dMenu_Dmap_c::iconMoveCalc() { /* 801BD3B8-801BD524 1B7CF8 016C+00 1/1 0/0 0/0 .text * drawFloorScreenBack__12dMenu_Dmap_cFP9J2DScreenffP13J2DOrthoGraph */ -void dMenu_Dmap_c::drawFloorScreenBack(J2DScreen* param_1, f32 param_2, f32 param_3, - J2DOrthoGraph* param_4) { - for (int i = 0; i < (s8)(getFloorAll() - mBottomFloor + 1); i++) { +void dMenu_Dmap_c::drawFloorScreenBack(J2DScreen* i_screen, f32 i_transX, f32 i_transY, + J2DOrthoGraph* i_ortho) { + for (int i = 0; i < getFloorAll(); i++) { if (i == getCurFloorPos() && 0.0f == field_0x114[i]) { mSelFloor[i]->hide(); } else { mSelFloor[i]->show(); } } + if (field_0x172 - mBottomFloor == getCurFloorPos()) { mStayIcon[0]->hide(); } else { mStayIcon[0]->show(); } + if (field_0x173 != -99) { if (field_0x173 - mBottomFloor == getCurFloorPos()) { mStayIcon[1]->hide(); @@ -1650,26 +1554,28 @@ void dMenu_Dmap_c::drawFloorScreenBack(J2DScreen* param_1, f32 param_2, f32 para mStayIcon[1]->show(); } } - param_1->draw(param_2, param_3, param_4); -} + i_screen->draw(i_transX, i_transY, i_ortho); +} /* 801BD524-801BD690 1B7E64 016C+00 1/1 0/0 0/0 .text * drawFloorScreenTop__12dMenu_Dmap_cFP9J2DScreenffP13J2DOrthoGraph */ -void dMenu_Dmap_c::drawFloorScreenTop(J2DScreen* param_1, f32 param_2, f32 param_3, - J2DOrthoGraph* param_4) { - for (int i = 0; i < (s8)(getFloorAll() - mBottomFloor + 1); i++) { +void dMenu_Dmap_c::drawFloorScreenTop(J2DScreen* i_screen, f32 i_transX, f32 i_transY, + J2DOrthoGraph* i_ortho) { + for (int i = 0; i < getFloorAll(); i++) { if (i == getCurFloorPos() && 0.0f == field_0x114[i]) { mSelFloor[i]->show(); } else { mSelFloor[i]->hide(); } } + if (field_0x172 - mBottomFloor == getCurFloorPos()) { mStayIcon[0]->show(); } else { mStayIcon[0]->hide(); } + if (field_0x173 != -99) { if (field_0x173 - mBottomFloor == getCurFloorPos()) { mStayIcon[1]->show(); @@ -1677,28 +1583,19 @@ void dMenu_Dmap_c::drawFloorScreenTop(J2DScreen* param_1, f32 param_2, f32 param mStayIcon[1]->hide(); } } - param_1->draw(param_2, param_3, param_4); -} + i_screen->draw(i_transX, i_transY, i_ortho); +} /* 801BD690-801BD6C4 1B7FD0 0034+00 3/3 0/0 0/0 .text isMapMoveState__12dMenu_Dmap_cFv */ -// getDisableZoomMoveFlgX is not defined - needs the member variables and the class is not defined at all. -#ifdef NONMATCHING bool dMenu_Dmap_c::isMapMoveState() { field_0x184 = true; - if (mMapCtrl->getDisableZoomMoveFlgX() == 1 && mMapCtrl->getDisableZoomMoveFlgZ() == 1) { - field_0x184 = false; - } - if (field_0x17b == 0) { + if (mMapCtrl->getDisableZoomMoveFlgX() == true && mMapCtrl->getDisableZoomMoveFlgZ() == true) { field_0x184 = false; } + return field_0x184; } -#else -bool dMenu_Dmap_c::isMapMoveState() { - // NONMATCHING -} -#endif /* 801BD6C4-801BD7C0 1B8004 00FC+00 1/1 0/0 0/0 .text floorChangeMode__12dMenu_Dmap_cFv */ @@ -1718,237 +1615,996 @@ void dMenu_Dmap_c::floorChangeMode() { field_0x16c = field_0x16d; mMapCtrl->setPlusNowStayFloorNo(dVar1, field_0x179); } + field_0x185 = 0; + if (mZoomState != 0) { - mpDrawBg[0]->setAButtonString(0); - mpDrawBg[0]->setBButtonString(0x522); + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x522); } else { - mpDrawBg[0]->setAButtonString(0x527); - mpDrawBg[0]->setBButtonString(0x3f9); + mpDrawBg->setAButtonString(0x527); + mpDrawBg->setBButtonString(0x3f9); } } /* 801BD7C0-801BDD40 1B8100 0580+00 1/1 0/0 0/0 .text _create__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::_create() { - // NONMATCHING -} + u32 sp30 = field_0xe8->getTotalFreeSize(); + OS_REPORT("MenuDmap create前 最大===========> %d bytes max\n", field_0xe8->getFreeSize()); + OS_REPORT("MenuDmap create前================> %d bytes remain\n", sp30); + + mDmapHeap = JKRCreateExpHeap(field_0xe8->getFreeSize() - 0x10, field_0xe8, false); + JUT_ASSERT(3732, mDmapHeap != 0); + JKRHeap* heap = mDoExt_setCurrentHeap(mDmapHeap); + u32 sp28 = mDmapHeap->getTotalFreeSize(); + + mMapCtrl = new dMenu_DmapMapCtrl_c(); + JUT_ASSERT(3739, mMapCtrl != 0); + + mCMessageNum = 0; + mJMessageNum = 0; + + field_0x184 = true; + if (mMapCtrl->getDisableZoomMoveFlgX() == true && mMapCtrl->getDisableZoomMoveFlgZ() == true) { + field_0x184 = false; + } + + mSelStick = new STControl(5, 2, 1, 1, 0.9f, 0.5f, 0, 0x800); + JUT_ASSERT(3753, mSelStick != 0); + mSelStick->setFirstWaitTime(8); + + u32 sp24 = field_0xe8->getTotalFreeSize(); + mpDrawBg = new dMenu_DmapBg_c(mDmapHeap, mpStick); + JUT_ASSERT(3763, mpDrawBg != 0); + + mItemTexBuf = (u8*)mDmapHeap->alloc(0xC00, 0x20); + JUT_ASSERT(3766, mItemTexBuf != 0); + + if (mZoomState) { + if (POINTER_OPT == 0) { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x522); + } + + mCMessageNum = 0x37B; + mJMessageNum = 0x569; + } else { + if (POINTER_OPT == 0) { + mpDrawBg->setAButtonString(0x527); + mpDrawBg->setBButtonString(0x3F9); + } + + mCMessageNum = 0; + mJMessageNum = 0; + } + + OS_REPORT("mpDrawBg create==================> %d bytes use, %d bytes remain\n", sp24 - field_0xe8->getTotalFreeSize(), field_0xe8->getTotalFreeSize()); + + if (dMeter2Info_getMapStatus() == 6) { + s8 sp8 = 0; + if (dComIfGs_isSaveSwitch(0x67)) { + sp8++; + } else if (dComIfGs_isSaveSwitch(0x66) || dComIfGs_isSaveSwitch(0x65)) { + + } + + mMapCtrl->_create(mpDrawBg->getMapWidth(), mpDrawBg->getMapHeight(), mpDrawBg->getMapWidth(), mpDrawBg->getMapHeight(), sp8, mpBinData); + m_process = 4; + } else { + mMapCtrl->_create(mpDrawBg->getMapWidth(), mpDrawBg->getMapHeight(), mpDrawBg->getMapWidth(), mpDrawBg->getMapHeight(), mpBinData); + m_process = 1; + } + + field_0x16c = mMapCtrl->getNowStayFloorNo(); + field_0x172 = mMapCtrl->getPlayerStayFloorNo(); + field_0x16d = field_0x16c; + field_0x16f = field_0x16c; + field_0x16a = 0; + + mpDrawBg->setDPDFloorSelCurPos(field_0x172); + mFloorAll = mMapCtrl->getTopFloorNo(); + mBottomFloor = mMapCtrl->getBottomFloorNo(); + field_0x173 = 0x9D; + + int floorNo; + if (dTres_c::getBossIconFloorNo(&floorNo)) { + OS_REPORT("BOSS floorNo<%d>\n", floorNo); + field_0x173 = floorNo; + } else { + OS_REPORT("BOSS floor Nothing!!\n"); + } -/* ############################################################################################## */ -/* 80454054-80454058 002654 0004+00 1/1 0/0 0/0 .sdata2 @6017 */ -SECTION_SDATA2 static f32 lit_6017 = 12.0f / 17.0f; + mpDrawBg->setFloorMessage(); + + if (mZoomState) { + f32 sp1C = 0.0f; + f32 sp18 = 0.0f; + mMapCtrl->calcZoomCenter(&sp1C, &sp18); + mMapCtrl->initZoomWait(sp1C, sp18); + + if ((mMapCtrl->getDisableZoomMoveFlgX() != true || mMapCtrl->getDisableZoomMoveFlgZ() != true) && mpDrawBg->field_0xcf4 != NULL) { + mpDrawBg->field_0xcf4->setAlpha(0xFF); + } + } + + field_0x182 = 1; + field_0x183 = 1; + + mpDrawBg->mapIconScaleSet(mZoomState); + + screenInit(); + + mpDrawBg->getMapPane()->changeTexture(mMapCtrl->getResTIMGPointer(0), NULL); + + if (mpDrawBg->getMapPane()->append(mMapCtrl->getResTIMGPointer(1), 1.0f)) { + mpDrawBg->getMapPane()->setBlendRatio(1.0f, 0.0f); + } + + mDoExt_setCurrentHeap(heap); + + getIconPos(mMapCtrl->getNowStayFloorNo(), 1.0f); + + field_0x17d = 0; + (this->*init_process[m_process])(); + + field_0x17e = 0; + (this->*map_init_process[field_0x17e])(); +} /* 801BDDA4-801BDEF8 1B86E4 0154+00 0/0 1/1 0/0 .text _move__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::_move() { - // NONMATCHING + u8 prev_process = m_process; + JKRHeap* prev_heap = mDoExt_setCurrentHeap(mDmapHeap); + + mpDrawBg->update(); + mpDrawBg->clearIconInfo(); + mapControl(); + + if (field_0x17e == 0) { + mpDrawBg->dpdMove(mFloorAll, mBottomFloor, field_0x172, field_0x174, field_0x181); + + if (mpDrawBg->mpBlack != NULL) { + f32 var_f31; + if (mpDrawBg->field_0xdd3 != 0xFF) { + var_f31 = 0.0f; + } else { + var_f31 = 0.70588237f; + } + + cLib_addCalc2(&field_0x110, var_f31, 0.4f, 0.5f); + mpDrawBg->mpBlack->setAlphaRate(field_0x110); + } + + (this->*move_process[m_process])(); + mpDrawBg->setCButtonString(0); + mpDrawBg->setJButtonString(0); + + if (m_process != prev_process) { + (this->*init_process[m_process])(); + } + } + + setMapTexture(); + mapBgAnime(); + mpDrawBg->calcCursor(); + mpDrawBg->addGoldFrameAlphaRate(); + + mDoExt_setCurrentHeap(prev_heap); } /* 801BDEF8-801BDF48 1B8838 0050+00 1/1 0/0 0/0 .text setMapTexture__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::setMapTexture() { f32 mapBlendPer = mMapCtrl->getMapBlendPer(); - mpDrawBg[0]->getMapPane()->setBlendRatio(mapBlendPer, 1.0f - mapBlendPer); + mpDrawBg->getMapPane()->setBlendRatio(mapBlendPer, 1.0f - mapBlendPer); } - /* 801BDF48-801BDF6C 1B8888 0024+00 1/1 0/0 0/0 .text mapBgAnime__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapBgAnime() { - mpDrawBg[0]->mapScreenAnime(); + mpDrawBg->mapScreenAnime(); } -/* ############################################################################################## */ -/* 80454058-8045405C 002658 0004+00 2/2 0/0 0/0 .sdata2 @6180 */ -SECTION_SDATA2 static f32 lit_6180 = 100.0f; - -/* 8045405C-80454060 00265C 0004+00 7/7 0/0 0/0 .sdata2 @6181 */ -SECTION_SDATA2 static f32 lit_6181 = -1.0f; - /* 801BDF6C-801BE328 1B88AC 03BC+00 1/1 0/0 0/0 .text mapControl__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapControl() { - // NONMATCHING -} + u8 temp_r27 = field_0x17e; + if (m_process == 0 || field_0x183 == 0) { + mMapCtrl->move(); + + getIconPos(mMapCtrl->getDispFloorNo(), mMapCtrl->getMapBlendPer()); + getIconPos(mMapCtrl->getDispFloor2No(), 1.0f - mMapCtrl->getMapBlendPer()); + return; + } + + (this->*map_move_process[field_0x17e])(); + + if (field_0x17e != temp_r27) { + (this->*map_init_process[field_0x17e])(); + } + + f32 sp28 = g_fmapHIO.mScrollSpeedSlowBound < g_fmapHIO.mScrollSpeedFastBound ? g_fmapHIO.mScrollSpeedSlowBound : g_fmapHIO.mScrollSpeedFastBound; + f32 sp24 = g_fmapHIO.mScrollSpeedSlowBound > g_fmapHIO.mScrollSpeedFastBound ? g_fmapHIO.mScrollSpeedSlowBound : g_fmapHIO.mScrollSpeedFastBound; + + f32 stick_value = mpCStick->getValueStick(); + s16 stick_angle = mpCStick->getAngleStick(); + + bool var_r28 = false; + f32 disp_center_x = mMapCtrl->getDispCenterX(); + f32 disp_center_z = mMapCtrl->getDispCenterZ(); + + if (stick_value >= sp28 && field_0x181 != 2) { + var_r28 = true; + + f32 var_f31 = mMapCtrl->getStageMapSizeX(); + if (var_f31 < mMapCtrl->getStageMapSizeZ()) { + var_f31 = mMapCtrl->getStageMapSizeZ(); + } + + f32 var_f29; + if (stick_value < sp24) { + var_f29 = g_fmapHIO.mScrollSpeedDungeonMapSlow; + } else { + var_f29 = g_fmapHIO.mScrollSpeedDungeonMapFast; + } + + f32 temp_f28 = (var_f29 / 100.0f) * var_f31; + f32 sp18 = temp_f28 * cM_ssin(stick_angle); + f32 sp14 = temp_f28 * cM_scos(stick_angle); + mMapCtrl->setPlusZoomCenterX(sp18); + mMapCtrl->setPlusZoomCenterZ(sp14); + } + + mMapCtrl->move(); + + getIconPos(mMapCtrl->getDispFloorNo(), mMapCtrl->getMapBlendPer()); + getIconPos(mMapCtrl->getDispFloor2No(), 1.0f - mMapCtrl->getMapBlendPer()); + + if (var_r28 && (disp_center_x != mMapCtrl->getDispCenterX() || disp_center_z != mMapCtrl->getDispCenterZ())) { + Z2GetAudioMgr()->seStartLevel(Z2SE_SY_MAP_SCROLL, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + } + + if (mpDrawBg->mpMeterHaihai != NULL && isMapMoveState() && (getCMessageNum() == 0x37B || getCMessageNum() == 0x569)) { + mpDrawBg->field_0xdda = 0; + + if (mMapCtrl->getDispCenterX() > mMapCtrl->getZoomCenterMinX()) { + mpDrawBg->field_0xdda |= 1; + } -/* ############################################################################################## */ -/* 80395760-80395760 021DC0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80395826 = "/res/FieldMap/res-d.arc"; -SECTION_DEAD static char const* const stringBase_8039583E = "dat/data.dat"; -#pragma pop + if (mMapCtrl->getDispCenterX() < mMapCtrl->getZoomCenterMaxX()) { + mpDrawBg->field_0xdda |= 4; + } + + if (mMapCtrl->getDispCenterZ() > mMapCtrl->getZoomCenterMinZ()) { + mpDrawBg->field_0xdda |= 8; + } + + if (mMapCtrl->getDispCenterZ() < mMapCtrl->getZoomCenterMaxZ()) { + mpDrawBg->field_0xdda |= 2; + } + + mpDrawBg->mpMeterHaihai->_execute(0); + } +} /* 801BE328-801BE670 1B8C68 0348+00 0/0 1/1 0/0 .text isOpen__12dMenu_Dmap_cFv */ bool dMenu_Dmap_c::isOpen() { - // NONMATCHING + bool var_r28 = false; + bool var_r27 = false; + const s16 display_frame_num = g_fmapHIO.mDisplayFrameNum; + const s16 undisplay_frame_num = g_fmapHIO.mUndisplayFrameNum; + + mpBinData = NULL; + + if (mpDresArchive == NULL) { + if (mpDresArchiveMount == NULL) { + mpDresArchiveMount = mDoDvdThd_mountArchive_c::create("/res/FieldMap/res-d.arc", 2, mDoExt_getJ2dHeap()); + } + + if (mpDresArchiveMount->sync()) { + mpDresArchive = mpDresArchiveMount->getArchive(); + mpDresArchiveMount->destroy(); + mpDresArchiveMount = NULL; + + mpBinData = mpDresArchive->getResource("dat/data.dat"); + JUT_ASSERT(4377, mpBinData != 0); + + _create(); + } else { + return var_r28; + } + } + + if (field_0x164 == 0) { + var_r27 = true; + } + + field_0x164++; + f32 temp_f31 = (f32)field_0x164 / (f32)display_frame_num; + + if (mInOutDir == 1) { + field_0x104 = (1.0f - temp_f31) * -mDoGph_gInf_c::getWidthF(); + field_0x108 = 0.0f; + } else if (mInOutDir == 3) { + field_0x104 = (1.0f - temp_f31) * mDoGph_gInf_c::getWidthF(); + field_0x108 = 0.0f; + } else if (mInOutDir == 2) { + field_0x104 = 0.0f; + field_0x108 = (1.0f - temp_f31) * -mDoGph_gInf_c::getHeightF(); + } else if (mInOutDir == 0) { + field_0x104 = 0.0f; + field_0x108 = (1.0f - temp_f31) * mDoGph_gInf_c::getHeightF(); + } + + field_0x10c = temp_f31; + + if (m_process == 0) { + Vec sp2C = field_0x7c[field_0x177]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp2C.x + field_0x104, sp2C.y, field_0x7c[field_0x177]->getPanePtr(), 0); + } else { + Vec sp20 = mSelFloor[getDefaultCurFloorPos()]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp20.x + field_0x104, sp20.y, mSelFloor[getDefaultCurFloorPos()]->getPanePtr(), 1); + } + + if (field_0x164 >= display_frame_num) { + field_0x164 = undisplay_frame_num; + field_0x104 = 0.0f; + field_0x108 = 0.0f; + field_0x10c = 1.0f; + var_r28 = true; + } + + mpDrawBg->setAllAlphaRate(field_0x10c, var_r27); + mpDrawBg->setGoldFrameAlphaRate(0.0f); + return var_r28; } /* 801BE670-801BE7E0 1B8FB0 0170+00 0/0 1/1 0/0 .text isClose__12dMenu_Dmap_cFv */ bool dMenu_Dmap_c::isClose() { - // NONMATCHING + bool var_r30 = true; + bool var_r29 = false; + const s16 undisplay_frame_num = g_fmapHIO.mUndisplayFrameNum; + + if (field_0x164 == undisplay_frame_num) { + var_r29 = true; + } + + field_0x164--; + + f32 temp_f31 = (f32)field_0x164 / (f32)undisplay_frame_num; + + if (field_0x164 <= 0) { + field_0x164 = 0; + } else { + var_r30 = false; + } + + if (mInOutDir == 1) { + field_0x104 = (1.0f - temp_f31) * mDoGph_gInf_c::getWidthF(); + field_0x108 = 0.0f; + } else if (mInOutDir == 3) { + field_0x104 = (1.0f - temp_f31) * -mDoGph_gInf_c::getWidthF(); + field_0x108 = 0.0f; + } else if (mInOutDir == 2) { + field_0x104 = 0.0f; + field_0x108 = (1.0f - temp_f31) * mDoGph_gInf_c::getHeightF(); + } else if (mInOutDir == 0) { + field_0x104 = 0.0f; + field_0x108 = (1.0f - temp_f31) * -mDoGph_gInf_c::getHeightF(); + } + + field_0x10c = temp_f31; + mpDrawBg->setAllAlphaRate(field_0x10c, var_r29); + mpDrawBg->decGoldFrameAlphaRate(); + return var_r30; } /* 801BE7E0-801BEAFC 1B9120 031C+00 0/0 1/1 0/0 .text _draw__12dMenu_Dmap_cFv */ +// NONMATCHING - not sure what the 2nd param of getGlobalVtxCenter is supposed to be void dMenu_Dmap_c::_draw() { - // NONMATCHING + if (mMapCtrl != NULL) { + mMapCtrl->draw(); + + if (mpDrawBg != NULL) { + mpDrawBg->setAllTrans(field_0x104, field_0x108); + + if (mpDrawBg->mpBackTexture != NULL) { + f32 var_f31 = 100.0f * mpDrawBg->field_0xd88; + f32 sp24 = mpDrawBg->field_0xd80 / var_f31; + f32 sp20 = mpDrawBg->field_0xd84 / var_f31; + + const ResTIMG* back_timg = mpDrawBg->mpBackTexture->getTexture(0)->getTexInfo(); + field_0x13c = mMapCtrl->getPixelStageSizeX(); + field_0x140 = mMapCtrl->getPixelStageSizeZ(); + field_0x134 = mMapCtrl->getPixelCenterX(); + field_0x138 = mMapCtrl->getPixelCenterZ(); + + f32 temp_f30; + f32 var_f29; + + f32 var_f27; + if (field_0x13c > field_0x140) { + temp_f30 = back_timg->width * var_f31; + var_f29 = mMapCtrl->getStageMapSizeX(); + var_f27 = field_0x13c * (temp_f30 / var_f29); + } else { + temp_f30 = back_timg->height * var_f31; + var_f29 = mMapCtrl->getStageMapSizeZ(); + var_f27 = field_0x140 * (temp_f30 / var_f29); + } + + f32 sp1C[2]; + sp1C[0] = var_f27; + sp1C[1] = var_f27; + + f32 sp14[2]; + sp14[0] = -(field_0x134 + (100.0f * (sp24 * mMapCtrl->getPixelPerCm()))); + sp14[1] = -(field_0x138 + 100.0f * (sp20 * mMapCtrl->getPixelPerCm())); + + Vec spC; + spC.x = mpDrawBg->mMapScreen[0]->search('center_n')->getGlbBounds().i.x + (mpDrawBg->mMapScreen[0]->search('center_n')->getWidth() / 2); + spC.y = mpDrawBg->mMapScreen[0]->search('center_n')->getGlbBounds().i.y + (mpDrawBg->mMapScreen[0]->search('center_n')->getHeight() / 2); + + CPaneMgr sp70; + Vec sp34 = sp70.getGlobalVtxCenter(mpDrawBg->getMapPane(), false, 0); + + spC.x = sp34.x; + spC.y = sp34.y; + mpDrawBg->mpBackTexture->move(sp14[0] + (spC.x - (sp1C[0] / 2)), sp14[1] + (spC.y - (sp1C[1] / 2))); + mpDrawBg->mpBackTexture->resize(sp1C[0], sp1C[1]); + } + + dComIfGd_set2DOpa(mpDrawBg); + } + } } /* 801BEAFC-801BEB0C 1B943C 0010+00 1/0 0/0 0/0 .text itemInfo_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemInfo_init_proc() { - // NONMATCHING + m_itemSubProcess = 0; + field_0x185 = 0; } /* 801BEB0C-801BEB44 1B944C 0038+00 1/0 0/0 0/0 .text itemInfo_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemInfo_proc() { - // NONMATCHING + (this->*itemInfo_subProcess[m_itemSubProcess])(); } /* 801BEB44-801BEF28 1B9484 03E4+00 1/0 0/0 0/0 .text itemSelect__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemSelect() { - // NONMATCHING + if (mpDrawBg->field_0xdd4 == -99 && mpDrawBg->field_0xdd5 == 0xFF) { + mSelStick->checkTrigger(); + } + + if (POINTER_OPT == 0) { + if (field_0x174[field_0x177] != 0) { + mpDrawBg->setAButtonString(0x5D); + } else { + mpDrawBg->setAButtonString(0); + } + + mpDrawBg->setBButtonString(0x3F9); + } + + if (mSelStick->checkUpTrigger()) { + int temp_r3 = getNextItem(-1); + if (temp_r3 != -1) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x178 = field_0x177; + field_0x177 = temp_r3; + field_0x179 = mSelStick->getYwaitTimer(); + itemSelectAnmInit(); + } + return; + } + + if (mSelStick->checkDownTrigger()) { + int temp_r3_2 = getNextItem(1); + if (temp_r3_2 != -1) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x178 = field_0x177; + field_0x177 = temp_r3_2; + field_0x179 = mSelStick->getYwaitTimer(); + itemSelectAnmInit(); + } + return; + } + + if (mSelStick->checkRightTrigger()) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_FLOOR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x179 = mSelStick->getXwaitTimer(); + m_process = 3; + + if (POINTER_OPT == 0) { + if (mZoomState) { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x522); + } else { + mpDrawBg->setAButtonString(0x527); + mpDrawBg->setBButtonString(0x3F9); + } + } + } else if (mpDrawBg->field_0xdd4 == -99) { + if (mpDrawBg->field_0xdd5 != 0xFF) { + if (field_0x177 != mpDrawBg->field_0xdd5) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x178 = field_0x177; + field_0x177 = mpDrawBg->field_0xdd5; + field_0x179 = mSelStick->getYwaitTimer(); + itemSelectAnmInit(); + return; + } + } + + if (mDoCPd_c::getTrigA(PAD_1) && !dMeter2Info_isTouchKeyCheck(0xC)) { + if (field_0x174[field_0x177] != 0) { + field_0x185 = 1; + field_0x183 = 0; + + mpDrawBg->createExplain(); + if (mpDrawBg->getItemExplainPtr()->openExplainDmap(field_0x174[field_0x177], 0, 0, 0, 0xFF)) { + mpDrawBg->field_0xdd0 = 1; + m_itemSubProcess = 2; + Z2GetAudioMgr()->seStart(Z2SE_SY_EXP_WIN_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + + if (POINTER_OPT == 0) { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0); + } + + mCMessageNum = 0; + mJMessageNum = 0; + } + } else { + Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + } + } + } } /* 801BEF28-801BEFCC 1B9868 00A4+00 1/1 0/0 0/0 .text getNextItem__12dMenu_Dmap_cFi */ -void dMenu_Dmap_c::getNextItem(int param_0) { - // NONMATCHING +int dMenu_Dmap_c::getNextItem(int param_0) { + if (!itemCarryCheck()) { + return -1; + } + + if ((field_0x177 + param_0) < 0 || (field_0x177 + param_0) > 2) { + return -1; + } + + int var_r30 = field_0x177; + int var_r28 = -1; + + while ((var_r30 + param_0) <= 2 && (var_r30 + param_0) >= 0) { + if (field_0x174[var_r30 + param_0] != 0) { + var_r28 = var_r30 + param_0; + break; + } + + var_r30 += param_0; + } + + return var_r28; } /* 801BEFCC-801BF030 1B990C 0064+00 1/1 0/0 0/0 .text itemSelectAnmInit__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemSelectAnmInit() { - // NONMATCHING + field_0x94->hide(); + field_0x88[field_0x178]->scaleAnimeStart(0); + field_0x88[field_0x177]->scaleAnimeStart(0); + m_itemSubProcess = 1; } /* 801BF030-801BF180 1B9970 0150+00 1/0 0/0 0/0 .text itemSelectAnm__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemSelectAnm() { - // NONMATCHING + bool temp_r29 = field_0x88[field_0x178]->scaleAnime(field_0x179, 1.0f, 0.9f, 0); + bool temp_r28 = field_0x88[field_0x177]->scaleAnime(field_0x179, 0.9f, 1.0f, 0); + + if (temp_r29 == true && temp_r28 == true) { + field_0x94->getPanePtr()->translate(field_0x88[field_0x177]->getPanePtr()->getTranslateX(), + field_0x88[field_0x177]->getPanePtr()->getTranslateY()); + field_0x94->show(); + + Vec sp14 = field_0x7c[field_0x177]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp14.x + field_0x104, sp14.y, field_0x7c[field_0x177]->getPanePtr(), false); + m_itemSubProcess = 0; + } } /* 801BF180-801BF18C 1B9AC0 000C+00 1/0 0/0 0/0 .text itemInfoOpenAnm__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemInfoOpenAnm() { - field_0x17c = 3; + m_itemSubProcess = 3; } /* 801BF18C-801BF278 1B9ACC 00EC+00 1/0 0/0 0/0 .text itemInfoWait__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemInfoWait() { - // NONMATCHING + mpDrawBg->getItemExplainPtr()->move(); + + if (mpDrawBg->getItemExplainPtr()->getStatus() == 2) { + if (POINTER_OPT == 0) { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x3F9); + } + } else if (mpDrawBg->getItemExplainPtr()->getStatus() == 3) { + if (POINTER_OPT == 0) { + if (field_0x174[field_0x177] != 0) { + mpDrawBg->setAButtonString(0x5D); + } else { + mpDrawBg->setAButtonString(0); + } + } + } else if (mpDrawBg->getItemExplainPtr()->getStatus() == 5) { + if (POINTER_OPT == 0) { + mpDrawBg->setAButtonString(0); + } + + Z2GetAudioMgr()->seStart(Z2SE_SY_EXP_WIN_CLOSE, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + mpDrawBg->field_0xdd0 = 1; + m_itemSubProcess = 4; + } } /* 801BF278-801BF334 1B9BB8 00BC+00 1/0 0/0 0/0 .text itemInfoCloseAnm__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::itemInfoCloseAnm() { - // NONMATCHING + bool var_r30 = false; + mpDrawBg->getItemExplainPtr()->move(); + + if (mpDrawBg->getItemExplainPtr()->getStatus() == 0) { + var_r30 = true; + } + + if (var_r30 == true) { + mpDrawBg->deleteExplain(); + mpDrawBg->field_0xdd0 = 0; + field_0x185 = 0; + field_0x183 = 1; + m_itemSubProcess = 0; + + if (POINTER_OPT == 0) { + mpDrawBg->setBButtonString(0x3F9); + } + + if (mZoomState) { + mCMessageNum = 0x37B; + mJMessageNum = 0x569; + } else { + mCMessageNum = 0; + mJMessageNum = 0; + } + } } /* 801BF334-801BF410 1B9C74 00DC+00 0/0 1/1 0/0 .text getNextStatus__12dMenu_Dmap_cFv */ u8 dMenu_Dmap_c::getNextStatus() { - // NONMATCHING + if (POINTER_OPT != 0) { + if ((dMw_LEFT_TRIGGER() || (dMw_B_TRIGGER() && (!getZoomState() || (m_process == 0 && m_itemSubProcess == 0)))) && !isKeyCheck()) { + return 1; + } else if (dMeter2Info_isTouchKeyCheck(0xE) && dMeter2Info_getMapStatus() != 6 && !isKeyCheck()) { + return 3; + } + } else { + if ((dMw_LEFT_TRIGGER() || (dMw_B_TRIGGER() && (!getZoomState() || (m_process == 0 && m_itemSubProcess == 0)))) && !isKeyCheck()) { + return 1; + } + #if (PLATFORM_GCN) + else if (dMw_RIGHT_TRIGGER() && !isKeyCheck()) { + return 2; + } + #endif + else if (dMeter2Info_isTouchKeyCheck(0xE) && dMeter2Info_getMapStatus() != 6 && !isKeyCheck()) { + return 3; + } + } + + return 0; } /* 801BF410-801BF464 1B9D50 0054+00 1/1 1/1 0/0 .text isSync__12dMenu_Dmap_cFv */ bool dMenu_Dmap_c::isSync() { - // NONMATCHING + if (mpDrawBg != NULL && (mpDrawBg->mpArchiveMount != NULL) && !mpDrawBg->mpArchiveMount->sync()) { + return false; + } + + if (mpDresArchiveMount != NULL && !mpDresArchiveMount->sync()) { + return false; + } + + return true; } /* 801BF464-801BF4A4 1B9DA4 0040+00 1/1 0/0 0/0 .text isKeyCheck__12dMenu_Dmap_cFv */ -void dMenu_Dmap_c::isKeyCheck() { - // NONMATCHING +bool dMenu_Dmap_c::isKeyCheck() { + if (!isSync()) { + return true; + } + + return field_0x185; } /* 801BF4A4-801BF528 1B9DE4 0084+00 1/0 0/0 0/0 .text infoModeChange_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::infoModeChange_init_proc() { - // NONMATCHING + field_0x10->hide(); + mSelFloor[getCurFloorPos()]->scaleAnimeStart(0); + mSelFloor[getCurFloorPos()]->alphaAnimeStart(0); + field_0x88[field_0x177]->scaleAnimeStart(0); } /* 801BF528-801BF688 1B9E68 0160+00 1/0 0/0 0/0 .text infoModeChange_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::infoModeChange_proc() { - // NONMATCHING + bool temp_r29 = mSelFloor[getCurFloorPos()]->scaleAnime(field_0x179, 1.0f, 0.9f, 0); + bool temp_r27 = mSelFloor[getCurFloorPos()]->alphaAnime(field_0x179, 0xFF, 0x80, 0); + bool temp_r28 = field_0x88[field_0x177]->scaleAnime(field_0x179, 0.9f, 1.0f, 0); + + if (temp_r29 == true && temp_r28 == true && temp_r27 == true) { + field_0x94->show(); + + Vec sp14 = field_0x7c[field_0x177]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp14.x + field_0x104, sp14.y, field_0x7c[field_0x177]->getPanePtr(), 0); + m_process = 0; + m_itemSubProcess = 0; + } + + iconMoveCalc(); } /* 801BF688-801BF70C 1B9FC8 0084+00 1/0 0/0 0/0 .text mapModeChange_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapModeChange_init_proc() { - // NONMATCHING + field_0x94->hide(); + mSelFloor[getCurFloorPos()]->scaleAnimeStart(0); + mSelFloor[getCurFloorPos()]->alphaAnimeStart(0); + field_0x88[field_0x177]->scaleAnimeStart(0); } /* 801BF70C-801BF8A0 1BA04C 0194+00 1/0 0/0 0/0 .text mapModeChange_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapModeChange_proc() { - // NONMATCHING + bool temp_r29 = mSelFloor[getCurFloorPos()]->scaleAnime(field_0x179, 0.9f, 1.0f, 0); + bool temp_r27 = mSelFloor[getCurFloorPos()]->alphaAnime(field_0x179, 0x80, 0xFF, 0); + bool temp_r28 = field_0x88[field_0x177]->scaleAnime(field_0x179, 1.0f, 0.9f, 0); + + if (temp_r29 == true && temp_r28 == true && temp_r27 == true) { + field_0x10->show(); + + Vec sp14 = mSelFloor[getDefaultCurFloorPos()]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp14.x + field_0x104, sp14.y, mSelFloor[getDefaultCurFloorPos()]->getPanePtr(), 1); + m_process = 1; + field_0x17d = 0; + + (this->*map_init_process[field_0x17d])(); + } + + iconMoveCalc(); } /* 801BF8A0-801BF8F8 1BA1E0 0058+00 1/0 0/0 0/0 .text lv5_talk_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::lv5_talk_init_proc() { - // NONMATCHING + field_0x185 = true; + dMsgObject_setTalkHeap(mpDrawBg->mpTalkHeap); + mpDrawBg->mMsgFlow.init(NULL, 0x202, 0, NULL); } /* 801BF8F8-801BF9D4 1BA238 00DC+00 1/0 0/0 0/0 .text lv5_talk_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::lv5_talk_proc() { - // NONMATCHING + u16 msg_status = dMsgObject_c::getStatus(); + if (msg_status == 15 || msg_status == 16) { + mpDrawBg->setAButtonString(0x408); + mpDrawBg->setBButtonString(0); + } else { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0); + } + + if (mpDrawBg->mMsgFlow.doFlow(NULL, NULL, 0)) { + if (POINTER_OPT == 0) { + if (mZoomState) { + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x522); + } else { + mpDrawBg->setAButtonString(0x527); + mpDrawBg->setBButtonString(0x3F9); + } + } + + m_process = 1; + } } /* 801BF9D4-801BF9E0 1BA314 000C+00 1/0 0/0 0/0 .text mapMode_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapMode_init_proc() { - // NONMATCHING + field_0x185 = false; } /* 801BF9E0-801BFA84 1BA320 00A4+00 1/0 0/0 0/0 .text mapMode_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::mapMode_proc() { - // NONMATCHING + u8 temp_r30 = field_0x17d; + if (mpDrawBg->field_0xdd4 == -99 && mpDrawBg->field_0xdd5 == 0xFF) { + mSelStick->checkTrigger(); + } + + (this->*floor_move_process[field_0x17d])(); + + if (field_0x17d != temp_r30) { + (this->*floor_init_process[field_0x17d])(); + } } /* 801BFA84-801BFA88 1BA3C4 0004+00 1/0 0/0 0/0 .text floorSelect_init_proc__12dMenu_Dmap_cFv */ -void dMenu_Dmap_c::floorSelect_init_proc() { - /* empty function */ -} +void dMenu_Dmap_c::floorSelect_init_proc() {} /* 801BFA88-801BFC78 1BA3C8 01F0+00 1/0 0/0 0/0 .text floorSelect_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::floorSelect_proc() { - // NONMATCHING + if (field_0x16d != field_0x16c) { + floorChangeMode(); + return; + } + + if (mSelStick->checkUpTrigger()) { + if (field_0x16c != mFloorAll) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_FLOOR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x16e = field_0x16c; + field_0x16c++; + field_0x16d = field_0x16c; + field_0x179 = mSelStick->getYwaitTimer(); + mMapCtrl->setPlusNowStayFloorNo(1, field_0x179); + field_0x17d = 1; + } + } else if (mSelStick->checkDownTrigger()) { + if (field_0x16c != mBottomFloor) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_FLOOR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x16e = field_0x16c; + field_0x16c -= 1; + field_0x16d = field_0x16c; + field_0x179 = mSelStick->getYwaitTimer(); + field_0x17d = 1; + mMapCtrl->setPlusNowStayFloorNo(-1, field_0x179); + } + } else if (mSelStick->checkLeftTrigger() && itemCarryCheck()) { + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + field_0x179 = mSelStick->getXwaitTimer(); + m_process = 2; + } } /* 801BFC78-801BFCAC 1BA5B8 0034+00 2/2 0/0 0/0 .text itemCarryCheck__12dMenu_Dmap_cFv */ -void dMenu_Dmap_c::itemCarryCheck() { - // NONMATCHING +int dMenu_Dmap_c::itemCarryCheck() { + int var_r29 = 0; + for (int i = 0; i < 3; i++) { + if (field_0x174[i] != 0) { + var_r29++; + } + } + + return var_r29; } /* 801BFCAC-801BFD5C 1BA5EC 00B0+00 1/0 0/0 0/0 .text floorChange_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::floorChange_init_proc() { - // NONMATCHING + field_0x10->hide(); + mSelFloor[getCurFloorPos()]->scaleAnimeStart(0); + mSelFloor[getFloorPos(field_0x16e)]->scaleAnimeStart(0); + mSelFloor[getCurFloorPos()]->alphaAnimeStart(0); + mSelFloor[getFloorPos(field_0x16e)]->alphaAnimeStart(0); } /* 801BFD5C-801BFF84 1BA69C 0228+00 1/0 0/0 0/0 .text floorChange_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::floorChange_proc() { - // NONMATCHING + bool temp_r29 = mSelFloor[getCurFloorPos()]->scaleAnime(field_0x179, 0.9f, 1.0f, 0); + bool temp_r28 = mSelFloor[getFloorPos(field_0x16e)]->scaleAnime(field_0x179, 1.0f, 0.9f, 0); + bool temp_r27 = mSelFloor[getCurFloorPos()]->alphaAnime(field_0x179, 0x80, 0xFF, 0); + bool temp_r26 = mSelFloor[getFloorPos(field_0x16e)]->alphaAnime(field_0x179, 0xFF, 0x80, 0); + + if (temp_r29 == true && temp_r28 == true && temp_r27 == true && temp_r26 == true) { + field_0x10->show(); + field_0x10->getPanePtr()->translate(mSelFloor[getCurFloorPos()]->getPanePtr()->getTranslateX(), + mSelFloor[getCurFloorPos()]->getPanePtr()->getTranslateY()); + + Vec sp14 = mSelFloor[getDefaultCurFloorPos()]->getGlobalVtxCenter(false, 0); + mpDrawBg->mpDrawCursor->setPos(sp14.x + field_0x104, sp14.y, mSelFloor[getDefaultCurFloorPos()]->getPanePtr(), 1); + field_0x17d = 0; + } + + iconMoveCalc(); } /* 801BFF84-801BFF88 1BA8C4 0004+00 1/0 0/0 0/0 .text zoomWait_init_proc__12dMenu_Dmap_cFv */ -void dMenu_Dmap_c::zoomWait_init_proc() { - /* empty function */ -} +void dMenu_Dmap_c::zoomWait_init_proc() {} /* 801BFF88-801C008C 1BA8C8 0104+00 1/0 0/0 0/0 .text zoomWait_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::zoomWait_proc() { - // NONMATCHING + if (m_process == 1) { + if (mDoCPd_c::getTrigA(PAD_1) && (((POINTER_OPT == 1 && mpDrawBg->field_0xdd3 != 0xFF) || POINTER_OPT == 0) && !dMeter2Info_isTouchKeyCheck(0xC))) { + if (!mZoomState && mMapCtrl->isEnableZoomIn()) { + field_0x17e = 1; + field_0x181 = 0; + return; + } + } else if (mDoCPd_c::getTrigB(PAD_1) && (POINTER_OPT == 1 || POINTER_OPT == 0) && !dMeter2Info_isTouchKeyCheck(0xC)) { + if (mZoomState && mMapCtrl->isEnableZoomOut()) { + field_0x17e = 2; + return; + } + + Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + } + } } /* 801C008C-801C01A0 1BA9CC 0114+00 1/0 0/0 0/0 .text zoomIn_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::zoomIn_init_proc() { - // NONMATCHING + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_ZOOMIN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + + if (mpDrawBg->field_0xdd3 != 0xFF) { + mMapCtrl->initZoomIn(10, mpDrawBg->field_0xdb4, mpDrawBg->field_0xdb8); + + if (field_0x182 != 0) { + field_0x182 = 0; + } + } else if (field_0x182 != 0) { + mMapCtrl->initZoomIn(10); + field_0x182 = 0; + } else { + mMapCtrl->initZoomInCenterHold(10); + } + + mpDrawBg->iconScaleAnmInit(0.0f, 1.0f, 10); + + field_0x184 = 1; + if (mMapCtrl->getDisableZoomMoveFlgX() == true && mMapCtrl->getDisableZoomMoveFlgZ() == true) { + field_0x184 = 0; + } + + mCMessageNum = 0; + mJMessageNum = 0; } /* 801C01A0-801C023C 1BAAE0 009C+00 1/0 0/0 0/0 .text zoomIn_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::zoomIn_proc() { - // NONMATCHING + bool temp_r30 = mMapCtrl->isEndZoomIn(); + bool temp_r29 = mpDrawBg->iconScaleAnm(); + bool temp_r28 = true; + + if (temp_r30 == true && temp_r29 == true && temp_r28 == true) { + mZoomState = 1; + mpDrawBg->setAButtonString(0); + mpDrawBg->setBButtonString(0x522); + mCMessageNum = 0x37B; + mJMessageNum = 0x569; + field_0x17e = 0; + } } /* 801C023C-801C02F0 1BAB7C 00B4+00 1/0 0/0 0/0 .text zoomOut_init_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::zoomOut_init_proc() { - // NONMATCHING + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_ZOOMOUT, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + mMapCtrl->initZoomOut(10); + mpDrawBg->iconScaleAnmInit(1.0f, 0.0f, 10); + + field_0x184 = 1; + if (mMapCtrl->getDisableZoomMoveFlgX() == true && mMapCtrl->getDisableZoomMoveFlgZ() == true) { + field_0x184 = 0; + } + + mCMessageNum = 0; + mJMessageNum = 0; } /* 801C02F0-801C0380 1BAC30 0090+00 1/0 0/0 0/0 .text zoomOut_proc__12dMenu_Dmap_cFv */ void dMenu_Dmap_c::zoomOut_proc() { - // NONMATCHING + bool temp_r30 = mMapCtrl->isEndZoomOut(); + bool temp_r29 = mpDrawBg->iconScaleAnm(); + bool temp_r28 = true; + + if (temp_r30 == true && temp_r29 == true && temp_r28 == true) { + mZoomState = 0; + mpDrawBg->setAButtonString(0x527); + mpDrawBg->setBButtonString(0x3F9); + mCMessageNum = 0; + mJMessageNum = 0; + field_0x17e = 0; + } } |
