Exemple #1
0
        public void ExportSPR(int index, string path)
        {
            var gfx = new Image[3][];

            GameContent.Get.Changes.BlockingResMod(new ResAction(() =>
            {
                gfx[0] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index], 136, 384);
                gfx[1] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index + GraphicChunk.Frames.Length / 3], 68, 192);
                gfx[2] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index + (GraphicChunk.Frames.Length / 3) * 2], 34, 96);
            }, GraphicChunk, false));

            var iffname   = ActiveIff.MainIff.Filename;
            var extension = iffname.LastIndexOf('.');

            if (extension != -1)
            {
                iffname = iffname.Substring(0, extension);
            }

            var baseName = Path.Combine(path, iffname + "_spr" + GraphicChunk.ChunkID + "_r" + index);

            gfx[0][0].Save(baseName + "_near" + "_color.bmp", ImageFormat.Bmp);
            gfx[0][1].Save(baseName + "_near" + "_alpha.bmp", ImageFormat.Bmp);
            gfx[0][2].Save(baseName + "_near" + "_depth.bmp", ImageFormat.Bmp);
            if (!AutoZooms.Checked)
            {
                gfx[1][0].Save(baseName + "_med" + "_color.bmp", ImageFormat.Bmp);
                gfx[1][1].Save(baseName + "_med" + "_alpha.bmp", ImageFormat.Bmp);
                gfx[1][2].Save(baseName + "_med" + "_depth.bmp", ImageFormat.Bmp);
                gfx[2][0].Save(baseName + "_far" + "_color.bmp", ImageFormat.Bmp);
                gfx[2][1].Save(baseName + "_far" + "_alpha.bmp", ImageFormat.Bmp);
                gfx[2][2].Save(baseName + "_far" + "_depth.bmp", ImageFormat.Bmp);
            }
        }
Exemple #2
0
        public void UpdateGraphics()
        {
            int index = FrameList.SelectedIndex;

            Graphics = new Image[3][];

            GameContent.Get.Changes.BlockingResMod(new ResAction(() =>
            {
                Graphics[0] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index], 136, 384);
                Graphics[1] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index + GraphicChunk.Frames.Length / 3], 68, 192);
                Graphics[2] = SpriteEncoderUtils.GetPixelAlpha(GraphicChunk.Frames[index + (GraphicChunk.Frames.Length / 3) * 2], 34, 96);
            }, GraphicChunk, false));

            SetDisplay();
        }