Beispiel #1
0
        public void RenderDrawsDeathMagenta()
        {
            IRenderImage src  = new BufferImage(16, 16, CreatePixels(16, 16, MAGENTA));
            IRenderImage dest = RenderImage.Create(16, 16);

            Render.render(dest, 0, 0, src, true);
            Assert.AreEqual(dest.GetArray(), src.GetArray());
        }
Beispiel #2
0
        public void RenderSkipsDeathMagenta()
        {
            IRenderImage src  = new BufferImage(16, 16, CreatePixels(16, 16, MAGENTA));
            IRenderImage dest = RenderImage.Create(16, 16);

            dest.Clear(BLACK);

            Render.render(dest, 0, 0, src, false);
            Assert.AreEqual(dest.GetArray(), CreatePixels(16, 16, BLACK));
        }
Beispiel #3
0
        public void Clone()
        {
            BufferImage img = new BufferImage(16, 16);

            img.UpdatePixels(CreateStippledPixels(16, 16, WHITE, GREEN));

            IRenderImage i2 = img.Clone();

            Assert.AreEqual(i2.GetArray(), img.GetArray());
        }
Beispiel #4
0
        public void DrawImage()
        {
            int[] pixels = new int[16 * 16];
            for (int i = 0; i < pixels.Length; i++)
            {
                pixels[i] = 1;
            }
            IRenderImage img = new BufferImage(16, 16, pixels);

            IRenderImage destImage = RenderImage.Create(16, 16);

            Render.render(destImage, 0, 0, img, true);

            int[] resultPixels = destImage.GetArray();
            Assert.AreEqual(pixels, resultPixels);
        }