[Scummvm-cvs-logs] SF.net SVN: scummvm:[44612] scummvm/trunk/engines/sci/gui

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun Oct 4 17:44:11 CEST 2009


Revision: 44612
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44612&view=rev
Author:   wjpalenstijn
Date:     2009-10-04 15:44:10 +0000 (Sun, 04 Oct 2009)

Log Message:
-----------
SCI/newgui: more descriptive names.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui/gui_helpers.h
    scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
    scummvm/trunk/engines/sci/gui/gui_windowmgr.h
    scummvm/trunk/engines/sci/gui32/gui32.cpp
    scummvm/trunk/engines/sci/gui32/gui32.h

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 15:44:10 UTC (rev 44612)
@@ -102,13 +102,13 @@
 	*y = *y + curPort->top;
 }
 
-reg_t SciGUI::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
+reg_t SciGUI::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
 	sciWnd *wnd = NULL;
 
-	if (rect2.top != 0 && rect2.left != 0 && rect2.height() != 0 && rect2.width() != 0)
-		wnd = _windowMgr->NewWindow(&rect1, &rect2, title, style, priority, 0);
+	if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0)
+		wnd = _windowMgr->NewWindow(dims, &restoreRect, title, style, priority, 0);
 	else
-		wnd = _windowMgr->NewWindow(&rect1, NULL, title, style, priority, 0);
+		wnd = _windowMgr->NewWindow(dims, NULL, title, style, priority, 0);
 	wnd->penClr = colorPen;
 	wnd->backClr = colorBack;
 	_windowMgr->DrawWindow(wnd);
@@ -126,7 +126,7 @@
 	int16 align = 0;
 	int16 bgcolor = -1, width = -1, bRedraw = 1;
 	byte bSaveUnder = false;
-	Common::Rect rect, *orect = &((sciWnd *)_gfx->GetPort())->rect0;
+	Common::Rect rect, *orect = &((sciWnd *)_gfx->GetPort())->dims;
 
 	memcpy(&oldPort, _gfx->GetPort(), sizeof(sciPort));
 	// setting defaults

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-04 15:44:10 UTC (rev 44612)
@@ -49,7 +49,7 @@
 	virtual reg_t getPort();
 	virtual void globalToLocal(int16 *x, int16 *y);
 	virtual void localToGlobal(int16 *x, int16 *y);
-	virtual reg_t newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
+	virtual reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
 	virtual void disposeWindow(uint16 windowPtr, int16 arg2);
 
 	virtual void display(const char *text, int argc, reg_t *argv);

Modified: scummvm/trunk/engines/sci/gui/gui_helpers.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_helpers.h	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui/gui_helpers.h	2009-10-04 15:44:10 UTC (rev 44612)
@@ -65,8 +65,8 @@
 	int16 textFace, penClr, backClr;
 	int16 penMode;
 	// window specific members
-	Common::Rect rect0; // client area of window
-	Common::Rect rect1; // total area of window including borders
+	Common::Rect dims; // client area of window
+	Common::Rect restoreRect; // total area of window including borders
 	uint16 wndStyle;
 	uint16 uSaveFlag;
 	reg_t hSaved1;

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-04 15:44:10 UTC (rev 44612)
@@ -68,7 +68,7 @@
 
 	windowList.AddToFront(wmgrPortH);
 
-	_picWind = NewWindow(&_picRect, 0, 0, TRANSPARENT | NOFRAME, 0, 1);
+	_picWind = NewWindow(_picRect, 0, 0, TRANSPARENT | NOFRAME, 0, 1);
 }
 
 SciGUIwindowMgr::~SciGUIwindowMgr() {
@@ -112,7 +112,7 @@
 	_gfx->SetPort(oldPort);
 }
 
-sciWnd *SciGUIwindowMgr::NewWindow(Common::Rect *rect, Common::Rect *rect2, const char *title, uint16 style, uint16 arg8, uint16 argA) {
+sciWnd *SciGUIwindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, uint16 arg8, uint16 argA) {
 	HEAPHANDLE hWnd = heapNewPtr(sizeof(sciWnd), kDataWindow, title);
 	Common::Rect r;
 
@@ -127,10 +127,10 @@
 		windowList.AddToEnd(hWnd);
 	sciWnd *pwnd = (sciWnd *)heap2Ptr(hWnd);
 	_gfx->OpenPort((sciPort *)pwnd);
-	r = *rect;
-	pwnd->rect = *rect;
-	if (rect2)
-		pwnd->rect1 = *rect2;
+	r = dims;
+	pwnd->rect = dims;
+	if (restoreRect)
+		pwnd->restoreRect = *restoreRect;
 	
 	pwnd->wndStyle = style;
 	pwnd->hSaved1 = pwnd->hSaved2 = NULL_REG;
@@ -148,7 +148,7 @@
 		strcpy((char *)heap2Ptr(hTitle), title);
 	}
 	
