[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.6,2.7 resource.cpp,1.42,1.43 script_v8.cpp,2.59,2.60 scumm.h,1.112,1.113

James Brown ender at users.sourceforge.net
Thu Dec 26 16:12:02 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv4286/scumm

Modified Files:
	charset.cpp resource.cpp script_v8.cpp scumm.h 
Log Message:
Move some things around, to get rid of all these resource/ sprintf's for CMI


Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- charset.cpp	26 Dec 2002 01:47:40 -0000	2.6
+++ charset.cpp	27 Dec 2002 00:11:01 -0000	2.7
@@ -397,7 +397,7 @@
 	
 	for (int i = 0; i < 4; i++) {
 		char fontname[256];
-		sprintf(fontname, "resource/font%d.nut", i);
+		sprintf(fontname, "font%d.nut", i);
 		warning("Loading charset %s\n", fontname);
 		_fr[i] = new NutRenderer(_vm);
 		if (!(_fr[i]->loadFont(fontname, _vm->getGameDataPath()))) {

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- resource.cpp	26 Dec 2002 01:46:36 -0000	1.42
+++ resource.cpp	27 Dec 2002 00:11:01 -0000	1.43
@@ -194,7 +194,7 @@
 	}
 
 	strcpy(buf, filename);
-	_fileHandle.open(buf, getGameDataPath(), 1, _encbyte);
+	_fileHandle.open(buf, getResDataPath(), 1, _encbyte);
 
 	return _fileHandle.isOpen();
 }

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.59
retrieving revision 2.60
diff -u -d -r2.59 -r2.60
--- script_v8.cpp	26 Dec 2002 23:42:28 -0000	2.59
+++ script_v8.cpp	27 Dec 2002 00:11:01 -0000	2.60
@@ -1283,8 +1283,7 @@
 	char dirName[255];
 	int len = resStrLen((char*)_scriptPointer);
 	
-	sprintf(dirName, "%s/resource/", getGameDataPath());
-	warning("o8_startVideo(%s/%s)\n", dirName, (char*)_scriptPointer);
+	warning("o8_startVideo(%s/%s)\n", getGameDataPath(), (char*)_scriptPointer);
 	
 	//ScummRenderer * sr = new ScummRenderer(this, 1000/14);
 	//SmushPlayer * sp = new SmushPlayer(sr);

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- scumm.h	26 Dec 2002 21:50:13 -0000	1.112
+++ scumm.h	27 Dec 2002 00:11:01 -0000	1.113
@@ -280,6 +280,16 @@
 	int scummLoop(int delta);
 	void initScummVars();
 
+	const char *getResDataPath() const {return _gameDataPath;}
+	const char *getGameDataPath() const {
+		if (_features & GF_AFTER_V8) {
+			char resourcePath[255];
+			sprintf(resourcePath, "%s/resource", _gameDataPath);
+			return resourcePath;
+		}
+		return _gameDataPath; 
+	}
+
 	void pauseGame(bool user);
 	void shutDown(int i);
 	void setOptions(void);





More information about the Scummvm-git-logs mailing list