diff options
Diffstat (limited to 'src/gui/widgets/textpreview.cpp')
-rw-r--r-- | src/gui/widgets/textpreview.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 5408eebe..d0bba285 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -2,7 +2,7 @@ * The Mana World * Copyright (C) 2006 The Mana World Development Team * - * This file is part of Aethyra based on 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 @@ -19,22 +19,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <typeinfo> +#include "gui/widgets/textpreview.h" -#include "textpreview.h" +#include "gui/gui.h" +#include "gui/palette.h" +#include "gui/textrenderer.h" +#include "gui/truetypefont.h" -#include "../gui.h" -#include "../palette.h" -#include "../textrenderer.h" -#include "../truetypefont.h" +#include "configuration.h" -#include "../../configuration.h" +#include <typeinfo> float TextPreview::mAlpha = config.getValue("guialpha", 0.8); -TextPreview::TextPreview(const std::string* text) +TextPreview::TextPreview(const std::string &text): + mText(text) { - mText = text; mTextAlpha = false; mFont = gui->getFont(); mTextColor = &guiPalette->getColor(Palette::TEXT); @@ -65,7 +65,7 @@ void TextPreview::draw(gcn::Graphics* graphics) if (mTextBGColor && typeid(*mFont) == typeid(TrueTypeFont)) { TrueTypeFont *font = static_cast<TrueTypeFont*>(mFont); - int x = font->getWidth(*mText) + 1 + 2 * ((mOutline || mShadow) ? 1 :0); + int x = font->getWidth(mText) + 1 + 2 * ((mOutline || mShadow) ? 1 :0); int y = font->getHeight() + 1 + 2 * ((mOutline || mShadow) ? 1 : 0); graphics->setColor(gcn::Color((int) mTextBGColor->r, (int) mTextBGColor->g, @@ -74,7 +74,7 @@ void TextPreview::draw(gcn::Graphics* graphics) graphics->fillRectangle(gcn::Rectangle(1, 1, x, y)); } - TextRenderer::renderText(graphics, *mText, 2, 2, gcn::Graphics::LEFT, + TextRenderer::renderText(graphics, mText, 2, 2, gcn::Graphics::LEFT, gcn::Color(mTextColor->r, mTextColor->g, mTextColor->b, alpha), mFont, mOutline, mShadow, alpha); |