コード例 #1
0
ファイル: Palettes.cs プロジェクト: jduranmaster/spritely
 public Palettes(Document doc, Type eType)
 {
     m_doc = doc;
     m_palettes = new Dictionary<int, Palette>();
     m_eType = eType;
     m_paletteCurrent = null;
 }
コード例 #2
0
ファイル: Map.cs プロジェクト: jduranmaster/spritely
        public Map(Document doc, string strName, int id, string strDesc, Spriteset bgtiles)
        {
            m_doc = doc;
            m_ss = bgtiles;
            m_ss.AddMap(this);

            m_strName = strName;
            m_id = id;
            m_strDesc = strDesc;

            m_BackgroundMap = new BackgroundMapTileInfo[kMaxMapTilesX, kMaxMapTilesY];

            int nDefaultTile = -1;
            if (bgtiles.CurrentSprite != null)
                nDefaultTile = bgtiles.CurrentSprite.FirstTileId;
            for (int ix = 0; ix < kMaxMapTilesX; ix++)
                for (int iy = 0; iy < kMaxMapTilesY; iy++)
                {
                    m_BackgroundMap[ix, iy].nTileIndex = nDefaultTile;
                    m_BackgroundMap[ix, iy].nSubpalette = 0;
                }

            // Make an initial snapshot of the (empty) map.
            m_snapshot = GetUndoData();

            if (m_doc.Owner != null)
            {
                m_winMap = new MapForm(m_doc.Owner, this, bgtiles, null); ;
            }
        }
コード例 #3
0
ファイル: Palette256.cs プロジェクト: jduranmaster/spritely
        public Palette256(Document doc, Palettes pals, string strName, int id, string strDesc)
            : base(doc, pals, strName, id, strDesc)
        {
            m_type = Palette.Type.Color256;

            m_data = new PaletteColorData(k_nColors);

            if (m_doc.Owner != null)
                m_winPalette = new Palette256Form(m_doc.Owner, this);
        }
コード例 #4
0
ファイル: Palette.cs プロジェクト: jduranmaster/spritely
        public Palette(Document doc, Palettes pals, string strName, int id, string strDesc)
        {
            m_doc = doc;
            m_palettes = pals;
            m_strName = strName;
            m_id = id;
            m_strDesc = strDesc;

            m_type = Type.Unknown;
            m_nMaxSubpalettes = 0;
        }
コード例 #5
0
ファイル: BgImage.cs プロジェクト: jduranmaster/spritely
        public BgImage(Document doc, string strName, int id, string strDesc)
        {
            m_doc = doc;

            Name = strName;
            m_id = id;
            Description = strDesc;

            HeaderFileName = strName + ".h";

            m_bm = null;
        }
コード例 #6
0
ファイル: BgImages.cs プロジェクト: jduranmaster/spritely
        public BgImages(Document doc)
        {
            m_doc = doc;
            m_bgimages = new Dictionary<int, BgImage>();
            m_bgiCurrent = null;

            if (m_doc.Owner != null)
            {
                m_winBgImageList = new BgImageListForm(m_doc.Owner, this); ;
                m_winBgImage = new BgImageForm(m_doc.Owner, null);
            }
        }
コード例 #7
0
ファイル: UndoMgr.cs プロジェクト: jduranmaster/spritely
        public void TestInit()
        {
            m_doc = new Document(null);
            Assert.IsNotNull(m_doc);

            m_palette = m_doc.Palettes.AddPalette16(Options.DefaultPaletteName, 0, "");
            Assert.IsNotNull(m_palette);

            m_ss = m_doc.Spritesets.AddSpriteset(Options.DefaultSpritesetName, 0, "", m_palette);
            Assert.IsNotNull(m_ss);

            m_mgr = new UndoMgr(null, TabMgr.TabId.Sprites);
            Assert.IsNotNull(m_mgr);
        }
コード例 #8
0
ファイル: Palette16.cs プロジェクト: jduranmaster/spritely
        public Palette16(Document doc, Palettes pals, string strName, int id, string strDesc)
            : base(doc, pals, strName, id, strDesc)
        {
            m_type = Palette.Type.Color16;
            m_nMaxSubpalettes = 16;

            m_subpalettes = new Subpalette[m_nMaxSubpalettes];
            for (int i = 0; i < m_nMaxSubpalettes; i++)
                m_subpalettes[i] = new Subpalette(doc, this, i, Subpalette.DefaultColorSet.BlackAndWhite);

            CurrentSubpaletteId = 0;

            if (m_doc.Owner != null)
                m_winPalette = new Palette16Form(m_doc.Owner, this);
        }
コード例 #9
0
ファイル: Spriteset.cs プロジェクト: jduranmaster/spritely
        public Spriteset(Document doc, string strName, int id, string strDesc, Palette pal)
        {
            m_doc = doc;
            m_strName = strName;
            m_id = id;
            m_strDesc = strDesc;
            m_palette = pal;
            m_fIsBackground = pal.IsBackground;

            m_Maps = new List<Map>();

            if (m_doc.Owner != null)
            {
                m_winSpriteset = new SpritesetForm(m_doc.Owner, this); ;
                m_winSprite = new SpriteForm(m_doc.Owner, this, CurrentSprite);
            }
        }
