Esempio n. 1
0
            public void GetBaseTextureStandalone(PAL Palette)
            {
                var beginX = -Bounds.X;
                var beginY = -Bounds.Y;

                for (var y = 0; y < TileHeight; ++y)
                {
                    for (var x = 0; x < TileWidth; ++x)
                    {
                        var ixPix = IndexOfPixel(x, y);
                        if (ixPix != -1)
                        {
                            var ixClr = Graphics[ixPix];
                            if (ixClr != 0)
                            {
                                var clr = Palette.Colors[ixClr];

                                var z = (HasZData)
                                    ? ZData[ixPix]
                                    : 0
                                ;

                                _Texture.PutPixel(clr, beginX + x, beginY + y, z);
                            }
                        }
                    }
                }
            }
Esempio n. 2
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);
     }
 }
Esempio n. 3
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);
                    }
                }
            }