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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Jan 28 20:56:30 CET 2008


Revision: 30687
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30687&view=rev
Author:   peres001
Date:     2008-01-28 11:56:29 -0800 (Mon, 28 Jan 2008)

Log Message:
-----------
Removed usage of kBitFront and kBitBack. Only the old kBit2 buffer is kept to store the background picture.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/exec_ns.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/gui_ns.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -360,27 +360,6 @@
 }
 
 
-void Parallaction_ns::eraseAnimations() {
-	debugC(9, kDebugExec, "eraseAnimations");
-
-	for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) {
-
-		Animation *a = *it;
-
-		if (((a->_flags & kFlagsActive) == 0) && ((a->_flags & kFlagsRemove) == 0)) continue;
-
-		Common::Rect r(a->width(), a->height());
-		r.moveTo(a->_oldPos);
-		_gfx->restoreBackground(r);
-
-		a->_oldPos.x = a->_left;
-		a->_oldPos.y = a->_top;
-	}
-
-	return;
-}
-
-
 void Parallaction_ns::runScripts() {
 	debugC(9, kDebugExec, "runScripts");
 

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -380,9 +380,6 @@
 
 
 void Gfx::swapBuffers() {
-	Graphics::Surface *temp = _buffers[kBitFront];
-	_buffers[kBitFront] = _buffers[kBitBack];
-	_buffers[kBitBack] = temp;
 	updateScreen();
 	return;
 }
@@ -393,27 +390,19 @@
 //
 void Gfx::clearScreen(Gfx::Buffers buffer) {
 	memset(_buffers[buffer]->pixels, 0, _vm->_screenSize);
-
-	if (buffer == kBitFront) updateScreen();
-
-	return;
 }
 
 
 void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) {
 	memcpy(_buffers[dstbuffer]->pixels, _buffers[srcbuffer]->pixels, _vm->_screenSize);
-
-	return;
 }
 
 void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) {
 
 	if (mask) {
 		uint16 z = queryMask(y);
-		blitCnv(&surf, x, y, z, kBitBack);
 		blitCnv(&surf, x, y, z, kBit2);
 	} else {
-		flatBlitCnv(&surf, x, y, kBitBack);
 		flatBlitCnv(&surf, x, y, kBit2);
 	}
 
@@ -797,37 +786,11 @@
 	_font = font;
 }
 
-void Gfx::restoreBackground(const Common::Rect& r) {
 
-	int16 left = r.left;
-	int16 top = r.top;
-	int16 width = r.width();
-	int16 height = r.height();
-
-	if (left < 0) left = 0;
-	if (top < 0) top = 0;
-
-	if (left >= _backgroundWidth) return;
-	if (top >= _backgroundHeight) return;
-
-	if (left+width >= _backgroundWidth) width = _backgroundWidth - left;
-	if (top+height >= _backgroundHeight) height = _backgroundHeight - top;
-
-	Common::Rect q(width, height);
-	q.moveTo(left, top);
-
-	copyRect(kBitBack, q, (byte*)_buffers[kBit2]->getBasePtr(q.left, q.top), _backgroundWidth);
-
-	return;
-}
-
-
-
 void Gfx::setBackground(Graphics::Surface *surface) {
 	_buffers[kBit2] = surface;
 
 	initBuffers(surface->w, surface->h);
-	copyScreen(kBit2, kBitBack);
 }
 
 void Gfx::setMask(MaskBuffer *buffer) {
@@ -880,9 +843,6 @@
 	_buffers[kBit2] = 0;
 	_depthMask = 0;
 
-	_buffers[kBitFront] = 0;
-	_buffers[kBitBack] = 0;
-
 	initBuffers(_vm->_screenWidth, _vm->_screenHeight);
 
 	setPalette(_palette);
@@ -923,38 +883,10 @@
 	_backgroundWidth = w;
 	_backgroundHeight = h;
 
-	if (!_buffers[kBitFront]) {
-		_buffers[kBitFront] = new Graphics::Surface;
-	}
-
-	if (!_buffers[kBitBack]) {
-		_buffers[kBitBack] = new Graphics::Surface;
-	}
-
-	if (_buffers[kBitFront]->w != w || _buffers[kBitFront]->h != h) {
-		_buffers[kBitFront]->create(w, h, 1);
-	}
-
-	if (_buffers[kBitBack]->w != w || _buffers[kBitBack]->h != h) {
-		_buffers[kBitBack]->create(w, h, 1);
-	}
-
 }
 
 void Gfx::freeBuffers() {
 
-	if (_buffers[kBitFront]) {
-		_buffers[kBitFront]->free();
-		delete _buffers[kBitFront];
-	}
-
-	if (_buffers[kBitBack]) {
-		_buffers[kBitBack]->free();
-		delete _buffers[kBitBack];
-	}
-
-	_buffers[kBitFront] = 0;
-	_buffers[kBitBack] = 0;
 }
 
 

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/graphics.h	2008-01-28 19:56:29 UTC (rev 30687)
@@ -349,8 +349,6 @@
 public:
 	enum Buffers {
 		// bit buffers
-		kBitFront,
-		kBitBack,
 		kBit2
 	};
 

