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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Oct 15 14:55:13 CEST 2009


Revision: 45116
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45116&view=rev
Author:   m_kiewitz
Date:     2009-10-15 12:55:12 +0000 (Thu, 15 Oct 2009)

Log Message:
-----------
SCI/newgui: SciGuiTransitions now also supports scrolling down (e.g. lsl1 intro), cleanup

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-15 12:48:47 UTC (rev 45115)
+++ scummvm/trunk/engines/sci/gui/gui_transitions.cpp	2009-10-15 12:55:12 UTC (rev 45116)
@@ -48,7 +48,7 @@
 
 // This table contains a mapping between oldIDs (prior SCI1LATE) and newIDs
 byte oldTransitionIDs[256][2] = {
-	{ 8, SCI_TRANSITIONS_BLOCKS },
+	{  8, SCI_TRANSITIONS_BLOCKS },
 	{ 18, SCI_TRANSITIONS_PIXELATION },
 	{ 30, SCI_TRANSITIONS_FADEPALETTE },
 	{ 40, SCI_TRANSITIONS_SCROLLRIGHT },
@@ -105,13 +105,10 @@
 		break;
 
 	case SCI_TRANSITIONS_SCROLLRIGHT:
-		setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_RIGHT);
-		break;
 	case SCI_TRANSITIONS_SCROLLLEFT:
-		setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_LEFT);
-		break;
 	case SCI_TRANSITIONS_SCROLLUP:
-		setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_UP);
+	case SCI_TRANSITIONS_SCROLLDOWN:
+		setNewPalette(); scroll();
 		break;
 
 	default:
@@ -202,7 +199,7 @@
 }
 
 // scroll old screen (up/down/left/right) and insert new screen that way - works on _picRect area
-void SciGuiTransitions::scroll(int16 direction) {
+void SciGuiTransitions::scroll() {
 	int16 screenWidth, screenHeight;
 	byte *oldScreenPtr;
 	int16 stepNr = 0;
@@ -215,8 +212,8 @@
 
 	oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
 
-	switch (direction) {
-	case SCI_TRANSITIONS_SCROLL_LEFT:
+	switch (_number) {
+	case SCI_TRANSITIONS_SCROLLLEFT:
 		newScreenRect.right = newScreenRect.left;
 		newMoveRect.left = newMoveRect.right;
 		while (oldMoveRect.left < oldMoveRect.right) {
@@ -235,7 +232,7 @@
 			g_system->updateScreen();
 		break;
 
-	case SCI_TRANSITIONS_SCROLL_RIGHT:
+	case SCI_TRANSITIONS_SCROLLRIGHT:
 		newScreenRect.left = newScreenRect.right;
 		while (oldMoveRect.left < oldMoveRect.right) {
 			oldMoveRect.left++;
@@ -253,7 +250,7 @@
 			g_system->updateScreen();
 		break;
 
-	case SCI_TRANSITIONS_SCROLL_UP:
+	case SCI_TRANSITIONS_SCROLLUP:
 		newScreenRect.bottom = newScreenRect.top;
 		newMoveRect.top = newMoveRect.bottom;
 		while (oldMoveRect.top < oldMoveRect.bottom) {
@@ -266,6 +263,19 @@
 			g_system->delayMillis(3);
 		}
 		break;
+
+	case SCI_TRANSITIONS_SCROLLDOWN:
+		newScreenRect.top = newScreenRect.bottom;
+		while (oldMoveRect.top < oldMoveRect.bottom) {
+			oldMoveRect.top++;
+			if (oldMoveRect.top < oldMoveRect.bottom)
+				g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+			newScreenRect.top--;
+			_screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top);
+			g_system->updateScreen();
+			g_system->delayMillis(3);
+		}
+		break;
 	}
 }
 

Modified: scummvm/trunk/engines/sci/gui/gui_transitions.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_transitions.h	2009-10-15 12:48:47 UTC (rev 45115)
+++ scummvm/trunk/engines/sci/gui/gui_transitions.h	2009-10-15 12:55:12 UTC (rev 45116)
@@ -40,12 +40,6 @@
 	SCI_TRANSITIONS_SCROLLDOWN		= 14
 };
 
-enum {
-	SCI_TRANSITIONS_SCROLL_RIGHT		= 1,
-	SCI_TRANSITIONS_SCROLL_LEFT			= 2,
-	SCI_TRANSITIONS_SCROLL_UP			= 3
-};
-
 class SciGuiScreen;
 class SciGuiTransitions {
 public:
@@ -63,7 +57,7 @@
 	void fadeIn();
 	void pixelation();
 	void blocks();
-	void scroll(int16 direction);
+	void scroll();
 
 	SciGui *_gui;
 	SciGuiScreen *_screen;


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