[Scummvm-cvs-logs] SF.net SVN: scummvm:[55634] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Jan 29 23:47:53 CET 2011


Revision: 55634
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55634&view=rev
Author:   drmccoy
Date:     2011-01-29 22:47:53 +0000 (Sat, 29 Jan 2011)

Log Message:
-----------
GOB: Add Script::evalInt() and Script::evalString()

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_playtoons.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/inter_v4.cpp
    scummvm/trunk/engines/gob/inter_v5.cpp
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/inter_v7.cpp
    scummvm/trunk/engines/gob/script.cpp
    scummvm/trunk/engines/gob/script.h
    scummvm/trunk/engines/gob/sound/sound.cpp
    scummvm/trunk/engines/gob/sound/sound.h

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter.h	2011-01-29 22:47:53 UTC (rev 55634)
@@ -558,7 +558,7 @@
 	void o6_removeHotspot(OpFuncParams &params);
 	void o6_fillRect(OpFuncParams &params);
 
-	void probe16bitMusic(char *fileName);
+	void probe16bitMusic(Common::String &fileName);
 };
 
 class Inter_Playtoons : public Inter_v6 {

Modified: scummvm/trunk/engines/gob/inter_playtoons.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_playtoons.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_playtoons.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -210,20 +210,10 @@
 }
 
 void Inter_Playtoons::oPlaytoons_checkData(OpFuncParams &params) {
-	int16 handle;
-	uint16 varOff;
-	int32 size;
-	char *backSlash;
-	SaveLoad::SaveMode mode;
+	const char *file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	varOff = _vm->_game->_script->readVarIndex();
+	uint16 varOff = _vm->_game->_script->readVarIndex();
 
-	size = -1;
-	handle = 1;
-
-	char *file = _vm->_game->_script->getResultStr();
-
 	// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
 	// In this case, "@:\" is replaced by the CD drive letter.
 	// As the files are copied on the HDD, those characters are skipped.
@@ -245,12 +235,15 @@
 	}
 
 	// WORKAROUND: In the Playtoons stick files found in german Addy 4, some paths are hardcoded
-	if ((backSlash = strrchr(file, '\\'))) {
+	const char *backSlash = strrchr(file, '\\');
+	if (backSlash) {
 		debugC(2, kDebugFileIO, "oPlaytoons_checkData: \"%s\" instead of \"%s\"", backSlash + 1, file);
 		file = backSlash + 1;
 	}
 
-	mode = _vm->_saveLoad->getSaveMode(file);
+	int32 size   = -1;
+	int16 handle = 1;
+	SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeNone) {
 		size = _vm->_dataIO->fileSize(file);
 		if (size == -1)
@@ -272,22 +265,13 @@
 }
 
 void Inter_Playtoons::oPlaytoons_readData(OpFuncParams &params) {
-	int32 retSize;
-	int32 size;
-	int32 offset;
-	uint16 dataVar;
-	byte *buf;
-	SaveLoad::SaveMode mode;
+	const char *file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	dataVar = _vm->_game->_script->readVarIndex();
-	size = _vm->_game->_script->readValExpr();
-	_vm->_game->_script->evalExpr(0);
-	offset = _vm->_game->_script->getResultInt();
-	retSize = 0;
+	uint16 dataVar = _vm->_game->_script->readVarIndex();
+	int32  size    = _vm->_game->_script->readValExpr();
+	int32  offset  = _vm->_game->_script->evalInt();
+	int32  retSize = 0;
 
-	char *file = _vm->_game->_script->getResultStr();
-
 	// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
 	// In this case, "@:\" is replaced by the CD drive letter.
 	// As the files are copied on the HDD, those characters are skipped.
@@ -299,7 +283,7 @@
 	debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
 			file, dataVar, size, offset);
 
-	mode = _vm->_saveLoad->getSaveMode(file);
+	SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeSave) {
 
 		WRITE_VAR(1, 1);
@@ -324,7 +308,7 @@
 		size = _vm->_game->_script->getVariablesCount() * 4;
 	}
 
-	buf = _variables->getAddressOff8(dataVar);
+	byte *buf = _variables->getAddressOff8(dataVar);
 
 	if (file[0] == 0) {
 		WRITE_VAR(1, size);
@@ -417,36 +401,28 @@
 }
 
 void Inter_Playtoons::oPlaytoons_copyFile() {
-	char fileName1[128];
-	char fileName2[128];
+	Common::String file1 = _vm->_game->_script->evalString();
+	Common::String file2 = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName1, _vm->_game->_script->getResultStr(), 128);
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName2, _vm->_game->_script->getResultStr(), 128);
-
-	warning("Playtoons Stub: copy file from \"%s\" to \"%s\"", fileName1, fileName2);
+	warning("Playtoons Stub: copy file from \"%s\" to \"%s\"", file1.c_str(), file2.c_str());
 }
 
 void Inter_Playtoons::oPlaytoons_openItk() {
-	char fileName[128];
-	char *backSlash;
+	const char *fileName  = _vm->_game->_script->evalString();
+	const char *backSlash = strrchr(fileName, '\\');
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 124);
+	Common::String file;
+	if (backSlash) {
+		debugC(2, kDebugFileIO, "Opening ITK file \"%s\" instead of \"%s\"",
+				backSlash + 1, fileName);
+		file = backSlash + 1;
+	} else
+		file = fileName;
 
