Changeset 8903 in orxonox.OLD for branches/mountain_lake/src/world_entities
- Timestamp:
- Jun 29, 2006, 1:37:36 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mountain_lake/src/world_entities/skydome.cc
r8800 r8903 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler … … 43 43 { 44 44 PRINTF(0)("Skydome init\n"); 45 45 46 46 this->setClassID(CL_SKYDOME, "Skydome"); 47 47 this->toList(OM_BACKGROUND); 48 this->toReflectionList(); 49 48 this->toReflectionList(); 49 50 50 } 51 51 … … 57 57 { 58 58 PRINTF(0)("Deleting Skydome\n"); 59 59 60 60 if (glIsTexture(texture)) 61 61 glDeleteTextures(1, &texture); … … 88 88 glPushMatrix(); 89 89 glTranslatef(0.0f,pRadius,0.0f); 90 90 91 91 92 92 glBegin(GL_TRIANGLES); … … 115 115 116 116 // 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 } 122 122 123 123 // 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 } 129 129 130 130 // Set the number of divisions into a valid range 131 131 int divs = divisions; 132 if (divisions < 1) 132 if (divisions < 1) 133 133 divs = 1; 134 134 135 if (divisions > 256) 136 divs = 256; 135 if (divisions > 256) 136 divs = 256; 137 137 138 138 pRadius = planetRadius; … … 152 152 float delta = plane_size/(float)divs; 153 153 float tex_delta = 2.0f/(float)divs; 154 154 155 155 // Variables we'll use during the dome's generation 156 156 float x_dist = 0.0f; … … 193 193 int startvert = (i*(divs+1) + j); 194 194 195 195 // tri 1 196 196 indices[index++] = startvert; 197 197 indices[index++] = startvert+1; … … 203 203 indices[index++] = startvert+divs+1; 204 204 } 205 } 206 } 205 } 206 }
Note: See TracChangeset
for help on using the changeset viewer.