aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/animation.cpp
AgeCommit message (Collapse)Author
2009-10-30Remove the last 2 default parameter values.Robert Špalek
They usually just add unnecessary confusion and this is definitely such an example. Removal will clarify the code. svn-id: r45512
2009-10-30Remove most of default parameter values.Robert Špalek
Also, add comments to the last commit. svn-id: r45511
2009-10-12Sound effects are now correctly played.Robert Špalek
Dubbing is not yet played. svn-id: r45000
2009-10-11Loading and caching sound samples in memory.Robert Špalek
The sounds are not played yet, but the infrastructure is getting ready. svn-id: r44957
2009-09-30Remove trailing whitespacesMax Horn
svn-id: r44493
2009-09-30- Adapt parts of the Draci code to match our code formatting guidelinesJohannes Schickel
- Remove use of tabs for formatting, now in nearly all cases tabs are only used for indentation - Use "uint" instead of "unsigned int" in the whole engine for consistency's sake - Strip some trailing tabs and leading whitespaces svn-id: r44478
2009-09-29Fixed Valgrind warnings about invalid memory access. Hopefully without breakingTorbjörn Andersson
anything, but modifying a data structure while traversing it can be a bit tricky... svn-id: r44469
2009-09-28draci: Inverted a logical check to make it more obvious.Denis Kasak
svn-id: r44454
2009-09-28Made AnimationManager::sortAnimations() do multiple passes, if necessary, ↵Denis Kasak
and added some animation debug info. svn-id: r44452
2009-09-27Improved the interface of Sprite and Animation concerning relative ↵Robert Špalek
coordinates and scaling. It is no longer needed to modify the underlying animations when drawing them on the screen or testing pixels in them. Read access is enough, because the displacement of the object is passed as a parameter. Added some more const's where they logically belong. svn-id: r44419
2009-09-27Fix renumbering of animation indexesRobert Špalek
svn-id: r44414
2009-09-27Remove memory leak in animation manager. Get rid of 1 non-const reference ↵Robert Špalek
parameter. svn-id: r44413
2009-09-25Added some more const's to the interface of Dragon HistoryRobert Špalek
svn-id: r44362
2009-09-25Add const's to many interfaces of engines/draci/Robert Špalek
svn-id: r44331
2009-08-17* Added pause support for animations.Denis Kasak
* Added AnimationManager::addItem() for adding inventory items animations. svn-id: r43486
2009-08-12Stopped returning from Animation::nextFrame() early even if the animation ↵Denis Kasak
has only one frame because such animations may need to have callbacks called too. Fixes intro freeze during mother's lecture. svn-id: r43313
2009-07-30Fixed sanity check in Animation::setCurrentFrame().Denis Kasak
svn-id: r42914
2009-07-30* Added Animation::setCurrentFrame()Denis Kasak
* Moved rewinding the animation to the beginning from Animation::nextFrame() to AnimationManager::stop() (fixes the owl animation) svn-id: r42913
2009-07-29Added support for animation callbacks and implemented a few callbacks ↵Denis Kasak
(doNothing, exitGameLoop, stopAnimation). svn-id: r42901
2009-07-29* Added method Animation::currentFrameNum()Denis Kasak
* Renamed Animation::getFramesNum() to Animation::getFrameCount() for clarity. svn-id: r42873
2009-07-27Fixed one more bug related to animations having no frames.Denis Kasak
svn-id: r42838
2009-07-27* Added AnimationManager::addText() for adding text animationsDenis Kasak
* Added AnimationManager::getTopAnimationID(x, y) which returns the ID of the top layer animation located on a point * Added Animation::getScale{X,Y}() * Fixed a few bugs related to animations sometimes having no frames svn-id: r42836
2009-07-24* Added tracking and deleting animations by index (which represents the ↵Denis Kasak
order in which they were loaded). This is needed by some GPL commands. * Added Game::getNumObjects() which returns the number of objects in the game * Fixed segfault (accessing a null Animation *) * Added some docs to various things svn-id: r42683
2009-07-24Added support for per-animation scaling (via scaling factors). I have ↵Denis Kasak
decided to go for a mixed approach (where Animation has a global scaling factor for the whole animation which is separate from Drawable's scaled width and height) so the animation can be scaled more naturally when the scale often changes (like with perspective when the dragon is walking). Previously, one had to alter the sizes of each frame of the dragon's animation whenever the dragon moved which was unclean. svn-id: r42680
2009-07-22* Disabled unconditional execution of gates' scriptsDenis Kasak
* Fixed bug in Animation::nextFrame() which caused non-looping animations to linger on forever * Stopped setting looping to false explicitly in AnimationManager::addAnimation() since the Animation constructor already does that svn-id: r42657
2009-07-22* Stopped AnimationManager::drawScene() from marking its own dirtiness.Denis Kasak
* Instead, Animation::nextFrame() marks both the old and the new frame dirty. This makes it possible to only update the real screen when the animation changes and results in a pretty big speedup. * Added utility method Animation::markDirtyRect() which takes a (Surface *) and marks a dirty rect on it for the current frame. * Fixed artifacts when moving the dragon. svn-id: r42652
2009-07-22* Moved scaling support from Animation to SpriteDenis Kasak
* 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-20* Added scaling supportDenis Kasak
* 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-18Fixed bug which caused the dragon to be animated with the wrong Z coordinate ↵Denis Kasak
for short periods of time when moved to a new location. svn-id: r42586
2009-07-18Fixed bug which caused animations to sometimes be played too fast if the ↵Denis Kasak
engine was busier than usual (like when redrawing the whole screen when returning from minimized state). svn-id: r42585
2009-07-18Fixed bug where certain animations were played very fast when not played ↵Denis Kasak
immediately when they are created. svn-id: r42580
2009-07-18* Added Animation::getFrame()Denis Kasak
* 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-14* Fixed bug in Animation which made the first frame of an animation being ↵Denis Kasak
drawn after it's stopped * Fixed debugging info when starting and stopping animations svn-id: r42485
2009-07-13Fixed bug in the NoScene logo room; the screen surface is now cleared ↵Denis Kasak
between scene redraws (filled with the colour 0) to fix artifacts when animating the logo. svn-id: r42448
2009-07-12Moved the delay mechanism from Animation to Drawable since each frame in an ↵Denis Kasak
animation can have a different delay. svn-id: r42427
2009-07-07* Added some more animation debug infoDenis Kasak
* 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-07Made AnimationManager::getAnimation() return NULL when an animation is not ↵Denis Kasak
found instead of Common::List<>::end(). svn-id: r42228
2009-07-07Shortened AnimationManager::{play,stop}(). Removed some excessive newlines.Denis Kasak
svn-id: r42226
2009-07-07* Added AnimationManager::deleteOverlays().Denis Kasak
* Fixed bug in AnimationManager::deleteAnimation() that could result in accessing the Common::List::end() sentinel value. svn-id: r42223
2009-07-05Renaming Animation -> AnimationManager and AnimObj -> Animation in light of ↵Denis Kasak
the new API change. svn-id: r42133
2009-07-05* API change for Animation and AnimObj; AnimObj is now a proper class and ↵Denis Kasak
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-03Added support for playing and stopping animations.Denis Kasak
svn-id: r42075
2009-07-03Added deconstructor for Animation. Made Animation objects delete their ↵Denis Kasak
frames when deleteAll() or deleteAnimation() are called. svn-id: r42073
2009-07-03Implemented beginning of the animation engine.Denis Kasak
svn-id: r42068
2009-07-01Added empty animation.cpp and animation.h files.Denis Kasak
svn-id: r42000