[Scummvm-cvs-logs] SF.net SVN: scummvm: [28449] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Aug 4 20:58:50 CEST 2007


Revision: 28449
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28449&view=rev
Author:   peres001
Date:     2007-08-04 11:58:50 -0700 (Sat, 04 Aug 2007)

Log Message:
-----------
Added routine to restore door backgrounds: this means that backgrounds for door and get zones are now handled by two different sets of routines. This fixes bugs #1765191 and #1762643 (it was actually the same bug).

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/zone.cpp

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-08-04 18:32:05 UTC (rev 28448)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-08-04 18:58:50 UTC (rev 28449)
@@ -548,9 +548,41 @@
 }
 
 //
+//	restores background according to specified frame
+//
+void Gfx::restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background) {
+
+	byte *t = cnv->_data0;
+	byte *s = background;
+	byte *d0 = _buffers[kBitBack] + r.left + r.top * _vm->_screenWidth;
+	byte *d1 = _buffers[kBit2] + r.left + r.top * _vm->_screenWidth;
+
+	for (uint16 i = 0; i < r.height() ; i++) {
+		for (uint16 j = 0; j < r.width() ; j++) {
+			if (*t) {
+				*d0 = *s;
+				*d1 = *s;
+			}
+
+			d0++;
+			d1++;
+			t++;
+			s++;
+		}
+
+		d0 += (_vm->_screenWidth - r.width());
+		d1 += (_vm->_screenWidth - r.width());
+	}
+
+
+	return;
+}
+
+
+//
 //	copies a rectangular bitmap on the background
 //
-void Gfx::restoreZoneBackground(const Common::Rect& r, byte *data) {
+void Gfx::restoreGetBackground(const Common::Rect& r, byte *data) {
 
 	StaticCnv cnv;
 

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-08-04 18:32:05 UTC (rev 28448)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-08-04 18:58:50 UTC (rev 28449)
@@ -175,7 +175,8 @@
 	void freeStaticCnv(StaticCnv *cnv);
 	void backupDoorBackground(DoorData *data, int16 x, int16 y);
 	void backupGetBackground(GetData *data, int16 x, int16 y);
-	void restoreZoneBackground(const Common::Rect& r, byte *data);
+	void restoreGetBackground(const Common::Rect& r, byte *data);
+	void restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background);
 
 	// location
 	void setBackground(byte *background);

Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp	2007-08-04 18:32:05 UTC (rev 28448)
+++ scummvm/trunk/engines/parallaction/zone.cpp	2007-08-04 18:58:50 UTC (rev 28449)
@@ -424,15 +424,18 @@
 	StaticCnv v14;
 
 	if (z->u.door->_cnv) {
+		Common::Rect r(z->_left, z->_top, z->_left+z->u.door->_cnv->_width, z->_top+z->u.door->_cnv->_height);
+
+		uint16 _ax = (z->_flags & kFlagsClosed ? 1 : 0);
+
 		v14._width = z->u.door->_cnv->_width;
 		v14._height = z->u.door->_cnv->_height;
+		v14._data0 = z->u.door->_cnv->getFramePtr(_ax);
 
-		Common::Rect r(z->_left, z->_top, z->_left+z->u.door->_cnv->_width, z->_top+z->u.door->_cnv->_height);
+		_vm->_gfx->restoreDoorBackground(&v14, r, z->u.door->_background);
 
-		_vm->_gfx->restoreZoneBackground(r, z->u.door->_background);
+		_ax = (z->_flags & kFlagsClosed ? 0 : 1);
 
-		uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1);
-
 		_vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack);
 		_vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2);
 	}
@@ -469,7 +472,7 @@
 	if (z->u.get->_cnv) {
 		Common::Rect r(z->_left, z->_top, z->_left + z->u.get->_cnv->_width, z->_top + z->u.get->_cnv->_height);
 
-		_vm->_gfx->restoreZoneBackground(r, z->u.get->_backup);
+		_vm->_gfx->restoreGetBackground(r, z->u.get->_backup);
 	}
 
 	count++;


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