NScumm.Scumm.Graphics.VirtScreen.VirtScreen C# (CSharp) Method

VirtScreen() public method

public VirtScreen ( int top, int width, int height, PixelFormat format, int numBuffers, bool trick = false ) : System
top int
width int
height int
format PixelFormat
numBuffers int
trick bool
return System
        public VirtScreen(int top, int width, int height, PixelFormat format, int numBuffers, bool trick = false)
        {
            if (numBuffers <= 0)
                throw new ArgumentOutOfRangeException("numBuffers", "The number of buffers should be positive.");

            var numStrips = Math.Max(width / 8, 80);
            tdirty = new int[numStrips + 1];
            bdirty = new int[numStrips + 1];
            TopLine = top;
            _surfaces = new Surface[numBuffers];
            _roSurfaces = new ReadOnlyCollection<Surface>(_surfaces);
            for (int i = 0; i < numBuffers; i++)
            {
                _surfaces[i] = new Surface(width, height, format, trick);
            }

            SetDirtyRange(0, height);
            HasTwoBuffers = Surfaces.Count == 2;
        }