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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Sep 7 00:27:29 CEST 2009


Revision: 43994
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43994&view=rev
Author:   thebluegr
Date:     2009-09-06 22:27:29 +0000 (Sun, 06 Sep 2009)

Log Message:
-----------
Removed the hi-color code (16bpp & 24bpp). All SCI games use up to 256 colors, so hi-color isn't really used anywhere, and it only makes the overall code more complex for no reason

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
    scummvm/trunk/engines/sci/gfx/gfx_support.cpp
    scummvm/trunk/engines/sci/gfx/gfx_system.h
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/res_pic.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -52,11 +52,11 @@
 	// create the visual buffers
 	for (i = 0; i < 2; i++) {
 		_visual[i] = NULL;
-		_visual[i] = new byte[_mode->xsize * _mode->ysize * _mode->bytespp];
+		_visual[i] = new byte[_mode->xsize * _mode->ysize];
 		if (!_visual[i]) {
 			error("Out of memory: Could not allocate visual buffers! (%dx%d)\n", _mode->xsize, _mode->ysize);
 		}
-		memset(_visual[i], 0, _mode->xsize * _mode->ysize * _mode->bytespp);
+		memset(_visual[i], 0, _mode->xsize * _mode->ysize);
 	}
 
 	if (_mode->palette)
@@ -79,12 +79,11 @@
 
 // Drawing operations
 
-template<int COPY_BYTES, typename SIZETYPE, int EXTRA_BYTE_OFFSET>
 static void drawProc(int x, int y, int c, void *data) {
 	GfxDriver *drv = (GfxDriver *)data;
 	byte *p = drv->getVisual0();
-	SIZETYPE col = c << (EXTRA_BYTE_OFFSET * 8);
-	memcpy(p + (y * 320* drv->getMode()->xfact + x) * COPY_BYTES, &col, COPY_BYTES);
+	uint8 col = c;
+	memcpy(p + (y * 320* drv->getMode()->xfact + x), &col, 1);
 }
 
 void GfxDriver::drawLine(Common::Point start, Common::Point end, gfx_color_t color, 
@@ -95,28 +94,6 @@
 	int xsize = _mode->xsize;
 	int ysize = _mode->ysize;
 
-	void (*modeDrawProc)(int,int,int,void*);
-	switch (_mode->bytespp) {
-	case 1:
-		modeDrawProc = drawProc<1, uint8, 0>;
-		break;
-	case 2:
-		modeDrawProc = drawProc<2, uint16, 0>;
-		break;
-	case 3:
-#ifdef SCUMM_BIG_ENDIAN
-		modeDrawProc = drawProc<3, uint32, 1>;
-#else
-		modeDrawProc = drawProc<3, uint32, 0>;
-#endif
-		break;
-	case 4:
-		modeDrawProc = drawProc<4, uint32, 0>;
-		break;
-	default:
-		error("Invalid mode->bytespp=%d", _mode->bytespp);
-	}
-
 	if (color.mask & GFX_MASK_VISUAL) {
 		Common::Point nstart, nend;
 
@@ -128,7 +105,7 @@
 				nend.x = CLIP<int16>(end.x + xc, 0, xsize - 1);
 				nend.y = CLIP<int16>(end.y + yc, 0, ysize - 1);
 
-				Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, modeDrawProc, this);
+				Graphics::drawLine(nstart.x, nstart.y, nend.x, nend.y, scolor, drawProc, this);
 
 				if (color.mask & GFX_MASK_PRIORITY) {
 					gfx_draw_line_pixmap_i(_priority[0], nstart, nend, color.priority);
@@ -142,8 +119,8 @@
 	gfx_rectangle_fill_t shade_mode) {
 	if (color1.mask & GFX_MASK_VISUAL) {
 		for (int i = rect.y; i < rect.y + rect.height; i++) {
-			memset(_visual[0] + (i * _mode->xsize + rect.x) * _mode->bytespp,
-			       color1.visual.parent_index, rect.width * _mode->bytespp);
+			memset(_visual[0] + (i * _mode->xsize + rect.x),
+			       color1.visual.parent_index, rect.width);
 		}
 	}
 
@@ -162,7 +139,7 @@
 	}
 
 	gfx_crossblit_pixmap(_mode, pxm, priority, src, dest, _visual[bufnr],
-	                     _mode->xsize * _mode->bytespp,
+	                     _mode->xsize,
 	                     _priority[bufnr]->index_data,
 	                     _priority[bufnr]->index_width, 1, 0);
 }
