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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Oct 12 09:11:22 CEST 2009


Revision: 44966
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44966&view=rev
Author:   m_kiewitz
Date:     2009-10-12 07:11:22 +0000 (Mon, 12 Oct 2009)

Log Message:
-----------
SCI/newgui: kGraph updateBox implemented, cleaned up usage of BitsShow() still not perfect (e.g. kq5 cutscene information box)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.h
    scummvm/trunk/engines/sci/gui/gui_palette.cpp
    scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
    scummvm/trunk/engines/sci/gui32/gui32.cpp
    scummvm/trunk/engines/sci/gui32/gui32.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -51,7 +51,10 @@
 // Graph subfunctions
 enum {
 	K_GRAPH_GET_COLORS_NR = 2,
+	// 3 - SET PALETTE VIA RESOURCE
 	K_GRAPH_DRAW_LINE = 4,
+	// 5 - NOP
+	// 6 - DRAW PATTERN
 	K_GRAPH_SAVE_BOX = 7,
 	K_GRAPH_RESTORE_BOX = 8,
 	K_GRAPH_FILL_BOX_BACKGROUND = 9,
@@ -649,14 +652,9 @@
 		break;
 
 	case K_GRAPH_UPDATE_BOX: {
-
-		debugC(2, kDebugLevelGraphics, "update_box(%d, %d, %d, %d)\n", argv[1].toSint16(), argv[2].toSint16(), argv[3].toSint16(), argv[4].toSint16());
-
-		area.x += s->port->zone.x;
-		area.y += s->port->zone.y;
-
-		// FIXME: Change to class calling
-		//gfxop_update_box(s->gfx_state, area);
+		rect = Common::Rect(x, y, x1, y1);
+		s->_gui->graphUpdateBox(rect);
+		break;
 	}
 	break;
 

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -245,8 +245,8 @@
 	if (bgcolor != -1)
 		_gfx->FillRect(rect, SCI_SCREEN_MASK_VISUAL, bgcolor, 0, 0);
 	_gfx->TextBox(text, 0, rect, align, -1);
-//	if (_picNotValid == 0 && bRedraw)
-//		_gfx->ShowBits(rect, 1);
+	if (!_screen->_picNotValid && bRedraw)
+		_gfx->BitsShow(rect);
 	// restoring port and cursor pos
 	GuiPort *currport = _gfx->GetPort();
 	uint16 tTop = currport->curTop;
@@ -254,8 +254,6 @@
 	*currport = oldPort;
 	currport->curTop = tTop;
 	currport->curLeft = tLeft;
-
-	_screen->copyToScreen();
 }
 
 void SciGui::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) {
@@ -282,8 +280,7 @@
 	_gfx->MoveTo(0, 1);
 	_gfx->Draw_String(text);
 	_gfx->SetPort(oldPort);
-	// _gfx->ShowBits(*_theMenuBar, 1);
-	_gfx->BitsShow(_gfx->_menuRect, SCI_SCREEN_MASK_VISUAL);
+	_gfx->BitsShow(_gfx->_menuRect);
 }
 
 void SciGui::drawMenuBar() {
@@ -299,21 +296,18 @@
 
 	if (_windowMgr->isFrontWindow(_windowMgr->_picWind)) {
 		_gfx->drawPicture(pictureId, animationNr, mirroredFlag, addToFlag, EGApaletteNo);
+		_screen->_picNotValid = 1;
 	} else {
 		_windowMgr->BeginUpdate(_windowMgr->_picWind);
 		_gfx->drawPicture(pictureId, animationNr, mirroredFlag, addToFlag, EGApaletteNo);
 		_windowMgr->EndUpdate(_windowMgr->_picWind);
 	}
-	_screen->copyToScreen();
-
 	_gfx->SetPort(oldPort);
-	_screen->_picNotValid = true;
 }
 
 void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
 	_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
 	_palette->setOnScreen();
-	_screen->copyToScreen();
 }
 
 void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
@@ -325,17 +319,17 @@
 		_gfx->TextFace(style & 1 ? 0 : 1);
 		_gfx->TextBox(text, 0, rect, 1, fontId);
 		_gfx->TextFace(0);
