62 if (mStatus == Fader::HIDDEN) {
64 }
else if (mStatus == Fader::OPAQUE) {
66 }
else if (mStatus == Fader::FADE_IN) {
67 u16 currFrame = mFrame;
68 u16 endFrame = mFrameCount;
70 if (currFrame > endFrame) {
71 mStatus = Fader::HIDDEN;
72 result = (mFlag & ColorFader::FLAG_1) != 0;
75 mCurrColor.a = 255 - (currFrame * 255 / mFrameCount);
76 }
else if (mStatus == Fader::FADE_OUT) {
77 u16 endFrame = mFrameCount;
78 u16 currFrame = mFrame;
80 if (currFrame > endFrame) {
81 if (currFrame > endFrame + 1) {
82 mStatus = Fader::OPAQUE;
83 result = (mFlag & ColorFader::FLAG_2) != 0;
85 endFrame = mFrameCount;
88 mCurrColor.a = currFrame * 255 / endFrame;
95 if (mCurrColor.a == 0) {
100 C_MTXOrtho(&projMtx, mTop, mBottom, mLeft, mRight, 0, 1);
101 GXSetProjection(&projMtx, 1);
103 GXSetViewport(mLeft, mTop, getWidth(), getHeight(), 0, 1);
104 GXSetScissor(mLeft, mTop, getWidth(), getHeight());
108 GXLoadPosMtxImm(&posMtx, 0);
112 GXInvalidateVtxCache();
114 GXSetVtxDesc(GX_VA_POS, GX_VA_TEX0MTXIDX);
115 GXSetVtxAttrFmt(0, GX_VA_POS, 1, 4, 0);
118 GXSetChanMatColor(GX_COLOR0A0, mCurrColor);
119 GXSetChanCtrl(GX_COLOR0A0, 0, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
122 GXSetNumIndStages(0);
123 __GXSetIndirectMask(0);
125 GXSetNumTevStages(1);
126 GXSetTevOp(GX_TEVSTAGE0, 4);
127 GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
129 if (mCurrColor.a == 255) {
130 GXSetBlendMode(GX_BM_NONE, GX_BL_ONE, GX_BL_ZERO, GX_LO_SET);
132 GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
137 GXSetZMode(0, GX_NEVER, 0);
140 GXBegin(GX_QUADS, GX_VTXFMT0, 4);
142 GXPosition3f32(mLeft, mTop, 0.0f);
143 GXPosition3f32(mRight, mTop, 0.0f);
144 GXPosition3f32(mRight, mBottom, 0.0f);
145 GXPosition3f32(mLeft, mBottom, 0.0f);