-	if (!strchr(fileName, '.'))
-		strcat(fileName, ".ITK");
+	if (!file.contains('.'))
+		file += ".ITK";
 
-	// Workaround for Bambou : In the script, the path is hardcoded (!!)
-	if ((backSlash = strrchr(fileName, '\\'))) {
-		debugC(2, kDebugFileIO, "Opening ITK file \"%s\" instead of \"%s\"", backSlash + 1, fileName);
-		_vm->_dataIO->openArchive(backSlash + 1, false);
-	} else
-		_vm->_dataIO->openArchive(fileName, false);
-	// All the other checks are meant to verify (if not found at the first try)
-	// if the file is present on the CD or not. As everything is supposed to
-	// be copied, those checks are skipped
+	_vm->_dataIO->openArchive(file, false);
 }
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -612,9 +612,8 @@
 }
 
 void Inter_v1::o1_playCDTrack() {
-	_vm->_game->_script->evalExpr(0);
 	_vm->_sound->adlibPlayBgMusic(); // Mac version
-	_vm->_sound->cdPlay(_vm->_game->_script->getResultStr()); // PC CD version
+	_vm->_sound->cdPlay(_vm->_game->_script->evalString()); // PC CD version
 }
 
 void Inter_v1::o1_getCDTrackPos() {
@@ -960,8 +959,7 @@
 void Inter_v1::o1_loadTot(OpFuncParams &params) {
 	if ((_vm->_game->_script->peekByte() & 0x80) != 0) {
 		_vm->_game->_script->skip(1);
-		_vm->_game->_script->evalExpr(0);
-		_vm->_game->_totToLoad = _vm->_game->_script->getResultStr();
+		_vm->_game->_totToLoad = _vm->_game->_script->evalString();
 	} else {
 		uint8 size = _vm->_game->_script->readInt8();
 		_vm->_game->_totToLoad = Common::String(_vm->_game->_script->readString(size), size);
@@ -1585,13 +1583,11 @@
 }
 
 void Inter_v1::o1_checkData(OpFuncParams &params) {
-	int16 varOff;
+	const char *file   = _vm->_game->_script->evalString();
+	      int16 varOff = _vm->_game->_script->readVarIndex();
 
-	_vm->_game->_script->evalExpr(0);
-	varOff = _vm->_game->_script->readVarIndex();
-
-	if (!_vm->_dataIO->hasFile(_vm->_game->_script->getResultStr())) {
-		warning("File \"%s\" not found", _vm->_game->_script->getResultStr());
+	if (!_vm->_dataIO->hasFile(file)) {
+		warning("File \"%s\" not found", file);
 		WRITE_VAR_OFFSET(varOff, (uint32) -1);
 	} else
 		WRITE_VAR_OFFSET(varOff, 50); // "handle" between 50 and 128 = in archive
@@ -1683,12 +1679,11 @@
 }
 
 void Inter_v1::o1_loadFont(OpFuncParams &params) {
-	_vm->_game->_script->evalExpr(0);
-	uint16 index = _vm->_game->_script->readInt16();
+	const char  *font  = _vm->_game->_script->evalString();
+	      uint16 index = _vm->_game->_script->readInt16();
 
 	_vm->_draw->animateCursor(4);
-
-	_vm->_draw->loadFont(index, _vm->_game->_script->getResultStr());
+	_vm->_draw->loadFont(index, font);
 }
 
 void Inter_v1::o1_freeFont(OpFuncParams &params) {
@@ -1706,20 +1701,15 @@
 }
 
 void Inter_v1::o1_readData(OpFuncParams &params) {
-	int16 retSize;
-	int16 size;
-	int16 dataVar;
-	int16 offset;
+	const char *file    = _vm->_game->_script->evalString();
+	      int16 dataVar = _vm->_game->_script->readVarIndex();
+	      int16 size    = _vm->_game->_script->readValExpr();
+	      int16 offset  = _vm->_game->_script->readValExpr();
+	      int16 retSize = 0;
 
-	_vm->_game->_script->evalExpr(0);
-	dataVar = _vm->_game->_script->readVarIndex();
-	size = _vm->_game->_script->readValExpr();
-	offset = _vm->_game->_script->readValExpr();
-	retSize = 0;
-
 	WRITE_VAR(1, 1);
 
-	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(_vm->_game->_script->getResultStr());
+	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(file);
 	if (!stream)
 		return;
 
@@ -1741,28 +1731,25 @@
 }
 
 void Inter_v1::o1_writeData(OpFuncParams &params) {
-	int16 offset;
-	int16 size;
-	int16 dataVar;
-
 	// This writes into a file. It's not portable and isn't needed anyway
 	// (Gobliiins 1 doesn't use save file), so we just warn should it be
 	// called regardless.
 
-	_vm->_game->_script->evalExpr(0);
-	dataVar = _vm->_game->_script->readVarIndex();
-	size = _vm->_game->_script->readValExpr();
-	offset = _vm->_game->_script->readValExpr();
+	const char *file = _vm->_game->_script->evalString();
 
-	warning("Attempted to write to file \"%s\"", _vm->_game->_script->getResultStr());
+	int16 dataVar = _vm->_game->_script->readVarIndex();
+	int16 size    = _vm->_game->_script->readValExpr();
+	int16 offset  = _vm->_game->_script->readValExpr();
+
+	warning("Attempted to write to file \"%s\" (%d, %d, %d)", file, dataVar, size, offset);
 	WRITE_VAR(1, 0);
 }
 
 void Inter_v1::o1_manageDataFile(OpFuncParams &params) {
-	_vm->_game->_script->evalExpr(0);
+	Common::String file = _vm->_game->_script->evalString();
 
-	if (_vm->_game->_script->getResultStr()[0] != 0)
-		_vm->_dataIO->openArchive(_vm->_game->_script->getResultStr(), true);
+	if (!file.empty())
+		_vm->_dataIO->openArchive(file, true);
 	else
 		_vm->_dataIO->closeArchive(true);
 }

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -513,8 +513,7 @@
 	if (!(_vm->_draw->_renderFlags & RENDERFLAG_NOBLITINVALIDATED))
 		_vm->_draw->blitInvalidated();
 
-	_vm->_game->_script->evalExpr(0);
-	_vm->_sound->cdPlay(_vm->_game->_script->getResultStr());
+	_vm->_sound->cdPlay(_vm->_game->_script->evalString());
 }
 
 void Inter_v2::o2_waitCDTrackEnd() {
@@ -529,13 +528,10 @@
 }
 
 void Inter_v2::o2_readLIC() {
-	char path[40];
+	Common::String file = _vm->_game->_script->evalString();
+	file += ".LIC";
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(path, _vm->_game->_script->getResultStr(), 36);
-	strcat(path, ".LIC");
-
-	_vm->_sound->cdLoadLIC(path);
+	_vm->_sound->cdLoadLIC(file.c_str());
 }
 
 void Inter_v2::o2_freeLIC() {
@@ -569,34 +565,27 @@
 }
 
 void Inter_v2::o2_totSub() {
-	char totFile[14];
-	byte length;
-	int flags;
-	int i;
-
-	length = _vm->_game->_script->readByte();
+	uint8 length = _vm->_game->_script->readByte();
 	if ((length & 0x7F) > 13)
 		error("Length in o2_totSub is greater than 13 (%d)", length);
 
-	if (length & 0x80) {
-		_vm->_game->_script->evalExpr(0);
-		strcpy(totFile, _vm->_game->_script->getResultStr());
-	} else {
-		for (i = 0; i < length; i++)
-			totFile[i] = _vm->_game->_script->readChar();
-		totFile[i] = 0;
-	}
+	Common::String totFile;
+	if (length & 0x80)
+		totFile = _vm->_game->_script->evalString();
+	else
+		for (uint8 i = 0; i < length; i++)
+			totFile += _vm->_game->_script->readChar();
 
 	// WORKAROUND: There is a race condition in the script when opening the notepad
-	if (!scumm_stricmp(totFile, "edit"))
+	if (!totFile.equalsIgnoreCase("edit"))
 		_vm->_util->forceMouseUp();
 
 	// WORKAROUND: For some reason, the variable indicating which TOT to load next
 	// is overwritten in the guard house card game in Woodruff
-	if ((_vm->getGameType() == kGameTypeWoodruff) && !scumm_stricmp(totFile, "6"))
-		strcpy(totFile, "EMAP2011");
+	if ((_vm->getGameType() == kGameTypeWoodruff) && (totFile == "6"))
+		totFile = "EMAP2011";
 
-	flags = _vm->_game->_script->readByte();
+	uint8 flags = _vm->_game->_script->readByte();
 
 	_vm->_game->totSub(flags, totFile);
 }
@@ -947,15 +936,10 @@
 }
 
 void Inter_v2::o2_playImd() {
-	char imd[128];
-	bool close;
-
-	_vm->_game->_script->evalExpr(0);
-	_vm->_game->_script->getResultStr()[8] = 0;
-	Common::strlcpy(imd, _vm->_game->_script->getResultStr(), 128);
-
 	VideoPlayer::Properties props;
 
+	Common::String imd = Common::String(_vm->_game->_script->evalString(), 8);
+
 	props.x          = _vm->_game->_script->readValExpr();
 	props.y          = _vm->_game->_script->readValExpr();
 	props.startFrame = _vm->_game->_script->readValExpr();
@@ -967,12 +951,12 @@
 	props.palCmd     = 1 << (props.flags & 0x3F);
 
 	debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
-			"paletteCmd %d (%d - %d), flags %X", imd,
+			"paletteCmd %d (%d - %d), flags %X", imd.c_str(),
 			props.x, props.y, props.startFrame, props.lastFrame,
 			props.palCmd, props.palStart, props.palEnd, props.flags);
 
 	int slot = 0;
-	if (imd[0] != 0) {
+	if (!imd.empty()) {
 		_vm->_vidPlayer->evaluateFlags(props);
 		if ((slot = _vm->_vidPlayer->openVideo(true, imd, props)) < 0) {
 			WRITE_VAR(11, (uint32) -1);
@@ -980,7 +964,7 @@
 		}
 	}
 
-	close = (props.lastFrame == -1);
+	bool close = (props.lastFrame == -1);
 	if (props.startFrame == -2) {
 		props.startFrame = 0;
 		props.lastFrame  = 0;
@@ -995,36 +979,29 @@
 }
 
 void Inter_v2::o2_getImdInfo() {
-	int16 varX, varY;
-	int16 varFrames;
-	int16 varWidth, varHeight;
+	Common::String imd = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	varX      = _vm->_game->_script->readVarIndex();
-	varY      = _vm->_game->_script->readVarIndex();
-	varFrames = _vm->_game->_script->readVarIndex();
-	varWidth  = _vm->_game->_script->readVarIndex();
-	varHeight = _vm->_game->_script->readVarIndex();
+	int16 varX      = _vm->_game->_script->readVarIndex();
+	int16 varY      = _vm->_game->_script->readVarIndex();
+	int16 varFrames = _vm->_game->_script->readVarIndex();
+	int16 varWidth  = _vm->_game->_script->readVarIndex();
+	int16 varHeight = _vm->_game->_script->readVarIndex();
 
 	// WORKAROUND: The nut rolling animation in the administration center
 	// in Woodruff is called "noixroul", but the scripts think it's "noixroule".
 	if ((_vm->getGameType() == kGameTypeWoodruff) &&
-			(!scumm_stricmp(_vm->_game->_script->getResultStr(), "noixroule")))
-		strcpy(_vm->_game->_script->getResultStr(), "noixroul");
+	    imd.equalsIgnoreCase("noixroule"))
+		imd = "noixroul";
 
-	_vm->_vidPlayer->writeVideoInfo(_vm->_game->_script->getResultStr(), varX, varY,
-			varFrames, varWidth, varHeight);
+	_vm->_vidPlayer->writeVideoInfo(imd, varX, varY, varFrames, varWidth, varHeight);
 }
 
 void Inter_v2::o2_openItk() {
-	char fileName[32];
+	Common::String file = _vm->_game->_script->evalString();
+	if (!file.contains('.'))
+		file += ".ITK";
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 28);
-	if (!strchr(fileName, '.'))
-		strcat(fileName, ".ITK");
-
-	_vm->_dataIO->openArchive(fileName, false);
+	_vm->_dataIO->openArchive(file, false);
 }
 
 void Inter_v2::o2_closeItk() {
@@ -1263,62 +1240,45 @@
 }
 
 void Inter_v2::o2_checkData(OpFuncParams &params) {
-	int16 varOff;
-	int32 size;
-	SaveLoad::SaveMode mode;
+	Common::String file = _vm->_game->_script->evalString();
+	int16 varOff = _vm->_game->_script->readVarIndex();
 
-	_vm->_game->_script->evalExpr(0);
-	varOff = _vm->_game->_script->readVarIndex();
-
-	size = -1;
-
-	char *file = _vm->_game->_script->getResultStr();
-
 	// WORKAROUND: For some reason, the variable indicating which TOT to load next
 	// is overwritten in the guard house card game in Woodruff.
-	if ((_vm->getGameType() == kGameTypeWoodruff) && !scumm_stricmp(file, "6.TOT"))
-		strcpy(file, "EMAP2011.TOT");
+	if ((_vm->getGameType() == kGameTypeWoodruff) && file.equalsIgnoreCase("6.tot"))
+		file = "EMAP2011.TOT";
 
-	mode = _vm->_saveLoad->getSaveMode(file);
+	int32 size = -1;
+	SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file.c_str());
 	if (mode == SaveLoad::kSaveModeNone) {
 
 		size = _vm->_dataIO->fileSize(file);
 		if (size == -1)
-			warning("File \"%s\" not found", file);
+			warning("File \"%s\" not found", file.c_str());
 
 	} else if (mode == SaveLoad::kSaveModeSave)
