Ejemplo n.º 1
0
 private void CompressPortraitButton_Click(object sender, EventArgs e)
 {
     if (InputFormRef.IsPleaseWaitDialog(this))
     {
         return;
     }
     ImagePortraitForm.Execute_ToolCompressAllPortrait();
 }
Ejemplo n.º 2
0
        static InputFormRef Init(Form self)
        {
            //FEditor Advが文字列長を書いてくれていた場合
            uint FEditorHint = InputFormRef.GetFEditorLengthHint(Program.ROM.p32(Program.ROM.RomInfo.portrait_pointer));
            //連続するnull個数
            int nullContinuousCount = 0;

            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.portrait_pointer
                                    , Program.ROM.RomInfo.portrait_datasize
                                    , (int i, uint addr) =>
            {    //読込最大値検索
                if (i <= 0)
                {
                    return true;
                }
                //0 と 4 がポインタであればデータがあると考える.
                uint u0 = Program.ROM.u32(addr + 0);
                uint u4 = Program.ROM.u32(addr + 4);
                uint u8 = Program.ROM.u32(addr + 8);
                if (U.isPointerOrNULL(u0) &&
                    U.isPointerOrNULL(u4) &&
                    U.isPointerOrNULL(u8)
                    )
                {
                    if (u0 == 0 && u4 == 0 && u8 == 0)
                    {    //NULLデータ. 怪しいがとりあえずOK
                        nullContinuousCount++;
                        if (nullContinuousCount >= 10)
                        {    //NULLデータが連続して10個出てきたら打ち切る.
                            Log.Notify("顔画像で nullが10個連続して出てきたので探索を打ち切りました.");
                            return false;
                        }
                    }
                    else
                    {
                        nullContinuousCount = 0;
                    }
                    return true;
                }
                if (FEditorHint != U.NOT_FOUND && i < FEditorHint)
                {    //不明なデータではあるがFEditorがあるというので信用する.
                    nullContinuousCount = 0;
                    return true;
                }

                return false;
            }
                                    , (int i, uint addr) =>
            {
                uint face_id = (uint)(i);

                String name = ImagePortraitForm.GetPortraitNameFast(face_id, addr);
                return U.ToHexString(face_id) + " " + name;
            }
                                    ));
        }
Ejemplo n.º 3
0
        //マップ顔画像
        public static Bitmap DrawUnitMapFacePictureByAddr(uint addr)
        {
            if (!U.isSafetyOffset(addr))
            {
                return(ImagePortraitForm.DrawPortraitMap(0));
            }
            uint face_id = Program.ROM.u16(addr + 6);

            return(ImagePortraitForm.DrawPortraitMap(face_id));
        }
Ejemplo n.º 4
0
        //顔シートの出力
        private void ExportButton_Click(object sender, EventArgs e)
        {
            uint unit_face = (uint)this.D0.Value;

            if (unit_face != 0)
            {
                Bitmap seetbitmap = DrawPortraitSeetFE6((uint)this.AddressList.SelectedIndex);
                ImageFormRef.ExportImage(this, seetbitmap, InputFormRef.MakeSaveImageFilename());
            }
            else
            {
                Bitmap classbitmap = ImagePortraitForm.DrawPortraitClass((uint)this.AddressList.SelectedIndex);
                ImageFormRef.ExportImage(this, classbitmap, InputFormRef.MakeSaveImageFilename());
            }
        }
Ejemplo n.º 5
0
        //顔画像
        public static Bitmap DrawUnitFacePictureByAddr(uint addr, bool showClassCardIfZero)
        {
            if (!U.isSafetyOffset(addr))
            {
                return(ImagePortraitForm.DrawPortraitMap(0));
            }
            uint face_id = Program.ROM.u16(addr + 6);

            if (face_id == 0 && showClassCardIfZero)
            {
                uint cid = Program.ROM.u8(addr + 5);
                return(ClassForm.DrawClassFacePicture(cid));
            }
            return(ImagePortraitForm.DrawPortraitAuto(face_id));
        }
Ejemplo n.º 6
0
 public static Bitmap TalkIcon()
 {
     if (Program.ROM.RomInfo.version() == 6)
     {
         return(ImagePortraitForm.DrawPortraitMap(2));
     }
     else if (Program.ROM.RomInfo.version() == 7)
     {//FE7には玉座のマップが、村にはない. 城で代用
         return(ImagePortraitForm.DrawPortraitMap(0x16));
     }
     else
     {
         return(ImagePortraitForm.DrawPortraitMap(2));
     }
 }
