Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2847 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Nov 13, 2004, 12:12:33 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: implemented destructors of Class Array and Class Material… working

Location:
orxonox/trunk/importer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/array.cc

    r2842 r2847  
    2222{
    2323  initializeArray ();
     24}
     25
     26/**
     27   \brief deletes an Array.
     28   It does this by first deleting all the array-entries, and then delete the array[] itself
     29*/
     30Array::~Array()
     31{
     32  if (verbose >= 2)
     33    printf("deleting array\n");
     34  Entry* walker = firstEntry;
     35  Entry* last;
     36  while (walker != NULL)
     37    {
     38      last = walker;
     39      walker = walker->next;
     40      delete last;
     41    }
     42  delete [] array;
    2443}
    2544
  • orxonox/trunk/importer/array.h

    r2842 r2847  
    2121 public:
    2222  Array ();
     23  ~Array();
    2324
    2425  void initializeArray ();
  • orxonox/trunk/importer/framework.cc

    r2846 r2847  
    22#include "object.h"
    33
    4 int verbose = 1;
     4int verbose = 2;
    55WindowHandler wHandler;  // Create an instance of the whandler basecode class
    66Object* obj;
  • orxonox/trunk/importer/material.cc

    r2842 r2847  
    3636 
    3737  setName (mtlName);
     38}
     39
     40/**
     41    \brief deletes a Material
     42*/
     43Material::~Material()
     44{
     45  if (verbose >= 2)
     46    printf ("delete Material %s\n", name);
     47  if (nextMat != NULL)
     48    delete nextMat;
    3849}
    3950
  • orxonox/trunk/importer/object.cc

    r2846 r2847  
    2424
    2525  initialize();
    26   //  importFile ("");
     26
    2727  BoxObject();
    2828
     
    5757
    5858  finalize();
     59}
     60
     61/**
     62   \brief deletes an Object
     63*/
     64Object::~Object()
     65{
     66  if (verbose >= 2)
     67    printf ("Don't know what to delete, or how to destroy a glList\n");
     68
    5969}
    6070
     
    8090  vTexture = new Array();
    8191
     92  material = new Material();
     93
    8294  glNewList (listNumber, GL_COMPILE);
    8395  glEnableClientState (GL_VERTEX_ARRAY);
     
    111123  glEnd();
    112124  glEndList();
     125  delete vertices;
     126  delete normals;
     127  delete vTexture;
     128  if (material != NULL)
     129    delete material;
    113130  return true;
    114131}
     
    351368    printf ("Opening mtlFile: %s\n", mtlFileName);
    352369  char Buffer[500];
    353   vertices = new Array();
    354   material = new Material();
    355370  Material* tmpMat = material;
    356371  while(!MTL_FILE->eof())
Note: See TracChangeset for help on using the changeset viewer.