Пример #1
0
        void Core_UpdateTestView()
        {
            try
            {
                GBA.Palette palette = new GBA.Palette(CurrentPortrait.Colors);
                palette[0] = palette[0].SetAlpha(true);
                for (int i = 1; i < palette.Count; i++)
                {
                    palette[i] = palette[i].SetAlpha(false);
                }   // force correct alpha on the palette (1st color transparent, all others opaque)
                GBA.TileMap tilemap = new TileMap(Portrait.Map_Test(IsGenericClassCard));

                TestPortrait = new SpriteSheet(tilemap.Width * 8, tilemap.Height * 8);

                if (!IsGenericClassCard)
                {
                    tilemap = new GBA.TileMap(GetTileMap_Mouth(
                                                  Test_Mouth_Smile_RadioButton.Checked,
                                                  Test_Mouth_TrackBar.Value));
                    TestPortrait.AddSprite(
                        new Sprite(palette,
                                   (Core.CurrentROM is FE6 || (Test_Mouth_Smile_RadioButton.Checked && Test_Mouth_TrackBar.Value == 0)) ?
                                   CurrentPortrait.Sprites[Portrait.MAIN].Sheet :
                                   CurrentPortrait.Sprites[Portrait.MOUTH].Sheet,
                                   tilemap),
                        (byte)Current["MouthX"] * 8,
                        (byte)Current["MouthY"] * 8);

                    tilemap = new GBA.TileMap(GetTileMap_Eyes(
                                                  EyesClosed_CheckBox.Checked,
                                                  Test_Blink_TrackBar.Value));
                    TestPortrait.AddSprite(
                        new Sprite(palette,
                                   CurrentPortrait.Sprites[Portrait.MAIN].Sheet,
                                   tilemap),
                        (byte)Current["BlinkX"] * 8,
                        (byte)Current["BlinkY"] * 8);
                }
                tilemap = new TileMap(Portrait.Map_Test(IsGenericClassCard));
                TestPortrait.AddSprite(
                    new Sprite(palette,
                               CurrentPortrait.Sprites[Portrait.MAIN].Sheet,
                               tilemap),
                    0, 0);

                Test_ImageBox.Load(TestPortrait);
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not load the portrait test view.", ex);
                Test_ImageBox.Reset();
            }
        }
Пример #2
0
        void Core_LoadImage()
        {
            try
            {
                CurrentMapSprite = new MapSprite(CurrentPalette,
                                                 Core.ReadData((Pointer)CurrentIdle["Sprite"], 0),
                                                 Core.ReadData((Pointer)CurrentMove["Sprite"], 0),
                                                 (byte)CurrentIdle["Size"]);

                Edit_ImageBox.Load(CurrentMapSprite);
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not load the map sprite image.", ex);
                Edit_ImageBox.Reset();
                Test_ImageBox.Reset();
            }
        }