Changeset 5865 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Dec 1, 2005, 11:00:49 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture_sequence.cc
r5863 r5865 29 29 /** 30 30 * Constructor for a Texture 31 */31 */ 32 32 TextureSequence::TextureSequence(unsigned int count, ...) 33 33 { … … 41 41 42 42 /** 43 * 44 45 46 */43 * Destructor of a TextureSequence 44 * 45 * Frees Data, and deletes the textures from GL 46 */ 47 47 TextureSequence::~TextureSequence() 48 48 { … … 54 54 } 55 55 56 this->setTexture(0); 56 57 // delete all textures. 57 58 while(!this->textures.empty()) … … 65 66 66 67 /** 67 * rebuilds all the textures from the Images stored in this FrameSequence68 * @brief rebuilds all the textures from the Images stored in this FrameSequence 68 69 */ 69 70 bool TextureSequence::rebuild() … … 85 86 86 87 /** 87 * loads an image Series88 * @brief loads an image Sequence 88 89 * @param count how many images to load to the TextureSequence 89 90 * @param ... the names of the Images to load … … 99 100 100 101 /** 101 * loads an image Series102 * @brief loads an image Sequence 102 103 * @param count how many images to load to the TextureSequence 103 104 * @param textures the names of the Images to load … … 115 116 } 116 117 117 118 /** 119 * @brief adds a new Frame to this Sequence (at the end) 120 * @param imageName the Name of the Image to add 121 * @returns true on success 122 */ 118 123 bool TextureSequence::addFrame(const char* imageName) 119 124 { … … 129 134 130 135 /** 131 * adds a new Frame at the end of the Sequence.136 * @brief adds a new Frame at the end of the Sequence. 132 137 * @param surface the Surface to add at the end of the Sequence. 133 138 */ … … 144 149 } 145 150 this->setAlpha(hasAlpha); 151 return true; 146 152 } 153 154 155 156 /** 157 * moves to the n'th texture which can then be retrieved via the Texture function: this->getTexture() 158 * @param frameNumber the n-th frame 159 */ 160 void TextureSequence::gotoFrame(unsigned int frameNumber) 161 { 162 if (this->textures.size() > frameNumber) 163 this->setTexture(this->textures[frameNumber]); 164 } -
trunk/src/lib/graphics/importer/texture_sequence.h
r5861 r5865 32 32 virtual bool rebuild(); 33 33 34 /** @returns the count of frames in this sequence */ 35 inline unsigned int getFrameCount() const { return this->textures.size(); }; 36 37 void gotoFrame(unsigned int frameNumber); 34 38 /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series. */ 35 inline GLuint getFrameTexture(unsigned int frameNumber) const { return this->textures[frameNumber]; };39 inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; }; 36 40 /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */ 37 const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return this->images[frameNumber]; };41 const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return (this->images.size()>frameNumber)?this->images[frameNumber]:NULL; }; 38 42 39 43 private:
Note: See TracChangeset
for help on using the changeset viewer.