Advertisement
fggkyle

Untitled

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