-		size = _vm->_saveLoad->getSize(file);
+		size = _vm->_saveLoad->getSize(file.c_str());
 	else if (mode == SaveLoad::kSaveModeExists)
 		size = 23;
 
-	debugC(2, kDebugFileIO, "Requested size of file \"%s\": %d",
-			file, size);
+	debugC(2, kDebugFileIO, "Requested size of file \"%s\": %d", file.c_str(), size);
 
 	WRITE_VAR_OFFSET(varOff, (size == -1) ? -1 : 50);
 	WRITE_VAR(16, (uint32) size);
 }
 
 void Inter_v2::o2_readData(OpFuncParams &params) {
-	int32 retSize;
-	int32 size;
-	int32 offset;
-	int16 dataVar;
-	byte *buf;
-	SaveLoad::SaveMode mode;
+	const char *file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	dataVar = _vm->_game->_script->readVarIndex();
-	size = _vm->_game->_script->readValExpr();
-	_vm->_game->_script->evalExpr(0);
-	offset = _vm->_game->_script->getResultInt();
-	retSize = 0;
+	uint16 dataVar = _vm->_game->_script->readVarIndex();
+	int32  size    = _vm->_game->_script->readValExpr();
+	int32  offset  = _vm->_game->_script->evalInt();
+	int32  retSize = 0;
 
-	char *file = _vm->_game->_script->getResultStr();
-
 	debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
 			file, dataVar, size, offset);
 
