aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-15 00:48:42 +0200
committerEinar Johan Trøan Sømåen2012-06-15 00:57:08 +0200
commit407a8818002b91f512faacb2ce9fa1f48b4c649e (patch)
treed4defb3c85b13177501ddc34fc14f7f53f767ef3 /engines/wintermute
parentcac5db7dfe58cf8f353d13d02fdd4be1452490d9 (diff)
downloadscummvm-rg350-407a8818002b91f512faacb2ce9fa1f48b4c649e.tar.gz
scummvm-rg350-407a8818002b91f512faacb2ce9fa1f48b4c649e.tar.bz2
scummvm-rg350-407a8818002b91f512faacb2ce9fa1f48b4c649e.zip
WINTERMUTE: Clean up BFonTT a little.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/Base/BFontTT.cpp23
-rw-r--r--engines/wintermute/Base/BFontTT.h19
-rw-r--r--engines/wintermute/FontGlyphCache.cpp4
-rw-r--r--engines/wintermute/FontGlyphCache.h4
4 files changed, 22 insertions, 28 deletions
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 2ec1f5031b..fd0993a5bb 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -756,7 +756,7 @@ void CBFontTT::FTCloseProc(FT_Stream stream) {
}*/
-
+#if 0
//////////////////////////////////////////////////////////////////////////
void CBFontTT::WrapText(const WideString &text, int maxWidth, int maxHeight, TextLineList &lines) {
int currWidth = 0;
@@ -837,7 +837,7 @@ void CBFontTT::WrapText(const WideString &text, int maxWidth, int maxHeight, Tex
currWidth += charWidth;
}
}
-
+#endif
//////////////////////////////////////////////////////////////////////////
void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight) {
//TextLineList lines;
@@ -873,10 +873,10 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight,
}*/
}
-
+#if 0
//////////////////////////////////////////////////////////////////////////
float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) {
-#if 0
+
GlyphInfo *infoLeft = _glyphCache->GetGlyph(leftChar);
GlyphInfo *infoRight = _glyphCache->GetGlyph(rightChar);
@@ -887,23 +887,25 @@ float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) {
if (error) return 0;
return delta.x * (1.0f / 64.0f);
-#endif
+
return 0;
}
-
-
+#endif
+#if 0
//////////////////////////////////////////////////////////////////////////
void CBFontTT::PrepareGlyphs(const WideString &text) {
+
// make sure we have all the glyphs we need
for (size_t i = 0; i < text.size(); i++) {
wchar_t ch = text[i];
if (!_glyphCache->HasGlyph(ch)) CacheGlyph(ch);
}
-}
+}
+#endif
+#if 0
//////////////////////////////////////////////////////////////////////////
void CBFontTT::CacheGlyph(wchar_t ch) {
-#if 0
FT_UInt glyphIndex = FT_Get_Char_Index(_fTFace, ch);
if (!glyphIndex) return;
@@ -939,7 +941,6 @@ void CBFontTT::CacheGlyph(wchar_t ch) {
_glyphCache->AddGlyph(ch, glyphIndex, _fTFace->glyph, _fTFace->glyph->bitmap.width, _fTFace->glyph->bitmap.rows, pixels, stride);
if (tempBuffer) delete [] tempBuffer;
-#endif
}
-
+#endif
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/BFontTT.h b/engines/wintermute/Base/BFontTT.h
index d21729369b..5658997d2e 100644
--- a/engines/wintermute/Base/BFontTT.h
+++ b/engines/wintermute/Base/BFontTT.h
@@ -120,16 +120,13 @@ public:
CBFontTT(CBGame *inGame);
virtual ~CBFontTT(void);
- virtual int GetTextWidth(byte *text, int MaxLenght = -1);
+ virtual int GetTextWidth(byte *text, int maxLenght = -1);
virtual int GetTextHeight(byte *text, int width);
- virtual void DrawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int MaxLenght = -1);
+ virtual void DrawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLenght = -1);
virtual int GetLetterHeight();
- HRESULT LoadBuffer(byte *Buffer);
- HRESULT LoadFile(const char *Filename);
-
- /* static unsigned long FTReadSeekProc(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count);
- static void FTCloseProc(FT_Stream stream);*/
+ HRESULT LoadBuffer(byte *buffer);
+ HRESULT LoadFile(const char *filename);
FontGlyphCache *GetGlyphCache() {
return _glyphCache;
@@ -143,13 +140,10 @@ public:
void InitLoop();
private:
- HRESULT ParseLayer(CBTTFontLayer *Layer, byte *Buffer);
+ HRESULT ParseLayer(CBTTFontLayer *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);
- float GetKerning(wchar_t leftChar, wchar_t rightChar);
- void PrepareGlyphs(const WideString &text);
- void CacheGlyph(wchar_t ch);
CBSurface *RenderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset);
void BlitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect);
@@ -158,8 +152,7 @@ private:
CBCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
HRESULT InitFont();
- //FT_Stream _fTStream;
- //FT_Face _fTFace;
+
Graphics::Font *_deletableFont;
const Graphics::Font *_font;
const Graphics::Font *_fallbackFont;
diff --git a/engines/wintermute/FontGlyphCache.cpp b/engines/wintermute/FontGlyphCache.cpp
index ea0acd4c19..73dc3d2ff1 100644
--- a/engines/wintermute/FontGlyphCache.cpp
+++ b/engines/wintermute/FontGlyphCache.cpp
@@ -29,7 +29,7 @@
#include "FontGlyphCache.h"
namespace WinterMute {
-
+#if 0
//////////////////////////////////////////////////////////////////////////
FontGlyphCache::FontGlyphCache() {
}
@@ -98,5 +98,5 @@ void GlyphInfo::SetGlyphImage(size_t width, size_t height, size_t stride, byte *
SDL_UnlockSurface(_image);
#endif
}
-
+#endif
} // end of namespace WinterMute
diff --git a/engines/wintermute/FontGlyphCache.h b/engines/wintermute/FontGlyphCache.h
index 9b1cafe4cb..bb36c0d864 100644
--- a/engines/wintermute/FontGlyphCache.h
+++ b/engines/wintermute/FontGlyphCache.h
@@ -34,7 +34,7 @@
#include "graphics/surface.h"
namespace WinterMute {
-
+#if 0
//////////////////////////////////////////////////////////////////////////
class GlyphInfo {
public:
@@ -119,7 +119,7 @@ private:
typedef Common::HashMap<char, GlyphInfo *> GlyphInfoMap; // TODO
GlyphInfoMap _glyphs;
};
-
+#endif
} // end of namespace WinterMute
#endif // WINTERMUTE_FONTGLYPHCACHE_H