public Palettes(Document doc, Type eType) { m_doc = doc; m_palettes = new Dictionary<int, Palette>(); m_eType = eType; m_paletteCurrent = null; }
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); ; } }
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); }
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; }
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; }
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); } }
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); }
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); }
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); } }
/// <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; }
public void UpdateDocument(Document doc) { m_doc = doc; foreach (Palette p in m_palettes.Values) { p.UpdateDocument(doc); } }
public void TestInit() { m_doc = new Document(null); m_xd = new XmlDocument(); }
public virtual void UpdateDocument(Document doc) { m_doc = doc; }
public Subpalette(Document doc, Palette mgr, int nSubpaletteID, DefaultColorSet eDefaultColorSet) { Init(doc, mgr, nSubpaletteID, eDefaultColorSet); }
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); }
public void UpdateDocument(Document doc) { m_doc = doc; foreach (SpriteType st in SpriteTypes) { foreach (Sprite s in st.Sprites) { s.UpdateDocument(doc); } } }
public void UpdateDocument(Document doc) { m_doc = doc; foreach (BgImage bgi in m_bgimages.Values) { bgi.UpdateDocument(doc); } }
public void UpdateDocument(Document doc) { m_doc = doc; foreach (Map m in m_maps.Values) { m.UpdateDocument(doc); } }
public Maps(Document doc) { m_doc = doc; m_maps = new Dictionary<int, Map>(); }
/// <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(); }
public override void UpdateDocument(Document doc) { base.UpdateDocument(doc); for (int i = 0; i < m_nMaxSubpalettes; i++) { m_subpalettes[i].UpdateDocument(doc); } }
public void UpdateDocument(Document doc) { m_doc = doc; foreach (Spriteset ss in m_spritesets.Values) { ss.UpdateDocument(doc); } }
public Spritesets(Document doc, bool fBackground) { m_doc = doc; m_fBackground = fBackground; m_spritesets = new Dictionary<int, Spriteset>(); }
public override void UpdateDocument(Document doc) { base.UpdateDocument(doc); }