[Scummvm-cvs-logs] SF.net SVN: scummvm:[42299] tools/branches/gsoc2009-gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jul 9 17:53:27 CEST 2009


Revision: 42299
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42299&view=rev
Author:   fingolfin
Date:     2009-07-09 15:53:27 +0000 (Thu, 09 Jul 2009)

Log Message:
-----------
Renamed File::writeU32LE -> writeUint32LE etc. to match the names we use in Common::Stream

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/compress_agos.cpp
    tools/branches/gsoc2009-gui/compress_kyra.cpp
    tools/branches/gsoc2009-gui/compress_queen.cpp
    tools/branches/gsoc2009-gui/compress_saga.cpp
    tools/branches/gsoc2009-gui/compress_tinsel.cpp
    tools/branches/gsoc2009-gui/compress_touche.cpp
    tools/branches/gsoc2009-gui/compress_tucker.cpp
    tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
    tools/branches/gsoc2009-gui/extract_mm_apple.cpp
    tools/branches/gsoc2009-gui/extract_mm_c64.cpp
    tools/branches/gsoc2009-gui/extract_mm_nes.cpp
    tools/branches/gsoc2009-gui/extract_parallaction.cpp
    tools/branches/gsoc2009-gui/extract_zak_c64.cpp
    tools/branches/gsoc2009-gui/util.cpp
    tools/branches/gsoc2009-gui/util.h

Modified: tools/branches/gsoc2009-gui/compress_agos.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_agos.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_agos.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -73,7 +73,7 @@
 		}
 		fseek(_input, -8, SEEK_CUR);
 
-		offsets[i] = _input.readU32LE();
+		offsets[i] = _input.readUint32LE();
 	}
 }
 
@@ -82,8 +82,8 @@
 	size = _input.size();
 
 	for (i = 1; i <= size / 6; i++) {
-		filenums[i] = _input.readU16BE();
-		offsets[i] = _input.readU32BE();
+		filenums[i] = _input.readUint16BE();
+		offsets[i] = _input.readUint32BE();
 	}
 
 	return(size/6);
@@ -141,19 +141,19 @@
 	}
 	size = num * 4;
 
-	_output_idx.writeU32LE(0);
-	_output_idx.writeU32LE(size);
+	_output_idx.writeUint32LE(0);
+	_output_idx.writeUint32LE(size);
 
 	for (i = 1; i < num; i++) {
 		if (offsets[i] == offsets[i + 1]) {
-			_output_idx.writeU32LE(size);
+			_output_idx.writeUint32LE(size);
 			continue;
 		}
 
 		if (offsets[i] != 0)
 			size += get_sound(offsets[i]);
 		if (i < num - 1)
-			_output_idx.writeU32LE(size);
+			_output_idx.writeUint32LE(size);
 	}
 }
 
@@ -175,12 +175,12 @@
 	}
 	size = num * 4;
 
-	_output_idx.writeU32LE(0);
-	_output_idx.writeU32LE(size);
+	_output_idx.writeUint32LE(0);
+	_output_idx.writeUint32LE(size);
 
 	for (i = 1; i < num; i++) {
 		if (filenums[i] == filenums[i + 1] && offsets[i] == offsets[i + 1]) {
-			_output_idx.writeU32LE(size);
+			_output_idx.writeUint32LE(size);
 			continue;
 		}
 
@@ -195,7 +195,7 @@
 		size += get_sound(offsets[i]);
 
 		if (i < num - 1) {
-			_output_idx.writeU32LE(size);
+			_output_idx.writeUint32LE(size);
 		}
 	}
 }

