[Scummvm-cvs-logs] CVS: scummvm/gui console.cpp,1.67,1.68 console.h,1.34,1.35
Chris Apers
chrilith at users.sourceforge.net
Sat Oct 8 12:41:55 CEST 2005
Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3619
Modified Files:
console.cpp console.h
Log Message:
Use font manager
Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/console.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- console.cpp 3 Sep 2005 18:20:09 -0000 1.67
+++ console.cpp 8 Oct 2005 19:40:47 -0000 1.68
@@ -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 @@
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 @@
#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::vprintf(const char *format, va_list argptr) {
-#ifdef PALMOS_68K
+#ifdef PALMOS_MODE
char buf[256];
#else
char buf[2048];
@@ -632,10 +629,10 @@
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);
Index: console.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/console.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- console.h 30 Jul 2005 21:11:01 -0000 1.34
+++ console.h 8 Oct 2005 19:40:47 -0000 1.35
@@ -44,6 +44,8 @@
protected:
Graphics::Surface _canvas;
+ const Graphics::Font *_font;
+
char _buffer[kBufferSize];
int _linesInBuffer;
More information about the Scummvm-git-logs
mailing list