public static void Draw() { SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance(); Debug.Assert(pMan != null); // walk through the list and render SpriteBatch pSpriteBatch = (SpriteBatch)pMan.BaseGetActive(); while (pSpriteBatch != null) { SBNodeMan pSBNodeMan = pSpriteBatch.GetSBNodeMan(); Debug.Assert(pSBNodeMan != null); if (pSpriteBatch.GetisDraw()) { pSBNodeMan.Draw(); } pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext; //SBNode pNode = (SBNode)pSBNodeMan.BaseGetActive(); //while (pNode != null) //{ // // Assumes someone before here called update() on each sprite // // Draw me. // pNode.getSpriteBase().Render(); // pNode = (SBNode)pNode.pNext; //} //pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext; } }
public SpriteBatch() : base() { this.name = SpriteBatch.Name.Uninitialized; this.pSBNodeMan = new SBNodeMan(); Debug.Assert(this.pSBNodeMan != null); this.isDraw = true; }
public static void Remove(SBNode pSpriteBatchNode) { Debug.Assert(pSpriteBatchNode != null); SBNodeMan pSBNodeMan = pSpriteBatchNode.getSBNodeMan(); Debug.Assert(pSBNodeMan != null); pSBNodeMan.remove(pSpriteBatchNode); }
public static void RemoveSprite(SBNode pSpriteBaseNode) { Debug.Assert(pSpriteBaseNode != null); //Get the manager that holds the sprite base node SBNodeMan pSBNodeMan = pSpriteBaseNode.GetSBNodeMan(); Debug.Assert(pSBNodeMan != null); pSBNodeMan.Remove(pSpriteBaseNode); }
public void Dettach(SpriteBase pNodeToRemove) { //use the back pointers Debug.Assert(pNodeToRemove != null); SBNode pSBNode = pNodeToRemove.GetSBNode(); SBNodeMan pSBNodeMan = this.GetSBNodeMan(); pSBNodeMan.Remove(pSBNode); }
public SpriteBatch() : base() { this.name = SpriteBatch.Name.Unitialized; // this is why SBNode manager cant be a singleton this.poSBNodeMan = new SBNodeMan(); Debug.Assert(this.poSBNodeMan != null); this.bToggle = true; }
//--------------------------------------------------------------------------------------------------------- // Methods //--------------------------------------------------------------------------------------------------------- public void set(SpriteBase pNode, SBNodeMan pSBNodeMan) { Debug.Assert(pNode != null); this.pSpriteBase = pNode; // set back pointer, easy for deletion Debug.Assert(this.pSpriteBase != null); this.pSpriteBase.SetSBNode(this); Debug.Assert(pSBNodeMan != null); this.pBackSBNodeMan = pSBNodeMan; }
public void Set(SpriteBase pNode, SBNodeMan pInSBNodeMan) { Debug.Assert(pNode != null); this.pSpriteBase = pNode; //set back pointers Debug.Assert(pSpriteBase != null); this.pSpriteBase.SetSBNode(this); Debug.Assert(pInSBNodeMan != null); this.pBackSBNodeMan = pInSBNodeMan; }
//~SBNode() //{ // this.pSpriteBase = null; //} //public void Set(GameSprite.Name name) //{ // // Go find it // this.pSpriteBase = GameSpriteMan.Find(name); // Debug.Assert(this.pSpriteBase != null); //} //public void Set(BoxSprite.Name name) //{ // // Go find it // this.pSpriteBase = BoxSpriteMan.Find(name); // Debug.Assert(this.pSpriteBase != null); //} //public void Set(ProxySprite pNode) //{ // // associate it // Debug.Assert(pNode != null); // this.pSpriteBase = pNode; //} public void Set(SpriteBase pNode, SBNodeMan _pSBNodeMan) { Debug.Assert(pNode != null); this.pSpriteBase = pNode; // Set the back pointer // Allows easier deletion in the future Debug.Assert(pSpriteBase != null); this.pSpriteBase.SetSBNode(this); Debug.Assert(_pSBNodeMan != null); this.pBackSBNodeMan = _pSBNodeMan; }
public static void Draw() { SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance(); Debug.Assert(pMan != null); //need access to the Sprites, //in the SpriteBatch to render SpriteBatch pSBatch = (SpriteBatch)pMan.BaseGetActive(); while (pSBatch != null) { if (pSBatch.bToggle == true) { SBNodeMan pSBNodeMan = pSBatch.GetSBNodeMan(); Debug.Assert(pSBNodeMan != null); pSBNodeMan.Draw(); } pSBatch = (SpriteBatch)pSBatch.pNext; } }
public void Draw() { //SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance(); //Debug.Assert(pMan != null); // walk through the list and render SpriteBatch pSpriteBatch = (SpriteBatch)this.BaseGetActive(); //int count = 0; while (pSpriteBatch != null) { //count++; if (pSpriteBatch.display == true) { SBNodeMan pSBNodeMan = pSpriteBatch.GetSBNodeMan(); Debug.Assert(pSBNodeMan != null); pSBNodeMan.Draw(); } pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext; } //Debug.WriteLine("DrawCount:{0}", count); }
public static void Draw() { //ensure call Create() first SpriteBatchMan pMan = SpriteBatchMan.GetInstance(); Debug.Assert(pMan != null); // get the active list SpriteBatch pSpriteBatch = (SpriteBatch)pMan.baseGetActiveList(); // walk through the list and render while (pSpriteBatch != null) { if (pSpriteBatch.getIsDraw()) { SBNodeMan pSBNodeMan = pSpriteBatch.getSBNodeMan(); Debug.Assert(pSBNodeMan != null); pSBNodeMan.draw(); } pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext; } }
public static void Update() { SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance(); Debug.Assert(pMan != null); SpriteBatch pSpriteBatch = (SpriteBatch)pMan.BaseGetActive(); while (pSpriteBatch != null) { SBNodeMan pSBNodeMan = pSpriteBatch.GetSBNodeMan(); Debug.Assert(pSBNodeMan != null); SBNode pNode = (SBNode)pSBNodeMan.BaseGetActive(); while (pNode != null) { pNode.GetSpriteBase().Update(); pNode = (SBNode)pNode.pNext; } pSpriteBatch = (SpriteBatch)pSpriteBatch.pNext; } }
public SBNode() : base() { this.pSpriteBase = null; // SBNode does not own pSpriteBase this.pBackSBNodeMan = null; }
public void Wash() { this.pSpriteBase = null; this.pBackSBNodeMan = null; }
public SBNode() : base() { this.pSpriteBase = null; this.pBackSBNodeMan = null; }