From d19b7859e9585905a9bbcf024884179f4e125ef1 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 11 Nov 2023 17:29:26 -0500 Subject: [PATCH] d_stage progress + struct fixes --- include/d/d_com_inf_game.h | 12 +- include/d/d_drawlist.h | 2 + include/d/d_kankyo.h | 1 + include/d/d_stage.h | 154 +++++++++++------ include/f_op/f_op_actor_mng.h | 8 +- src/d/d_com_inf_game.cpp | 6 +- src/d/d_path.cpp | 4 +- src/d/d_s_room.cpp | 10 +- src/d/d_stage.cpp | 305 +++++++++++++++++++++++++--------- src/f_op/f_op_actor.cpp | 2 +- src/f_op/f_op_actor_mng.cpp | 18 +- 11 files changed, 375 insertions(+), 147 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 1da8bc5ec..bb5d6a98b 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1355,7 +1355,7 @@ inline void dComIfGp_setStageNameOff() { g_dComIfG_gameInfo.play.setStageNameOff(); } -inline s8 dComIfGp_getStartStageRoomNo() { +inline int dComIfGp_getStartStageRoomNo() { return g_dComIfG_gameInfo.play.getStartStageRoomNo(); } @@ -1507,7 +1507,7 @@ inline void dComIfGp_roomControl_init() { g_dComIfG_gameInfo.play.getRoomControl()->init(); } -inline dStage_roomStatus_c* dComIfGp_roomControl_getStatusRoomDt(int room_no) { +inline dStage_roomDt_c* dComIfGp_roomControl_getStatusRoomDt(int room_no) { return g_dComIfG_gameInfo.play.getRoomControl()->getStatusRoomDt(room_no); } @@ -1543,8 +1543,8 @@ inline void dComIfGp_roomControl_setTimePass(int isPassing) { g_dComIfG_gameInfo.play.getRoomControl()->SetTimePass(isPassing); } -inline int dComIfGp_roomControl_loadRoom(int param_0, u8* param_1) { - return g_dComIfG_gameInfo.play.getRoomControl()->loadRoom(param_0, param_1); +inline int dComIfGp_roomControl_loadRoom(int roomCount, u8* rooms) { + return g_dComIfG_gameInfo.play.getRoomControl()->loadRoom(roomCount, rooms); } inline dBgS* dComIfG_Bgsp() { @@ -2164,6 +2164,10 @@ inline s32 dComIfGd_getLightModelNum() { return g_dComIfG_gameInfo.drawlist.getLightModelNum(); } +inline void dComIfGd_setSpotModelColor(GXColor& color) { + g_dComIfG_gameInfo.drawlist.setSpotModelColor(color); +} + inline J3DDrawBuffer* dComIfGd_getOpaListP1() { return g_dComIfG_gameInfo.drawlist.getOpaListP1(); } diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 5730c6624..6f0ec136f 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -324,6 +324,7 @@ public: BOOL set(u8 type, Mtx mtx, u8 alpha); BOOL draw(Mtx); s32 getNum() { return mNum; } + void setColor(GXColor& color) { mColor = color; } public: /* 0x00 */ GXColor mColor; @@ -426,6 +427,7 @@ public: void setLightModel(u8 type, Mtx mtx, u8 alpha) { mpLightModel->set(type, mtx, alpha); } s32 getSpotModelNum() { return mpSpotModel->getNum(); } s32 getLightModelNum() { return mpLightModel->getNum(); } + void setSpotModelColor(GXColor& color) { mpSpotModel->setColor(color); } void setWindow(dDlst_window_c* pWindow) { mpWindow = pWindow; } void setViewPort(view_port_class* pViewPort) { mpViewPort = pViewPort; } diff --git a/include/d/d_kankyo.h b/include/d/d_kankyo.h index 21f65cb99..456e6aa7c 100644 --- a/include/d/d_kankyo.h +++ b/include/d/d_kankyo.h @@ -412,6 +412,7 @@ void dKy_fog_startendz_set(f32, f32, f32); BOOL dKy_daynight_check(); void dKy_tevstr_init(dKy_tevstr_c*, s8, u8); void dKy_Sound_init(); +void dKy_change_colset(u8 param_0, u8 param_1, f32 param_2); void dKy_change_colpat(u8 param_0); void dKy_custom_colset(u8 param_0, u8 param_1, f32 i_blend); u8 dKy_pship_existense_chk(); diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 41b15fea8..6894ddd73 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -7,8 +7,10 @@ #include "d/d_kankyo.h" #include "JSystem/JUtility/JUTAssert.h" #include "global.h" +#include "f_op/f_op_actor_mng.h" void dStage_SetErrorRoom(); +void dStage_SetErrorStage(); class JKRExpHeap; @@ -25,20 +27,24 @@ public: /* 0x1E */ color_RGB_class mKasumiMaeColor; }; -class stage_tresure_class { +class stage_tresure_data_class { public: /* 0x00 */ char mName[8]; - /* 0x08 */ u8 field_0x8; - /* 0x09 */ u8 mTypeFlag; - /* 0x0A */ u8 field_0xa; // part of flag - /* 0x0B */ u8 mAppearType; - /* 0x0C */ Vec mPosition; - /* 0x18 */ s16 mRoomNo; - /* 0x1A */ s16 mRotation; - /* 0x1C */ u8 mItem; - /* 0x1D */ u8 mFlagID; + /* 0x08 */ u32 mParameter; + /* 0x0C */ cXyz mSpawnPos; + /* 0x18 */ csXyz mAngle; + /* 0x1E */ u16 mSetId; + + stage_tresure_data_class() {} + ~stage_tresure_data_class() {} }; // Size: 0x20 +class stage_tresure_class { +public: + /* 0x00 */ int num; + /* 0x04 */ stage_tresure_data_class* m_entries; +}; + struct stage_stag_info_class { /* 0x00 */ f32 field_0x0; /* 0x04 */ f32 field_0x4; @@ -56,7 +62,7 @@ struct stage_scls_info_class { /* 0x0 */ char mStage[8]; /* 0x8 */ u8 mStart; /* 0x9 */ u8 mRoom; - /* 0xA */ s8 mWipe; + /* 0xA */ u8 mWipe; /* 0xB */ u8 field_0xb; }; @@ -171,10 +177,12 @@ public: /* 0x4 */ stage_actor_data_class* m_entries; }; -struct stage_tgsc_data_class : public stage_actor_data_class { - /* 0x20 */ u8 field_0x20; - /* 0x21 */ u8 field_0x21; - /* 0x22 */ u8 field_0x22; +class stage_tgsc_data_class : public stage_actor_data_class { +public: + fopAcM_prmScale_class mScale; + + stage_tgsc_data_class() {} + ~stage_tgsc_data_class() {} }; // Size: 0x24 class stage_tgsc_class { @@ -184,10 +192,10 @@ public: }; struct roomRead_data_class { - /* 0x0 */ u8 field_0x0; + /* 0x0 */ u8 mRoomCount; /* 0x1 */ u8 field_0x1; /* 0x2 */ u8 field_0x2; - /* 0x4 */ u8* field_0x4; + /* 0x4 */ u8* mpRooms; }; struct roomRead_class { @@ -423,7 +431,7 @@ public: /* vt[37] */ virtual void setPlightNumInfo(int i_plightNum) { mPlightInfoNum = i_plightNum; } /* vt[38] */ virtual int getPlightNumInfo() const { return mPlightInfoNum; } /* vt[39] */ virtual void setLightVecInfo(stage_lightvec_info_class*) { - dStage_SetErrorRoom(); + dStage_SetErrorStage(); OSReport("stage non LightVec data !!\n"); JUT_ASSERT(2380, 0); } @@ -433,7 +441,7 @@ public: return NULL; } /* vt[41] */ virtual void setLightVecInfoNum(int) { - dStage_SetErrorRoom(); + dStage_SetErrorStage(); OSReport("stage non LightVecNum data !!\n"); JUT_ASSERT(2391, 0); } @@ -459,7 +467,7 @@ public: /* vt[57] */ virtual void setEventInfo(dStage_EventInfo_c* i_eventInfo) { mpEventInfo = i_eventInfo; } /* vt[58] */ virtual dStage_EventInfo_c* getEventInfo() const { return mpEventInfo; } /* vt[59] */ virtual void setFileListInfo(dStage_FileList_dt_c*) { - dStage_SetErrorRoom(); + dStage_SetErrorStage(); OSReport("stage non filelist data!\n"); JUT_ASSERT(2490, 0); } @@ -475,7 +483,7 @@ public: /* vt[65] */ virtual void setMemoryMap(dStage_MemoryMap_c* i_map) { mpMemoryMap = i_map; } /* vt[66] */ virtual dStage_MemoryMap_c* getMemoryMap() const { return mpMemoryMap; } /* vt[67] */ virtual void setShip(dStage_Ship_c*) { - dStage_SetErrorRoom(); + dStage_SetErrorStage(); OSReport("stage non SHIP data!\n"); JUT_ASSERT(2561, 0); } @@ -487,7 +495,7 @@ public: /* vt[69] */ virtual void setMulti(dStage_Multi_c* i_multi) { mpMulti = i_multi; } /* vt[70] */ virtual dStage_Multi_c* getMulti() const { return mpMulti; } /* vt[71] */ virtual void setLbnk(dStage_Lbnk_c*) { - dStage_SetErrorRoom(); + dStage_SetErrorStage(); OSReport("stage non Lbnk data!\n"); JUT_ASSERT(2590, 0); } @@ -773,20 +781,24 @@ public: class dStage_darkStatus_c { public: - // name to offset relation is guessed based on debug map - // may need to be fixed - - /* 0x00 */ u8 mRatio; - /* 0x01 */ u8 mNonAlpha[2]; - /* 0x04 */ f32 mNonScale[2]; + /* 0x00 */ u8 mEnvAlpha; + /* 0x01 */ u8 mBokoAlpha[2]; + /* 0x04 */ f32 mBokoScale[2]; /* 0x0C */ int field_0xc; - /* 0x10 */ int field_0x10[2]; - /* 0x18 */ int field_0x18[2]; + /* 0x10 */ f32 field_0x10[2]; + /* 0x18 */ f32 field_0x18[2]; + + u8 getEnvAlpha() const { return mEnvAlpha; } + u8 getBokoAlpha(int i) const { return mBokoAlpha[i]; } + f32 getBokoScale(int i) const { return mBokoScale[i]; } + // void getNonAlpha(int i) const {} + // void getNonScale(int i) const {} }; class dBgW; -class dStage_roomStatus_c : public dStage_roomDt_c { +class dStage_roomStatus_c { public: + /* 0x000 */ dStage_roomDt_c mRoomDt; /* 0x054 */ dKy_tevstr_c mTevStr; /* 0x104 */ u8 mFlags; /* 0x105 */ bool mDraw; @@ -796,7 +808,6 @@ public: /* 0x10C */ int mProcID; /* 0x110 */ dBgW* mpBgW; - int getZoneNo() const { return mZoneNo; } ~dStage_roomStatus_c() {} dStage_roomStatus_c() {} }; // Size: 0x114 @@ -808,7 +819,7 @@ public: dStage_roomControl_c() {} void init(); - dStage_roomStatus_c* getStatusRoomDt(int); + dStage_roomDt_c* getStatusRoomDt(int); bool checkRoomDisp(int) const; int loadRoom(int, u8*); void zoneCountCheck(int) const; @@ -823,10 +834,9 @@ public: static JKRExpHeap* getMemoryBlock(int); static void setStayNo(int); static s32 GetTimePass(); - static void setZoneNo(int i_roomNo, int i_zoneNo) { - mStatus[i_roomNo].mZoneNo = i_zoneNo; - } + static void setZoneNo(int i_roomNo, int i_zoneNo) { mStatus[i_roomNo].mZoneNo = i_zoneNo; } static int getZoneNo(int i_roomNo); + static void setZoneCount(int i_roomNo, int count) { mStatus[i_roomNo].mZoneCount = count; } static s8 getStayNo() { return mStayNo; } static s8 getMemoryBlockID(int i_roomNo) { return mStatus[i_roomNo].mMemBlockID; } @@ -839,6 +849,8 @@ public: static int getStatusProcID(int i_roomNo) { return mStatus[i_roomNo].mProcID; } static dStage_darkStatus_c& getDarkStatus(int i_idx) { return mDarkStatus[i_idx]; } static char* getDemoArcName() { return mDemoArcName; } + static u8 getDarkRatio() { return mDarkRatio; } + static u8* getDarkRatio_p() { return &mDarkRatio; } static void setMemoryBlockID(int i_roomNo, int i_blockID) { mStatus[i_roomNo].mMemBlockID = i_blockID; @@ -846,14 +858,8 @@ public: static void setBgW(int i_roomNo, dBgW* i_bgw) { mStatus[i_roomNo].mpBgW = i_bgw; } - BOOL checkStatusFlag(int i_roomNo, u8 flag) const { - return cLib_checkBit(mStatus[i_roomNo].mFlags, flag); - } - - void offStatusFlag(int i_roomNo, u8 flag) { - cLib_offBit(mStatus[i_roomNo].mFlags, flag); - } - + BOOL checkStatusFlag(int i_roomNo, u8 flag) const { return cLib_checkBit(mStatus[i_roomNo].mFlags, flag); } + void offStatusFlag(int i_roomNo, u8 flag) { cLib_offBit(mStatus[i_roomNo].mFlags, flag); } void onStatusFlag(int i_roomNo, u8 flag) { return cLib_onBit(mStatus[i_roomNo].mFlags, flag); } static JKRExpHeap* mMemoryBlock[16]; @@ -901,6 +907,24 @@ private: /* 0xD */ s8 mWipe; }; // Size: 0xE +class dStage_KeepTresureInfo { +public: + /* 0x00 */ int num; + /* 0x04 */ stage_tresure_data_class mTresureData[0x20]; + + dStage_KeepTresureInfo() {} + ~dStage_KeepTresureInfo() {} +}; + +class dStage_KeepDoorInfo { +public: + /* 0x00 */ int num; + /* 0x04 */ stage_tgsc_data_class mDrTgData[0x40]; + + dStage_KeepDoorInfo() {} + ~dStage_KeepDoorInfo() {} +}; + // unknown name struct dStage_objectNameInf { char mName[8]; @@ -967,7 +991,11 @@ inline u8 dStage_stagInfo_getStartSch(stage_stag_info_class* p_info) { // dStage_stagInfo_ChkKeyDisp__FP21stage_stag_info_class inline u8 dStage_roomRead_dt_c_GetLoadRoomIndex(u8 param_0) { - return param_0 & 0x3f; + return param_0 & 0x3F; +} + +inline u8 dStage_roomRead_dt_c_ChkBg(u8 param_0) { + return param_0 & 0x80; } inline u8 dStage_roomRead_dt_c_GetReverb(roomRead_data_class& room) { @@ -975,11 +1003,11 @@ inline u8 dStage_roomRead_dt_c_GetReverb(roomRead_data_class& room) { } inline s32 dStage_roomRead_dt_c_GetTimePass(roomRead_data_class& data) { - return data.field_0x2 & 3; + return data.field_0x2 & 0x03; } inline s32 dStage_sclsInfo_getWipe(stage_scls_info_class* p_info) { - return p_info->mWipe; + return p_info->mWipe & 0xF; } inline int dStage_FileList_dt_ChkPathWindEffect(dStage_FileList_dt_c* i_fili) { @@ -994,6 +1022,38 @@ inline f32 dStage_FileList_dt_SeaLevel(dStage_FileList_dt_c* i_fili) { return i_fili->mSeaLevel; } +// inline u8 dStage_FileList_dt_PhotoDepth(dStage_FileList_dt_c* i_fili) { + // maybe 0x00007F80? +// } + +inline s32 dStage_FileList_dt_CheckDarkOn(dStage_FileList_dt_c* i_fili) { + return i_fili->mParam & 1; +} + +inline u8 dStage_FileList_dt_DarkNo(dStage_FileList_dt_c* i_fili) { + return (i_fili->mParam & 0x78) >> 3; +} + +// inline u8 dStage_FileList_dt_CheckAgbCom(dStage_FileList_dt_c* i_fili) { + +// } + +// inline u8 dStage_FileList_dt_CheckAgbHover(dStage_FileList_dt_c* i_fili) { + +// } + +// inline u8 dStage_FileList_dt_GetSongOk(dStage_FileList_dt_c* i_fili) { + // maybe 0x40000000? +// } + +// inline u8 dStage_FileList_dt_GetToonsw(dStage_FileList_dt_c* i_fili) { + +// } + +// inline u8 dStage_FileList_dt_GetParticleNo(dStage_FileList_dt_c* i_fili) { + // 0x1FE00000 +// } + bool dStage_chkPlayerId(int playerId, int room_no); int dStage_changeScene(int i_exitId, f32 speed, u32 mode, s8 room_no); diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 5117ee8d6..a91626cbd 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -25,12 +25,18 @@ struct fopAcM_prmBase_class { /* 0x16 */ u16 field_0x16; }; // Size = 0x18 +struct fopAcM_prmScale_class { + u8 x; + u8 y; + u8 z; +}; + struct fopAcM_prm_class { /* 0x00 */ u32 mParameter; // single U32 Parameter /* 0x04 */ cXyz mPos; /* 0x10 */ csXyz mAngle; // rotation /* 0x16 */ u16 mSetId; - /* 0x18 */ u8 mScale[3]; + /* 0x18 */ fopAcM_prmScale_class mScale; /* 0x1B */ u8 mGbaName; /* 0x1C */ s32 mParentPcId; // parent process ID /* 0x20 */ s8 mSubtype; diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index afab328fa..633ddb22f 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -561,7 +561,7 @@ int dComIfGd_setSimpleShadow2(cXyz* i_pos, f32 param_1, f32 param_2, cBgS_PolyIn /* 800535B8-80053678 .text dComIfGp_getShip__Fii */ dStage_Ship_data* dComIfGp_getShip(int i_roomNo, int param_1) { - dStage_roomStatus_c* roomSt_p = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); + dStage_roomDt_c* roomSt_p = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); if (roomSt_p == NULL) { return NULL; } @@ -610,7 +610,7 @@ bool dComIfGp_getMapTrans(int i_roomNo, f32* o_transX, f32* o_transY, s16* o_ang /* 80053728-80053778 .text dComIfGp_getRoomCamera__Fi */ stage_camera_class* dComIfGp_getRoomCamera(int i_roomNo) { - dStage_roomStatus_c* status = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); + dStage_roomDt_c* status = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); if (status == NULL) { return NULL; @@ -621,7 +621,7 @@ stage_camera_class* dComIfGp_getRoomCamera(int i_roomNo) { /* 80053778-800537C8 .text dComIfGp_getRoomArrow__Fi */ stage_arrow_class* dComIfGp_getRoomArrow(int i_roomNo) { - dStage_roomStatus_c* status = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); + dStage_roomDt_c* status = dComIfGp_roomControl_getStatusRoomDt(i_roomNo); if (status == NULL) { return NULL; diff --git a/src/d/d_path.cpp b/src/d/d_path.cpp index d6bb786f5..d2185673b 100644 --- a/src/d/d_path.cpp +++ b/src/d/d_path.cpp @@ -25,7 +25,7 @@ dPath* dPath_GetRoomPath(int path_index, int room_no) { pd = dComIfGp_getStage().getPath2Inf(); } else { JUT_ASSERT(0x3d, 0 <= room_no && room_no < 64); - dStage_roomStatus_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); + dStage_roomDt_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); if (pRoom == NULL) return NULL; pd = pRoom->getPath2Inf(); @@ -43,7 +43,7 @@ dPath* dPath_GetNextRoomPath(dPath* path, int room_no) { if (room_no == -1) { pd = dComIfGp_getStage().getPath2Inf(); } else { - dStage_roomStatus_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); + dStage_roomDt_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); if (pRoom == NULL) return NULL; pd = pRoom->getPath2Inf(); diff --git a/src/d/d_s_room.cpp b/src/d/d_s_room.cpp index 1ccd84139..ed44a1c48 100644 --- a/src/d/d_s_room.cpp +++ b/src/d/d_s_room.cpp @@ -23,7 +23,7 @@ class room_of_scene_class : public scene_class { public: /* 0x1C4 */ request_of_phase_process_class mPhs; /* 0x1CC */ void * mpRoomData; - /* 0x1D0 */ dStage_roomStatus_c * mpRoomStatus; + /* 0x1D0 */ dStage_roomDt_c * mpRoomDt; /* 0x1D4 */ mDoDvdThd_toMainRam_c * sceneCommand; /* 0x1D8 */ bool mbHasRoomParticle; /* 0x1D9 */ bool mbReLoaded; @@ -79,7 +79,7 @@ void objectSetCheck(room_of_scene_class* i_this) { if (!i_this->mbReLoaded) { if (!hiddenFlag) { fopAcM_create(PROC_BG, roomNo, NULL, -1, NULL, NULL, 0xFF, NULL); - dStage_dt_c_roomReLoader(i_this->mpRoomData, i_this->mpRoomStatus, roomNo); + dStage_dt_c_roomReLoader(i_this->mpRoomData, i_this->mpRoomDt, roomNo); i_this->mbReLoaded = true; } } else { @@ -207,12 +207,12 @@ s32 phase_2(room_of_scene_class* i_this) { dComIfGp_roomControl_setZoneNo(roomNo, zoneNo); } - i_this->mpRoomStatus = dComIfGp_roomControl_getStatusRoomDt(roomNo); - i_this->mpRoomStatus->mRoomNo = roomNo; + i_this->mpRoomDt = dComIfGp_roomControl_getStatusRoomDt(roomNo); + i_this->mpRoomDt->mRoomNo = roomNo; i_this->mpRoomData = dComIfG_getStageRes(arcName, "room.dzr"); if (i_this->mpRoomData != NULL) { - dStage_dt_c_roomLoader(i_this->mpRoomData, i_this->mpRoomStatus); + dStage_dt_c_roomLoader(i_this->mpRoomData, i_this->mpRoomDt); if (dStage_roomControl_c::mDemoArcName[0] == '\0') { dStage_Lbnk_c * lbnk = dComIfGp_roomControl_getStatusRoomDt(roomNo)->getLbnk(); if (lbnk != NULL) { diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 67e9c328d..0ab895eaa 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -20,6 +20,23 @@ #include "f_op/f_op_kankyo_mng.h" #include "f_op/f_op_msg_mng.h" #include "f_op/f_op_scene_mng.h" +#include "m_Do/m_Do_mtx.h" + +const char dummy_4720[13][8] = { + "ACTR", + "ACT0", + "ACT1", + "ACT2", + "ACT3", + "ACT4", + "ACT5", + "ACT6", + "ACT7", + "ACT8", + "ACT9", + "ACTa", + "ACTb", +}; /* 80040900-80040938 .text set__18dStage_nextStage_cFPCcScsScSc */ void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i_layer, s8 i_wipe) { @@ -36,13 +53,7 @@ void dStage_SetErrorRoom() {} /* 8004093C-80040940 .text dStage_SetErrorStage__Fv */ void dStage_SetErrorStage() {} -class dStage_KeepTresureInfo { - u8 unk[0x404]; -}; - -class dStage_KeepDoorInfo { - u8 unk[0x904]; -}; +Vec dummy; dStage_KeepTresureInfo TresureInfo; dStage_KeepDoorInfo DoorInfo; @@ -57,15 +68,64 @@ dStage_KeepDoorInfo * dStage_GetKeepDoorInfo() { return &DoorInfo; } -/* 80040958-80040A78 .text dStage_KeepTresureInfoProc__FP11dStage_dt_cP19stage_tresure_class - */ -void dStage_KeepTresureInfoProc(dStage_dt_c*, stage_tresure_class*) { - /* Nonmatching */ +/* 80040958-80040A78 .text dStage_KeepTresureInfoProc__FP11dStage_dt_cP19stage_tresure_class */ +void dStage_KeepTresureInfoProc(dStage_dt_c* i_stage, stage_tresure_class* i_tresure) { + stage_stag_info_class* stagInfo = i_stage->getStagInfo(); + if (stagInfo == NULL) { + return; + } + u32 stageType = dStage_stagInfo_GetSTType(stagInfo); + if (stageType == 3 || stageType == 6) { + // Boss or miniboss room. + return; + } + if (i_tresure == NULL) { + TresureInfo.num = 0; + return; + } + if (i_tresure->num >= (int)ARRAY_SIZE(TresureInfo.mTresureData) || i_tresure->num < 0) { + TresureInfo.num = 0; + return; + } + TresureInfo.num = i_tresure->num; + if (TresureInfo.num == 0) { + return; + } + stage_tresure_data_class* pSrcEntry = i_tresure->m_entries; + stage_tresure_data_class* pDstEntry = TresureInfo.mTresureData; + for (int i = 0; i < TresureInfo.num; pDstEntry++, pSrcEntry++, i++) { + *pDstEntry = *pSrcEntry; + } } /* 80040A78-80040BA8 .text dStage_KeepDoorInfoProc__FP11dStage_dt_cP16stage_tgsc_class */ -void dStage_KeepDoorInfoProc(dStage_dt_c*, stage_tgsc_class*) { - /* Nonmatching */ +void dStage_KeepDoorInfoProc(dStage_dt_c* i_stage, stage_tgsc_class* i_drtg) { + stage_stag_info_class* stagInfo = i_stage->getStagInfo(); + if (stagInfo == NULL) { + return; + } + u32 stageType = dStage_stagInfo_GetSTType(stagInfo); + if (stageType == 3 || stageType == 6) { + // Boss or miniboss room. + return; + } + if (i_drtg == NULL) { + DoorInfo.num = 0; + return; + } + if (i_drtg->num >= (int)ARRAY_SIZE(DoorInfo.mDrTgData) || i_drtg->num < 0) { + DoorInfo.num = 0; + return; + } + DoorInfo.num = i_drtg->num; + if (DoorInfo.num == 0) { + return; + } + stage_tgsc_data_class* pSrcEntry = i_drtg->m_entries; + stage_tgsc_data_class* pDstEntry = DoorInfo.mDrTgData; + for (int i = 0; i < DoorInfo.num; pDstEntry++, pSrcEntry++, i++) { + *pDstEntry = *pSrcEntry; + } } /* 80040BA8-80040BF4 .text set__19dStage_startStage_cFPCcScsSc */ @@ -76,17 +136,6 @@ void dStage_startStage_c::set(const char* i_name, s8 i_roomNo, s16 i_point, s8 i mLayer = i_layer; } -dStage_roomStatus_c dStage_roomControl_c::mStatus[64]; -JKRExpHeap* dStage_roomControl_c::mMemoryBlock[16]; -dStage_darkStatus_c dStage_roomControl_c::mDarkStatus[8]; - -u32 dStage_roomControl_c::mProcID; -s8 dStage_roomControl_c::mStayNo; -s8 dStage_roomControl_c::mOldStayNo; -u8 dStage_roomControl_c::mDarkRatio; -char dStage_roomControl_c::mDemoArcName[8]; -s8 dStage_roomControl_c::m_time_pass; - /* 80040BF4-80040D0C .text init__20dStage_roomControl_cFv */ void dStage_roomControl_c::init() { mStayNo = -1; @@ -98,7 +147,7 @@ void dStage_roomControl_c::init() { dStage_roomStatus_c* status = mStatus; for (int i = 0; i < 64; i++) { - status->init(); + status->mRoomDt.init(); setStatusFlag(i, 0); status->mDraw = false; @@ -121,11 +170,11 @@ void dStage_roomControl_c::init() { } /* 80040D0C-80040D38 .text getStatusRoomDt__20dStage_roomControl_cFi */ -dStage_roomStatus_c* dStage_roomControl_c::getStatusRoomDt(int i_statusIdx) { +dStage_roomDt_c* dStage_roomControl_c::getStatusRoomDt(int i_statusIdx) { if (i_statusIdx < 0 || i_statusIdx >= 0x40) { return NULL; } - return &mStatus[i_statusIdx]; + return &mStatus[i_statusIdx].mRoomDt; } /* 80040D38-80040D70 .text getMemoryBlock__20dStage_roomControl_cFi */ @@ -151,12 +200,12 @@ void dStage_roomControl_c::setStayNo(int i_roomNo) { } /* 80040DA8-80040DDC .text stayRoomCheck__FiPUci */ -int stayRoomCheck(int param_0, u8* param_1, int param_2) { - for (; param_0 > 0; param_0--) { - if (param_2 == dStage_roomRead_dt_c_GetLoadRoomIndex(*param_1)) { +int stayRoomCheck(int roomCount, u8* rooms, int roomNo) { + for (; roomCount > 0; roomCount--) { + if (roomNo == dStage_roomRead_dt_c_GetLoadRoomIndex(*rooms)) { return 1; } - param_1++; + rooms++; } return 0; } @@ -182,8 +231,39 @@ bool dStage_roomControl_c::checkRoomDisp(int i_roomNo) const { } /* 80040E6C-80040FD8 .text loadRoom__20dStage_roomControl_cFiPUc */ -int dStage_roomControl_c::loadRoom(int, u8*) { - /* Nonmatching */ +int dStage_roomControl_c::loadRoom(int roomCount, u8* rooms) { + for (int roomNo = 0; roomNo < ARRAY_SIZE(mStatus); roomNo++) { + if (dStage_roomControl_c::checkStatusFlag(roomNo, 0x02 | 0x04)) { + return 0; + } + } + + BOOL r26 = TRUE; + for (int roomNo = 0; roomNo < (int)ARRAY_SIZE(mStatus); roomNo++) { + if (dStage_roomControl_c::checkStatusFlag(roomNo, 0x01)) { + if (!stayRoomCheck(roomCount, rooms, roomNo)) { + dStage_roomControl_c::onStatusFlag(roomNo, 0x04); + r26 = FALSE; + } + } + } + if (!r26) { + return FALSE; + } + + for (int i = 0; i < roomCount; i++) { + u8 roomNo = dStage_roomRead_dt_c_GetLoadRoomIndex(rooms[i]); + dStage_roomControl_c::setZoneCount(roomNo, 2); + if (!dStage_roomControl_c::checkStatusFlag(roomNo, 0x01)) { + if (createRoomScene(roomNo)) { + u8 flag = dStage_roomRead_dt_c_ChkBg(rooms[i]) ? 0x02 : 0x0A; + dStage_roomControl_c::onStatusFlag(roomNo, flag); + } + return TRUE; + } + } + + return TRUE; } /* 80040FD8-800410AC .text zoneCountCheck__20dStage_roomControl_cCFi */ @@ -208,26 +288,81 @@ void dStage_roomControl_c::zoneCountCheck(int i_roomNo) const { /* 800410AC-800412EC .text checkDrawArea__20dStage_roomControl_cCFv */ void dStage_roomControl_c::checkDrawArea() const { - /* Nonmatching */ + if (mStayNo < 0) { + return; + } + fopAc_ac_c* player = dComIfGp_getPlayer(0); + if (player == NULL) { + return; + } + + dStage_roomStatus_c * pRoomStatus = &mStatus[mStayNo]; + dStage_FileList_dt_c* plist_p = pRoomStatus->mRoomDt.mpFileList; + BOOL darkOn; + u8 targetRatio = 0xFF; + if (plist_p == NULL) { + return; + } + dStage_darkStatus_c& darkStatus = dStage_roomControl_c::getDarkStatus(dStage_FileList_dt_DarkNo(plist_p)); + darkOn = dStage_FileList_dt_CheckDarkOn(plist_p); + if (darkOn) { + targetRatio = darkStatus.getEnvAlpha(); + } + cLib_chaseUC(dStage_roomControl_c::getDarkRatio_p(), targetRatio, 8); + u8 darkRatio = dStage_roomControl_c::getDarkRatio(); + if (darkRatio == 0xFF) { + return; + } + f32 ratio = darkRatio / 128.0f; + if (ratio > 1.0f) { + ratio = 1.0f; + } + if (darkOn) { + if (targetRatio == darkRatio) { + dKy_change_colset(0, 4, 1.0f - ratio); + } + } else { + dKy_change_colset(4, 0, ratio); + } + + cXyz bokoFlamePos; + if (daPy_getPlayerActorClass()->getBokoFlamePos(&bokoFlamePos)) { + return; + } + + static cXyz l_offset(0.0f, 60.0f, 0.0f); + static GXColor l_spotColor = {0x00, 0x00, 0x00, 0xFF}; + l_spotColor.a = dStage_roomControl_c::getDarkRatio(); + dComIfGd_setSpotModelColor(l_spotColor); + cXyz pos; + cLib_offsetPos(&pos, &player->current.pos, player->shape_angle.y, &l_offset); + + static Mtx l_m[2]; + for (int i = 0; i < 2; i++) { + mDoMtx_stack_c::transS(pos); + f32 scale = darkStatus.getBokoScale(i); + mDoMtx_stack_c::scaleM(scale, scale, scale); + cMtx_copy(mDoMtx_stack_c::get(), l_m[i]); + dComIfGd_setSpotModel(0, l_m[i], darkStatus.getBokoAlpha(i)); + } } /* 800412EC-80041330 .text getDarkStatus__20dStage_roomControl_cFv */ -// NONMATCHING dStage_darkStatus_c* dStage_roomControl_c::getDarkStatus() { dStage_roomStatus_c * pRoomStatus = &mStatus[mStayNo]; - dStage_FileList_dt_c* plist_p = pRoomStatus->mpFileList; + dStage_FileList_dt_c* plist_p = pRoomStatus->mRoomDt.mpFileList; if (plist_p == NULL) return NULL; - // pointer math here seems wrong... - return &mDarkStatus[(plist_p->mParam & 0x78) >> 3]; + int idx = (plist_p->mParam & 0x78) >> 3; + return &mDarkStatus[idx]; } /* 80041330-80041370 .text getDarkMode__20dStage_roomControl_cFv */ u32 dStage_roomControl_c::getDarkMode() { dStage_roomStatus_c * pRoomStatus = &mStatus[mStayNo]; - dStage_FileList_dt_c* plist_p = pRoomStatus->mpFileList; + dStage_FileList_dt_c* plist_p = pRoomStatus->mRoomDt.mpFileList; u8 mode = 0; if (plist_p != NULL && (plist_p->mParam & 1) != 0) @@ -1213,6 +1348,11 @@ int dStage_cameraCreate(stage_camera2_data_class* i_cameraData, int i_cameraIdx, /* 80041708-8004184C .text dStage_decodeSearchIkada__FPvi */ void dStage_decodeSearchIkada(void*, int) { /* Nonmatching */ + static const char* x = "ikada_h"; + static const char* y = "ikada_u"; + static const char* z = "ikadaS"; + int ikada_data = 0; + JUT_ASSERT(0, ikada_data != 0); } /* 8004184C-800419D0 .text dStage_playerInitIkada__FP16fopAcM_prm_classPv */ @@ -1243,7 +1383,7 @@ bool dStage_chkPlayerId(int playerId, int room_no) { } /* 80041AF4-80041E84 .text dStage_playerInit__FP11dStage_dt_cPviPv */ -int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* param_3) { +int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* i_file) { stage_actor_class* player = (stage_actor_class*)((int*)i_data + 1); stage_actor_data_class* player_data = player->m_entries; @@ -1260,7 +1400,7 @@ int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* param_3 int point = dComIfGp_getStartStagePoint(); u32 roomParam = dComIfGs_getRestartRoomParam(); if (point == -2) { - dStage_playerInitIkada(appen, param_3); + dStage_playerInitIkada(appen, i_file); } else if (point == -3) { appen->mParameter = dComIfGs_getTurnRestartParam(); appen->mPos = dComIfGs_getTurnRestartPos(); @@ -1346,7 +1486,6 @@ int dStage_mapInfo_GetOceanX(stage_map_info_class* i_mapInfo) { } /* 80041F54-80041F6C .text dStage_mapInfo_GetOceanZ__FP20stage_map_info_class */ -// NONMATCHING int dStage_mapInfo_GetOceanZ(stage_map_info_class* i_mapInfo) { int rt = (i_mapInfo->mOceanXZ >> 4) & 0x0F; if (rt & 8) @@ -1532,9 +1671,7 @@ int dStage_tgscInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { appen->mAngle = actor_data->mAngle; appen->mSetId = actor_data->mSetId; appen->mRoomNo = i_stage->getRoomNo(); - appen->mScale[0] = actor_data->field_0x20; - appen->mScale[1] = actor_data->field_0x21; - appen->mScale[2] = actor_data->field_0x22; + appen->mScale = actor_data->mScale; dStage_actorCreate(actor_data, appen); } actor_data++; @@ -1545,16 +1682,14 @@ int dStage_tgscInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { /* 8004259C-80042628 .text dStage_roomReadInit__FP11dStage_dt_cPviPv */ int dStage_roomReadInit(dStage_dt_c* i_stage, void* i_data, int i_num, void* i_file) { - // logic is bad - dStage_nodeHeader* room_info = (dStage_nodeHeader*)(i_data); - roomRead_class* pRoom = (roomRead_class*)room_info->m_offset; - i_stage->setRoom(pRoom); + roomRead_class* rtbl = (roomRead_class*)((int*)i_data + 1); + roomRead_data_class** rtbl_entries = rtbl->m_entries; + i_stage->setRoom(rtbl); - roomRead_data_class ** ppEntry = pRoom->m_entries; - for (s32 i = 0; i < room_info->m_entryNum; i++, ppEntry++) { - // (u8*)(*ppEntry) = (u8*)(i_file) + (u32)ppEntry; - roomRead_data_class * pEntry = *ppEntry; - pEntry->field_0x4 = (u8*)(i_file) + ((u32)pEntry->field_0x4); + for (int i = 0; i < rtbl->num; i++) { + rtbl_entries[i] = (roomRead_data_class*)((u32)i_file + (u32)rtbl_entries[i]); + roomRead_data_class * pEntry = rtbl_entries[i]; + rtbl_entries[i]->mpRooms = (u8*)((u32)i_file + (u32)rtbl_entries[i]->mpRooms); } return 1; @@ -1581,8 +1716,8 @@ int dStage_pathInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { dPath* pPath = pStagePath->m_path; i_stage->setPathInfo(pStagePath); - for (s32 i = 0; i < pStagePath->num; i++, pPath++) - *(u32*)pPath->mpPnt += (u32)i_stage->getPntInf(); + for (s32 i = 0; i < pStagePath->num; pPath++, i++) + pPath->mpPnt = (dPath__Point*)((u32)*((int*)i_stage->getPntInf()+1) + (u32)pPath->mpPnt); // TODO clean this up return 1; } @@ -1594,7 +1729,13 @@ int dStage_rppnInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { /* 80042750-800427E0 .text dStage_rpatInfoInit__FP11dStage_dt_cPviPv */ int dStage_rpatInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { - /* Nonmatching */ + dStage_dPath_c* pStagePath = (dStage_dPath_c*)((char*)i_data + 4); + dPath* pPath = pStagePath->m_path; + + i_stage->setPath2Info(pStagePath); + for (s32 i = 0; i < pStagePath->num; pPath++, i++) + pPath->mpPnt = (dPath__Point*)((u32)*((int*)i_stage->getPnt2Inf()+1) + (u32)pPath->mpPnt); // TODO clean this up + return 1; } /* 800427E0-80042814 .text dStage_soundInfoInit__FP11dStage_dt_cPviPv */ @@ -1652,10 +1793,10 @@ int dStage_mecoInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { /* 800429C0-80042B10 .text dStage_setShipPos__Fii */ // NONMATCHING - close -bool dStage_setShipPos(int param_0, int param_1) { +bool dStage_setShipPos(int param_0, int i_roomNo) { if (strcmp(dComIfGp_getStartStageName(), "GanonM") == 0 && !dComIfGs_isEventBit(0x3D02)) { param_0 = 0xFF; - param_1 = 0xFF; + i_roomNo = 0xFF; dComIfGp_setShipId(0xFF); dComIfGp_setShipRoomId(0xFF); } @@ -1674,11 +1815,8 @@ bool dStage_setShipPos(int param_0, int param_1) { } if (param_0 != 0xFF) { - if (param_1 == 0xFF) { - param_1 = dComIfGp_roomControl_getStayNo(); - } - - dStage_Ship_data* ship_data_p = dComIfGp_getShip(param_1, param_0); + i_roomNo = i_roomNo == 0xFF ? dComIfGp_roomControl_getStayNo() : i_roomNo; + dStage_Ship_data* ship_data_p = dComIfGp_getShip(i_roomNo, param_0); if (ship_data_p != NULL) { daShip_c* ship_p = (daShip_c*)fopAcM_SearchByName(PROC_SHIP); if (ship_p != NULL) { @@ -1985,7 +2123,6 @@ void dStage_infoCreate() { } /* 800432EC-80043464 .text dStage_Create__Fv */ -// NONMATCHING - regalloc / string offsets void dStage_Create() { dKankyo_create(); @@ -2012,10 +2149,10 @@ void dStage_Create() { } /* 80043464-80043514 .text dStage_Delete__Fv */ -// NONMATCHING - almost void dStage_Delete() { - if (*dStage_roomControl_c::getDemoArcName() != 0) { - dComIfG_deleteObjectRes(dStage_roomControl_c::getDemoArcName()); + char* demoArcName = dStage_roomControl_c::getDemoArcName(); + if (*demoArcName != 0) { + dComIfG_deleteObjectRes(demoArcName); } dStage_roomControl_c::destroyMemoryBlock(); @@ -2050,7 +2187,7 @@ int dStage_RoomCheck(cBgS_GndChk* i_gndChk) { dComIfGp_roomControl_setTimePass(timePass); roomRead_data_class* room_data = room->m_entries[roomReadId]; - return dComIfGp_roomControl_loadRoom(room_data->field_0x0, room_data->field_0x4); + return dComIfGp_roomControl_loadRoom(room_data->mRoomCount, room_data->mpRooms); } return 1; @@ -2061,11 +2198,11 @@ void dStage_roomControl_c::SetTimePass(int i_timepass) { m_time_pass = i_timepass; } -static inline s8 IkadaGetRoomNoArg0(fopAc_ac_c* i_actor) { +static inline u8 IkadaGetRoomNoArg0(fopAc_ac_c* i_actor) { return (fopAcM_GetParam(i_actor) >> 4) & 0x3F; } -static inline s16 IkadaGetLinkIdArg1(fopAc_ac_c* i_actor) { +static inline u8 IkadaGetLinkIdArg1(fopAc_ac_c* i_actor) { return (fopAcM_GetParam(i_actor) >> 10) & 0xFF; } @@ -2074,7 +2211,6 @@ static inline u8 IkadaGetIkadaIdArg2(fopAc_ac_c* i_actor) { } /* 8004360C-80043900 .text dStage_changeSceneExitId__FR13cBgS_PolyInfofUlSc */ -// NONMATCHING - regalloc / extra extsh int dStage_changeSceneExitId(cBgS_PolyInfo& i_poly, f32 i_speed, u32 i_mode, s8 i_roomNo) { int exit_id = dComIfG_Bgsp()->GetExitId(i_poly); if (exit_id == 0x3E || exit_id == 0x3B) { @@ -2119,7 +2255,6 @@ int dStage_changeSceneExitId(cBgS_PolyInfo& i_poly, f32 i_speed, u32 i_mode, s8 } /* 80043900-80043AA8 .text dStage_changeScene__FifUlSc */ -// NONMATCHING - almost int dStage_changeScene(int i_exitId, f32 speed, u32 mode, s8 room_no) { stage_scls_info_dummy_class* scls; @@ -2145,7 +2280,6 @@ int dStage_changeScene(int i_exitId, f32 speed, u32 mode, s8 room_no) { } /* 80043AB0-80043B10 .text dStage_restartRoom__FUlUl */ -// NONMATCHING - extra extsb void dStage_restartRoom(u32 roomParam, u32 mode) { dComIfGp_setNextStage(dComIfGp_getStartStageName(), -1, dComIfGs_getRestartRoomNo(), -1, 0.0f, mode, 0, 0); @@ -2154,6 +2288,7 @@ void dStage_restartRoom(u32 roomParam, u32 mode) { /* 80043B10-80043BD0 .text dStage_turnRestart__Fv */ void dStage_turnRestart() { + /* Nonmatching - regalloc */ s8 layerNo = dComIfGp_getStartStageLayer(); if (layerNo >= 0) layerNo = dComIfGp_getStartStageLayer() ^ 1; @@ -2188,7 +2323,6 @@ void dStage_escapeRestart() { } /* 80043C84-80043CD0 .text dStage_checkRestart__Fv */ -// NONMATCHING - extra extsh bool dStage_checkRestart() { if (dComIfGp_isEnableNextStage()) { if (dComIfGp_getStartStagePoint() == -2 || dComIfGp_getStartStagePoint() == -3) { @@ -2202,3 +2336,24 @@ bool dStage_checkRestart() { return false; } + +dStage_roomStatus_c dStage_roomControl_c::mStatus[64]; +JKRExpHeap* dStage_roomControl_c::mMemoryBlock[16]; +dStage_darkStatus_c dStage_roomControl_c::mDarkStatus[8] = { + // TODO: member names need to be documented + {0x19, 0x06, 0x06, 0.8f, 0.8f, 0x08080206, 0.8f, 1.0f, 2.0f, 5.0f}, + {0x32, 0x06, 0x06, 0.8f, 2.6f, 0x08080309, 0.8f, 2.6f, 4.0f, 144.0f}, + {}, + {}, + {}, + {}, + {}, + {}, +}; + +u32 dStage_roomControl_c::mProcID; +s8 dStage_roomControl_c::mStayNo; +s8 dStage_roomControl_c::mOldStayNo; +u8 dStage_roomControl_c::mDarkRatio; +char dStage_roomControl_c::mDemoArcName[8]; +s8 dStage_roomControl_c::m_time_pass; diff --git a/src/f_op/f_op_actor.cpp b/src/f_op/f_op_actor.cpp index be93ce842..dd6f1c894 100644 --- a/src/f_op/f_op_actor.cpp +++ b/src/f_op/f_op_actor.cpp @@ -163,7 +163,7 @@ s32 fopAc_Create(void* pProc) { actor->mParentPcId = prm->mParentPcId; actor->mSubtype = prm->mSubtype; actor->mGbaName = prm->mGbaName; - actor->mScale.set(prm->mScale[0] * 0.1f, prm->mScale[1] * 0.1f, prm->mScale[2] * 0.1f); + actor->mScale.set(prm->mScale.x * 0.1f, prm->mScale.y * 0.1f, prm->mScale.z * 0.1f); actor->mSetId = prm->mSetId; actor->orig.roomNo = prm->mRoomNo; } diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index fec0ae34d..989c13697 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -77,9 +77,9 @@ fopAcM_prm_class* fopAcM_CreateAppend() { cLib_memSet(params, 0, sizeof(fopAcM_prm_class)); params->mSetId = 0xFFFF; params->mRoomNo = -1; - params->mScale[0] = 10; - params->mScale[1] = 10; - params->mScale[2] = 10; + params->mScale.x = 10; + params->mScale.y = 10; + params->mScale.z = 10; params->mParentPcId = -1; params->mSubtype = -1; } @@ -105,13 +105,13 @@ fopAcM_prm_class * createAppend(u32 parameter, cXyz* pPos, int roomNo, csXyz* pA params->mAngle = csXyz::Zero; if (pScale != NULL) { - params->mScale[0] = 10.0f * pScale->x; - params->mScale[1] = 10.0f * pScale->y; - params->mScale[2] = 10.0f * pScale->z; + params->mScale.x = 10.0f * pScale->x; + params->mScale.y = 10.0f * pScale->y; + params->mScale.z = 10.0f * pScale->z; } else { - params->mScale[0] = 10.0f; - params->mScale[1] = 10.0f; - params->mScale[2] = 10.0f; + params->mScale.x = 10.0f; + params->mScale.y = 10.0f; + params->mScale.z = 10.0f; } params->mParameter = parameter;