[Scummvm-cvs-logs] CVS: scummvm/gui newgui.cpp,1.18,1.19 newgui.h,1.11,1.12

Max Horn fingolfin at users.sourceforge.net
Sat Sep 28 09:20:03 CEST 2002


Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv3450/gui

Modified Files:
	newgui.cpp newgui.h 
Log Message:
cleaned up various variable names in the SDL backend & NewGui; also fixed a small buglet that could cause garbage to appear behind the mouse cursor when closing NewGui while inside a game

Index: newgui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- newgui.cpp	28 Sep 2002 15:58:25 -0000	1.18
+++ newgui.cpp	28 Sep 2002 16:19:27 -0000	1.19
@@ -75,8 +75,7 @@
 };
 
 // Constructor
-NewGui::NewGui(OSystem *system) : _system(system), _screen(0),
-	_use_alpha_blending(true), _need_redraw(false),
+NewGui::NewGui(OSystem *system) : _system(system), _screen(0), _needRedraw(false),
 	_currentKeyDown(0), _cursorAnimateCounter(0), _cursorAnimateTimer(0)
 {
 	// Setup some default GUI colors.
@@ -113,14 +112,14 @@
 
 		activeDialog->handleTickle();
 	
-		if (_need_redraw) {
+		if (_needRedraw) {
 			// Restore the overlay to its initial state, then draw all dialogs.
 			// This is necessary to get the blending right.
 			_system->clear_overlay();
-			_system->grab_overlay(_screen, _screen_pitch);
+			_system->grab_overlay(_screen, _screenPitch);
 			for (i = 0; i < _dialogStack.size(); i++)
 				_dialogStack[i]->draw();
-			_need_redraw = false;
+			_needRedraw = false;
 		}
 		
 		animateCursor();
@@ -205,10 +204,10 @@
 	_system->show_overlay();
 	// TODO - add getHeight & getWidth methods to OSystem.
 	_screen = new int16[320 * 240];
-	_screen_pitch = 320;
+	_screenPitch = 320;
 //	_screen = new int16[_system->get_width() * _system->get_height()];
-//	_screen_pitch = _system->get_width();
-	_system->grab_overlay(_screen, _screen_pitch);
+//	_screenPitch = _system->get_width();
+	_system->grab_overlay(_screen, _screenPitch);
 }
 
 void NewGui::restoreState()
@@ -227,7 +226,7 @@
 void NewGui::openDialog(Dialog *dialog)
 {
 	_dialogStack.push(dialog);
-	_need_redraw = true;
+	_needRedraw = true;
 }
 
 void NewGui::closeTopDialog()
@@ -238,7 +237,7 @@
 	
 	// Remove the dialog from the stack
 	_dialogStack.pop();
-	_need_redraw = true;
+	_needRedraw = true;
 }
 
 
@@ -247,7 +246,7 @@
 
 int16 *NewGui::getBasePtr(int x, int y)
 {
-	return _screen + x + y * _screen_pitch;
+	return _screen + x + y * _screenPitch;
 }
 
 void NewGui::box(int x, int y, int width, int height)
@@ -282,7 +281,7 @@
 		/* vertical line */
 		while (y++ <= y2) {
 			*ptr = color;
-			ptr += _screen_pitch;
+			ptr += _screenPitch;
 		}
 	} else if (y == y2) {
 		/* horizontal line */
@@ -307,7 +306,7 @@
 			                   (GREEN_FROM_16(ptr[i])+g)/4,
 			                   (BLUE_FROM_16(ptr[i])+b)/4);
 		}
-		ptr += _screen_pitch;
+		ptr += _screenPitch;
 	}
 }
 
@@ -322,7 +321,7 @@
 		for (i = 0; i < w; i++) {
 			ptr[i] = color;
 		}
-		ptr += _screen_pitch;
+		ptr += _screenPitch;
 	}
 }
 
@@ -338,7 +337,7 @@
 			if ((h ^ i) & 1)
 				ptr[i] = color;
 		}
-		ptr += _screen_pitch;
+		ptr += _screenPitch;
 	}
 }
 
@@ -353,12 +352,12 @@
 	for (i = 0; i < w; i++, ptr++)
 		*ptr = color;
 	ptr--;
-	for (i = 0; i < h; i++, ptr += _screen_pitch)
+	for (i = 0; i < h; i++, ptr += _screenPitch)
 		*ptr = color;
 	ptr = basePtr;
-	for (i = 0; i < h; i++, ptr += _screen_pitch)
+	for (i = 0; i < h; i++, ptr += _screenPitch)
 		*ptr = color;
-	ptr -= _screen_pitch;
+	ptr -= _screenPitch;
 	for (i = 0; i < w; i++, ptr++)
 		*ptr = color;
 }
@@ -369,7 +368,7 @@
 	// blit the affected area directly to the overlay. At least for our current
 	// GUI/widget/dialog code that is just fine.
 	int16 *buf = getBasePtr(x, y);
-	_system->copy_rect_overlay(buf, _screen_pitch, x, y, w, h);
+	_system->copy_rect_overlay(buf, _screenPitch, x, y, w, h);
 }
 
 void NewGui::drawChar(const char chr, int xx, int yy, int16 color)
@@ -394,7 +393,7 @@
 			if (c)
 				ptr[x] = color;
 		}
-		ptr += _screen_pitch;
+		ptr += _screenPitch;
 	}
 }
 
@@ -442,7 +441,7 @@
 				ptr[x2] = color;
 			mask >>= 4;
 		}
-		ptr += _screen_pitch;
+		ptr += _screenPitch;
 	}
 }
 

Index: newgui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- newgui.h	26 Sep 2002 11:44:02 -0000	1.11
+++ newgui.h	28 Sep 2002 16:19:28 -0000	1.12
@@ -81,10 +81,9 @@
 protected:
 	OSystem		*_system;
 	int16		*_screen;
-	int			_screen_pitch;
+	int			_screenPitch;
 	
-	bool		_use_alpha_blending;
-	bool		_need_redraw;
+	bool		_needRedraw;
 	DialogStack	_dialogStack;
 	
 	// for continuous events (keyDown)





More information about the Scummvm-git-logs mailing list