-	mode = _vm->_saveLoad->getSaveMode(file);
+	SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeSave) {
 
 		WRITE_VAR(1, 1);
@@ -1345,7 +1305,7 @@
 		size = _vm->_game->_script->getVariablesCount() * 4;
 	}
 
-	buf = _variables->getAddressOff8(dataVar);
+	byte *buf = _variables->getAddressOff8(dataVar);
 
 	if (file[0] == 0) {
 		WRITE_VAR(1, size);
@@ -1379,25 +1339,18 @@
 }
 
 void Inter_v2::o2_writeData(OpFuncParams &params) {
-	int32 offset;
-	int32 size;
-	int16 dataVar;
-	SaveLoad::SaveMode mode;
+	const char *file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	dataVar = _vm->_game->_script->readVarIndex();
-	size = _vm->_game->_script->readValExpr();
-	_vm->_game->_script->evalExpr(0);
-	offset = _vm->_game->_script->getResultInt();
+	int16 dataVar = _vm->_game->_script->readVarIndex();
+	int32 size    = _vm->_game->_script->readValExpr();
+	int32 offset  = _vm->_game->_script->evalInt();
 
-	char *file = _vm->_game->_script->getResultStr();
-
 	debugC(2, kDebugFileIO, "Write to file \"%s\" (%d, %d bytes at %d)",
 			file, dataVar, size, offset);
 
 	WRITE_VAR(1, 1);
 
-	mode = _vm->_saveLoad->getSaveMode(file);
+	SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeSave) {
 
 		if (!_vm->_saveLoad->save(file, dataVar, size, offset)) {

Modified: scummvm/trunk/engines/gob/inter_v4.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v4.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v4.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -141,17 +141,12 @@
 }
 
 void Inter_v4::o4_playVmdOrMusic() {
-	char fileName[128];
-	bool close;
+	Common::String file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 128);
-
 	// WORKAROUND: The nut rolling animation in the administration center
 	// in Woodruff is called "noixroul", but the scripts think it's "noixroule".
-	if ((_vm->getGameType() == kGameTypeWoodruff) &&
-			(!scumm_stricmp(fileName, "noixroule")))
-		strcpy(fileName, "noixroul");
+	if ((_vm->getGameType() == kGameTypeWoodruff) && file.equalsIgnoreCase("noixroule"))
+		file = "noixroul";
 
 	VideoPlayer::Properties props;
 
@@ -166,11 +161,11 @@
 	props.palCmd     = 1 << (props.flags & 0x3F);
 
 	debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
-			"paletteCmd %d (%d - %d), flags %X", fileName,
+			"paletteCmd %d (%d - %d), flags %X", file.c_str(),
 			props.x, props.y, props.startFrame, props.lastFrame,
 			props.palCmd, props.palStart, props.palEnd, props.flags);
 
