Changeset 8310 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jun 11, 2006, 12:33:19 PM (18 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture_sequence.cc
r8309 r8310 29 29 30 30 /** 31 * Constructor for a Texture31 * @brief Constructor for a Texture 32 32 */ 33 33 TextureSequence::TextureSequence(unsigned int count, ...) … … 38 38 va_start(textureNameList, count); 39 39 40 for (unsigned int i = 0; i < count; i++) 41 { 42 this->addFrame(va_arg(textureNameList, char*)); 43 } 44 va_end(textureNameList); 45 40 46 this->loadImageSeries(count, textureNameList); 41 47 } 42 48 43 44 /** 45 * Destructor of a TextureSequence 49 /** 50 * @brief Creates an ImageSeries out of TextureNames. 51 * @param textureNames The Names of the Textures 52 * @param prependFolder Optional you can prepend a Folder of Textures. 53 */ 54 TextureSequence::TextureSequence(const std::vector<std::string>& textureNames, const std::string& prependFolder) 55 { 56 this->setClassID(CL_TEXTURE_SEQUENCE, "TextureSequence"); 57 this->loadImageSeries(textureNames, prependFolder); 58 } 59 60 61 /** 62 * @brief Destructor of a TextureSequence 46 63 * 47 64 * Frees Data, and deletes the textures from GL … … 87 104 retVal = false; 88 105 } 106 va_end(textureNameList); 107 return retVal; 108 } 109 110 /** 111 * @brief Load an TextureSeries from TextureNames 112 * @param textureNames The Names of the Textures. 113 * @param prependFolder (optional) the Folder to prepend 114 * @return true on success. 115 */ 116 bool TextureSequence::loadImageSeries(const std::vector<std::string>& textureNames, const std::string& prependFolder) 117 { 118 bool retVal = true; 119 for (unsigned int i = 0; i < textureNames.size(); i++) 120 { 121 if( !this->addFrame(prependFolder + textureNames[i])) 122 retVal = false; 123 } 124 89 125 return retVal; 90 126 } -
trunk/src/lib/graphics/importer/texture_sequence.h
r8309 r8310 17 17 public: 18 18 TextureSequence(unsigned int count = 0, ...); 19 TextureSequence(const std::vector<std::string> *& textureNames);19 TextureSequence(const std::vector<std::string>& textureNames, const std::string& prependFolder = ""); 20 20 // Texture(TEXTURE_TYPE type, int resolution); 21 21 virtual ~TextureSequence(); 22 22 23 23 bool loadImageSeries(unsigned int count, ...); 24 bool loadImageSeries( unsigned int count, std::vector<std::string>& textureNames);24 bool loadImageSeries(const std::vector<std::string>& textureNames, const std::string& prependFolder = ""); 25 25 bool loadImageSeries(const std::string& imagePrefix, unsigned int from, unsigned int to); 26 26 bool addFrame(const std::string& image);
Note: See TracChangeset
for help on using the changeset viewer.