Ejemplo n.º 1
0
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null) throw new ArgumentNullException("videosystem");

            m_videosystem = videosystem;

            using (IO.File effectfile = m_videosystem.GetSubSystem<IO.FileSystem>().OpenFile("xnaMugen.data.Shader.fx"))
            {
                CompiledEffect compiled = Effect.CompileEffectFromSource(effectfile.ReadToEnd(), null, null, CompilerOptions.None, TargetPlatform.Windows);
                if (compiled.Success == false)
                {
                    throw new InvalidOperationException("Cannot successfully create shader.");
                }

                m_effect = new Effect(Device, compiled.GetEffectCode(), CompilerOptions.NotCloneable, null);
            }

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection<String, EffectParameter>(x => x.Name);

            m_nullpixels = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            Byte[] pixels = new Byte[] { 1, 2, 1, 2 };
            m_nullpixels.SetData<Byte>(pixels);

            Color[] paldata = new Color[256];
            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData<Color>(paldata);
        }
Ejemplo n.º 2
0
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException("videosystem");
            }

            m_videosystem = videosystem;

            using (IO.File effectfile = m_videosystem.GetSubSystem <IO.FileSystem>().OpenFile("xnaMugen.data.Shader.fx"))
            {
                CompiledEffect compiled = Effect.CompileEffectFromSource(effectfile.ReadToEnd(), null, null, CompilerOptions.None, TargetPlatform.Windows);
                if (compiled.Success == false)
                {
                    throw new InvalidOperationException("Cannot successfully create shader.");
                }

                m_effect = new Effect(Device, compiled.GetEffectCode(), CompilerOptions.NotCloneable, null);
            }

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection <String, EffectParameter>(x => x.Name);

            m_nullpixels  = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            Byte[] pixels = new Byte[] { 1, 2, 1, 2 };
            m_nullpixels.SetData <Byte>(pixels);

            Color[] paldata = new Color[256];
            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData <Color>(paldata);
        }
Ejemplo n.º 3
0
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException(nameof(videosystem));
            }

            m_videosystem = videosystem;

            m_videosystem.SubSystems.Game.Content.RootDirectory = "data";
            m_effect = m_videosystem.SubSystems.Game.Content.Load <Effect>("bin/shader");

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection <string, EffectParameter>(x => x.Name);

            m_nullpixels  = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            var pixels = new byte[] { 1, 2, 1, 2 };

            m_nullpixels.SetData(pixels);

            var paldata = new Color[256];

            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData(paldata);
        }
Ejemplo n.º 4
0
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null) throw new ArgumentNullException("videosystem");

            m_videosystem = videosystem;
            m_mode = DrawMode.Normal;
            m_pixels = null;
            m_palette = null;
            m_scissorrect = Rectangle.Empty;
            m_blending = new Blending();
            m_drawdata = new List<DrawData>();
            m_scale = Vector2.One;
            m_axis = Vector2.Zero;
            m_flip = SpriteEffects.None;
            m_rotation = 0;
            m_offset = Vector2.Zero;
            m_stretch = Vector2.One;
            m_parameters = new ShaderParameters();
        }
Ejemplo n.º 5
0
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException("videosystem");
            }

            m_videosystem = videosystem;
            m_mode        = DrawMode.Normal;
            m_pixels      = null;
            m_palette     = null;
            m_scissorrect = Rectangle.Empty;
            m_blending    = new Blending();
            m_drawdata    = new List <DrawData>();
            m_scale       = Vector2.One;
            m_axis        = Vector2.Zero;
            m_flip        = SpriteEffects.None;
            m_rotation    = 0;
            m_offset      = Vector2.Zero;
            m_stretch     = Vector2.One;
            m_parameters  = new ShaderParameters();
        }
Ejemplo n.º 6
0
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException(nameof(videosystem));
            }

            m_videosystem    = videosystem;
            Mode             = DrawMode.Normal;
            Pixels           = null;
            Palette          = null;
            ScissorRectangle = Rectangle.Empty;
            Blending         = new Blending();
            m_drawdata       = new List <DrawData>();
            Scale            = Vector2.One;
            Axis             = Vector2.Zero;
            Flip             = SpriteEffects.None;
            Rotation         = 0;
            Offset           = Vector2.Zero;
            Stretch          = Vector2.One;
            m_parameters     = new ShaderParameters();
        }