diff options
author | Chris Apers | 2005-10-08 19:40:47 +0000 |
---|---|---|
committer | Chris Apers | 2005-10-08 19:40:47 +0000 |
commit | 3bd243e0433be31a0549b38bde10e89fb1d8b864 (patch) | |
tree | 4a1ec9c2f1e5e0a134769f39fbe3727ea4433025 /gui | |
parent | 8b4f59dc7a0021ec37a26225b6e39e98e7adaa94 (diff) | |
download | scummvm-rg350-3bd243e0433be31a0549b38bde10e89fb1d8b864.tar.gz scummvm-rg350-3bd243e0433be31a0549b38bde10e89fb1d8b864.tar.bz2 scummvm-rg350-3bd243e0433be31a0549b38bde10e89fb1d8b864.zip |
Use font manager
svn-id: r18964
Diffstat (limited to 'gui')
-rw-r--r-- | gui/console.cpp | 19 | ||||
-rw-r--r-- | gui/console.h | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/gui/console.cpp b/gui/console.cpp index 3bff410edb..30c9509351 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -29,15 +29,10 @@ #include "graphics/font.h" -namespace Graphics { -extern const NewFont g_consolefont; -} -using Graphics::g_consolefont; - namespace GUI { -#define kConsoleCharWidth (g_consolefont.getMaxCharWidth()) -#define kConsoleLineHeight (g_consolefont.getFontHeight() + 2) +#define kConsoleCharWidth (_font->getMaxCharWidth()) +#define kConsoleLineHeight (_font->getFontHeight() + 2) enum { kConsoleSlideDownDuration = 200 // Time in milliseconds @@ -59,6 +54,8 @@ ConsoleDialog::ConsoleDialog(float widthPercent, float heightPercent) const int screenW = g_system->getOverlayWidth(); const int screenH = g_system->getOverlayHeight(); + + _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont); // Calculate the real width/height (rounded to char/line multiples) _w = (uint16)(_widthPercent * screenW); @@ -177,7 +174,7 @@ void ConsoleDialog::drawDialog() { #else byte c = buffer((start + line) * _lineWidth + column); #endif - g_gui.drawChar(c, x, y, g_gui._textcolor, &g_consolefont); + g_gui.drawChar(c, x, y, g_gui._textcolor, _font); x += kConsoleCharWidth; } y += kConsoleLineHeight; @@ -568,7 +565,7 @@ int ConsoleDialog::printf(const char *format, ...) { } int ConsoleDialog::vprintf(const char *format, va_list argptr) { -#ifdef PALMOS_68K +#ifdef PALMOS_MODE char buf[256]; #else char buf[2048]; @@ -632,10 +629,10 @@ void ConsoleDialog::drawCaret(bool erase) { char c = buffer(_currentPos); if (erase) { g_gui.fillRect(x, y, kConsoleCharWidth, kConsoleLineHeight, g_gui._bgcolor); - g_gui.drawChar(c, x, y + 2, g_gui._textcolor, &g_consolefont); + g_gui.drawChar(c, x, y + 2, g_gui._textcolor, _font); } else { g_gui.fillRect(x, y, kConsoleCharWidth, kConsoleLineHeight, g_gui._textcolor); - g_gui.drawChar(c, x, y + 2, g_gui._bgcolor, &g_consolefont); + g_gui.drawChar(c, x, y + 2, g_gui._bgcolor, _font); } g_gui.addDirtyRect(x, y, kConsoleCharWidth, kConsoleLineHeight); diff --git a/gui/console.h b/gui/console.h index 62deb53c8d..90657b6ce5 100644 --- a/gui/console.h +++ b/gui/console.h @@ -44,6 +44,8 @@ public: protected: Graphics::Surface _canvas; + const Graphics::Font *_font; + char _buffer[kBufferSize]; int _linesInBuffer; |