-		if (style & 8) { // selected
-			rect.grow(1);
+		rect.grow(1);
+		if (style & 8) // selected
 			_gfx->FrameRect(rect);
+		if (!_screen->_picNotValid) {
+			rect.grow(1);
+			_gfx->BitsShow(rect);
 		}
 	} else {
 		_gfx->InvertRect(rect);
+		_gfx->BitsShow(rect);
 	}
-
-	Common::Rect screenRect = rect;
-	screenRect.grow(2);
-	_gfx->BitsShow(screenRect, SCI_SCREEN_MASK_VISUAL);
 }
 
 void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, bool hilite) {
@@ -347,13 +341,13 @@
 		if (style & 8) { // selected
 			_gfx->FrameRect(rect);
 		}
+		rect.grow(1);
+		if (!_screen->_picNotValid)
+			_gfx->BitsShow(rect);
 	} else {
 		_gfx->InvertRect(rect);
+		_gfx->BitsShow(rect);
 	}
-
-	Common::Rect screenRect = rect;
-	screenRect.grow(1);
-	_gfx->BitsShow(screenRect, SCI_SCREEN_MASK_VISUAL);
 }
 
 void SciGui::drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite) {
@@ -371,7 +365,10 @@
 		rect.grow(-1);
 		_gfx->TexteditCursorDraw(rect, text, cursorPos);
 		_gfx->SetFont(oldFontId);
+		rect.grow(1);
 	}
+	if (!_screen->_picNotValid)
+		_gfx->BitsShow(rect);
 }
 
 void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool hilite) {
@@ -382,9 +379,8 @@
 		}
 	} else {
 		_gfx->InvertRect(rect);
+		_gfx->BitsShow(rect);
 	}
-
-	_gfx->BitsShow(rect, SCI_SCREEN_MASK_VISUAL);
 }
 
 void SciGui::drawControlList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) {
@@ -394,7 +390,8 @@
 		if (isAlias && (style & 8)) {
 			_gfx->FrameRect(rect);
 		}
-		_gfx->BitsShow(rect, SCI_SCREEN_MASK_VISUAL);
+		if (!_screen->_picNotValid)
+			_gfx->BitsShow(rect);
 	}
 }
 
@@ -410,22 +407,18 @@
 
 void SciGui::graphFillBoxForeground(Common::Rect rect) {
 	_gfx->PaintRect(rect);
-	_screen->copyRectToScreen(rect);
 }
 
 void SciGui::graphFillBoxBackground(Common::Rect rect) {
 	_gfx->EraseRect(rect);
-	_screen->copyRectToScreen(rect);
 }
 
 void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
 	_gfx->FillRect(rect, colorMask, color, priority, control);
-	_screen->copyRectToScreen(rect);
 }
 
 void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
 	_gfx->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
-	_screen->copyToScreen();
 }
 
 reg_t SciGui::graphSaveBox(Common::Rect rect, uint16 flags) {
@@ -434,9 +427,13 @@
 
 void SciGui::graphRestoreBox(reg_t handle) {
 	_gfx->BitsRestore(handle);
-	_screen->copyToScreen();
 }
 
+void SciGui::graphUpdateBox(Common::Rect rect) {
+	_gfx->BitsShow(rect);
+}
+
+
 void SciGui::paletteSet(int resourceNo, int flags) {
    _palette->setFromResource(resourceNo, flags);
 }
@@ -484,10 +481,8 @@
 
 	if (listReference.isNull()) {
 		_gfx->AnimateDisposeLastCast();
-		if (_screen->_picNotValid) {
-			//(this->*ShowPic)(_showMap, _showStyle);
-			_screen->_picNotValid = false;
-		}
+		if (_screen->_picNotValid)
+			_gfx->ShowPic();
 		return;
 	}
 
@@ -513,12 +508,10 @@
 	_gfx->AnimateDrawCels();
 
 	if (_screen->_picNotValid) {
-		//(this->*ShowPic)(_showMap, _showStyle);
-		_screen->_picNotValid = false;
+		_gfx->ShowPic();
 	}
 
-	//_gfx->AnimateUpdateScreen();
-	_screen->copyToScreen();
+	_gfx->AnimateUpdateScreen(old_picNotValid);
 	_gfx->AnimateRestoreAndDelete(argc, argv);
 
 	_gfx->SetPort(oldPort);
@@ -586,7 +579,8 @@
 }
 
 void SciGui::setCursorPos(Common::Point pos) {
-	// No adjustment of position needed, directly forwarding to SciGui::moveCursor()
+	pos.y += _gfx->GetPort()->top;
+	pos.x += _gfx->GetPort()->left;
 	moveCursor(pos);
 }
 

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-12 07:11:22 UTC (rev 44966)
@@ -82,6 +82,7 @@
 	virtual void graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
 	virtual reg_t graphSaveBox(Common::Rect rect, uint16 flags);
 	virtual void graphRestoreBox(reg_t handle);
