Allow char drawing with a custom font

svn-id: r14624
This commit is contained in:
Max Horn 2004-08-15 13:49:13 +00:00
parent e27f2c5592
commit 0f142572f7
2 changed files with 8 additions and 4 deletions

View File

@ -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) {

View File

@ -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);