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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jun 6 12:40:32 CEST 2009


Revision: 41216
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41216&view=rev
Author:   thebluegr
Date:     2009-06-06 10:40:32 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
Some uint8 -> byte conversions

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-06 10:36:38 UTC (rev 41215)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-06 10:40:32 UTC (rev 41216)
@@ -78,7 +78,7 @@
 
 static void drawProc(int x, int y, int c, void *data) {
 	GfxDriver *drv = (GfxDriver *)data;
-	uint8 *p = drv->getVisual0();
+	byte *p = drv->getVisual0();
 	p[y * 320* drv->getMode()->xfact + x] = c;
 }
 
@@ -224,7 +224,7 @@
 byte *GfxDriver::createCursor(gfx_pixmap_t *pointer) {
 	int linewidth = pointer->width;
 	int lines = pointer->height;
-	byte *data = new uint8[linewidth*lines];
+	byte *data = new byte[linewidth*lines];
 	byte *linebase = data, *pos;
 	byte *src = pointer->index_data;
 
@@ -232,7 +232,7 @@
 		pos = linebase;
 
 		for (int xc = 0; xc < pointer->index_width; xc++) {
-			uint8 color = *src;
+			byte color = *src;
 			// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT
 			// Note that some cursors don't have a palette in SQ5
 			if (pointer->palette && color < pointer->palette->size())
@@ -254,11 +254,11 @@
 	if ((pointer == NULL) || (hotspot == NULL)) {
 		g_system->showMouse(false);
 	} else {
-		uint8 *cursorData = createCursor(pointer);
+		byte *cursorData = createCursor(pointer);
 
 		// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT
 		// Note that some cursors don't have a palette in SQ5
-		uint8 color_key = GFX_CURSOR_TRANSPARENT;
+		byte color_key = GFX_CURSOR_TRANSPARENT;
 		if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && (pointer->palette && (unsigned int)pointer->color_key < pointer->palette->size()))
 			color_key = pointer->palette->getColor(pointer->color_key).parent_index;
 		// Some cursors in SQ5 don't have a palette. The cursor palette seems to use 64 colors, so setting the color key to 63 works

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-06 10:36:38 UTC (rev 41215)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-06 10:40:32 UTC (rev 41216)
@@ -206,7 +206,7 @@
 
 	// TODO: We probably want to only update the colours used by this pixmap
 	// here. This will require updating the 'dirty' system.
-	uint8 paletteData[4*256];
+	byte paletteData[4*256];
 	const uint paletteSize = driver->getMode()->palette->size();
 	for (uint i = 0; i < paletteSize; ++i) {
 		const PaletteEntry& c = (*driver->getMode()->palette)[i];
@@ -989,17 +989,17 @@
 		draw_color1.priority = draw_color2.priority = color1.priority;
 
 		if (draw_color1.mask & GFX_MASK_VISUAL) {
-			draw_color1.visual.r = (uint8) COLOR_MIX(visual.r, mod_offset);
-			draw_color1.visual.g = (uint8) COLOR_MIX(visual.g, mod_offset);
-			draw_color1.visual.b = (uint8) COLOR_MIX(visual.b, mod_offset);
-			draw_color1.alpha = (uint8) COLOR_MIX(alpha, mod_offset);
+			draw_color1.visual.r = (byte) COLOR_MIX(visual.r, mod_offset);
+			draw_color1.visual.g = (byte) COLOR_MIX(visual.g, mod_offset);
+			draw_color1.visual.b = (byte) COLOR_MIX(visual.b, mod_offset);
+			draw_color1.alpha = (byte) COLOR_MIX(alpha, mod_offset);
 
 			mod_offset += mod_breadth;
 
-			draw_color2.visual.r = (uint8) COLOR_MIX(visual.r, mod_offset);
-			draw_color2.visual.g = (uint8) COLOR_MIX(visual.g, mod_offset);
-			draw_color2.visual.b = (uint8) COLOR_MIX(visual.b, mod_offset);
-			draw_color2.alpha = (uint8) COLOR_MIX(alpha, mod_offset);
+			draw_color2.visual.r = (byte) COLOR_MIX(visual.r, mod_offset);
+			draw_color2.visual.g = (byte) COLOR_MIX(visual.g, mod_offset);
+			draw_color2.visual.b = (byte) COLOR_MIX(visual.b, mod_offset);
+			draw_color2.alpha = (byte) COLOR_MIX(alpha, mod_offset);
 		}
 		if (reverse)
 			return drv->drawFilledRect(new_box, draw_color2, draw_color1, driver_shade_type);


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