Beispiel #1
0
 public override void Draw(BitmapBits bmp, Point camera, ObjectEntry obj, bool includeDebug)
 {
     BitmapBits bits = new BitmapBits(img);
     bits.Flip(obj.XFlip, obj.YFlip);
     bmp.DrawBitmapComposited(bits, new Point(obj.X + offset.X - camera.X, obj.Y + offset.Y - camera.Y));
 }
Beispiel #2
0
 public override Sprite GetSprite(ObjectEntry obj)
 {
     byte subtype = obj.SubType;
     if (subtype > 10) subtype = 0;
     BitmapBits bits = new BitmapBits(imgs[subtype].Image);
     bits.Flip(obj.XFlip, obj.YFlip);
     return new Sprite(bits, new Point(imgs[subtype].X + obj.X, imgs[subtype].Y + obj.Y));
 }
Beispiel #3
0
 public override void Draw(BitmapBits bmp, Point camera, ObjectEntry obj, bool includeDebug)
 {
     byte subtype = obj.SubType;
     if (subtype > 10) subtype = 0;
     BitmapBits bits = new BitmapBits(imgs[subtype]);
     bits.Flip(obj.XFlip, obj.YFlip);
     bmp.DrawBitmapComposited(bits, new Point(obj.X + offsets[subtype].X - camera.X, obj.Y + offsets[subtype].Y - camera.Y));
 }
 internal static BitmapBits[] S3KMapFrameToBmp(byte[] file, S3KMappings map, int startpal, out Point offset)
 {
     int left = 0;
     int right = 0;
     int top = 0;
     int bottom = 0;
     for (int i = 0; i < map.TileCount; i++)
     {
         left = Math.Min(map[i].X, left);
         right = Math.Max(map[i].X + (map[i].Width * 8), right);
         top = Math.Min(map[i].Y, top);
         bottom = Math.Max(map[i].Y + (map[i].Height * 8), bottom);
     }
     offset = new Point(left, top);
     BitmapBits[] bmp = new BitmapBits[] { new BitmapBits(right - left, bottom - top), new BitmapBits(right - left, bottom - top) };
     for (int i = map.TileCount - 1; i >= 0; i--)
     {
         BitmapBits pcbmp = new BitmapBits(map[i].Width * 8, map[i].Height * 8);
         int ti = 0;
         int pr = map[i].Tile.Priority ? 1 : 0;
         for (int x = 0; x < map[i].Width; x++)
         {
             for (int y = 0; y < map[i].Height; y++)
             {
                 pcbmp.DrawBitmapComposited(
                     ObjectHelper.TileToBmp8bpp(file, map[i].Tile.Tile + ti, (map[i].Tile.Palette + startpal) & 3),
                     new Point(x * 8, y * 8));
                 ti++;
             }
         }
         pcbmp.Flip(map[i].Tile.XFlip, map[i].Tile.YFlip);
         bmp[pr].DrawBitmapComposited(pcbmp, new Point(map[i].X - left, map[i].Y - top));
     }
     return bmp;
 }
Beispiel #5
0
 public override void Draw(BitmapBits bmp, Point loc, byte subtype, bool XFlip, bool YFlip, bool includeDebug)
 {
     if (subtype > 10) subtype = 0;
     BitmapBits bits = new BitmapBits(imgs[subtype]);
     bits.Flip(XFlip, YFlip);
     bmp.DrawBitmapComposited(bits, new Point(loc.X + offsets[subtype].X, loc.Y + offsets[subtype].Y));
 }