[Scummvm-cvs-logs] CVS: scummvm/saga palanim.cpp,1.3,1.4 palanim.h,1.3,1.4 palanim_mod.h,1.2,1.3 reinherit.h,1.13,1.14 resnames.h,1.4,1.5 rscfile.cpp,1.3,1.4 rscfile.h,1.3,1.4 rscfile_mod.h,1.2,1.3 saga.cpp,1.14,1.15 saga.h,1.8,1.9

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat May 1 06:20:04 CEST 2004


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

Modified Files:
	palanim.cpp palanim.h palanim_mod.h reinherit.h resnames.h 
	rscfile.cpp rscfile.h rscfile_mod.h saga.cpp saga.h 
Log Message:
indent

Index: palanim.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/palanim.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- palanim.cpp	30 Apr 2004 23:02:23 -0000	1.3
+++ palanim.cpp	1 May 2004 13:19:15 -0000	1.4
@@ -20,27 +20,16 @@
  * $Header$
  *
  */
-/*
- Description:   
- 
-    Palette animation module
 
- Notes: 
-*/
+// Palette animation module
 
 #include "reinherit.h"
 
 #include "yslib.h"
 
-/*
- * Uses the following modules:
-\*--------------------------------------------------------------------------*/
 #include "events_mod.h"
 #include "game_mod.h"
 
-/*
- * Begin module:
-\*--------------------------------------------------------------------------*/
 #include "palanim_mod.h"
 #include "palanim.h"
 
@@ -48,8 +37,7 @@
 
 static PALANIM_DATA PAnimData;
 
