Esempio n. 1
0
        public bool fill_with_color_spr()
        {
            palette_group plt = palette_group.Instance;

            if (plt.active_palette >= 0)
            {
                if (m_data != null)
                {
                    if (m_sel_ind >= 0)
                    {
#if DEF_NES
                        m_data.fill_CHR_bank_spr8x8_by_color_ind(m_sel_ind, plt.get_palettes_arr()[plt.active_palette].get_color_slot());
#else
                        m_data.fill_CHR_bank_spr8x8_by_color_ind(m_sel_ind, plt.active_palette * utils.CONST_NUM_SMALL_PALETTES + plt.get_palettes_arr()[plt.active_palette].get_color_slot());
#endif

                        MainForm.set_status_msg(String.Format("CHR Bank: Sprite #{0:X2} is filled with a palette slot index: {1}", m_sel_ind, plt.get_palettes_arr()[plt.active_palette].get_color_slot()));

                        update();
                    }
                    else
                    {
                        MainForm.message_box("Please, select a CHR!", "Fill CHR With Color", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                dispatch_event_need_gfx_update();
                dispatch_event_data_changed();

                return(true);
            }

            return(false);
        }