+	virtual void graphUpdateBox(Common::Rect rect);
 
 	virtual void paletteSet(int resourceNo, int flags);
 	virtual int16 paletteFind(int r, int g, int b);

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -533,7 +533,7 @@
 	rect.left = _curPort->curLeft;
 	DrawText(text, from, len, orgFontId, orgPenColor);
 	rect.right = _curPort->curLeft;
-	BitsShow(rect, SCI_SCREEN_MASK_VISUAL);
+	BitsShow(rect);
 }
 
 // Draws a text in rect.
@@ -581,14 +581,13 @@
 }
 
 // Update (part of) screen
-void SciGuiGfx::BitsShow(const Common::Rect &r, uint16 screenMask) {
+void SciGuiGfx::BitsShow(const Common::Rect &r) {
 	Common::Rect rect(r.left, r.top, r.right, r.bottom);
 	rect.clip(_curPort->rect);
 	if (rect.isEmpty()) // nothing to show
 		return;
 
 	OffsetRect(rect);
-	assert((screenMask & 0x8000) == 0);
 	_screen->copyRectToScreen(rect);
 }
 
@@ -720,10 +719,11 @@
 	picture->draw(animationNr, mirroredFlag, addToFlag, paletteId);
 }
 
+// This one is the only one that updates screen!
 void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo) {
 	SciGuiView *view = new SciGuiView(_s->resMan, _screen, _palette, viewId);
-	Common::Rect rect(0, 0);
-	Common::Rect clipRect(0, 0);
+	Common::Rect rect;
+	Common::Rect clipRect;
 	if (view) {
 		rect.left = leftPos;
 		rect.top = topPos;
@@ -737,12 +737,40 @@
 		Common::Rect clipRectTranslated = clipRect;
 		OffsetRect(clipRectTranslated);
 		view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
+		if (!_screen->_picNotValid)
+			BitsShow(rect);
+	}
+}
 
-		//if (_picNotValid == 0)
-		//	_gfx->ShowBits(rect, 1);
+// This version of drawCel is not supposed to call BitsShow()!
+void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
+	SciGuiView *view = new SciGuiView(_s->resMan, _screen, _palette, viewId);
+	Common::Rect clipRect;
+	if (view) {
+		clipRect = celRect;
+		clipRect.clip(_curPort->rect);
+		if (clipRect.isEmpty()) // nothing to draw
+			return;
+
+		Common::Rect clipRectTranslated = clipRect;
+		OffsetRect(clipRectTranslated);
+		view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
 	}
 }
 
+// This version of drawCel is not supposed to call BitsShow()!
+void SciGuiGfx::drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
+	Common::Rect clipRect;
+	clipRect = celRect;
+	clipRect.clip(_curPort->rect);
+	if (clipRect.isEmpty()) // nothing to draw
+		return;
+
+	Common::Rect clipRectTranslated = clipRect;
+	OffsetRect(clipRectTranslated);
+	view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
+}
+
 const char controlListUpArrow[2]	= { 0x18, 0 };
 const char controlListDownArrow[2]	= { 0x19, 0 };
 
@@ -810,7 +838,7 @@
 		_texteditCursorRect.bottom = _texteditCursorRect.top + _font->getHeight();
 		_texteditCursorRect.right = _texteditCursorRect.left + (text[curPos] == 0 ? 1 : CharWidth(text[curPos]));
 		InvertRect(_texteditCursorRect);
-		BitsShow(_texteditCursorRect, SCI_SCREEN_MASK_VISUAL);
+		BitsShow(_texteditCursorRect);
 		_texteditCursorVisible = true;
 		TexteditSetBlinkTime();
 	}