-	close = false;
+	bool close = false;
 	if (props.lastFrame == -1) {
 		close = true;
 	} else if (props.lastFrame == -2) {
@@ -187,7 +182,7 @@
 		uint32 x = props.x;
 		uint32 y = props.y;
 
-		int slot = _vm->_vidPlayer->openVideo(false, fileName, props);
+		int slot = _vm->_vidPlayer->openVideo(false, file, props);
 
 		_vm->_mult->_objects[props.startFrame].videoSlot = slot + 1;
 
@@ -201,7 +196,7 @@
 
 		return;
 	} else if (props.lastFrame == -4) {
-		warning("Woodruff Stub: Video/Music command -4: Play background video %s", fileName);
+		warning("Woodruff Stub: Video/Music command -4: Play background video %s", file.c_str());
 		return;
 	} else if (props.lastFrame == -5) {
 		_vm->_sound->bgStop();
@@ -211,15 +206,15 @@
 	} else if (props.lastFrame == -7) {
 		return;
 	} else if (props.lastFrame == -8) {
-		warning("Woodruff Stub: Video/Music command -8: Play background video %s", fileName);
+		warning("Woodruff Stub: Video/Music command -8: Play background video %s", file.c_str());
 		return;
 	} else if (props.lastFrame == -9) {
 		_vm->_sound->bgStop();
 		_vm->_sound->bgSetPlayMode(BackgroundAtmosphere::kPlayModeRandom);
-		_vm->_sound->bgPlay(fileName, "SND", SOUND_SND, props.palStart);
+		_vm->_sound->bgPlay(file.c_str(), "SND", SOUND_SND, props.palStart);
 		return;
 	} else if (props.lastFrame < 0) {
-		warning("Unknown Video/Music command: %d, %s", props.lastFrame, fileName);
+		warning("Unknown Video/Music command: %d, %s", props.lastFrame, file.c_str());
 		return;
 	}
 
@@ -232,7 +227,7 @@
 	_vm->_vidPlayer->evaluateFlags(props);
 
 	int slot = 0;
-	if ((fileName[0] != 0) && ((slot = _vm->_vidPlayer->openVideo(true, fileName, props)) < 0)) {
+	if (!file.empty() && ((slot = _vm->_vidPlayer->openVideo(true, file, props)) < 0)) {
 		WRITE_VAR(11, (uint32) -1);
 		return;
 	}

Modified: scummvm/trunk/engines/gob/inter_v5.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v5.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v5.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -100,8 +100,7 @@
 }
 
 void Inter_v5::o5_deleteFile() {
-	_vm->_game->_script->evalExpr(0);
-	char *file = _vm->_game->_script->getResultStr();
+	const char *file =_vm->_game->_script->evalString();
 
 	debugC(2, kDebugFileIO, "Delete file \"%s\"", file);
 

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -73,26 +73,18 @@
 }
 
 void Inter_v6::o6_totSub() {
-	char totFile[14];
-	byte length;
-	int flags;
-	int i;
-
-	length = _vm->_game->_script->readByte();
+	uint8 length = _vm->_game->_script->readByte();
 	if ((length & 0x7F) > 13)
 		error("Length in o6_totSub is greater than 13 (%d)", length);
 
-	if (length & 0x80) {
-		_vm->_game->_script->evalExpr(0);
-		strcpy(totFile, _vm->_game->_script->getResultStr());
-	} else {
-		for (i = 0; i < length; i++)
-			totFile[i] = _vm->_game->_script->readChar();
-		totFile[i] = 0;
-	}
+	Common::String totFile;
+	if (length & 0x80)
+		totFile = _vm->_game->_script->evalString();
+	else
+		for (uint8 i = 0; i < length; i++)
+			totFile += _vm->_game->_script->readChar();
 
-	flags = _vm->_game->_script->readByte();
-
+	uint8 flags = _vm->_game->_script->readByte();
 	if (flags & 0x40)
 		warning("Urban Stub: o6_totSub(), flags & 0x40");
 
@@ -100,12 +92,8 @@
 }
 
 void Inter_v6::o6_playVmdOrMusic() {
-	char fileName[128];
-	bool close;
+	Common::String file = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 128);
-
 	VideoPlayer::Properties props;
 
 	props.x          = _vm->_game->_script->readValExpr();
