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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Apr 25 01:31:10 CEST 2009


Revision: 40134
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40134&view=rev
Author:   drmccoy
Date:     2009-04-24 23:31:10 +0000 (Fri, 24 Apr 2009)

Log Message:
-----------
Ooops, changing a const argument is evil, copying it now

Modified Paths:
--------------
    scummvm/trunk/engines/gob/demoplayer.cpp

Modified: scummvm/trunk/engines/gob/demoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/demoplayer.cpp	2009-04-24 23:26:57 UTC (rev 40133)
+++ scummvm/trunk/engines/gob/demoplayer.cpp	2009-04-24 23:31:10 UTC (rev 40134)
@@ -65,12 +65,16 @@
 
 void DemoPlayer::playVideo(const char *fileName) {
 	uint32 waitTime = 0;
+	char *file;
 
+	file = new char[strlen(fileName) + 1];
+	strcpy(file, fileName);
+
 	// Trimming spaces front
-	while (*fileName == ' ')
-		fileName++;
+	while (*file == ' ')
+		file++;
 
-	char *spaceBack = strchr(fileName, ' ');
+	char *spaceBack = strchr(file, ' ');
 	if (spaceBack) {
 		char *nextSpace = strchr(spaceBack, ' ');
 
@@ -82,10 +86,10 @@
 		waitTime = atoi(spaceBack) * 100;
 	}
 
-	debugC(1, kDebugDemo, "Playing video \"%s\"", fileName);
+	debugC(1, kDebugDemo, "Playing video \"%s\"", file);
 
 	// Playing the video
-	if (_vm->_vidPlayer->primaryOpen(fileName)) {
+	if (_vm->_vidPlayer->primaryOpen(file)) {
 		_vm->_vidPlayer->slotSetDoubleMode(-1, _doubleMode);
 		_vm->_vidPlayer->primaryPlay();
 		_vm->_vidPlayer->primaryClose();
@@ -93,6 +97,8 @@
 		if (waitTime > 0)
 			_vm->_util->longDelay(waitTime);
 	}
+
+	delete[] file;
 }
 
 void DemoPlayer::evaluateVideoMode(const char *mode) {


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