Added != to Animation.
authorTegmine <emilyteng55@gmail.com>
Sun, 4 Mar 2012 20:40:58 +0000 (14:40 -0600)
committerTegmine <emilyteng55@gmail.com>
Sun, 4 Mar 2012 20:40:58 +0000 (14:40 -0600)
Animation.cpp
Animation.h

index 039a4de..44dd9a3 100644 (file)
 #include <GL/gl.h>
 using namespace std;
 
+Animation::Animation():mName()
+{
+       mBuilt = false;
+}
+
 Animation::Animation(std::string animFile):mName(animFile)
 {
        loadAnimation(animFile);
@@ -28,7 +33,9 @@ int Animation::loadAnimation(std::string animFile)
        string buffer,file;
        int transparency[3];
        int pause;
+       int count=0;
        animFile="ArtAssets/Sprites/"+animFile;
+       
        //file
        ifstream fin(animFile.c_str());
 
@@ -38,7 +45,6 @@ int Animation::loadAnimation(std::string animFile)
                return -1;
        }
 
-       int count=0;
        while(getline(fin,buffer))
        {
                if(buffer[0] != '#' && buffer[0] != '\r' && buffer[0] != '\0' && buffer[0] != '\n' && buffer.length() != 0)
index 9afe2de..5474519 100644 (file)
@@ -8,26 +8,34 @@
 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