Ejemplo n.º 7
0
        private void J_8_Click(object sender, EventArgs e)
        {
            ImagePalletForm f = (ImagePalletForm)InputFormRef.JumpForm <ImagePalletForm>(U.NOT_FOUND);

            Bitmap baseBitmap = ImagePortraitForm.DrawPortraitUnit((uint)this.AddressList.SelectedIndex);

            f.JumpTo(baseBitmap, (uint)D8.Value, 1);
            f.FormClosed += (s, ee) =>
            {
                if (this.IsDisposed)
                {
                    return;
                }
                U.ReSelectList(this.AddressList);
            };
        }
Ejemplo n.º 8
0
        //顔画像
        public static Bitmap DrawClassFacePicture(uint cid)
        {
            if (cid <= 0)
            {
                return(ImageUtil.BlankDummy());
            }
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(cid);

            if (!U.isSafetyOffset(addr))
            {
                return(ImageUtil.BlankDummy());
            }
            uint face_id = Program.ROM.u16(addr + 8);

            return(ImagePortraitForm.DrawPortraitClass(face_id));
        }
Ejemplo n.º 9
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 4
                             , (int i, uint addr) =>
     {
         return false;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u8(Program.ROM.RomInfo.unit_increase_height_switch2_address) + (uint)i;
         return U.ToHexString(id) + " " + ImagePortraitForm.GetPortraitName(id);
     }
                             ));
 }
Ejemplo n.º 10
0
        //クラスカード
        public static Bitmap DrawPortraitClassFE6(uint id)
        {
            InputFormRef InputFormRef = Init(null);
            uint         baseaddress  = InputFormRef.BaseAddress;
            uint         blocksize    = InputFormRef.BlockSize;
            //現在のIDに対応するデータ
            uint addr = baseaddress + (id * blocksize);

            uint unit_face = Program.ROM.u32(addr);
            uint map_face  = Program.ROM.u32(addr + 4);
            uint palette   = Program.ROM.u32(addr + 8);

            if (map_face == 0)
            {
                return(ImagePortraitForm.DrawPortraitClass(unit_face, palette));
            }
            return(ImageUtil.BlankDummy());
        }
Ejemplo n.º 11
0
        //マップ顔画像
        public static Bitmap DrawUnitMapFacePicture(uint uid)
        {
            if (uid == 0)
            {
                return(ImageUtil.BlankDummy());
            }
            uid--;

            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(uid);

            if (!U.isSafetyOffset(addr))
            {
                return(ImagePortraitForm.DrawPortraitMap(0));
            }
            uint face_id = Program.ROM.u16(addr + 6);

            return(ImagePortraitForm.DrawPortraitMap(face_id));
        }
Ejemplo n.º 12
0
        private void SwitchListExpandsButton_Click(object sender, EventArgs e)
        {
            if (this.L_0_COMBO.Items.Count <= 0)
            {
                return;
            }
            uint defAddr = U.atoh(this.L_0_COMBO.Items[0].ToString());

            uint newCount = ImagePortraitForm.DataCount();

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "UnitIncreaseHeight SwitchExpands");

            PatchUtil.Switch2Expands(Program.ROM.RomInfo.unit_increase_height_pointer
                                     , Program.ROM.RomInfo.unit_increase_height_switch2_address
                                     , newCount
                                     , defAddr
                                     , undodata);
            Program.Undo.Push(undodata);

            ReInit(this.InputFormRef);
        }
Ejemplo n.º 13
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint unit_face = (uint)D0.Value;
            uint map_face  = (uint)D4.Value;
            uint palette   = (uint)D8.Value;
            uint mouth_x   = (uint)B12.Value;
            uint mouth_y   = (uint)B13.Value;
            int  showFrame = (int)ShowFrameUpDown.Value;

            if (map_face == 0)
            {
                X_UNIT_PIC.Image = ImagePortraitForm.DrawPortraitClass(unit_face, palette);
                X_PIC_ZZZ.Image  = null;
            }
            else if (unit_face != 0)
            {
                X_UNIT_PIC.Image = DrawPortraitUnitFE6(unit_face, palette, mouth_x, mouth_y, showFrame);
                X_PIC_ZZZ.Image  = DrawPortraitUnitFE6(unit_face, palette, mouth_x, mouth_y, 3);
            }

            X_MAP_PIC.Image = DrawPortraitFE6Map(map_face, palette);
        }
Ejemplo n.º 14
0
        //顔 + テキストを書くルーチン
        public static Size DrawImagePortraitAndText(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 = ImagePortraitForm.DrawPortraitAuto(icon);

            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);

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

            bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE;
            return(new Size(bounds.X, bounds.Y));
        }
Ejemplo n.º 15
0
        //顔画像
        public static Bitmap DrawUnitFacePicture(uint uid)
        {
            if (Program.ROM.RomInfo.version() == 6)
            {
                return(UnitFE6Form.DrawUnitFacePicture(uid));
            }

            if (uid == 0)
            {
                return(ImagePortraitForm.DrawPortraitAuto(0));
            }
            uid--;

            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(uid);

            if (!U.isSafetyOffset(addr))
            {
                return(ImagePortraitForm.DrawPortraitAuto(0));
            }
            uint face_id = Program.ROM.u16(addr + 6);

            return(ImagePortraitForm.DrawPortraitAuto(face_id));
        }
