Commit graph

54 commits

Author SHA1 Message Date
Johannes Schickel
df777fee2a DRACI: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Eugene Sandulenko
734abb5a53 DRACI: Fix potential sign extention. CID 1003514 2013-10-17 14:18:27 +03:00
Tarek Soliman
921f602ab8 JANITORIAL: Fix whitespace in pointer template arg 2012-02-15 10:07:08 -06:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
84184aabc0 ALL: colour -> color 2011-04-14 14:12:35 +02:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Lars Persson
61d68b9d4a Removed <cmath> includes since a) not a part of Symbian OS b) Compiles fine without it (at least with Symbian OS GCCE 3.4.3 and CW 2)
svn-id: r46213
2009-11-30 08:09:39 +00:00
Robert Špalek
87c26fe54b Fixed bug with exhausting sound handles
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-28 00:07:22 +00:00
Robert Špalek
95d4c62efb Fixed breaking long lines instead of using smaller font (which is sometimes not enough)
svn-id: r46101
2009-11-23 06:44:40 +00:00
Robert Špalek
8ed71d903a Refactored draw() according to drawReScaled()
svn-id: r45826
2009-11-11 02:25:42 +00:00
Robert Špalek
8edfd6b56c Updated the list of TODOs
svn-id: r45768
2009-11-08 22:48:27 +00:00
Robert Špalek
354d7f6366 Debugged smooth walking except for 1 bug.
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-08 03:16:22 +00:00
Robert Špalek
f91c89560f Get rid of doubling memory allocation and a lot of copying.
The Sprite class points to the original buffer (which is cached in the memory
thanks to BArchive machinery) instead of allocating its own buffer and
copying the source there.

svn-id: r45594
2009-11-01 10:03:37 +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
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
a20e42efb9 Move WalkingMap into new module.
Also, fix a bug when loading the default walking map (wasn't implemented)
and setting font size.  The reason I move this code into a new module is
because I will augment it with other walking-related algorithms soon.

svn-id: r45510
2009-10-30 00:52:05 +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
4be9e6cda0 Rewrite from scratch drawReScaled() and cropping now works well.
I left draw() as is for now, although it could also be similarly simplified.
Also, one could easily completely get rid of columnIndices[], but I was too
tired for the time being.

svn-id: r44457
2009-09-29 06:36: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
431780297e Added some more const's to the interface of Dragon History
svn-id: r44362
2009-09-25 17:33:00 +00:00
Filippos Karapetis
e296cef9be Created a macro for lround(), for non-C99 compilers, and used that in places where lround() is used
svn-id: r44337
2009-09-25 09:48:43 +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
Filippos Karapetis
7106caca81 Replaced the C99 lround() with floor(), to get draci to compile under non-C99 compilers (e.g. VS)
svn-id: r44328
2009-09-25 07:05:26 +00:00
Denis Kasak
e46abf1643 Added Text::setFont().
svn-id: r43159
2009-08-09 03:59:39 +00:00
Denis Kasak
854c27ffac Calculate the character length of Text objects (without the '|' separators) when setting a new string. Implemented Text::getLength().
svn-id: r42990
2009-08-02 05:09:55 +00:00
Denis Kasak
fa59e4b16b * Added Sprite::getPixel() (takes into account whether a sprite is mirrored or scaled)
* Made the Text class internally store a Common::String instead of a byte *

svn-id: r42835
2009-07-27 04:14:59 +00:00
Denis Kasak
2525ec46de * Removed friend declarations in Drawable for Sprite and Text, and made Drawable's private members protected so they can access them
* Added Text::drawScaled() and altered Text::getRect() so Text instances can be accessed through a Drawable pointer. Scaling text is planned for later because it's not essential.

svn-id: r42789
2009-07-26 00:04:12 +00:00
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