- Timestamp:
- Jun 9, 2006, 2:56:50 AM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture_sequence.cc
r7221 r8297 86 86 this->textures[i] = loadTexToGL(this->images[i]); 87 87 } 88 return true; 88 89 } 89 90 … … 117 118 } 118 119 return retVal; 120 } 121 122 bool TextureSequence::loadImageSeries(const std::string& imagePrefix, unsigned int from, unsigned int to, const std::string& extension) 123 { 124 unsigned int index = 0; 125 unsigned int frameSize = 0; 126 // search for the special character # in the LoadParam 127 if ((index = imagePrefix.find("_#")) != std::string::npos) 128 { 129 std::string _imagePrefix = imagePrefix; 130 index++; // start at # 131 while(imagePrefix[index+frameSize] == '#') 132 { 133 _imagePrefix[index+frameSize] = '0'; 134 frameSize++; 135 } 136 137 PRINTF(4)("Found %d '#'s in %s... searching for LOD's\n", frameSize, imagePrefix.c_str()); 138 char tmpString[32]; 139 for (unsigned int i = from; i < to; i++) 140 { 141 sprintf(tmpString, "%d", i); 142 _imagePrefix.replace(index+frameSize -strlen(tmpString), index+frameSize, tmpString); 143 printf("TEST STRING %s\n", _imagePrefix.c_str()); 144 } 145 return true; 146 } 147 return false; 119 148 } 120 149 -
trunk/src/lib/graphics/importer/texture_sequence.h
r7221 r8297 23 23 bool loadImageSeries(unsigned int count, ...); 24 24 bool loadImageSeries(unsigned int count, va_list textureNames); 25 bool loadImageSeries(const std::string& imagePrefix, unsigned int from, unsigned int to, const std::string& extension = "png"); 25 26 bool addFrame(const std::string& image); 26 27 bool addFrame(SDL_Surface* surface); -
trunk/src/lib/gui/gl/glgui_cursor.cc
r8145 r8297 20 20 #include "glgui_handler.h" 21 21 #include "color.h" 22 #include "texture_sequence.h" 22 23 23 24 … … 50 51 51 52 53 52 54 /** 53 55 * @brief initializes the GUI-element … … 64 66 this->setLayer(E2D_LAYER_ABOVE_ALL); 65 67 this->color = 0.0f; 68 69 TextureSequence* seq = new TextureSequence(); 70 seq->loadImageSeries("test_###", 0, 222, "png"); 66 71 67 72 this->resize();
Note: See TracChangeset
for help on using the changeset viewer.