@@ -120,22 +108,22 @@
 	props.forceSeek  = true;
 
 	debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
-			"paletteCmd %d (%d - %d), flags %X", fileName,
+			"paletteCmd %d (%d - %d), flags %X", file.c_str(),
 			props.x, props.y, props.startFrame, props.lastFrame,
 			props.palCmd, props.palStart, props.palEnd, props.flags);
 
 	// WORKAROUND: When taking the music sheet from Dr. Dramish's car,
 	//             the video that lets the sheet vanish is missing. We'll
 	//             play the one where the sheet is already gone instead.
-	if (!strcmp(fileName, "MXRAMPART") && _vm->isCurrentTot("avt005.tot"))
-		strcpy(fileName, "PLCOFDR2");
+	if (_vm->isCurrentTot("avt005.tot") && file.equalsIgnoreCase("MXRAMPART"))
+		file = "PLCOFDR2";
 
-	if (!strcmp(fileName, "RIEN")) {
+	if (file == "RIEN") {
 		_vm->_vidPlayer->closeAll();
 		return;
 	}
 
-	close = false;
+	bool close = false;
 	if (props.lastFrame == -1) {
 		close = true;
 	} else if (props.lastFrame == -5) {
@@ -149,16 +137,16 @@
 //		warning("Urban/Playtoons Stub: Video/Music command -6 (flush cache)");
 		return;
 	} else if ((props.lastFrame == -8) || (props.lastFrame == -9)) {
-		if (!strchr(fileName, '.'))
-			strcat(fileName, ".WA8");
+		if (!file.contains('.'))
+			file += ".WA8";
 
-		probe16bitMusic(fileName);
+		probe16bitMusic(file);
 
 		if (props.lastFrame == -9)
 			debugC(0, kDebugVideo, "Urban/Playtoons Stub: Delayed music stop?");
 
 		_vm->_sound->bgStop();
-		_vm->_sound->bgPlay(fileName, SOUND_WAV);
+		_vm->_sound->bgPlay(file.c_str(), SOUND_WAV);
 		return;
 	} else if (props.lastFrame <= -10) {
 		_vm->_vidPlayer->closeVideo();
@@ -167,7 +155,7 @@
 			props.loop = true;
 
 	} else if (props.lastFrame < 0) {
-		warning("Urban/Playtoons Stub: Unknown Video/Music command: %d, %s", props.lastFrame, fileName);
+		warning("Urban/Playtoons Stub: Unknown Video/Music command: %d, %s", props.lastFrame, file.c_str());
 		return;
 	}
 
@@ -184,7 +172,7 @@
 		primary = false;
 
 	int slot = 0;
-	if ((fileName[0] != 0) && ((slot = _vm->_vidPlayer->openVideo(primary, fileName, props)) < 0)) {
+	if (!file.empty() && ((slot = _vm->_vidPlayer->openVideo(primary, file, props)) < 0)) {
 		WRITE_VAR(11, (uint32) -1);
 		return;
 	}
@@ -392,12 +380,11 @@
 	_vm->_draw->_spriteRight = _vm->_game->_script->readValExpr();
 	_vm->_draw->_spriteBottom = _vm->_game->_script->readValExpr();
 
-	_vm->_game->_script->evalExpr(0);
+	uint32 patternColor = _vm->_game->_script->evalInt();
 
-	_vm->_draw->_backColor = _vm->_game->_script->getResultInt() & 0xFFFF;
+	_vm->_draw->_backColor = patternColor & 0xFFFF;
+	_vm->_draw->_pattern   = patternColor >> 16;
 
-	_vm->_draw->_pattern = _vm->_game->_script->getResultInt() >> 16;
-
 	if (_vm->_draw->_pattern != 0)
 		warning("Urban Stub: o6_fillRect(), _pattern = %d", _vm->_draw->_pattern);
 
@@ -421,21 +408,16 @@
 	_vm->_draw->spriteOperation(DRAW_FILLRECT);
 }
 
-void Inter_v6::probe16bitMusic(char *fileName) {
-	int len = strlen(fileName);
-
-	if (len < 4)
+void Inter_v6::probe16bitMusic(Common::String &fileName) {
+	if (!fileName[fileName.size() - 1] != '8')
 		return;
 
-	if (scumm_stricmp(fileName + len - 4, ".WA8"))
-		return;
+	fileName.setChar('V', fileName.size() - 1);
 
-	fileName[len - 1] = 'V';
-
 	if (_vm->_dataIO->hasFile(fileName))
 		return;
 
-	fileName[len - 1] = '8';
+	fileName.setChar('8', fileName.size() - 1);
 }
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/inter_v7.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v7.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/inter_v7.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -84,11 +84,9 @@
 }
 
 void Inter_v7::o7_loadCursor() {
-	int16 cursorIndex = _vm->_game->_script->readValExpr();
+	int16          cursorIndex = _vm->_game->_script->readValExpr();
+	Common::String cursorFile  = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::String cursorFile = _vm->_game->_script->getResultStr();
-
 	warning("Addy Stub: Load cursor \"%s\" to %d", cursorFile.c_str(), cursorIndex);
 
 	byte cursor[9];
@@ -109,25 +107,18 @@
 }
 
 void Inter_v7::o7_displayWarning() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String caption = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String text = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String source = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String msg =  _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String param = _vm->_game->_script->getResultStr();
+	Common::String caption = _vm->_game->_script->evalString();
+	Common::String text    = _vm->_game->_script->evalString();
+	Common::String source  = _vm->_game->_script->evalString();
+	Common::String msg     = _vm->_game->_script->evalString();
+	Common::String param   = _vm->_game->_script->evalString();
 
 	warning("%s: %s (%s)", source.c_str(), msg.c_str(), param.c_str());
 }
 
 void Inter_v7::o7_draw0x45() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str1 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
