示例#1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            font0         = Content.Load <SpriteFont>("font0");
            gbColorShader = Content.Load <Effect>("shaders/colorShader");
            gbShader      = Content.Load <Effect>("shaders/screenShader");

            sprOverlay    = Content.Load <Texture2D>("gbc");
            sprBackground = Content.Load <Texture2D>("noise");

            sprMemory = new Texture2D(graphics.GraphicsDevice, 512, 1024);

            sprWhite = new Texture2D(graphics.GraphicsDevice, 1, 1);
            sprWhite.SetData(new Color[] { Color.White });

            gbRenderTarget = new RenderTarget2D(graphics.GraphicsDevice, 160, 144, false, SurfaceFormat.Color, DepthFormat.None);

            gbRenderer.Load(Content);

            LoadRomList(parameter[0]);

            bgColors[0] = new Vector4(0, 0, 0, 0.05f);
            bgColors[1] = new Vector4(0, 0, 0, 0.4f);
            bgColors[2] = new Vector4(0, 0, 0, 0.6f);
            bgColors[3] = new Vector4(0, 0, 0, 0.8f);

            objColors[0] = new Vector4(1.0f, 1.0f, 1.0f, 0.05f);
            objColors[1] = new Vector4(0.8f, 0.5f, 0.5f, 0.3f);
            objColors[2] = new Vector4(0.5f, 0.2f, 0.2f, 0.5f);
            objColors[3] = new Vector4(0.0f, 0.0f, 0.0f, 0.7f);

            SearchTree tree = new SearchTree();

            tree.AddItem(new byte[] { 0xFF, 0xFA, 0x0F, 0xFF }, 12);
            tree.AddItem(new byte[] { 0xFF, 0xCA, 0x0F, 0xFF }, 154);
            tree.AddItem(new byte[] { 0xFF, 0xCA, 0xFF, 0xFF }, 554);

            int search = tree.Search(new byte[] { 0xFF, 0xFA, 0x0F, 0xFF });
        }