Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8742 in orxonox.OLD


Ignore:
Timestamp:
Jun 23, 2006, 2:55:59 PM (18 years ago)
Author:
bensch
Message:

gui: better switch with keys

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/light.cc

    r7193 r8742  
    2727#include "debug.h"
    2828
    29 using namespace std;
    30 
    3129CREATE_FACTORY(Light, CL_LIGHT);
    3230
    3331//! Definition of the Lights and their Names
    3432int lightsV[] =
    35 {
    36                   GL_LIGHT0,
    37                   GL_LIGHT1,
    38                   GL_LIGHT2,
    39                   GL_LIGHT3,
    40                   GL_LIGHT4,
    41                   GL_LIGHT5,
    42                   GL_LIGHT6,
    43                   GL_LIGHT7
    44 };
     33  {
     34    GL_LIGHT0,
     35    GL_LIGHT1,
     36    GL_LIGHT2,
     37    GL_LIGHT3,
     38    GL_LIGHT4,
     39    GL_LIGHT5,
     40    GL_LIGHT6,
     41    GL_LIGHT7
     42  };
    4543
    4644/**
     
    4947  @todo what to do, if no Light-Slots are open anymore ???
    5048 */
    51  Light::Light(const TiXmlElement* root)
     49Light::Light(const TiXmlElement* root)
    5250{
    5351  PRINTF(4)("initializing Light number %d.\n", this->lightNumber);
     
    8987
    9088  LoadParam(root, "diffuse-color", this, Light, setDiffuseColor)
    91       .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
     89  .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
    9290
    9391  LoadParam(root, "specular-color", this, Light, setSpecularColor)
    94       .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
     92  .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
    9593
    9694  LoadParam(root, "attenuation", this, Light, setAttenuation)
    97       .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
     95  .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
    9896
    9997  LoadParam(root, "spot-direction", this, Light, setSpotDirection)
    100       .describe("sets the Direction of the Spot");
     98  .describe("sets the Direction of the Spot");
    10199
    102100  LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff)
    103       .describe("the cuttoff of the Spotlight");
     101  .describe("the cuttoff of the Spotlight");
    104102}
    105103
     
    263261{
    264262  LoadParamXML(root, "Lights", this, LightManager, loadLights)
    265       .describe("an XML-Element to load lights from.");
     263  .describe("an XML-Element to load lights from.");
    266264
    267265  LoadParam(root, "ambient-color", this, LightManager, setAmbientColor)
    268       .describe("sets the ambient Color of the Environmental Light");
     266  .describe("sets the ambient Color of the Environmental Light");
    269267}
    270268
     
    310308  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    311309    if (!this->lights[i])
    312   {
    313     this->lights[i]=light;
    314     return i;
    315   }
     310    {
     311      this->lights[i]=light;
     312      return i;
     313    }
    316314  PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
    317315  return -1;
     
    351349void LightManager::draw() const
    352350{
    353  PRINTF(4)("Drawing the Lights\n");
     351  PRINTF(4)("Drawing the Lights\n");
    354352  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    355353    if (this->lights[i] != NULL)
     
    372370  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    373371    if (this->lights[i])
    374       {
    375         this->lights[i]->debug();
    376       }
     372    {
     373      this->lights[i]->debug();
     374    }
    377375  PRINT(0)("-----------------------------LM-\n");
    378376}
  • trunk/src/lib/gui/gl/glgui_handler.cc

    r8717 r8742  
    135135        }
    136136
    137         if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
     137        if (dynamic_cast<GLGuiWidget*>(*it)->selectable() && dynamic_cast<GLGuiWidget*>(*it)->isVisible())
    138138        {
    139139          dynamic_cast<GLGuiWidget*>(*it)->select();
     
    183183        }
    184184
    185         if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
     185        if (dynamic_cast<GLGuiWidget*>(*it)->selectable() && dynamic_cast<GLGuiWidget*>(*it)->isVisible())
    186186        {
    187187          dynamic_cast<GLGuiWidget*>(*it)->select();
  • trunk/src/story_entities/menu/game_menu.cc

    r8719 r8742  
    217217
    218218void GameMenu::showMultiPlayer()
    219 {}
     219{
     220  if (this->networkBox == NULL)
     221  {
     222    this->networkBox = new OrxGui::GLGuiBox();
     223    {
     224      OrxGui::GLGuiButton* clientButton = new OrxGui::GLGuiPushButton("Client");
     225      networkBox->pack(clientButton);
     226
     227      OrxGui::GLGuiButton* serverButton = new OrxGui::GLGuiPushButton("Server");
     228      networkBox->pack(serverButton);
     229
     230
     231    }
     232  }
     233
     234  this->showSecondLevelElement(this->networkBox);
     235
     236}
    220237
    221238void GameMenu::showOptionsMenu()
Note: See TracChangeset for help on using the changeset viewer.