+	Common::String str1 = _vm->_game->_script->evalString();
 
 	warning("Addy Stub Draw 0x45: \"%s\", \"%s\"", str0.c_str(), str1.c_str());
 }
@@ -140,10 +131,8 @@
 }
 
 void Inter_v7::o7_callGroup() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str1 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
+	Common::String str1 = _vm->_game->_script->evalString();
 
 	int16 expr0 = _vm->_game->_script->readValExpr();
 
@@ -151,8 +140,7 @@
 }
 
 void Inter_v7::o7_loadGroups() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
 
 	int16 expr0 = _vm->_game->_script->readValExpr();
 
@@ -160,10 +148,8 @@
 }
 
 void Inter_v7::o7_draw0x89() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str1 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
+	Common::String str1 = _vm->_game->_script->evalString();
 
 	warning("Addy Stub Draw 0x89: \"%s\", \"%s\"", str0.c_str(), str1.c_str());
 
@@ -180,8 +166,7 @@
 }
 
 void Inter_v7::o7_findFile() {
-	_vm->_game->_script->evalExpr(0);
-	const char *file = _vm->_game->_script->getResultStr();
+	const char *file = _vm->_game->_script->evalString();
 	uint16 pathIndex = _vm->_game->_script->readVarIndex();
 
 	if (!strncmp(file, "<ME>", 4))
@@ -204,34 +189,31 @@
 }
 
 void Inter_v7::o7_getSystemProperty() {
-	_vm->_game->_script->evalExpr(0);
-
-	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "TotalPhys")) {
+	const char *property = _vm->_game->_script->evalString();
+	if (!scumm_stricmp(property, "TotalPhys")) {
 		// HACK
 		storeValue(1000000);
 		return;
 	}
 
-	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "AvailPhys")) {
+	if (!scumm_stricmp(property, "AvailPhys")) {
 		// HACK
 		storeValue(1000000);
 		return;
 	}
 
-	if (!scumm_stricmp(_vm->_game->_script->getResultStr(), "TimeGMT")) {
+	if (!scumm_stricmp(property, "TimeGMT")) {
 		renewTimeInVars();
 		storeValue(0);
 		return;
 	}
 
-	warning("Inter_v7::o7_getSystemProperty(): Unknown property \"%s\"",
-			_vm->_game->_script->getResultStr());
+	warning("Inter_v7::o7_getSystemProperty(): Unknown property \"%s\"", property);
 	storeValue(0);
 }
 
 void Inter_v7::o7_loadLBM() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String file = _vm->_game->_script->getResultStr();
+	Common::String file = _vm->_game->_script->evalString();
 	if (!file.contains('.'))
 		file += ".LBM";
 
@@ -261,23 +243,16 @@
 }
 
 void Inter_v7::o7_getINIValue() {
-	_vm->_game->_script->evalExpr(0);
+	const char *file = _vm->_game->_script->evalString();
+	if (!strncmp(file, "<ME>", 4))
+		file += 4;
+	else if (!strncmp(file, "<ALLCD>", 7))
+		file += 7;
 
-	Common::String file;
-	if (!strncmp(_vm->_game->_script->getResultStr(), "<ME>", 4))
-		file = _vm->_game->_script->getResultStr() + 4;
-	else if (!strncmp(_vm->_game->_script->getResultStr(), "<ALLCD>", 7))
-		file = _vm->_game->_script->getResultStr() + 7;
-	else
-		file = _vm->_game->_script->getResultStr();
+	Common::String section = _vm->_game->_script->evalString();
+	Common::String key     = _vm->_game->_script->evalString();
+	Common::String def     = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::String section = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String key = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String def = _vm->_game->_script->getResultStr();
-
 	Common::String value;
 	_inis.getValue(value, file, section, key, def);
 
@@ -285,29 +260,21 @@
 }
 
 void Inter_v7::o7_setINIValue() {
-	_vm->_game->_script->evalExpr(0);
+	const char *file = _vm->_game->_script->evalString();
+	if (!strncmp(file, "<ME>", 4))
+		file += 4;
+	else if (!strncmp(file, "<ALLCD>", 7))
+		file += 7;
 
-	Common::String file;
-	if (!strncmp(_vm->_game->_script->getResultStr(), "<ME>", 4))
-		file = _vm->_game->_script->getResultStr() + 4;
-	else if (!strncmp(_vm->_game->_script->getResultStr(), "<ALLCD>", 7))
-		file = _vm->_game->_script->getResultStr() + 7;
-	else
-		file = _vm->_game->_script->getResultStr();
+	Common::String section = _vm->_game->_script->evalString();
+	Common::String key     = _vm->_game->_script->evalString();
+	Common::String value   = _vm->_game->_script->evalString();
 
-	_vm->_game->_script->evalExpr(0);
-	Common::String section = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String key = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String value = _vm->_game->_script->getResultStr();
-
 	_inis.setValue(file, section, key, value);
 }
 
 void Inter_v7::o7_draw0xA4() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
 
 	int16 expr0 = _vm->_game->_script->readValExpr();
 	int16 expr1 = _vm->_game->_script->readValExpr();