コード例 #10
0
ファイル: Document.cs プロジェクト: jduranmaster/spritely
        /// <summary>
        /// Open the named file.
        /// </summary>
        /// <param name="strFilename">Name of file to open</param>
        /// <returns>True if the file was successfully opened</returns>
        public bool Open(string strFilename)
        {
            // Open into a separate doc so that we can keep the current doc untouched in case
            // there is an error.
            Document doc = new Document(m_form);
            if (!doc.m_data.Filer.OpenFile(strFilename))
                return false;

            Open_(doc);
            return true;
        }
コード例 #11
0
ファイル: Palettes.cs プロジェクト: jduranmaster/spritely
        public void UpdateDocument(Document doc)
        {
            m_doc = doc;

            foreach (Palette p in m_palettes.Values)
            {
                p.UpdateDocument(doc);
            }
        }
コード例 #12
0
ファイル: Map_LoadSave.cs プロジェクト: jduranmaster/spritely
 public void TestInit()
 {
     m_doc = new Document(null);
     m_xd = new XmlDocument();
 }
コード例 #13
0
ファイル: Palette.cs プロジェクト: jduranmaster/spritely
 public virtual void UpdateDocument(Document doc)
 {
     m_doc = doc;
 }
コード例 #14
0
ファイル: Subpalette.cs プロジェクト: jduranmaster/spritely
 public Subpalette(Document doc, Palette mgr, int nSubpaletteID, DefaultColorSet eDefaultColorSet)
 {
     Init(doc, mgr, nSubpaletteID, eDefaultColorSet);
 }
コード例 #15
0
ファイル: Subpalette.cs プロジェクト: jduranmaster/spritely
        private void Init(Document doc, Palette mgr, int nSubpaletteID, DefaultColorSet eDefaultColorSet)
        {
            m_doc = doc;
            m_mgr = mgr;
            m_nSubpaletteID = nSubpaletteID;

            m_data = new PaletteColorData(k_nColors);
            m_Brush = new SolidBrush[k_nColors];

            // Default color = black (index 1)
            m_data.currentColor = 1;

            m_snapshot = new PaletteColorData(k_nColors);
            SetDefaultSubpaletteColors(eDefaultColorSet);
        }
コード例 #16
0
ファイル: Spriteset.cs プロジェクト: jduranmaster/spritely
        public void UpdateDocument(Document doc)
        {
            m_doc = doc;

            foreach (SpriteType st in SpriteTypes)
            {
                foreach (Sprite s in st.Sprites)
                {
                    s.UpdateDocument(doc);
                }
            }
        }
コード例 #17
0
ファイル: BgImages.cs プロジェクト: jduranmaster/spritely
        public void UpdateDocument(Document doc)
        {
            m_doc = doc;

            foreach (BgImage bgi in m_bgimages.Values)
            {
                bgi.UpdateDocument(doc);
            }
        }
コード例 #18
0
ファイル: Maps.cs プロジェクト: jduranmaster/spritely
        public void UpdateDocument(Document doc)
        {
            m_doc = doc;

            foreach (Map m in m_maps.Values)
            {
                m.UpdateDocument(doc);
            }
        }
コード例 #19
0
ファイル: Maps.cs プロジェクト: jduranmaster/spritely
 public Maps(Document doc)
 {
     m_doc = doc;
     m_maps = new Dictionary<int, Map>();
 }
コード例 #20
0
ファイル: Document.cs プロジェクト: jduranmaster/spritely
        /// <summary>
        /// Copy the newly opened Document into the current document.
        /// </summary>
        /// <param name="doc">The newly opened document</param>
        private void Open_(Document doc)
        {
            // Copy data from newly loaded doc into this doc
            m_data = doc.m_data;
            // Update the document references to point to this document
            m_data.Palettes.UpdateDocument(this);
            m_data.Spritesets.UpdateDocument(this);
            m_data.BackgroundPalettes.UpdateDocument(this);
            m_data.BackgroundSpritesets.UpdateDocument(this);
            m_data.BackgroundMaps.UpdateDocument(this);
            m_data.Filer.UpdateDocument(this);

            Spriteset ss = m_data.Spritesets.Current;
            if (ss != null)
                ss.SelectFirstSprite();
            Spriteset bss = m_data.BackgroundSpritesets.Current;
            if (bss != null)
                bss.SelectFirstSprite();
            BgImages bgis = m_data.BackgroundImages;
            if (bgis != null)
                bgis.SelectFirstImage();
            Owner.ClearUndo();
        }
コード例 #21
0
ファイル: Palette16.cs プロジェクト: jduranmaster/spritely
        public override void UpdateDocument(Document doc)
        {
            base.UpdateDocument(doc);

            for (int i = 0; i < m_nMaxSubpalettes; i++)
            {
                m_subpalettes[i].UpdateDocument(doc);
            }
        }
コード例 #22
0
ファイル: Spritesets.cs プロジェクト: jduranmaster/spritely
        public void UpdateDocument(Document doc)
        {
            m_doc = doc;

            foreach (Spriteset ss in m_spritesets.Values)
            {
                ss.UpdateDocument(doc);
            }
        }
コード例 #23
0
ファイル: Spritesets.cs プロジェクト: jduranmaster/spritely
 public Spritesets(Document doc, bool fBackground)
 {
     m_doc = doc;
     m_fBackground = fBackground;
     m_spritesets = new Dictionary<int, Spriteset>();
 }
コード例 #24
0
ファイル: Palette256.cs プロジェクト: jduranmaster/spritely
 public override void UpdateDocument(Document doc)
 {
     base.UpdateDocument(doc);
 }