[Scummvm-cvs-logs] SF.net SVN: scummvm:[55690] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Jan 31 19:22:20 CET 2011


Revision: 55690
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55690&view=rev
Author:   strangerke
Date:     2011-01-31 18:22:20 +0000 (Mon, 31 Jan 2011)

Log Message:
-----------
Hugo: Some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/file.cpp
    scummvm/trunk/engines/hugo/file.h
    scummvm/trunk/engines/hugo/file_v1d.cpp
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/parser.cpp
    scummvm/trunk/engines/hugo/schedule.cpp

Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/file.cpp	2011-01-31 18:22:20 UTC (rev 55690)
@@ -171,9 +171,9 @@
 		_objectsArchive.seek(objBlock.objOffset, SEEK_SET);
 	} else {
 		Common::String buf;
-		buf = _vm->_picDir + Common::String(_vm->_text->getNoun(objPtr->nounIndex, 0)) + Common::String(".PIX");
+		buf = _vm->_picDir + Common::String(_vm->_text->getNoun(objPtr->nounIndex, 0)) + ".PIX";
 		if (!_objectsArchive.open(buf)) {
-			buf = Common::String(_vm->_text->getNoun(objPtr->nounIndex, 0)) + Common::String(".PIX");
+			buf = Common::String(_vm->_text->getNoun(objPtr->nounIndex, 0)) + ".PIX";
 			if (!_objectsArchive.open(buf))
 				error("File not found: %s", buf.c_str());
 		}
@@ -292,7 +292,7 @@
 /**
 * Return whether file exists or not
 */
-bool FileManager::fileExists(Common::String filename) {
+bool FileManager::fileExists(const Common::String filename) const {
 	Common::File f;
 	return(f.exists(filename));
 }
@@ -300,7 +300,7 @@
 /**
 * Save game to supplied slot
 */
-bool FileManager::saveGame(int16 slot, Common::String descrip) {
+bool FileManager::saveGame(int16 slot, const Common::String descrip) {
 	debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip.c_str());
 
 	const EnginePlugin *plugin = NULL;

Modified: scummvm/trunk/engines/hugo/file.h
===================================================================
--- scummvm/trunk/engines/hugo/file.h	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/file.h	2011-01-31 18:22:20 UTC (rev 55690)
@@ -44,7 +44,7 @@
 	FileManager(HugoEngine *vm);
 	virtual ~FileManager();
 
-	bool     fileExists(Common::String filename);
+	bool     fileExists(const Common::String filename) const;
 	sound_pt getSound(int16 sound, uint16 *size);
 
 	void     readBootFile();
@@ -52,7 +52,7 @@
 	void     readUIFImages();
 	void     readUIFItem(int16 id, byte *buf);
 	bool     restoreGame(int16 slot);
-	bool     saveGame(int16 slot, Common::String descrip);
+	bool     saveGame(int16 slot, const Common::String descrip);
 
 	// Name scenery and objects picture databases
 	const char *getBootFilename()    { return "HUGO.BSF";    }

Modified: scummvm/trunk/engines/hugo/file_v1d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file_v1d.cpp	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/file_v1d.cpp	2011-01-31 18:22:20 UTC (rev 55690)
@@ -85,7 +85,7 @@
 	debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
 
 	Common::String buf;
-	buf = Common::String(_vm->_text->getScreenNames(screenIndex)) + Common::String(".ART");
+	buf = Common::String(_vm->_text->getScreenNames(screenIndex)) + ".ART";
 	if (!_sceneryArchive1.open(buf))
 		error("File not found: %s", buf.c_str());
 	// Read the image into dummy seq and static dib_a

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2011-01-31 18:22:20 UTC (rev 55690)
@@ -826,27 +826,27 @@
 	switch (_gameVariant) {
 	case kGameVariantH1Dos:
 		_episode = "\"Hugo's House of Horrors\"";
-		_picDir = Common::String("");
+		_picDir = "";
 		break;
 	case kGameVariantH2Dos:
 		_episode = "\"Hugo II: Whodunit?\"";
-		_picDir = Common::String("");
+		_picDir = "";
 		break;
 	case kGameVariantH3Dos:
 		_episode = "\"Hugo III: Jungle of Doom\"";
-		_picDir = Common::String("pictures/");
+		_picDir = "pictures/";
 		break;
 	case kGameVariantH1Win:
 		_episode = "\"Hugo's Horrific Adventure\"";
-		_picDir = Common::String("hugo1/");
+		_picDir = "hugo1/";
 		break;
 	case kGameVariantH2Win:
 		_episode = "\"Hugo's Mystery Adventure\"";
-		_picDir = Common::String("hugo2/");
+		_picDir = "hugo2/";
 		break;
 	case kGameVariantH3Win:
 		_episode = "\"Hugo's Amazon Adventure\"";
-		_picDir = Common::String("hugo3/");
+		_picDir = "hugo3/";
 		break;
 	default:
 		error("Unknown game");

Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/parser.cpp	2011-01-31 18:22:20 UTC (rev 55690)
@@ -320,7 +320,6 @@
 	for (int i = 0; i < _vm->_object->_numObj; i++) { // Find widths of 2 columns
 		if (_vm->_object->isCarried(i)) {
 			uint16 len = strlen(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2));
-			printf("%s %d\n", _vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2), strlen(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)));
 			if (index++ & 1)                        // Right hand column
 				len2 = (len > len2) ? len : len2;
 			else
@@ -336,18 +335,18 @@
 	assert(len1 + len2 - strlen(_vm->_text->getTextParser(kTBIntro)) / 2 < strlen(blanks));
 	buffer = Common::String(blanks, (len1 + len2 - strlen(_vm->_text->getTextParser(kTBIntro))) / 2);
 
-	buffer += Common::String(_vm->_text->getTextParser(kTBIntro)) + Common::String("\n");
+	buffer += Common::String(_vm->_text->getTextParser(kTBIntro)) + "\n";
 	index = 0;
 	for (int i = 0; i < _vm->_object->_numObj; i++) { // Assign strings
 		if (_vm->_object->isCarried(i)) {
 			if (index++ & 1)
-				buffer += Common::String(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)) + Common::String("\n");
+				buffer += Common::String(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)) + "\n";
 			else
 				buffer += Common::String(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)) + Common::String(blanks, len1 - strlen(_vm->_text->getNoun(_vm->_object->_objects[i].nounIndex, 2)));
 		}
 	}
 	if (index & 1)
-		buffer += Common::String("\n");
+		buffer += "\n";
 	buffer += Common::String(_vm->_text->getTextParser(kTBOutro));
 	Utils::Box(kBoxAny, "%s", buffer.c_str());
 }

Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp	2011-01-31 18:18:39 UTC (rev 55689)
+++ scummvm/trunk/engines/hugo/schedule.cpp	2011-01-31 18:22:20 UTC (rev 55690)
@@ -163,8 +163,8 @@
 	// Make sure the background file exists!
 	if (!_vm->isPacked()) {
 		Common::String filename = Common::String(_vm->_text->getScreenNames(screenIndex));
-		if (!_vm->_file->fileExists(_vm->_picDir + filename + Common::String(".PCX")) &&
-			!_vm->_file->fileExists(filename + Common::String(".ART"))) {
+		if (!_vm->_file->fileExists(_vm->_picDir + filename + ".PCX") &&
+			!_vm->_file->fileExists(filename + ".ART")) {
 				error("Unable to find background file for %s", filename.c_str());
 			return;
 		}


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