示例#1
0
        public void increaseAtlasCapacity()
        {
            // if we're going beyond the current TextureAtlas's capacity,
            // all the previously initialized sprites will need to redo their texture coords
            // this is likely computationally expensive
            int quantity = (m_pobTextureAtlas.Capacity + 1) * 4 / 3;

            System.Diagnostics.Debug.WriteLine
            (
                string.Format(
                    "cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [{0}] to [{1}].",
                    (long)m_pobTextureAtlas.Capacity,
                    (long)m_pobTextureAtlas.Capacity
                    )
            );

            if (!m_pobTextureAtlas.resizeCapacity(quantity))
            {
                // serious problems
                System.Diagnostics.Debug.WriteLine("cocos2d: WARNING: Not enough memory to resize the atlas");
                Debug.Assert(false);
            }
        }