[Scummvm-cvs-logs] CVS: scummvm/saga gfx.cpp,1.4,1.5 interface.cpp,1.2,1.3 reinherit.h,1.7,1.8

Eugene Sandulenko sev at users.sourceforge.net
Tue Apr 27 19:12:01 CEST 2004


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32756

Modified Files:
	gfx.cpp interface.cpp reinherit.h 
Log Message:
Fixed crash. Original clip routine was more sane.
Some code formatting.


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gfx.cpp	25 Apr 2004 16:06:22 -0000	1.4
+++ gfx.cpp	28 Apr 2004 02:11:09 -0000	1.5
@@ -49,9 +49,7 @@
 
 namespace Saga {
 
-int GFX_ClearSurface(char *buf, int w, int h, int p)
-{
-
+int GFX_ClearSurface(char *buf, int w, int h, int p) {
 	int y;
 
 	for (y = 0; y < h; y++) {
@@ -62,9 +60,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_ClearSurface16(char *buf, int w, int h, int p)
-{
-
+int GFX_ClearSurface16(char *buf, int w, int h, int p) {
 	int y;
 	w <<= 1;
 
@@ -76,8 +72,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_DrawPalette(R_SURFACE * dst_s)
-{
+int GFX_DrawPalette(R_SURFACE *dst_s) {
 	int x;
 	int y;
 
@@ -86,12 +81,10 @@
 	R_RECT pal_rect;
 
 	for (y = 0; y < 16; y++) {
-
 		pal_rect.top = (y * 8) + 4;
 		pal_rect.bottom = pal_rect.top + 8;
 
 		for (x = 0; x < 16; x++) {
-
 			pal_rect.left = (x * 8) + 4;
 			pal_rect.right = pal_rect.left + 8;
 
@@ -103,8 +96,7 @@
 	return 0;
 }
 
-int GFX_SimpleBlit(R_SURFACE * dst_s, R_SURFACE * src_s)
-{
+int GFX_SimpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s) {
 	uchar *src_p;
 	uchar *dst_p;
 	int y, w, p;
@@ -120,7 +112,6 @@
 	p = src_s->buf_pitch;
 
 	for (y = 0; y < src_s->buf_h; y++) {
-
 		memcpy(dst_p, src_p, w);
 
 		dst_p += p;
@@ -130,14 +121,11 @@
 	return R_SUCCESS;
 }
 
-int GFX_Scale2x(R_SURFACE * dst_s, R_SURFACE * src_s)
-{
-
+int GFX_Scale2x(R_SURFACE *dst_s, R_SURFACE *src_s) {
 	assert((dst_s != NULL) && (src_s != NULL));
 	assert((dst_s->bpp == src_s->bpp));
 
 	switch (dst_s->bpp) {
-
 	case 8:
 		return GFX_Scale2x8(dst_s, src_s);
 		break;
@@ -154,9 +142,7 @@
 	return R_FAILURE;
 }
 
-int GFX_Scale2x8(R_SURFACE * dst_s, R_SURFACE * src_s)
-{
-
+int GFX_Scale2x8(R_SURFACE *dst_s, R_SURFACE *src_s) {
 	int y, x;
 
 	int src_skip = src_s->buf_pitch - src_s->buf_w;
@@ -172,7 +158,6 @@
 	assert(dst_s->buf_h == (src_s->buf_h * 2));
 
 	for (y = 0; y < src_s->buf_h; y++) {
-
 		src_row = src_ptr;
 		dst_row = dst_ptr;
 
@@ -192,8 +177,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_Scale2x16(R_SURFACE * dst_s, R_SURFACE * src_s)
-{
+int GFX_Scale2x16(R_SURFACE *dst_s, R_SURFACE *src_s) {
 	int y, x;
 
 	int src_skip;
@@ -211,7 +195,6 @@
 	dest_skip = (dst_s->buf_pitch - dst_s->buf_w) / sizeof(short);
 
 	for (y = 0; y < src_s->buf_h; y++) {
-
 		src_row = (short *)src_ptr;
 		dest_row = (short *)dest_ptr;
 
@@ -232,10 +215,6 @@
 	return R_SUCCESS;
 }
 
-int
-GFX_BufToSurface(R_SURFACE * ds,
-    const uchar * src,
-    int src_w, int src_h, R_RECT * src_rect, R_POINT * dst_pt)
 /*--------------------------------------------------------------------------*\
  * Copies a rectangle from a raw 8 bit pixel buffer to the specified surface.
  * The buffer is of width 'src_w' and height 'src_h'. The rectangle to be 
@@ -247,8 +226,8 @@
  * - The surface must match the logical dimensions of the buffer exactly.
  * - Returns R_FAILURE on error
 \*--------------------------------------------------------------------------*/
-{
-
+int GFX_BufToSurface(R_SURFACE *ds, const uchar *src, int src_w, int src_h, 
+					 R_RECT *src_rect, R_POINT *dst_pt) {
 	const uchar *read_p;
 	uchar *write_p;
 
@@ -263,10 +242,8 @@
 	int src_off_x, src_off_y;
 	int src_draw_w, src_draw_h;
 
-	/* Clamp source rectangle to source buffer
-	 * \*------------------------------------------------------------- */
+	/* Clamp source rectangle to source buffer */
 	if (src_rect != NULL) {
-
 		src_rect->clip(src_w - 1, src_h - 1);
 
 		s = *src_rect;
@@ -282,8 +259,7 @@
 		s.bottom = src_h - 1;
 	}
 
-	/* Get destination origin and clip rectangle
-	 * \*------------------------------------------------------------- */
+	/* Get destination origin and clip rectangle */
 	if (dst_pt != NULL) {
 		d_x = dst_pt->x;
 		d_y = dst_pt->y;
@@ -304,8 +280,7 @@
 		clip.bottom = ds->buf_h - 1;
 	}
 
-	/* Clip source rectangle to destination surface
-	 * \*------------------------------------------------------------- */
+	/* Clip source rectangle to destination surface */
 	dst_off_x = d_x;
 	dst_off_y = d_y;
 	src_off_x = s.left;
@@ -363,13 +338,11 @@
 		src_draw_h -= (clip.bottom - (d_y + src_draw_h - 1));
 	}
 
-	/* Transfer buffer data to surface
-	 * \*------------------------------------------------------------- */
+	/* Transfer buffer data to surface */
 	read_p = (src + src_off_x) + (src_w * src_off_y);
 	write_p = (ds->buf + dst_off_x) + (ds->buf_pitch * dst_off_y);
 
 	for (row = 0; row < src_draw_h; row++) {
-
 		memcpy(write_p, read_p, src_draw_w);
 
 		write_p += ds->buf_pitch;
@@ -379,16 +352,8 @@
 	return R_SUCCESS;
 }
 
-int
-GFX_BufToBuffer(uchar * dst_buf,
-    int dst_w,
-    int dst_h,
-    const uchar * src,
-    int src_w, int src_h, R_RECT * src_rect, R_POINT * dst_pt)
-/*--------------------------------------------------------------------------*\
-\*--------------------------------------------------------------------------*/
-{
-
+int GFX_BufToBuffer(uchar *dst_buf, int dst_w, int dst_h, const uchar *src,
+					int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt) {
 	const uchar *read_p;
 	uchar *write_p;
 
@@ -403,10 +368,8 @@
 	int src_off_x, src_off_y;
 	int src_draw_w, src_draw_h;
 
-	/* Clamp source rectangle to source buffer
-	 * \*------------------------------------------------------------- */
+	/* Clamp source rectangle to source buffer */
 	if (src_rect != NULL) {
-
 		src_rect->clip(src_w - 1, src_h - 1);
 
 		s.left = src_rect->left;
@@ -425,8 +388,7 @@
 		s.bottom = src_h - 1;
 	}
 
-	/* Get destination origin and clip rectangle
-	 * \*------------------------------------------------------------- */
+	/* Get destination origin and clip rectangle */
 	if (dst_pt != NULL) {
 		d_x = dst_pt->x;
 		d_y = dst_pt->y;
@@ -440,8 +402,7 @@
 	clip.right = dst_w - 1;
 	clip.bottom = dst_h - 1;
 
-	/* Clip source rectangle to destination surface
-	 * \*------------------------------------------------------------- */
+	/* Clip source rectangle to destination surface */
 	dst_off_x = d_x;
 	dst_off_y = d_y;
 	src_off_x = s.left;
@@ -499,13 +460,11 @@
 		src_draw_h -= (clip.bottom - (d_y + src_draw_h - 1));
 	}
 
-	/* Transfer buffer data to surface
-	 * \*------------------------------------------------------------- */
+	/* Transfer buffer data to surface */
 	read_p = (src + src_off_x) + (src_w * src_off_y);
 	write_p = (dst_buf + dst_off_x) + (dst_w * dst_off_y);
 
 	for (row = 0; row < src_draw_h; row++) {
-
 		memcpy(write_p, read_p, src_draw_w);
 
 		write_p += dst_w;
@@ -515,18 +474,15 @@
 	return R_SUCCESS;
 }
 
-int GFX_DrawCursor(R_SURFACE * ds, R_POINT * p1)
-{
-
+int GFX_DrawCursor(R_SURFACE *ds, R_POINT *p1) {
 	static uchar cursor_img[R_CURSOR_W * R_CURSOR_H] = {
-
-		0, 0, 0, 255, 0, 0, 0,
-		0, 0, 0, 255, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0,
-		255, 255, 0, 0, 0, 255, 255,
-		0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 255, 0, 0, 0,
-		0, 0, 0, 255, 0, 0, 0
+		0,   0,   0,   255, 0,   0,   0,
+		0,   0,   0,   255, 0,   0,   0,
+		0,   0,   0,   0,   0,   0,   0,
+		255, 255, 0,   0,   0,   255, 255,
+		0,   0,   0,   0,   0,   0,   0,
+		0,   0,   0,   255, 0,   0,   0,
+		0,   0,   0,   255, 0,   0,   0
 	};
 
 	R_CLIPINFO ci;
@@ -569,9 +525,7 @@
 	dst_skip = ds->buf_pitch - ci.draw_w;
 
 	for (y = 0; y < ci.draw_h; y++) {
-
 		for (x = 0; x < ci.draw_w; x++) {
-
 			if (*src_p != 0) {
 				*dst_p = *src_p;
 			}
@@ -588,12 +542,11 @@
 
 }
 
-int GFX_DrawRect(R_SURFACE * ds, R_RECT * dst_rect, int color)
 /*--------------------------------------------------------------------------*\
  * Fills a rectangle in the surface ds from point 'p1' to point 'p2' using
  * the specified color.
 \*--------------------------------------------------------------------------*/
-{
+int GFX_DrawRect(R_SURFACE *ds, R_RECT *dst_rect, int color) {
 	uchar *write_p;
 
 	int w;
@@ -603,7 +556,6 @@
 	int left, top, right, bottom;
 
 	if (dst_rect != NULL) {
-
 		dst_rect->clip(ds->buf_w - 1, ds->buf_h - 1);
 
 		left = dst_rect->left;
@@ -635,8 +587,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_DrawFrame(R_SURFACE * ds, R_POINT * p1, R_POINT * p2, int color)
-{
+int GFX_DrawFrame(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
 	int left, top, right, bottom;
 
 	int min_x;
@@ -678,9 +629,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_DrawPolyLine(R_SURFACE * ds, R_POINT * pts, int pt_ct, int draw_color)
-{
-
+int GFX_DrawPolyLine(R_SURFACE *ds, R_POINT *pts, int pt_ct, int draw_color) {
 	R_POINT *first_pt = pts;
 	int last_i = 1;
 	int i;
@@ -702,9 +651,7 @@
 	return R_SUCCESS;
 }
 
-int GFX_GetClipInfo(R_CLIPINFO * clipinfo)
-{
-
+int GFX_GetClipInfo(R_CLIPINFO *clipinfo) {
 	Common::Rect s;
 	int d_x, d_y;
 
@@ -726,8 +673,7 @@
 
 	clip = *clipinfo->dst_rect;
 
-	/* Clip source rectangle to destination surface
-	 * \*------------------------------------------------------------- */
+	/* Clip source rectangle to destination surface */
 	clipinfo->dst_draw_x = d_x;
 	clipinfo->dst_draw_y = d_y;
 	clipinfo->src_draw_x = s.left;
@@ -798,12 +744,8 @@
 	return R_SUCCESS;
 }
 
-int
-GFX_ClipLine(R_SURFACE * ds,
-    const R_POINT * src_p1,
-    const R_POINT * src_p2, R_POINT * dst_p1, R_POINT * dst_p2)
-{
-
+int GFX_ClipLine(R_SURFACE *ds, const R_POINT *src_p1, const R_POINT *src_p2, 
+				 R_POINT *dst_p1, R_POINT *dst_p2) {
 	const R_POINT *n_p1;
 	const R_POINT *n_p2;
 
@@ -841,7 +783,6 @@
 	dy = bottom - top;
 
 	if (left < 0) {
-
 		if (right < 0) {
 			/* Line completely off left edge */
 			return -1;
@@ -856,7 +797,6 @@
 	}
 
 	if (bottom > clip.right) {
-
 		if (left > clip.right) {
 			/* Line completely off right edge */
 			return -1;
@@ -873,7 +813,6 @@
 	return 1;
 }
 
-void GFX_DrawLine(R_SURFACE * ds, R_POINT * p1, R_POINT * p2, int color)
 /*--------------------------------------------------------------------------*\
  * Utilizes Bresenham's run-length slice algorithm described in
  *  "Michael Abrash's Graphics Programming Black Book", 
@@ -881,8 +820,7 @@
  *
  * Performs no clipping
 \*--------------------------------------------------------------------------*/
-{
-
+void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
 	uchar *write_p;
 
 	int clip_result;

Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- interface.cpp	25 Apr 2004 15:14:46 -0000	1.2
+++ interface.cpp	28 Apr 2004 02:11:09 -0000	1.3
@@ -58,7 +58,6 @@
 static R_INTERFACE_MODULE IfModule;
 
 static R_VERB_DATA I_VerbData[] = {
-
 	{I_VERB_WALKTO, "verb_walkto", "Walk to", S_VERB_WALKTO},
 	{I_VERB_LOOKAT, "verb_lookat", "Look at", S_VERB_LOOKAT},
 	{I_VERB_PICKUP, "verb_pickup", "Pick up", S_VERB_PICKUP},
@@ -70,7 +69,6 @@
 };
 
 static R_INTERFACE_DESC ITE_interface = {
-
 	ITE_STATUS_Y,
 	ITE_STATUS_W,
 	ITE_STATUS_H,
@@ -89,7 +87,6 @@
 };
 
 static R_INTERFACE_BUTTON ITE_c_buttons[] = {
-
 	{5, 4, 46, 47, "Portrait", 0, 0, BUTTON_NONE, 0},
 	/* "Walk To" and "Talk To" share button sprites */
 	{52, 4, 109, 14, "Walk To", 1, 2, BUTTON_VERB, I_VERB_WALKTO},
@@ -114,7 +111,6 @@
 };
 
 static R_INTERFACE_DESC IHNM_interface = {
-
 	IHNM_STATUS_Y,
 	IHNM_STATUS_W,
 	IHNM_STATUS_H,
@@ -133,16 +129,13 @@
 };
 
 static R_INTERFACE_BUTTON IHNM_c_buttons[] = {
-
 	{5, 4, 46, 47, "Portrait", 0, 0, 0, 0}
 };
 
-int INTERFACE_RegisterLang(void)
-{
+int INTERFACE_RegisterLang(void) {
 	size_t i;
 
 	for (i = 0; i < ARRAYSIZE(I_VerbData); i++) {
-
 		if (CVAR_Register_S(I_VerbData[i].verb_str,
 			I_VerbData[i].verb_cvar,
 			NULL, R_CVAR_CFG, R_VERB_STRLIMIT) != R_SUCCESS) {
@@ -156,9 +149,7 @@
 	return R_SUCCESS;
 }
 
-int INTERFACE_Init(void)
-{
-
+int INTERFACE_Init(void) {
 	R_GAME_RESOURCEDESC g_resdesc;
 
 	int game_type;
@@ -170,7 +161,6 @@
 
 	IfModule.i_thread = STHREAD_Create();
 	if (IfModule.i_thread == NULL) {
-
 		R_printf(R_STDERR,
 		    "Error creating script thread for game interface "
 		    "module.\n");
@@ -178,8 +168,7 @@
 		return R_FAILURE;
 	}
 
-	/* Load interface module resource file context
-	 * \*------------------------------------------------------------- */
+	/* Load interface module resource file context */
 	result = GAME_GetFileContext(&IfModule.i_file_ctxt,
 	    R_GAME_RESOURCEFILE, 0);
 	if (result != R_SUCCESS) {
@@ -187,20 +176,16 @@
 		return R_FAILURE;
 	}
 
-	/* Initialize interface data by game type
-	 * \*------------------------------------------------------------- */
+	/* Initialize interface data by game type */
 	game_type = GAME_GetGameType();
 
 	if (game_type == R_GAMETYPE_ITE) {
-
 		/* Load Inherit the Earth interface desc */
-
 		IfModule.c_panel.buttons = ITE_c_buttons;
 		IfModule.c_panel.nbuttons = ARRAYSIZE(ITE_c_buttons);
 
 		IfModule.i_desc = ITE_interface;
 	} else if (game_type == R_GAMETYPE_IHNM) {
-
 		/* Load I Have No Mouth interface desc */
 		IfModule.c_panel.buttons = IHNM_c_buttons;
 		IfModule.c_panel.nbuttons = ARRAYSIZE(IHNM_c_buttons);
@@ -210,8 +195,7 @@
 		return R_FAILURE;
 	}
 
-	/* Load interface resources
-	 * \*------------------------------------------------------------- */
+	/* Load interface resources */
 	GAME_GetResourceInfo(&g_resdesc);
 
 	/* Load command panel resource */
@@ -264,26 +248,20 @@
 	return R_SUCCESS;
 }
 
-int INTERFACE_Activate(void)
-{
-
+int INTERFACE_Activate(void) {
 	IfModule.active = 1;
 	INTERFACE_Draw();
 
 	return R_SUCCESS;
 }
 
-int INTERFACE_Deactivate(void)
-{
-
+int INTERFACE_Deactivate(void) {
 	IfModule.active = 0;
 
 	return R_SUCCESS;
 }
 
-int INTERFACE_SetStatusText(const char *new_txt)
-{
-
+int INTERFACE_SetStatusText(const char *new_txt) {
 	assert(new_txt != NULL);
 
 	strncpy(IfModule.status_txt, new_txt, R_STATUS_TEXT_LEN);
@@ -291,9 +269,7 @@
 	return R_SUCCESS;
 }
 
-int INTERFACE_Draw(void)
-{
-
+int INTERFACE_Draw(void) {
 	R_GAME_DISPLAYINFO g_di;
 
 	R_SURFACE *back_buf;
@@ -312,24 +288,20 @@
 		return R_SUCCESS;
 	}
 
-	/* Get game display info
-	 * \*------------------------------------------------------------- */
+	/* Get game display info */
 	GAME_GetDisplayInfo(&g_di);
 
-	/* Erase background of status bar
-	 * \*------------------------------------------------------------- */
+	/* Erase background of status bar */
 	rect.left = 0;
-	rect.top = IfModule.i_desc.status_y;
+	rect.top = IfModule.i_desc.status_h - 1;
 
 	rect.right = g_di.logical_w - 1;
-	rect.bottom = IfModule.i_desc.status_h - 1;
+	rect.bottom = IfModule.i_desc.status_y;
 
 	GFX_DrawRect(back_buf, &rect, IfModule.i_desc.status_bgcol);
 
-	/* Draw command panel background
-	 * \*------------------------------------------------------------- */
+	/* Draw command panel background */
 	if (IfModule.panel_mode == PANEL_COMMAND) {
-
 		xbase = IfModule.c_panel.x;
 		ybase = IfModule.c_panel.y;
 
@@ -341,7 +313,6 @@
 		    IfModule.c_panel.img_w,
 		    IfModule.c_panel.img_h, NULL, &origin);
 	} else {
-
 		xbase = IfModule.d_panel.x;
 		ybase = IfModule.d_panel.y;
 
@@ -354,8 +325,7 @@
 		    IfModule.d_panel.img_h, NULL, &origin);
 	}
 
-	/* Draw character portrait
-	 * \*------------------------------------------------------------- */
+	/* Draw character portrait */
 	lportrait_x = xbase + IfModule.i_desc.lportrait_x;
 	lportrait_y = ybase + IfModule.i_desc.lportrait_y;
 
@@ -366,9 +336,7 @@
 	return R_SUCCESS;
 }
 
-int INTERFACE_Update(R_POINT * imouse_pt, int update_flag)
-{
-
+int INTERFACE_Update(R_POINT *imouse_pt, int update_flag) {
 	R_GAME_DISPLAYINFO g_di;
 
 	R_SURFACE *back_buf;
@@ -386,33 +354,23 @@
 
 	back_buf = SYSGFX_GetBackBuffer();
 
-	/* Get game display info
-	 * \*------------------------------------------------------------- */
+	/* Get game display info */
 	GAME_GetDisplayInfo(&g_di);
 
-	/* Update playfield space ( only if cursor is inside )
-	 * \*------------------------------------------------------------- */
+	/* Update playfield space ( only if cursor is inside ) */
 	if (imouse_y < g_di.scene_h) {
-
 		/* Mouse is in playfield space */
-
 		if (update_flag == UPDATE_MOUSEMOVE) {
-
 			HandlePlayfieldUpdate(back_buf, imouse_pt);
 		} else if (update_flag == UPDATE_MOUSECLICK) {
-
 			HandlePlayfieldClick(back_buf, imouse_pt);
 		}
 	}
 
-	/* Update command space
-	 * \*------------------------------------------------------------- */
-
+	/* Update command space */
 	if (update_flag == UPDATE_MOUSEMOVE) {
-
 		HandleCommandUpdate(back_buf, imouse_pt);
 	} else if (update_flag == UPDATE_MOUSECLICK) {
-
 		HandleCommandClick(back_buf, imouse_pt);
 	}
 
@@ -421,20 +379,16 @@
 	return R_SUCCESS;
 }
 
-int DrawStatusBar(R_SURFACE * ds)
-{
-
+int DrawStatusBar(R_SURFACE *ds) {
 	R_GAME_DISPLAYINFO g_di;
 	R_RECT rect;
 
 	int string_w;
 
-	/* Get game display info
-	 * \*------------------------------------------------------------- */
+	/* Get game display info */
 	GAME_GetDisplayInfo(&g_di);
 
-	/* Erase background of status bar
-	 * \*------------------------------------------------------------- */
+	/* Erase background of status bar */
 	rect.left = 0;
 	rect.top = IfModule.i_desc.status_y;
 	rect.right = g_di.logical_w - 1;
@@ -457,9 +411,7 @@
 
 }
 
-int HandleCommandClick(R_SURFACE * ds, R_POINT * imouse_pt)
-{
-
+int HandleCommandClick(R_SURFACE *ds, R_POINT *imouse_pt) {
 	int hit_button;
 	int ibutton_num;
 
@@ -474,7 +426,6 @@
 
 	hit_button = INTERFACE_HitTest(imouse_pt, &ibutton_num);
 	if (hit_button != R_SUCCESS) {
-
 		/* Clicking somewhere other than a button doesn't do anything */
 		return R_SUCCESS;
 	}
@@ -483,19 +434,16 @@
 	y_base = IfModule.c_panel.y;
 
 	if (IfModule.c_panel.buttons[ibutton_num].flags & BUTTON_SET) {
-
 		old_set_button = IfModule.c_panel.set_button;
 		set_button = ibutton_num;
 		IfModule.c_panel.set_button = set_button;
 
 		if (IfModule.c_panel.buttons[set_button].flags & BUTTON_VERB) {
-
 			IfModule.active_verb =
 			    IfModule.c_panel.buttons[ibutton_num].data;
 		}
 
 		if (IfModule.c_panel.buttons[set_button].flags & BUTTON_BITMAP) {
-
 			button_x =
 			    x_base + IfModule.c_panel.buttons[set_button].x1;
 			button_y =
@@ -527,9 +475,7 @@
 	return R_SUCCESS;
 }
 
-int HandleCommandUpdate(R_SURFACE * ds, R_POINT * imouse_pt)
-{
-
+int HandleCommandUpdate(R_SURFACE *ds, R_POINT *imouse_pt) {
 	int hit_button;
 	int ibutton_num;
 
@@ -545,15 +491,14 @@
 	int i;
 
 	hit_button = INTERFACE_HitTest(imouse_pt, &ibutton_num);
-	if (hit_button == R_SUCCESS) {
 
+	if (hit_button == R_SUCCESS) {
 		/* Hovering over a command panel button */
 		INTERFACE_SetStatusText(I_VerbData[IfModule.active_verb].
 		    verb_str);
 	}
 
 	for (i = 0; i < IfModule.c_panel.nbuttons; i++) {
-
 		if (!(IfModule.c_panel.buttons[i].flags & BUTTON_LABEL)) {
 			continue;
 		}
@@ -596,9 +541,7 @@
 	return R_SUCCESS;
 }
 
-int HandlePlayfieldClick(R_SURFACE * ds, R_POINT * imouse_pt)
-{
-
+int HandlePlayfieldClick(R_SURFACE *ds, R_POINT *imouse_pt) {
 	int hit_object;
 	int object_num;
 	uint object_flags = 0;
@@ -609,9 +552,7 @@
 	hit_object = OBJECTMAP_HitTest(imouse_pt, &object_num);
 
 	if (hit_object != R_SUCCESS) {
-
 		/* Player clicked on empty spot - walk here regardless of verb */
-
 		ACTOR_StoA(&iactor_pt, imouse_pt);
 		ACTOR_WalkTo(0, &iactor_pt, 0, NULL);
 
@@ -619,16 +560,13 @@
 	}
 
 	if (OBJECTMAP_GetFlags(object_num, &object_flags) != R_SUCCESS) {
-
 		CON_Print("Invalid object number: %d\n", object_num);
 
 		return R_FAILURE;
 	}
 
 	if (object_flags & R_OBJECT_NORMAL) {
-
 		if (OBJECTMAP_GetEPNum(object_num, &script_num) == R_SUCCESS) {
-
 			/* Set active verb in script module */
 			SDATA_PutWord(4, 4,
 			    I_VerbData[IfModule.active_verb].s_verb);
@@ -639,20 +577,15 @@
 			}
 		}
 	} else {
-
 		/* Not a normal scene object - walk to it as if it weren't there */
-
 		ACTOR_StoA(&iactor_pt, imouse_pt);
 		ACTOR_WalkTo(0, &iactor_pt, 0, NULL);
-
 	}
 
 	return R_SUCCESS;
 }
 
-int HandlePlayfieldUpdate(R_SURFACE * ds, R_POINT * imouse_pt)
-{
-
+int HandlePlayfieldUpdate(R_SURFACE *ds, R_POINT *imouse_pt) {
 	const char *object_name;
 	int object_num;
 	uint object_flags = 0;
@@ -666,7 +599,6 @@
 	hit_object = OBJECTMAP_HitTest(imouse_pt, &object_num);
 
 	if (hit_object != R_SUCCESS) {
-
 		/* Cursor over nothing - just display current verb */
 		INTERFACE_SetStatusText(I_VerbData[IfModule.active_verb].
 		    verb_str);
@@ -675,7 +607,6 @@
 	}
 
 	if (OBJECTMAP_GetFlags(object_num, &object_flags) != R_SUCCESS) {
-
 		CON_Print("Invalid object number: %d\n", object_num);
 
 		return R_FAILURE;
@@ -684,18 +615,14 @@
 	OBJECTMAP_GetName(object_num, &object_name);
 
 	if (object_flags & R_OBJECT_NORMAL) {
-
 		/* Normal scene object - display as subject of verb */
-
 		snprintf(new_status,
 		    R_STATUS_TEXT_LEN,
 		    "%s %s",
 		    I_VerbData[IfModule.active_verb].verb_str, object_name);
 	} else {
-
 		/* Not normal scene object - override verb as we can only
 		 * walk to this object */
-
 		snprintf(new_status,
 		    R_STATUS_TEXT_LEN,
 		    "%s %s", I_VerbData[I_VERB_WALKTO].verb_str, object_name);
@@ -706,9 +633,7 @@
 	return R_SUCCESS;
 }
 
-int INTERFACE_HitTest(R_POINT * imouse_pt, int *ibutton)
-{
-
+int INTERFACE_HitTest(R_POINT *imouse_pt, int *ibutton) {
 	R_INTERFACE_BUTTON *buttons;
 
 	int nbuttons;
@@ -724,7 +649,6 @@
 	ybase = IfModule.c_panel.y;
 
 	for (i = 0; i < nbuttons; i++) {
-
 		if ((imouse_pt->x >= (xbase + buttons[i].x1)) &&
 		    (imouse_pt->x < (xbase + buttons[i].x2)) &&
 		    (imouse_pt->y >= (ybase + buttons[i].y1)) &&
@@ -740,11 +664,8 @@
 	return R_FAILURE;
 }
 
-int INTERFACE_Shutdown(void)
-{
-
+int INTERFACE_Shutdown(void) {
 	if (!IfModule.init) {
-
 		return R_FAILURE;
 	}
 

Index: reinherit.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/reinherit.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- reinherit.h	28 Apr 2004 00:30:16 -0000	1.7
+++ reinherit.h	28 Apr 2004 02:11:09 -0000	1.8
@@ -84,16 +84,13 @@
 
 
 struct R_COLOR {
-
 	int red;
 	int green;
 	int blue;
 	int alpha;
-
 };
 
 struct R_SURFACE {
-
 	uchar *buf;
 	int buf_w;
 	int buf_h;
@@ -104,11 +101,9 @@
 	R_RECT clip_rect;
 
 	void *impl_src;
-
 };
 
 struct R_SOUNDBUFFER {
-
 	const uchar *res_data;
 	size_t res_len;
 
@@ -119,7 +114,6 @@
 
 	const uchar *s_buf;
 	size_t s_buf_len;
-
 };
 
 #define R_RGB_RED   0x00FF0000UL
@@ -127,30 +121,24 @@
 #define R_RGB_BLUE  0x000000FFUL
 
 struct SAGA_COLOR {
-
 	byte r;
 	byte g;
 	byte b;
-
 };
 
 #define SAGA_COLOR_LEN 3
 
 struct PALENTRY {
-
 	byte red;
 	byte green;
 	byte blue;
-
 };
 
 enum R_ERRORCODE {
-
 	R_STOP = -3,
 	R_MEM = -2,
 	R_FAILURE = -1,
 	R_SUCCESS = 0
-
 };
 
 
@@ -163,10 +151,10 @@
 /*
  * r_transitions.c
 \*--------------------------------------------------------------------------*/
-int TRANSITION_Dissolve(uchar * dst_img,
+int TRANSITION_Dissolve(uchar *dst_img,
     int dst_w,
     int dst_h,
-    int dst_p, const uchar * src_img, int src_p, int flags, double percent);
+    int dst_p, const uchar *src_img, int src_p, int flags, double percent);
 
 /*--------------------------------------------------------------------------*\
  * System specific routines
@@ -228,22 +216,22 @@
 R_SURFACE *SYSGFX_GetScreenSurface(void);
 R_SURFACE *SYSGFX_GetBackBuffer(void);
 
-int SYSGFX_LockSurface(R_SURFACE * surface);
-int SYSGFX_UnlockSurface(R_SURFACE * surface);
+int SYSGFX_LockSurface(R_SURFACE *surface);
+int SYSGFX_UnlockSurface(R_SURFACE *surface);
 
 R_SURFACE *SYSGFX_CreateSurface(int w, int h, int bpp);
-R_SURFACE *SYSGFX_FormatToDisplay(R_SURFACE * surface);
-int SYSGFX_DestroySurface(R_SURFACE * surface);
+R_SURFACE *SYSGFX_FormatToDisplay(R_SURFACE *surface);
+int SYSGFX_DestroySurface(R_SURFACE *surface);
 
 int SYSGFX_GetWhite(void);
 int SYSGFX_GetBlack(void);
 int SYSGFX_MatchColor(unsigned long colormask);
-int SYSGFX_SetPalette(R_SURFACE * surface, PALENTRY * pal);
-int SYSGFX_GetCurrentPal(PALENTRY * src_pal);
+int SYSGFX_SetPalette(R_SURFACE *surface, PALENTRY *pal);
+int SYSGFX_GetCurrentPal(PALENTRY *src_pal);
 
-int SYSGFX_PalToBlack(R_SURFACE * surface, PALENTRY * src_pal, double percent);
+int SYSGFX_PalToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent);
 
-int SYSGFX_BlackToPal(R_SURFACE * surface, PALENTRY * src_pal, double percent);
+int SYSGFX_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent);
 
 /*
  * System : Input 





More information about the Scummvm-git-logs mailing list