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

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sat Feb 21 10:44:53 CET 2009


Revision: 38673
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38673&view=rev
Author:   aquadran
Date:     2009-02-21 09:44:53 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
formating

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/resource/sci_cursor_0.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_font.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_pal_1.cpp

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_cursor_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_cursor_0.cpp	2009-02-21 09:39:10 UTC (rev 38672)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_cursor_0.cpp	2009-02-21 09:44:53 UTC (rev 38673)
@@ -42,9 +42,7 @@
 	{GFX_COLOR_INDEX_UNMAPPED, 0xaa, 0xaa, 0xaa}
 };
 
-
-static gfx_pixmap_t *
-_gfxr_draw_cursor(int id, byte *resource, int size, int sci01) {
+static gfx_pixmap_t *_gfxr_draw_cursor(int id, byte *resource, int size, int sci01) {
 	int colors[4] = {0, 1, GFX_CURSOR_TRANSPARENT, 1};
 	int line;
 	byte *data;
@@ -67,7 +65,7 @@
 	if (sci01) {
 		retval->xoffset = get_int_16(resource);
 		retval->yoffset = get_int_16(resource + 2);
-	} else if (resource[3]) /* center */
+	} else if (resource[3]) // center
 		retval->xoffset = retval->yoffset = CURSOR_SIZE / 2;
 	else
 		retval->xoffset = retval->yoffset = 0;
@@ -81,23 +79,17 @@
 		int i;
 
 		for (i = 0; i < 16; i++) {
-			int color_code = ((mask_a << i) & 0x8000)
-			                 | (((mask_b << i) >> 1) & 0x4000);
-
+			int color_code = ((mask_a << i) & 0x8000) | (((mask_b << i) >> 1) & 0x4000);
 			*data++ = colors[color_code >> 14];
 		}
 	}
 	return retval;
 }
 
