Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8903 in orxonox.OLD for branches/mountain_lake/src/world_entities


Ignore:
Timestamp:
Jun 29, 2006, 1:37:36 PM (18 years ago)
Author:
hdavid
Message:

branches/mountain_lake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/world_entities/skydome.cc

    r8800 r8903  
    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(); 
    49  
     48  this->toReflectionList();
     49
    5050}
    5151
     
    5757{
    5858  PRINTF(0)("Deleting Skydome\n");
    59  
     59
    6060  if (glIsTexture(texture))
    6161    glDeleteTextures(1, &texture);
     
    8888  glPushMatrix();
    8989  glTranslatef(0.0f,pRadius,0.0f);
    90  
     90
    9191
    9292  glBegin(GL_TRIANGLES);
     
    115115
    116116  // Make sure our vertex array is clear
    117 //   if (planeVertices)
    118 //   {
    119 //     delete planeVertices;
    120 //     planeVertices = NULL;
    121 //   }
     117  if (planeVertices)
     118  {
     119    delete planeVertices;
     120    planeVertices = NULL;
     121  }
    122122
    123123  // Make sure our index array is clear
    124 //   if (indices)
    125 //   {
    126 //     delete indices;
    127 //     indices = NULL;
    128 //   }
     124  if (indices)
     125  {
     126    delete indices;
     127    indices = NULL;
     128  }
    129129
    130130  // Set the number of divisions into a valid range
    131131  int divs = divisions;
    132   if (divisions < 1) 
     132  if (divisions < 1)
    133133    divs = 1;
    134134
    135   if (divisions > 256) 
    136     divs = 256; 
     135  if (divisions > 256)
     136    divs = 256;
    137137
    138138  pRadius = planetRadius;
     
    152152  float delta = plane_size/(float)divs;
    153153  float tex_delta = 2.0f/(float)divs;
    154  
     154
    155155  // Variables we'll use during the dome's generation
    156156  float x_dist   = 0.0f;
     
    193193      int startvert = (i*(divs+1) + j);
    194194
    195         // tri 1
     195      // tri 1
    196196      indices[index++] = startvert;
    197197      indices[index++] = startvert+1;
     
    203203      indices[index++] = startvert+divs+1;
    204204    }
    205   } 
    206 }
     205  }
     206}
Note: See TracChangeset for help on using the changeset viewer.