diff options
author | Sven Hesse | 2009-04-24 23:31:10 +0000 |
---|---|---|
committer | Sven Hesse | 2009-04-24 23:31:10 +0000 |
commit | f9c433353da884fdb20f37654a6c396b1f183cea (patch) | |
tree | d5619dac2ba519ad3263cf3e88c3083d2e9da48b /engines | |
parent | 6411c84b3166c4dcbdf3d33f298c956a3ab8576d (diff) | |
download | scummvm-rg350-f9c433353da884fdb20f37654a6c396b1f183cea.tar.gz scummvm-rg350-f9c433353da884fdb20f37654a6c396b1f183cea.tar.bz2 scummvm-rg350-f9c433353da884fdb20f37654a6c396b1f183cea.zip |
Ooops, changing a const argument is evil, copying it now
svn-id: r40134
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/demoplayer.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/gob/demoplayer.cpp b/engines/gob/demoplayer.cpp index 16eebd53bf..772d31ffbe 100644 --- a/engines/gob/demoplayer.cpp +++ b/engines/gob/demoplayer.cpp @@ -65,12 +65,16 @@ void DemoPlayer::clearScreen() { 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 @@ void DemoPlayer::playVideo(const char *fileName) { 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 @@ void DemoPlayer::playVideo(const char *fileName) { if (waitTime > 0) _vm->_util->longDelay(waitTime); } + + delete[] file; } void DemoPlayer::evaluateVideoMode(const char *mode) { |