-
-gfx_pixmap_t *
-gfxr_draw_cursor0(int id, byte *resource, int size) {
+gfx_pixmap_t *gfxr_draw_cursor0(int id, byte *resource, int size) {
 	return _gfxr_draw_cursor(id, resource, size, 0);
 }
 
-gfx_pixmap_t *
-gfxr_draw_cursor01(int id, byte *resource, int size) {
+gfx_pixmap_t *gfxr_draw_cursor01(int id, byte *resource, int size) {
 	return _gfxr_draw_cursor(id, resource, size, 1);
 }
-

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_font.cpp	2009-02-21 09:39:10 UTC (rev 38672)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_font.cpp	2009-02-21 09:44:53 UTC (rev 38673)
@@ -31,12 +31,10 @@
 
 extern int font_counter;
 
-
 #define FONT_HEIGHT_OFFSET 4
 #define FONT_MAXCHAR_OFFSET 2
 
-static int
-calc_char(byte *dest, int total_width, int total_height, byte *src, int size) {
+static int calc_char(byte *dest, int total_width, int total_height, byte *src, int size) {
 	int width = src[0];
 	int height = src[1];
 	int byte_width = (width + 7) >> 3;
@@ -63,9 +61,7 @@
 	return GFX_OK;
 }
 
-
-gfx_bitmap_font_t *
-gfxr_read_font(int id, byte *resource, int size) {
+gfx_bitmap_font_t *gfxr_read_font(int id, byte *resource, int size) {
 	gfx_bitmap_font_t *font = (gfx_bitmap_font_t*)sci_calloc(sizeof(gfx_bitmap_font_t), 1);
 	int chars_nr;
 	int max_width = 0, max_height;
@@ -84,8 +80,7 @@
 
 	if (chars_nr < 0 || chars_nr > 256 || max_height < 0) {
 		if (chars_nr < 0 || chars_nr > 256)
-			GFXERROR("Font %04x: Invalid number of characters: %d\n", id,
-			         chars_nr);
+			GFXERROR("Font %04x: Invalid number of characters: %d\n", id, chars_nr);
 		if (max_height < 0)
 			GFXERROR("Font %04x: Invalid font height: %d\n", id, max_height);
 		gfxr_free_font(font);
@@ -93,8 +88,7 @@
 	}
 
 	if (size < 6 + chars_nr * 2) {
-		GFXERROR("Font %04x: Insufficient space for %d characters in font\n",
-		         id, chars_nr);
+		GFXERROR("Font %04x: Insufficient space for %d characters in font\n", id, chars_nr);
 		gfxr_free_font(font);
 		return NULL;
 	}
@@ -106,8 +100,7 @@
 		int offset = get_int_16(resource + (i << 1) + 6);
 
 		if (offset >= size) {
-			GFXERROR("Font %04x: Error: Character 0x%02x is at offset 0x%04x (beyond 0x%04x)\n",
-			         id, i, offset, size);
+			GFXERROR("Font %04x: Error: Character 0x%02x is at offset 0x%04x (beyond 0x%04x)\n", id, i, offset, size);
 			gfxr_free_font(font);
 			return NULL;
 		}
@@ -130,13 +123,12 @@
 		font->row_size = (font->row_size + 3) & ~3;
 
 	font->char_size = font->row_size * max_height;
-	font->data = (byte*)sci_calloc(font->char_size, chars_nr);
+	font->data = (byte *)sci_calloc(font->char_size, chars_nr);
 
 	for (i = 0; i < chars_nr; i++) {
 		int offset = get_int_16(resource + (i << 1) + 6);
 
-		if (calc_char(font->data + (font->char_size * i), font->row_size, max_height,
-		              resource + offset, size - offset)) {
+		if (calc_char(font->data + (font->char_size * i), font->row_size, max_height, resource + offset, size - offset)) {
 			GFXERROR("Problem occured in font %04x, char %d/%d\n", id, i, chars_nr);
 			gfxr_free_font(font);
 			return NULL;
@@ -145,5 +137,3 @@
 
 	return font;
 }
-
-

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pal_1.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pal_1.cpp	2009-02-21 09:39:10 UTC (rev 38672)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pal_1.cpp	2009-02-21 09:44:53 UTC (rev 38673)
@@ -36,8 +36,7 @@
 #define SCI_PAL_FORMAT_VARIABLE_FLAGS 0
 #define SCI_PAL_FORMAT_CONSTANT_FLAGS 1
 
-gfx_pixmap_color_t *
-gfxr_read_pal11(int id, int *colors_nr, byte *resource, int size) {
+gfx_pixmap_color_t *gfxr_read_pal11(int id, int *colors_nr, byte *resource, int size) {
 	int start_color = resource[25];
 	int format = resource[32];
 	int entry_size = 0;
@@ -55,8 +54,7 @@
 		break;
 	}
 
-	retval = (gfx_pixmap_color_t *)
-	         sci_malloc(sizeof(gfx_pixmap_color_t) * (_colors_nr + start_color));
+	retval = (gfx_pixmap_color_t *)sci_malloc(sizeof(gfx_pixmap_color_t) * (_colors_nr + start_color));
 	memset(retval, 0, sizeof(gfx_pixmap_color_t) * (_colors_nr + start_color));
 
 	for (i = 0; i < start_color; i ++) {
@@ -86,8 +84,7 @@
 	return retval;
 }
 
-gfx_pixmap_color_t *
-gfxr_read_pal1(int id, int *colors_nr, byte *resource, int size) {
+gfx_pixmap_color_t *gfxr_read_pal1(int id, int *colors_nr, byte *resource, int size) {
 	int counter = 0;
 	int pos;
 	unsigned int colors[MAX_COLORS] = {0};
@@ -98,14 +95,10 @@
 		return NULL;
 	}
 
-
 	pos = PALETTE_START;
 
 	while (pos < size/* && resource[pos] == COLOR_OK && counter < MAX_COLORS*/) {
-		int color = resource[pos]
-		            | (resource[pos + 1] << 8)
-		            | (resource[pos + 2] << 16)
-		            | (resource[pos + 3] << 24);
+		int color = resource[pos] | (resource[pos + 1] << 8) | (resource[pos + 2] << 16) | (resource[pos + 3] << 24);
 
 		pos += 4;
 
@@ -123,9 +116,6 @@
 	}
 
 	retval = (gfx_pixmap_color_t*)sci_malloc(sizeof(gfx_pixmap_color_t) * counter);
-#ifdef SATISFY_PURIFY
-	memset(retval, 0, sizeof(gfx_pixmap_color_t) * counter);
-#endif
 
 	*colors_nr = counter;
 	for (pos = 0; pos < counter; pos++) {
@@ -140,12 +130,11 @@
 	return retval;
 }
 
-gfx_pixmap_color_t *
-gfxr_read_pal1_amiga(int *colors_nr, FILE *f) {
+gfx_pixmap_color_t *gfxr_read_pal1_amiga(int *colors_nr, FILE *f) {
 	int i;
 	gfx_pixmap_color_t *retval;
 
-	retval = (gfx_pixmap_color_t*)sci_malloc(sizeof(gfx_pixmap_color_t) * 32);
+	retval = (gfx_pixmap_color_t *)sci_malloc(sizeof(gfx_pixmap_color_t) * 32);
 
 	for (i = 0; i < 32; i++) {
 		int b1, b2;
@@ -165,6 +154,6 @@
 	}
 
 	*colors_nr = 32;
+
 	return retval;
 }
-


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