-	r = *rect;
+	r = dims;
 	if (style == USER || (style & NOFRAME) == 0) {
 		r.grow(1);
 		if (style & TITLE) {
@@ -157,28 +157,28 @@
 		}
 	}
 	
-	pwnd->rect0 = r;
+	pwnd->dims = r;
 	const Common::Rect *wmprect = &_wmgrPort->rect;
-	int16 oldtop = pwnd->rect0.top;
-	int16 oldleft = pwnd->rect0.left;
-	if (wmprect->top > pwnd->rect0.top)
-		pwnd->rect0.moveTo(pwnd->rect0.left, wmprect->top);
+	int16 oldtop = pwnd->dims.top;
+	int16 oldleft = pwnd->dims.left;
+	if (wmprect->top > pwnd->dims.top)
+		pwnd->dims.moveTo(pwnd->dims.left, wmprect->top);
 	
-	if (wmprect->bottom < pwnd->rect0.bottom)
-		pwnd->rect0.moveTo(pwnd->rect0.left, wmprect->bottom
-				- pwnd->rect0.bottom + pwnd->rect0.top);
+	if (wmprect->bottom < pwnd->dims.bottom)
+		pwnd->dims.moveTo(pwnd->dims.left, wmprect->bottom
+				- pwnd->dims.bottom + pwnd->dims.top);
 	
-	if (wmprect->right < pwnd->rect0.right)
-		pwnd->rect0.moveTo(wmprect->right + pwnd->rect0.left
-				- pwnd->rect0.right, pwnd->rect0.top);
+	if (wmprect->right < pwnd->dims.right)
+		pwnd->dims.moveTo(wmprect->right + pwnd->dims.left
+				- pwnd->dims.right, pwnd->dims.top);
 	
-	if (wmprect->left > pwnd->rect0.left)
-		pwnd->rect0.moveTo(wmprect->left, pwnd->rect0.top);
+	if (wmprect->left > pwnd->dims.left)
+		pwnd->dims.moveTo(wmprect->left, pwnd->dims.top);
 	
-	pwnd->rect.moveTo(pwnd->rect.left + pwnd->rect0.left - oldleft,
-			pwnd->rect.top + pwnd->rect0.top - oldtop);
-	if (rect2 == 0)
-		pwnd->rect1 = pwnd->rect0;
+	pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft,
+			pwnd->rect.top + pwnd->dims.top - oldtop);
+	if (restoreRect == 0)
+		pwnd->restoreRect = pwnd->dims;
 	
 	if (argA)
 		DrawWindow(pwnd);
@@ -198,17 +198,17 @@
 	sciPort *oldport = _gfx->SetPort(_wmgrPort);
 	_gfx->PenColor(0);
 	if ((wndStyle & TRANSPARENT) == 0) {
-		pWnd->hSaved1 = _gfx->SaveBits(pWnd->rect1, 1);
+		pWnd->hSaved1 = _gfx->SaveBits(pWnd->restoreRect, 1);
 		if (pWnd->uSaveFlag & 2) {
-			pWnd->hSaved2 = _gfx->SaveBits(pWnd->rect1, 2);
+			pWnd->hSaved2 = _gfx->SaveBits(pWnd->restoreRect, 2);
 			if ((wndStyle & USER) == 0)
-				_gfx->FillRect(pWnd->rect1, 2, 0, 0xF);
+				_gfx->FillRect(pWnd->restoreRect, 2, 0, 0xF);
 		}
 	}
 	
 	// drawing frame,shadow and title
 	if ((wndStyle & USER) == 0) {
-		r = pWnd->rect0;
+		r = pWnd->dims;
 		if ((wndStyle & NOFRAME) == 0) {
 			r.translate(1, 1);
 			_gfx->FrameRect(r);// shadow
@@ -225,7 +225,7 @@
 					_gfx->PenColor(oldcolor);
 				}
 				
-				r = pWnd->rect0;
+				r = pWnd->dims;
 				r.top += 9;
 			}
 			
@@ -234,7 +234,7 @@
 		
 		if ((wndStyle & TRANSPARENT) == 0)
 			_gfx->FillRect(r, 1, pWnd->backClr);
-		_gfx->ShowBits(pWnd->rect0, 1);
+		_gfx->ShowBits(pWnd->dims, 1);
 	}
 	_gfx->SetPort(oldport);
 }
@@ -244,9 +244,9 @@
 	_gfx->RestoreBits(pWnd->hSaved1);
 	_gfx->RestoreBits(pWnd->hSaved2);
 	if (arg2)
