[Scummvm-cvs-logs] SF.net SVN: scummvm:[44759] scummvm/trunk/engines/sci/engine/kgraphics.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Oct 7 23:25:31 CEST 2009


Revision: 44759
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44759&view=rev
Author:   m_kiewitz
Date:     2009-10-07 21:25:31 +0000 (Wed, 07 Oct 2009)

Log Message:
-----------
SCI: kDrawPic / had an error in previous revision

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-07 21:15:50 UTC (rev 44758)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-07 21:25:31 UTC (rev 44759)
@@ -922,8 +922,8 @@
 		if (!argv[2].isNull())
 			addToFlag = true;
 		// FIXME: usesOldGfxFunctions() seems to be broken, cause sq3 has it set, but uses bit 0 correctly
-		if (s->_kernel->usesOldGfxFunctions())
-			addToFlag = !addToFlag;
+		if (!s->_kernel->usesOldGfxFunctions())
+			addToFlag = !addToFlag; // later engines set the bit, but dont want to add to picture
 	}
 	if (argc >= 4)
 		EGApaletteNo = argv[3].toUint16();
@@ -1585,7 +1585,7 @@
 		s->gui->addToPicView(viewId, loopNo, celNo, leftPos, topPos, priority, control);
 		break;
 	default:
-		error("kAddToPic with unsupported parameter count %d", argc);		
+		error("kAddToPic with unsupported parameter count %d", argc);
 	}
 	return s->r_acc;
 }
@@ -1598,7 +1598,7 @@
 	uint16 portPtr;
 	Common::Rect picRect;
 	int16 picTop, picLeft;
-	
+
 	switch (argc) {
 		case 1:
 		portPtr = argv[0].toSint16();
@@ -1735,25 +1735,25 @@
 
 static reg_t kShowMovie_Windows(EngineState *s, int argc, reg_t *argv) {
 	Common::String filename = s->_segMan->getString(argv[1]);
-	
+
 	Graphics::AVIPlayer *player = new Graphics::AVIPlayer(g_system);
-	
+
 	if (!player->open(filename)) {
 		warning("Failed to open movie file %s", filename.c_str());
 		return s->r_acc;
 	}
-	
+
 	uint32 startTime = g_system->getMillis();
 	bool play = true;
-	
+
 	while (play && player->getCurFrame() < player->getFrameCount()) {
 		uint32 elapsed = g_system->getMillis() - startTime;
-		
+
 		if (elapsed >= player->getCurFrame() * 1000 / player->getFrameRate()) {
 			Graphics::Surface *surface = player->getNextFrame();
 
 			Palette *palette = NULL;
-			
+
 			if (player->dirtyPalette()) {
 				byte *rawPalette = player->getPalette();
 				Palette *colors = new Palette(256);
@@ -1769,29 +1769,29 @@
 
 				palette->forceInto(s->gfx_state->driver->getMode()->palette);
 			}
-				
+
 			if (surface) {
 				// Allocate a pixmap
 				gfx_pixmap_t *pixmap = gfx_new_pixmap(surface->w, surface->h, 0, 0, 0);
 				assert(pixmap);
 				gfx_pixmap_alloc_index_data(pixmap);
-	
+
 				// Copy data from the surface
 				memcpy(pixmap->index_data, surface->pixels, surface->w * surface->h);
 				pixmap->xoffset = (g_system->getWidth() - surface->w) / 2;
 				pixmap->yoffset = (g_system->getHeight() - surface->h) / 2;
 				pixmap->palette = palette;
-				
+
 				// Copy the frame to the screen
 				gfx_xlate_pixmap(pixmap, s->gfx_state->driver->getMode());
 				gfxop_draw_pixmap(s->gfx_state, pixmap, gfx_rect(0, 0, 320, 200), Common::Point(pixmap->xoffset, pixmap->yoffset));
 				gfxop_update_box(s->gfx_state, gfx_rect(0, 0, 320, 200));
 				gfx_free_pixmap(pixmap);
-				
+
 				// Surface is freed when the codec in the video is deleted
 			}
 		}
-		
+
 		Common::Event event;
 		while (g_system->getEventManager()->pollEvent(event)) {
 			switch (event.type) {
@@ -1803,7 +1803,7 @@
 					break;
 			}
 		}
-		
+
 		g_system->delayMillis(10);
 	}
 


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