Ejemplo n.º 16
0
        static void ScanSystem(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap)
        {
            ROMCheck(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleAnimeForm"))
            {
                return;
            }
            ImageBattleAnimeForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBGForm"))
            {
                return;
            }
            ImageBGForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem UnitForm"))
            {
                return;
            }
            UnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ClassForm"))
            {
                return;
            }
            ClassForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemForm"))
            {
                return;
            }
            ItemForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem MoveCostForm"))
            {
                return;
            }
            MoveCostForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem PatchForm"))
            {
                return;
            }
            PatchForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitMoveIconFrom"))
            {
                return;
            }
            ImageUnitMoveIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitWaitIconFrom"))
            {
                return;
            }
            ImageUnitWaitIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemEffectPointerForm"))
            {
                return;
            }
            ItemEffectPointerForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitPaletteForm"))
            {
                return;
            }
            ImageUnitPaletteForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleScreen"))
            {
                return;
            }
            ImageBattleScreenForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageMagic"))
            {
                return;
            }
            ImageMagicFEditorForm.MakeCheckError(errors);
            ImageMagicCSACreatorForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem Procs"))
            {
                return;
            }
            ProcsScriptForm.MakeCheckError(errors, ldrmap);

            if (InputFormRef.DoEvents(null, "ScanSystem MenuDefinition"))
            {
                return;
            }
            MenuDefinitionForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem EventUnit"))
            {
                return;
            }
            EventUnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem AIScript"))
            {
                return;
            }
            AIScriptForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem SongTable"))
            {
                return;
            }
            SongTableForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemWeaponEffect"))
            {
                return;
            }
            ItemWeaponEffectForm.MakeCheckError(errors);

            if (Program.ROM.RomInfo.version() == 8)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem SoundFootStepsForm"))
                {
                    return;
                }
                SoundFootStepsForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuForm"))
                {
                    return;
                }
                EventHaikuForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkForm"))
                {
                    return;
                }
                EventBattleTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkForm"))
                {
                    return;
                }
                SupportTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDForm.MakeCheckError(errors);
            }
            else if (Program.ROM.RomInfo.version() == 7)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE7Form"))
                {
                    return;
                }
                EventHaikuFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE7Form"))
                {
                    return;
                }
                EventBattleTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE7Form"))
                {
                    return;
                }
                SupportTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE7Form.MakeCheckError(errors);
            }
            else
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitFE6Form"))
                {
                    return;
                }
                ImagePortraitFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE6Form"))
                {
                    return;
                }
                EventHaikuFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE6Form"))
                {
                    return;
                }
                EventBattleTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE6Form"))
                {
                    return;
                }
                SupportTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE6Form.MakeCheckError(errors);
            }
        }
Ejemplo n.º 17
0
        string MakeNMMDropDownList(InputFormRef ifr, string basefilename, Dictionary <string, string> addFiles, List <Control> controls, string linktype, int num)
        {
            string filename = basefilename + linktype + ".txt";

            if (addFiles.ContainsKey(linktype))
            {
                return(addFiles[filename]);
            }

            string data = "";

            if (linktype == "INDEX")
            {
                data = MakeNMMDropDownListInner(ifr.MakeList());
            }
            else if (linktype == "PORTRAIT")
            {
                data = MakeNMMDropDownListInner(ImagePortraitForm.MakePortraitList());
            }
            else if (linktype == "UNIT")
            {
                List <U.AddrResult> list = UnitForm.MakeUnitList();
                data = MakeNMMDropDownListInner(list);
            }
            else if (linktype == "CLASS")
            {
                data = MakeNMMDropDownListInner(ClassForm.MakeClassList());
            }
            else if (linktype == "ITEM")
            {
                data = MakeNMMDropDownListInner(ItemForm.MakeItemList());
            }
            else if (linktype == "SONG")
            {
                data = MakeNMMDropDownListInner(SongTableForm.MakeItemList());
            }
            else if (linktype == "COMBO")
            {
                Control c = InputFormRef.FindObject(ifr.Prefix, controls, num + "_" + linktype);
                if (c is ComboBox)
                {
                    data = MakeNMMDropDownListInner((ComboBox)c);
                    data = string.Join("\r\n", U.ComboBoxToStringList((ComboBox)c));
                }
            }
            else if (linktype == "ATTRIBUTE")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("8");
                for (uint n = 0; n < 8; n++)
                {
                    sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetAttributeName(n));
                }
                data = sb.ToString();
            }
            else if (linktype == "WEAPON")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("7");
                sb.AppendLine("0x0 -");
                sb.AppendLine("0x1 E");
                sb.AppendLine("0x31 D");
                sb.AppendLine("0x71 C");
                sb.AppendLine("0x121 B");
                sb.AppendLine("0x181 A");
                sb.AppendLine("0x251 S");
                data = sb.ToString();
            }
            else if (linktype == "FLAG")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("128");
                string dummy;
                for (uint n = 0; n < 128; n++)
                {
                    sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetFlagName(n, out dummy));
                }
                data = sb.ToString();
            }
            else if (linktype == "BIT")
            {
                filename = basefilename + linktype + num + ".txt";
                if (addFiles.ContainsKey(linktype))
                {
                    return(addFiles[filename]);
                }

                data = MakeBitsListInner(ifr, controls, linktype, num);
            }

            if (data == "")
            {
                return("NULL");
            }
            addFiles[filename] = data;
            return(filename);
        }
