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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Oct 14 18:57:17 CEST 2009


Revision: 45086
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45086&view=rev
Author:   m_kiewitz
Date:     2009-10-14 16:57:16 +0000 (Wed, 14 Oct 2009)

Log Message:
-----------
SCI/newgui: SciGuiTransitions scroll left/right now supported (kq1)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_transitions.cpp
    scummvm/trunk/engines/sci/gui/gui_transitions.h

Modified: scummvm/trunk/engines/sci/gui/gui_transitions.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_transitions.cpp	2009-10-14 15:46:59 UTC (rev 45085)
+++ scummvm/trunk/engines/sci/gui/gui_transitions.cpp	2009-10-14 16:57:16 UTC (rev 45086)
@@ -72,6 +72,12 @@
 			fadeOut(); setNewScreen(); fadeIn();
 			break;
 
+		case SCI_TRANSITIONS_VGA_SCROLLRIGHT:
+			setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_RIGHT);
+			break;
+		case SCI_TRANSITIONS_VGA_SCROLLLEFT:
+			setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_LEFT);
+			break;
 		case SCI_TRANSITIONS_VGA_SCROLLUP:
 			setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_UP);
 			break;
@@ -95,6 +101,16 @@
 			fadeOut(); setNewScreen(); fadeIn();
 			break;
 
+		case SCI_TRANSITIONS_EGA_SCROLLRIGHT:
+			scroll(SCI_TRANSITIONS_SCROLL_RIGHT);
+			break;
+		case SCI_TRANSITIONS_EGA_SCROLLLEFT:
+			scroll(SCI_TRANSITIONS_SCROLL_LEFT);
+			break;
+		case SCI_TRANSITIONS_EGA_SCROLLUP:
+			scroll(SCI_TRANSITIONS_SCROLL_UP);
+			break;
+
 		default:
 			warning("SciGuiTransitions: EGA-%d not implemented", _number);
 			setNewScreen();
@@ -191,31 +207,64 @@
 // scroll old screen (up/down/left/right) and insert new screen that way - works on _picRect area
 void SciGuiTransitions::scroll(int16 direction) {
 	int16 screenWidth, screenHeight;
-	int16 oldWidth, oldHeight;
-	int16 newWidth, newHeight;
 	byte *oldScreenPtr;
-	int16 x, y;
+	int16 stepNr = 0;
+	Common::Rect oldMoveRect = _picRect;
+	Common::Rect newMoveRect = _picRect;
 	Common::Rect newScreenRect = _picRect;
 
 	_screen->copyFromScreen(_oldScreen);
 	screenWidth = _screen->_displayWidth; screenHeight = _screen->_displayHeight;
 
-	x = _picRect.left; y = _picRect.top;
-	oldWidth = _picRect.width(); oldHeight = _picRect.height();
-	newWidth = 0; newHeight = 0;
-
 	oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
 
 	switch (direction) {
+	case SCI_TRANSITIONS_SCROLL_LEFT:
+		newScreenRect.right = newScreenRect.left;
+		newMoveRect.left = newMoveRect.right;
+		while (oldMoveRect.left < oldMoveRect.right) {
+			oldScreenPtr++; oldMoveRect.right--;
+			if (oldMoveRect.right > oldMoveRect.left)
+				g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+			newScreenRect.right++; newMoveRect.left--;
+			_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
+			if ((stepNr & 1) == 0) {
+				g_system->updateScreen();
+				g_system->delayMillis(1);
+			}
+			stepNr++;
+		}
+		if ((stepNr & 1) == 0)
+			g_system->updateScreen();
+		break;
+
+	case SCI_TRANSITIONS_SCROLL_RIGHT:
+		newScreenRect.left = newScreenRect.right;
+		while (oldMoveRect.left < oldMoveRect.right) {
+			oldMoveRect.left++;
+			if (oldMoveRect.right > oldMoveRect.left)
+				g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+			newScreenRect.left--;
+			_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
+			if ((stepNr & 1) == 0) {
+				g_system->updateScreen();
+				g_system->delayMillis(1);
+			}
+			stepNr++;
+		}
+		if ((stepNr & 1) == 0)
+			g_system->updateScreen();
+		break;
+
 	case SCI_TRANSITIONS_SCROLL_UP:
 		newScreenRect.bottom = newScreenRect.top;
-		y += oldHeight;
-		while (oldHeight > 0) {
-			oldScreenPtr += screenWidth; oldHeight--;
-			if (oldHeight)
-				g_system->copyRectToScreen(oldScreenPtr, _screen->_displayWidth, _picRect.left, _picRect.top, oldWidth, oldHeight);
-			newScreenRect.bottom++;	y--;
-			_screen->copyRectToScreen(newScreenRect, x, y);
+		newMoveRect.top = newMoveRect.bottom;
+		while (oldMoveRect.top < oldMoveRect.bottom) {
+			oldScreenPtr += screenWidth; oldMoveRect.top++;
+			if (oldMoveRect.top < oldMoveRect.bottom)
+				g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left, _picRect.top, oldMoveRect.width(), oldMoveRect.height());
+			newScreenRect.bottom++;	newMoveRect.top--;
+			_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
 			g_system->updateScreen();
 			g_system->delayMillis(3);
 		}

Modified: scummvm/trunk/engines/sci/gui/gui_transitions.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_transitions.h	2009-10-14 15:46:59 UTC (rev 45085)
+++ scummvm/trunk/engines/sci/gui/gui_transitions.h	2009-10-14 16:57:16 UTC (rev 45086)
@@ -33,19 +33,27 @@
 enum {
 	SCI_TRANSITIONS_EGA_BLOCKS			= 8,
 	SCI_TRANSITIONS_EGA_PIXELATION		= 18,
-	SCI_TRANSITIONS_EGA_FADEPALETTE		= 30
+	SCI_TRANSITIONS_EGA_FADEPALETTE		= 30,
+	SCI_TRANSITIONS_EGA_SCROLLRIGHT		= 40,
+	SCI_TRANSITIONS_EGA_SCROLLLEFT		= 41,
+	SCI_TRANSITIONS_EGA_SCROLLUP		= 42,
+	SCI_TRANSITIONS_EGA_SCROLLDOWN		= 43
 };
 
 enum {
 	SCI_TRANSITIONS_VGA_BLOCKS			= 8,
 	SCI_TRANSITIONS_VGA_PIXELATION		= 9,
 	SCI_TRANSITIONS_VGA_FADEPALETTE		= 10,
+	SCI_TRANSITIONS_VGA_SCROLLRIGHT		= 11,
+	SCI_TRANSITIONS_VGA_SCROLLLEFT		= 12,
 	SCI_TRANSITIONS_VGA_SCROLLUP		= 13,
 	SCI_TRANSITIONS_VGA_SCROLLDOWN		= 14
 };
 
 enum {
-	SCI_TRANSITIONS_SCROLL_UP			= 1
+	SCI_TRANSITIONS_SCROLL_RIGHT		= 1,
+	SCI_TRANSITIONS_SCROLL_LEFT			= 2,
+	SCI_TRANSITIONS_SCROLL_UP			= 3,
 };
 
 class SciGuiScreen;


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