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

GetScale() публичный Метод

public GetScale ( int boxNum, int x, int y ) : int
boxNum int
x int
y int
Результат int
        public int GetScale(int boxNum, int x, int y)
        {
            if (Game.Version <= 3)
                return 255;

            var box = GetBoxBase(boxNum);
            if (box == null)
                return 255;

            int scale, slot;
            if (Game.Version == 8)
            {
                // COMI has a separate field for the scale slot...
                slot = box.ScaleSlot;
                scale = box.Scale;
            }
            else
            {
                scale = box.Scale;
                slot = 0;
                if ((scale & 0x8000) != 0)
                    slot = (scale & 0x7FFF) + 1;
            }

            // Was a scale slot specified? If so, we compute the effective scale
            // from it, ignoring the box scale.
            if (slot != 0)
                scale = GetScaleFromSlot(slot, x, y);

            return scale;
        }
ScummEngine