Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7596 in orxonox.OLD for branches


Ignore:
Timestamp:
May 11, 2006, 3:07:39 PM (19 years ago)
Author:
bottac
Message:
 
Location:
branches/bsp_model/src/lib/graphics/importer
Files:
3 edited

Legend:

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

    r7579 r7596  
    4040 * @param name the Name of the *.bsp file
    4141 */
    42 int BspFile::read(char* name)
     42int BspFile::read(const char* name)
    4343{
    4444  int offset;
    4545  int size;
    4646  struct stat results;
    47   name = "/root/data/Kanti175.bsp";
     47  // name = "/root/data/Kanti175.bsp";
    4848
    4949  if (stat( name , &results) == 0) {
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.h

    r7563 r7596  
    142142public:
    143143  BspFile();
    144   int read( char* name );
     144  int read(const char* name );
    145145  void build_tree();
    146146  void load_textures();
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r7592 r7596  
    2626#include "world_entities/player.h"
    2727#include "world_entities/playable.h"
     28#include "util/loading/resource_manager.h"
    2829// STL Containers
    2930#include <vector>
     
    3334
    3435
     36
    3537BspManager::BspManager()
    3638{
    3739  // open a BSP file
    3840  this->bspFile = new BspFile();
    39   this->bspFile->read("/root/data/Kanti175.bsp");
     41  this->bspFile->read(ResourceManager::getFullName("test.bsp").c_str());
    4042  this->bspFile->build_tree();
    4143  this->root  = this->bspFile->get_root();
     
    9597  if(this->outputFraction != 1.0f || this->outputAllSolid ) this->drawDebugCube(&this->cam);
    9698
    97   if (false  || viscluster < 0 ) // || (((int *)(this->bspFile->header))[35] == 0 )  || viscluster < 0)  //!< if (sizeof(Visdata) == 0)
     99  if (false || viscluster < 0  || ((int *)(this->bspFile->header))[35] == 0 )  //!< if (sizeof(Visdata) == 0)
    98100  {
    99101   
     
    121123      dMaxs = dir.x*(float)curLeaf.maxs[0] +dir.y*(float)curLeaf.maxs[1] +dir.z*(float)curLeaf.maxs[2] ;
    122124     
    123       if(dMins < 0.0 && dMaxs < 0.0)
     125      if(dMins < -100.0 && dMaxs < -100.0)
    124126      {   
    125         //continue;
     127       continue;
    126128      }
    127129   
     
    129131      // Iterate through all faces
    130132      for (int j = 0; j < curLeaf.n_leaffaces ; ++j) {
    131         const int f = ( j +  ((leaf *) (this->bspFile->leaves))[i].leafface) % this->bspFile->numFaces;
     133        const int g = (j +  curLeaf.leafface);
     134        const int f = ((int *)this->bspFile->leafFaces)[g];
    132135        if (f >=0 && !this->isAlreadyVisible(f)) {
    133136          this->alreadyVisible[f] = true;
     
    141144
    142145    } //for
    143   } else {
     146  }
     147  else {
    144148
    145149 
Note: See TracChangeset for help on using the changeset viewer.