aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-24 23:33:59 +0100
committerEugene Sandulenko2017-01-24 23:33:59 +0100
commitb84ab35363ac2fd40031b7f313fe49ebfc09d967 (patch)
treeb3602ed42dba1a5ae200c9dcf6752e477e504b7b /graphics/fonts
parent41e93fca1653a548b561a66b170bb4df59e723ad (diff)
downloadscummvm-rg350-b84ab35363ac2fd40031b7f313fe49ebfc09d967.tar.gz
scummvm-rg350-b84ab35363ac2fd40031b7f313fe49ebfc09d967.tar.bz2
scummvm-rg350-b84ab35363ac2fd40031b7f313fe49ebfc09d967.zip
GRAPHICS: Plug MacFont scaler in
Diffstat (limited to 'graphics/fonts')
-rw-r--r--graphics/fonts/macfont.cpp6
-rw-r--r--graphics/fonts/macfont.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index b8b808f9ea..d15f0d1704 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -427,6 +427,8 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
data._size = src->_data._size;
data._style = src->_data._style;
+ data._glyphs.resize(src->_data._glyphs.size());
+
// Dtermine width of the bit image table
int newBitmapWidth = 0;
for (uint i = 0; i < src->_data._glyphs.size() + 1; i++) {
@@ -443,7 +445,7 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
data._rowWords = newBitmapWidth;
- uint16 bitImageSize = data._rowWords * _data._fRectHeight;
+ uint16 bitImageSize = data._rowWords * data._fRectHeight;
data._bitImage = new byte[bitImageSize];
int srcPitch = src->_data._rowWords;
@@ -454,7 +456,7 @@ MacFONTFont *MacFONTFont::scaleFont(MacFONTFont *src, int newSize) {
MacGlyph *glyph = (i == src->_data._glyphs.size()) ? &data._defaultChar : &data._glyphs[i];
byte *ptr = &data._bitImage[glyph->bitmapOffset];
- for (int y = 0; y < _data._fRectHeight; y++) {
+ for (int y = 0; y < data._fRectHeight; y++) {
const byte *srcd = (const byte *)&src->_data._bitImage[((int)((float)y / scale)) * srcPitch + srcglyph->bitmapOffset];
byte *dst = ptr;
byte b = 0;
diff --git a/graphics/fonts/macfont.h b/graphics/fonts/macfont.h
index ab285ed905..5baa6438bb 100644
--- a/graphics/fonts/macfont.h
+++ b/graphics/fonts/macfont.h
@@ -156,7 +156,7 @@ public:
int getFontSize() const { return _data._size; }
- MacFONTFont *scaleFont(MacFONTFont *src, int newSize);
+ static MacFONTFont *scaleFont(MacFONTFont *src, int newSize);
private:
MacFONTdata _data;