[Scummvm-cvs-logs] CVS: scummvm/saga binread.cpp,1.1,1.2 gamedesc.cpp,1.2,1.3 gamedesc.h,1.1,1.2 resfile.cpp,1.1,1.2 resfile.h,1.1,1.2

Eugene Sandulenko sev at users.sourceforge.net
Sun Mar 14 18:37:02 CET 2004


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

Modified Files:
	binread.cpp gamedesc.cpp gamedesc.h resfile.cpp resfile.h 
Log Message:
Code formatting


Index: binread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/binread.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- binread.cpp	14 Mar 2004 23:39:41 -0000	1.1
+++ binread.cpp	15 Mar 2004 01:14:48 -0000	1.2
@@ -30,7 +30,7 @@
 	_bufLen = 0;
 }
 
-BinReader::BinReader( const byte *buf, size_t buflen ) {
+BinReader::BinReader(const byte *buf, size_t buflen) {
 	_buf    = buf;
 	_bufPtr = buf;
 	_bufEnd = buf + buflen;
@@ -38,29 +38,25 @@
 }
 
 BinReader::~BinReader() {
-
 }
 
-void BinReader::setBuf( const byte *buf, size_t buflen )
-{
+void BinReader::setBuf(const byte *buf, size_t buflen) {
 	_buf    = buf;
 	_bufPtr = buf;
 	_bufEnd = buf + buflen;
 	_bufLen = buflen;
 }
 
-void BinReader::skip( size_t skip_ct )
-{
-	assert(( _bufPtr + skip_ct ) <= _bufEnd );
+void BinReader::skip(size_t skip_ct) {
+	assert((_bufPtr + skip_ct) <= _bufEnd );
 
 	_bufPtr += skip_ct;
 }
 
 unsigned int BinReader::readUint16LE() {
+	assert((_bufPtr + 2) <= _bufEnd);
 	
-	assert(( _bufPtr + 2 ) <= _bufEnd );
-	
-	unsigned int u16_le = ((unsigned int)_bufPtr[1] << 8 ) | _bufPtr[0];
+	unsigned int u16_le = ((unsigned int)_bufPtr[1] << 8) | _bufPtr[0];
 
 	_bufPtr += 2;
 
@@ -68,10 +64,9 @@
 }
 
 unsigned int BinReader::readUint16BE() {
+	assert((_bufPtr + 2) <= _bufEnd);
 
-	assert(( _bufPtr + 2 ) <= _bufEnd );
-
-	unsigned int u16_be = ((unsigned int)_bufPtr[0] << 8 ) | _bufPtr[1];
+	unsigned int u16_be = ((unsigned int)_bufPtr[0] << 8) | _bufPtr[1];
  
 	_bufPtr += 2;
 	    
@@ -79,10 +74,9 @@
 }
 
 int BinReader::readSint16LE() {
+	assert((_bufPtr + 2) <= _bufEnd);
 
-	assert(( _bufPtr + 2 ) <= _bufEnd );
-
-	unsigned int u16_le = ((unsigned int)_bufPtr[1] << 8 ) | _bufPtr[0];
+	unsigned int u16_le = ((unsigned int)_bufPtr[1] << 8) | _bufPtr[0];
 
 	_bufPtr += 2;
 
@@ -90,10 +84,9 @@
 }
 
 int BinReader::readSint16BE() {
+	assert((_bufPtr + 2) <= _bufEnd);
 
-	assert(( _bufPtr + 2 ) <= _bufEnd );
-
-	unsigned int u16_be = ((unsigned int)_bufPtr[0] << 8 ) | _bufPtr[1];
+	unsigned int u16_be = ((unsigned int)_bufPtr[0] << 8) | _bufPtr[1];
  
 	_bufPtr += 2;
 	    
@@ -101,14 +94,12 @@
 }
 
 
-uint32 BinReader::readUint32LE()
-{
-
-	assert(( _bufPtr + 4 ) <= _bufEnd );
+uint32 BinReader::readUint32LE() {
+	assert((_bufPtr + 4) <= _bufEnd);
 
-	unsigned long u32_le = ((unsigned long)_bufPtr[3] << 24 ) | 
-	                       ((unsigned long)_bufPtr[2] << 16 ) |
-	                       ((unsigned long)_bufPtr[1] << 8  ) |
+	unsigned long u32_le = ((unsigned long)_bufPtr[3] << 24) | 
+	                       ((unsigned long)_bufPtr[2] << 16) |
+	                       ((unsigned long)_bufPtr[1] << 8 ) |
 	                       _bufPtr[0];
 
 	_bufPtr += 4;
@@ -116,14 +107,12 @@
 	return u32_le;
 }
 
-uint32 BinReader::readUint32BE()
-{
-
-	assert(( _bufPtr + 4 ) <= _bufEnd );
+uint32 BinReader::readUint32BE() {
+	assert((_bufPtr + 4) <= _bufEnd);
 
-	unsigned long u32_be = ((unsigned long)_bufPtr[0] << 24 ) | 
-	                       ((unsigned long)_bufPtr[1] << 16 ) |
-	                       ((unsigned long)_bufPtr[2] << 8  ) |
+	unsigned long u32_be = ((unsigned long)_bufPtr[0] << 24) | 
+	                       ((unsigned long)_bufPtr[1] << 16) |
+	                       ((unsigned long)_bufPtr[2] << 8 ) |
 	                       _bufPtr[3];
 
 	_bufPtr += 4;
@@ -131,14 +120,12 @@
 	return u32_be;
 }
 
-int32 BinReader::readSint32LE()
-{
-
-	assert(( _bufPtr + 4 ) <= _bufEnd );
+int32 BinReader::readSint32LE() {
+	assert((_bufPtr + 4) <= _bufEnd);
 
-	unsigned long u32_le = ((unsigned long)_bufPtr[3] << 24 ) | 
-	                       ((unsigned long)_bufPtr[2] << 16 ) |
-	                       ((unsigned long)_bufPtr[1] << 8  ) |
+	unsigned long u32_le = ((unsigned long)_bufPtr[3] << 24) | 
+	                       ((unsigned long)_bufPtr[2] << 16) |
+	                       ((unsigned long)_bufPtr[1] << 8 ) |
 	                       _bufPtr[0];
 
 	_bufPtr += 4;
@@ -146,14 +133,12 @@
 	return u32_le;
 }
 
-int32 BinReader::readSint32BE()
-{
-
-	assert(( _bufPtr + 4 ) <= _bufEnd );
+int32 BinReader::readSint32BE() {
+	assert((_bufPtr + 4) <= _bufEnd);
 
-	unsigned long u32_be = ((unsigned long)_bufPtr[0] << 24 ) | 
-	                       ((unsigned long)_bufPtr[1] << 16 ) |
-	                       ((unsigned long)_bufPtr[2] << 8  ) |
+	unsigned long u32_be = ((unsigned long)_bufPtr[0] << 24) | 
+	                       ((unsigned long)_bufPtr[1] << 16) |
+	                       ((unsigned long)_bufPtr[2] << 8 ) |
 	                       _bufPtr[3];
 
 	_bufPtr += 4;

Index: gamedesc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gamedesc.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gamedesc.cpp	15 Mar 2004 00:29:46 -0000	1.2
+++ gamedesc.cpp	15 Mar 2004 01:14:49 -0000	1.3
@@ -38,7 +38,6 @@
 \*--------------------------------------------------------------------------*/
 
 R_GAME_FILEDESC ITEDEMO_GameFiles[] = {
-
 	{ "ITE.RSC",	 R_GAME_RESOURCEFILE },
 	{ "ITE.DMO",	 R_GAME_DEMOFILE	 },
 	{ "SCRIPTS.RSC", R_GAME_SCRIPTFILE	 },
@@ -46,13 +45,11 @@
 };
 
 R_GAME_FONTDESC ITEDEMO_GameFonts[] = {
-	
 	{ R_GAME_FONT_SMALL,  0 },
 	{ R_GAME_FONT_MEDIUM, 1 }
 };
 
 R_GAME_SOUNDINFO ITEDEMO_GameSound = {
-
 	R_GAME_SOUND_VOC, 0, 0, 0
 };
 
@@ -61,28 +58,24 @@
 \*--------------------------------------------------------------------------*/
 
 R_GAME_FILEDESC ITEDISK_GameFiles[] = {
-
 	{ "ITE.RSC",	 R_GAME_RESOURCEFILE },
 	{ "SCRIPTS.RSC", R_GAME_SCRIPTFILE	 },
 	{ "VOICES.RSC",  R_GAME_SOUNDFILE | R_GAME_VOICEFILE }
 };
 
 R_GAME_FONTDESC ITEDISK_GameFonts[] = {
-	
 	{ R_GAME_FONT_MEDIUM, 0 },
 	{ R_GAME_FONT_LARGE,  1 },
 	{ R_GAME_FONT_SMALL,  2 }
 };
 
 R_GAME_DISPLAYINFO ITE_DisplayInfo = {
-
 	320, 200,  /* Logical width and height */
 	137,       /* Scene playfield height */
 	0, 0       /* Overlay palette start index and length */
 };
 
-R_GAME_RESOURCEINFO ITE_Resources =
-{
+R_GAME_RESOURCEINFO ITE_Resources = {
 	ITE_SCENE_LUT,  /* Scene lookup table RN */
 	ITE_SCRIPT_LUT, /* Script lookup table RN */
 	
@@ -98,7 +91,6 @@
 };
 
 R_GAME_SOUNDINFO ITE_GameSound = {
-
 	R_GAME_SOUND_VOC, 0, 0, 0
 };
 
@@ -107,7 +99,6 @@
 \*--------------------------------------------------------------------------*/
 
 R_GAME_FILEDESC  ITECD_GameFiles[] = {
-
 	{ "ITE.RSC",	 R_GAME_RESOURCEFILE },
 	{ "SCRIPTS.RSC", R_GAME_SCRIPTFILE	 },
 	{ "SOUNDS.RSC",  R_GAME_SOUNDFILE	 },
@@ -115,14 +106,12 @@
 };
 
 R_GAME_FONTDESC ITECD_GameFonts[] = {
-	
 	{ R_GAME_FONT_MEDIUM, 0 },
 	{ R_GAME_FONT_LARGE,  1 },
 	{ R_GAME_FONT_SMALL,  2 }
 };
 
 R_GAME_SOUNDINFO ITECD_GameSound = {
-
 	R_GAME_SOUND_PCM,
 	22050,
 	16,
@@ -134,7 +123,6 @@
 \*--------------------------------------------------------------------------*/
 
 R_GAME_FILEDESC IHNMDEMO_GameFiles[] = {
-
 	{ "SCREAM.RES",  R_GAME_RESOURCEFILE },
 	{ "SCRIPTS.RES", R_GAME_SCRIPTFILE	 },
 	{ "SFX.RES",	 R_GAME_SOUNDFILE	 },
@@ -146,7 +134,6 @@
 \*--------------------------------------------------------------------------*/
 
 R_GAME_FILEDESC IHNMCD_GameFiles[] = {
-	
 	{ "MUSICFM.RES", R_GAME_MUSICFILE	 },
 	{ "MUSICGM.RES", R_GAME_MUSICFILE	 },
 	{ "SCREAM.RES",  R_GAME_RESOURCEFILE },
@@ -162,7 +149,6 @@
 };
 
 R_GAME_FONTDESC IHNMCD_GameFonts[] = {
-	
 	{ R_GAME_FONT_MEDIUM,	2 },
 	{ R_GAME_FONT_LARGE,	3 },
 	{ R_GAME_FONT_SMALL,	4 },
@@ -173,14 +159,12 @@
 };
 
 R_GAME_DISPLAYINFO IHNM_DisplayInfo = {
-
 	640, 480, /* Logical width and height */
 	304,      /* Scene playfield height */
 	248, 255  /* Overlay palette start index and length */
 };
 
-R_GAME_RESOURCEINFO IHNM_Resources[] =
-{
+R_GAME_RESOURCEINFO IHNM_Resources[] = {
 	IHNM_SCENE_LUT,  /* Scene lookup table RN */
 	IHNM_SCRIPT_LUT, /* Script lookup table RN */
 	
@@ -197,12 +181,10 @@
 
 
 R_GAME_SOUNDINFO IHNM_GameSound = {
-
 	R_GAME_SOUND_WAV, 0, 0, 0
 };
 
 R_GAMEDESC GameDescs[] = {
-
 	/* Inherit the earth - Demo version
 	\*-------------------------------------------------------------*/
 	{ 
@@ -216,10 +198,10 @@
  
 		&ITE_Resources,
 
-		ARRAYSIZE( ITEDEMO_GameFiles ), /* Game datafiles */
+		ARRAYSIZE(ITEDEMO_GameFiles), /* Game datafiles */
 		ITEDEMO_GameFiles,
 
-		ARRAYSIZE( ITEDEMO_GameFonts ),
+		ARRAYSIZE(ITEDEMO_GameFonts),
 		ITEDEMO_GameFonts,
 	 
 		&ITEDEMO_GameSound,
@@ -240,10 +222,10 @@
 
 		&ITE_Resources,
 
-		ARRAYSIZE( ITEDISK_GameFiles ), 	
+		ARRAYSIZE(ITEDISK_GameFiles), 	
 		ITEDISK_GameFiles, 
 	  
-		ARRAYSIZE( ITEDISK_GameFonts ),
+		ARRAYSIZE(ITEDISK_GameFonts),
 		ITEDISK_GameFonts,
 	  
 		&ITE_GameSound,
@@ -288,7 +270,7 @@
 
 		IHNM_Resources,
 	  
-		ARRAYSIZE( IHNMDEMO_GameFiles ),
+		ARRAYSIZE(IHNMDEMO_GameFiles),
 		IHNMDEMO_GameFiles,
 
 		0,
@@ -312,10 +294,10 @@
 
 		IHNM_Resources,
 
-		ARRAYSIZE( IHNMCD_GameFiles ),
+		ARRAYSIZE(IHNMCD_GameFiles),
 		IHNMCD_GameFiles,
 
-		ARRAYSIZE( IHNMCD_GameFonts ),
+		ARRAYSIZE(IHNMCD_GameFonts),
 		IHNMCD_GameFonts,
 
 		&IHNM_GameSound,
@@ -326,17 +308,15 @@
 
 static R_GAMEMODULE GameModule;
 
-void SagaGameDesc::setGameDirectory( const char *gamedir ) {
-
-	assert( gamedir != NULL );
+void SagaGameDesc::setGameDirectory(const char *gamedir) {
+	assert(gamedir != NULL);
 
-	debug( 1, "Using game data path: %s", gamedir );
+	debug(1, "Using game data path: %s", gamedir);
 
 	GameModule.game_dir = gamedir;
 }
 
 int SagaGameDesc::detectGame() {
-
 	File test_file;
 
 	bool disqualified = false;
@@ -347,12 +327,11 @@
 	const char *file_name;
 
 	int game_n;
-	int game_ct = ARRAYSIZE( GameDescs );
-
-	assert( GameModule.game_dir != NULL );
+	int game_ct = ARRAYSIZE(GameDescs);
 
-	for( game_n = 0 ; game_n < game_ct ; game_n++ ) {
+	assert(GameModule.game_dir != NULL);
 
+	for (game_n = 0; game_n < game_ct; game_n++) {
 		disqualified = false;
 		
 		/* Attempt to open all files for this game
@@ -361,10 +340,9 @@
 		 */
 		file_ct = GameDescs[game_n].gd_filect;
 		
-		for( file_n = 0; file_n < file_ct; file_n++ ) {
-			
+		for (file_n = 0; file_n < file_ct; file_n++) {
 			file_name = GameDescs[game_n].gd_filedescs[file_n].gf_fname;
-			if( !test_file.open( file_name, GameModule.game_dir )) {
+			if (!test_file.open(file_name, GameModule.game_dir)) {
 				disqualified = true;
 				break;
 			}
@@ -372,11 +350,11 @@
 			test_file.close();
 		}
 
-		if ( disqualified ) {
+		if (disqualified) {
 			continue;
 		}
 
-		switch ( GameDescs[game_n].gd_game_id ) {
+		switch (GameDescs[game_n].gd_game_id) {
 
 		case R_GAME_ITE_DEMO:
 			disqualified = !verifyITEDEMO();
@@ -389,15 +367,14 @@
 			break;
 		}
 
-		if( !disqualified ) {
+		if (!disqualified) {
 			found_game = true;
 			break;
 		}
 	}
 
-	if( found_game ) {
-
-		debug( 1, "Found SAGA game: %s\n", GameDescs[game_n].gd_title );
+	if (found_game) {
+		debug(1, "Found SAGA game: %s\n", GameDescs[game_n].gd_title);
 		return game_n;
 	}
 	
@@ -405,23 +382,22 @@
 }
 
 bool SagaGameDesc::openGame() {
-
 	int game_filect;
 
-	if(( GameModule.game_index = detectGame() ) < 0 ) { 
-		error( "Couldn't locate any valid SAGA games" );	
+	if ((GameModule.game_index = detectGame()) < 0) { 
+		error("Couldn't locate any valid SAGA games");	
 		return false;
 	}
 
-	assert( GameModule.game_index < ARRAYSIZE(GameDescs));
+	assert(GameModule.game_index < ARRAYSIZE(GameDescs));
 
-	if( !GameModule.game_dir ) {
+	if (!GameModule.game_dir) {
 		return false;
 	}
 
-	game_filect = GameDescs[ GameModule.game_index ].gd_filect;
+	game_filect = GameDescs[GameModule.game_index].gd_filect;
 
-	GameModule.gfile_data = new R_GAME_FILEDATA[ game_filect ];
+	GameModule.gfile_data = new R_GAME_FILEDATA[game_filect];
 
 	return true;
 }
@@ -431,7 +407,6 @@
 }	
 
 bool verifyITEDISK() {
-
 	ResourceFile test_file;
 	int32 script_lut_rn;
 	int32 script_lut_len;
@@ -442,17 +417,17 @@
 	 * version.
 	 */
 
-	assert( GameModule.game_dir != NULL );
+	assert (GameModule.game_dir != NULL);
 
-	if ( !test_file.open( "ITE.RSC", GameModule.game_dir )) {
+	if (!test_file.open("ITE.RSC", GameModule.game_dir)) {
 		return false;
 	}
 
-	script_lut_rn = GameDescs[ R_GAME_ITE_DISK ].gd_resource_info->script_lut_rn;
+	script_lut_rn = GameDescs[R_GAME_ITE_DISK].gd_resource_info->script_lut_rn;
 
-	script_lut_len = test_file.getResourceLen( script_lut_rn );
+	script_lut_len = test_file.getResourceLen(script_lut_rn);
 
-	if( script_lut_len % R_SCR_LUT_ENTRYLEN_ITEDISK == 0 ) {
+	if (script_lut_len % R_SCR_LUT_ENTRYLEN_ITEDISK == 0) {
 		return true;
 	}
 

Index: gamedesc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gamedesc.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gamedesc.h	14 Mar 2004 23:39:41 -0000	1.1
+++ gamedesc.h	15 Mar 2004 01:14:49 -0000	1.2
@@ -29,13 +29,11 @@
 namespace SagaGameDesc {
 
 enum R_GAME_BASETYPES {
-	
 	R_GAMETYPE_ITE,
 	R_GAMETYPE_IHNM
 };
 
 enum R_GAME_IDS {
-	
 	R_GAME_ITE_DEMO  = 0,
 	R_GAME_ITE_DISK  = 1,
 	R_GAME_ITE_CD    = 2,
@@ -44,7 +42,6 @@
 };
 
 enum R_GAME_FILETYPES {
-
 	R_GAME_RESOURCEFILE = 0x01,
 	R_GAME_SCRIPTFILE   = 0x02,
 	R_GAME_SOUNDFILE    = 0x04,
@@ -56,14 +53,12 @@
 };
 
 enum R_GAME_SOUNDINFO_TYPES {
-	
 	R_GAME_SOUND_PCM = 0,
 	R_GAME_SOUND_VOC,
 	R_GAME_SOUND_WAV
 };
 
 enum R_GAME_FONT_IDS {
-
 	R_GAME_FONT_SMALL = 0,
 	R_GAME_FONT_MEDIUM,
 	R_GAME_FONT_LARGE,
@@ -74,7 +69,6 @@
 };
 
 typedef struct R_GAME_DISPLAYINFO_tag {
-
 	int logical_w;
 	int logical_h;
 	int scene_h;
@@ -85,7 +79,6 @@
 } R_GAME_DISPLAYINFO;
 
 typedef struct R_GAMESOUND_INFO_tag {
-
 	int  res_type;
 	long freq;
 	int  sample_size;
@@ -94,21 +87,18 @@
 } R_GAME_SOUNDINFO;
 
 typedef struct R_GAMEFONT_DESC_tag {
-	
 	unsigned int  font_id;
 	unsigned long font_rn;
 	
 } R_GAME_FONTDESC;
 
 typedef struct R_GAMESCENE_DESC_tag {
-
 	unsigned long scene_lut_rn;
 	unsigned long first_scene;
 
 } R_GAME_SCENEDESC;
 
 typedef struct R_GAME_RESOURCEINFO_tag {
-	
 	unsigned long scene_lut_rn;
 	unsigned long script_lut_rn;
 

Index: resfile.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/resfile.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- resfile.cpp	14 Mar 2004 23:39:41 -0000	1.1
+++ resfile.cpp	15 Mar 2004 01:14:49 -0000	1.2
@@ -28,7 +28,6 @@
 
 
 ResourceFile::ResourceFile() {
-
 	_resTblOffset = 0;
 	_resTblCt     = 0;
 	_resTblLoaded = false;
@@ -36,30 +35,27 @@
 }
 
 ResourceFile::~ResourceFile() {
-
 	close();
 }
 
-bool
-ResourceFile::open( const char *filename, const char *directory ) {
-
+bool ResourceFile::open(const char *filename, const char *directory) {
 	byte * temp_tbl;
 	uint32 tbl_len;
 
-	if( !File::open( filename, directory )) {
+	if (!File::open(filename, directory)) {
 		return false;
 	}
 
 	/* Seek to end of file to read resource table 'trailer' */
 	_file_len = size();
 
-	seek( _file_len - RSC_TABLEINFO_SIZE, SEEK_SET );
+	seek(_file_len - RSC_TABLEINFO_SIZE, SEEK_SET);
 
 	_resTblOffset = readSint32LE();
 	_resTblCt     = readSint32LE();
 
 	/* Check for sane values */
-	if( _resTblOffset != _file_len - RSC_TABLEINFO_SIZE - 
+	if (_resTblOffset != _file_len - RSC_TABLEINFO_SIZE - 
 		(RSC_TABLEENTRY_SIZE * _resTblCt)) {
 		return false;
 	}
@@ -67,26 +63,25 @@
 	/* Load resource table */
 	_resTbl = new Resource[_resTblCt];
 
-	seek( _resTblOffset, SEEK_SET );
+	seek(_resTblOffset, SEEK_SET);
 
 	tbl_len = _resTblCt * RSC_TABLEENTRY_SIZE;
 	temp_tbl = new byte[tbl_len];
 
-	if( read( temp_tbl, tbl_len ) != tbl_len ) {
+	if (read(temp_tbl, tbl_len) != tbl_len) {
 		delete [] _resTbl;
 		delete [] temp_tbl;
 		return false;
 	}
 
-	BinReader bread( temp_tbl, tbl_len );
+	BinReader bread(temp_tbl, tbl_len);
 
-	for( int i = 0 ; i < _resTblCt ; i++ ) {
-		
+	for (int i = 0; i < _resTblCt; i++) {
 		_resTbl[i].res_offset = bread.readSint32LE();
 		_resTbl[i].res_len    = bread.readSint32LE();
 	}
 
-	delete [] temp_tbl;
+	delete[] temp_tbl;
 
 	_resTblLoaded = true;
 
@@ -95,8 +90,7 @@
 
 
 void ResourceFile::close() {
-
-	if( _resTblLoaded ) {
+	if ( _resTblLoaded) {
 		delete [] _resTbl;
 		_resTblLoaded = false;
 		_resTbl = NULL;
@@ -105,57 +99,52 @@
 	_resTblOffset = 0;
 	_resTblCt = 0;
 
-	if( File::isOpen() ) {
+	if (File::isOpen()) {
 		File::close();
 	}
 }
 
 int32 ResourceFile::getResourceCt() {
-
 	return (_resTblLoaded) ? _resTblCt : -1;
 }
 
-int32 ResourceFile::getResourceOffset( int32 rn ) {
-
-	if (!R_PBOUNDS( rn, _resTblCt )) {
+int32 ResourceFile::getResourceOffset(int32 rn) {
+	if (!R_PBOUNDS(rn, _resTblCt))
 		return -1;
-	}
 
 	return _resTbl[rn].res_offset;
 }
 
-int32 ResourceFile::getResourceLen( int32 rn ) {
-
-	if (!R_PBOUNDS( rn, _resTblCt )) {
+int32 ResourceFile::getResourceLen(int32 rn) {
+	if (!R_PBOUNDS(rn, _resTblCt))
 		return -1;
-	}
 
 	return _resTbl[rn].res_len;
 }
 
-bool ResourceFile::loadResource( int32 rn, byte **res, int32 *res_len ) {
-	
+bool ResourceFile::loadResource(int32 rn, byte **res, int32 *res_len) {
 	byte *new_res;
 	uint32 new_res_len;
 
-	assert( res != NULL && res_len != NULL );
+	assert(res != NULL && res_len != NULL);
 	*res = NULL;
 	*res_len = NULL;
 
-	if( !R_PBOUNDS( rn, _resTblCt )) {
+	if (!R_PBOUNDS( rn, _resTblCt)) {
 		return false;
 	}
 
 	new_res_len = _resTbl[rn].res_len;
-	new_res = new byte[ new_res_len ];
-	if( !new_res ) {
+	new_res = new byte[new_res_len];
+
+	if (!new_res) {
 		return false;
 	}
 
-	seek( _resTbl[rn].res_offset, SEEK_SET );
+	seek(_resTbl[rn].res_offset, SEEK_SET);
 
-	if( read( new_res, new_res_len ) != new_res_len ) {
-		delete [] new_res;
+	if (read(new_res, new_res_len) != new_res_len) {
+		delete[] new_res;
 		return false;
 	}
 
@@ -165,9 +154,8 @@
 	return true;
 }
 
-void ResourceFile::freeResource( byte *res ) {
-
-	delete [] res;
+void ResourceFile::freeResource(byte *res) {
+	delete[] res;
 }
 
 

Index: resfile.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/resfile.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- resfile.h	14 Mar 2004 23:39:41 -0000	1.1
+++ resfile.h	15 Mar 2004 01:14:49 -0000	1.2
@@ -66,7 +66,7 @@
 	ResourceFile();
 	virtual ~ResourceFile();
 
-	bool open( const char *filename, const char *directory );
+	bool open(const char *filename, const char *directory);
 	void close();
 
 	inline int16 readSint16LE() {





More information about the Scummvm-git-logs mailing list