From 8049dec3393c4ade687dbdfd84d3ccde73168ab0 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis Date: Thu, 26 May 2022 04:24:39 +0100 Subject: `sys_matrix` OK, documented, rename some other mathematics functions (#787) * Import data and bss, add some name options * Decomp rest of stack functions, remove RSPMatrix, split header * sys_matrix OK (thanks Tharo) Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * pragma weaks in sinf and cosf, change documentation change mcros to use 0x8000 * Rename sinf and cosf * Correct initialisation of sMtxFClear * More minor cleanup * Rename stack functions * Matrix_InsertMatrix -> Matrix_Mult * The big transpose rename * Fix MirRay_DrawReflectedBeam * Matrix_InsertTranslation -> Matrix_Translate * Matrix_Insert.Rotation_s -> Matrix_Rotate$1S + RotateY -> RotateYS * Matrix_Insert(.)Rotation_f -> Matrix_Rotate$1F * Matrix_RotateStateAroundXAxis -> Matrix_RotateXFApply Matrix_SetStateXRotation -> Matrix_RotateXFNew * Matrix_MultiplyVector3fByState -> Matrix_MultVec3f * Matrix_MultiplyVector3fXZByCurrentState -> Matrix_MultVec3fXZ * Matrix_GetStateTranslation -> Matrix_MultZero * Matrix_GetStateTranslationAndScaled(.) -> Matrix_MultVec$1 * Matrix_FromRSPMatrix -> Matrix_MtxToMtxF * Matrix_MultiplyVector3fByMatrix -> Matrix_MultVec3fExt * Matrix_TransposeXYZ -> Matrix_Transpose * Matrix_ToRSPMatrix -> Matrix_MtxFToMtx * Matrix_AppendToPolyOpaDisp -> Matrix_MtxFToNewMtx and document the conversion functions * Matrix_NormalizeXYZ -> Matrix_ReplaceRotation * Matrix_InsertRotationAroundUnitVector_f -> Matrix_RotateAxisF and S * Matrix_InsertRotation -> Matrix_RotateZYX * Document the last functions * Small cleanup * Matrix_JointPosition -> Matrix_TranslateRotateZYX * Matrix_SetStateRotationAndTranslation -> Matrix_SetTranslateRotateYXZ * func_8018219C -> Matrix_MtxFToYXZRot * func_801822C4 -> Matrix_MtxFToZYXRot * Fix files * Format * Review 1 * Renames * Fix warning in EnDragon * Format * Convert `mode` to an actual enum * Add enums, typedefs, externs to sys_matrix header * Review * One more * More review * Fix function names * Format * Fix names * Format * Review * engineer's review * Fix build * Format * Fix again Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> --- src/code/z_debug_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/code/z_debug_display.c') diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index ab3478fa1..fb7378751 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -68,10 +68,10 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, GlobalCo func_8012C6FC(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, dispObj->color.r, dispObj->color.g, dispObj->color.b, dispObj->color.a); - Matrix_InsertTranslation(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW); + Matrix_Translate(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, MTXMODE_NEW); Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); - Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY); - Matrix_InsertRotation(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY); + Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY); + Matrix_RotateZYX(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY); gDPLoadTextureBlock(POLY_XLU_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -94,7 +94,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* arg1, GlobalContex gSPSetLights1(POLY_XLU_DISP++, sDebugDisplayLight1); - Matrix_SetStateRotationAndTranslation(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot); + Matrix_SetTranslateRotateYXZ(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot); Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); -- cgit v1.2.3