Beispiel #1
0
 internal void Highlight(Helpers.ZBufferedTexture tex, CellStruct TopLeft)
 {
     for (var y = 0; y < TileHeight; ++y) {
         var l = FirstPixelInRow(y);
         var r = TileWidth - l;
         tex.PutPixel(Color.Red, TopLeft.X + l, TopLeft.Y + y, Int32.MaxValue);
         tex.PutPixel(Color.Red, TopLeft.X + r, TopLeft.Y + y, Int32.MaxValue);
     }
 }
Beispiel #2
0
            public void DrawIntoTexture(Helpers.ZBufferedTexture Texture, CellStruct StartXY, PAL tmpPalette, int zIndex = 0)
            {
                var fw = (int)Width;
                var fh = (int)Height;

                if (fw * fh != ProcessedBytes.Length) {
                    throw new InvalidDataException("Frame does not decompress to the right amount of bytes");
                }

                for (var y = 0; y < fh; ++y) {
                    for (var x = 0; x < fw; ++x) {
                        var ixPix = y * fw + x;
                        var ixClr = ProcessedBytes[ixPix];
                        var clr = PAL.TranslucentColor;
                        if (ixClr != 0) {
                            clr = tmpPalette.Colors[ixClr];
                        }
                        Texture.PutPixel(clr, StartXY.X + x, StartXY.Y + y, zIndex);
                    }
                }
            }