[Scummvm-cvs-logs] SF.net SVN: scummvm:[47900] scummvm/trunk/engines/sci/graphics
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Fri Feb 5 13:30:41 CET 2010
Revision: 47900
http://scummvm.svn.sourceforge.net/scummvm/?rev=47900&view=rev
Author: m_kiewitz
Date: 2010-02-05 12:30:41 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
SCI: renamed class Font to GfxFont
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/cache.cpp
scummvm/trunk/engines/sci/graphics/cache.h
scummvm/trunk/engines/sci/graphics/font.cpp
scummvm/trunk/engines/sci/graphics/font.h
scummvm/trunk/engines/sci/graphics/frameout.cpp
scummvm/trunk/engines/sci/graphics/text16.cpp
scummvm/trunk/engines/sci/graphics/text16.h
Modified: scummvm/trunk/engines/sci/graphics/cache.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.cpp 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/cache.cpp 2010-02-05 12:30:41 UTC (rev 47900)
@@ -63,12 +63,12 @@
_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];
}
Modified: scummvm/trunk/engines/sci/graphics/cache.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/cache.h 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/cache.h 2010-02-05 12:30:41 UTC (rev 47900)
@@ -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 @@
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);
Modified: scummvm/trunk/engines/sci/graphics/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.cpp 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/font.cpp 2010-02-05 12:30:41 UTC (rev 47900)
@@ -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() {
+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;
Modified: scummvm/trunk/engines/sci/graphics/font.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.h 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/font.h 2010-02-05 12:30:41 UTC (rev 47900)
@@ -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();
Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp 2010-02-05 12:30:41 UTC (rev 47900)
@@ -235,7 +235,7 @@
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;
Modified: scummvm/trunk/engines/sci/graphics/text16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/text16.cpp 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/text16.cpp 2010-02-05 12:30:41 UTC (rev 47900)
@@ -57,7 +57,7 @@
return _ports->_curPort->fontId;
}
-Font *GfxText16::GetFont() {
+GfxFont *GfxText16::GetFont() {
if ((_font == NULL) || (_font->getResourceId() != _ports->_curPort->fontId))
_font = _cache->getFont(_ports->_curPort->fontId);
Modified: scummvm/trunk/engines/sci/graphics/text16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/text16.h 2010-02-05 12:14:03 UTC (rev 47899)
+++ scummvm/trunk/engines/sci/graphics/text16.h 2010-02-05 12:30:41 UTC (rev 47900)
@@ -35,14 +35,14 @@
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 @@
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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list