Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9006 in orxonox.OLD for trunk/src/world_entities/skydome.cc


Ignore:
Timestamp:
Jul 2, 2006, 2:11:59 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the mountain_lake branche back to the trunk
merged with command:
svn merge -r8799:HEAD https://svn.orxonox.net/orxonox/branches/mountain_lake .

conflicts in script taken from the branche, since they are indentation-problems.

also fixed the delete-bug for the lightning-effect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/skydome.cc

    r8793 r9006  
    11/*
    22   orxonox - the future of 3D-vertical-scrollers
    3 
     3 
    44   Copyright (C) 2006 orx
    5 
     5 
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 2, or (at your option)
    99   any later version.
    10 
     10 
    1111### File Specific:
    1212   main-programmer: hdavid, amaechler
     
    4343{
    4444  PRINTF(0)("Skydome init\n");
    45  
     45
    4646  this->setClassID(CL_SKYDOME, "Skydome");
    4747  this->toList(OM_BACKGROUND);
    48   this->toReflectionList(); 
     48  this->toReflectionList();
    4949 
     50  activateDome = false;
     51
    5052}
    5153
     
    5759{
    5860  PRINTF(0)("Deleting Skydome\n");
    59  
     61
    6062  if (glIsTexture(texture))
    6163    glDeleteTextures(1, &texture);
     
    7476
    7577
     78void Skydome::activate()
     79{
     80  this->activateDome = true;
     81}
     82
     83void Skydome::deactivate()
     84{
     85  this->activateDome = false;
     86}
     87
     88
    7689void Skydome::draw() const
    7790{
     91  if(!activateDome)
     92    return;
     93 
    7894  glPushAttrib(GL_ENABLE_BIT);
    7995
     
    88104  glPushMatrix();
    89105  glTranslatef(0.0f,pRadius,0.0f);
    90  
     106
    91107
    92108  glBegin(GL_TRIANGLES);
     
    113129{
    114130  PRINTF(0)("Generating a sky plane");
    115  
     131
    116132  // Make sure our vertex array is clear
    117   if (planeVertices) 
     133  if (planeVertices)
    118134  {
    119135    delete planeVertices;
     
    130146  // Set the number of divisions into a valid range
    131147  int divs = divisions;
    132   if (divisions < 1) 
     148  if (divisions < 1)
    133149    divs = 1;
    134150
    135   if (divisions > 256) 
    136     divs = 256; 
     151  if (divisions > 256)
     152    divs = 256;
    137153
    138154  pRadius = planetRadius;
     
    152168  float delta = plane_size/(float)divs;
    153169  float tex_delta = 2.0f/(float)divs;
    154  
     170
    155171  // Variables we'll use during the dome's generation
    156172  float x_dist   = 0.0f;
     
    193209      int startvert = (i*(divs+1) + j);
    194210
    195         // tri 1
     211      // tri 1
    196212      indices[index++] = startvert;
    197213      indices[index++] = startvert+1;
     
    203219      indices[index++] = startvert+divs+1;
    204220    }
    205   } 
    206 }
     221  }
     222}
Note: See TracChangeset for help on using the changeset viewer.