Modified: tools/branches/gsoc2009-gui/compress_kyra.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_kyra.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_kyra.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -104,9 +104,9 @@
 }
 
 int CompressKyra::decodeChunk(File &in, File &out) {
-	uint16 size = in.readU16LE();
-	uint16 outSize = in.readU16LE();
-	uint32 id = in.readU32LE();
+	uint16 size = in.readUint16LE();
+	uint16 outSize = in.readUint16LE();
+	uint32 id = in.readUint32LE();
 	byte *inputBuffer, *outputBuffer;
 	int bytesRead = 0;
 
@@ -254,8 +254,8 @@
 void CompressKyra::compressAUDFile(File &input, const char *outfile) {
 	AUDHeader header;
 
-	header.freq = input.readU16LE();
-	header.size = input.readU32LE();
+	header.freq = input.readUint16LE();
+	header.size = input.readUint32LE();
 	header.flags = input.readByte();
 	header.type = input.readByte();
 	//print("%d Hz, %d bytes, type %d (%08X)\n", header.freq, header.size, header.type, header.flags);
@@ -300,13 +300,13 @@
 		if (!output.loadFile(NULL, false))
 			return;
 
-		uint16 files = input.readU16LE();
+		uint16 files = input.readUint16LE();
 		DuplicatedFile *red = new DuplicatedFile[files];
 		memset(red, 0, sizeof(DuplicatedFile)*files);
 
 		for (uint16 i = 0; i < files; ++i) {
-			uint32 resFilename = input.readU32LE();
-			uint32 resOffset = input.readU32LE();
+			uint32 resFilename = input.readUint32LE();
+			uint32 resOffset = input.readUint32LE();
 
 			char outname[16];
 			snprintf(outname, 16, "%.08u.%s", resFilename, audio_extensions(_format));
@@ -366,8 +366,8 @@
 
 		uint32 offset = 0;
 		for (uint16 i = 0; i < entries; ++i) {
-			f.readU32LE();
-			offset = f.readU32LE();
+			f.readUint32LE();
+			offset = f.readUint32LE();
 
 			if (offset > filesize)
 				error("Unknown filetype of file: '%s'", infile->getFullPath().c_str());

Modified: tools/branches/gsoc2009-gui/compress_queen.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_queen.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_queen.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -140,18 +140,18 @@
 	inTbl.seek(7, SEEK_SET);	/* Skip past header */
 
 	/* Write new header */
-	outFinal.writeU32BE(QTBL);
+	outFinal.writeUint32BE(QTBL);
 	outFinal.write(_version->versionString, 6, 1);
 	outFinal.writeByte(_version->isFloppy);
 	outFinal.writeByte(_version->isDemo);
 	outFinal.writeByte(_versionExtra.compression);
-	outFinal.writeU16BE(_versionExtra.entries);
+	outFinal.writeUint16BE(_versionExtra.entries);
 
 	for (i = 0; i < _versionExtra.entries; i++) {
 		fromFileToFile(inTbl, outFinal, 12);
 		outFinal.writeByte(inTbl.readByte());
-		outFinal.writeU32BE(dataStartOffset + inTbl.readU32BE());
-		outFinal.writeU32BE(inTbl.readU32BE());
+		outFinal.writeUint32BE(dataStartOffset + inTbl.readUint32BE());
+		outFinal.writeUint32BE(inTbl.readUint32BE());
 	}
 
 	/* Append contents of temporary datafile to final datafile */
@@ -194,7 +194,7 @@
 		error("Invalid TBL file");
 	}
 
-	if (inputTbl.readU32BE() != CURRENT_TBL_VERSION) {
+	if (inputTbl.readUint32BE() != CURRENT_TBL_VERSION) {
 		error("You are using an incorrect (outdated?) version of the queen.tbl file");
 	}
 
@@ -202,16 +202,16 @@
 	inputTbl.seek(_version->tableOffset, SEEK_SET);
 
 	_versionExtra.compression = compression_format(_format);
-	_versionExtra.entries = inputTbl.readU16BE();
+	_versionExtra.entries = inputTbl.readUint16BE();
 
 	outputTbl.open(TEMP_TBL, "wb");
 
 	outputData.open(TEMP_DAT, "wb");
 
 	/* Write tablefile header */
-	outputTbl.writeU32BE(QTBL);
+	outputTbl.writeUint32BE(QTBL);
 	outputTbl.writeByte(_versionExtra.compression);
-	outputTbl.writeU16BE(_versionExtra.entries);
+	outputTbl.writeUint16BE(_versionExtra.entries);
 
 	for (i = 0; i < _versionExtra.entries; i++) {
 		prevOffset = outputData.pos();
@@ -220,8 +220,8 @@
 		inputTbl.read(_entry.filename, 1, 12);
 		_entry.filename[12] = '\0';
 		_entry.bundle = inputTbl.readByte();
-		_entry.offset = inputTbl.readU32BE();
-		_entry.size = inputTbl.readU32BE();
+		_entry.offset = inputTbl.readUint32BE();
+		_entry.size = inputTbl.readUint32BE();
 
 		print("Processing entry: %s\n", _entry.filename);
 		fseek(inputData, _entry.offset, SEEK_SET);
@@ -235,7 +235,7 @@
 			inputData.seek(_entry.offset, SEEK_SET);
 
 			inputData.seek(2, SEEK_CUR);
-			sbVersion = inputData.readU16LE();
+			sbVersion = inputData.readUint16LE();
 
 			switch (sbVersion) {
 			case 104:
@@ -301,8 +301,8 @@
 		/* Write entry to table */
 		outputTbl.write(_entry.filename, 12, 1);
 		outputTbl.writeByte(_entry.bundle);
-		outputTbl.writeU32BE(prevOffset);
-		outputTbl.writeU32BE(_entry.size);
+		outputTbl.writeUint32BE(prevOffset);
+		outputTbl.writeUint32BE(_entry.size);
 	}
 
 	/* Merge the temporary table and temporary datafile to create final file */

Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -326,11 +326,11 @@
 	inputFile.seek(inputFileSize - RSC_TABLEINFO_SIZE, SEEK_SET);
 
 	if (!_currentFileDescription->swapEndian) {
-		resTableOffset = inputFile.readU32LE();
-		resTableCount = inputFile.readU32LE();
+		resTableOffset = inputFile.readUint32LE();
+		resTableCount = inputFile.readUint32LE();
 	} else {
-		resTableOffset = inputFile.readU32BE();
-		resTableCount = inputFile.readU32BE();
+		resTableOffset = inputFile.readUint32BE();
+		resTableCount = inputFile.readUint32BE();
 	}
 
 	print("Table offset: %ul\nnumber of records: %ul\n", resTableOffset, resTableCount);
@@ -347,11 +347,11 @@
 	for (i = 0; i < resTableCount; i++) {
 
 		if (!_currentFileDescription->swapEndian) {
-			inputTable[i].offset = inputFile.readU32LE();
-			inputTable[i].size = inputFile.readU32LE();
+			inputTable[i].offset = inputFile.readUint32LE();
+			inputTable[i].size = inputFile.readUint32LE();
 		} else {
-			inputTable[i].offset = inputFile.readU32BE();
-			inputTable[i].size = inputFile.readU32BE();
+			inputTable[i].offset = inputFile.readUint32BE();
+			inputTable[i].size = inputFile.readUint32BE();
 		}
 
 		print("Record: %ul, offset: %ul, size: %ul\n", i, inputTable[i].offset, inputTable[i].size);
@@ -384,11 +384,11 @@
 
 	resTableOffset = outputFile.pos();
 	for (i = 0; i < resTableCount; i++) {
-		outputFile.writeU32LE(outputTable[i].offset);
-		outputFile.writeU32LE(outputTable[i].size);
+		outputFile.writeUint32LE(outputTable[i].offset);
+		outputFile.writeUint32LE(outputTable[i].size);
 	}
-	outputFile.writeU32LE(resTableOffset);
-	outputFile.writeU32LE(resTableCount);	// Should be the same number of entries
+	outputFile.writeUint32LE(resTableOffset);
+	outputFile.writeUint32LE(resTableCount);	// Should be the same number of entries
 
 	outputFile.close();
 

Modified: tools/branches/gsoc2009-gui/compress_tinsel.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_tinsel.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_tinsel.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -82,7 +82,7 @@
 	copyLeft = curFileHandle.pos();
 	fseek(curFileHandle, 0, SEEK_SET);
 	// Write size of compressed data
-	_output_smp.writeU32LE(copyLeft);
+	_output_smp.writeUint32LE(copyLeft);
 	// Write actual data
 	while (copyLeft > 0) {
 		doneRead = curFileHandle.read(buffer, 1, copyLeft > sizeof(buffer) ? sizeof(buffer) : copyLeft);
@@ -229,7 +229,7 @@
 	copyLeft = curFileHandle.pos();
 	curFileHandle.seek(0, SEEK_SET);
 	// Write size of compressed data
-	_output_smp.writeU32LE(copyLeft);
+	_output_smp.writeUint32LE(copyLeft);
 	// Write actual data
 	while (copyLeft > 0) {
 		doneRead = curFileHandle.read(buffer, 1, copyLeft > sizeof(buffer) ? sizeof(buffer) : copyLeft);
@@ -281,7 +281,7 @@
 
 	loopCount = indexCount;
 	while (loopCount>0) {
-		indexOffset = _input_idx.readU32LE();
+		indexOffset = _input_idx.readUint32LE();
 		if (indexOffset) {
 			if (indexNo==0) {
 				error("The sourcefiles are already compressed, aborting...\n");
@@ -291,18 +291,18 @@
 
 			// Seek to Sample in input-file and read SampleSize
 			_input_smp.seek(indexOffset, SEEK_SET);
-			sampleSize = _input_smp.readU32LE();
+			sampleSize = _input_smp.readUint32LE();
 
 			// Write offset of new data to new index file
-			_output_idx.writeU32LE(_output_smp.pos());
+			_output_idx.writeUint32LE(_output_smp.pos());
 
 			if (sampleSize & 0x80000000) {
 				// multiple samples in ADPCM format
 				sampleCount = sampleSize & ~0x80000000;
 				// Write sample count to new sample file
-				_output_smp.writeU32LE(sampleSize);
+				_output_smp.writeUint32LE(sampleSize);
 				while (sampleCount>0) {
-					sampleSize = _input_smp.readU32LE();
+					sampleSize = _input_smp.readUint32LE();
 					convertTinselADPCMSample(sampleSize);
 					sampleCount--;
 				}
@@ -314,13 +314,13 @@
 			if (indexNo==0) {
 				// Write signature as index 0
 				switch (_format) {
-				case AUDIO_MP3: _output_idx.writeU32BE(MKID_BE('MP3 ')); break;
-				case AUDIO_VORBIS: _output_idx.writeU32BE(MKID_BE('OGG ')); break;
-				case AUDIO_FLAC: _output_idx.writeU32BE(MKID_BE('FLAC')); break;
+				case AUDIO_MP3: _output_idx.writeUint32BE(MKID_BE('MP3 ')); break;
+				case AUDIO_VORBIS: _output_idx.writeUint32BE(MKID_BE('OGG ')); break;
+				case AUDIO_FLAC: _output_idx.writeUint32BE(MKID_BE('FLAC')); break;
 				default: throw ToolException("Unknown audio format!");
 				}
 			} else {
-				_output_idx.writeU32LE(0);
+				_output_idx.writeUint32LE(0);
 			}
 		}
 		loopCount--;

Modified: tools/branches/gsoc2009-gui/compress_touche.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_touche.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_touche.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -53,8 +53,8 @@
 	for (i = 0; i < len; ++i) {
 		offs_table[i] = readUint32LE(input);
 		size_table[i] = readUint32LE(input);
-		output.writeU32LE(0);
-		output.writeU32LE(0);
+		output.writeUint32LE(0);
+		output.writeUint32LE(0);
 		current_offset += 8;
 	}
 	for (i = 0; i < len; ++i) {
@@ -90,8 +90,8 @@
 	/* fix data offsets table */
 	output.seek(start_offset, SEEK_SET);
 	for (i = 0; i < len; ++i) {
-		output.writeU32LE(offs_table[i]);
-		output.writeU32LE(size_table[i]);
+		output.writeUint32LE(offs_table[i]);
+		output.writeUint32LE(size_table[i]);
 	}
 	output.seek(0, SEEK_END);
 
@@ -113,7 +113,7 @@
 	/* write 0 offsets table */
 	for (i = 0; i < MAX_OFFSETS; ++i) {
 		offsets_table[i] = 0;
-		output.writeU32LE(offsets_table[i]);
+		output.writeUint32LE(offsets_table[i]);
 		current_offset += 4;
 	}
 
@@ -145,7 +145,7 @@
 	/* fix global offsets table at the beginning of the file */
 	output.seek(HEADER_SIZE, SEEK_SET);
 	for (i = 0; i < MAX_OFFSETS; ++i) {
-		output.writeU32LE(offsets_table[i]);
+		output.writeUint32LE(offsets_table[i]);
 	}
 
 	output.close();

Modified: tools/branches/gsoc2009-gui/compress_tucker.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_tucker.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/compress_tucker.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -121,8 +121,8 @@
 
 	/* write 0 offsets/sizes table */
 	for (i = 0; i < dir->count; ++i) {
-		output.writeU32LE(0);
-		output.writeU32LE(0);
+		output.writeUint32LE(0);
+		output.writeUint32LE(0);
 	}
 
 	/* compress .wav files in directory */
@@ -354,16 +354,16 @@
 
 	File output(*outpath, "wb");
 
-	output.writeU16LE(CURRENT_VER);
-	output.writeU16LE(flags);
+	output.writeUint16LE(CURRENT_VER);
+	output.writeUint16LE(flags);
 
 	/* write 0 offsets/count */
 	for (i = 0; i < SOUND_TYPES_COUNT; ++i) {
-		output.writeU32LE(0);
-		output.writeU32LE(0);
+		output.writeUint32LE(0);
+		output.writeUint32LE(0);
 	}
 	if (flags & HEADER_FLAG_AUDIO_INTRO) {
-		output.writeU32LE(0);
+		output.writeUint32LE(0);
 	}
 
 	/* compress the .wav files in each directory */
@@ -382,13 +382,13 @@
 	fseek(output, HEADER_SIZE, SEEK_SET);
 	current_offset = 0;
 	for (i = 0; i < SOUND_TYPES_COUNT; ++i) {
-		output.writeU32LE(current_offset);
-		output.writeU32LE(sound_directory_table[i].count);
+		output.writeUint32LE(current_offset);
+		output.writeUint32LE(sound_directory_table[i].count);
 		current_offset += sound_directory_size[i];
 	}
 	if (flags & HEADER_FLAG_AUDIO_INTRO) {
-		output.writeU32LE(current_offset);
-		output.writeU32LE(ARRAYSIZE(audio_files_list));
+		output.writeUint32LE(current_offset);
+		output.writeUint32LE(ARRAYSIZE(audio_files_list));
 		current_offset += audio_directory_size;
 	}
 

Modified: tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_loom_tg16.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_loom_tg16.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -35,7 +35,7 @@
 }
 uint16 read_cword (File &input, short *ctr) {
 	(*ctr) += 2;
-	return input.readU16LE();
+	return input.readUint16LE();
 }
 
 void write_cbyte (File &output, uint8 val, short *ctr) {
@@ -43,11 +43,11 @@
 	(*ctr) += 1;
 }
 void write_cword (File &output, uint16 val, short *ctr) {
-	output.writeU16LE(val);
+	output.writeUint16LE(val);
 	(*ctr) += 2;
 }
 void write_clong (File &output, uint32 val, short *ctr) {
-	output.writeU32LE(val);
+	output.writeUint32LE(val);
 	(*ctr) += 4;
 }
 
@@ -799,8 +799,8 @@
 	switch (res->type) {
 	case RES_CHARSET:
 		rlen = r_length(res);
-		output.writeU16LE((uint16)(rlen + 4));
-		output.writeU16LE(0);
+		output.writeUint16LE((uint16)(rlen + 4));
+		output.writeUint16LE(0);
 
 		/* Skip 4 bytes */
 		read_cword(input, &i);
@@ -824,8 +824,8 @@
 			error("extract_resource(globdata) - length mismatch while extracting resource (was %04X, expected %04X)",rlen,r_length(res));
 		if (rtype != 0x11)
 			error("extract_resource(globdata) - resource tag is incorrect");
-		output.writeU32LE((uint16)(rlen + 1));
-		output.writeU16LE('O0');	/* 0O - Object Index */
+		output.writeUint32LE((uint16)(rlen + 1));
+		output.writeUint16LE('O0');	/* 0O - Object Index */
 		for (i = 5; i < rlen; i++)
 			output.writeByte(input.readByte());
 		break;
@@ -950,7 +950,7 @@
 				}
 			}
 			output.seek(off, SEEK_SET);
-			output.writeU32LE(rlen);
+			output.writeUint32LE(rlen);
 			output.seek(0, SEEK_END);
 		}
 
@@ -967,8 +967,8 @@
 			error("extract_resource(costume) - length mismatch while extracting resource (was %04X, expected %04X)",rlen,r_length(res));
 		if (rtype != 0x03)
 			error("extract_resource(costume) - resource tag is incorrect");
-		output.writeU32LE((uint16)(rlen + 1));
-		output.writeU16LE('OC');	/* CO - Costume */
+		output.writeUint32LE((uint16)(rlen + 1));
+		output.writeUint16LE('OC');	/* CO - Costume */
 		for (i = 5; i < rlen; i++)
 			output.writeByte(input.readByte());
 		break;
@@ -981,8 +981,8 @@
 			error("extract_resource(script) - length mismatch while extracting resource (was %04X, expected %04X)", rlen, r_length(res));
 		if (rtype != 0x02)
 			error("extract_resource(script) - resource tag is incorrect");
-		output.writeU32LE((uint16)(rlen + 1));
-		output.writeU16LE('CS');	/* SC - Script */
+		output.writeUint32LE((uint16)(rlen + 1));
+		output.writeUint16LE('CS');	/* SC - Script */
 		for (i = 5; i < rlen; i++)
 			output.writeByte(input.readByte());
 		break;
@@ -1314,41 +1314,41 @@
 	lfl_index.num_scripts = NUM_SCRIPTS;
 	lfl_index.num_sounds = NUM_SOUNDS;
 
-	output.writeU32LE(8 + 5 * lfl_index.num_rooms);
-	output.writeU16LE('R0'); /* 0R - room index */
-	output.writeU16LE(lfl_index.num_rooms);
+	output.writeUint32LE(8 + 5 * lfl_index.num_rooms);
+	output.writeUint16LE('R0'); /* 0R - room index */
+	output.writeUint16LE(lfl_index.num_rooms);
 
 	for (i = 0; i < lfl_index.num_rooms; i++) {
 		output.writeByte(lfl_index.room_lfl[i]);
-		output.writeU32LE(lfl_index.room_addr[i]);
+		output.writeUint32LE(lfl_index.room_addr[i]);
 	}
 
-	output.writeU32LE(8 + 5 * lfl_index.num_scripts);
-	output.writeU16LE('S0'); /* 0S - script index */
-	output.writeU16LE(lfl_index.num_scripts);
+	output.writeUint32LE(8 + 5 * lfl_index.num_scripts);
+	output.writeUint16LE('S0'); /* 0S - script index */
+	output.writeUint16LE(lfl_index.num_scripts);
 
 	for (i = 0; i < lfl_index.num_scripts; i++) {
 		output.writeByte(lfl_index.script_lfl[i]);
-		output.writeU32LE(lfl_index.script_addr[i]);
+		output.writeUint32LE(lfl_index.script_addr[i]);
 	}
 
-	output.writeU32LE(8 + 5 * lfl_index.num_costumes);
-	output.writeU16LE('C0'); /* 0C - costume index */
-	output.writeU16LE(lfl_index.num_costumes);
+	output.writeUint32LE(8 + 5 * lfl_index.num_costumes);
+	output.writeUint16LE('C0'); /* 0C - costume index */
+	output.writeUint16LE(lfl_index.num_costumes);
 
 	for (i = 0; i < lfl_index.num_costumes; i++) {
 		output.writeByte(lfl_index.costume_lfl[i]);
-		output.writeU32LE(lfl_index.costume_addr[i]);
+		output.writeUint32LE(lfl_index.costume_addr[i]);
 	}
 
 /*
-	output.writeU32LE(8 + 5 * lfl_index.num_sounds);
-	output.writeU16LE('N0'); 0N - sounds index
-	output.writeU16LE(lfl_index.num_sounds);
+	output.writeUint32LE(8 + 5 * lfl_index.num_sounds);
+	output.writeUint16LE('N0'); 0N - sounds index
+	output.writeUint16LE(lfl_index.num_sounds);
 
 	for (i = 0; i < lfl_index.num_sounds; i++) {
 		output.writeByte(lfl_index.sound_lfl[i]);
-		output.writeU32LE(lfl_index.sound_addr[i]);
+		output.writeUint32LE(lfl_index.sound_addr[i]);
 	}
 */
 

Modified: tools/branches/gsoc2009-gui/extract_mm_apple.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_apple.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_mm_apple.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -69,11 +69,11 @@
 	input2.seek(143104, SEEK_SET);
 
 	/* check signature */
-	signature = input1.readU16LE();
+	signature = input1.readUint16LE();
 	if (signature != 0x0A31)
 		error("Signature not found in disk 1!");
 
-	signature = input2.readU16LE();
+	signature = input2.readUint16LE();
 	if (signature != 0x0032)
 		error("Signature not found in disk 2!");
 
@@ -84,7 +84,7 @@
 	print("Creating 00.LFL...");
 
 	/* write signature */
-	output.writeU16LE(signature);
+	output.writeUint16LE(signature);
 
 	/* copy object flags */
 	for (i = 0; i < 256; i++)
@@ -106,19 +106,19 @@
 	for (i = 0; i < 25; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 25; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy script offsets */
 	for (i = 0; i < 160; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 160; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy sound offsets */
 	for (i = 0; i < 70; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 70; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* NOTE: Extra 92 bytes of unknown data */
 
@@ -140,8 +140,8 @@
 		input->seek((SectorOffset[room_tracks_apple[i]] + room_sectors_apple[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
-			unsigned short len = input->readU16LE();
-			output.writeU16LE(len);
+			unsigned short len = input->readUint16LE();
+			output.writeUint16LE(len);
 
 			for (len -= 2; len > 0; len--)
 				output.writeByte(input->readByte());

Modified: tools/branches/gsoc2009-gui/extract_mm_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_c64.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_mm_c64.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -67,10 +67,10 @@
 	File input2(inpath2, "rb");
 
 	/* check signature */
-	signature = input1.readU16LE();
+	signature = input1.readUint16LE();
 	if (signature != 0x0A31)
 		error("Signature not found in disk 1!");
-	signature = input2.readU16LE();
+	signature = input2.readUint16LE();
 	if (signature != 0x0132)
 		error("Signature not found in disk 2!");
 
@@ -80,7 +80,7 @@
 	print("Creating 00.LFL...");
 
 	/* write signature */
-	output.writeU16LE(signature);
+	output.writeUint16LE(signature);
 
 	/* copy object flags */
 	for (i = 0; i < 256; i++)
@@ -101,19 +101,19 @@
 	for (i = 0; i < 25; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 25; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy script offsets */
 	for (i = 0; i < 160; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 160; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy sound offsets */
 	for (i = 0; i < 70; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 70; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 	output.close();
 
 	for (i = 0; i < NUM_ROOMS; i++) {
@@ -134,8 +134,8 @@
 		input->seek((SectorOffset[room_tracks[i]] + room_sectors[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
-			unsigned short len = input->readU16LE();
-			output.writeU16LE(len);
+			unsigned short len = input->readUint16LE();
+			output.writeUint16LE(len);
 
 			for (len -= 2; len > 0; len--) {
 				output.writeByte(input->readByte());

Modified: tools/branches/gsoc2009-gui/extract_mm_nes.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_nes.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_mm_nes.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -837,7 +837,7 @@
 		break;
 	case NES_ROOMGFX:
 	case NES_COSTUMEGFX:
-		output.writeU16LE((uint16)(res->length + 2));
+		output.writeUint16LE((uint16)(res->length + 2));
 		len = input.readByte();
 		output.writeByte((uint8)len);
 		if (!len)
@@ -855,7 +855,7 @@
 		break;
 	case NES_ROOM:
 	case NES_SCRIPT:
-		len = input.readU16LE();
+		len = input.readUint16LE();
 		if (len != res->length)
 			error("extract_resource - length mismatch while extracting room/script resource (was %04X, should be %04X)", len, res->length);
 		input.seek(-2, SEEK_CUR);
@@ -867,7 +867,7 @@
 		val = input.readByte();
 		cnt = input.readByte();
 		if ((val == 2) && (cnt == 100)) {
-			output.writeU16LE(len);
+			output.writeUint16LE(len);
 			output.writeByte(val);
 			output.writeByte(cnt);
 			cnt = input.readByte();
@@ -883,7 +883,7 @@
 					break;
 				}
 		} else if (((val == 0) || (val == 1) || (val == 4)) && (cnt == 10)) {
-			output.writeU16LE(len);
+			output.writeUint16LE(len);
 			output.writeByte(val);
 			output.writeByte(cnt);
 			while (1) {
@@ -914,13 +914,13 @@
 	case NES_SPRDATA:
 	case NES_CHARSET:
 		len = res->length;
-		output.writeU16LE((uint16)(len + 2));
+		output.writeUint16LE((uint16)(len + 2));
 		for (i = 0; i < len; i++)
 			output.writeByte(input.readByte());
 		break;
 	case NES_PREPLIST:
 		len = res->length;
-		output.writeU16LE(0x002A);
+		output.writeUint16LE(0x002A);
 		output.writeByte(' ');
 		for (i = 1; i < 8; i++)
 			output.writeByte(0);
@@ -1249,7 +1249,7 @@
 			}
 			extract_resource(input, output, &entry->type->langs[ROMset][entry->index], entry->type->type);
 		}
-		output.writeU16LE(0xF5D1);
+		output.writeUint16LE(0xF5D1);
 	}
 
 	outpath.setFullName("00.LFL");
@@ -1259,7 +1259,7 @@
 #endif
 	print("Creating 00.LFL...");
 
-	output.writeU16LE(0x4643);
+	output.writeUint16LE(0x4643);
 	extract_resource(input, output, &res_globdata.langs[ROMset][0], res_globdata.type);
 	for (i = 0; i < (int)sizeof(struct t_lflindex); i++)
 		output.writeByte(((uint8 *)&mm_lfl_index)[i]);

Modified: tools/branches/gsoc2009-gui/extract_parallaction.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_parallaction.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_parallaction.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -150,7 +150,7 @@
 	_file.seek(_numSlots * ARCHIVE_FILENAME_LEN + ARCHIVE_HEADER_SIZE, SEEK_SET);
 
 	for (i = 0; i < _numSlots; i++) {
-		_sizes[i] = _file.readU32BE();
+		_sizes[i] = _file.readUint32BE();
 	}
 
 	if (smallArchive) {

Modified: tools/branches/gsoc2009-gui/extract_zak_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_zak_c64.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/extract_zak_c64.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -68,10 +68,10 @@
 	File input2(inpath2, "rb");
 
 	/* check signature */
-	signature = input1.readU16LE();
+	signature = input1.readUint16LE();
 	if (signature != 0x0A31)
 		error("Signature not found in disk 1!");
-	signature = input2.readU16LE();
+	signature = input2.readUint16LE();
 	if (signature != 0x0132)
 		error("Signature not found in disk 2!");
 
@@ -82,7 +82,7 @@
 	print("Creating 00.LFL...");
 
 	/* write signature */
-	output.writeU16LE(signature);
+	output.writeUint16LE(signature);
 
 	/* copy object flags */
 	for (i = 0; i < 775; i++)
@@ -104,19 +104,19 @@
 	for (i = 0; i < 38; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 38; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy script offsets */
 	for (i = 0; i < 155; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 155; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	/* copy sound offsets */
 	for (i = 0; i < 127; i++)
 		output.writeByte(input1.readByte());
 	for (i = 0; i < 127; i++)
-		output.writeU16LE(input1.readU16LE());
+		output.writeUint16LE(input1.readUint16LE());
 
 	output.close();
 
@@ -138,8 +138,8 @@
 		input->seek((SectorOffset[room_tracks_c64[i]] + room_sectors_c64[i]) * 256, SEEK_SET);
 
 		for (j = 0; j < ResourcesPerFile[i]; j++) {
-			unsigned short len = input->readU16LE();
-			output.writeU16LE(len);
+			unsigned short len = input->readUint16LE();
+			output.writeUint16LE(len);
 
 			for (len -= 2; len > 0; len--) {
 				output.writeByte(input->readByte());

Modified: tools/branches/gsoc2009-gui/util.cpp
===================================================================
--- tools/branches/gsoc2009-gui/util.cpp	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/util.cpp	2009-07-09 15:53:27 UTC (rev 42299)
@@ -368,21 +368,21 @@
 	return (uint8)u8;
 }
 
-uint16 File::readU16BE() {
+uint16 File::readUint16BE() {
 	uint16 ret = 0;
 	ret |= uint16(readByte() << 8ul);
 	ret |= uint16(readByte());
 	return ret;
 }
 
-uint16 File::readU16LE() {
+uint16 File::readUint16LE() {
 	uint16 ret = 0;
 	ret |= uint16(readByte());
 	ret |= uint16(readByte() << 8ul);
 	return ret;
 }
 
-uint32 File::readU32BE() {
+uint32 File::readUint32BE() {
 	uint32 ret = 0;
 	ret |= uint32(readByte() << 24);
 	ret |= uint32(readByte() << 16);
@@ -391,7 +391,7 @@
 	return ret;
 }
 
-uint32 File::readU32LE() {
+uint32 File::readUint32LE() {
 	uint32 ret = 0;
 	ret |= uint32(readByte());
 	ret |= uint32(readByte() << 8);
@@ -425,24 +425,24 @@
 		throw FileException("Could not write to file (" + _name.getFullPath() + ")");
 }
 
-void File::writeU16BE(uint16 value) {
+void File::writeUint16BE(uint16 value) {
 	writeByte((uint8)(value >> 8));
 	writeByte((uint8)(value));
 }
 
-void File::writeU16LE(uint16 value) {
+void File::writeUint16LE(uint16 value) {
 	writeByte((uint8)(value));
 	writeByte((uint8)(value >> 8));
 }
 
-void File::writeU32BE(uint32 value) {
+void File::writeUint32BE(uint32 value) {
 	writeByte((uint8)(value >> 24));
 	writeByte((uint8)(value >> 16));
 	writeByte((uint8)(value >> 8));
 	writeByte((uint8)(value));
 }
 
-void File::writeU32LE(uint32 value) {
+void File::writeUint32LE(uint32 value) {
 	writeByte((uint8)(value));
 	writeByte((uint8)(value >> 8));
 	writeByte((uint8)(value >> 16));

Modified: tools/branches/gsoc2009-gui/util.h
===================================================================
--- tools/branches/gsoc2009-gui/util.h	2009-07-09 15:48:56 UTC (rev 42298)
+++ tools/branches/gsoc2009-gui/util.h	2009-07-09 15:53:27 UTC (rev 42299)
@@ -383,22 +383,22 @@
 	 * Read a single 16-bit word, big endian.
 	 * Throws FileException if file is not open / if read failed.
 	 */
-	uint16 readU16BE();
+	uint16 readUint16BE();
 	/**
 	 * Read a single 16-bit word, little endian.
 	 * Throws FileException if file is not open / if read failed.
 	 */
-	uint16 readU16LE();
+	uint16 readUint16LE();
 	/**
 	 * Read a single 32-bit word, big endian.
 	 * Throws FileException if file is not open / if read failed.
 	 */
-	uint32 readU32BE();
+	uint32 readUint32BE();
 	/**
 	 * Read a single 32-bit word, little endian.
 	 * Throws FileException if file is not open / if read failed.
 	 */
-	uint32 readU32LE();
+	uint32 readUint32LE();
 
 	/**
 	 * Works the same way as fread, but throws on error or if it could
@@ -420,22 +420,22 @@
 	 * Writes a single 16-bit word to the file, big endian.
 	 * Throws FileException if file is not open / if write failed.
 	 */
-	void writeU16BE(uint16 value);
+	void writeUint16BE(uint16 value);
 	/**
 	 * Writes a single 16-bit word to the file, little endian.
 	 * Throws FileException if file is not open / if write failed.
 	 */
-	void writeU16LE(uint16 value);
+	void writeUint16LE(uint16 value);
 	/**
 	 * Writes a single 32-bit word to the file, big endian.
 	 * Throws FileException if file is not open / if write failed.
 	 */
-	void writeU32BE(uint32 value);
+	void writeUint32BE(uint32 value);
 	/**
 	 * Writes a single 32-bit word to the file, little endian.
 	 * Throws FileException if file is not open / if write failed.
 	 */
-	void writeU32LE(uint32 value);
+	void writeUint32LE(uint32 value);
 
 	/**
 	 * Works the same way as fwrite, but throws on error or if


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