[Scummvm-cvs-logs] SF.net SVN: scummvm:[34389] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Sep 6 22:34:21 CEST 2008


Revision: 34389
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34389&view=rev
Author:   fingolfin
Date:     2008-09-06 20:34:21 +0000 (Sat, 06 Sep 2008)

Log Message:
-----------
ScummFile: Don't use the File::_ioFailed flag, rather track the io status separately;  also, changed eof() -> eos()

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/file.cpp
    scummvm/trunk/engines/scumm/file.h
    scummvm/trunk/engines/scumm/resource.cpp
    scummvm/trunk/engines/scumm/resource_v4.cpp

Modified: scummvm/trunk/engines/scumm/file.cpp
===================================================================
--- scummvm/trunk/engines/scumm/file.cpp	2008-09-06 19:50:12 UTC (rev 34388)
+++ scummvm/trunk/engines/scumm/file.cpp	2008-09-06 20:34:21 UTC (rev 34389)
@@ -125,8 +125,8 @@
 }
 
 
-bool ScummFile::eof() {
-	return _subFileLen ? (pos() >= _subFileLen) : File::eof();
+bool ScummFile::eos() {
+	return _subFileLen ? (pos() >= _subFileLen) : File::eos();
 }
 
 uint32 ScummFile::pos() {
@@ -167,7 +167,7 @@
 		uint32 newPos = curPos + dataSize;
 		if (newPos > _subFileLen) {
 			dataSize = _subFileLen - curPos;
-			_ioFailed = true;
+			_myIoFailed = true;
 		}
 	}
 

Modified: scummvm/trunk/engines/scumm/file.h
===================================================================
--- scummvm/trunk/engines/scumm/file.h	2008-09-06 19:50:12 UTC (rev 34388)
+++ scummvm/trunk/engines/scumm/file.h	2008-09-06 20:34:21 UTC (rev 34389)
@@ -39,7 +39,7 @@
 	virtual bool open(const Common::String &filename) = 0;
 	virtual bool openSubFile(const Common::String &filename) = 0;
 
-	virtual bool eof() = 0;
+	virtual bool eos() = 0;
 	virtual uint32 pos() = 0;
 	virtual uint32 size() = 0;
 	virtual void seek(int32 offs, int whence = SEEK_SET) = 0;
@@ -51,6 +51,7 @@
 	byte _encbyte;
 	uint32	_subFileStart;
 	uint32	_subFileLen;
+	bool	_myIoFailed;
 public:
 	ScummFile();
 	void setEnc(byte value);
@@ -61,7 +62,10 @@
 	bool open(const Common::String &filename);
 	bool openSubFile(const Common::String &filename);
 
-	bool eof();
+	bool ioFailed() const { return _myIoFailed || BaseScummFile::ioFailed(); }
+	void clearIOFailed() { _myIoFailed = false; BaseScummFile::clearIOFailed(); }
+
+	bool eos();
 	uint32 pos();
 	uint32 size();
 	void seek(int32 offs, int whence = SEEK_SET);
@@ -106,7 +110,7 @@
 	bool openSubFile(const Common::String &filename);
 
 	void close();
-	bool eof() { return _stream->eos(); }
+	bool eos() { return _stream->eos(); }
 	uint32 pos() { return _stream->pos(); }
 	uint32 size() { return _stream->size(); }
 	void seek(int32 offs, int whence = SEEK_SET) { _stream->seek(offs, whence); }

Modified: scummvm/trunk/engines/scumm/resource.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource.cpp	2008-09-06 19:50:12 UTC (rev 34388)
+++ scummvm/trunk/engines/scumm/resource.cpp	2008-09-06 20:34:21 UTC (rev 34389)
@@ -253,7 +253,7 @@
 
 	if (_game.version <= 5) {
 		// Figure out the sizes of various resources
-		while (!_fileHandle->eof()) {
+		while (!_fileHandle->eos()) {
 			blocktype = _fileHandle->readUint32BE();
 			itemsize = _fileHandle->readUint32BE();
 			if (_fileHandle->ioFailed())

Modified: scummvm/trunk/engines/scumm/resource_v4.cpp
===================================================================
--- scummvm/trunk/engines/scumm/resource_v4.cpp	2008-09-06 19:50:12 UTC (rev 34388)
+++ scummvm/trunk/engines/scumm/resource_v4.cpp	2008-09-06 20:34:21 UTC (rev 34389)
@@ -62,7 +62,7 @@
 	closeRoom();
 	openRoom(0);
 
-	while (!_fileHandle->eof()) {
+	while (!_fileHandle->eos()) {
 		// Figure out the sizes of various resources
 		itemsize = _fileHandle->readUint32LE();
 		blocktype = _fileHandle->readUint16LE();


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