SpriteTexture.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. Completely worked out how to deal with texture animation and sprite textures:
  2. TextureMovie - derives from Texture
  3. - isAnimated() - returns true
  4. - getFrames - decodes all frames and returns them as individual textures. Make a note that this is an extremely slow process. For normals textures it just returns self.
  5. - I will need this when providing a texture to SpriteGenerator among other things, so it may extract frames an generate an atlas (although I don't expect this will be
  6. needed for actual movies, I want to keep the functionality the same for all textures)
  7. - getBindableTexture() - texture used by RenderSystem. Normal textures just return self, while animated textures return the current frame
  8. - DOES NOT support sprites (i.e. multiple textures from a single atlas, only multiple separate textures)
  9. - TextureMovieTheora decodes textures on the fly
  10. - TextureMovieRaw is created from a bunch of normal textures (using some utility method)
  11. - play/stop/rewind/setSpeed/move(+/- frameCount)
  12. SpriteTexture
  13. - Inherits from Resource
  14. - Replace all references to it using shared_ptr with handles
  15. - How do I create it?
  16. - From native code allow a constructor that accepts a single texture (no atlas)
  17. - And another constructor that accepts an uv an atlas
  18. - Can contain sprite animation
  19. - Some constructors accept a list of uvs, list of pages (referencing an atlas), a list of atlases and FPS
  20. - (Need multiple atlases as some animations might be lengthty)
  21. - Will have play/stop/rewind/getTime()/etc. methods
  22. - It is up to the renderer to use animation data.
  23. - GUIManager will be modified so use animation data if it exists
  24. - For use in Scene I may add a special SpriteRenderer that uses certain logic and a certain material which supports sprite animation
  25. SpriteGenerator
  26. - generateAtlas: Accepts a list of textures and outputs a list of SpriteTextures and a texture atlas
  27. - generateSpriteAnimation: Accepts a list of textures, and generates a single SpriteTexture with a set of UVs and FPS
  28. - All of them must be manually saved using Resources::create if they are to persist
  29. TODO - How to handle animating uvs?
  30. - Things using animated textures will need to manually set the uvs every frame?