Advertisement
fggkyle

Untitled

Oct 6th, 2020
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.68 KB | None | 0 0
  1. void func_801330E0(GlobalContext* globalCtx, s32 limbIndex, Skeleton* skeleton, Vec3s* limbDrawTable,
  2.                            OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s32 dListIndex) {
  3.     SkelLimbEntry* limbEntry;
  4.     Gfx* dList;
  5.     Vec3f pos;
  6.     Vec3s rot;
  7.     GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
  8.     Gfx* _polyOpa;
  9.    
  10.     SysMatrix_StatePush();
  11.     limbEntry = Lib_PtrSegToVirt(skeleton->limbs[limbIndex]);
  12.     limbIndex++;
  13.     rot = limbDrawTable[limbIndex];
  14.  
  15.     pos.x = limbEntry->translation.x;
  16.     pos.y = limbEntry->translation.y;
  17.     pos.z = limbEntry->translation.z;
  18.  
  19.     dList = limbEntry->displayLists[dListIndex];
  20.     if ((overrideLimbDraw == NULL) || (overrideLimbDraw(globalCtx, limbIndex, &dList, &pos, &rot, actor) == 0)) {
  21.         SysMatrix_RotateAndTranslateState(&pos, &rot);
  22.         if (dList != NULL) {
  23.             _polyOpa = gfxCtx->polyOpa.p;
  24.             gSPMatrix(_polyOpa++, SysMatrix_AppendStateToPolyOpaDisp(globalCtx->state.gfxCtx), G_MTX_LOAD);
  25.             gSPDisplayList(_polyOpa++, dList);
  26.         }
  27.     }
  28.  
  29.     if (postLimbDraw != NULL) {
  30.         postLimbDraw(globalCtx, limbIndex, &dList, &rot, actor);
  31.     }
  32.  
  33.     if (limbEntry->firstChildIndex != LIMB_DONE) {
  34.         func_801330E0(globalCtx, limbEntry->firstChildIndex, skeleton, limbDrawTable, overrideLimbDraw,
  35.                               postLimbDraw, actor, dListIndex);
  36.     }
  37.  
  38.     SysMatrix_StatePop();
  39.  
  40.     if (limbEntry->nextLimbIndex != LIMB_DONE) {
  41.         func_801330E0(globalCtx, limbEntry->nextLimbIndex, skeleton, limbDrawTable, overrideLimbDraw,
  42.                               postLimbDraw, actor, dListIndex);
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement