[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.16,1.17 screen.h,1.6,1.7 sword1.cpp,1.17,1.18

Robert G?ffringmann lavosspawn at users.sourceforge.net
Sun Dec 21 09:35:02 CET 2003


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv8930/sword1

Modified Files:
	screen.cpp screen.h sword1.cpp 
Log Message:
fixed parallax drawing for room 54

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- screen.cpp	20 Dec 2003 20:20:53 -0000	1.16
+++ screen.cpp	21 Dec 2003 17:34:44 -0000	1.17
@@ -276,13 +276,24 @@
 		_resMan->resClose(_roomDefTable[_currentScreen].parallax[1]);
 }
 
-void SwordScreen::recreate() {
-	memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
-}
-
-void SwordScreen::spritesAndParallax(void) {
-	if ((_currentScreen == 54) && _parallax[0])
-		renderParallax(_parallax[0]); // rm54 has a BACKGROUND parallax layer in parallax[0]
+void SwordScreen::draw(void) {
+	if (_currentScreen == 54) {
+		// rm54 has a BACKGROUND parallax layer in parallax[0]
+		if (_parallax[0])
+			renderParallax(_parallax[0]);
+		uint8 *src = _layerBlocks[0];
+		uint8 *dest = _screenBuf;
+		for (uint16 cnty = 0; cnty < _scrnSizeY; cnty++)
+			for (uint16 cntx = 0; cntx < _scrnSizeX; cntx++) {
+				if (*src)
+					*dest = *src;
+				dest++;
+				src++;
+			}
+	} else
+		memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
+	
+		
 
 	for (uint8 cnt = 0; cnt < _backLength; cnt++)
 		processImage(_backList[cnt]);
@@ -454,7 +465,7 @@
 
 	for (uint16 cnty = 0; cnty < SCREEN_DEPTH; cnty++) {
 		uint8 *src = data + READ_LE_UINT32(header->lineIndexes + cnty + scrlY);
-		uint8 *dest = _screenBuf + SwordLogic::_scriptVars[SCROLL_OFFSET_X] + cnty * _scrnSizeX;
+		uint8 *dest = _screenBuf + SwordLogic::_scriptVars[SCROLL_OFFSET_X] + (cnty + SwordLogic::_scriptVars[SCROLL_OFFSET_Y]) * _scrnSizeX;
 		uint16 remain = scrlX;
 		uint16 xPos = 0;
 		bool copyFirst = false;

Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- screen.h	20 Dec 2003 20:20:53 -0000	1.6
+++ screen.h	21 Dec 2003 17:34:44 -0000	1.7
@@ -75,13 +75,11 @@
 
 	void addToGraphicList(uint8 listId, uint32 objId);
 
-	void recreate();
-	void spritesAndParallax(void);
+	void draw(void);
 
 	void fadeDownPalette(void);
 	void fadeUpPalette(void);
 	void fnSetPalette(uint8 start, uint16 length, uint32 id, bool fadeUp);
-	//void fnSetFadeTargetPalette(uint32 id);
 	bool stillFading(void);
 
 	void updateScreen(void);

Index: sword1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sword1.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- sword1.cpp	21 Dec 2003 16:50:02 -0000	1.17
+++ sword1.cpp	21 Dec 2003 17:34:44 -0000	1.18
@@ -1090,8 +1090,7 @@
 			_logic->engine();
 			_logic->updateScreenParams(); // sets scrolling
 
-			_screen->recreate();
-			_screen->spritesAndParallax();
+			_screen->draw();
 			_mouse->animate();
 
 			newTime = _system->get_msecs();





More information about the Scummvm-git-logs mailing list