Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        public static void Dump()
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.BaseDump();
        }
Exemplo n.º 3
0
        public static void Remove(SpriteBatch pNode)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            Debug.Assert(pNode != null);
            pMan.BaseRemove(pNode);
        }
Exemplo n.º 4
0
        private void PrivStatBatchDump()
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            Debug.WriteLine("");
            Debug.WriteLine("Sprite Batch Manager Stats---------------------");
            pMan.BaseStatDump();
        }
Exemplo n.º 5
0
        public static void DumpBatches()
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            Debug.WriteLine("");
            Debug.WriteLine("Sprite Batch Manager Stats---------------------");
            pMan.BaseDumpNodes();
        }
Exemplo n.º 6
0
        public static SpriteBatch Find(SpriteBatch.Name name)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.SetName(name);

            SpriteBatch pData = (SpriteBatch)pMan.BaseFind(pMan.poNodeCompare);

            return(pData);
        }
Exemplo n.º 7
0
        public static SpriteBatch Add(SpriteBatch.Name name)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            SpriteBatch pSBatch = (SpriteBatch)pMan.BaseAdd();

            pSBatch.SetName(name);

            return(pSBatch);
        }
Exemplo n.º 8
0
        public static SpriteBatch Add(SpriteBatch.Name name, int reserveNum = 3, int reserveGrow = 1)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            SpriteBatch pNode = (SpriteBatch)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(name, reserveNum, reserveGrow);
            return(pNode);
        }
Exemplo n.º 9
0
        private static SpriteBatch Add(SpriteBatch.Name name, SpriteBatch pSB)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            SpriteBatch pNode = (SpriteBatch)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            pNode = pSB;

            return(pSB);
        }
Exemplo n.º 10
0
        public static SpriteBatch Replace(SpriteBatch.Name name, SpriteBatch pSB)
        {
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.SetName(name);

            SpriteBatch pData = (SpriteBatch)pMan.BaseFind(pMan.poNodeCompare);
            SpriteBatch tmp   = pData;

            SpriteBatchMan.Remove(pData);
            SpriteBatchMan.Add(name, pSB);

            return(tmp);
        }
Exemplo n.º 11
0
        public static void Destroy()
        {
            // Get the instance
            SpriteBatchMan pMan = SpriteBatchMan.PrivGetInstance();

            Debug.Assert(pMan != null);

#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("--->SpriteBatchMan.Destroy()");
#endif
            pMan.BaseDestroy();

#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("     {0} ({1})", pMan.poNodeCompare, pMan.poNodeCompare.GetHashCode());
            Debug.WriteLine("     {0} ({1})", SpriteBatchMan.pInstance, SpriteBatchMan.pInstance.GetHashCode());
#endif

            pMan.poNodeCompare       = null;
            SpriteBatchMan.pInstance = null;
        }
Exemplo n.º 12
0
        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;
            }
        }
Exemplo n.º 13
0
        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;
            }
        }