NScumm.Sky.AutoRoute.ClipCoordY C# (CSharp) Method

ClipCoordY() private static method

private static ClipCoordY ( ushort y, byte &blkY, short &initY ) : void
y ushort
blkY byte
initY short
return void
        private static void ClipCoordY(ushort y, out byte blkY, out short initY)
        {
            if (y < Logic.TOP_LEFT_Y)
            {
                blkY = 0;
                initY = (short)(y - Logic.TOP_LEFT_Y);
            }
            else if (y >= Logic.TOP_LEFT_Y + Screen.GameScreenHeight)
            {
                blkY = (Screen.GameScreenHeight - 1) >> 3;
                initY = (short)(y - (Logic.TOP_LEFT_Y + Screen.GameScreenHeight));
            }
            else
            {
                blkY = (byte)((y - Logic.TOP_LEFT_Y) >> 3);
                initY = 0;
            }
        }