aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-05-11 01:49:37 +0200
committerEinar Johan Trøan Sømåen2012-06-02 12:56:05 +0200
commit6acc470bc6682f4705248b8ace86c3c7ca96f03c (patch)
tree06bf25389578f3e0c7673cd1d692a294a2253123 /engines
parent7339ca988f65cad90a6d0a22e93e1925e4384c35 (diff)
downloadscummvm-rg350-6acc470bc6682f4705248b8ace86c3c7ca96f03c.tar.gz
scummvm-rg350-6acc470bc6682f4705248b8ace86c3c7ca96f03c.tar.bz2
scummvm-rg350-6acc470bc6682f4705248b8ace86c3c7ca96f03c.zip
WINTERMUTE: Disable fonts, and remove FreeType2.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/BFontStorage.cpp8
-rw-r--r--engines/wintermute/BFontStorage.h10
-rw-r--r--engines/wintermute/BFontTT.cpp28
-rw-r--r--engines/wintermute/BFontTT.h8
-rw-r--r--engines/wintermute/FontGlyphCache.cpp4
-rw-r--r--engines/wintermute/FontGlyphCache.h2
6 files changed, 34 insertions, 26 deletions
diff --git a/engines/wintermute/BFontStorage.cpp b/engines/wintermute/BFontStorage.cpp
index 1ceb77cb1c..61b5e58805 100644
--- a/engines/wintermute/BFontStorage.cpp
+++ b/engines/wintermute/BFontStorage.cpp
@@ -43,7 +43,7 @@ IMPLEMENT_PERSISTENT(CBFontStorage, true)
//////////////////////////////////////////////////////////////////////////
CBFontStorage::CBFontStorage(CBGame *inGame): CBBase(inGame) {
- _fTLibrary = NULL;
+// _fTLibrary = NULL;
InitFreeType();
}
@@ -56,10 +56,12 @@ CBFontStorage::~CBFontStorage() {
//////////////////////////////////////////////////////////////////////////
void CBFontStorage::InitFreeType() {
+#if 0
FT_Error error = FT_Init_FreeType(&_fTLibrary);
if (error) {
Game->LOG(0, "Error initializing FreeType library.");
}
+#endif
}
//////////////////////////////////////////////////////////////////////////
@@ -72,9 +74,9 @@ HRESULT CBFontStorage::Cleanup(bool Warn) {
}
_fonts.RemoveAll();
-
+#if 0
if (_fTLibrary) FT_Done_FreeType(_fTLibrary);
-
+#endif
return S_OK;
}
diff --git a/engines/wintermute/BFontStorage.h b/engines/wintermute/BFontStorage.h
index 010d0a83c2..25e1b345d2 100644
--- a/engines/wintermute/BFontStorage.h
+++ b/engines/wintermute/BFontStorage.h
@@ -34,8 +34,8 @@
#include "persistent.h"
#include "coll_templ.h"
-#include <ft2build.h>
-#include FT_FREETYPE_H
+/*#include <ft2build.h>
+#include FT_FREETYPE_H*/
namespace WinterMute {
@@ -52,13 +52,13 @@ public:
CBArray<CBFont *, CBFont *> _fonts;
HRESULT InitLoop();
- FT_Library GetFTLibrary() const {
+/* FT_Library GetFTLibrary() const {
return _fTLibrary;
- }
+ }*/
private:
void InitFreeType();
- FT_Library _fTLibrary;
+ //FT_Library _fTLibrary;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFontTT.cpp b/engines/wintermute/BFontTT.cpp
index 8019429329..f2971efc52 100644
--- a/engines/wintermute/BFontTT.cpp
+++ b/engines/wintermute/BFontTT.cpp
@@ -26,8 +26,8 @@
* Copyright (c) 2011 Jan Nedoma
*/
-#include <ft2build.h>
-#include FT_FREETYPE_H
+//#include <ft2build.h>
+//#include FT_FREETYPE_H
#include "dcgf.h"
#include "BFile.h"
#include "BFontTT.h"
@@ -56,10 +56,10 @@ CBFontTT::CBFontTT(CBGame *inGame): CBFont(inGame) {
for (int i = 0; i < NUM_CACHED_TEXTS; i++) _cachedTexts[i] = NULL;
-
+#if 0
_fTFace = NULL;
_fTStream = NULL;
-
+#endif
_glyphCache = NULL;
_ascender = _descender = _lineHeight = _pointSize = _underlinePos = 0;
@@ -81,14 +81,14 @@ CBFontTT::~CBFontTT(void) {
delete _glyphCache;
_glyphCache = NULL;
-
+#if 0
if (_fTFace) {
FT_Done_Face(_fTFace);
_fTFace = NULL;
}
delete[] _fTStream;
_fTStream = NULL;
-
+#endif
}
@@ -596,7 +596,8 @@ void CBFontTT::AfterLoad() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFontTT::InitFont() {
if (!_fontFile) return E_FAIL;
-
+ warning("BFontTT::InitFont - Not ported yet");
+ return E_FAIL;
CBFile *file = Game->_fileManager->OpenFile(_fontFile);
if (!file) {
// the requested font file is not in wme file space; try loading a system font
@@ -608,7 +609,7 @@ HRESULT CBFontTT::InitFont() {
return E_FAIL;
}
}
-
+#if 0
FT_Error error;
float vertDpi = 96.0;
@@ -665,7 +666,7 @@ HRESULT CBFontTT::InitFont() {
_glyphCache = new FontGlyphCache();
_glyphCache->Initialize();
-
+#endif
return S_OK;
}
@@ -673,6 +674,7 @@ HRESULT CBFontTT::InitFont() {
//////////////////////////////////////////////////////////////////////////
// I/O bridge between FreeType and WME file system
//////////////////////////////////////////////////////////////////////////
+/*
unsigned long CBFontTT::FTReadSeekProc(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count) {
CBFile *f = static_cast<CBFile *>(stream->descriptor.pointer);
if (!f) return 0;
@@ -694,7 +696,7 @@ void CBFontTT::FTCloseProc(FT_Stream stream) {
Game->_fileManager->CloseFile(f);
stream->descriptor.pointer = NULL;
-}
+}*/
@@ -800,7 +802,7 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight,
float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) {
GlyphInfo *infoLeft = _glyphCache->GetGlyph(leftChar);
GlyphInfo *infoRight = _glyphCache->GetGlyph(rightChar);
-
+#if 0
if (!infoLeft || !infoRight) return 0;
FT_Vector delta;
@@ -808,6 +810,8 @@ float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) {
if (error) return 0;
return delta.x * (1.0f / 64.0f);
+#endif
+ return 0;
}
@@ -822,6 +826,7 @@ void CBFontTT::PrepareGlyphs(const WideString &text) {
//////////////////////////////////////////////////////////////////////////
void CBFontTT::CacheGlyph(wchar_t ch) {
+#if 0
FT_UInt glyphIndex = FT_Get_Char_Index(_fTFace, ch);
if (!glyphIndex) return;
@@ -857,6 +862,7 @@ 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
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/BFontTT.h b/engines/wintermute/BFontTT.h
index 812fc61b2e..5690947465 100644
--- a/engines/wintermute/BFontTT.h
+++ b/engines/wintermute/BFontTT.h
@@ -127,8 +127,8 @@ public:
HRESULT LoadBuffer(byte *Buffer);
HRESULT LoadFile(char *Filename);
- static unsigned long FTReadSeekProc(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count);
- static void FTCloseProc(FT_Stream stream);
+/* static unsigned long FTReadSeekProc(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count);
+ static void FTCloseProc(FT_Stream stream);*/
FontGlyphCache *GetGlyphCache() {
return _glyphCache;
@@ -157,8 +157,8 @@ private:
CBCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
HRESULT InitFont();
- FT_Stream _fTStream;
- FT_Face _fTFace;
+ //FT_Stream _fTStream;
+ //FT_Face _fTFace;
FontGlyphCache *_glyphCache;
diff --git a/engines/wintermute/FontGlyphCache.cpp b/engines/wintermute/FontGlyphCache.cpp
index 81ecd49c86..d2ac984b29 100644
--- a/engines/wintermute/FontGlyphCache.cpp
+++ b/engines/wintermute/FontGlyphCache.cpp
@@ -58,7 +58,7 @@ GlyphInfo *FontGlyphCache::GetGlyph(wchar_t ch) {
return it->_value;
}
-
+/*
//////////////////////////////////////////////////////////////////////////
void FontGlyphCache::AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot, size_t width, size_t height, byte *pixels, size_t stride) {
if (stride == 0) stride = width;
@@ -67,7 +67,7 @@ void FontGlyphCache::AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot
_glyphs[ch]->SetGlyphInfo(glyphSlot->advance.x / 64.f, glyphSlot->advance.y / 64.f, glyphSlot->bitmap_left, glyphSlot->bitmap_top);
_glyphs[ch]->SetGlyphImage(width, height, stride, pixels);
}
-
+*/
//////////////////////////////////////////////////////////////////////////
void GlyphInfo::SetGlyphImage(size_t width, size_t height, size_t stride, byte *pixels) {
diff --git a/engines/wintermute/FontGlyphCache.h b/engines/wintermute/FontGlyphCache.h
index 7fac01e40c..0a42748107 100644
--- a/engines/wintermute/FontGlyphCache.h
+++ b/engines/wintermute/FontGlyphCache.h
@@ -109,7 +109,7 @@ public:
void Initialize();
bool HasGlyph(wchar_t ch);
GlyphInfo *GetGlyph(wchar_t ch);
- void AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot, size_t width, size_t height, byte *pixels, size_t stride = 0);
+ //void AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot, size_t width, size_t height, byte *pixels, size_t stride = 0);
private:
//typedef Common::HashMap<wchar_t, GlyphInfo *> GlyphInfoMap;