Ejemplo n.º 18
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));
            }
        }
Ejemplo n.º 19
0
        //顔画像シートを作成する.
        public static Bitmap DrawPortraitSeetFE6(uint id)
        {
            InputFormRef InputFormRef = Init(null);

            //現在のIDに対応するデータ
            uint addr = InputFormRef.IDToAddr(id);

            if (!U.isSafetyOffset(addr))
            {
                return(ImageUtil.BlankDummy());
            }

            uint unit_face = Program.ROM.u32(addr);
            uint map_face  = Program.ROM.u32(addr + 4);
            uint palette   = Program.ROM.u32(addr + 8);

            if (unit_face == 0)
            {
                return(ImagePortraitForm.DrawPortraitClass(unit_face, palette));
            }



            unit_face = U.toOffset(unit_face);
            palette   = U.toOffset(palette);

            if (unit_face == 0 ||
                !U.isSafetyOffset(unit_face) ||
                !U.isSafetyOffset(palette)
                )
            {
                //ない.
                return(ImageUtil.Blank(seet_width, seet_height));
            }
            //FE6の顔画像は圧縮されている.
            byte[] imageUZ = LZ77.decompress(Program.ROM.Data, unit_face);
            if (imageUZ.Length <= 0)
            {//ない
                return(ImageUtil.Blank(seet_width, seet_height));
            }


            Bitmap allface = ImageUtil.ByteToImage16Tile(32 * 8, 5 * 8
                                                         , imageUZ, (int)0
                                                         , Program.ROM.Data, (int)palette
                                                         );

            //シートを作る
            Bitmap seet = ImageUtil.Blank(seet_width, seet_height, allface);

            //メインの顔を転写
            ImageUtil.BitBlt(seet, parts_width / 2, 0
                             , parts_width * 2, parts_height * 2
                             , allface, 0, 0);//顔上
            ImageUtil.BitBlt(seet, parts_width / 2, parts_height * 2
                             , parts_width * 2, parts_height * 2
                             , allface, parts_width * 2, 0);//顔下
            ImageUtil.BitBlt(seet, parts_width / 2, parts_height * 4
                             , parts_width, parts_height
                             , allface, parts_width * 4, 0);//右肩
            ImageUtil.BitBlt(seet, 0, parts_height * 3
                             , parts_width / 2, parts_height * 2
                             , allface, parts_width * 5, 0);//右端
            ImageUtil.BitBlt(seet, parts_width + parts_width / 2, parts_height * 4
                             , parts_width, parts_height
                             , allface, parts_width * 4, parts_height);//左肩
            ImageUtil.BitBlt(seet, parts_width * 2 + parts_width / 2, parts_height * 3
                             , parts_width / 2, parts_height * 2
                             , allface, parts_width * 5 + parts_width / 2, 0);//左端

            //マップ顔を描画
            map_face = U.toOffset(map_face);
            Bitmap mapface_bitmap = ImageUtil.ByteToImage16Tile(mapface_width, mapface_height
                                                                , Program.ROM.Data, (int)map_face
                                                                , Program.ROM.Data, (int)palette
                                                                , 0
                                                                );

            //シートにマップ顔を転写
            ImageUtil.BitBlt(seet, face_width, parts_height, mapface_width, mapface_height, mapface_bitmap, 0, 0);

            //口 いい具合に2*2と固まっているのでまとめてもっていく
            ImageUtil.BitBlt(seet, parts_width * 0, face_height, parts_width * 2, parts_height * 2, allface, (32 * 8) - (parts_width * 2), parts_height * 0);

            //右端の口
            ImageUtil.BitBlt(seet, parts_width * 3, face_height, parts_width, parts_height / 2, allface, 0, 4 * 8);
            //余白
            ImageUtil.BitBlt(seet, parts_width * 3, face_height + (parts_height / 2), parts_width, parts_height / 2, allface, 4 * 8, 4 * 8);

            return(seet);
        }