Changeset 5211 in orxonox.OLD
- Timestamp:
- Sep 21, 2005, 2:21:41 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5209 r5211 104 104 { 105 105 this->setClassID(CL_PARENT_NODE, "PNode"); 106 106 107 this->children = new tList<PNode>(); 107 108 this->bRelCoorChanged = true; -
trunk/src/lib/graphics/importer/model.cc
r5115 r5211 350 350 delete this->normals; 351 351 if (this->triangles) 352 delete this->triangles;352 delete[] this->triangles; 353 353 354 354 this->vertices = NULL; 355 355 this->vTexture = NULL; 356 356 this->normals = NULL; 357 this->triangles = NULL; this->triangleCount = 0; 357 this->triangles = NULL; 358 this->triangleCount = 0; 358 359 } 359 360 -
trunk/src/lib/graphics/importer/texture.cc
r4836 r5211 45 45 Texture::~Texture() 46 46 { 47 if (this->texture )47 if (this->texture != 0) 48 48 glDeleteTextures(1, &this->texture); 49 49 } -
trunk/src/lib/graphics/light.cc
r5156 r5211 244 244 if (this->lights[i]) 245 245 delete lights[i]; 246 delete lights;246 delete[] lights; 247 247 LightManager::singletonRef = NULL; 248 248 } -
trunk/src/lib/graphics/render2D/element_2d.cc
r5118 r5211 90 90 this->parent = NULL; 91 91 this->children = new tList<Element2D>; 92 this->absDirection = 0.0; 92 93 this->relDirection = 0.0; 93 94 this->bRelCoorChanged = true; … … 844 845 NullElement2D::~NullElement2D () 845 846 { 846 //delete singletonRef;847 847 NullElement2D::singletonRef = NULL; 848 848 } -
trunk/src/lib/graphics/render2D/element_2d.h
r5113 r5211 193 193 Vector absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) ) 194 194 float relDirection; //!< direction relative to the parent 195 float absDirection; //!< absolute dire vtion in the world ( from (0,0,1) )195 float absDirection; //!< absolute diretion in the world ( from (0,0,1) ) 196 196 197 197 Vector prevRelCoordinate; //!< The last Relative Coordinate from the last update-Cycle. -
trunk/src/lib/math/curve.cc
r4836 r5211 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 13 13 co-programmer: Patrick Boenzli 14 14 15 ADD: Patrick Boenzli B-Spline 16 17 18 TODO: 15 ADD: Patrick Boenzli B-Spline 16 17 18 TODO: 19 19 local-Time implementation 20 20 NURBS 21 21 tList implementation 22 22 23 23 */ 24 24 … … 33 33 34 34 35 /** 35 /** 36 36 * default constructor for a Curve 37 37 */ … … 71 71 void Curve::addNode(const Vector& newNode, unsigned int insertPosition) 72 72 { 73 74 73 if (this->nodeCount == 0 || insertPosition > this->nodeCount) 75 74 return addNode(newNode); … … 85 84 { 86 85 while (tmpNode->next->number != insertPosition) 87 86 tmpNode= tmpNode->next; 88 87 insNode->next = tmpNode->next; 89 88 tmpNode->next = insNode; … … 199 198 tmpNode->factor = binCoef; 200 199 if (tmpNode =tmpNode->next) 201 202 203 204 200 { 201 binCoef *=(n-k)/(k+1); 202 ++k; 203 } 205 204 } 206 205 … … 212 211 dirCurve = new BezierCurve(1); 213 212 while(tmpNode->next) 214 215 216 217 218 219 220 221 222 213 { 214 Vector tmpVector = (tmpNode->next->position)- (tmpNode->position); 215 tmpVector.x*=(float)nodeCount; 216 tmpVector.y*=(float)nodeCount; 217 tmpVector.z*=(float)nodeCount; 218 tmpVector.normalize(); 219 this->dirCurve->addNode(tmpVector); 220 tmpNode = tmpNode->next; 221 } 223 222 } 224 223 } … … 229 228 * @return the Position on the Path 230 229 */ 231 Vector BezierCurve::calcPos(float t) 230 Vector BezierCurve::calcPos(float t) 232 231 { 233 232 Vector ret = Vector(0.0,0.0,0.0); … … 237 236 double factor = pow(1.0-t,nodeCount-1); 238 237 while(tmpNode) 239 240 241 242 243 244 245 246 238 { 239 ret.x += tmpNode->factor * factor * tmpNode->position.x; 240 ret.y += tmpNode->factor * factor * tmpNode->position.y; 241 ret.z += tmpNode->factor * factor * tmpNode->position.z; 242 factor *= t/(1.0-t); // same as pow but much faster. 243 244 tmpNode = tmpNode->next; 245 } 247 246 } 248 247 else if (nodeCount == 2) -
trunk/src/lib/physics/physics_engine.cc
r5129 r5211 58 58 } 59 59 delete itPC; 60 60 delete this->connections; 61 61 // 62 62 // // delete all PhysicsInterfaces, still in existence (this could be dangerous) -
trunk/src/lib/util/list.h
r5209 r5211 82 82 { 83 83 listElement<T>* le = this->currentEl->next; 84 //delete this->currentEl->curr; 84 //delete this->currentEl->curr; //! THIS IS EXTREMELY UNSAFE (the list only stores pointers not instances) // 85 85 delete this->currentEl; 86 86 this->currentEl = le; -
trunk/src/story_entities/campaign.cc
r5115 r5211 161 161 } 162 162 delete this->entities; 163 delete it; 163 164 } 164 165 -
trunk/src/story_entities/world.cc
r5209 r5211 165 165 this->setName(name); 166 166 this->debugWorldNr = worldID; 167 167 this->gameTime = 0.0f; 168 168 this->setSpeed(1.0); 169 169 this->music = NULL; 170 this->shell = NULL; 171 this->entities = NULL; 170 172 } 171 173 … … 259 261 // load the parameters 260 262 // name 261 char* temp;262 263 const char* string = grabParameter( root, "name"); 263 264 if( string == NULL) 264 265 { 265 266 PRINTF(2)("World is missing a proper 'name'\n"); 266 string = "Unknown"; 267 temp = new char[strlen(string)+1]; 268 strcpy( temp, string); 269 this->setName(temp); 267 this->setName("Unknown"); 270 268 } 271 269 else 272 270 { 273 temp = new char[strlen(string )+1]; 274 strcpy( temp, string); 275 this->setName(temp); 271 this->setName(string); 276 272 } 277 273 … … 478 474 ClassList::debug(); 479 475 480 this->music = (OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL);481 music->playback();476 this->music = NULL;//(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL); 477 //music->playback(); 482 478 } 483 479 -
trunk/src/util/loading/load_param.cc
r5141 r5211 133 133 this->types = NULL; 134 134 this->description = NULL; 135 this->defaultValues = NULL; 135 136 this->paramName = new char[strlen(paramName)+1]; 136 137 strcpy(this->paramName, paramName); 137 this->defaultValues = NULL;138 138 } 139 139 … … 158 158 } 159 159 160 delete []this->types;161 delete []this->defaultValues;162 delete []this->paramName;163 delete []this->description;160 delete[] this->types; 161 delete[] this->defaultValues; 162 delete[] this->paramName; 163 delete[] this->description; 164 164 } 165 165 -
trunk/src/util/resource_manager.cc
r5208 r5211 81 81 } 82 82 delete tmpIt; 83 84 83 delete this->imageDirs; 84 85 delete[] this->dataDir; 85 86 86 87 ResourceManager::singletonRef = NULL; … … 356 357 PRINTF(4)("Image %s resides to %s\n", fileName, imgName); 357 358 tmpResource->pointer = new Texture(imgName); 358 delete []imgName;359 delete[] imgName; 359 360 break; 360 361 } 361 delete []imgName;362 delete[] imgName; 362 363 tmpDir = iterator->nextElement(); 363 364 } … … 375 376 if (tmpResource->pointer) 376 377 this->resourceList->add(tmpResource); 377 delete []fullName;378 delete[] fullName; 378 379 } 379 380 if (tmpResource->pointer) … … 631 632 } 632 633 else 634 { 635 delete[] tmpDirName; 633 636 return false; 637 } 634 638 } 635 639
Note: See TracChangeset
for help on using the changeset viewer.