Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8904 in orxonox.OLD for branches/single_player_map/src/lib/graphics


Ignore:
Timestamp:
Jun 29, 2006, 1:40:35 PM (18 years ago)
Author:
bottac
Message:

bugfix

Location:
branches/single_player_map/src/lib/graphics/importer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/graphics/importer/bsp_file.cc

    r8894 r8904  
    4646BspFile::BspFile()
    4747{}
     48
     49BspFile::~ BspFile()
     50{
     51  delete [] nodes;
     52  delete [] leaves;
     53  delete [] planes;
     54  delete [] bspModels;
     55  delete [] leafFaces;
     56  delete [] faces;
     57  delete [] leafBrushes;
     58  delete [] brushes;
     59  delete [] brushSides;
     60  delete [] vertice;
     61  delete [] meshverts;
     62  delete [] visData;
     63  delete [] textures;
     64  delete [] patchVertice;
     65  delete [] patchIndexes;
     66 // delete [] patchTrianglesPerRow;
     67  delete [] lightMaps;
     68 
     69  for(int i = 0; i < this->numPatches; ++i) delete this->VertexArrayModels[i];
     70 // delete  [] VertexArrayModels;
     71 
     72  for(int i = 0; i < this->numTextures; ++i)
     73  {
     74    delete this->Materials[i].mat;
     75    //delete this->Materials[i].aviMat;
     76  }
     77  delete [] this->Materials;
     78  //delete [] testSurf;
     79 
     80 
     81 
     82}
    4883
    4984/**
     
    294329    this->patchVertice = new char[8*8*44*(this->numPatches+10)];
    295330    this->patchIndexes = new char[7*8*2*4*(this->numPatches+10)];
    296     this->patchRowIndexes = new int*[7*4*this->numPatches];
     331 // this->patchRowIndexes = new int*[7*4*this->numPatches]; Not needed?
    297332    this->patchTrianglesPerRow = new char[7*4*this->numPatches];
    298333    this->VertexArrayModels  = new VertexArrayModel*[this->numPatches];
     
    464499
    465500    if(File(absFileName).exists()) {
    466       PRINTF(0)("BSP FILE: gefunden . \n");
     501      PRINTF(4)("BSP FILE: gefunden . \n");
    467502      this->Materials[i] = this->loadAVI(fileName);
    468503      continue;
     
    553588    }
    554589
    555     PRINTF(0)("BSP FILE: Textur %s nicht  gefunden . \n", &this->textures[8+72*i]);
     590    PRINTF(0)("BSP FILE: Texture %s not found.",&this->textures[8+ 72*i] );
    556591    //  Default Material
    557592    this->Materials[i].mat = new Material();
     
    10121047  Face->meshvert = patchOffset -sz;  //3*(patchOffset-sz)*level1*level1;
    10131048  Face->n_meshverts = sz;
    1014   PRINTF(4)("BSP FILE: sz: %i. \n", sz);
    1015   PRINTF(4)("BSP FILE: Face->meshvert %i . \n", Face->meshvert);
     1049  PRINTF(0)("BSP FILE: sz: %i. \n", sz);
     1050  PRINTF(0)("BSP FILE: Face->meshvert %i . \n", Face->meshvert);
    10161051
    10171052  //Face->n_meshverts = sz;
  • branches/single_player_map/src/lib/graphics/importer/bsp_file.h

    r8490 r8904  
    151151public:
    152152  BspFile();
     153  ~BspFile();
    153154  int read(const char* name );
    154155  void build_tree();
     
    183184
    184185  int** patchRowIndexes;
    185   VertexArrayModel** VertexArrayModels;
     186  VertexArrayModel** VertexArrayModels; 
    186187  int patchOffset;
    187188
  • branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc

    r8894 r8904  
    7777} */
    7878
    79 void BspManager::load(const char* fileName, float scale)
     79BspManager::~BspManager()
     80{
     81  if(this->bspFile)
     82    delete this->bspFile;
     83}
     84 
     85int BspManager::load(const char* fileName, float scale)
    8086{
    8187  // open a BSP file
     88 
     89 
    8290  this->bspFile = new BspFile();
    8391  this->bspFile->scale =  scale;
    84   this->bspFile->read(ResourceManager::getFullName(fileName).c_str());
     92  if(this->bspFile->read(ResourceManager::getFullName(fileName).c_str()) == -1)
     93    return -1;
    8594  this->bspFile->build_tree();
    8695  this->root  = this->bspFile->get_root();
     
    8897
    8998  this->outputFraction = 1.0f;
     99 
     100  return 0;
    90101}
    91102/*
  • branches/single_player_map/src/lib/graphics/importer/bsp_manager.h

    r8724 r8904  
    4141class WorldEntity;
    4242
     43
     44// Obsolete
    4345struct BspCollisionEvent
    4446{
     
    5456
    5557  BspManager(const char* fileName, float scale = 0.4f);
    56   void load(const char* fileName, float scale);
     58 
     59  // Deconstructor
     60  ~BspManager();
     61 
     62 
    5763
    5864  // Functions
     65  int load(const char* fileName, float scale);
    5966  const void draw();
    6067  const void tick(float time);
Note: See TracChangeset for help on using the changeset viewer.