Commit Graph

45 Commits

Author SHA1 Message Date
Johannes Schickel
df777fee2a DRACI: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
2149a2383d Reduce indirect header dependencies further
svn-id: r48936
2010-05-04 12:00:16 +00:00
Robert Špalek
2d8b25f656 Dragon History: fixing properly bug 2976774
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
2010-04-01 22:01:40 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Robert Špalek
0ee8f879fa Fix positioning of one-time hero animations.
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-22 05:10:31 +00:00
Robert Špalek
e2ca397e63 Huge refactoring of data structures.
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-10 05:16:34 +00:00
Robert Špalek
4341a36641 Implement QuickHero walking.
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-08 06:46:24 +00:00
Robert Špalek
f534c12289 Add helper functions to retrieve dragon position from the animation.
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-07 04:56:28 +00:00
Robert Špalek
357d9989d4 Implemented relative animations.
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-07 01:28:27 +00:00
Robert Špalek
f8a19bb4a9 Implemented proper walking.
First shot, not debugged yet, but seems to work (even though a bit hairy)!

svn-id: r45688
2009-11-05 14:22:39 +00:00
Robert Špalek
f77446a500 Commented on loop() before refactoring.
svn-id: r45604
2009-11-01 23:04:56 +00:00
Robert Špalek
c1cc230e4b Debugged computation and displaying of optimal walking paths
svn-id: r45597
2009-11-01 12:57:06 +00:00
Robert Špalek
6411125f39 Moved all one-line getters/setters to the header files
svn-id: r45524
2009-10-30 06:11:04 +00:00
Robert Špalek
d662c4aa20 Remove the last 2 default parameter values.
They usually just add unnecessary confusion and this is definitely such
an example.  Removal will clarify the code.

svn-id: r45512
2009-10-30 01:56:52 +00:00
Robert Špalek
c778efaca5 Remove most of default parameter values.
Also, add comments to the last commit.

svn-id: r45511
2009-10-30 01:41:57 +00:00
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
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
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
014c33718f Added a dedicated animation for speech text.
svn-id: r42988
2009-08-02 03:02:22 +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
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
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
6097828f54 Made 'show walking map overlay' setting persist when changing rooms.
svn-id: r42628
2009-07-20 17:34:19 +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
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
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
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