@@ -819,7 +847,7 @@
 void SciGuiGfx::TexteditCursorErase() {
 	if (_texteditCursorVisible) {
 		InvertRect(_texteditCursorRect);
-		BitsShow(_texteditCursorRect, SCI_SCREEN_MASK_VISUAL);
+		BitsShow(_texteditCursorRect);
 		_texteditCursorVisible = false;
 	}
 	TexteditSetBlinkTime();
@@ -854,8 +882,10 @@
 			eventKey = GET_SEL32V(eventObject, message);
 			switch (eventKey) {
 			case SCI_K_BACKSPACE:
-				cursorPos--; text.deleteChar(cursorPos);
-				textChanged = true;
+				if (cursorPos > 0) {
+					cursorPos--; text.deleteChar(cursorPos);
+					textChanged = true;
+				}
 				break;
 			case SCI_K_DELETE:
 				text.deleteChar(cursorPos);
@@ -898,7 +928,7 @@
 		TexteditCursorErase();
 		EraseRect(rect);
 		TextBox(text.c_str(), 0, rect, 0, fontId);
-		BitsShow(rect, SCI_SCREEN_MASK_VISUAL);
+		BitsShow(rect);
 		SetFont(fontId);
 		rect.top--;
 		TexteditCursorDraw(rect, text.c_str(), cursorPos);
@@ -908,7 +938,7 @@
 	} else {
 		if (g_system->getMillis() >= _texteditBlinkTime) {
 			InvertRect(_texteditCursorRect);
-			BitsShow(_texteditCursorRect, SCI_SCREEN_MASK_VISUAL);
+			BitsShow(_texteditCursorRect);
 			_texteditCursorVisible = !_texteditCursorVisible;
 			TexteditSetBlinkTime();
 		}
@@ -999,6 +1029,14 @@
 	return _priorityBottom;
 }
 
+void SciGuiGfx::ShowPic() {
+	// TODO: Implement animations
+	warning("ShowPic animation not implemented");
+	_palette->setOnScreen();
+	_screen->copyToScreen();
+	_screen->_picNotValid = 0;
+}
+
 void SciGuiGfx::AnimateDisposeLastCast() {
 	// FIXME
 	//if (!_lastCast->first.isNull())
@@ -1202,7 +1240,7 @@
 
 		if (signal & SCI_ANIMATE_SIGNAL_ALWAYSUPDATE) {
 			// draw corresponding cel
-			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect.left, listEntry->celRect.top, listEntry->priority, listEntry->paletteNo);
+			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
 			listEntry->showBitsFlag = true;
 
 			signal &= 0xFFFF ^ (SCI_ANIMATE_SIGNAL_STOPUPDATE | SCI_ANIMATE_SIGNAL_VIEWUPDATED | SCI_ANIMATE_SIGNAL_NOUPDATE | SCI_ANIMATE_SIGNAL_FORCEUPDATE);
@@ -1246,7 +1284,7 @@
 
 		if (signal & SCI_ANIMATE_SIGNAL_NOUPDATE && !(signal & SCI_ANIMATE_SIGNAL_HIDDEN)) {
 			// draw corresponding cel
-			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect.left, listEntry->celRect.top, listEntry->priority, listEntry->paletteNo);
+			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
 			listEntry->showBitsFlag = true;
 
 			if ((signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
@@ -1280,7 +1318,7 @@
 			PUT_SEL32(curObject, underBits, bitsHandle);
 
 			// draw corresponding cel
-			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect.left, listEntry->celRect.top, listEntry->priority, listEntry->paletteNo);
+			drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
 			listEntry->showBitsFlag = true;
 
 			if (signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW) {
@@ -1303,6 +1341,46 @@
 	}
 }
 
+void SciGuiGfx::AnimateUpdateScreen(byte oldPicNotValid) {
+	SegManager *segMan = _s->_segMan;
+	GuiAnimateEntry *listEntry;
+	uint16 signal;
+	GuiAnimateList::iterator listIterator;
+	GuiAnimateList::iterator listEnd = _animateList.end();
+
+	listIterator = _animateList.begin();
+	while (listIterator != listEnd) {
+		listEntry = *listIterator;
+		signal = listEntry->signal;
+
+		if (listEntry->showBitsFlag || !(signal & (SCI_ANIMATE_SIGNAL_REMOVEVIEW | SCI_ANIMATE_SIGNAL_NOUPDATE) ||
+										!(signal & SCI_ANIMATE_SIGNAL_REMOVEVIEW) && signal & SCI_ANIMATE_SIGNAL_NOUPDATE && oldPicNotValid)) {
+// TODO: code finish
+//			rect = (Common::Rect *)&cobj[_objOfs[7]];
+//			rect1 = (Common::Rect *)&cobj[_objOfs[8]];
+//
+//			Common::Rect ro(rect->left, rect->top, rect->right, rect->bottom);
+//			ro.clip(*rect1);
+//
+//			if (!ro.isEmpty()) {
+//				ro = *rect; 
+//				ro.extend(*rect1);
+//			} else {
+//				_gfx->ShowBits(*rect, _showMap);
+//			//	ro = *rect1;
+//			//}
+//			//*rect  = *rect1;
+//			_gfx->ShowBits(ro, _showMap);
+			if (signal & SCI_ANIMATE_SIGNAL_HIDDEN) {
+				listEntry->signal |= SCI_ANIMATE_SIGNAL_REMOVEVIEW;
+			}
+		}
+
+		listIterator++;
+	}
+	_screen->copyToScreen();
+}
+
 void SciGuiGfx::AnimateRestoreAndDelete(int argc, reg_t *argv) {
 	SegManager *segMan = _s->_segMan;
 	reg_t curObject;
@@ -1360,7 +1438,7 @@
 		view->getCelRect(listEntry->loopNo, listEntry->celNo, listEntry->x, listEntry->y, listEntry->priority, &listEntry->celRect);
 
 		// draw corresponding cel
-		drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect.left, listEntry->celRect.top, listEntry->priority, listEntry->paletteNo);
+		drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect, listEntry->priority, listEntry->paletteNo);
 		if ((listEntry->signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
 			listEntry->celRect.top = CLIP<int16>(PriorityToCoordinate(listEntry->priority) - 1, listEntry->celRect.top, listEntry->celRect.bottom - 1);
 			FillRect(listEntry->celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
@@ -1378,7 +1456,7 @@
 
 	// Create rect according to coordinates and given cel
 	view->getCelRect(loopNo, celNo, leftPos, topPos, priority, &celRect);
-	drawCel(viewId, loopNo, celNo, celRect.left, celRect.top, priority, 0);
+	drawCel(view, loopNo, celNo, celRect, priority, 0);
 }
 
 bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-12 07:11:22 UTC (rev 44966)
@@ -101,7 +101,7 @@
 		DrawText(str, 0, (int16)strlen(str), orgFontId, orgPenColor);
 	}
 	void TextBox(const char *str, int16 bshow, const Common::Rect &rect, int16 align, GuiResourceId fontId);
-	void BitsShow(const Common::Rect &r, uint16 flags);
+	void BitsShow(const Common::Rect &r);
 	GuiMemoryHandle BitsSave(const Common::Rect &rect, byte screenFlags);
 	void BitsRestore(GuiMemoryHandle memoryHandle);
 	void BitsFree(GuiMemoryHandle memoryHandle);
@@ -111,6 +111,8 @@
 	
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
 	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo);
+	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
+	void drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
 	void drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias);
 	void TexteditCursorDraw (Common::Rect rect, const char *text, uint16 curPos);
 	void TexteditCursorErase();
