[Scummvm-cvs-logs] CVS: scummvm/gui widget.cpp,1.51,1.52 widget.h,1.45,1.46

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Jun 3 04:15:36 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1810

Modified Files:
	widget.cpp widget.h 
Log Message:
Cleanup


Index: widget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- widget.cpp	18 May 2005 15:58:39 -0000	1.51
+++ widget.cpp	3 Jun 2005 11:14:52 -0000	1.52
@@ -112,18 +112,6 @@
 	_flags = WIDGET_ENABLED;
 	_type = kStaticTextWidget;
 	_label = text;
-	
-	switch (_ws) {
-	case kNormalWidgetSize:
-		_font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
-		break;
-	case kBigWidgetSize:
-		_font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
-		break;
-	case kDefaultWidgetSize:
-		_font = &g_gui.getFont();
-		break;
-	}
 }
 
 void StaticTextWidget::setValue(int value) {
@@ -150,7 +138,7 @@
 
 void StaticTextWidget::drawWidget(bool hilite) {
 	NewGui *gui = &g_gui;
-	gui->drawString(_font, _label, _x, _y, _w, isEnabled() ? gui->_textcolor : gui->_color, _align);
+	gui->drawString(_label, _x, _y, _w, isEnabled() ? gui->_textcolor : gui->_color, _align);
 }
 
 #pragma mark -
@@ -169,8 +157,8 @@
 
 void ButtonWidget::drawWidget(bool hilite) {
 	NewGui *gui = &g_gui;
-	const int off = (_h - _font->getFontHeight()) / 2;
-	gui->drawString(_font, _label, _x, _y + off, _w,
+	const int off = (_h - g_gui.getFontHeight()) / 2;
+	gui->drawString(_label, _x, _y + off, _w,
 					!isEnabled() ? gui->_color :
 					hilite ? gui->_textcolorhi : gui->_textcolor, _align);
 }
@@ -200,7 +188,7 @@
 
 void CheckboxWidget::drawWidget(bool hilite) {
 	NewGui *gui = &g_gui;
-	int fontHeight = _font->getFontHeight();
+	int fontHeight = gui->getFontHeight();
 
 	// Draw the box
 	gui->box(_x, _y, fontHeight + 4, fontHeight + 4, gui->_color, gui->_shadowcolor);
@@ -231,7 +219,7 @@
 	}
 
 	// Finally draw the label
-	gui->drawString(_font, _label, _x + fontHeight + 10, _y + 3, _w, isEnabled() ? gui->_textcolor : gui->_color);
+	gui->drawString(_label, _x + fontHeight + 10, _y + 3, _w, isEnabled() ? gui->_textcolor : gui->_color);
 }
 
 #pragma mark -

Index: widget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- widget.h	18 May 2005 15:58:39 -0000	1.45
+++ widget.h	3 Jun 2005 11:15:03 -0000	1.46
@@ -154,7 +154,6 @@
 	String					_label;
 	TextAlignment			_align;
 	const WidgetSize		_ws;
-	const Graphics::Font	*_font;
 public:
 	StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws = kDefaultWidgetSize);
 	void setValue(int value);





More information about the Scummvm-git-logs mailing list