Index: /trunk/src/story_entities/simple_game_menu.cc
===================================================================
--- /trunk/src/story_entities/simple_game_menu.cc	(revision 6990)
+++ /trunk/src/story_entities/simple_game_menu.cc	(revision 6991)
@@ -57,6 +57,6 @@
 
   this->cameraVector = Vector(50.0, 0.0, 0.0);
-  this->menuLayer.push_back(new MenuLayer());
-  this->menuLayer.push_back(new MenuLayer());
+  this->menuLayers.push_back(MenuLayer());
+  this->menuLayers.push_back(MenuLayer());
 
   this->layerIndex = 0;
@@ -177,5 +177,5 @@
                                         State::getResY() / 2.0f - 60.0f,
                                         0.0f);
-      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
+      this->menuLayers[0].menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
 
     }
@@ -185,7 +185,7 @@
       this->menuStartMultiplayerGame->setBindNode((const PNode*)NULL);
       this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f,
-                                                   State::getResY() / 2.0f + ((this->menuLayer[0]->menuList.size() -1 ) * 60.0f),
+                                                   State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f),
                                                    0.0f);
-      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
+      this->menuLayers[0].menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
     }
     else if( !strcmp( "Quit_Menu", (*entity)->getName()))
@@ -194,12 +194,12 @@
       this->menuQuitGame->setBindNode((const PNode*)NULL);
       this->menuQuitGame->setRelCoor2D(State::getResX() / 2.0f,
-                                       State::getResY() / 2.0f + ((this->menuLayer[0]->menuList.size() -1 )* 60.0f),
+                                       State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 )* 60.0f),
                                        0.0f);
-      this->menuLayer[0]->menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
+      this->menuLayers[0].menuList.push_back(dynamic_cast<ImageEntity*>(*entity));
     }
   }
   this->menuSelected->getNullElement()->update2D(0.1f);
   this->menuSelectedIndex = 0;
-  this->menuSelected = this->menuLayer[0]->menuList[this->menuSelectedIndex];
+  this->menuSelected = this->menuLayers[0].menuList[this->menuSelectedIndex];
   this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
 
@@ -213,5 +213,5 @@
     if( se->isContainedInMenu())
     {
-      this->menuLayer[1]->storyList.push_back(se);
+      this->menuLayers[1].storyList.push_back(se);
 
       // generating menu item
@@ -220,7 +220,7 @@
       ie->setVisibility(false);
       ie->setBindNode((const PNode*)NULL);
-      ie->setRelCoor2D(State::getResX() / 2.0f - 200.0f, State::getResY() / 2.0f + ((this->menuLayer[1]->menuList.size() - 2.0f) * 60.0f), 0.0f);
+      ie->setRelCoor2D(State::getResX() / 2.0f - 200.0f, State::getResY() / 2.0f + ((this->menuLayers[1].menuList.size() - 2.0f) * 60.0f), 0.0f);
       ie->setSize2D(100.0f, 50.0f);
-      this->menuLayer[1]->menuList.push_back(ie);
+      this->menuLayers[1].menuList.push_back(ie);
 
       // generating screenshoot item
@@ -231,5 +231,5 @@
       ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f, 0.0f);
       ie->setSize2D(140.0f, 105.0f);
-      this->menuLayer[1]->screenshootList.push_back(ie);
+      this->menuLayers[1].screenshootList.push_back(ie);
     }
   }
@@ -244,9 +244,10 @@
 
   std::vector<ImageEntity*>::iterator it;
-  std::vector<MenuLayer*>::iterator mit;
-  for(mit = this->menuLayer.begin(); mit != this->menuLayer.end(); mit++)
-  {
-    (*mit)->menuList.erase((*mit)->menuList.begin(), (*mit)->menuList.end());
-    (*mit)->storyList.erase((*mit)->storyList.begin(), (*mit)->storyList.end());
+  std::vector<MenuLayer>::iterator mit;
+  for(mit = this->menuLayers.begin(); mit != this->menuLayers.end(); mit++)
+  {
+    (*mit).menuList.clear(); //erase((*mit).menuList.begin(), (*mit).menuList.end());
+    (*mit).storyList.clear(); //erase((*mit).storyList.begin(), (*mit).storyList.end());
+    (*mit).screenshootList.clear();
   }
 }
