#include <GL/gl.h>
using namespace std;
+Animation::Animation():mName()
+{
+ mBuilt = false;
+}
+
Animation::Animation(std::string animFile):mName(animFile)
{
loadAnimation(animFile);
string buffer,file;
int transparency[3];
int pause;
+ int count=0;
animFile="ArtAssets/Sprites/"+animFile;
+
//file
ifstream fin(animFile.c_str());
return -1;
}
- int count=0;
while(getline(fin,buffer))
{
if(buffer[0] != '#' && buffer[0] != '\r' && buffer[0] != '\0' && buffer[0] != '\n' && buffer.length() != 0)
using std::vector;
/**
- An Animation
+An Animation
- This class is tasked with the following:
- - loading sets of images into an animation set.
+This class is tasked with the following:
+- loading sets of images into an animation set.
*/
class Animation
{
- public:
+public:
+ //variables
+ int mBuilt,/**< Using as a bool */
+ mNumFrames,/**< Number of frames in this Animation */
+ mW,/**< Animation's current width */
+ mH;/**< The animation's current Height */
+ std::vector<SpriteFrame> Frames;
+ std::string mName;//add name to anim file
+ SpriteFrame *mFrames;/**< Pointer to the current animation. As an array of SpriteFrames */
+
+ //Constructors
+ Animation();
Animation(std::string animFile);
Animation(std::string animFile, string name);
+
+ //Methods
int loadAnimation(std::string animFile);/**< Loads the Animations from a file in the specified format. */
- SpriteFrame *mFrames;/**< Pointer to the current animation. As an array of SpriteFrames */
- int mBuilt,/**< Using as a bool */
- mNumFrames,/**< Number of frames in this Animation */
- mW,/**< Animation's current width */
- mH;/**< The animation's current Height */
bool operator==(Animation a){return mName==a.mName;}
- std::string mName;//add name to anim file
+ bool operator!=(Animation a){return mName!=a.mName;}
};
#endif