| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef BACKGROUND_2D_ANIMATION_H
- #define BACKGROUND_2D_ANIMATION_H
- #include <OgreString.h>
- #include <Ogre.h>
- #include <vector>
- #include "map/QGearsTile.h"
- class Background2D;
- class Background2DAnimation
- {
- public:
- Background2DAnimation( const Ogre::String& name, Background2D* background, const int tile_index );
- virtual ~Background2DAnimation();
- enum State
- {
- ONCE,
- LOOPED
- };
- void AddTime( const float time );
- const Ogre::String& GetName() const;
- void SetTime( const float time );
- float GetTime() const;
- void SetLength( const float time );
- float GetLength() const;
- virtual void AddUVKeyFrame( const QGears::KeyFrame key_frame );
- virtual void AddUVKeyFrame( const float time, const Ogre::Vector4& uv );
- virtual void AddUVKeyFrame( const float time, const float u1, const float v1, const float u2, const float v2 );
- private:
- Background2DAnimation();
- Ogre::String m_Name;
- Background2D* m_Background;
- int m_TileIndex;
- float m_Time;
- float m_Length;
- struct Background2DKeyFrameUV
- {
- float time;
- float u1;
- float v1;
- float u2;
- float v2;
- };
- std::vector< Background2DKeyFrameUV > m_UV;
- };
- #endif // BACKGROUND_2D_ANIMATION_H
|