aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kasak2009-06-14 16:33:20 +0000
committerDenis Kasak2009-06-14 16:33:20 +0000
commit149b45f7a59c5319c912d13d8259b63b5fbb2a21 (patch)
tree939139a56605161040e0920f72003299d7b871d1
parent15a35e359d6a5a973a434b03626bc0e1e5001a0f (diff)
downloadscummvm-rg350-149b45f7a59c5319c912d13d8259b63b5fbb2a21.tar.gz
scummvm-rg350-149b45f7a59c5319c912d13d8259b63b5fbb2a21.tar.bz2
scummvm-rg350-149b45f7a59c5319c912d13d8259b63b5fbb2a21.zip
Renamed DraciFont class to Font to be more consistent with the rest of the classes and other engines.
svn-id: r41523
-rw-r--r--engines/draci/draci.cpp2
-rw-r--r--engines/draci/font.cpp18
-rw-r--r--engines/draci/font.h6
3 files changed, 13 insertions, 13 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 151fb046ed..a75080d31d 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -132,7 +132,7 @@ int DraciEngine::go() {
_system->fillScreen(255);
// Draw big string
- DraciFont font(kFontBig);
+ Font font(kFontBig);
Common::String testString = "Testing, testing, read all about it!";
Graphics::Surface *surf = _system->lockScreen();
font.drawString(surf, testString,
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp
index 284c6b8f48..104b341fd1 100644
--- a/engines/draci/font.cpp
+++ b/engines/draci/font.cpp
@@ -30,13 +30,13 @@
namespace Draci {
-DraciFont::DraciFont(const Common::String &filename) :
+Font::Font(const Common::String &filename) :
_fontHeight(0), _maxCharWidth(0),
_charWidths(NULL), _charData(0) {
setFont(filename);
}
-DraciFont::~DraciFont() {
+Font::~Font() {
freeFont();
}
@@ -45,7 +45,7 @@ DraciFont::~DraciFont() {
* @param path Path to font file
* @return true if the font was loaded successfully, false otherwise
*
- * Loads fonts from a file into a DraciFont instance. The original game uses two
+ * Loads fonts from a file into a Font instance. The original game uses two
* fonts (located inside files "Small.fon" and "Big.fon"). The characters in the
* font are indexed from the space character so an appropriate offset must be
* added to convert them to equivalent char values, i.e. kDraciIndexOffset.
@@ -58,7 +58,7 @@ DraciFont::~DraciFont() {
* [138 * fontHeight * maxWidth bytes] character data, stored row-wise
*/
-bool DraciFont::setFont(const Common::String &filename) {
+bool Font::setFont(const Common::String &filename) {
// Free previously loaded font (if any)
freeFont();
@@ -96,12 +96,12 @@ bool DraciFont::setFont(const Common::String &filename) {
return true;
}
-void DraciFont::freeFont() {
+void Font::freeFont() {
delete[] _charWidths;
delete[] _charData;
}
-uint8 DraciFont::getCharWidth(uint8 chr) const {
+uint8 Font::getCharWidth(uint8 chr) const {
return _charWidths[chr - kCharIndexOffset];
}
@@ -114,7 +114,7 @@ uint8 DraciFont::getCharWidth(uint8 chr) const {
* @param ty Vertical offset on the surface
*/
-void DraciFont::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const {
+void Font::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const {
assert(dst != NULL);
assert(tx >= 0);
assert(ty >= 0);
@@ -155,7 +155,7 @@ void DraciFont::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) cons
* @param spacing Space to leave between individual characters. Defaults to 0.
*/
-void DraciFont::drawString(Graphics::Surface *dst, Common::String &str,
+void Font::drawString(Graphics::Surface *dst, Common::String &str,
int x, int y, int spacing) const {
assert(dst != NULL);
assert(x >= 0);
@@ -185,7 +185,7 @@ void DraciFont::drawString(Graphics::Surface *dst, Common::String &str,
* @return The calculated width of the string
*/
-int DraciFont::getStringWidth(Common::String &str, int spacing) const {
+int Font::getStringWidth(Common::String &str, int spacing) const {
int width = 0;
uint len = str.size();
for (unsigned int i = 0; i < len; ++i) {
diff --git a/engines/draci/font.h b/engines/draci/font.h
index b28b1ec338..ddc6eaec7e 100644
--- a/engines/draci/font.h
+++ b/engines/draci/font.h
@@ -34,11 +34,11 @@ const Common::String kFontBig("Big.fon");
* Represents the game's fonts. See docs for setFont() for font format details.
*/
-class DraciFont {
+class Font {
public:
- DraciFont(const Common::String &filename);
- ~DraciFont();
+ Font(const Common::String &filename);
+ ~Font();
bool setFont(const Common::String &filename);
uint8 getFontHeight() const { return _fontHeight; };
uint8 getMaxCharWidth() const { return _maxCharWidth; };