Commit Graph

43 Commits

Author SHA1 Message Date
Robert Špalek
e779284403 Sound effects are now correctly played.
Dubbing is not yet played.

svn-id: r45000
2009-10-12 22:27:23 +00:00
Robert Špalek
f71b32dd96 Loading and caching sound samples in memory.
The sounds are not played yet, but the infrastructure is getting ready.

svn-id: r44957
2009-10-11 23:01:59 +00:00
Max Horn
cc54ad650d Remove trailing whitespaces
svn-id: r44493
2009-09-30 16:04:21 +00:00
Johannes Schickel
c9ca057ae2 - Adapt parts of the Draci code to match our code formatting guidelines
- 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-30 10:45:14 +00:00
Torbjörn Andersson
c857369131 Fixed Valgrind warnings about invalid memory access. Hopefully without breaking
anything, but modifying a data structure while traversing it can be a bit
tricky...

svn-id: r44469
2009-09-29 19:51:37 +00:00
Denis Kasak
137c44013c draci: Inverted a logical check to make it more obvious.
svn-id: r44454
2009-09-28 23:32:16 +00:00
Denis Kasak
a8d6e8774c Made AnimationManager::sortAnimations() do multiple passes, if necessary, and added some animation debug info.
svn-id: r44452
2009-09-28 23:02:39 +00:00
Robert Špalek
caa3b6707e Improved the interface of Sprite and Animation concerning relative 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-27 20:49:59 +00:00
Robert Špalek
cf1031fc63 Fix renumbering of animation indexes
svn-id: r44414
2009-09-27 18:51:07 +00:00
Robert Špalek
fc2bb50600 Remove memory leak in animation manager. Get rid of 1 non-const reference parameter.
svn-id: r44413
2009-09-27 18:11:06 +00:00
Robert Špalek
431780297e Added some more const's to the interface of Dragon History
svn-id: r44362
2009-09-25 17:33:00 +00:00
Robert Špalek
f51c81f344 Add const's to many interfaces of engines/draci/
svn-id: r44331
2009-09-25 08:13:39 +00:00
Denis Kasak
e5774d2881 * Added pause support for animations.
* Added AnimationManager::addItem() for adding inventory items animations.

svn-id: r43486
2009-08-17 18:47:17 +00:00
Denis Kasak
3022c623d6 Stopped returning from Animation::nextFrame() early even if the animation 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-08-12 07:37:08 +00:00
Denis Kasak
7532845fee Fixed sanity check in Animation::setCurrentFrame().
svn-id: r42914
2009-07-30 02:16:58 +00:00
Denis Kasak
b124c8b122 * Added Animation::setCurrentFrame()
* Moved rewinding the animation to the beginning from Animation::nextFrame() to AnimationManager::stop() (fixes the owl animation)

svn-id: r42913
2009-07-30 01:12:07 +00:00
Denis Kasak
f42894c33c Added support for animation callbacks and implemented a few callbacks (doNothing, exitGameLoop, stopAnimation).
svn-id: r42901
2009-07-29 19:39:10 +00:00
Denis Kasak
33af83c650 * Added method Animation::currentFrameNum()
* Renamed Animation::getFramesNum() to Animation::getFrameCount() for clarity.

svn-id: r42873
2009-07-29 00:46:36 +00:00
Denis Kasak
0098084969 Fixed one more bug related to animations having no frames.
svn-id: r42838
2009-07-27 04:47:38 +00:00
Denis Kasak
673bae4443 * Added AnimationManager::addText() for adding text animations
* 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-27 04:18:44 +00:00
Denis Kasak
c1ad0c3926 * Added tracking and deleting animations by index (which represents the 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-24 05:00:53 +00:00
Denis Kasak
a2bca06b3f Added support for per-animation scaling (via scaling factors). I have 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-24 01:54:13 +00:00
Denis Kasak
1726cc8d24 * Disabled unconditional execution of gates' scripts
* 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 11:30:57 +00:00
Denis Kasak
ef37d0a9b0 * Stopped AnimationManager::drawScene() from marking its own dirtiness.
* 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 07:18:00 +00:00
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