- Timestamp:
- Dec 1, 2005, 8:38:37 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/class_id.h
r5822 r5860 181 181 CL_FONT = 0x00c02802, 182 182 CL_MATERIAL = 0x00000804, 183 CL_MODEL = 0x00000805, //!< @todo make this a SUBCLASS maybe 184 CL_OBJMODEL = 0x00000806, 185 CL_PROMITIVE_MODEL = 0x00000807, 186 CL_MD2Model = 0x00000808, 187 CL_LIGHT = 0x00000809, 188 CL_PARTICLE_EMITTER = 0x0000080a, 189 CL_PARTICLE_SYSTEM = 0x0000080b, 183 CL_MULTI_FRAME_TEXTURE = 0x00c04805, 184 CL_MODEL = 0x00000806, //!< @todo make this a SUBCLASS maybe 185 CL_OBJMODEL = 0x00000807, 186 CL_PROMITIVE_MODEL = 0x00000808, 187 CL_MD2Model = 0x00000809, 188 CL_LIGHT = 0x0000080a, 189 CL_PARTICLE_EMITTER = 0x0000080b, 190 CL_PARTICLE_SYSTEM = 0x0000080c, 190 191 CL_ENVIRONMENT = 0x00000810, 191 192 CL_SHADER = 0x00000811, -
trunk/src/lib/graphics/importer/multi_frame_texture.cc
r5858 r5860 34 34 MultiFrameTexture::MultiFrameTexture(unsigned int count, ...) 35 35 { 36 this->setClassID(CL_ TEXTURE, "Texture");36 this->setClassID(CL_MULTI_FRAME_TEXTURE, "MultiFrameTexture"); 37 37 38 va_list textureNameList; 39 va_start(textureNameList, count); 40 41 this->loadImageSeries(count, textureNameList); 38 42 } 39 43 … … 48 52 49 53 50 54 /** 55 * rebuilds all the textures from the Images stored in this FrameSequence 56 */ 51 57 bool MultiFrameTexture::rebuild() 52 58 { … … 64 70 65 71 } 72 73 74 75 bool MultiFrameTexture::loadImageSeries(unsigned int count, ...) 76 { 77 va_list textureNameList; 78 va_start(textureNameList, count); 79 80 this->loadImageSeries(count, textureNameList); 81 } 82 83 bool MultiFrameTexture::loadImageSeries(unsigned int count, va_list textures) 84 { 85 86 87 } 88 89 90 bool MultiFrameTexture::addFrame(const char* imageName) 91 { 92 93 94 } 95 96 97 bool MultiFrameTexture::addFrame(SDL_Surface* surface) 98 { 99 100 101 } 102 103 -
trunk/src/lib/graphics/importer/multi_frame_texture.h
r5859 r5860 10 10 11 11 #include "glincl.h" 12 12 13 #include <vector> 14 #include <stdarg.h> 13 15 14 16 /* Forward Declaration */ … … 16 18 17 19 //! A Class, that reads in Textures from different fileformats. 18 19 20 21 MultiFrameTexture(unsigned int count, ...);20 class MultiFrameTexture : public Texture 21 { 22 public: 23 MultiFrameTexture(unsigned int count = 0, ...); 22 24 // Texture(TEXTURE_TYPE type, int resolution); 23 25 ~MultiFrameTexture(); 24 26 25 bool loadImages(unsigned int cound, ...); 26 bool rebuild(); 27 bool loadImageSeries(unsigned int count, ...); 28 bool loadImageSeries(unsigned int count, va_list textureNames); 29 bool addFrame(const char* image); 30 bool addFrame(SDL_Surface* surface); 27 31 28 /** @returns The textureID of this texture. */ 29 inline GLuint getFrameTexture(unsigned int frameNumber) const { return this->textures[frameNumber]; }; 32 virtual bool rebuild(); 30 33 31 const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return this->images[frameNumber]; }; 34 /** @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]; }; 36 /** @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]; }; 32 38 33 34 35 36 39 private: 40 std::vector<GLuint> textures; //!< The Texture-ID of opengl from this Texture. 41 std::vector<SDL_Surface*> images; //!< The SDL_Surfce that stores the Texture on it. 42 }; 37 43 38 44 #endif /* _MULTI_FRAME_TEXTURE_H */ -
trunk/src/lib/graphics/importer/texture.cc
r5859 r5860 116 116 bool Texture::rebuild() 117 117 { 118 if (this->texture != 0 && glIsTexture(this->texture))118 if (this->texture != 0) 119 119 { 120 glDeleteTextures(1,&this->texture); 120 if (glIsTexture(this->texture)) 121 glDeleteTextures(1,&this->texture); 121 122 this->setTexture(0); 122 123 }
Note: See TracChangeset
for help on using the changeset viewer.