Denis Kasak
20a744bdd2
Simplified rectangle height and width calculation in Sprite::drawScaled() (use methods of Common::Rect instead of doing it manually).
...
svn-id: r42779
2009-07-25 18:33:20 +00:00
Denis Kasak
9b32771017
Fixed scaled mirrored sprite drawing. This change enables the NoSense logo animation to be played correctly.
...
svn-id: r42649
2009-07-22 04:50:11 +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
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
d519626c55
Added const keyword to "transparent" local variable in Sprite::draw() and removed leading underscore.
...
svn-id: r42227
2009-07-07 15:37:50 +00:00
Denis Kasak
61fa4d27d5
Cache the transparent colour instead of calling a function for every pixel.
...
svn-id: r42192
2009-07-06 19:41:13 +00:00
Denis Kasak
960740fe83
Rewrote Sprite::draw() to draw overflowing sprites correctly. Stopped playing animations as soon as they're loaded from Game::loadAnimation().
...
svn-id: r42111
2009-07-04 23:05:13 +00:00
Denis Kasak
a06509f3c2
* Removed tracking of Z coordinates in Drawable since it's not used
...
* Made columnwise parameter mandatory
* Made Sprite coordinates signed (the engine sometimes uses negative coordinates)
* Prevented overflow when drawing sprites in some cases
svn-id: r42100
2009-07-04 18:29:01 +00:00
Denis Kasak
63d0fdea68
Added Sprite::getRect() and Text::getRect().
...
svn-id: r42074
2009-07-03 19:02:08 +00:00
Denis Kasak
90e6ff9d8a
Added support for mirrored sprites.
...
svn-id: r42067
2009-07-03 17:39:13 +00:00
Denis Kasak
8e9771d15c
Added bool parameter markDirty to Sprite::draw() and Text::draw() to specify whether to mark a dirty rect for a particular draw (also added such support to the Font class since it's needed by Text). Made spacing parameters for Text instances mandatory.
...
svn-id: r42066
2009-07-03 16:41:11 +00:00
Denis Kasak
58c1591ae0
Added Text::setSpacing() method.
...
svn-id: r41999
2009-07-01 16:15:06 +00:00
Denis Kasak
1373eeea12
Made Text objects calculate their widths and heights properly.
...
svn-id: r41998
2009-07-01 16:14:04 +00:00
Denis Kasak
cfadb6cc3d
Made coordinate specification mandatory when constructing objects of type Sprite and Class. Made transforming from columnwise a default (since it was done most of the time anyway). Changed coordinates to use uint instead of uint16.
...
svn-id: r41996
2009-07-01 16:00:27 +00:00
Denis Kasak
4895993588
Added Text::setText() and Text::setColour() methods. Changed demo animation to use them.
...
svn-id: r41984
2009-07-01 01:43:20 +00:00
Denis Kasak
d7f8cbf170
Added text position specification to Text constructor.
...
svn-id: r41982
2009-07-01 01:18:22 +00:00
Denis Kasak
78d5b96f51
Added Text as a subclass of Drawable. Fixed syntax error in font.cpp
...
svn-id: r41981
2009-07-01 01:11:48 +00:00
Denis Kasak
85a5871873
Added the Drawable abstract base class and made Sprite inherit from it.
...
svn-id: r41979
2009-06-30 22:31:29 +00:00
Denis Kasak
d6729f3804
Added transformToRows() static method to Sprite. Modified Sprite constructors to use it.
...
svn-id: r41865
2009-06-25 14:03:57 +00:00
Denis Kasak
f5e39fa61d
* Expanded docs for the Sprite class
...
* Added Surface and Screen docs
* Small documentation fixes
svn-id: r41779
2009-06-22 20:13:25 +00:00
Denis Kasak
1fe88abf6b
Added Sprite::draw() method for drawing sprites to a Surface.
...
svn-id: r41654
2009-06-19 00:00:31 +00:00
Denis Kasak
b942082da4
Removed superfluous return from the Sprite constructor.
...
svn-id: r41525
2009-06-14 19:06:46 +00:00
Eugene Sandulenko
f6f7a1e31a
Whitespce fixes
...
svn-id: r41514
2009-06-14 13:51:07 +00:00
Denis Kasak
b8ec907ea0
Added a Sprite class for handling sprites in the Draci format transparently. Modified the test animation to use it.
...
svn-id: r41509
2009-06-14 12:44:12 +00:00