diff options
| author | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-05-17 03:07:04 -0300 |
|---|---|---|
| committer | Sonic Dreamcaster <alejandro.asenjo88@gmail.com> | 2025-05-17 03:07:04 -0300 |
| commit | 8667da55b90a2884b24da41b4633ef80ff77763d (patch) | |
| tree | 6f5e51a95a8191f1836ca2c4e64739096777348d | |
| parent | 1228f206e17ebdadc14248afdbfcbee3ec5540bb (diff) | |
tag and fix item boxes
| -rw-r--r-- | src/actors/item_box/render.inc.c | 31 | ||||
| -rw-r--r-- | src/engine/Matrix.cpp | 1 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/actors/item_box/render.inc.c b/src/actors/item_box/render.inc.c index 0d02c3979..81670381e 100644 --- a/src/actors/item_box/render.inc.c +++ b/src/actors/item_box/render.inc.c @@ -3,6 +3,8 @@ #include <macros.h> #include "port/interpolation/FrameInterpolation.h" +#define TAG_ITEM_ADDR(x) ((u32) 0x10000000 | (u32) x) + /** * @brief Renders the item box actor. * @@ -27,8 +29,8 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { f32 temp_f2_2; f32 someMultiplier; - FrameInterpolation_RecordMatrixPush(someMatrix1); - FrameInterpolation_RecordMatrixPush(someMatrix2); + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild(TAG_ITEM_ADDR(item_box), 0); temp_f0 = is_within_render_distance(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1], 4000000.0f); @@ -78,18 +80,18 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA); - if ((item_box->rot[1] < 0xAA1) && (item_box->rot[1] > 0)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - } else if ((item_box->rot[1] >= 0x6AA5) && (item_box->rot[1] < 0x754E)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - } else if ((item_box->rot[1] >= 0x38E1) && (item_box->rot[1] < 0x438A)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - } else if ((item_box->rot[1] >= 0xC711) && (item_box->rot[1] < 0xD1BA)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - } else { + // if ((item_box->rot[1] < 0xAA1) && (item_box->rot[1] > 0)) { + // gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + // } else if ((item_box->rot[1] >= 0x6AA5) && (item_box->rot[1] < 0x754E)) { + // gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + // } else if ((item_box->rot[1] >= 0x38E1) && (item_box->rot[1] < 0x438A)) { + // gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + // } else if ((item_box->rot[1] >= 0xC711) && (item_box->rot[1] < 0xD1BA)) { + // gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + // } else { gDPSetBlendMask(gDisplayListHead++, 0xFF); gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); - } + // } gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPDisplayList(gDisplayListHead++, D_0D003090); } else { @@ -183,7 +185,6 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) { } gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); } - - FrameInterpolation_RecordMatrixPop(someMatrix1); - FrameInterpolation_RecordMatrixPop(someMatrix2); + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } diff --git a/src/engine/Matrix.cpp b/src/engine/Matrix.cpp index 0104de47c..0c0ce260f 100644 --- a/src/engine/Matrix.cpp +++ b/src/engine/Matrix.cpp @@ -13,6 +13,7 @@ void AddMatrix(std::vector<Mtx>& stack, Mat4 mtx, s32 flags) { // Push a new matrix to the stack stack.emplace_back(); + FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &stack.back()); // Convert to a fixed-point matrix guMtxF2L(mtx, &stack.back()); |