@@ -123,12 +125,15 @@
 	byte CoordinateToPriority(int16 y);
 	int16 PriorityToCoordinate(byte priority);
 
+	void ShowPic();
+
 	void AnimateDisposeLastCast();
 	void AnimateInvoke(List *list, int argc, reg_t *argv);
 	void AnimateMakeSortedList(List *list);
 	void AnimateFill(byte &oldPicNotValid);
 	void AnimateUpdate();
 	void AnimateDrawCels();
+	void AnimateUpdateScreen(byte oldPicNotValid);
 	void AnimateRestoreAndDelete(int argc, reg_t *argv);
 	void AddToPicDrawCels(List *list);
 	void AddToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);

Modified: scummvm/trunk/engines/sci/gui/gui_palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_palette.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui_palette.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -191,7 +191,7 @@
 	if (flag == 2 || sciPal->timestamp != systime) {
 		merge(sciPal, &_sysPalette, flag);
 		sciPal->timestamp = _sysPalette.timestamp;
-		if (_screen->_picNotValid == 0 && systime != _sysPalette.timestamp)
+		if (!_screen->_picNotValid && systime != _sysPalette.timestamp)
 			setOnScreen();
 	}
 }

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -151,6 +151,9 @@
 			r.bottom++;
 		}
 	}