@@ -180,9 +157,9 @@
 		pxm->width = src.width;
 		pxm->height = src.height;
 		for (int i = 0; i < src.height; i++) {
-			memcpy(pxm->data + i * src.width * _mode->bytespp,
-			       _visual[0] + _mode->bytespp * ((i + src.y) * _mode->xsize + src.x),
-			       src.width * _mode->bytespp);
+			memcpy(pxm->data + i * src.width,
+			       _visual[0] + ((i + src.y) * _mode->xsize + src.x),
+			       src.width);
 		}
 		break;
 
@@ -211,15 +188,15 @@
 	switch (buffer) {
 	case GFX_BUFFER_BACK:
 		for (int i = 0; i < src.height; i++) {
-			memcpy(_visual[0] + _mode->bytespp * ( (dest.y + i) * _mode->xsize + dest.x),
-			       _visual[1] + _mode->bytespp * ( (src.y + i) * _mode->xsize + src.x), src.width * _mode->bytespp );
+			memcpy(_visual[0] + ( (dest.y + i) * _mode->xsize + dest.x),
+			       _visual[1] + ( (src.y + i) * _mode->xsize + src.x), src.width );
 		}
 
 		if ((src.x == dest.x) && (src.y == dest.y))
 			gfx_copy_pixmap_box_i(_priority[0], _priority[1], src);
 		break;
 	case GFX_BUFFER_FRONT: {
-		g_system->copyRectToScreen(_visual[0] + _mode->bytespp * (src.x + src.y * _mode->xsize), _mode->xsize * _mode->bytespp, dest.x, dest.y, src.width, src.height);
+		g_system->copyRectToScreen(_visual[0] + (src.x + src.y * _mode->xsize), _mode->xsize, dest.x, dest.y, src.width, src.height);
 		g_system->updateScreen();
 		break;
 	}
@@ -229,7 +206,7 @@
 }
 
 void GfxDriver::setStaticBuffer(gfx_pixmap_t *pic, gfx_pixmap_t *priority) {
-	memcpy(_visual[1], pic->data, _mode->xsize * _mode->ysize * _mode->bytespp);
+	memcpy(_visual[1], pic->data, _mode->xsize * _mode->ysize);
 	gfx_copy_pixmap_box_i(_priority[1], priority, gfx_rect(0, 0, _mode->xsize, _mode->ysize));
 }
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -26,7 +26,6 @@
 /* Required defines:
 ** FUNCNAME: Function name
 ** SIZETYPE: Type used for each pixel
-** EXTRA_BYTE_OFFSET: Extra source byte offset for copying (used on big-endian machines in 24 bit mode)
 */
 
 #include "sci/gfx/gfx_system.h"
@@ -39,18 +38,14 @@
 // TODO: Replace this code with our common scalers (/graphics/scaler.h)
 
 