@@ -329,5 +330,5 @@
       {
         // switch to first submenu
-        if( this->menuLayer[1]->menuList.size() == 0)
+        if( this->menuLayers[1].menuList.size() == 0)
         {
           PRINTF(1)("Haven't got any StoryEntities to play!\n");
@@ -348,5 +349,5 @@
     if( event.type == SDLK_RETURN && event.bPressed == true)
     {
-      this->setNextStoryID( this->menuLayer[1]->storyList[this->menuSelectedIndex]->getStoryID());
+      this->setNextStoryID( this->menuLayers[1].storyList[this->menuSelectedIndex]->getStoryID());
       this->stop();
     }
@@ -362,13 +363,13 @@
   if( event.type == SDLK_DOWN && event.bPressed == true)
   {
-    if(this->menuSelectedIndex < (this->menuLayer[this->layerIndex]->menuList.size() - 1))
-    {
-      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[++this->menuSelectedIndex];
+    if(this->menuSelectedIndex < (this->menuLayers[this->layerIndex].menuList.size() - 1))
+    {
+      this->menuSelected = this->menuLayers[this->layerIndex].menuList[++this->menuSelectedIndex];
       this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
 
       if( this->layerIndex == 1)
       {
-        this->menuLayer[1]->screenshootList[this->menuSelectedIndex]->setVisibility(true);
-        this->menuLayer[1]->screenshootList[this->menuSelectedIndex-1]->setVisibility(false);
+        this->menuLayers[1].screenshootList[this->menuSelectedIndex]->setVisibility(true);
+        this->menuLayers[1].screenshootList[this->menuSelectedIndex-1]->setVisibility(false);
       }
     }
@@ -378,11 +379,11 @@
     if(this->menuSelectedIndex > 0)
     {
-      this->menuSelected = this->menuLayer[this->layerIndex]->menuList[--this->menuSelectedIndex];
+      this->menuSelected = this->menuLayers[this->layerIndex].menuList[--this->menuSelectedIndex];
       this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
 
       if( this->layerIndex == 1)
       {
-        this->menuLayer[1]->screenshootList[this->menuSelectedIndex]->setVisibility(true);
-        this->menuLayer[1]->screenshootList[this->menuSelectedIndex+1]->setVisibility(false);
+        this->menuLayers[1].screenshootList[this->menuSelectedIndex]->setVisibility(true);
+        this->menuLayers[1].screenshootList[this->menuSelectedIndex+1]->setVisibility(false);
       }
     }
@@ -399,5 +400,5 @@
 {
   // wrong sizes
-  if(layer1 >= this->menuLayer.size() || layer2 >= this->menuLayer.size())
+  if(layer1 >= this->menuLayers.size() || layer2 >= this->menuLayers.size())
     return;
 
@@ -406,10 +407,10 @@
   std::vector<ImageEntity*>::iterator it;
   // fade old menu
-  for( it = this->menuLayer[layer1]->menuList.begin(); it != this->menuLayer[layer1]->menuList.end(); it++)
+  for( it = this->menuLayers[layer1].menuList.begin(); it != this->menuLayers[layer1].menuList.end(); it++)
   {
     (*it)->setVisibility(false);
   }
   //also fade the screenshots if in level choosement mode
-  for( it = this->menuLayer[layer1]->screenshootList.begin(); it != this->menuLayer[layer1]->screenshootList.end(); it++)
+  for( it = this->menuLayers[layer1].screenshootList.begin(); it != this->menuLayers[layer1].screenshootList.end(); it++)
   {
     (*it)->setVisibility(false);
@@ -419,5 +420,5 @@
   PRINTF(0)("Showing layer %i\n", layer1);
   // beam here the new menu
-  for( it = this->menuLayer[layer2]->menuList.begin(); it != this->menuLayer[layer2]->menuList.end(); it++ )
+  for( it = this->menuLayers[layer2].menuList.begin(); it != this->menuLayers[layer2].menuList.end(); it++ )
   {
     (*it)->setVisibility(true);
@@ -426,10 +427,10 @@
 
   this->layerIndex = layer2;
-  this->menuSelected = this->menuLayer[layer2]->menuList[0];
+  this->menuSelected = this->menuLayers[layer2].menuList[0];
   this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());
   this->menuSelectedIndex = 0;
 
   if( layer2 == 1)
-    this->menuLayer[layer2]->screenshootList[0]->setVisibility(true);
+    this->menuLayers[layer2].screenshootList[0]->setVisibility(true);
 }
 
Index: /trunk/src/story_entities/simple_game_menu.h
===================================================================
--- /trunk/src/story_entities/simple_game_menu.h	(revision 6990)
+++ /trunk/src/story_entities/simple_game_menu.h	(revision 6991)
@@ -70,5 +70,5 @@
 
   private:
-    std::vector<MenuLayer*>           menuLayer;                       //!< the menu layer
+    std::vector<MenuLayer>            menuLayers;                      //!< the menu layer
     MenuLayer*                        selectedLayer;                   //!< the selected menu layer
     int                               layerIndex;
