コード例 #1
0
ファイル: NesEmulator.cs プロジェクト: zhoujf2010/NESsemulate
        public void UpdateSize()
        {
            _CanRender = false;
            while (_IsRendering)
            {
            }
            switch (_DrawSize)
            {
            case DrawSize.Stretch:
                Screen_X = 0;
                Screen_Y = 0;
                Screen_W = Surface.Size.Width;
                Screen_H = Surface.Size.Height;
                break;

            case DrawSize.X1:
                Screen_X = (Surface.Size.Width / 2) - 128;
                Screen_Y = (Surface.Size.Height / 2) - (_ScanLines / 2);
                Screen_W = 256;
                Screen_H = _ScanLines;
                break;

            case DrawSize.X2:
                Screen_X = (Surface.Size.Width / 2) - 256;
                Screen_Y = (Surface.Size.Height / 2) - _ScanLines;
                Screen_W = 512;
                Screen_H = _ScanLines * 2;
                break;
            }
            GR = Surface.CreateGraphics();
            GR.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
            GR.Clear(Color.Black);
            CanRender = true;
        }