summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-28 01:40:42 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-28 01:40:42 +0300
commitb6559685c8825c1cee8ac395d6f2af0bc45c4bb4 (patch)
tree210000c9cc707b52f1df56d90f787185188edfcb
parent7900408adc2b6db601373de2730a80707ec4c837 (diff)
downloadplus-b6559685c8825c1cee8ac395d6f2af0bc45c4bb4.tar.gz
plus-b6559685c8825c1cee8ac395d6f2af0bc45c4bb4.tar.bz2
plus-b6559685c8825c1cee8ac395d6f2af0bc45c4bb4.tar.xz
plus-b6559685c8825c1cee8ac395d6f2af0bc45c4bb4.zip
Remove unused font object from sdlfont class.
-rw-r--r--src/gui/sdlfont.cpp21
-rw-r--r--src/gui/sdlfont.h1
2 files changed, 4 insertions, 18 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index 181bcef87..776e04782 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -69,8 +69,7 @@ class SDLTextChunk final
&& chunk.color2 == color2);
}
- void generate(TTF_Font *const font, TTF_Font *const font2,
- const float alpha)
+ void generate(TTF_Font *const font, const float alpha)
{
BLOCK_START("SDLTextChunk::generate")
SDL_Color sdlCol;
@@ -181,9 +180,8 @@ SDLFont::SDLFont(std::string filename, const int size, const int style) :
fixDirSeparators(filename);
mFont = TTF_OpenFont(resman->getPath(filename).c_str(), size);
- mFontOutline = TTF_OpenFont(resman->getPath(filename).c_str(), size);
- if (!mFont || !mFontOutline)
+ if (!mFont)
{
logger->log("Error finding font " + filename);
std::string backFile = "fonts/dejavusans.ttf";
@@ -194,26 +192,15 @@ SDLFont::SDLFont(std::string filename, const int size, const int style) :
throw GCN_EXCEPTION("SDLSDLFont::SDLSDLFont: " +
std::string(TTF_GetError()));
}
- mFontOutline = TTF_OpenFont(resman->getPath(
- fixDirSeparators(backFile)).c_str(), size);
- if (!mFont)
- {
- throw GCN_EXCEPTION("SDLSDLFont::SDLSDLFont: " +
- std::string(TTF_GetError()));
- }
}
TTF_SetFontStyle(mFont, style);
- TTF_SetFontStyle(mFontOutline, style);
- TTF_SetFontOutline(mFontOutline, OUTLINE_SIZE);
}
SDLFont::~SDLFont()
{
TTF_CloseFont(mFont);
mFont = nullptr;
- TTF_CloseFont(mFontOutline);
- mFontOutline = nullptr;
--fontCounter;
if (fontCounter == 0)
@@ -328,7 +315,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics,
#endif
cache->push_front(chunk);
SDLTextChunk &data = cache->front();
- data.generate(mFont, mFontOutline, alpha);
+ data.generate(mFont, alpha);
if (data.img)
g->drawImage(data.img, x, y);
@@ -364,7 +351,7 @@ void SDLFont::createSDLTextChunk(SDLTextChunk *const chunk)
const float alpha = static_cast<float>(chunk->color.a) / 255.0f;
chunk->color.a = 255;
- chunk->generate(mFont, mFontOutline, alpha);
+ chunk->generate(mFont, alpha);
}
int SDLFont::getWidth(const std::string &text) const
diff --git a/src/gui/sdlfont.h b/src/gui/sdlfont.h
index 89f920cc3..3086abf0a 100644
--- a/src/gui/sdlfont.h
+++ b/src/gui/sdlfont.h
@@ -97,7 +97,6 @@ class SDLFont final : public gcn::Font
private:
TTF_Font *mFont;
- TTF_Font *mFontOutline;
unsigned mCreateCounter;
unsigned mDeleteCounter;