void DrawSample(uint battleAnimeID, int paletteIndex)
        {
            Bitmap[] animeframe = new Bitmap[12];

            uint showsecstion = 0;
            uint showframe    = 0;

            for (int index = 0; index < animeframe.Length; index++, showframe += 2)
            {
                animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID
                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90
                                                                         , 0, showsecstion, showframe, paletteIndex);
                if (!ImageUtil.IsBlankBitmap(animeframe[index], 10))
                {
                    continue;
                }
                //何も描画されなければフレームをもうちょっと進めてみる.
                showframe        += 2;
                animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID
                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90
                                                                         , 0, showsecstion, showframe, paletteIndex);
                if (!ImageUtil.IsBlankBitmap(animeframe[index], 10))
                {
                    continue;
                }
                //それでもだめならセクションを切り替える.
                showsecstion     += 1;
                showframe         = 0;
                animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID
                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90
                                                                         , 0, showsecstion, showframe, paletteIndex);
                if (!ImageUtil.IsBlankBitmap(animeframe[index], 10))
                {
                    continue;
                }
                //さらにダメならもう一つセクションを進める. それでもだめならあきらめる.
                showsecstion     += 1;
                showframe         = 0;
                animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID
                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90
                                                                         , 0, showsecstion, showframe, paletteIndex);
            }

            this.DrawBitmap = ImageUtil.Blank(360, 290, animeframe[0]);
            int x = 0;
            int y = 0;

            for (int index = 0; index < animeframe.Length; index++)
            {
                ImageUtil.BitBlt(this.DrawBitmap, x, y, animeframe[index].Width, animeframe[index].Height, animeframe[index], 0, 0);
                x += animeframe[index].Width;
                if (x >= this.DrawBitmap.Width)
                {
                    x  = 0;
                    y += animeframe[index].Height;
                }
            }

            ReDrawBitmap();
        }
Пример #2
0
 private void B16_ValueChanged(object sender, EventArgs e)
 {
     if (PatchUtil.OPClassReelAnimationIDOver255() == PatchUtil.OPClassReelAnimationIDOver255Patch.Over255)
     {     //パッチで 戦闘アニメ255を越える場合
         if (B13.Value == 0xFF)
         { //標準パレット
             X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)D18.Value + 1
                                                                            , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value);
         }
         else
         {
             X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)D18.Value + 1
                                                                            , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value);
         }
     }
     else
     {     //バニラ
         if (B13.Value == 0xFF)
         { //標準パレット
             X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1
                                                                            , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value);
         }
         else
         {
             X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1
                                                                            , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value);
         }
     }
 }
Пример #3
0
 private void B16_ValueChanged(object sender, EventArgs e)
 {
     if (B13.Value == 0xFF)
     {//標準パレット
         X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1
                                                                        , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value);
     }
     else
     {
         X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1
                                                                        , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value);
     }
 }
Пример #4
0
        public static Bitmap DrawSample(uint unitid, uint type)
        {
            InputFormRef InputFormRef   = Init(null);
            InputFormRef N_InputFormRef = N_Init(null);

            uint addr1 = InputFormRef.IDToAddr(unitid);
            uint addr2 = N_InputFormRef.IDToAddr(unitid);

            if (addr1 == U.NOT_FOUND || addr2 == U.NOT_FOUND)
            {
                return(ImageUtil.BlankDummy());
            }
            uint b   = Program.ROM.u8(addr1 + type);
            uint n_b = Program.ROM.u8(addr2 + type);

            return(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(n_b)
                                                        , ImageBattleAnimeForm.ScaleTrim.SCALE_90, b));
        }
