aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-05 12:30:41 +0000
committerMartin Kiewitz2010-02-05 12:30:41 +0000
commit51b608d794e0ac53403a1f96f36dd642677bbf1d (patch)
tree9e7a4310a67f7d6f748beab152136bd1c53a8b46 /engines/sci
parent3ad4433adfd6c31b92d37d057ad677f9e971b836 (diff)
downloadscummvm-rg350-51b608d794e0ac53403a1f96f36dd642677bbf1d.tar.gz
scummvm-rg350-51b608d794e0ac53403a1f96f36dd642677bbf1d.tar.bz2
scummvm-rg350-51b608d794e0ac53403a1f96f36dd642677bbf1d.zip
SCI: renamed class Font to GfxFont
svn-id: r47900
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/cache.cpp4
-rw-r--r--engines/sci/graphics/cache.h6
-rw-r--r--engines/sci/graphics/font.cpp16
-rw-r--r--engines/sci/graphics/font.h6
-rw-r--r--engines/sci/graphics/frameout.cpp2
-rw-r--r--engines/sci/graphics/text16.cpp2
-rw-r--r--engines/sci/graphics/text16.h6
7 files changed, 21 insertions, 21 deletions
diff --git a/engines/sci/graphics/cache.cpp b/engines/sci/graphics/cache.cpp
index c3c0c034ab..ef8538349f 100644
--- a/engines/sci/graphics/cache.cpp
+++ b/engines/sci/graphics/cache.cpp
@@ -63,12 +63,12 @@ void GfxCache::purgeViewCache() {
_cachedViews.clear();
}
-Font *GfxCache::getFont(GuiResourceId fontId) {
+GfxFont *GfxCache::getFont(GuiResourceId fontId) {
if (_cachedFonts.size() >= MAX_CACHED_FONTS)
purgeFontCache();
if (!_cachedFonts.contains(fontId))
- _cachedFonts[fontId] = new Font(_resMan, _screen, fontId);
+ _cachedFonts[fontId] = new GfxFont(_resMan, _screen, fontId);
return _cachedFonts[fontId];
}
diff --git a/engines/sci/graphics/cache.h b/engines/sci/graphics/cache.h
index c444b69c3c..b1754929b1 100644
--- a/engines/sci/graphics/cache.h
+++ b/engines/sci/graphics/cache.h
@@ -32,10 +32,10 @@
namespace Sci {
-class Font;
+class GfxFont;
class GfxView;
-typedef Common::HashMap<int, Font *> FontCache;
+typedef Common::HashMap<int, GfxFont *> FontCache;
typedef Common::HashMap<int, GfxView *> ViewCache;
class GfxCache {
@@ -43,7 +43,7 @@ public:
GfxCache(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette);
~GfxCache();
- Font *getFont(GuiResourceId fontId);
+ GfxFont *getFont(GuiResourceId fontId);
GfxView *getView(GuiResourceId viewId);
int16 kernelViewGetCelWidth(GuiResourceId viewId, int16 loopNo, int16 celNo);
diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp
index c85ff9bd15..4bfe8f87dd 100644
--- a/engines/sci/graphics/font.cpp
+++ b/engines/sci/graphics/font.cpp
@@ -30,7 +30,7 @@
namespace Sci {
-Font::Font(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId)
+GfxFont::GfxFont(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId)
: _resourceId(resourceId), _screen(screen), _resMan(resMan) {
assert(resourceId != -1);
@@ -56,29 +56,29 @@ Font::Font(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId)
}
}
-Font::~Font() {
+GfxFont::~GfxFont() {
delete []_chars;
_resMan->unlockResource(_resource);
}
-GuiResourceId Font::getResourceId() {
+GuiResourceId GfxFont::getResourceId() {
return _resourceId;
}
-byte Font::getHeight() {
+byte GfxFont::getHeight() {
return _fontHeight;
}
-byte Font::getCharWidth(byte chr) {
+byte GfxFont::getCharWidth(byte chr) {
return chr < _numChars ? _chars[chr].w : 0;
}
-byte Font::getCharHeight(byte chr) {
+byte GfxFont::getCharHeight(byte chr) {
return chr < _numChars ? _chars[chr].h : 0;
}
-byte *Font::getCharData(byte chr) {
+byte *GfxFont::getCharData(byte chr) {
return chr < _numChars ? _resourceData + _chars[chr].offset + 2 : 0;
}
-void Font::draw(int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
+void GfxFont::draw(int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
int charWidth = MIN<int>(getCharWidth(chr), _screen->getWidth() - left);
int charHeight = MIN<int>(getCharHeight(chr), _screen->getHeight() - top);
byte b = 0, mask = 0xFF;
diff --git a/engines/sci/graphics/font.h b/engines/sci/graphics/font.h
index 4a33b484d0..a14ad4aaa3 100644
--- a/engines/sci/graphics/font.h
+++ b/engines/sci/graphics/font.h
@@ -30,10 +30,10 @@
namespace Sci {
-class Font {
+class GfxFont {
public:
- Font(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId);
- ~Font();
+ GfxFont(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId);
+ ~GfxFont();
GuiResourceId getResourceId();
byte getHeight();
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 05c79f3ca9..e9ee25946c 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -235,7 +235,7 @@ void GfxFrameout::kernelFrameout() {
if (lookup_selector(_segMan, itemEntry->object, kernel->_selectorCache.text, NULL, NULL) == kSelectorVariable) {
Common::String text = _segMan->getString(GET_SEL32(_segMan, itemEntry->object, text));
int16 fontRes = GET_SEL32V(_segMan, itemEntry->object, font);
- Font *font = new Font(_resMan, _screen, fontRes);
+ GfxFont *font = new GfxFont(_resMan, _screen, fontRes);
bool dimmed = GET_SEL32V(_segMan, itemEntry->object, dimmed);
uint16 foreColor = GET_SEL32V(_segMan, itemEntry->object, fore);
uint16 curX = itemEntry->x;
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index 4f3bf35ce9..68e46c5472 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -57,7 +57,7 @@ GuiResourceId GfxText16::GetFontId() {
return _ports->_curPort->fontId;
}
-Font *GfxText16::GetFont() {
+GfxFont *GfxText16::GetFont() {
if ((_font == NULL) || (_font->getResourceId() != _ports->_curPort->fontId))
_font = _cache->getFont(_ports->_curPort->fontId);
diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h
index c55c09e91e..47e5f14e13 100644
--- a/engines/sci/graphics/text16.h
+++ b/engines/sci/graphics/text16.h
@@ -35,14 +35,14 @@ namespace Sci {
class GfxPorts;
class GfxPaint16;
class GfxScreen;
-class Font;
+class GfxFont;
class GfxText16 {
public:
GfxText16(ResourceManager *_resMan, GfxCache *fonts, GfxPorts *ports, GfxPaint16 *paint16, GfxScreen *screen);
~GfxText16();
GuiResourceId GetFontId();
- Font *GetFont();
+ GfxFont *GetFont();
void SetFont(GuiResourceId fontId);
void CodeSetFonts(int argc, reg_t *argv);
@@ -62,7 +62,7 @@ public:
void Box(const char *text, int16 bshow, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId);
void Draw_String(const char *text);
- Font *_font;
+ GfxFont *_font;
private:
void init();