-#define EXTEND_COLOR(x) (unsigned) ((((unsigned) x) << 24) | (((unsigned) x) << 16) | (((unsigned) x) << 8) | ((unsigned) x))
-
-template<int COPY_BYTES, typename SIZETYPE, int EXTRA_BYTE_OFFSET>
-void _gfx_xlate_pixmap_unfiltered(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
-	SIZETYPE result_colors[GFX_PIC_COLORS];
-	SIZETYPE alpha_color = 0;
-	SIZETYPE alpha_ormask = 0xffffffff & 0;
+static void _gfx_xlate_pixmap_unfiltered(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
+	byte result_colors[GFX_PIC_COLORS];
+	byte alpha_color = 0;
+	byte alpha_ormask = 0xffffffff & 0;
 	int xfact = (scale) ? mode->xfact : 1;
 	int yfact = (scale) ? mode->yfact : 1;
 	int widthc, heightc; // Width duplication counter
 	int line_width = xfact * pxm->index_width;
-	int bytespp = mode->bytespp;
 	int x, y;
 	int i;
 	byte byte_transparent = 0;
@@ -61,23 +56,12 @@
 	int using_alpha = pxm->color_key != GFX_PIXMAP_COLOR_KEY_NONE;
 	int separate_alpha_map = using_alpha;
 
-	assert(bytespp == COPY_BYTES);
-
 	if (separate_alpha_map && !alpha_dest)
 		alpha_dest = pxm->alpha_map = (byte *)malloc(pxm->index_width * xfact * pxm->index_height * yfact);
 
 	// Calculate all colors
-	for (i = 0; i < pxm->colors_nr(); i++) {
-		int col;
-		const PaletteEntry& color = pxm->palette->getColor(i);
-		if (mode->palette)
-			col = color.parent_index;
-		else {
-			col = mode->format.ARGBToColor(0, color.r, color.g, color.b);
-			col |= alpha_ormask;
-		}
-		result_colors[i] = col;
-	}
+	for (i = 0; i < pxm->colors_nr(); i++)
+		result_colors[i] = pxm->palette->getColor(i).parent_index;
 
 	if (!separate_alpha_map && pxm->color_key != GFX_PIXMAP_COLOR_KEY_NONE)
 		result_colors[pxm->color_key] = alpha_color;
@@ -89,15 +73,15 @@
 
 		for (x = 0; x < pxm->index_width; x++) {
 			int isalpha;
-			SIZETYPE col = result_colors[isalpha = *src++] << (EXTRA_BYTE_OFFSET * 8);
+			byte col = result_colors[isalpha = *src++];
 			isalpha = (isalpha == pxm->color_key) && using_alpha;
 
 			// O(n) loops. There is an O(ln(n)) algorithm for this, but its slower for small n (which we're optimizing for here).
 			// And, anyway, most of the time is spent in memcpy() anyway.
 
 			for (widthc = 0; widthc < xfact; widthc++) {
-				memcpy(dest, &col, COPY_BYTES);
-				dest += COPY_BYTES;
+				memcpy(dest, &col, 1);
+				dest++;
 			}
 
 			if (separate_alpha_map) { // Set separate alpha map
@@ -109,43 +93,15 @@
 		// Copies each line. O(n) iterations; again, this could be optimized to O(ln(n)) for very high resolutions,
 		// but that wouldn't really help that much, as the same amount of data still would have to be transferred.
 		for (heightc = 1; heightc < yfact; heightc++) {
-			memcpy(dest, prev_dest, line_width * bytespp);
-			dest += line_width * bytespp;
+			memcpy(dest, prev_dest, line_width);
+			dest += line_width;
 			if (separate_alpha_map) {
 				memcpy(alpha_dest, prev_alpha_dest, line_width);
 				alpha_dest += line_width;
 			}
 		}
 	}
-}
 
-static void _gfx_xlate_pixmap_unfiltered(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
-	switch (mode->bytespp) {
-
-	case 1:
-		_gfx_xlate_pixmap_unfiltered<1, uint8, 0>(mode, pxm, scale);
-		break;
-
-	case 2:
-		_gfx_xlate_pixmap_unfiltered<2, uint16, 0>(mode, pxm, scale);
-		break;
-
-	case 3:
-#ifdef SCUMM_BIG_ENDIAN
-		_gfx_xlate_pixmap_unfiltered<3, uint32, 1>(mode, pxm, scale);
-#else
-		_gfx_xlate_pixmap_unfiltered<3, uint32, 0>(mode, pxm, scale);
-#endif
-		break;
-
-	case 4:
-		_gfx_xlate_pixmap_unfiltered<4, uint32, 0>(mode, pxm, scale);
-		break;
-
-	default:
-		error("Invalid mode->bytespp=%d", mode->bytespp);
-	}
-
 	if (pxm->flags & GFX_PIXMAP_FLAG_SCALED_INDEX) {
 		pxm->width = pxm->index_width;
 		pxm->height = pxm->index_height;
@@ -157,24 +113,18 @@
 
 
 void gfx_xlate_pixmap(gfx_pixmap_t *pxm, gfx_mode_t *mode) {
-	int was_allocated = 0;
+	if (pxm->palette && pxm->palette != mode->palette)
+		pxm->palette->mergeInto(mode->palette);
 
-	if (mode->palette) {
-		if (pxm->palette && pxm->palette != mode->palette)
-			pxm->palette->mergeInto(mode->palette);
-	}
-
-
 	if (!pxm->data) {
-		pxm->data = (byte*)malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height * mode->bytespp + 1);
+		pxm->data = (byte*)malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height + 1);
 		// +1: Eases coying on BE machines in 24 bpp packed mode
 		// Assume that memory, if allocated already, will be sufficient
 
 		// Allocate alpha map
 		if (pxm->colors_nr() < GFX_PIC_COLORS)
 			pxm->alpha_map = (byte*)malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height + 1);
-	} else
-		was_allocated = 1;
+	}
 
 	_gfx_xlate_pixmap_unfiltered(mode, pxm, !(pxm->flags & GFX_PIXMAP_FLAG_SCALED_INDEX));
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -314,7 +314,6 @@
 gfx_mode_t mode_1x1_color_index = { /* Fake 1x1 mode */
 	/* xfact */ 1, /* yfact */ 1,
 	/* xsize */ 1, /* ysize */ 1,
-	/* bytespp */ 1,
 	/* palette */ NULL,
 
 	Graphics::PixelFormat()

Modified: scummvm/trunk/engines/sci/gfx/gfx_support.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -124,16 +124,11 @@
 }
 
 
-/* Template parameters:
- * BYTESPP: Bytes per pixel
- * USE_PRIORITY: Whether to care about the priority buffer
- */
-template <int BYTESPP, bool USE_PRIORITY>
 void _gfx_crossblit(byte *dest, byte *src, int bytes_per_dest_line, int bytes_per_src_line,
 	int xl, int yl, byte *alpha, int bytes_per_alpha_line, int bytes_per_alpha_pixel,
 	unsigned int alpha_test_mask, unsigned int alpha_min,
-	byte *priority_buffer, int bytes_per_priority_line, int bytes_per_priority_pixel, int priority
-	) {
+	byte *priority_buffer, int bytes_per_priority_line, int bytes_per_priority_pixel, int priority,
+	bool usePriority) {
 	int x, y;
 	int alpha_end = xl * bytes_per_alpha_pixel;
 
@@ -145,46 +140,32 @@
 		for (x = 0; x < alpha_end; x += bytes_per_alpha_pixel) {
 			if (((alpha_test_mask & alpha[x]) < alpha_min) ^ 1) {
 
-				if (USE_PRIORITY) {
+				if (usePriority) {
 					if (priority_buffer[priority_offset] <= priority) {
 						priority_buffer[priority_offset] = priority;
-						memcpy(dest + pixel_offset, src + pixel_offset, BYTESPP);
+						memcpy(dest + pixel_offset, src + pixel_offset, 1);
 					}
 				} else {
-					memcpy(dest + pixel_offset, src + pixel_offset, BYTESPP);
+					memcpy(dest + pixel_offset, src + pixel_offset, 1);
 				}
 			}
 
-			pixel_offset += BYTESPP;
+			pixel_offset++;
 			alpha_offset += bytes_per_alpha_pixel;
-			if (USE_PRIORITY)
+			if (usePriority)
 				priority_offset += bytes_per_priority_pixel;
 		}
 
 		dest += bytes_per_dest_line;
 		src += bytes_per_src_line;
 		alpha += bytes_per_alpha_line;
-		if (USE_PRIORITY)
+		if (usePriority)
 			priority_buffer += bytes_per_priority_line;
 	}
 }
 
-static void (*crossblit_fns[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int, byte *, int, int, int) = { NULL,
-	_gfx_crossblit<1, false>,
-	_gfx_crossblit<2, false>,
-	_gfx_crossblit<3, false>,
-	_gfx_crossblit<4, false>
-};
-
-static void (*crossblit_fns_P[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int, byte *, int, int, int) = { NULL,
-	_gfx_crossblit<1, true>,
-	_gfx_crossblit<2, true>,
-	_gfx_crossblit<3, true>,
-	_gfx_crossblit<4, true>
-};
-
-void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl, int bpp) {
-	int line_width = xl * bpp;
+void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl) {
+	int line_width = xl;
 	int i;
 
 	for (i = 0; i < yl; i++) {
@@ -202,9 +183,6 @@
 	byte *alpha = pxm->alpha_map ? pxm->alpha_map : pxm->data;
 	byte *priority_pos = priority_dest;
 	unsigned int alpha_mask, alpha_min;
-	int bpp = mode->bytespp;
-	int bytes_per_alpha_pixel = bpp;
-	int bytes_per_alpha_line =  bytes_per_alpha_pixel * pxm->width;
 	int xl = pxm->width, yl = pxm->height;
 	int xoffset = (dest_coords.x < 0) ? - dest_coords.x : 0;
 	int yoffset = (dest_coords.y < 0) ? - dest_coords.y : 0;
@@ -240,7 +218,7 @@
 
 	// Set x offsets
 	if (!(flags & GFX_CROSSBLIT_FLAG_DATA_IS_HOMED))
-		dest += dest_coords.x * bpp;
+		dest += dest_coords.x;
 	priority_pos += dest_coords.x * priority_skip;
 
 	// Set y offsets
@@ -251,15 +229,15 @@
 	// Set source offsets
 	if (xoffset += src_coords.x) {
 		dest_coords.x = 0;
-		src += xoffset * bpp;
-		alpha += xoffset * bytes_per_alpha_pixel;
+		src += xoffset;
+		alpha += xoffset;
 	}
 
 
 	if (yoffset += src_coords.y) {
 		dest_coords.y = 0;
-		src += yoffset * bpp * pxm->width;
-		alpha += yoffset * bytes_per_alpha_line;
+		src += yoffset * pxm->width;
+		alpha += yoffset * pxm->width;
 	}
 
 	// Adjust length for clip box
@@ -307,25 +285,17 @@
 		alpha_min = 255 - alpha_min; // Since we use it for the reverse effect
 
 		if (!alpha_mask)
-			_gfx_crossblit_simple(dest, src, dest_line_width, pxm->width * bpp, xl, yl, bpp);
+			_gfx_crossblit_simple(dest, src, dest_line_width, pxm->width, xl, yl);
 		else
 
 			if (priority == GFX_NO_PRIORITY) {
-				if (bpp > 0 && bpp < 5)
-					crossblit_fns[bpp](dest, src, dest_line_width, pxm->width * bpp,
-					        xl, yl, alpha, bytes_per_alpha_line, bytes_per_alpha_pixel, alpha_mask, alpha_min,
-					        0, 0, 0, 0);
-				else {
-					error("Invalid mode->bytespp: %d", mode->bytespp);
-				}
+				_gfx_crossblit(dest, src, dest_line_width, pxm->width,
+				        xl, yl, alpha, pxm->width, 1, alpha_mask, alpha_min,
+				        0, 0, 0, 0, false);
 			} else { // priority
-				if (bpp > 0 && bpp < 5)
-					crossblit_fns_P[bpp](dest, src, dest_line_width, pxm->width * bpp,
-					        xl, yl, alpha, bytes_per_alpha_line, bytes_per_alpha_pixel, alpha_mask, alpha_min,
-					        priority_pos, priority_line_width, priority_skip, priority);
-				else {
-					error("Invalid mode->bytespp: %d", mode->bytespp);
-				}
+				_gfx_crossblit(dest, src, dest_line_width, pxm->width,
+				        xl, yl, alpha, pxm->width, 1, alpha_mask, alpha_min,
+				        priority_pos, priority_line_width, priority_skip, priority, true);
 			}
 }
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_system.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-09-06 22:27:29 UTC (rev 43994)
@@ -61,7 +61,6 @@
 
 	int xfact, yfact; /**< Horizontal and vertical scaling factors */
 	int xsize, ysize; /**< Horizontal and vertical size */
-	int bytespp; /**< Bytes per pixel */
 
 	/**
 	 * Palette or NULL to indicate non-palette mode.
@@ -272,13 +271,6 @@
 	GFX_SHADE_HORIZONTALLY	/**< Shade horizontally */
 };
 
-
-enum gfx_color_mode_t {
-	GFX_COLOR_MODE_AUTO = 0,	/**< Auto-detect- handled by the gfxop library */
-	GFX_COLOR_MODE_INDEX = 1,	/**< Index mode */
-	GFX_COLOR_MODE_HIGH = 2,	/**< High color mode (15bpp or 16 bpp) */
-	GFX_COLOR_MODE_TRUE = 4		/**< True color mode (24 bpp padded to 32 bpp) */
-};
 /** @} */
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -48,7 +48,6 @@
 
 	mode->xfact = xfact;
 	mode->yfact = yfact;
-	mode->bytespp = format.bytesPerPixel;
 	mode->format = format;
 	mode->palette = palette;
 
@@ -56,8 +55,7 @@
 }
 
 void gfx_free_mode(gfx_mode_t *mode) {
-	if (mode->palette)
-		mode->palette->free();
+	mode->palette->free();
 	free(mode);
 	mode = NULL;
 }
@@ -183,7 +181,7 @@
 		pixmap->height = pixmap->index_height * mode->yfact;
 	}
 
