Beispiel #1
0
        /** Unloads the landscape data, but doesn´t destroy the landscape page. */
        public void Unload( )
        {
            if (isLoaded == false)
            {
                return;
            }

            if (neighbors[(int)Neighbor.South] != null)
            {
                neighbors[(int)Neighbor.South].SetNeighbor(Neighbor.North, null);
            }
            if (neighbors[(int)Neighbor.North] != null)
            {
                neighbors[(int)Neighbor.North].SetNeighbor(Neighbor.South, null);
            }
            if (neighbors[(int)Neighbor.East] != null)
            {
                neighbors[(int)Neighbor.East].SetNeighbor(Neighbor.West, null);
            }
            if (neighbors[(int)Neighbor.West] != null)
            {
                neighbors[(int)Neighbor.West].SetNeighbor(Neighbor.East, null);
            }
            for (long i = 0; i < 4; i++)
            {
                neighbors[i] = null;
            }

            // Unload the Tiles
            for (long i = 0; i < numTiles; i++)
            {
                for (long j = 0; j < numTiles; j++)
                {
                    Debug.Assert(tiles[i][j] != null);
                    tiles[i][j].Release();
                    tiles[i][j] = null;
                }
                //mTiles[ i ].clear();
            }
            //mTiles.clear ();

            if (pageNode != null)
            {
                // Unload the nodes
                pageNode.Clear();
                //pageNoderemoveAndDestroyAllChildren();

                //mPageNode->getParent()->removeChild( mPageNode->getName() );
                //delete mPageNode;

                // jsw - we need to call both of these to delete the scene node.  The first
                //  one removes it from the SceneManager's list of all nodes, and the 2nd one
                //  removes it from the tree of scene nodes.
                pageNode.Creator.DestroySceneNode(pageNode.Name);
                pageNode.Parent.RemoveChild(pageNode.Name);
                pageNode = null;
            }
            Texture.TextureManager.Instance.Unload(tableX, tableZ);
            isLoaded = false;
        }
Beispiel #2
0
 /// <summary>
 ///    Clears the overlay of all attached items.
 /// </summary>
 public void Clear()
 {
     rootNode.Clear();
     elementList.Clear();
 }