Commit Graph

38 Commits

Author SHA1 Message Date
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
Robert Špalek
33cc92d414 Fixed bug 2976767 on corrupted char glyphs.
After unfinished translation of the game, several inaccessible characters
have been left in the game files.  Since the font does not contain all 256
characters, trying to draw them brings them random jump.  I now properly
skip these characters.

svn-id: r48462
2010-04-02 01:00:35 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +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
7ef17ba73e get rid of static Common::String's
svn-id: r44432
2009-09-28 03:06:43 +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
Denis Kasak
fad77de234 Sped up the game during dialogues by not updating every drawn char separately but the whole string at once. Also removed the markDirty parameter from Font::drawChar() since it's not needed anymore.
svn-id: r43368
2009-08-14 16:12:17 +00:00
Denis Kasak
71dbb75031 * Added Font::getLineWidth()
* Changed Font::getStringWidth() and Font::getStringHeight() to return uint instead of int.
* Made the Font::drawString() overload which accepts a Common::String the "default" one. The overload accepting a (byte *) now calls that one (it was the other way around before).
* Added proper line centering to the Font::drawString() routine. 

svn-id: r43053
2009-08-04 19:23:59 +00:00
Denis Kasak
41d7590835 * Reverted change that subtracts 1 from font colour indexes for various speaking characters; they are 0-based after all.
* Fixed font blitting algorithm to allow for both white fonts and transparency.

svn-id: r43044
2009-08-04 15:41:27 +00:00
Denis Kasak
5e2eefd4fe * Fixed bug which made characters talk with the wrong colour; the colour indexes are indexed from 1 in the data files so we need to subtract 1.
* Turned on font transparency again. 

svn-id: r43022
2009-08-03 01:48:15 +00:00
Denis Kasak
77033ca9a1 * Fixed bug in Font::getStringWidth() which made it miscalculate string widths (a temporary variable used for storing the width of the current line was not being reset).
* Temporarily disabled font transparency because the dragon's text is rendered hollow (transparency inside glyph bodies). 

svn-id: r42993
2009-08-02 05:16:36 +00:00
Denis Kasak
bc89ce23d3 Fixed text bugs related to the fact that some strings in the data files don't end with '|' like they should.
svn-id: r42897
2009-07-29 16:39:12 +00:00
Denis Kasak
ddf8f1cbb5 * Removed unused variable
* Fixed unsigned to signed comparison warning

svn-id: r42834
2009-07-27 03:57:43 +00:00
Denis Kasak
b14828c4ce * Added Font::getStringHeight()
* Made Font::getStringWidth() calculate the width of the string properly now that handling of multi-row strings is in
* Fixed bug which caused the last column of pixels in the last letter of a string to linger on the screen

svn-id: r42832
2009-07-27 03:08:19 +00:00
Denis Kasak
3f571c7eae Handled the '|' char correctly when drawing text (it serves as both a newline and end-of-string marker).
svn-id: r42788
2009-07-25 23:43:21 +00:00
Denis Kasak
a4a3ad123c Renamed Font::setFont() to loadFont(). Removed DraciEngine::_font and added _smallFont and _bigFont so each font can be handled separately.
svn-id: r42514
2009-07-15 18:16:54 +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
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
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
49e1a07f27 Added Font::drawString overload that takes in a pointer to a byte buffer and a length instead of a Common::String. Changed the former drawString to be a wrapper for the new one.
svn-id: r41980
2009-07-01 01:02:48 +00:00
Denis Kasak
8c3e1b0e8d Documentation fix for the Font class.
svn-id: r41776
2009-06-22 19:32:47 +00:00
Denis Kasak
9d0b940af3 Added support for the new Surface class to Font (transparency, marking dirty rectangles).
svn-id: r41656
2009-06-19 00:09:36 +00:00
Denis Kasak
8249d24a63 Changing font colour constants to an enum.
svn-id: r41553
2009-06-15 17:14:38 +00:00
Denis Kasak
a3a9f5c790 Added const to reference parameters of Font::drawString() and Font::getStringWidth().
svn-id: r41530
2009-06-15 00:31:25 +00:00
Denis Kasak
910991ddde Converted default font colours from static members of Font to constants. Moved the initializer list of the Font constructor to the constructor body (for readability).
svn-id: r41529
2009-06-15 00:29:05 +00:00
Denis Kasak
718f84fb97 Added a Font _font variable to the engine instance. Fixed font colour handling by replacing the appropriate colours before drawing. Added Font::setColour() method for changing the current font colour. Added include guards to draci/font.h. Moved kFontBig and kFontSmall constants to draci/font.cpp to prevent redefinition errors.
svn-id: r41524
2009-06-14 18:59:31 +00:00
Denis Kasak
149b45f7a5 Renamed DraciFont class to Font to be more consistent with the rest of the classes and other engines.
svn-id: r41523
2009-06-14 16:33:20 +00:00
Denis Kasak
15a35e359d Changed DraciFont API to accept const Strings when loading fonts and added constants for font types.
svn-id: r41522
2009-06-14 16:21:44 +00:00
Denis Kasak
92dd6d5474 Reworded DraciFont docs (with regards to mentioning ASCII).
svn-id: r41511
2009-06-14 13:32:21 +00:00
Denis Kasak
d6ddbf7062 Removed superfluous checks for NULL in DraciFont::freeFont().
svn-id: r41510
2009-06-14 13:10:12 +00:00
Denis Kasak
5808e4f940 Made DraciFont::drawString() return early if the string is too long to fit on the screen.
svn-id: r41475
2009-06-12 10:37:46 +00:00
Denis Kasak
837f76f61f Made DraciFont::drawString() take a String reference instead of a copy.
svn-id: r41472
2009-06-12 10:25:05 +00:00
Denis Kasak
32d12e90e3 Removed overflow/underflow checks from DraciFont::drawChar(). Instead, we now calculate the number of pixels that can be drawn without overflowing beforehand. Also added asserts to catch any negative value passed for the coordinates.
svn-id: r41471
2009-06-12 10:22:43 +00:00
Denis Kasak
2308748f01 Made the DraciFont::freeFont() method safe to call in any circumstance by making it check for NULL pointers itself to prevent double free / corruption. This also fixes a potential bug in the destructor.
svn-id: r41469
2009-06-12 09:52:35 +00:00
Denis Kasak
51672df700 Properly documented everything (including the new DraciFont class). Reshuffled some old comments.
svn-id: r41467
2009-06-12 09:45:12 +00:00
Denis Kasak
a36a9a0398 Implemented font handling via the DraciFont class. Reprogrammed the test animation to use the original game fonts. Removed the old drawString() hack.
svn-id: r41454
2009-06-11 20:31:36 +00:00