[Scummvm-cvs-logs] SF.net SVN: scummvm:[35217] scummvm/trunk/engines/m4/mads_anim.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Dec 3 12:51:51 CET 2008


Revision: 35217
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35217&view=rev
Author:   thebluegr
Date:     2008-12-03 11:51:51 +0000 (Wed, 03 Dec 2008)

Log Message:
-----------
Simplify line reading with the simpler readLine(), instead of readLine_NEW

Modified Paths:
--------------
    scummvm/trunk/engines/m4/mads_anim.cpp

Modified: scummvm/trunk/engines/m4/mads_anim.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_anim.cpp	2008-12-03 11:47:57 UTC (rev 35216)
+++ scummvm/trunk/engines/m4/mads_anim.cpp	2008-12-03 11:51:51 UTC (rev 35217)
@@ -247,14 +247,14 @@
 }
 
 void TextviewView::processLines() {
-	_script->readLine_NEW(_currentLine, 79);
+	strncpy(_currentLine, _script->readLine().c_str(), 79);
 	if (_script->eos() || _script->err())
 		error("Attempted to read past end of response file");
 
 	while (!_script->eos() && !_script->err()) {
 		// Commented out line, so go loop for another
 		if (_currentLine[0] == '#') {
-			_script->readLine_NEW(_currentLine, 79);
+			strncpy(_currentLine, _script->readLine().c_str(), 79);
 			continue;
 		}
 
@@ -267,7 +267,7 @@
 				if (!cEnd)
 					error("Unterminated command '%s' in response file", _currentLine);
 
-				*(cEnd + 1)= '\0';
+				*cEnd = '\0';
 				processCommand();
 
 				// Copy rest of line (if any) to start of buffer
@@ -286,7 +286,7 @@
 			break;
 		}
 
-		_script->readLine_NEW(_currentLine, 79);
+		strncpy(_currentLine, _script->readLine().c_str(), 79);
 	}
 }
 
@@ -597,7 +597,7 @@
 }
 
 void AnimviewView::processLines() {
-	_script->readLine_NEW(_currentLine, 79);
+	strncpy(_currentLine, _script->readLine().c_str(), 79);
 	if (_script->eos() || _script->err()) {
 		// end of script, end animation
 		scriptDone();
@@ -638,7 +638,7 @@
 			break;
 		}
 
-		_script->readLine_NEW(_currentLine, 79);
+		strncpy(_currentLine, _script->readLine().c_str(), 79);
 	}
 }
 


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