-	size = pixmap->width * pixmap->height * mode->bytespp;
+	size = pixmap->width * pixmap->height;
 	if (!size)
 		size = 1;
 

Modified: scummvm/trunk/engines/sci/gfx/res_pic.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-09-06 21:56:49 UTC (rev 43993)
+++ scummvm/trunk/engines/sci/gfx/res_pic.cpp	2009-09-06 22:27:29 UTC (rev 43994)
@@ -1116,7 +1116,7 @@
 }
 
 extern gfx_pixmap_t *gfxr_draw_cel0(int id, int loop, int cel, byte *resource, int size, gfxr_view_t *view, int mirrored);
-extern void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl, int bpp);
+extern void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl);
 
 void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, byte *resource,
 					 gfxr_pic0_params_t *style, int resid, ViewType viewType, Palette *static_pal, Common::Rect portBounds) {
@@ -1509,7 +1509,7 @@
 
 				_gfx_crossblit_simple(pic->visual_map->index_data + (titlebar_size * 320) + posy * 320 + posx,
 				                      view->index_data, pic->visual_map->index_width, view->index_width,
-				                      view->index_width, view->index_height, 1);
+				                      view->index_width, view->index_height);
 
 				gfx_free_pixmap(view);
 				view = NULL;
@@ -1616,8 +1616,7 @@
 		                      view->index_data,
 		                      pic->visual_map->index_width, view->index_width,
 		                      view->index_width,
-		                      view->index_height,
-		                      1);
+		                      view->index_height);
 	} else {
 		warning("[GFX] No view was contained in SCI1.1 pic resource");
 	}


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