-int PALANIM_Load(const byte * resdata, size_t resdata_len)
-{
+int PALANIM_Load(const byte *resdata, size_t resdata_len) {
 	const byte *read_p = resdata;
 	void *test_p;
 
@@ -71,9 +59,7 @@
 
 	PAnimData.entry_count = ys_read_u16_le(read_p, &read_p);
 
-	R_printf(R_STDOUT,
-	    "PALANIM_Load(): Loading %d PALANIM entries.\n",
-	    PAnimData.entry_count);
+	R_printf(R_STDOUT, "PALANIM_Load(): Loading %d PALANIM entries.\n", PAnimData.entry_count);
 
 	test_p = calloc(PAnimData.entry_count, sizeof(PALANIM_ENTRY));
 	if (test_p == NULL) {
@@ -84,7 +70,6 @@
 	PAnimData.entries = (PALANIM_ENTRY *)test_p;
 
 	for (i = 0; i < PAnimData.entry_count; i++) {
-
 		int color_count;
 		int pal_count;
 		int p, c;
@@ -95,61 +80,46 @@
 		PAnimData.entries[i].pal_count = pal_count;
 		PAnimData.entries[i].color_count = color_count;
 
-#       if 0
-		R_printf(R_STDOUT,
-		    "PALANIM_Load(): Entry %d: Loading %d palette indices.\n",
-		    i, pal_count);
+#if 0
+		R_printf(R_STDOUT, "PALANIM_Load(): Entry %d: Loading %d palette indices.\n", i, pal_count);
 #endif
 
 		test_p = calloc(1, sizeof(char) * pal_count);
 		if (test_p == NULL) {
-			R_printf(R_STDERR,
-			    "PALANIM_Load(): Allocation failure.\n");
+			R_printf(R_STDERR, "PALANIM_Load(): Allocation failure.\n");
 			return R_MEM;
 		}
 
 		PAnimData.entries[i].pal_index = (byte *)test_p;
 
-#       if 0
-		R_printf(R_STDOUT,
-		    "PALANIM_Load(): Entry %d: Loading %d SAGA_COLOR "
-		    "structures.\n", i, color_count);
-#       endif
+#if 0
+		R_printf(R_STDOUT, "PALANIM_Load(): Entry %d: Loading %d SAGA_COLOR structures.\n", i, color_count);
+#endif
 
 		test_p = calloc(1, sizeof(R_COLOR) * color_count);
 		if (test_p == NULL) {
-			R_printf(R_STDERR,
-			    "PALANIM_Load(): Allocation failure.\n");
+			R_printf(R_STDERR, "PALANIM_Load(): Allocation failure.\n");
 			return R_MEM;
 		}
 
 		PAnimData.entries[i].colors = (R_COLOR *)test_p;
 
 		for (p = 0; p < pal_count; p++) {
-			PAnimData.entries[i].pal_index[p] =
-			    (byte) ys_read_u8(read_p, &read_p);
+			PAnimData.entries[i].pal_index[p] = (byte) ys_read_u8(read_p, &read_p);
 		}
 
 		for (c = 0; c < color_count; c++) {
-			PAnimData.entries[i].colors[c].red =
-			    (byte) ys_read_u8(read_p, &read_p);
-
-			PAnimData.entries[i].colors[c].green =
-			    (byte) ys_read_u8(read_p, &read_p);
-
-			PAnimData.entries[i].colors[c].blue =
-			    (byte) ys_read_u8(read_p, &read_p);
+			PAnimData.entries[i].colors[c].red = (byte) ys_read_u8(read_p, &read_p);
+			PAnimData.entries[i].colors[c].green = (byte) ys_read_u8(read_p, &read_p);
+			PAnimData.entries[i].colors[c].blue = (byte) ys_read_u8(read_p, &read_p);
 		}
 	}
 
 	PAnimData.loaded = 1;
 	return R_SUCCESS;
-
 }
 
-int PALANIM_CycleStart(void)
-{
-
+int PALANIM_CycleStart() {
 	R_EVENT event;
 
 	if (!PAnimData.loaded) {
@@ -164,11 +134,9 @@
 	EVENT_Queue(&event);
 
 	return R_SUCCESS;
-
 }
 
-int PALANIM_CycleStep(int vectortime)
-{
+int PALANIM_CycleStep(int vectortime) {
 	R_SURFACE *back_buf;
 
 	static PALENTRY pal[256];
@@ -189,26 +157,14 @@
 	back_buf = SYSGFX_GetBackBuffer();
 
 	for (i = 0; i < PAnimData.entry_count; i++) {
-
 		cycle = PAnimData.entries[i].cycle;
 		cycle_limit = PAnimData.entries[i].color_count;
-
 		for (j = 0; j < PAnimData.entries[i].pal_count; j++) {
-
-			pal_index =
-			    (unsigned char)PAnimData.entries[i].pal_index[j];
+			pal_index = (unsigned char)PAnimData.entries[i].pal_index[j];
 			col_index = (cycle + j) % cycle_limit;
-
-			pal[pal_index].red =
-			    (byte) PAnimData.entries[i].colors[col_index].red;
-
-			pal[pal_index].green =
-			    (byte) PAnimData.entries[i].colors[col_index].
-			    green;
-
-			pal[pal_index].blue =
-			    (byte) PAnimData.entries[i].colors[col_index].
-			    blue;
+			pal[pal_index].red = (byte) PAnimData.entries[i].colors[col_index].red;
+			pal[pal_index].green = (byte) PAnimData.entries[i].colors[col_index].green;
+			pal[pal_index].blue = (byte) PAnimData.entries[i].colors[col_index].blue;
 		}
 
 		PAnimData.entries[i].cycle++;
@@ -228,12 +184,9 @@
 	EVENT_Queue(&event);
 
 	return R_SUCCESS;
-
 }
 
-int PALANIM_Free(void)
-{
-
+int PALANIM_Free() {
 	uint16 i;
 
 	if (!PAnimData.loaded) {
@@ -242,16 +195,13 @@
 
 	for (i = 0; i < PAnimData.entry_count; i++) {
 #if 0
-		R_printf(R_STDOUT,
-		    "PALANIM_Free(): Entry %d: Freeing colors.\n", i);
+		R_printf(R_STDOUT, "PALANIM_Free(): Entry %d: Freeing colors.\n", i);
 #endif
 		free(PAnimData.entries[i].colors);
 #if 0
-		R_printf(R_STDOUT,
-		    "PALANIM_Free(): Entry %d: Freeing indices.\n", i);
+		R_printf(R_STDOUT, "PALANIM_Free(): Entry %d: Freeing indices.\n", i);
 #endif
 		free(PAnimData.entries[i].pal_index);
-
 	}
 
 	R_printf(R_STDOUT, "PALANIM_Free(): Freeing entries.\n");

Index: palanim.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/palanim.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- palanim.h	30 Apr 2004 23:02:23 -0000	1.3
+++ palanim.h	1 May 2004 13:19:15 -0000	1.4
@@ -20,13 +20,8 @@
  * $Header$
  *
  */
-/*
- Description:	
- 
-	Palette animation module header file
 
- Notes: 
-*/
+// Palette animation module header file
 
 #ifndef SAGA_PALANIM_H
 #define SAGA_PALANIM_H
@@ -38,23 +33,17 @@
 #define PALANIM_CYCLETIME 100
 
 struct PALANIM_ENTRY {
-
 	uint16 pal_count;
 	uint16 color_count;
 	uint16 cycle;
-
 	byte *pal_index;
 	R_COLOR *colors;
-
 };
 
 struct PALANIM_DATA {
-
 	int loaded;
 	uint16 entry_count;
-
 	PALANIM_ENTRY *entries;
-
 };
 
 } // End of namespace Saga

Index: palanim_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/palanim_mod.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- palanim_mod.h	30 Apr 2004 23:02:23 -0000	1.2
+++ palanim_mod.h	1 May 2004 13:19:15 -0000	1.3
@@ -20,13 +20,9 @@
  * $Header$
  *
  */
-/*
- Description:	
- 
-	Palette animation module public header file
 
- Notes: 
-*/
+// Palette animation module public header file
+
 
 #ifndef SAGA_PALANIM_MOD_H__
 #define SAGA_PALANIM_MOD_H__
@@ -34,13 +30,10 @@
 namespace Saga {
 
 int PALANIM_Load(const byte *, size_t);
-
-int PALANIM_CycleStart(void);
-
+int PALANIM_CycleStart();
 int PALANIM_CycleStep(int vectortime);
-
-int PALANIM_Free(void);
+int PALANIM_Free();
 
 } // End of namespace Saga
 
-#endif				/* SAGA_PALANIM_MOD_H__ */
+#endif

Index: reinherit.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/reinherit.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- reinherit.h	1 May 2004 09:40:47 -0000	1.13
+++ reinherit.h	1 May 2004 13:19:15 -0000	1.14
@@ -20,13 +20,8 @@
  * $Header$
  *
  */
-/*
- Description:   
- 
-    Main Header File
 
- Notes: 
-*/
+// Main Header File
 
 #ifndef SAGA_REINHERIT_H_
 #define SAGA_REINHERIT_H_
@@ -37,9 +32,6 @@
 
 #include "base/engine.h"
 
-/*
- * Implementation conditionals
-\*--------------------------------------------------------------------------*/
 #define R_ENV_LINUX
 #include "sys_interface.h"
 
@@ -47,7 +39,7 @@
 
 #define R_MAXPATH 512
 
-/* For debug message processing */
+// For debug message processing
 #define R_DEBUG_NONE 0
 #define R_DEBUG_INFO 1
 #define R_DEBUG_VERBOSE 2
@@ -55,24 +47,19 @@
 
 #define R_MEMFAIL_MSG "Memory allocation error."
 
-/*
- * Define opaque types
-\*--------------------------------------------------------------------------*/
+// Define opaque types
 
-/* r_rscfile */
+// r_rscfile
 typedef struct R_RSCFILE_CONTEXT_tag R_RSCFILE_CONTEXT;
 
-/* r_script */
+// r_script
 typedef struct R_SEMAPHORE_tag R_SEMAPHORE;
 
-/*
- * Define common data types
-\*--------------------------------------------------------------------------*/
+// Define common data types
 
 typedef Common::Point R_POINT;
 typedef Common::Rect R_RECT;
 
-
 struct R_COLOR {
 	int red;
 	int green;
@@ -85,11 +72,8 @@
 	int buf_w;
 	int buf_h;
 	int buf_pitch;
-
 	int bpp;
-
 	R_RECT clip_rect;
-
 	void *impl_src;
 };
 
@@ -118,64 +102,47 @@
 	R_SUCCESS = 0
 };
 
+// r_transitions.c
+int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h,
+						int dst_p, const byte *src_img, int src_p, int flags, double percent);
 
-/*
- * r_transitions.c
-\*--------------------------------------------------------------------------*/
-int TRANSITION_Dissolve(byte *dst_img,
-    int dst_w,
-    int dst_h,
-    int dst_p, const byte *src_img, int src_p, int flags, double percent);
-
-/*--------------------------------------------------------------------------*\
- * System specific routines
-\*--------------------------------------------------------------------------*/
+// System specific routines
 
-/*
- * System : Graphics
-\*--------------------------------------------------------------------------*/
+// System : Graphics
 #define R_PAL_ENTRIES 256
 
 struct R_SYSGFX_INIT {
 	int backbuf_w;
 	int backbuf_h;
 	int backbuf_bpp;
-
 	int screen_w;
 	int screen_h;
 	int screen_bpp;
 };
 
 int SYSGFX_Init(R_SYSGFX_INIT *);
-
-R_SURFACE *SYSGFX_GetScreenSurface(void);
-R_SURFACE *SYSGFX_GetBackBuffer(void);
-
+R_SURFACE *SYSGFX_GetScreenSurface();
+R_SURFACE *SYSGFX_GetBackBuffer();
 int SYSGFX_LockSurface(R_SURFACE *surface);
 int SYSGFX_UnlockSurface(R_SURFACE *surface);
-
-int SYSGFX_GetWhite(void);
-int SYSGFX_GetBlack(void);
+int SYSGFX_GetWhite();
+int SYSGFX_GetBlack();
 int SYSGFX_MatchColor(unsigned long colormask);
 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_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent);
 
-/*
- * System : Input 
-\*--------------------------------------------------------------------------*/
+// System : Input 
 int SYSINPUT_Init(void);
 int SYSINPUT_ProcessInput(void);
 int SYSINPUT_GetMousePos(int *mouse_x, int *mouse_y);
 int SYSINPUT_HideMouse(void);
 int SYSINPUT_ShowMouse(void);
 
-/*** sys_signal.c ***/
+// sys_signal.c
 int ITESYS_CheckSignal(void);
 
 } // End of namespace Saga
 
-#endif				/* SAGA_REINHERIT_H_ */
+#endif

Index: resnames.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/resnames.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- resnames.h	12 Apr 2004 22:26:48 -0000	1.4
+++ resnames.h	1 May 2004 13:19:15 -0000	1.5
@@ -20,36 +20,30 @@
  * $Header$
  *
  */
-/*
-
- Description:   
- 
-    Descriptive names for game resource numbers
 
- Notes: 
-*/
+// Descriptive names for game resource numbers
 
 #ifndef SAGA_RESOURCENAMES_H_
 #define SAGA_RESOURCENAMES_H_
 
 namespace Saga {
 
-/* Lookup tables */
+// Lookup tables
 #define ITE_SCENE_LUT  1806
 #define ITE_SCRIPT_LUT 216
 
 #define IHNM_SCENE_LUT  1272
 #define IHNM_SCRIPT_LUT 0
 
-/* SCENES */
+// SCENES
 #define ITE_DEFAULT_SCENE 32
 
-/* FONTS */
+// FONTS
 #define RN_MEDIUM_FONT 0
 #define RN_BIG_FONT 1
 #define RN_SMALL_FONT 2
 
-/* INTERFACE IMAGES */
+// INTERFACE IMAGES
 #define ITE_COMMAND_PANEL 3
 #define ITE_DIALOGUE_PANEL 4
 
@@ -60,7 +54,7 @@
 #define ITE_COMMAND_BUTTONSPRITES 7
 #define ITE_DEFAULT_PORTRAITS 125
 
-/* ITE Scene resource numbers */
+// ITE Scene resource numbers
 #define ITE_INTRO_ANIM_SCENE 1538
 #define ITE_CAVE_SCENE_1 1542
 #define ITE_CAVE_SCENE_2 1545
@@ -92,7 +86,7 @@
 #define INTRO_IMG_3 1561
 #define INTRO_IMG_4 1565
 
-/* ITE_VOICES */
+// ITE_VOICES
 #define CAVE_VOICE_0 0
 #define CAVE_VOICE_1 1
 #define CAVE_VOICE_2 2
@@ -108,7 +102,7 @@
 #define CAVE_VOICE_12 12
 #define CAVE_VOICE_13 13
 
-/* MUSIC */
+// MUSIC
 #define MUSIC_1 9
 #define MUSIC_2 10
 #define MUSIC_3 11
@@ -138,4 +132,4 @@
 
 } // End of namespace Saga
 
-#endif				/* SAGA_RESOURCENAMES_H_ */
+#endif

Index: rscfile.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/rscfile.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rscfile.cpp	30 Apr 2004 23:02:23 -0000	1.3
+++ rscfile.cpp	1 May 2004 13:19:15 -0000	1.4
@@ -20,33 +20,19 @@
  * $Header$
  *
  */
-/*
-
- Description:   
- 
-    RSC Resource file management module
 
- Notes: 
-*/
+// RSC Resource file management module
 
 #include "reinherit.h"
 
 #include "yslib.h"
 
-/*
- * Uses the following modules:
-\*--------------------------------------------------------------------------*/
-
-/*
- * Begin module
-\*--------------------------------------------------------------------------*/
 #include "rscfile_mod.h"
 #include "rscfile.h"
 
 namespace Saga {
 
-R_RSCFILE_CONTEXT *RSC_CreateContext(void)
-{
+R_RSCFILE_CONTEXT *RSC_CreateContext() {
 	R_RSCFILE_CONTEXT empty_context;
 	empty_context.rc_file_fspec = NULL;
 	empty_context.rc_file_loaded = 0;
@@ -64,14 +50,12 @@
 	return new_context;
 }
 
-int RSC_OpenContext(R_RSCFILE_CONTEXT *rsc_context, const char *fspec)
-{
+int RSC_OpenContext(R_RSCFILE_CONTEXT *rsc_context, const char *fspec) {
 	if (rsc_context->rc_file.isOpen()) {
 		return R_FAILURE;
 	}
 
 	if (!rsc_context->rc_file.open(fspec)) {
-
 		return R_FAILURE;
 	}
 
@@ -86,8 +70,7 @@
 	return R_SUCCESS;
 }
 
-int RSC_CloseContext(R_RSCFILE_CONTEXT * rsc_context)
-{
+int RSC_CloseContext(R_RSCFILE_CONTEXT *rsc_context) {
 	if (rsc_context->rc_file.isOpen()) {
 		rsc_context->rc_file.close();
 	}
@@ -99,8 +82,7 @@
 	return R_SUCCESS;
 }
 
-int RSC_DestroyContext(R_RSCFILE_CONTEXT * rsc_context)
-{
+int RSC_DestroyContext(R_RSCFILE_CONTEXT *rsc_context) {
 	RSC_CloseContext(rsc_context);
 
 	if (rsc_context->rc_file_loaded) {
@@ -112,8 +94,7 @@
 	return R_SUCCESS;
 }
 
-int RSC_LoadRSC(R_RSCFILE_CONTEXT * rsc)
-{
+int RSC_LoadRSC(R_RSCFILE_CONTEXT *rsc) {
 	uint32 res_tbl_ct;
 	uint32 res_tbl_offset;
 
@@ -132,8 +113,7 @@
 		return R_FAILURE;
 	}
 
-	/* Read resource table info from the rear end of file
-	 * \*------------------------------------------------------------- */
+	// Read resource table info from the rear end of file
 	rsc->rc_file.seek((long)(rsc->rc_file.size() - 8), SEEK_SET);
 
 	if (rsc->rc_file.read(tblinfo_buf, RSC_TABLEINFO_SIZE) != RSC_TABLEINFO_SIZE) {
@@ -143,16 +123,13 @@
 	res_tbl_offset = ys_read_u32_le(read_p, &read_p);
 	res_tbl_ct = ys_read_u32_le(read_p, NULL);
 
-	/* Check for sane table offset
-	 * \*------------------------------------------------------------- */
-	if (res_tbl_offset != rsc->rc_file.size() - RSC_TABLEINFO_SIZE -
-	    RSC_TABLEENTRY_SIZE * res_tbl_ct) {
+	// Check for sane table offset
+	if (res_tbl_offset != rsc->rc_file.size() - RSC_TABLEINFO_SIZE - RSC_TABLEENTRY_SIZE * res_tbl_ct) {
 
 		return R_FAILURE;
 	}
 
-	/* Load resource table
-	 * \*------------------------------------------------------------- */
+	// Load resource table
 	tbl_len = RSC_TABLEENTRY_SIZE * res_tbl_ct;
 
 	tbl_buf = (byte *)malloc(tbl_len);
@@ -176,13 +153,9 @@
 	read_p = tbl_buf;
 
 	for (i = 0; i < res_tbl_ct; i++) {
-
 		rsc_restbl[i].res_offset = ys_read_u32_le(read_p, &read_p);
 		rsc_restbl[i].res_size = ys_read_u32_le(read_p, &read_p);
-
-		if ((rsc_restbl[i].res_offset > rsc->rc_file.size()) ||
-		    (rsc_restbl[i].res_size > rsc->rc_file.size())) {
-
+		if ((rsc_restbl[i].res_offset > rsc->rc_file.size()) || (rsc_restbl[i].res_size > rsc->rc_file.size())) {
 			free(tbl_buf);
 			free(rsc_restbl);
 			return R_FAILURE;
@@ -197,8 +170,7 @@
 	return R_SUCCESS;
 }
 
-int RSC_FreeRSC(R_RSCFILE_CONTEXT * rsc)
-{
+int RSC_FreeRSC(R_RSCFILE_CONTEXT *rsc) {
 	if (!rsc->rc_file_loaded) {
 		return R_FAILURE;
 	}
@@ -208,14 +180,11 @@
 	return R_SUCCESS;
 }
 
-uint32 RSC_GetResourceCount(R_RSCFILE_CONTEXT * rsc)
-{
+uint32 RSC_GetResourceCount(R_RSCFILE_CONTEXT *rsc) {
 	return (rsc == NULL) ? 0 : rsc->rc_res_ct;
 }
 
-int
-RSC_GetResourceSize(R_RSCFILE_CONTEXT * rsc, uint32 res_num, uint32 * res_size)
-{
+int RSC_GetResourceSize(R_RSCFILE_CONTEXT *rsc, uint32 res_num, uint32 *res_size) {
 	if ((rsc == NULL) || (res_size == NULL)) {
 		return R_FAILURE;
 	}
@@ -229,10 +198,7 @@
 	return R_SUCCESS;
 }
 
-int
-RSC_GetResourceOffset(R_RSCFILE_CONTEXT * rsc,
-    uint32 res_num, uint32 * res_offset)
-{
+int RSC_GetResourceOffset(R_RSCFILE_CONTEXT *rsc, uint32 res_num, uint32 *res_offset) {
 	if ((rsc == NULL) || (res_offset == NULL)) {
 		return R_FAILURE;
 	}
@@ -246,10 +212,7 @@
 	return R_SUCCESS;
 }
 
-int
-RSC_LoadResource(R_RSCFILE_CONTEXT * rsc,
-    uint32 res_num, byte ** res_p, size_t * res_size_p)
-{
+int RSC_LoadResource(R_RSCFILE_CONTEXT *rsc, uint32 res_num, byte **res_p, size_t *res_size_p) {
 	uint32 res_offset;
 	size_t res_size;
 	byte *res_buf;
@@ -286,9 +249,7 @@
 	return R_SUCCESS;
 }
 
-int RSC_FreeResource(byte * resource_ptr)
-{
-
+int RSC_FreeResource(byte *resource_ptr) {
 	free(resource_ptr);
 
 	return R_SUCCESS;

Index: rscfile.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/rscfile.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rscfile.h	25 Apr 2004 14:42:14 -0000	1.3
+++ rscfile.h	1 May 2004 13:19:15 -0000	1.4
@@ -20,14 +20,8 @@
  * $Header$
  *
  */
-/*
-
- Description:   
- 
-    RSC Resource file management header file
 
- Notes: 
-*/
+// RSC Resource file management header file
 
 #ifndef SAGA_RSCFILE_H__
 #define SAGA_RSCFILE_H__
@@ -42,29 +36,22 @@
 #define RSC_MIN_FILESIZE (RSC_TABLEINFO_SIZE + RSC_TABLEENTRY_SIZE + 1)
 
 struct R_RSCFILE_RESOURCE {
-
 	int res_type;
-
 	size_t res_offset;
 	size_t res_size;
-
 };
 
 struct R_RSCFILE_CONTEXT_tag {
-
 	const char *rc_file_fspec;
 	File rc_file;
-
 	int rc_file_loaded;
 	R_RSCFILE_RESOURCE *rc_res_table;
 	size_t rc_res_ct;
-
 };
 
-int RSC_LoadRSC(R_RSCFILE_CONTEXT * rsc_context);
-
-int RSC_FreeRSC(R_RSCFILE_CONTEXT * rsc);
+int RSC_LoadRSC(R_RSCFILE_CONTEXT *rsc_context);
+int RSC_FreeRSC(R_RSCFILE_CONTEXT *rsc);
 
 } // End of namespace Saga
 
-#endif				/* SAGA_RSCFILE_H__ */
+#endif

Index: rscfile_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/rscfile_mod.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rscfile_mod.h	30 Apr 2004 23:02:23 -0000	1.2
+++ rscfile_mod.h	1 May 2004 13:19:15 -0000	1.3
@@ -20,14 +20,8 @@
  * $Header$
  *
  */
-/*
-
- Description:   
- 
-    RSC Resource file management module public header file
 
- Notes: 
-*/
+// RSC Resource file management module public header file
 
 #ifndef SAGA_RSCFILE_MOD_H__
 #define SAGA_RSCFILE_MOD_H__
@@ -36,24 +30,16 @@
 
 namespace Saga {
 
-R_RSCFILE_CONTEXT *RSC_CreateContext(void);
-
+R_RSCFILE_CONTEXT *RSC_CreateContext();
 int RSC_DestroyContext(R_RSCFILE_CONTEXT *);
-
 int RSC_OpenContext(R_RSCFILE_CONTEXT *, const char *);
-
 int RSC_CloseContext(R_RSCFILE_CONTEXT *);
-
 uint32 RSC_GetResourceCount(R_RSCFILE_CONTEXT *);
-
 int RSC_GetResourceSize(R_RSCFILE_CONTEXT *, uint32, uint32 *);
-
 int RSC_GetResourceOffset(R_RSCFILE_CONTEXT *, uint32, uint32 *);
-
 int RSC_LoadResource(R_RSCFILE_CONTEXT *, uint32, byte **, size_t *);
-
 int RSC_FreeResource(byte *);
 
 } // End of namespace Saga
 
-#endif				/* SAGA_RSCFILE_MOD_H__ */
+#endif

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- saga.cpp	29 Apr 2004 05:13:18 -0000	1.14
+++ saga.cpp	1 May 2004 13:19:15 -0000	1.15
@@ -71,7 +71,7 @@
 
 static const SAGAGameSettings saga_settings[] = {
 	/* Inherit the Earth - Original floppy version */
-  	{ "ite", "Inherit the Earth (DOS)", Saga::GID_ITE,
+	{ "ite", "Inherit the Earth (DOS)", Saga::GID_ITE,
 	 MDT_ADLIB, "ite.rsc" },
 	/* Inherit the Earth - CD version */
 	{ "itecd", "Inherit the Earth (DOS CD Version)", Saga::GID_ITECD,
@@ -96,7 +96,7 @@
 DetectedGameList Engine_SAGA_detectGames(const FSList &fslist) {
 	DetectedGameList detectedGames;
 	const SAGAGameSettings *g;
-	
+
 	for (g = saga_settings; g->name; ++g) {
 		// Iterate over all files in the given directory
 		for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
@@ -123,10 +123,8 @@
 #define R_MAX_TIME_DELTA 100
 
 struct R_MAIN_DATA {
-
 	int sound_enabled;
 	int music_enabled;
-
 };
 
 static void CF_quitfunc(int argc, char *argv[]);
@@ -152,7 +150,6 @@
 }
 
 SagaEngine::~SagaEngine() {
-
 }
 
 void SagaEngine::errorString(const char *buf1, char *buf2) {
@@ -162,9 +159,8 @@
 void SagaEngine::go() {
 	int msec = 0;
 
-	/* Register engine modules
-	 * \*------------------------------------------------------------- */
-	CON_Register();		/* Register console cvars first */
+	// Register engine modules
+	CON_Register(); // Register console cvars first
 
 	RENDER_Register();
 	GAME_Register();
@@ -179,19 +175,15 @@
 	MainData.sound_enabled = 1;
 	MainData.music_enabled = 1;
 
-	CVAR_RegisterFunc(CF_testfunc,
-	    "testfunc", "foo [ optional foo ]", R_CVAR_NONE, 0, -1);
+	CVAR_RegisterFunc(CF_testfunc, "testfunc", "foo [ optional foo ]", R_CVAR_NONE, 0, -1);
 
-	CVAR_Register_I(&MainData.sound_enabled,
-	    "sound", NULL, R_CVAR_CFG, 0, 1);
+	CVAR_Register_I(&MainData.sound_enabled, "sound", NULL, R_CVAR_CFG, 0, 1);
 
-	CVAR_Register_I(&MainData.music_enabled,
-	    "music", NULL, R_CVAR_CFG, 0, 1);
+	CVAR_Register_I(&MainData.music_enabled, "music", NULL, R_CVAR_CFG, 0, 1);
 
 	CVAR_RegisterFunc(CF_quitfunc, "quit", NULL, R_CVAR_NONE, 0, 0);
 
-	/* Process config file
-	 * \*------------------------------------------------------------- */
+	// Process config file
 	// FIXME
 	/*
 	if (CFG_Read(NULL) != R_SUCCESS) {
@@ -199,21 +191,15 @@
 	}
 	*/
 
-	/* Process command line
-	 * \*------------------------------------------------------------- */
+	// Process command line
 
-	/* Detect game and open resource files
-	 * \*------------------------------------------------------------- */
+	// Detect game and open resource files
 	if (GAME_Init() != R_SUCCESS) {
-
-		R_printf(R_STDERR,
-		    "Couldn't start the game: %s\n", GAME_GetErrS());
-
+		R_printf(R_STDERR, "Couldn't start the game: %s\n", GAME_GetErrS());
 		return;
 	}
 
-	/* Initialize engine modules
-	 * \*------------------------------------------------------------- */
+	// Initialize engine modules
 	_sndRes = new SndRes(this);
 	EVENT_Init();
 	FONT_Init();
@@ -223,27 +209,24 @@
 	OBJECTMAP_Init();
 	ISOMAP_Init();
 	SCRIPT_Init();
-	INTERFACE_Init();	/* requires script module */
+	INTERFACE_Init(); // requires script module
 	ACTOR_Init();
 
 	if (SCENE_Init() != R_SUCCESS) {
-
 		R_printf(R_STDERR, "Couldn't initialize scene module.\n");
 		return;
 	}
 
-	/* System initialization
-	 * \*------------------------------------------------------------- */
+	// System initialization
 
-	/* Must initialize system timer module first */
+	// Must initialize system timer module first
 	if (SYSTIMER_InitMSCounter() != R_SUCCESS) {
-
 		return;
 	}
 
-	/* On some platforms, graphics initialization also initializes sound
-	 * ( Win32 DirectX )... Music must be initialized before sound for 
-	 * native midi support */
+	// On some platforms, graphics initialization also initializes sound
+	// ( Win32 DirectX )... Music must be initialized before sound for 
+	// native midi support
 	MidiDriver *driver = GameDetector::createMidi(GameDetector::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE));
 	if (!driver)
 		driver = MidiDriver_ADLIB_create(_mixer);
@@ -257,12 +240,12 @@
 		R_printf(R_STDOUT, "Music disabled.\n");
 	}
 
-	/* Initialize graphics */
+	// Initialize graphics
 	if (RENDER_Init() != R_SUCCESS) {
 		return;
 	}
 
-	/* Initialize system specific sound */
+	// Initialize system specific sound
 	_sound = new Sound(this, _mixer, MainData.sound_enabled);
 	if (!MainData.sound_enabled) {
 		R_printf(R_STDOUT, "Sound disabled.\n");
@@ -272,44 +255,32 @@
 
 	SYSTIMER_ResetMSCounter();
 
-	/* Begin Main Engine Loop
-	 * \*------------------------------------------------------------- */
+	// Begin Main Engine Loop
 
 	SCENE_Start();
 
 	for (;;) {
-
 #ifdef R_USE_CUSTOM_WININIT
-
 		if (ITESYS_CheckSignal()) {
 			break;
 		}
 #endif
-
 		if (RENDER_GetFlags() & RF_RENDERPAUSE) {
-			/* Freeze time while paused */
+			// Freeze time while paused
 			SYSTIMER_ResetMSCounter();
 		} else {
 			msec = SYSTIMER_ReadMSCounter();
-
 			if (msec > R_MAX_TIME_DELTA) {
 				msec = R_MAX_TIME_DELTA;
 			}
-
 			ACTOR_Direct(msec);
 			EVENT_HandleEvents(msec);
 			STHREAD_ExecThreads(msec);
 		}
-
-		/* Per frame processing
-		 * \*--------------------------------------------------------- */
+		// Per frame processing
 		RENDER_DrawScene();
-
 		SYSTIMER_Sleep(0);
-
-	}			/* end main game engine loop */
-
-	return;
+	}
 }
 
 void SagaEngine::shutdown() {
@@ -319,30 +290,25 @@
 	ANIM_Shutdown();
 	SPRITE_Shutdown();
 	OBJECTMAP_Shutdown();
-
 	FONT_Shutdown();
-
 	CON_Shutdown();
 	CVAR_Shutdown();
 	EVENT_Shutdown();
 
 	delete _sndRes;
-
-	/* Shutdown system modules */
+	// Shutdown system modules */
 	delete _music;
 	delete _sound;
 
 	_system->quit();
 }
 
-static void CF_quitfunc(int argc, char *argv[])
-{
+static void CF_quitfunc(int argc, char *argv[]) {
 	_vm->shutdown();
 	exit(0);
 }
 
-static void CF_testfunc(int argc, char *argv[])
-{
+static void CF_testfunc(int argc, char *argv[]) {
 	int i;
 
 	CON_Print("Test function invoked: Got %d arguments.", argc);
@@ -350,8 +316,6 @@
 	for (i = 0; i < argc; i++) {
 		CON_Print("Arg %d: %s", i, argv[i]);
 	}
-
-	return;
 }
 
 } // End of namespace Saga

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- saga.h	29 Apr 2004 03:52:59 -0000	1.8
+++ saga.h	1 May 2004 13:19:15 -0000	1.9
@@ -49,18 +49,18 @@
 class SagaEngine:public Engine {
 	void errorString(const char *buf_input, char *buf_output);
 
- protected:
+protected:
 	void go();
 
- public:
+public:
 	SagaEngine(GameDetector * detector, OSystem * syst);
 	virtual ~SagaEngine();
 
 	void shutdown();
 
 	SndRes *_sndRes;
-	Sound  *_sound;
-	Music  *_music;
+	Sound *_sound;
+	Music *_music;
 };
 
 // FIXME: Global var. We use it until everything will be turned into objects





More information about the Scummvm-git-logs mailing list