Changeset 9854 in orxonox.OLD for branches/new_class_id/src/lib/graphics/importer
- Timestamp:
- Sep 28, 2006, 10:17:56 AM (18 years ago)
- Location:
- branches/new_class_id/src/lib/graphics/importer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.cc
r9847 r9854 6 6 7 7 8 ResourceMD2::ResourceMD2(const std::string& modelName, const std::string& skinName, float scale )8 ResourceMD2::ResourceMD2(const std::string& modelName, const std::string& skinName, float scale, const Resources::KeepLevel& keepLevel) 9 9 : Resource(&ResourceMD2::type) 10 10 { … … 22 22 //std::string skinFileName = this->Resource::locateFile(skinName); 23 23 this->MD2Model::load(modelFileName, skinName, scale); 24 this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinName, scale), Resources::KeepLevel(0), this->MD2Model::dataPointer()));24 this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinName, scale), keepLevel, this->MD2Model::dataPointer())); 25 25 } 26 26 27 27 } 28 28 29 ResourceMD2 ResourceMD2::createFromString(const std::string& loadString )29 ResourceMD2 ResourceMD2::createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel) 30 30 { 31 31 SubString loadValues(loadString, ','); … … 40 40 scale = MultiType(loadValues[2]).getFloat(); 41 41 42 return ResourceMD2(modelName, skinName, scale );42 return ResourceMD2(modelName, skinName, scale, keepLevel); 43 43 } 44 44 -
branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.h
r9847 r9854 15 15 { 16 16 public: 17 ResourceMD2(const std::string& modelName, const std::string& skinName = "", float scale = 1.0f); 18 static ResourceMD2 createFromString(const std::string& loadString); 17 ResourceMD2(const std::string& modelName, 18 const std::string& skinName = "", 19 float scale = 1.0f, 20 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 21 static ResourceMD2 createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 19 22 static std::string loadString(const std::string& modelName, const std::string& skinName = "", float scale = 1.0f); 20 23 -
branches/new_class_id/src/lib/graphics/importer/resource_obj.cc
r9847 r9854 6 6 7 7 8 ResourceOBJ::ResourceOBJ(const std::string& imageName, float scaling )8 ResourceOBJ::ResourceOBJ(const std::string& imageName, float scaling, const Resources::KeepLevel& keepLevel) 9 9 : Resource(&ResourceOBJ::type) 10 10 { … … 21 21 std::string fileName = this->Resource::locateFile(imageName); 22 22 this->acquireData(OBJModel(fileName, scaling).dataPointer()); 23 this->Resource::addResource(new ResourceOBJ::OBJResourcePointer(imageName + ',' + MultiType(scaling).getString(), Resources::KeepLevel(0), this->StaticModel::dataPointer()));23 this->Resource::addResource(new ResourceOBJ::OBJResourcePointer(imageName + ',' + MultiType(scaling).getString(), keepLevel, this->StaticModel::dataPointer())); 24 24 } 25 25 } 26 26 27 ResourceOBJ ResourceOBJ::createFromString(const std::string& loadString )27 ResourceOBJ ResourceOBJ::createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel) 28 28 { 29 29 SubString loadValues(loadString, ','); … … 35 35 scaling = (GLenum)MultiType(loadValues[2]).getFloat(); 36 36 37 return ResourceOBJ(imageName, scaling );37 return ResourceOBJ(imageName, scaling, keepLevel); 38 38 } 39 39 -
branches/new_class_id/src/lib/graphics/importer/resource_obj.h
r9847 r9854 14 14 { 15 15 public: 16 ResourceOBJ(const std::string& imageName, float scaling = 1.0f); 17 static ResourceOBJ createFromString(const std::string& loadString); 16 ResourceOBJ(const std::string& imageName, 17 float scaling = 1.0f, 18 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 19 static ResourceOBJ createFromString(const std::string& loadString, 20 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 18 21 19 22 private: -
branches/new_class_id/src/lib/graphics/importer/resource_texture.cc
r9847 r9854 6 6 7 7 8 ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target )8 ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target, const Resources::KeepLevel& keepLevel) 9 9 : Resource(&ResourceTexture::type) 10 10 { … … 21 21 std::string fileName = this->Resource::locateFile(imageName); 22 22 this->Texture::loadImage(fileName, target); 23 this->Resource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + MultiType((int)target).getString(), Resources::KeepLevel(0), this->Texture::dataPointer()));23 this->Resource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + MultiType((int)target).getString(), keepLevel, this->Texture::dataPointer())); 24 24 } 25 25 } 26 26 27 ResourceTexture ResourceTexture::createFromString(const std::string& loadString )27 ResourceTexture ResourceTexture::createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel) 28 28 { 29 29 SubString loadValues(loadString, ','); … … 35 35 target = (GLenum)MultiType(loadValues[2]).getInt(); 36 36 37 return ResourceTexture(imageName, target );37 return ResourceTexture(imageName, target, keepLevel); 38 38 } 39 39 -
branches/new_class_id/src/lib/graphics/importer/resource_texture.h
r9847 r9854 15 15 { 16 16 public: 17 ResourceTexture(const std::string& imageName, GLenum target = GL_TEXTURE_2D); 18 static ResourceTexture createFromString(const std::string& loadString); 17 ResourceTexture(const std::string& imageName, 18 GLenum target = GL_TEXTURE_2D, 19 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 20 static ResourceTexture createFromString(const std::string& loadString, 21 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 19 22 20 23 private:
Note: See TracChangeset
for help on using the changeset viewer.