MCPcopy Create free account
hub / github.com/doldecomp/mkdd / makePaneExStream

Method makePaneExStream

libs/JSystem/J2DGraph/J2DPane.cpp:661–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659J2DPane* J2DPane::getParentPane() { return (mTree.getParent() == nullptr) ? nullptr : mTree.getParent()->getObject(); }
660
661void J2DPane::makePaneExStream(J2DPane* parent, JSURandomInputStream* input)
662{
663 input->getPosition();
664
665 J2DPaneExBlock data;
666 input->read(&data, sizeof(data));
667 mAnimPaneIndex = data.mAnimIndex;
668 mIsVisible = (u8)data.mIsVisible;
669 mTag = data.mTag;
670 mMessageID = data.mMessageID;
671
672 mScale.x = data.mWidthScale;
673 mScale.y = data.mHeightScale;
674
675 mAngleX = data.mAngleX;
676 mAngleY = data.mAngleY;
677 mAngleZ = data.mAngleZ;
678
679 mOffset.x = data.mOffsetX;
680 mOffset.y = data.mOffsetY;
681 mRotationAxis = J2DROTATE_Z;
682
683 if (data.mBasePosition % 3 == 0) {
684 mAnchorPoint.x = 0;
685 } else if (data.mBasePosition % 3 == 1) {
686 mAnchorPoint.x = data.mWidth / 2;
687 } else {
688 mAnchorPoint.x = data.mWidth;
689 }
690
691 if (data.mBasePosition / 3 == 0) {
692 mAnchorPoint.y = 0;
693 } else if (data.mBasePosition / 3 == 1) {
694 mAnchorPoint.y = data.mHeight / 2;
695 } else {
696 mAnchorPoint.y = data.mHeight;
697 }
698
699 mBounds.set(-mAnchorPoint.x, -mAnchorPoint.y, data.mWidth - mAnchorPoint.x, data.mHeight - mAnchorPoint.y);
700 mBasePosition = data.mBasePosition;
701
702 mAlpha = 255;
703 mIsInfluencedAlpha = false;
704
705 if (parent) {
706 parent->mTree.appendChild(&mTree);
707 }
708
709 mCullMode = GX_CULL_NONE;
710 mColorAlpha = 255;
711 mIsConnected = false;
712 calcMtx();
713}
714
715s16 J2DPane::J2DCast_F32_to_S16(f32 value, u8 cutoff)
716{

Callers

nothing calls this directly

Calls 4

getPositionMethod · 0.45
readMethod · 0.45
setMethod · 0.45
appendChildMethod · 0.45

Tested by

no test coverage detected