aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/animation.cpp
AgeCommit message (Collapse)Author
2010-11-19COMMON: Split common/stream.h into several headersMax Horn
svn-id: r54385
2010-07-03Finish support of compressed dubbingRobert Špalek
Now even the length of a compressed stream is measured precisely and the dubbing sounds exactly like the original. svn-id: r50618
2010-04-01Dragon History: fixing properly bug 2976774Robert Špalek
The previous bugfix just hid the problem by removing an assert, but it might demonstrate itself in another way later. This is a proper bugfix. svn-id: r48460
2009-12-09DRACI: Reduce header interdependencies; some cleanupMax Horn
svn-id: r46320
2009-11-28Fixed bug with exhausting sound handlesRobert Špalek
It was caused by forever re-starting the same sample when the animation was stopped and the same frame got displayed over and over, each time triggering playing the same sample. svn-id: r46168
2009-11-26Fix SIGSEGV found by ValGrindRobert Špalek
svn-id: r46142
2009-11-22Fix positioning of one-time hero animations.Robert Špalek
With the previous code, the position of the animation was doubled (due to counting the position twice, the second time being a relative shift), which put it mostly outside the screen. This is because one-time hero animations are actually stored using absolute coordinates. svn-id: r46057
2009-11-22Fixed Animation::getTopAnimation()Robert Špalek
It does not return kTitleText and others. This caused flickering of speech texts on/off when the title got displayed under the mouse. svn-id: r46056
2009-11-10Huge refactoring of data structures.Robert Špalek
Replaced IDs of objects by pointers, which saves many lookups, each of which is horribly ineffective. Moved a lot of code into methods of structs now turned into objects. Tested the new code a lot and seems to work as well as the old code. svn-id: r45799
2009-11-08Removed old hack for cyclic animations.Robert Špalek
This makes the hero's walk even smoother. svn-id: r45763
2009-11-08Silence gcc warning by putting parentheses around an && expression nested in ↵Johannes Schickel
an || expression. svn-id: r45752
2009-11-08Implement QuickHero walking.Robert Špalek
Pressing Q during the game enables/disables faster walking; all animation phases are flipped after one refresh instead of after given delay. svn-id: r45748
2009-11-08Fixed mistake with two inner loop caused by not clearing the path.Robert Špalek
Also, optimize play() and stop() svn-id: r45746
2009-11-08Debugged smooth walking except for 1 bug.Robert Špalek
Adjusting to the edge is done such that it respects slight sideways movements of the dragon. Fixed rounding issues in the whole game. Improved debug messages. Made sure that the dragon does not turn like crazy around when clicking on the same pixel: the final point is always the clicked one although the middle points made by shifted to make the animations smooth, and preserve the dragons direction if he has not walked. There is a bug with running turning animations as they seem to disappear for 1 frame and have incorrect Z coordinate. Will investigate it next. svn-id: r45742
2009-11-07Add helper functions to retrieve dragon position from the animation.Robert Špalek
To implement proper walking, I have to respect the relative shifts defined by the sprites as opposed to apply some constant velocity. svn-id: r45714
2009-11-07Implemented relative animations.Robert Špalek
In these animations, each sprite can specify a relative shift with respect to the previous sprite. Moving animations (such as walking of the dragon) are easily described in this framework. I have sort of hacked their support and it seems to work. The current walking code does not interact with the new code yet, but it will be easy to do. svn-id: r45712
2009-11-06Add safe-guard against collision of animation IDs.Robert Špalek
When debugging another issue, I preloaded all animations, and horrible things happened that I debugged for a few hours. svn-id: r45695
2009-11-05Implemented proper walking.Robert Špalek
First shot, not debugged yet, but seems to work (even though a bit hairy)! svn-id: r45688
2009-11-01Debugged computation and displaying of optimal walking pathsRobert Špalek
svn-id: r45597
2009-10-30Moved all one-line getters/setters to the header filesRobert Špalek
svn-id: r45524
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