I started working on animations. I've never done anything with animations. So in the spirit that I've approach the rest "where's my bone," I hacked the most naive approach I could imagine. So I just read in a text file that lists the images that should be used in a given animation. Something like
Then, each of the images was concatenated into one big image that shows the entire animation strip. DO NOT DO THIS IF YOU ARE USING OPENGL! I don't know if DirectX has the same restrictions, but this was a mistake in OpenGL because the dimensions, width and height, of the resulting image are not powers of two (except by luck). OpenGL doesn't like that. So with a three frame animation I ended up having white quads where my animations ought to be. That caused me some confusion. Anyway, the animation I made was a little tail wag that is updated each frame, so the little pup wiggles his tail very quickly (unless I maximize the screen... can anyone tell me why maximizing slows things down so much?)
So I got something to work - yay! It's always nice to get visible results [smile] But it was also clear by the end of my hackery that I need to put a better system in place. The three things I need to do now are:
- incorporate a better way of scheduling and updating the animations
- overhaul the AnimationManager because it is duplicating a lot of the work done by the TextureManager unnecessarily
- Animation frames should be smaller. At the moment they are the same size as the whole puppy quad. It should be easy to use smaller frame sizes with an offset to achieve the same effect.