summaryrefslogtreecommitdiff
path: root/src/gui/truetypefont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/truetypefont.cpp')
-rw-r--r--src/gui/truetypefont.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp
index 24c60caf..7c72e2f5 100644
--- a/src/gui/truetypefont.cpp
+++ b/src/gui/truetypefont.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,8 +43,7 @@ class TextChunk
bool operator==(const TextChunk &chunk) const
{
- return (
- chunk.text == text && chunk.color == color);
+ return (chunk.text == text && chunk.color == color);
}
void generate(TTF_Font *font)
@@ -78,7 +76,7 @@ typedef std::list<TextChunk>::iterator CacheIterator;
static int fontCounter;
-TrueTypeFont::TrueTypeFont(const std::string& filename, int size)
+TrueTypeFont::TrueTypeFont(const std::string &filename, int size)
{
if (fontCounter == 0 && TTF_Init() == -1)
{
@@ -133,12 +131,12 @@ void TrueTypeFont::drawString(gcn::Graphics *graphics,
bool found = false;
- for (CacheIterator i = cache.begin(); i != cache.end(); i++)
+ for (CacheIterator i = mCache.begin(); i != mCache.end(); ++i)
{
if (chunk == (*i))
{
// Raise priority: move it to front
- cache.splice(cache.begin(), cache, i);
+ mCache.splice(mCache.begin(), mCache, i);
found = true;
break;
}
@@ -147,19 +145,19 @@ void TrueTypeFont::drawString(gcn::Graphics *graphics,
// Surface not found
if (!found)
{
- if (cache.size() >= CACHE_SIZE)
+ if (mCache.size() >= CACHE_SIZE)
{
- cache.pop_back();
+ mCache.pop_back();
}
- cache.push_front(chunk);
- cache.front().generate(mFont);
+ mCache.push_front(chunk);
+ mCache.front().generate(mFont);
}
- cache.front().img->setAlpha(alpha);
- g->drawImage(cache.front().img, x, y);
+ mCache.front().img->setAlpha(alpha);
+ g->drawImage(mCache.front().img, x, y);
}
-int TrueTypeFont::getWidth(const std::string& text) const
+int TrueTypeFont::getWidth(const std::string &text) const
{
int w, h;
TTF_SizeUTF8(mFont, text.c_str(), &w, &h);