aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-08-15 13:49:13 +0000
committerMax Horn2004-08-15 13:49:13 +0000
commit0f142572f7e4ee643a462d22654a4f9dd9b2ee7a (patch)
tree64846e4001f6dad2e5af0749dd05412f184e6b8b
parente27f2c559243ee316f96d9ee490d4757d981f3a6 (diff)
downloadscummvm-rg350-0f142572f7e4ee643a462d22654a4f9dd9b2ee7a.tar.gz
scummvm-rg350-0f142572f7e4ee643a462d22654a4f9dd9b2ee7a.tar.bz2
scummvm-rg350-0f142572f7e4ee643a462d22654a4f9dd9b2ee7a.zip
Allow char drawing with a custom font
svn-id: r14624
-rw-r--r--gui/newgui.cpp6
-rw-r--r--gui/newgui.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index ed58bda981..767c5776c9 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -373,8 +373,10 @@ void NewGui::addDirtyRect(int x, int y, int w, int h) {
_system->copyRectToOverlay(buf, _screenPitch, x, y, w, h);
}
-void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color) {
- getFont().drawChar(&_screen, chr, xx, yy, color);
+void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color, const Graphics::Font *font) {
+ if (font == 0)
+ font = &getFont();
+ font->drawChar(&_screen, chr, xx, yy, color);
}
int NewGui::getStringWidth(const String &str) {
diff --git a/gui/newgui.h b/gui/newgui.h
index 8200d9f722..82b2af1a94 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -128,10 +128,12 @@ public:
void fillRect(int x, int y, int w, int h, OverlayColor color);
void checkerRect(int x, int y, int w, int h, OverlayColor color);
void frameRect(int x, int y, int w, int h, OverlayColor color);
- void drawChar(byte c, int x, int y, OverlayColor color);
+
+ void drawChar(byte c, int x, int y, OverlayColor color, const Graphics::Font *font = 0);
+ void drawString(const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
+
int getStringWidth(const String &str);
int getCharWidth(byte c);
- void drawString(const String &str, int x, int y, int w, OverlayColor color, Graphics::TextAlignment align = Graphics::kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
void drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h = 8);