Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6848 in orxonox.OLD


Ignore:
Timestamp:
Jan 30, 2006, 2:56:54 AM (18 years ago)
Author:
patrick
Message:

trunk: switching to element2sd

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.h

    r6841 r6848  
    114114    inline void setVisibility(bool visible) { this->bVisible = visible; };
    115115    /** @returns the visibility state */
    116     inline bool isVisible() { return this->bVisible; };
     116    inline bool isVisible() const { return this->bVisible; };
    117117
    118118
  • trunk/src/story_entities/simple_game_menu.cc

    r6845 r6848  
    190190      PRINTF(0)("Got a new menu entry |%s|\n", se->getName());
    191191      ImageEntity* ie = new ImageEntity();
    192       ie->setAbsCoor(0.0f, this->menuLayer[1]->menuList.size() * -10.0f, 0.0f);
    193       //State::getObjectManager()->toList(dynamic_cast<WorldEntity*>(ie), OM_DEAD);
    194       //this->menuLayer[1]->menuList.push_back(ie);
     192      ie->setTexture(se->getMenuItemImage());
     193      ie->setRelCoor(0.0f,- (this->menuLayer[1]->menuList.size() * 10.0f), 0.0f);
     194      ie->setVisibility(false);
     195      this->menuLayer[1]->menuList.push_back(ie);
    195196    }
    196197  }
     
    306307  else if( this->layerIndex == 1)
    307308  {
    308 
     309    if( event.type == SDLK_RETURN && event.bPressed == true)
     310    {
     311      this->setNextStoryID( this->menuLayer[1]->storyList[this->menuSelectedIndex]->getStoryID());
     312      this->stop();
     313    }
    309314  }
    310315}
     
    328333  for( it = this->menuLayer[layer1]->menuList.begin(); it != this->menuLayer[layer1]->menuList.end(); it++ )
    329334  {
    330     (*it)->setAbsCoor(Vector(-100, -100, -100));
     335    (*it)->setVisibility(false);
    331336  }
    332337
     
    335340  // beam here the new menu
    336341  for( it = this->menuLayer[layer2]->menuList.begin(); it != this->menuLayer[layer2]->menuList.end(); it++ )
    337   {}
     342  {
     343    (*it)->setVisibility(true);
     344  }
    338345
    339346  this->layerIndex = layer2;
  • trunk/src/story_entities/story_entity.cc

    r6841 r6848  
    4141  this->storyID = -1;
    4242  this->description = NULL;
     43  this->menuItemImage = "pictures/menu/DefaultMenuItem.png";
    4344  this->nextStoryID = WORLD_ID_GAMEEND;
    4445  this->bMenuEntry = false;
  • trunk/src/world_entities/image_entity.cc

    r6841 r6848  
    161161void ImageEntity::draw() const
    162162{
     163  if( !this->isVisible())
     164    return;
     165
    163166  glPushMatrix();
    164167  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
Note: See TracChangeset for help on using the changeset viewer.