diff options
Diffstat (limited to 'src/00_Core/Render/ModelRender.cpp')
| -rw-r--r-- | src/00_Core/Render/ModelRender.cpp | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/src/00_Core/Render/ModelRender.cpp b/src/00_Core/Render/ModelRender.cpp index cd984739..37a4ce30 100644 --- a/src/00_Core/Render/ModelRender.cpp +++ b/src/00_Core/Render/ModelRender.cpp @@ -1,32 +1,30 @@ #include "Render/ModelRender.hpp" -#include "DTCM/UnkStruct_027e037c.hpp" - -extern "C" void func_020189dc(ModelRender_UnkStruct_4 *unkStruct4, ItemModel *model); -extern "C" void func_02018c3c(ModelRender_UnkStruct_4 *unkStruct4, void *param2); -extern "C" void UnkInit_ModelRender_Struct4_Params(ModelRender_UnkStruct_4 *unkStruct4, - void (*func)(ModelRenderCommandsData *), unk32 param3, u8 param4, - u8 param5); -extern "C" void ExecModelRenderCommands(ModelRender_UnkStruct_4 *unkStruct4); +#include "DTCM/UnkStruct_027e037c.h" +#include "nds/g3d/sbc.h" + +extern "C" void func_020189dc(G3d_RenderObject *unkStruct4, ItemModel *model); +extern "C" void func_02018c3c(G3d_RenderObject *unkStruct4, void *param2); +extern "C" void UnkInit_ModelRender_Struct4_Params(G3d_RenderObject *unkStruct4, void (*func)(ModelRenderCommandsData *), + unk32 param3, u8 param4, u8 param5); extern "C" void CopySingle288(Mat3p *src, Mat3p *dest); extern "C" void SetGeometryScale(Vec3p *scale); extern "C" void SetGeometryTranslation(Vec3p *translation); extern "C" void PushGeometryCommand(u32 command, void *data, s32 length); -extern "C" void func_ov000_020c0d70(UnkStruct_ov000_020c0c08 *param1, ModelRender_UnkStruct_4 *param2); +extern "C" void func_ov000_020c0d70(UnkStruct_ov000_020c0c08 *param1, G3d_RenderObject *param2); extern "C" void func_ov000_020b3ea8(void *param1); extern "C" unk32 func_0201e388(void *param1, const char *param2); extern "C" u8 *GetModelUnknownHeader(ModelRender *modelRender); extern "C" Mat3p gGeomMatrix; extern "C" Vec3p gGeomTranslation; extern "C" Vec3p gGeomScale; -extern "C" UnkStruct_027e037c data_027e037c; -extern "C" void *data_027e03c8; +extern "C" const Mat4x3p *data_027e03c8; extern "C" Vec3p gDefaultScale; extern "C" Mat3p gDefaultMatrix; extern "C" u32 *data_027e0ce0[]; THUMB ModelRender::ModelRender(ItemModel *itemModel) { this->unkBoneMatrixArray2 = NULL; - this->Init_ModelRender_UnkStruct_4(itemModel); + this->Init_RenderObject(itemModel); } THUMB ModelRender::~ModelRender() { @@ -37,19 +35,19 @@ THUMB ModelRender::~ModelRender() { } ARM void *ModelRender::GetLcdcAddress() { - return mUnk_04.mLcdcAddr; + return renderObj.model; } -void ModelRender::Init_ModelRender_UnkStruct_4(ItemModel *model) { - func_020189dc(&this->mUnk_04, model); +void ModelRender::Init_RenderObject(ItemModel *model) { + func_020189dc(&this->renderObj, model); } -ModelRender_UnkBoneMatrixStruct *ModelRender::UnkGetBoneMatrix(s32 index) { +G3d_BoneMtxStruct *ModelRender::UnkGetBoneMatrix(s32 index) { if (this->unkBoneMatrixArray2 != NULL) { return &this->unkBoneMatrixArray2[index]; } - if (this->mUnk_04.unkBoneMatrixArray1 != NULL) { - return &this->mUnk_04.unkBoneMatrixArray1[index]; + if (this->renderObj.cacheJntAnm != NULL) { + return &this->renderObj.cacheJntAnm[index]; } return NULL; } @@ -88,40 +86,40 @@ void ModelRender::PushGeometryCommands() { } void ModelRender::ExecRenderCommands() { - ExecModelRenderCommands(&this->mUnk_04); + G3d_Render(&this->renderObj); } void ModelRender::vfunc_24(UnkStruct_ov000_020c0c08 *param1) { - func_ov000_020c0d70(param1, &this->mUnk_04); + func_ov000_020c0d70(param1, &this->renderObj); } void ModelRender::vfunc_28() { - while (this->mUnk_04.mUnk_10 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_10); + while (this->renderObj.jntAnim != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.jntAnim); } - while (this->mUnk_04.mUnk_08 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_08); + while (this->renderObj.matAnim != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.matAnim); } - while (this->mUnk_04.mUnk_18 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_18); + while (this->renderObj.mUnk_18 != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.mUnk_18); } } void ModelRender::vfunc_2c() { - while (this->mUnk_04.mUnk_10 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_10); + while (this->renderObj.jntAnim != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.jntAnim); } } void ModelRender::vfunc_34() { - while (this->mUnk_04.mUnk_18 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_18); + while (this->renderObj.mUnk_18 != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.mUnk_18); } } void ModelRender::vfunc_30() { - while (this->mUnk_04.mUnk_08 != NULL) { - func_02018c3c(&this->mUnk_04, this->mUnk_04.mUnk_08); + while (this->renderObj.matAnim != NULL) { + func_02018c3c(&this->renderObj, this->renderObj.matAnim); } } @@ -146,29 +144,28 @@ THUMB void ModelRender::InitBoneMatrixArrays(u32 idLength) { u8 *unkPtr = GetModelUnknownHeader(this); u8 boneMatrixCount = *(unkPtr + 3); - ModelRender_UnkBoneMatrixStruct *boneMatrixArray = - (ModelRender_UnkBoneMatrixStruct *) SysObject::operator new[](boneMatrixCount * 0x58, id, idLength); - this->unkBoneMatrixArray2 = boneMatrixArray; - this->mUnk_04.unkBoneMatrixArray1 = boneMatrixArray; + G3d_BoneMtxStruct *boneMatrixArray = (G3d_BoneMtxStruct *) SysObject::operator new[](boneMatrixCount * 0x58, id, idLength); + this->unkBoneMatrixArray2 = boneMatrixArray; + this->renderObj.cacheJntAnm = boneMatrixArray; } -ARM void ModelRender::SetUnkBoneMatrixArray1(ModelRender_UnkBoneMatrixStruct *boneMatrix) { - this->mUnk_04.unkBoneMatrixArray1 = boneMatrix; +ARM void ModelRender::SetUnkBoneMatrixArray1(G3d_BoneMtxStruct *boneMatrix) { + this->renderObj.cacheJntAnm = boneMatrix; } void ModelRender::vfunc_38() { - this->mUnk_04.flags |= 3; - ExecModelRenderCommands(&this->mUnk_04); - this->mUnk_04.flags &= 0xfffffffd; + this->renderObj.flag |= 3; + G3d_Render(&this->renderObj); + this->renderObj.flag &= 0xfffffffd; } void ModelRender::vfunc_3c(ModelRenderCommandsData *renderData) {} void func_ov000_020a99c0(ModelRenderCommandsData *renderData) { - renderData->unkStruct4->mUnk_2c->vfunc_3c(renderData); + ((ModelRender *) renderData->unkStruct4->modelRender)->vfunc_3c(renderData); } void ModelRender::UnkInit_Struct4_Params(u8 param1, u8 param2) { - this->mUnk_04.mUnk_2c = this; - UnkInit_ModelRender_Struct4_Params(&this->mUnk_04, &func_ov000_020a99c0, 0, param1, param2); + this->renderObj.modelRender = this; + UnkInit_ModelRender_Struct4_Params(&this->renderObj, &func_ov000_020a99c0, 0, param1, param2); }
\ No newline at end of file |
