NScumm.Scumm.ScummEngine.DoTransitionEffect C# (CSharp) Метод

DoTransitionEffect() приватный Метод

Perform a transition effect. There are four different effects possible: 0: Iris effect 1: Box wipe (a black box expands from the upper-left corner to the lower-right corner) 2: Box wipe (a black box expands from the lower-right corner to the upper-left corner) 3: Inverse box wipe
All effects operate on 8x8 blocks of the screen. These blocks are updated in a certain order; the exact order determines how the effect appears to the user.
private DoTransitionEffect ( int a ) : void
a int The transition effect to perform.
Результат void
        void DoTransitionEffect(int a)
        {
            int[] delta = new int[16];                              // Offset applied during each iteration
            int[] tab_2 = new int[16];
            int i, j;
            int bottom;
            int l, t, r, b;
            var height = Math.Min(MainVirtScreen.Height, ScreenHeight);
            var delay = VariableFadeDelay.HasValue ? Variables[VariableFadeDelay.Value] * FadeDelay : PictureDelay;

            for (i = 0; i < 16; i++)
            {
                delta[i] = transitionEffects[a].deltaTable[i];
                j = transitionEffects[a].stripTable[i];
                if (j == 24)
                    j = height / 8 - 1;
                tab_2[i] = j;
            }

            bottom = height / 8;
            for (j = 0; j < transitionEffects[a].numOfIterations; j++)
            {
                for (i = 0; i < 4; i++)
                {
                    l = tab_2[i * 4];
                    t = tab_2[i * 4 + 1];
                    r = tab_2[i * 4 + 2];
                    b = tab_2[i * 4 + 3];

                    if (t == b)
                    {
                        while (l <= r)
                        {
                            if (l >= 0 && l < Gdi.NumStrips && t < bottom)
                            {
                                MainVirtScreen.TDirty[l] = ScreenTop + t * 8;
                                MainVirtScreen.BDirty[l] = ScreenTop + (b + 1) * 8;
                            }
                            l++;
                        }
                    }
                    else
                    {
                        if (l < 0 || l >= Gdi.NumStrips || b <= t)
                            continue;
                        if (b > bottom)
                            b = bottom;
                        if (t < 0)
                            t = 0;
                        MainVirtScreen.TDirty[l] = ScreenTop + t * 8;
                        MainVirtScreen.BDirty[l] = ScreenTop + (b + 1) * 8;
                    }
                    UpdateDirtyScreen(MainVirtScreen);
                }

                for (i = 0; i < 16; i++)
                    tab_2[i] += delta[i];

                // Draw the current state to the screen and wait a few secs so the
                // user can watch the effect taking place.
                WaitForTimer(delay);
            }
        }
ScummEngine