+
+	// FIXME: it seems as if shadows may result in the window getting moved one upwards
+	//         so that the shadow is visible (lsl5)
 	
 	pwnd->dims = r;
 	const Common::Rect *wmprect = &_wmgrPort->rect;
@@ -160,24 +163,19 @@
 		pwnd->dims.moveTo(pwnd->dims.left, wmprect->top);
 	
 	if (wmprect->bottom < pwnd->dims.bottom)
-		pwnd->dims.moveTo(pwnd->dims.left, wmprect->bottom
-				- pwnd->dims.bottom + pwnd->dims.top);
+		pwnd->dims.moveTo(pwnd->dims.left, wmprect->bottom - pwnd->dims.bottom + pwnd->dims.top);
 	
 	if (wmprect->right < pwnd->dims.right)
-		pwnd->dims.moveTo(wmprect->right + pwnd->dims.left
-				- pwnd->dims.right, pwnd->dims.top);
+		pwnd->dims.moveTo(wmprect->right + pwnd->dims.left - pwnd->dims.right, pwnd->dims.top);
 	
 	if (wmprect->left > pwnd->dims.left)
 		pwnd->dims.moveTo(wmprect->left, pwnd->dims.top);
 	
-	pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft,
-			pwnd->rect.top + pwnd->dims.top - oldtop);
+	pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft, pwnd->rect.top + pwnd->dims.top - oldtop);
 	if (restoreRect == 0)
 		pwnd->restoreRect = pwnd->dims;
 
-	// CHECKME: Is this 'kTransparent' check necessary?
-	// The shadow is already drawn if !(wndStyle & (kUser | kNoFrame)).
-	if (!(pwnd->wndStyle & (SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_USER | SCI_WINDOWMGR_STYLE_NOFRAME))) {
+	if (!(pwnd->wndStyle & (SCI_WINDOWMGR_STYLE_USER | SCI_WINDOWMGR_STYLE_NOFRAME))) {
 		// The shadow is drawn slightly outside the window.
 		// Enlarge restoreRect to cover that.
 		pwnd->restoreRect.bottom++;
@@ -240,7 +238,7 @@
 		if (!(wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT))
 			_gfx->FillRect(r, SCI_SCREEN_MASK_VISUAL, pWnd->backClr);
 
-		_gfx->BitsShow(pWnd->dims, SCI_SCREEN_MASK_VISUAL);
+		_gfx->BitsShow(pWnd->restoreRect);
 	}
 	_gfx->SetPort(oldport);
 }
@@ -250,7 +248,7 @@
 	_gfx->BitsRestore(pWnd->hSaved1);
 	_gfx->BitsRestore(pWnd->hSaved2);
 	if (arg2)
-		_gfx->BitsShow(pWnd->restoreRect, SCI_SCREEN_MASK_VISUAL);
+		_gfx->BitsShow(pWnd->restoreRect);
 //	else
 //		g_sci->ReAnimate(&pwnd->dims);
 	_windowList.remove(pWnd);

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-12 07:11:22 UTC (rev 44966)
@@ -952,6 +952,15 @@
 	graph_restore_box(s, handle);
 }
 
+void SciGui32::graphUpdateBox(Common::Rect rect) {
+	rect_t area = gfx_rect(rect.left, rect.top, rect.width(), rect.height());
+
+	area.x += s->port->zone.x;
+	area.y += s->port->zone.y;
+
+	gfxop_update_box(s->gfx_state, area);
+}
+
 void SciGui32::paletteSet(int resourceNo, int flags) {
 	//warning("STUB");
 }

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-12 03:08:28 UTC (rev 44965)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-12 07:11:22 UTC (rev 44966)
@@ -73,6 +73,7 @@
 	void graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
 	reg_t graphSaveBox(Common::Rect rect, uint16 flags);
 	void graphRestoreBox(reg_t handle);
+	void graphUpdateBox(Common::Rect);
 
 	void paletteSet(int resourceNo, int flags);
 	int16 paletteFind(int r, int g, int b);


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