athena/include/Athena/SpriteFrame.hpp

85 lines
1.4 KiB
C++
Raw Normal View History

#ifndef SSPRITEFRAME_HPP
#define SSPRITEFRAME_HPP
#include "Athena/SakuraGlobal.hpp"
#ifndef ATHENA_USE_QT
#include <vector>
2014-02-27 05:47:39 +00:00
#else
#include <QObject>
#include <QList>
#endif
2014-04-20 09:14:15 +00:00
namespace Athena
{
namespace Sakura
{
2014-02-27 05:47:39 +00:00
class Sprite;
class SpritePart;
#ifndef ATHENA_USE_QT
class SpriteFrame
{
2014-02-27 05:47:39 +00:00
#else
class SpriteFrame : public QObject
{
Q_OBJECT
Q_PROPERTY(qreal frameTime READ frameTime WRITE setFrameTime)
#endif
public:
/*!
* \brief SSpriteFrame
*/
SpriteFrame();
2014-02-27 05:47:39 +00:00
SpriteFrame(Sprite* root);
/*!
* \brief setFrameTime
* \param frameTime
*/
void setFrameTime(float frameTime);
2014-02-27 05:47:39 +00:00
/*!
* \brief frameTime
* \return
*/
float frameTime() const;
#ifndef ATHENA_USE_QT
2014-02-27 05:47:39 +00:00
void setParts(std::vector<SpritePart*> parts);
std::vector<SpritePart*> parts() const;
#else
void setParts(QList<SpritePart*> parts);
QList<SpritePart*> parts() const;
#endif
atUint32 partCount() const;
2014-02-27 05:47:39 +00:00
void setRoot(Sprite* root);
Sprite* root() const;
#ifdef ATHENA_USE_QT
2014-02-27 05:47:39 +00:00
signals:
void frameTimeChanged(float);
#endif
private:
2014-02-27 05:47:39 +00:00
Sprite* m_root;
float m_frameTime;
#ifndef ATHENA_USE_QT
2014-02-27 05:47:39 +00:00
std::vector<SpritePart*> m_parts;
#else
QList<SpritePart*> m_parts;
#endif
};
} // Sakura
} // zelda
#ifdef ATHENA_USE_QT
Q_DECLARE_METATYPE(Athena::Sakura::SpriteFrame*);
2014-02-27 05:47:39 +00:00
#endif
#endif // SSPRITEFRAME_HPP