protected virtual void exportBlocks()
{
//duck tales 2 has other format
var f = new SelectFile();
f.Filename = "exportedBigBlocks.bin";
f.ShowExportParams = true;
f.ShowDialog();
if (!f.Result)
return;
var fn = f.Filename;
if (f.getExportType() == ExportType.Binary)
{
Utils.saveDataToFile(fn, Utils.linearizeBigBlocks(bigBlockIndexes));
}
else
{
Bitmap result = new Bitmap((int)(32 * formMain.CurScale * 256),(int)(32 * formMain.CurScale)); //need some hack for duck tales 1
Image[][] smallBlocksPack = new Image[1][];
smallBlocksPack[0] = smallBlocks.Images.Cast<Image>().ToArray();
using (Graphics g = Graphics.FromImage(result))
{
for (int i = 0; i < ConfigScript.getBigBlocksCount(); i++)
{
Bitmap b;
b = ConfigScript.videoNes.makeBigBlock(i, bigBlockIndexes, smallBlocksPack);
g.DrawImage(b, new Point((int)(32 * formMain.CurScale * i), 0));
}
}
result.Save(fn);
}
}