aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-26 17:45:32 +0200
committerEinar Johan Trøan Sømåen2012-07-26 17:45:32 +0200
commitf5cbee18f86de7c5c423fc855c8466e6ce01c714 (patch)
treef6f31e6d8d561b91e18ca2d1c1c09bebb68e31ea /engines/wintermute/base
parentef11f9d0c53cbdd9d88a99143de6f43f34d7e24d (diff)
downloadscummvm-rg350-f5cbee18f86de7c5c423fc855c8466e6ce01c714.tar.gz
scummvm-rg350-f5cbee18f86de7c5c423fc855c8466e6ce01c714.tar.bz2
scummvm-rg350-f5cbee18f86de7c5c423fc855c8466e6ce01c714.zip
WINTERMUTE: Remove unused code in BaseFontTTF
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp46
-rw-r--r--engines/wintermute/base/font/base_font_truetype.h30
2 files changed, 2 insertions, 74 deletions
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index 420df58b74..e14d79cb42 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -61,13 +61,7 @@ BaseFontTT::BaseFontTT(BaseGame *inGame): BaseFont(inGame) {
_cachedTexts[i] = NULL;
}
-#if 0
- _fTFace = NULL;
- _fTStream = NULL;
-#endif
-
- _ascender = _descender = _lineHeight = _pointSize = _underlinePos = 0;
- _horDpi = _vertDpi = 0;
+ _lineHeight = 0;
_maxCharWidth = _maxCharHeight = 0;
}
@@ -85,15 +79,6 @@ BaseFontTT::~BaseFontTT(void) {
delete _deletableFont;
_font = NULL;
-
-#if 0
- if (_fTFace) {
- FT_Done_Face(_fTFace);
- _fTFace = NULL;
- }
- delete[] _fTStream;
- _fTStream = NULL;
-#endif
}
@@ -258,7 +243,7 @@ void BaseFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align,
//////////////////////////////////////////////////////////////////////////
BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset) {
//TextLineList lines;
- // TODO
+ // TODO: Use WideString-conversion here.
//WrapText(text, width, maxHeight, lines);
Common::Array<Common::String> lines;
_font->wordWrapText(text, width, lines);
@@ -402,33 +387,6 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width,
return NULL;
}
-//////////////////////////////////////////////////////////////////////////
-void BaseFontTT::blitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect) {
- //SDL_BlitSurface(src, NULL, target, targetRect);
- warning("BaseFontTT::BlitSurface - not ported yet");
-#if 0
- for (int y = 0; y < src->h; y++) {
- if (targetRect->y + y < 0 || targetRect->y + y >= target->h) {
- continue;
- }
-
-
- uint8 *srcBuf = (uint8 *)src->pixels + y * src->pitch;
- uint8 *tgtBuf = (uint8 *)target->pixels + (y + targetRect->y) * target->pitch;
-
- uint32 *srcBuf32 = (uint32 *)srcBuf;
- uint32 *tgtBuf32 = (uint32 *)tgtBuf;
-
- for (int x = 0; x < src->w; x++) {
- if (targetRect->x + x < 0 || targetRect->x + x >= target->w) {
- continue;
- }
-
- tgtBuf32[x + targetRect->x] = srcBuf32[x];
- }
- }
-#endif
-}
//////////////////////////////////////////////////////////////////////////
int BaseFontTT::getLetterHeight() {
diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h
index f8c5eee74d..434fa7100c 100644
--- a/engines/wintermute/base/font/base_font_truetype.h
+++ b/engines/wintermute/base/font/base_font_truetype.h
@@ -94,27 +94,6 @@ public:
uint32 _color;
};
- //////////////////////////////////////////////////////////////////////////
- class TextLine {
- public:
- TextLine(const WideString &text, int width) {
- _text = text;
- _width = width;
- }
-
- const WideString getText() const {
- return _text;
- }
- int getWidth() const {
- return _width;
- }
- private:
- WideString _text;
- int _width;
- };
- typedef Common::List<TextLine *> TextLineList;
-
-
public:
DECLARE_PERSISTENT(BaseFontTT, BaseFont)
BaseFontTT(BaseGame *inGame);
@@ -138,12 +117,9 @@ public:
private:
bool parseLayer(BaseTTFontLayer *layer, byte *buffer);
- void wrapText(const WideString &text, int maxWidth, int maxHeight, TextLineList &lines);
void measureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight);
BaseSurface *renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset);
- void blitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect);
-
BaseCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
@@ -153,13 +129,7 @@ private:
const Graphics::Font *_font;
const Graphics::Font *_fallbackFont;
- float _ascender;
- float _descender;
float _lineHeight;
- float _underlinePos;
- float _pointSize;
- float _vertDpi;
- float _horDpi;
size_t _maxCharWidth;
size_t _maxCharHeight;