[Scummvm-cvs-logs] SF.net SVN: scummvm:[35198] scummvm/trunk/engines
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Mon Dec 1 22:13:03 CET 2008
Revision: 35198
http://scummvm.svn.sourceforge.net/scummvm/?rev=35198&view=rev
Author: fingolfin
Date: 2008-12-01 21:13:02 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Got rid of Stream::readLine_OLD calls in two places (mostly untested, please check/test for regressions)
Modified Paths:
--------------
scummvm/trunk/engines/queen/resource.cpp
scummvm/trunk/engines/sword1/animation.cpp
scummvm/trunk/engines/sword1/animation.h
Modified: scummvm/trunk/engines/queen/resource.cpp
===================================================================
--- scummvm/trunk/engines/queen/resource.cpp 2008-12-01 20:38:14 UTC (rev 35197)
+++ scummvm/trunk/engines/queen/resource.cpp 2008-12-01 21:13:02 UTC (rev 35198)
@@ -130,10 +130,12 @@
ResourceEntry *re = resourceEntry(filename);
assert(re != NULL);
seekResourceFile(re->bundle, re->offset);
- char buf[512];
Common::SeekableSubReadStream stream(&_resourceFile, re->offset, re->offset + re->size);
- while (stream.readLine_OLD(buf, 512)) {
- stringList.push_back(buf);
+ while (true) {
+ Common::String tmp = stream.readLine();
+ if (stream.eos() || stream.err())
+ break;
+ stringList.push_back(tmp);
}
}
Modified: scummvm/trunk/engines/sword1/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword1/animation.cpp 2008-12-01 20:38:14 UTC (rev 35197)
+++ scummvm/trunk/engines/sword1/animation.cpp 2008-12-01 21:13:02 UTC (rev 35198)
@@ -184,22 +184,23 @@
if (SwordEngine::_systemVars.showText) {
sprintf(fileName, "%s.txt", sequenceList[id]);
if (f.open(fileName)) {
- char line[240];
+ Common::String line;
int lineNo = 0;
int lastEnd = -1;
_movieTexts.clear();
- while (f.readLine_OLD(line, sizeof(line))) {
+ while (!f.eos() && !f.err()) {
+ line = f.readLine();
lineNo++;
- if (line[0] == '#' || line[0] == 0) {
+ if (line.empty() || line[0] == '#') {
continue;
}
- char *ptr = line;
+ const char *ptr = line.c_str();
// TODO: Better error handling
- int startFrame = strtoul(ptr, &ptr, 10);
- int endFrame = strtoul(ptr, &ptr, 10);
+ int startFrame = strtoul(ptr, (char **)&ptr, 10);
+ int endFrame = strtoul(ptr, (char **)&ptr, 10);
while (*ptr && isspace(*ptr))
ptr++;
Modified: scummvm/trunk/engines/sword1/animation.h
===================================================================
--- scummvm/trunk/engines/sword1/animation.h 2008-12-01 20:38:14 UTC (rev 35197)
+++ scummvm/trunk/engines/sword1/animation.h 2008-12-01 21:13:02 UTC (rev 35198)
@@ -66,7 +66,7 @@
uint16 _startFrame;
uint16 _endFrame;
char *_text;
- MovieText(int startFrame, int endFrame, char *text) {
+ MovieText(int startFrame, int endFrame, const char *text) {
_startFrame = startFrame;
_endFrame = endFrame;
_text = strdup(text);
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