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); } }
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, bigBlockIndexes); } else { Bitmap result = new Bitmap((int)(32 * formMain.CurScale * 256),(int)(32 * formMain.CurScale)); //need some hack for duck tales 1 using (Graphics g = Graphics.FromImage(result)) { for (int i = 0; i < ConfigScript.getBigBlocksCount(); i++) { Bitmap b; /*switch (Globals.gameType) { //todo: write code to export blocks for TinyToon //case GameTyp.TT: // b = ConfigScript.videoNes.makeBigBlockTT(i, 64, 64, bigBlockIndexes, smallBlocksAll, smallBlocksColorBytes); // break; case GameTyp._3E: b = ConfigScript.videoNes.makeBigBlock3E(i, 64, 64, bigBlockIndexes, smallBlocks); break; default: b = ConfigScript.videoNes.makeBigBlock(i, 64, 64, bigBlockIndexes, smallBlocks); break; }*/ b = ConfigScript.videoNes.makeBigBlock(i, 64, 64, bigBlockIndexes, smallBlocks); g.DrawImage(b, new Point((int)(32 * formMain.CurScale * i), 0)); } } result.Save(fn); } }