- Timestamp:
- May 6, 2005, 12:23:14 PM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h
r4078 r4079 25 25 #include "base_object.h" 26 26 27 template<class T> class tList; 27 28 28 29 … … 92 93 int currentAnim; // The current index into pAnimations list (NEW) 93 94 int currentFrame; // The current frame of the current animation (NEW) 94 //vector<tAnimationInfo> pAnimations; // The list of animations (NEW)95 //vector<tMaterialInfo> pMaterials; // The list of material information (Textures and colors)96 //vector<t3DObject> pObject; // The object list for our model95 tList<tAnimationInfo>* animationList; // The list of animations (NEW) 96 tList<tMaterialInfo>* materialList; // The list of material information (Textures and colors) 97 tList<t3DObject>* objectList; // The object list for our model 97 98 }; 98 99 … … 103 104 104 105 public: 105 AbstractModel(); 106 virtual ~AbstractModel(); 107 108 109 private: 110 106 AbstractModel() {} 107 virtual ~AbstractModel() {} 111 108 }; 112 109 -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4078 r4079 13 13 */ 14 14 15 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER 16 16 17 17 #include "md2Model.h" 18 19 //#include <stdio.h> 20 //#include <stdlib.h> 21 //#include <string> 22 #include <fstream> 18 23 19 24 … … 77 82 \param texture name to load 78 83 */ 79 bool MD2Loader::importMD2(t3DModel *pModel, char *strFileName, char *strTexture) 80 {} 84 bool MD2Loader::importMD2(t3DModel *pModel, char *fileName, char *textureName) 85 { 86 char strMessage[255] = {0}; 87 88 this->pFile = fopen(fileName, "rb"); 89 if( unlikely(!pFile)) 90 { 91 PRINTF(1)("Couldn't open the MD2 File for loading. Exiting.\n"); 92 return false; 93 } 94 fread(&this->header, 1, sizeof(tMd2Header), pFile); 95 /* check for the header version: make sure its a md2 file :) */ 96 if( likely(this->header.version != 8)) 97 { 98 PRINTF(1)("Couldn't load file %s: invalid file format: stop loading\n", fileName); 99 return false; 100 } 101 102 this->readMD2Data(); 103 this->convertDataStructures(pModel); 104 105 if( likely((int)textureName)) 106 { 107 tMaterialInfo textureInfo; 108 strcpy(textureInfo.strFile, textureName); 109 /* since there is only one texture for a .Md2 file, the ID is always 0 */ 110 textureInfo.texureId = 0; 111 textureInfo.uTile = 1; 112 /* we only have 1 material for a model */ 113 pModel->numOfMaterials = 1; 114 //pModel->materialList.add(texture); 115 } 116 117 this->cleanUp(); 118 return true; 119 } 81 120 82 121 /** -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
r4078 r4079 135 135 virtual ~MD2Loader(); 136 136 137 bool importMD2(t3DModel *pModel, char * strFileName, char *strTexture);137 bool importMD2(t3DModel *pModel, char *fileName, char *texture); 138 138 139 139 private:
Note: See TracChangeset
for help on using the changeset viewer.