[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.140,2.141 debugger.cpp,1.148,1.149 intern.h,2.481,2.482 resource.cpp,1.321,1.322 resource_v3.cpp,1.38,1.39 resource_v4.cpp,1.25,1.26 resource_v7he.cpp,1.40,1.41 resource_v7he.h,1.12,1.13 script_v6he.cpp,2.156,2.157 script_v72he.cpp,2.286,2.287 script_v80he.cpp,2.113,2.114 scumm.cpp,1.500,1.501 sound.cpp,1.456,1.457 sound.h,1.86,1.87 util.cpp,2.10,2.11 util.h,2.10,2.11 vars.cpp,1.134,1.135 wiz_he.cpp,2.79,2.80

Max Horn fingolfin at users.sourceforge.net
Tue May 10 15:59:46 CEST 2005


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

Modified Files:
	charset.cpp debugger.cpp intern.h resource.cpp resource_v3.cpp 
	resource_v4.cpp resource_v7he.cpp resource_v7he.h 
	script_v6he.cpp script_v72he.cpp script_v80he.cpp scumm.cpp 
	sound.cpp sound.h util.cpp util.h vars.cpp wiz_he.cpp 
Log Message:
Moved class File and the MD5 stuff to namespace Common

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.140
retrieving revision 2.141
diff -u -d -r2.140 -r2.141
--- charset.cpp	8 May 2005 21:49:44 -0000	2.140
+++ charset.cpp	10 May 2005 22:56:07 -0000	2.141
@@ -28,14 +28,14 @@
 namespace Scumm {
 
 void ScummEngine::loadCJKFont() {
-	File fp;
+	Common::File fp;
 	_useCJKMode = false;
 	if (_language == Common::JA_JPN && _version <= 5) { // FM-TOWNS v3 / v5 Kanji
 		int numChar = 256 * 32;
 		_2byteWidth = 16;
 		_2byteHeight = 16;
 		// use FM-TOWNS font rom, since game files don't have kanji font resources
-		if (fp.open("fmt_fnt.rom", File::kFileReadMode)) {
+		if (fp.open("fmt_fnt.rom", Common::File::kFileReadMode)) {
 			_useCJKMode = true;
 			debug(2, "Loading FM-TOWNS Kanji rom");
 			_2byteFontPtr = new byte[((_2byteWidth + 7) / 8) * _2byteHeight * numChar];

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- debugger.cpp	8 May 2005 21:49:45 -0000	1.148
+++ debugger.cpp	10 May 2005 22:56:07 -0000	1.149
@@ -289,7 +289,7 @@
 }
 
 bool ScummDebugger::Cmd_ImportRes(int argc, const char** argv) {
-	File file;
+	Common::File file;
 	uint32 size;
 	int resnum;
 
@@ -302,7 +302,7 @@
 	// FIXME add bounds check
 
 	if (!strncmp(argv[1], "scr", 3)) {
-		file.open(argv[2], File::kFileReadMode);
+		file.open(argv[2], Common::File::kFileReadMode);
 		if (file.isOpen() == false) {
 			DebugPrintf("Could not open file %s\n", argv[2]);
 			return true;

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.481
retrieving revision 2.482
diff -u -d -r2.481 -r2.482
--- intern.h	10 May 2005 05:42:47 -0000	2.481
+++ intern.h	10 May 2005 22:56:07 -0000	2.482
@@ -675,7 +675,7 @@
 
 	const OpcodeEntryv60he *_opcodesv60he;
 
-	File _hFileTable[17];
+	Common::File _hFileTable[17];
 	
 public:
 	ScummEngine_v60he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v6(detector, syst, gs, md5sum) {}

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.321
retrieving revision 1.322
diff -u -d -r1.321 -r1.322
--- resource.cpp	10 May 2005 03:03:26 -0000	1.321
+++ resource.cpp	10 May 2005 22:56:08 -0000	1.322
@@ -1227,7 +1227,7 @@
 
 void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int length) {
 	char buf[256];
-	File out;
+	Common::File out;
 
 	uint32 size;
 	if (length >= 0)
@@ -1245,7 +1245,7 @@
 	sprintf(buf, "dumps/%s%d.dmp", tag, idx);
 #endif
 
-	out.open(buf, File::kFileWriteMode);
+	out.open(buf, Common::File::kFileWriteMode);
 	if (out.isOpen() == false)
 		return;
 	out.write(ptr, size);

Index: resource_v3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v3.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- resource_v3.cpp	10 Apr 2005 12:58:57 -0000	1.38
+++ resource_v3.cpp	10 May 2005 22:56:10 -0000	1.39
@@ -104,7 +104,7 @@
 	checkRange(2, 0, no, "Loading illegal charset %d");
 	closeRoom();
 
-	File file;
+	Common::File file;
 	char buf[20];
 
 	sprintf(buf, "%02d.LFL", 99 - no);

Index: resource_v4.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v4.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- resource_v4.cpp	20 Apr 2005 18:21:00 -0000	1.25
+++ resource_v4.cpp	10 May 2005 22:56:10 -0000	1.26
@@ -136,7 +136,7 @@
 	checkRange(4, 0, no, "Loading illegal charset %d");
 	closeRoom();
 
-	File file;
+	Common::File file;
 	char buf[20];
 
 	sprintf(buf, "%03d.LFL", 900 + no);

Index: resource_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- resource_v7he.cpp	10 May 2005 22:31:47 -0000	1.40
+++ resource_v7he.cpp	10 May 2005 22:56:10 -0000	1.41
@@ -142,7 +142,7 @@
 		
 	/* initiate stuff */
 	fi.memory = NULL;
-	fi.file = new File;
+	fi.file = new Common::File;
 
 	if (!_fileName[0]) { // We are running for the first time
 		snprintf(_fileName, 256, "%s.he3", _vm->getGameName());
@@ -1279,7 +1279,7 @@
 	int cursorsize;
 	int w = 0, h = 0, hotspot_x = 0, hotspot_y = 0;
 	int keycolor;
-	File f;
+	Common::File f;
 
 	if (!_fileName[0]) // We are running for the first time
 		if (_vm->_substResFileNameIndex > 0) {
@@ -1314,7 +1314,7 @@
 }
 
 int MacResExtractor::extractResource(int id, byte **buf) {
-	File in;
+	Common::File in;
 	int size;
 
 	in.open(_fileName);
@@ -1345,7 +1345,7 @@
 #define MBI_RFLEN 87
 #define MAXNAMELEN 63
 
-bool MacResExtractor::init(File in) {
+bool MacResExtractor::init(Common::File in) {
 	byte infoHeader[MBI_INFOHDR];
 	int32 data_size, rsrc_size;
 	int32 data_size_pad, rsrc_size_pad;
@@ -1397,7 +1397,7 @@
 	return true;
 }
 
-byte *MacResExtractor::getResource(File in, const char *typeID, int16 resID, int *size) {
+byte *MacResExtractor::getResource(Common::File in, const char *typeID, int16 resID, int *size) {
 	int	i;
 	int typeNum = -1;
 	int resNum = -1;
@@ -1434,7 +1434,7 @@
 	return buf;
 }
 
-void MacResExtractor::readMap(File in) {
+void MacResExtractor::readMap(Common::File in) {
 	int	i, j, len;
 	
 	in.seek(_mapOffset + 22);

Index: resource_v7he.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- resource_v7he.h	31 Jan 2005 03:53:35 -0000	1.12
+++ resource_v7he.h	10 May 2005 22:56:10 -0000	1.13
@@ -156,7 +156,7 @@
 #endif	
 
 	struct WinLibrary {
-		File *file;
+		Common::File *file;
 		byte *memory;
 		byte *first_resource;
 		bool is_PE_binary;
@@ -490,9 +490,9 @@
 
 private:
 	int extractResource(int id, byte **buf);
-	bool init(File in);
-	void readMap(File in);
-	byte *getResource(File in, const char *typeID, int16 resID, int *size);
+	bool init(Common::File in);
+	void readMap(Common::File in);
+	byte *getResource(Common::File in, const char *typeID, int16 resID, int *size);
 	void convertIcons(byte *data, int datasize, byte **cursor, int *w, int *h,
 					 int *hotspot_x, int *hotspot_y, int *keycolor);
 

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.156
retrieving revision 2.157
diff -u -d -r2.156 -r2.157
--- script_v6he.cpp	20 Apr 2005 18:21:05 -0000	2.156
+++ script_v6he.cpp	10 May 2005 22:56:10 -0000	2.157
@@ -1007,12 +1007,12 @@
 	if (slot != -1) {
 		switch(mode) {
 		case 1:
-			_hFileTable[slot].open((char*)filename + r, File::kFileReadMode, _saveFileMan->getSavePath());
+			_hFileTable[slot].open((char*)filename + r, Common::File::kFileReadMode, _saveFileMan->getSavePath());
 			if (_hFileTable[slot].isOpen() == false)
-				_hFileTable[slot].open((char*)filename + r, File::kFileReadMode);
+				_hFileTable[slot].open((char*)filename + r, Common::File::kFileReadMode);
 			break;
 		case 2:
-			_hFileTable[slot].open((char*)filename + r, File::kFileWriteMode, _saveFileMan->getSavePath());
+			_hFileTable[slot].open((char*)filename + r, Common::File::kFileWriteMode, _saveFileMan->getSavePath());
 			break;
 		default:
 			error("o60_openFile(): wrong open file mode %d", mode);

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.286
retrieving revision 2.287
diff -u -d -r2.286 -r2.287
--- script_v72he.cpp	10 May 2005 05:42:47 -0000	2.286
+++ script_v72he.cpp	10 May 2005 22:56:10 -0000	2.287
@@ -538,7 +538,7 @@
 	}
 
 	if (setFilePath) {
-		File f;
+		Common::File f;
 		char filePath[256], newFilePath[256];
 
 		sprintf(filePath, "%s%s", _gameDataPath.c_str(), dst + r);
@@ -1752,12 +1752,12 @@
 	if (slot != -1) {
 		switch(mode) {
 		case 1:
-			_hFileTable[slot].open((char*)filename + r, File::kFileReadMode, _saveFileMan->getSavePath());
+			_hFileTable[slot].open((char*)filename + r, Common::File::kFileReadMode, _saveFileMan->getSavePath());
 			if (_hFileTable[slot].isOpen() == false)
-				_hFileTable[slot].open((char*)filename + r, File::kFileReadMode, _gameDataPath.c_str());
+				_hFileTable[slot].open((char*)filename + r, Common::File::kFileReadMode, _gameDataPath.c_str());
 			break;
 		case 2:
-			_hFileTable[slot].open((char*)filename + r, File::kFileWriteMode, _saveFileMan->getSavePath());
+			_hFileTable[slot].open((char*)filename + r, Common::File::kFileWriteMode, _saveFileMan->getSavePath());
 			break;
 		default:
 			error("o72_openFile(): wrong open file mode %d", mode);

Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.113
retrieving revision 2.114
diff -u -d -r2.113 -r2.114
--- script_v80he.cpp	10 May 2005 14:07:21 -0000	2.113
+++ script_v80he.cpp	10 May 2005 22:56:11 -0000	2.114
@@ -406,7 +406,7 @@
 
 	copyScriptString(filename, sizeof(filename));
 
-	File f;
+	Common::File f;
 	if (f.open((char *)filename) == false) {
 		push(-1);
 		return;

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.500
retrieving revision 1.501
diff -u -d -r1.500 -r1.501
--- scumm.cpp	10 May 2005 22:31:47 -0000	1.500
+++ scumm.cpp	10 May 2005 22:56:11 -0000	1.501
@@ -72,6 +72,8 @@
 
 static int generateSubstResFileName_(const char *filename, char *buf, int bufsize, int index);
 
+using Common::File;
+
 namespace Scumm {
 
 // Use g_scumm from error() ONLY
@@ -2628,7 +2630,7 @@
 		uint8 md5sum[16];
 		const char *name = iter->_key.c_str();
 
-		if (md5_file(name, md5sum, 0, kMD5FileSizeLimit)) {
+		if (Common::md5_file(name, md5sum, 0, kMD5FileSizeLimit)) {
 			char md5str[32+1];
 			for (int j = 0; j < 16; j++) {
 				sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
@@ -2772,7 +2774,7 @@
 			game.platform = Common::kPlatformMacintosh;
 	}
 
-	if (md5_file(detectName, md5sum, ConfMan.get("path").c_str(), kMD5FileSizeLimit)) {
+	if (Common::md5_file(detectName, md5sum, ConfMan.get("path").c_str(), kMD5FileSizeLimit)) {
 		for (int j = 0; j < 16; j++) {
 			sprintf(gameMD5 + j*2, "%02x", (int)md5sum[j]);
 		}

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.456
retrieving revision 1.457
diff -u -d -r1.456 -r1.457
--- sound.cpp	10 May 2005 08:42:23 -0000	1.456
+++ sound.cpp	10 May 2005 22:56:11 -0000	1.457
@@ -165,7 +165,7 @@
 void Sound::setupHEMusicFile() {
 	int i, total_size;
 	char buf[32], buf1[128];
-	File musicFile;
+	Common::File musicFile;
 
 	sprintf(buf, "%s.he4", _vm->getGameName());
 
@@ -238,7 +238,7 @@
 
 		int music_offs;
 		char buf[32], buf1[128];
-		File musicFile;
+		Common::File musicFile;
 
 		sprintf(buf, "%s.he4", _vm->getGameName());
 
@@ -1397,7 +1397,7 @@
 		// Used in 3DO version of puttputt joins the parade and probably others
 		// Specifies a separate file to be used for music from what I gather.
 		int tmpsize;
-		File dmuFile;
+		Common::File dmuFile;
 		char buffer[128];
 		debugC(DEBUG_SOUND, "Found base tag FMUS in sound %d, size %d", idx, total_size);
 		debugC(DEBUG_SOUND, "It was at position %d", _fileHandle->pos());

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- sound.h	8 May 2005 14:31:27 -0000	1.86
+++ sound.h	10 May 2005 22:56:13 -0000	1.87
@@ -25,7 +25,9 @@
 #include "sound/audiostream.h"
 #include "sound/mixer.h"
 
-class File;
+namespace Common {
+	class File;
+}
 
 namespace Scumm {
 

Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/util.cpp,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -d -r2.10 -r2.11
--- util.cpp	5 May 2005 15:59:22 -0000	2.10
+++ util.cpp	10 May 2005 22:56:14 -0000	2.11
@@ -23,6 +23,8 @@
 #include "common/util.h"
 #include "common/md5.h"
 
+using Common::File;
+
 namespace Scumm {
 
 #pragma mark -
@@ -1197,7 +1199,7 @@
 	uint8 md5sum[16];
 
 	if (_ROMset == kROMsetNum) {
-		if (md5_file(filename, md5sum)) {
+		if (Common::md5_file(filename, md5sum)) {
 			char md5str[32+1];
 			for (int j = 0; j < 16; j++) {
 				sprintf(md5str + j*2, "%02x", (int)md5sum[j]);

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/util.h,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -d -r2.10 -r2.11
--- util.h	5 May 2005 15:59:22 -0000	2.10
+++ util.h	10 May 2005 22:56:14 -0000	2.11
@@ -27,7 +27,7 @@
 
 namespace Scumm {
 
-class BaseScummFile : public File {
+class BaseScummFile : public Common::File {
 public:
 	virtual void setEnc(byte value) = 0;
 	

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- vars.cpp	9 May 2005 02:59:45 -0000	1.134
+++ vars.cpp	10 May 2005 22:56:14 -0000	1.135
@@ -603,7 +603,7 @@
 			   &&  (_platform == Common::kPlatformPC)) {
 				if (_gameId == GID_LOOM) {
 					char buf[50];
-					File f;
+					Common::File f;
 					for (int i = 82; i < 86; i++) {
 						sprintf(buf, "%d.LFL", i);
 						f.open(buf);
@@ -612,7 +612,7 @@
 						f.close();
 					}
 				} else if (_gameId == GID_MONKEY_EGA) {
-						File f;
+						Common::File f;
 						f.open("DISK09.LEC");
 						if (f.isOpen() == false)
 							error("Native MIDI support requires Roland patch from LucasArts");

Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.79
retrieving revision 2.80
diff -u -d -r2.79 -r2.80
--- wiz_he.cpp	8 May 2005 10:59:32 -0000	2.79
+++ wiz_he.cpp	10 May 2005 22:56:14 -0000	2.80
@@ -1713,7 +1713,7 @@
 		break;
 	case 3:
 		if (params->processFlags & kWPFUseFile) {
-			File f;
+			Common::File f;
 
 			// Convert Windows path separators to something more portable
 			strncpy(buf, (const char *)params->filename, 512);
@@ -1722,7 +1722,7 @@
 					buf[i] = '/';
 			}
 
-			if (f.open((const char *)buf, File::kFileReadMode)) {
+			if (f.open((const char *)buf, Common::File::kFileReadMode)) {
 				uint32 id = f.readUint32LE();
 				if (id == TO_LE_32(MKID('AWIZ')) || id == TO_LE_32(MKID('MULT'))) {
 					uint32 size = f.readUint32BE();
@@ -1751,7 +1751,7 @@
 		break;
 	case 4:
 		if (params->processFlags & kWPFUseFile) {
-			File f;
+			Common::File f;
 
 			switch(params->fileWriteMode) {
 			case 2:
@@ -1768,7 +1768,7 @@
 						buf[i] = '/';
 				}
 
-				if (!f.open((const char *)buf, File::kFileWriteMode)) {
+				if (!f.open((const char *)buf, Common::File::kFileWriteMode)) {
 					warning("Unable to open for write '%s'", buf);
 					VAR(119) = -3;
 				} else {





More information about the Scummvm-git-logs mailing list