Пример #5
0
        //バトルアニメ + テキストを書くルーチン
        public static Size DrawImageBattleAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            string text = lb.Items[index].ToString();

            SolidBrush brush      = new SolidBrush(lb.ForeColor);
            Font       normalFont = lb.Font;
            Rectangle  bounds     = listbounds;

            int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2;



            //テキストの先頭にアイコン番号(キャラ番号が入っている. 無駄だが汎用性を考えるとほかに方法がない)
            uint   icon   = U.atoh(text);
            Bitmap bitmap = ImageBattleAnimeForm.DrawBattleAnime(icon, ImageBattleAnimeForm.ScaleTrim.SCALE_48);

            U.MakeTransparent(bitmap);

            //アイコンを描く. 処理速度を稼ぐためにマップアイコンの方を描画
            Rectangle b = bounds;

            b.Width   = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            b.Height  = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b);

            //テキストを描く.
            b         = bounds;
            b.Y      += textmargineY;
            bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b);

            brush.Dispose();
            bitmap.Dispose();

            bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE;
            return(new Size(bounds.X, bounds.Y));
        }
Пример #6
0
 private void B5_ValueChanged(object sender, EventArgs e)
 {
     X_PIC5.Image = ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID((uint)N_B5.Value)
                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B5.Value);
 }
Пример #7
0
        public MainSimpleMenuImageSubForm()
        {
            InitializeComponent();

            ImageBGButton.BackgroundImage = MakeTransparent(Trim(ImageBGForm.DrawBG(0)));

            if (Program.ROM.RomInfo.version() >= 7)
            {
                BigCGButton.BackgroundImage = MakeTransparent(Trim(ImageCGForm.DrawImageByID(0)));
            }
            else
            {
                BigCGButton.Hide();
            }

            ImagePortraitButton.BackgroundImage     = MakeTransparent(ImagePortraitForm.DrawPortraitUnit(2));
            ImageBattleAnimeButton.BackgroundImage  = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(1, ImageBattleAnimeForm.ScaleTrim.SCALE_90)));
            ImageUnitWaitIconButton.BackgroundImage = MakeTransparent(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(1, 0, false));
            ImageUnitMoveIconButton.BackgroundImage = MakeTransparent(ImageUnitMoveIconFrom.DrawMoveUnitIconBitmap(3, 0, 0));
            ImageIconButton.BackgroundImage         = MakeTransparent(ImageItemIconForm.DrawIconWhereID(0xB));
            SystemIconButton.BackgroundImage        = MakeTransparent(ImageSystemIconForm.YubiYoko());
            //BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.Allows(8));
            BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(0));

            ImageBattleFieldButton.BackgroundImage   = MakeTransparent(ImageBattleBGForm.DrawBG(2));
            ImageBattleTerrainButton.BackgroundImage = MakeTransparent((ImageBattleTerrainForm.Draw(2)));

            if (Program.ROM.RomInfo.version() == 8)
            {
                ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(UnitPaletteForm.DrawSample(2, 3)));
            }
            else
            {//for FE6 , FE7
                ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(UnitForm.GetClassID(2))
                                                                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90, UnitForm.GetPaletteLowClass(2))));
            }

            WorldMapImageButton.BackgroundImage = MakeTransparent(WorldMapImageForm.DrawWorldMap());

            if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte() == false)
            {//英語版FE7は、章タイトルをテキストで保持していて、40260c nazo fontで、描画している.
                ImageChapterTitleButton.Hide();
            }
            else
            {
                ImageChapterTitleButton.BackgroundImage = MakeTransparent(ImageChapterTitleForm.DrawSample(0));
            }


            if (ImageUtilMagic.SearchMagicSystem() != ImageUtilMagic.magic_system_enum.NO)
            {
                ImageMagicButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(8 - 3));
            }
            else
            {
                ImageMagicButton.Hide();
            }

            if (Program.ROM.RomInfo.is_multibyte())
            {
                OptionForm.textencoding_enum textencoding = OptionForm.textencoding();
                if (textencoding == OptionForm.textencoding_enum.ZH_TBL)
                {
//                    FontButton.BackgroundImage = MakeTransparent(FontZHForm.DrawFontString("字形", true));
                }
                else
                {
                    FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("フォント", true));
                }
            }
            else
            {
                FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("Font", true));
            }
        }