@@ -316,30 +283,23 @@
 }
 
 void Inter_v7::o7_opendBase() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str1 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
+	Common::String str1 = _vm->_game->_script->evalString();
 
 	warning("Addy Stub: Open dBase file \"%s.dbf\" (%s)", str0.c_str(), str1.c_str());
 }
 
 void Inter_v7::o7_draw0xC5() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
 
 	warning("Addy Stub Draw 0xC5: \"%s\"", str0.c_str());
 }
 
 void Inter_v7::o7_draw0xC6() {
-	_vm->_game->_script->evalExpr(0);
-	Common::String str0 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str1 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str2 = _vm->_game->_script->getResultStr();
-	_vm->_game->_script->evalExpr(0);
-	Common::String str3 = _vm->_game->_script->getResultStr();
+	Common::String str0 = _vm->_game->_script->evalString();
+	Common::String str1 = _vm->_game->_script->evalString();
+	Common::String str2 = _vm->_game->_script->evalString();
+	Common::String str3 = _vm->_game->_script->evalString();
 
 	int16 index0 = _vm->_game->_script->readVarIndex();
 

Modified: scummvm/trunk/engines/gob/script.cpp
===================================================================
--- scummvm/trunk/engines/gob/script.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/script.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -321,6 +321,16 @@
 		return false;
 }
 
+int32 Script::evalInt() {
+	evalExpr(0);
+	return getResultInt();
+}
+
+const char *Script::evalString() {
+	evalExpr(0);
+	return getResultStr();
+}
+
 int32 Script::getResultInt() const {
 	return _expression->getResultInt();
 }

Modified: scummvm/trunk/engines/gob/script.h
===================================================================
--- scummvm/trunk/engines/gob/script.h	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/script.h	2011-01-29 22:47:53 UTC (rev 55634)
@@ -84,9 +84,12 @@
 	void  skipExpr(char stopToken);
 
 	// Higher-level expression parsing functions
-	char evalExpr(int16 *pRes);
-	bool evalBool();
+	char  evalExpr(int16 *pRes);
+	bool  evalBool();
+	int32 evalInt();
 
+	const char *evalString();
+
 	// Accessing the result of expressions
 	int32 getResultInt() const;
 	char *getResultStr() const;

Modified: scummvm/trunk/engines/gob/sound/sound.cpp
===================================================================
--- scummvm/trunk/engines/gob/sound/sound.cpp	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/sound/sound.cpp	2011-01-29 22:47:53 UTC (rev 55634)
@@ -508,11 +508,11 @@
 	_blaster->stopSound(0);
 }
 
-void Sound::cdLoadLIC(const char *fname) {
+void Sound::cdLoadLIC(const Common::String &fname) {
 	if (!_cdrom)
 		return;
 
-	debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname);
+	debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname.c_str());
 
 	Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fname);
 	if (!stream)
@@ -592,17 +592,17 @@
 		}
 }
 
-void Sound::cdPlay(const char *trackName) {
+void Sound::cdPlay(const Common::String &trackName) {
 	if (!_cdrom)
 		return;
-	debugC(1, kDebugSound, "CDROM: Playing track \"%s\"", trackName);
+	debugC(1, kDebugSound, "CDROM: Playing track \"%s\"", trackName.c_str());
 
 // WORKAROUND - In Fascination CD, in the storage room, a track has the wrong
 // name in the scripts, and therefore doesn't play. This fixes the problem.
-	if ((_vm->getGameType() == kGameTypeFascination) && !scumm_stricmp(trackName, "boscle"))
+	if ((_vm->getGameType() == kGameTypeFascination) && trackName.equalsIgnoreCase("boscle"))
 		_cdrom->startTrack("bosscle");
 	else
-		_cdrom->startTrack(trackName);
+		_cdrom->startTrack(trackName.c_str());
 }
 
 void Sound::cdStop() {

Modified: scummvm/trunk/engines/gob/sound/sound.h
===================================================================
--- scummvm/trunk/engines/gob/sound/sound.h	2011-01-29 22:47:14 UTC (rev 55633)
+++ scummvm/trunk/engines/gob/sound/sound.h	2011-01-29 22:47:53 UTC (rev 55634)
@@ -114,13 +114,13 @@
 
 
 	// CD-ROM
-	void cdLoadLIC(const char *fname);
+	void cdLoadLIC(const Common::String &fname);
 	void cdUnloadLIC();
 
 	void cdPlayBgMusic();
 	void cdPlayMultMusic();
 
-	void cdPlay(const char *trackName);
+	void cdPlay(const Common::String &);
 	void cdStop();
 
 	bool cdIsPlaying() const;


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