Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 24, 2006, 1:23:47 PM (18 years ago)
Author:
bensch
Message:

Cleanup after merge

File:
1 edited

Legend:

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

    r9414 r9417  
    102102        this->numTextures = lump.length/sizeof(BspTexture);
    103103        this->textures = new char[lump.length];
    104         file.seekg( lump.offset );     
    105         file.read( TEXTURE_SEMANTICS, this->numTextures, 
     104        file.seekg( lump.offset );
     105        file.read( TEXTURE_SEMANTICS, this->numTextures,
    106106                this->textures, slurpedBytes );
    107107}
    108108void BspFile::readPlanes()
    109 {       
     109{
    110110        size_t slurpedBytes;
    111111        bsp_lump& lump = header.lumps[Planes];
     
    113113        this->planes = new plane[this->numPlanes];
    114114        file.seekg( lump.offset );
    115         file.read( PLANE_SEMANTICS, this->numPlanes, 
     115        file.read( PLANE_SEMANTICS, this->numPlanes,
    116116                this->planes, slurpedBytes );
    117117}
     
    124124        this->nodes = new node[this->numNodes];
    125125        file.seekg( lump.offset );
    126         file.read( NODE_SEMANTICS, this->numNodes, 
     126        file.read( NODE_SEMANTICS, this->numNodes,
    127127                this->nodes, slurpedBytes );
    128128}
     
    135135        this->leaves = new leaf[this->numLeafs];
    136136        file.seekg( lump.offset );
    137         file.read( LEAF_SEMANTICS, this->numLeafs, 
    138                 this->leaves, slurpedBytes );   
     137        file.read( LEAF_SEMANTICS, this->numLeafs,
     138                this->leaves, slurpedBytes );
    139139}
    140140
     
    146146        this->leafFaces = (char*)( new int[this->numLeafFaces] );
    147147        file.seekg( lump.offset );
    148         file.read( "i", this->numLeafFaces, 
     148        file.read( "i", this->numLeafFaces,
    149149                this->leafFaces, slurpedBytes );
    150150}
     
    157157        this->leafBrushes = (char*) ( new int[this->numLeafBrushes] );
    158158        file.seekg( lump.offset );
    159         file.read( "i", this->numLeafBrushes, 
    160                 this->leafBrushes, slurpedBytes );     
     159        file.read( "i", this->numLeafBrushes,
     160                this->leafBrushes, slurpedBytes );
    161161}
    162162
     
    168168        this->bspModels = new model[this->numBspModels];
    169169        file.seekg( lump.offset );
    170         file.read( MODEL_SEMANTICS, this->numBspModels, 
     170        file.read( MODEL_SEMANTICS, this->numBspModels,
    171171                this->bspModels, slurpedBytes );
    172172}
     
    179179        this->brushes = new brush[numBrushes];
    180180        file.seekg( lump.offset );
    181         file.read( BRUSH_SEMANTICS, numBrushes, 
     181        file.read( BRUSH_SEMANTICS, numBrushes,
    182182                this->brushes, slurpedBytes );
    183183}
     
    189189        this->vertice = (char*)( new BspVertex[this->numVertex] );
    190190        file.seekg( lump.offset );
    191         file.read( VERTEX_SEMANTICS, this->numVertex, 
     191        file.read( VERTEX_SEMANTICS, this->numVertex,
    192192                this->vertice, slurpedBytes );
    193193}
     
    215215        this->faces = new face[this->numFaces];
    216216        file.seekg( lump.offset );
    217         file.read( FACE_SEMANTICS, this->numFaces, 
     217        file.read( FACE_SEMANTICS, this->numFaces,
    218218                this->faces, slurpedBytes );
    219219}
     
    226226        this->lightMaps = new lightmap[this->numLightMaps];
    227227        file.seekg( lump.offset );
    228         file.read( LIGHTMAP_SEMANTICS, this->numLightMaps, 
     228        file.read( LIGHTMAP_SEMANTICS, this->numLightMaps,
    229229                this->lightMaps, slurpedBytes );
    230230}
    231231void BspFile::readLightvols()
    232232{
    233         /* not loaded atm */   
     233        /* not loaded atm */
    234234}
    235235void BspFile::readBrushSides()
     
    241241        this->brushSides = new brushside[this->numBrushSides];
    242242        file.seekg( lump.offset );
    243         file.read( BRUSHSIDE_SEMANTICS, this->numBrushSides, 
     243        file.read( BRUSHSIDE_SEMANTICS, this->numBrushSides,
    244244                this->brushSides, slurpedBytes );
    245245}
     
    251251        file.seekg( lump.offset );
    252252        file.read( "i2", 1, this->visData, slurpedBytes );
    253         file.read( "b", lump.length-8, 
    254                 this->visData+8, slurpedBytes );       
     253        file.read( "b", lump.length-8,
     254                this->visData+8, slurpedBytes );
    255255}
    256256/**
     
    267267        if (file.exists() && file.open( File::ReadOnly ) ) {
    268268        PRINTF(0)("BSP FILE: Datei %s gefunden. \n", name);
    269        
     269
    270270                //BSP-Files have little endian order.
    271271                file.setByteorder( LittleEndian );
    272272                file.read( HEADER_SEMANTICS, (void*)&header, slurpedBytes );
    273273                if ( header.version != 46 ) {
    274                         PRINTF(0)("BSP FILE: Wrong BSPVersion. We only handle 0x2e-files!\n");   
    275                         //!< now, we should do some error handling             
     274                        PRINTF(0)("BSP FILE: Wrong BSPVersion. We only handle 0x2e-files!\n");
     275                        //!< now, we should do some error handling
    276276                        return ( -1 );
    277277                }
     
    280280                readPlanes();
    281281                readNodes();
    282                 readLeafs(); readLeafFaces(); readLeafBrushes(); 
    283                 readModels(); 
     282                readLeafs(); readLeafFaces(); readLeafBrushes();
     283                readModels();
    284284                readVertices(); readMeshVerts();
    285285                readBrushSides(); readBrushes();
     
    287287                readFaces();
    288288                readLightmaps(); readLightvols();
    289                 readVisdata(   
     289                readVisdata();
    290290        file.close();
    291291
Note: See TracChangeset for help on using the changeset viewer.