2014-01-26 04:56:04 +00:00
|
|
|
#ifndef SSPRITEFRAME_HPP
|
|
|
|
#define SSPRITEFRAME_HPP
|
|
|
|
|
|
|
|
|
2015-09-03 19:37:45 +00:00
|
|
|
#include "Athena/SakuraGlobal.hpp"
|
2014-01-26 04:56:04 +00:00
|
|
|
|
2014-04-20 10:28:28 +00:00
|
|
|
#ifndef ATHENA_USE_QT
|
2014-01-26 04:56:04 +00:00
|
|
|
#include <vector>
|
2014-02-27 05:47:39 +00:00
|
|
|
#else
|
|
|
|
#include <QObject>
|
|
|
|
#include <QList>
|
|
|
|
#endif
|
2014-01-26 04:56:04 +00:00
|
|
|
|
2014-04-20 09:14:15 +00:00
|
|
|
namespace Athena
|
2014-01-26 04:56:04 +00:00
|
|
|
{
|
|
|
|
namespace Sakura
|
|
|
|
{
|
|
|
|
|
2014-02-27 05:47:39 +00:00
|
|
|
class Sprite;
|
|
|
|
class SpritePart;
|
|
|
|
|
2014-04-20 10:28:28 +00:00
|
|
|
#ifndef ATHENA_USE_QT
|
2014-01-26 04:56:04 +00:00
|
|
|
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
|
2014-01-26 04:56:04 +00:00
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
* \brief SSpriteFrame
|
|
|
|
*/
|
|
|
|
SpriteFrame();
|
|
|
|
|
2014-02-27 05:47:39 +00:00
|
|
|
SpriteFrame(Sprite* root);
|
2014-01-26 04:56:04 +00:00
|
|
|
/*!
|
|
|
|
* \brief setFrameTime
|
|
|
|
* \param frameTime
|
|
|
|
*/
|
|
|
|
void setFrameTime(float frameTime);
|
|
|
|
|
2014-02-27 05:47:39 +00:00
|
|
|
|
2014-01-26 04:56:04 +00:00
|
|
|
/*!
|
|
|
|
* \brief frameTime
|
|
|
|
* \return
|
|
|
|
*/
|
|
|
|
float frameTime() const;
|
|
|
|
|
2014-04-20 10:28:28 +00:00
|
|
|
#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
|
|
|
|
|
2014-06-18 04:51:18 +00:00
|
|
|
atUint32 partCount() const;
|
2014-02-27 05:47:39 +00:00
|
|
|
|
|
|
|
void setRoot(Sprite* root);
|
|
|
|
Sprite* root() const;
|
2014-04-20 10:28:28 +00:00
|
|
|
#ifdef ATHENA_USE_QT
|
2014-02-27 05:47:39 +00:00
|
|
|
signals:
|
|
|
|
void frameTimeChanged(float);
|
|
|
|
#endif
|
2014-01-26 04:56:04 +00:00
|
|
|
private:
|
2014-02-27 05:47:39 +00:00
|
|
|
Sprite* m_root;
|
|
|
|
float m_frameTime;
|
2014-04-20 10:28:28 +00:00
|
|
|
#ifndef ATHENA_USE_QT
|
2014-02-27 05:47:39 +00:00
|
|
|
std::vector<SpritePart*> m_parts;
|
|
|
|
#else
|
|
|
|
QList<SpritePart*> m_parts;
|
|
|
|
#endif
|
2014-01-26 04:56:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Sakura
|
|
|
|
} // zelda
|
|
|
|
|
2014-04-20 10:28:28 +00:00
|
|
|
#ifdef ATHENA_USE_QT
|
|
|
|
Q_DECLARE_METATYPE(Athena::Sakura::SpriteFrame*);
|
2014-02-27 05:47:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // SSPRITEFRAME_HPP
|