Changeset 8353 in orxonox.OLD for branches/bsp_model
- Timestamp:
- Jun 14, 2006, 1:07:17 AM (18 years ago)
- Location:
- branches/bsp_model/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_data.cc
r8351 r8353 77 77 { 78 78 FILE *pFile; //file stream 79 char* buffer; //buffer for frame data 80 81 82 sFrame* frame; //temp frame 83 sVec3D *pVertex; 84 int* pNormals; 79 // char* buffer; //buffer for frame data 85 80 86 81 … … 96 91 return false; 97 92 } 98 this->header = new MD 2Header;99 fread(this->header, 1, sizeof(MD 2Header), pFile);93 this->header = new MD3Header; 94 fread(this->header, 1, sizeof(MD3Header), pFile); 100 95 /* check for the header version: make sure its a md2 file :) */ 101 96 if( unlikely(this->header->version != MD2_VERSION) && unlikely(this->header->ident != MD2_IDENT)) … … 104 99 return false; 105 100 } 101 102 106 103 107 104 #if 0 … … 157 154 #endif 158 155 159 delete [] buffer;156 //delete [] buffer; 160 157 fclose(pFile); 161 158 … … 216 213 217 214 } 215 -
branches/bsp_model/src/lib/graphics/importer/md3/md3_data.h
r8351 r8353 47 47 48 48 //! This holds the header information that is read in at the beginning of the file: id software definition 49 struct MD 2Header49 struct MD3Header 50 50 { 51 51 int ident; //!< This is used to identify the file 52 52 int version; //!< The version number of the file (Must be 8) 53 53 54 int skinWidth; //!< The skin width in pixels 55 int skinHeight; //!< The skin height in pixels 56 int frameSize; //!< The size in bytes the frames are 54 char filename[68]; //!< The filename of the model 57 55 58 int numSkins; //!< The number of skins associated with the model 59 int numVertices; //!< The number of vertices (constant for each frame) 60 int numTexCoords; //!< The number of texture coordinates 61 int numTriangles; //!< The number of faces (polygons) 62 int numGlCommands; //!< The number of gl commands 63 int numFrames; //!< The number of animation frames 64 65 int offsetSkins; //!< The offset in the file for the skin data 66 int offsetTexCoords; //!< The offset in the file for the texture data 67 int offsetTriangles; //!< The offset in the file for the face data 68 int offsetFrames; //!< The offset in the file for the frames data 69 int offsetGlCommands; //!< The offset in the file for the gl commands data 70 int offsetEnd; //!< The end of the file offset 56 int boneFrameNum; //!< number of frames 57 int tagNum; //!< number of tags 58 int meshNum; //!< number of mesh 59 int maxTexNum; //!< number of texture 60 int boneFrameStart; //!< start of bone frames 61 int tagStart; //!< start of the tag 62 int meshStart; //!< mesh start 63 int fileSize; //!< file size 71 64 }; 72 65 … … 99 92 std::string fileName; //!< file name of the model File 100 93 std::string skinFileName; //!< file name of the skin file 101 MD 2Header* header; //!< the header file94 MD3Header* header; //!< the header file 102 95 103 96 sVec3D* pVertices; //!< pointer to the vertices data block -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
r8351 r8353 25 25 * md3 model 26 26 */ 27 MD3Model::MD3Model(FILE *pFile, int dataOffset) 28 {} 27 MD3Model::MD3Model(std::string filename, float scaling) 28 { 29 30 } 29 31 30 32 -
branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h
r8351 r8353 10 10 11 11 #include <string> 12 #include "model.h" 12 13 13 14 … … 19 20 { 20 21 21 class MD3Model 22 class MD3Model : public Model 22 23 { 23 24 24 25 public: 25 MD3Model( FILE *pFile, int dataOffset);26 MD3Model(std::string filename, float scaling); 26 27 ~MD3Model(); 27 28 -
branches/bsp_model/src/world_entities/world_entity.cc
r8346 r8353 22 22 #include "model.h" 23 23 #include "md2/md2Model.h" 24 #include "md3/md3_model.h" 25 24 26 #include "util/loading/resource_manager.h" 25 27 #include "util/loading/load_param.h" … … 199 201 this->buildObbTree(obbTreeDepth); 200 202 } 203 else if(fileName.find(".md3") != std::string::npos) 204 { 205 PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str()); 206 Model* m = new md3::MD3Model(fileName, this->scaling); 207 this->setModel(m, 0); 208 209 // if( m != NULL) 210 // this->buildObbTree(obbTreeDepth); 211 } 201 212 } 202 213 else
Note: See TracChangeset
for help on using the changeset viewer.