Changeset 8324 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Jun 12, 2006, 12:40:57 AM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture_sequence.cc
r8311 r8324 128 128 /** 129 129 * @brief Loads an Image-Series into the TextureSequence. 130 * @param image PrefixThe Prefix of the Image130 * @param imageNameSubstitue The Prefix of the Image 131 131 * @param from From which image 132 132 * @param to To which image … … 137 137 * @note important is, that the count of ###'s is correct. 138 138 */ 139 bool TextureSequence::loadImageSeries(const std::string& image Prefix, unsigned int from, unsigned int to)139 bool TextureSequence::loadImageSeries(const std::string& imageNameSubstitue, unsigned int from, unsigned int to) 140 140 { 141 141 unsigned int index = 0; 142 142 unsigned int frameSize = 0; 143 143 // search for the special character # in the LoadParam 144 if ((index = image Prefix.find("_#")) != std::string::npos)145 { 146 std::string _image Prefix = imagePrefix;144 if ((index = imageNameSubstitue.find("_#")) != std::string::npos) 145 { 146 std::string _imageNameSubstitue = imageNameSubstitue; 147 147 index++; // start at # 148 while(image Prefix[index+frameSize] == '#')148 while(imageNameSubstitue[index+frameSize] == '#') 149 149 { 150 _image Prefix[index+frameSize] = '0';150 _imageNameSubstitue[index+frameSize] = '0'; 151 151 frameSize++; 152 152 } 153 153 154 PRINTF(4)("Found %d '#'s in %s... searching for LOD's\n", frameSize, image Prefix.c_str());154 PRINTF(4)("Found %d '#'s in %s... searching for LOD's\n", frameSize, imageNameSubstitue.c_str()); 155 155 char tmpString[32]; 156 156 for (unsigned int i = from; i < to; i++) 157 157 { 158 158 sprintf(tmpString, "%d", i); 159 _image Prefix.replace(index+frameSize -strlen(tmpString), strlen(tmpString), tmpString);160 this->addFrame(_image Prefix);159 _imageNameSubstitue.replace(index+frameSize -strlen(tmpString), strlen(tmpString), tmpString); 160 this->addFrame(_imageNameSubstitue); 161 161 } 162 162 return true; -
trunk/src/lib/graphics/importer/texture_sequence.h
r8310 r8324 23 23 bool loadImageSeries(unsigned int count, ...); 24 24 bool loadImageSeries(const std::vector<std::string>& textureNames, const std::string& prependFolder = ""); 25 bool loadImageSeries(const std::string& image Prefix, unsigned int from, unsigned int to);25 bool loadImageSeries(const std::string& imageNameSubstitue, unsigned int from, unsigned int to); 26 26 bool addFrame(const std::string& image); 27 27 bool addFrame(SDL_Surface* surface); … … 34 34 /** @returns the count of frames in this sequence */ 35 35 inline unsigned int getFrameCount() const { return this->textures.size(); }; 36 /** @returns true if no Textures are stored inside of this TextureSequence */ 37 inline bool empty() const { return textures.empty(); }; 36 38 37 39 //void gotoFrame(unsigned int frameNumber);
Note: See TracChangeset
for help on using the changeset viewer.