Beispiel #1
0
        // TODO probably remove this method because no longer used. Update handled in game objects
        public static void Update()
        {
            SpriteBatchManager pMan = SpriteBatchManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // walk through the list and render
            SpriteBatch pSpriteBatch = (SpriteBatch)pMan.BaseGetActive();

            while (pSpriteBatch != null)
            {
                SpriteBaseNodeManager pSBNodeMan = pSpriteBatch.GetSBNodeManager();
                Debug.Assert(pSBNodeMan != null);

                SpriteBaseNode pNode = (SpriteBaseNode)pSBNodeMan.BaseGetActive();

                while (pNode != null)
                {
                    pNode.pSpriteBase.Update();

                    pNode = (SpriteBaseNode)pNode.GetNext();
                }

                pSpriteBatch = (SpriteBatch)pSpriteBatch.GetNext();
            }
        }
Beispiel #2
0
 public SpriteBatch()
 {
     this.name        = SpriteBatch.Name.Uninitialized;
     this.poSBNodeMan = new SpriteBaseNodeManager();
     Debug.Assert(this.poSBNodeMan != null);
     this.enabled = true;
 }
Beispiel #3
0
        public static void Remove(SpriteBaseNode pSpriteBatchNode)
        {
            Debug.Assert(pSpriteBatchNode != null);
            SpriteBaseNodeManager pSBNodeMan = pSpriteBatchNode.GetSBNodeMan();

            Debug.Assert(pSBNodeMan != null);
            pSBNodeMan.Remove(pSpriteBatchNode);
        }
Beispiel #4
0
        public void Set(SpriteBase pNode, SpriteBaseNodeManager pSBNodeMan)
        {
            // associate it
            Debug.Assert(pNode != null);
            this.pSpriteBase = pNode;

            // Set the back pointer
            // Allows easier deletion in the future
            this.pSpriteBase.SetSBNode(this);

            Debug.Assert(pSBNodeMan != null);
            this.pBackSBNodeMan = pSBNodeMan;
        }
Beispiel #5
0
        public static void Draw()
        {
            SpriteBatchManager pMan = SpriteBatchManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // walk through the list and render
            SpriteBatch pSpriteBatch = (SpriteBatch)pMan.BaseGetActive();

            while (pSpriteBatch != null)
            {
                if (pSpriteBatch.enabled)
                {
                    SpriteBaseNodeManager pSBNodeMan = pSpriteBatch.GetSBNodeManager();
                    Debug.Assert(pSBNodeMan != null);

                    pSBNodeMan.Draw();
                }
                pSpriteBatch = (SpriteBatch)pSpriteBatch.GetNext();
            }
        }
Beispiel #6
0
 public SpriteBaseNode()
 {
     this.pSpriteBase    = null;
     this.pBackSBNodeMan = null;
 }