-		_gfx->ShowBits(pWnd->rect1, 1);
+		_gfx->ShowBits(pWnd->restoreRect, 1);
 //	else
-//		g_sci->ReAnimate(&pwnd->rect0);
+//		g_sci->ReAnimate(&pwnd->dims);
 	HEAPHANDLE hh = ptr2heap((byte *)pWnd);
 	windowList.DeleteNode(hh);
 	SelectWindow(windowList.getLast());
@@ -259,11 +259,11 @@
 	sciMemoryHandle handle;
 
 	if (wnd->uSaveFlag && wnd->bDrawed) {
-		handle = _gfx->SaveBits(wnd->rect1, 1);
+		handle = _gfx->SaveBits(wnd->restoreRect, 1);
 		_gfx->RestoreBits(wnd->hSaved1);
 		wnd->hSaved1 = handle;
 		if (wnd->uSaveFlag & 2) {
-			handle = _gfx->SaveBits(wnd->rect1, 2);
+			handle = _gfx->SaveBits(wnd->restoreRect, 2);
 			_gfx->RestoreBits(wnd->hSaved2);
 			wnd->hSaved2 = handle;
 		}

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.h	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.h	2009-10-04 15:44:10 UTC (rev 44612)
@@ -39,7 +39,7 @@
 	SCILanguage getSCILanguage();
 	char* StrSplit(char*buff, const char*msg, const char*fmt);
 	char* getIntlString(char*buff, const char*msg, const char*fmt, SCILanguage lang, SCILanguage prop);
-	sciWnd *NewWindow(Common::Rect *rect, Common::Rect *rect2, const char *title, uint16 style, uint16 arg8, uint16 argA);
+	sciWnd *NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, uint16 arg8, uint16 argA);
 	void DrawWindow(sciWnd *wnd);
 	void DisposeWindow(sciWnd *pWnd, int16 arg2);
 	void UpdateWindow(sciWnd *wnd);

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-04 15:44:10 UTC (rev 44612)
@@ -171,7 +171,7 @@
 	*y = *y + s->port->zone.y;
 }
 
-reg_t SciGUI32::newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
+reg_t SciGUI32::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
 	GfxPort *window;
 	int x, y, xl, yl;
 	gfx_color_t bgcolor;
@@ -179,10 +179,10 @@
 	gfx_color_t black;
 	gfx_color_t lWhite;
 
-	y = rect1.top;
-	x = rect1.left;
-	yl = rect1.height();
-	xl = rect1.width();
+	y = dims.top;
+	x = dims.left;
+	yl = dims.height();
+	xl = dims.width();
 
 	y += s->wm_port->_bounds.y;
 
@@ -205,7 +205,7 @@
 	bgcolor.mask |= priority >= 0 ? GFX_MASK_PRIORITY : 0;
 	bgcolor.alpha = 0;
 	bgcolor.control = -1;
-	debugC(2, kDebugLevelGraphics, "New window with params %d, %d, %d, %d\n", rect1.top, rect1.left, rect1.height(), rect1.width());
+	debugC(2, kDebugLevelGraphics, "New window with params %d, %d, %d, %d\n", dims.top, dims.left, dims.height(), dims.width());
 
 	fgcolor.visual = get_pic_color(s, colorPen);
 	fgcolor.mask = GFX_MASK_VISUAL;
@@ -227,8 +227,8 @@
 							s->titlebar_port->_font, lWhite, black, title ? s->strSplit(title, NULL).c_str() : NULL, style);
 
 	// PQ3 and SCI1.1 games have the interpreter store underBits implicitly
-	if (rect2.top != 0 && rect2.left != 0 && rect2.height() != 0 && rect2.width() != 0)
-		gfxw_port_auto_restore_background(s->visual, window, gfx_rect(rect2.left, rect2.top + s->wm_port->_bounds.y, rect2.width(), rect2.height()));
+	if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0)
+		gfxw_port_auto_restore_background(s->visual, window, gfx_rect(restoreRect.left, restoreRect.top + s->wm_port->_bounds.y, restoreRect.width(), restoreRect.height()));
 
 	ADD_TO_WINDOW_PORT(window);
 	FULL_REDRAW();

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-04 15:34:43 UTC (rev 44611)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-04 15:44:10 UTC (rev 44612)
@@ -42,7 +42,7 @@
 	reg_t getPort();
 	void globalToLocal(int16 *x, int16 *y);
 	void localToGlobal(int16 *x, int16 *y);
-	reg_t newWindow(Common::Rect rect1, Common::Rect rect2, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
+	reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
 	void disposeWindow(uint16 windowPtr, int16 arg2);
 
 	void display(const char *text, int argc, reg_t *argv);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list