Commit Graph
69 Commits
Author SHA1 Message Date
Denis Kasak b3a2d186bb * Moved scaling support from Animation to Sprite
* Now each Sprite (and hence frame in an animation) can have a separate zoom (which is needed for some animations in the game)
* Scale factors are not stored any more; instead, we only store scaled dimensions (since these are stored in the data files) and calculate the factors from those.

svn-id: r42647
2009-07-22 04:42:33 +00:00
Denis Kasak a2a71cb8fb * Added scaling support
* Made the dragon scale when it is in different parts of the room
* Added getters for relative coordinates (Animation::getRelativeX() and Animation::getRelativeY())
* Commented Game::loop() and Sprite::draw*() methods in more detail

svn-id: r42627
2009-07-20 17:25:57 +00:00
Denis Kasak cb185f18cd Fixed bug which caused the dragon to be animated with the wrong Z coordinate for short periods of time when moved to a new location.
svn-id: r42586
2009-07-18 12:08:18 +00:00
Denis Kasak a44cda5525 Fixed bug which caused animations to sometimes be played too fast if the engine was busier than usual (like when redrawing the whole screen when returning from minimized state).
svn-id: r42585
2009-07-18 05:21:01 +00:00
Denis Kasak 3cde84fec4 Fixed bug where certain animations were played very fast when not played immediately when they are created.
svn-id: r42580
2009-07-18 02:58:11 +00:00
Denis Kasak adf9e91e1f * Added Animation::getFrame()
* Added support for sorting animations when Z is changed later on (AnimationManager::sortAnimations())
* Added support for relative coordinates (Animation::setRelative())
* Fixed bug where AnimationManager::deleteOverlays() deleted all animations

svn-id: r42579
2009-07-18 02:53:37 +00:00
Denis Kasak 6d51a3ead4 * Fixed bug in Animation which made the first frame of an animation being drawn after it's stopped
* Fixed debugging info when starting and stopping animations

svn-id: r42485
2009-07-14 18:11:33 +00:00
Denis Kasak f655999c15 Fixed bug in the NoScene logo room; the screen surface is now cleared between scene redraws (filled with the colour 0) to fix artifacts when animating the logo.
svn-id: r42448
2009-07-13 19:11:24 +00:00
Denis Kasak 77a810c0c9 Moved the delay mechanism from Animation to Drawable since each frame in an animation can have a different delay.
svn-id: r42427
2009-07-12 19:32:01 +00:00
Denis Kasak 9246e9cf4a * Added some more animation debug info
* Reordered Animation::nextFrame() a bit to make sure the timings are correct (particularly the last frame)
* Added checks to AnimationManager::play() and AnimationManager::stop() so it doesn't dereference a null pointer.

svn-id: r42243
2009-07-07 21:11:36 +00:00
Denis Kasak c258eefc82 Made AnimationManager::getAnimation() return NULL when an animation is not found instead of Common::List<>::end().
svn-id: r42228
2009-07-07 15:39:18 +00:00
Denis Kasak 4cfdf8c855 Shortened AnimationManager::{play,stop}(). Removed some excessive newlines.
svn-id: r42226
2009-07-07 15:35:35 +00:00
Denis Kasak 82e6bcea2f * Added AnimationManager::deleteOverlays().
* Fixed bug in AnimationManager::deleteAnimation() that could result in accessing the Common::List::end() sentinel value.

svn-id: r42223
2009-07-07 14:52:36 +00:00
Denis Kasak 8e341ee968 Renaming Animation -> AnimationManager and AnimObj -> Animation in light of the new API change.
svn-id: r42133
2009-07-05 11:52:17 +00:00
Denis Kasak 6c3e9f5151 * API change for Animation and AnimObj; AnimObj is now a proper class and each instance handles its own animation. Animation handles adding, fetching and deleting of AnimObjs (probably needs a namechange).
* Implemented actual animation (previously only the first frame was display)
* Implemented animation starting, stoping, looping
* Loaded looping dragon animation as a test

svn-id: r42114
2009-07-05 03:24:46 +00:00
Denis Kasak a4e6464a63 Added support for playing and stopping animations.
svn-id: r42075
2009-07-03 19:05:58 +00:00
Denis Kasak 4465ecf123 Added deconstructor for Animation. Made Animation objects delete their frames when deleteAll() or deleteAnimation() are called.
svn-id: r42073
2009-07-03 18:19:51 +00:00
Denis Kasak c178409b56 Implemented beginning of the animation engine.
svn-id: r42068
2009-07-03 17:50:22 +00:00
Denis Kasak d47ab6ae98 Added empty animation.cpp and animation.h files.
svn-id: r42000
2009-07-01 16:20:47 +00:00