[Scummvm-cvs-logs] SF.net SVN: scummvm:[38680] scummvm/trunk/engines/sword1/animation.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat Feb 21 12:22:57 CET 2009


Revision: 38680
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38680&view=rev
Author:   eriktorbjorn
Date:     2009-02-21 11:22:56 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/animation.cpp

Modified: scummvm/trunk/engines/sword1/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword1/animation.cpp	2009-02-21 11:04:47 UTC (rev 38679)
+++ scummvm/trunk/engines/sword1/animation.cpp	2009-02-21 11:22:56 UTC (rev 38680)
@@ -85,7 +85,7 @@
  */
 bool MoviePlayer::load(uint32 id) {
 	Common::File f;
-	char fileName[20];
+	char filename[20];
 
 	if (_decoderType == kVideoDecoderDXA) {
 		_bgSoundStream = Audio::AudioStream::openStreamFile(sequenceList[id]);
@@ -94,8 +94,8 @@
 	}
 
 	if (SwordEngine::_systemVars.showText) {
-		sprintf(fileName, "%s.txt", sequenceList[id]);
-		if (f.open(fileName)) {
+		sprintf(filename, "%s.txt", sequenceList[id]);
+		if (f.open(filename)) {
 			Common::String line;
 			int lineNo = 0;
 			int lastEnd = -1;
@@ -118,22 +118,22 @@
 					ptr++;
 
 				if (startFrame > endFrame) {
-					warning("%s:%d: startFrame (%d) > endFrame (%d)", fileName, lineNo, startFrame, endFrame);
+					warning("%s:%d: startFrame (%d) > endFrame (%d)", filename, lineNo, startFrame, endFrame);
 					continue;
 				}
 
 				if (startFrame <= lastEnd) {
-					warning("%s:%d startFrame (%d) <= lastEnd (%d)", fileName, lineNo, startFrame, lastEnd);
+					warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename, lineNo, startFrame, lastEnd);
 					continue;
 				}
 
 				_movieTexts.push_back(new MovieText(startFrame, endFrame, ptr));
 				lastEnd = endFrame;
 			}
+			f.close();
 		}
 	}
 
-	char filename[20];
 	switch (_decoderType) {
 	case kVideoDecoderDXA:
 		snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]);


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