public bool Connect(List <Data> TileTables, List <Data> TileSheets, List <Data> Palettes) { bool success = true; if (TileTables.Count == 0 || TileSheets.Count == 0) { return(false); } MyCreTable = (TileTable)TileTables [0]; MyCreSheet = (TileSheet)TileSheets [0]; MySceTable = (TileTable)TileTables.Find(x => x.StartAddressLR == SceTablePtr); if (MySceTable == null) { success = false; } MySceSheet = (TileSheet)TileSheets.Find(x => x.StartAddressLR == SceSheetPtr); if (MySceSheet == null) { success = false; } MyPalette = (CompressedPalette)Palettes.Find(x => x.StartAddressLR == PalettePtr); if (MyPalette == null) { success = false; } return(success); }
// Properties //---------------------------------------------------------------------------------------- // Loads an 8x8 tile from a tilesheet into a bitmap image. public BlitImage Tile8ToImage(int tilesheetIndex, int paletteIndex, int tileIndex) { TileSheet t = (TileSheet)TileSheets [tilesheetIndex]; CompressedPalette p = (CompressedPalette)Palettes [paletteIndex]; int index = 256; byte [] data = t.RenderTile(index, p, 0); return(new BlitImage(data, 8)); }
public TileSet() : base() { SceTablePtr = 0; SceSheetPtr = 0; PalettePtr = 0; MyCreTable = null; MyCreSheet = null; MySceTable = null; MySceSheet = null; MyPalette = null; }
// Loads full tilesheet into an image. public BlitImage TilesheetToImage(int tilesheetIndex, int paletteIndex) { TileSheet t = (TileSheet)TileSheets [tilesheetIndex]; CompressedPalette p = (CompressedPalette)Palettes [paletteIndex]; byte [] data = new byte [16 * 64 * 64 * 4]; for (int row = 0; row < 64; row++) { for (int col = 0; col < 16; col++) { t.DrawTile(data, 16 * 8, 64 * 8, p, 0, 8 * col, 8 * row, 16 * row + col, false, false); } } return(new BlitImage(data, 16 * 8)); }