Modified: scummvm/trunk/engines/parallaction/gui_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -388,7 +388,7 @@
 
 	_disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0");
 
-	showSlide("password");	// loads background into kBitBack buffer
+	showSlide("password");
 
 
 	const uint16 (*keys)[PASSWORD_LEN] = (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_LANG_MULT)) ? _amigaKeys : _pcKeys;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -284,7 +284,6 @@
 		}
 
 		if (_inputMode == kInputModeGame) {
-			eraseAnimations();
 			runScripts();
 			walk();
 			drawAnimations();

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-01-28 19:56:29 UTC (rev 30687)
@@ -491,7 +491,6 @@
 	virtual void runScripts() = 0;
 	virtual void walk() = 0;
 	virtual void drawAnimations() = 0;
-	virtual void eraseAnimations() = 0;
 
 	void		beep();
 
@@ -655,7 +654,6 @@
 	void runScripts();
 	void walk();
 	void drawAnimations();
-	void eraseAnimations();
 
 
 	// location parser

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -144,7 +144,7 @@
 }
 
 void Parallaction_br::splash(const char *name) {
-
+#if 0
 	BackgroundInfo info;
 
 	_gfx->clearScreen(Gfx::kBitFront);
@@ -163,7 +163,7 @@
 		_system->delayMillis(20);
 	}
 	info.bg.free();
-
+#endif
 	return;
 }
 
@@ -186,9 +186,9 @@
 
 int Parallaction_br::showMenu() {
 	// TODO: filter menu entries according to progress in game
-
+#if 0
 	_gfx->clearScreen(Gfx::kBitFront);
-
+#endif
 	BackgroundInfo info;
 
 	Graphics::Surface	_menuItems[7];
@@ -212,11 +212,11 @@
 		kMenuPart3,
 		kMenuPart4
 	};
-
+#if 0
 	_disk->loadSlide(info, "tbra");
 	_gfx->setPalette(info.palette);
 	_gfx->flatBlitCnv(&info.bg, 20, 50, Gfx::kBitFront);
-
+#endif
 	int availItems = 4 + _progress;
 
 	for (int i = 0; i < availItems; i++)
@@ -251,12 +251,12 @@
 				invertMenuItem(_menuItems[oldSelectedItem]);
 
 			Common::Rect r(MENUITEM_WIDTH, MENUITEM_HEIGHT);
-
+#if 0
 			for (int i = 0; i < availItems; i++) {
 				r.moveTo(MENUITEMS_X, MENUITEMS_Y + i * 20);
 				_gfx->copyRect(Gfx::kBitFront, r, (byte*)_menuItems[i].pixels, _menuItems[i].pitch);
 			}
-
+#endif
 			oldSelectedItem = selectedItem;
 		}
 

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-01-28 18:28:30 UTC (rev 30686)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-01-28 19:56:29 UTC (rev 30687)
@@ -248,7 +248,7 @@
 
 	uint16 v2 = 0;
 	if (!scumm_stricmp(background, "final")) {
-		_gfx->clearScreen(Gfx::kBitBack);
+		_gfx->clearScreen(Gfx::kBit2);
 		for (uint16 _si = 0; _si < 32; _si++) {
 			pal.setEntry(_si, v2, v2, v2);
 			v2 += 4;
@@ -323,8 +323,6 @@
 	}
 
 
-	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
-	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
 	_gfx->setBlackPalette();
 	_gfx->updateScreen();
 


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