[Scummvm-cvs-logs] scummvm master -> c9900b605ac8f943bdc3231ba415fdda5ce48964

Strangerke Strangerke at scummvm.org
Tue Sep 13 00:34:38 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c9900b605a CGE: Some more cleanup in fileIo


Commit: c9900b605ac8f943bdc3231ba415fdda5ce48964
    https://github.com/scummvm/scummvm/commit/c9900b605ac8f943bdc3231ba415fdda5ce48964
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-09-12T15:28:31-07:00

Commit Message:
CGE: Some more cleanup in fileIo

Changed paths:
    engines/cge/cge.cpp
    engines/cge/fileio.cpp
    engines/cge/fileio.h



diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index a5967da..9ff8a76 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -79,8 +79,8 @@ void CGEEngine::init() {
 	_miniShp = NULL;
 	_miniShpList = NULL;
 	_sprite = NULL;
-	_dat = new IoHand(kDatName, XCrypt);
-	_cat = new BtFile(kCatName, XCrypt);
+	_dat = new IoHand(kDatName);
+	_cat = new BtFile(kCatName);
 
 	// Create debugger console
 	_console = new CGEConsole(this);
diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index 5c63d41..ddefc57 100644
--- a/engines/cge/fileio.cpp
+++ b/engines/cge/fileio.cpp
@@ -38,12 +38,11 @@ namespace CGE {
 /*-----------------------------------------------------------------------
  * IOHand
  *-----------------------------------------------------------------------*/
-IoHand::IoHand(Crypt *crypt) : _error(0), _crypt(crypt), _seed(kCryptSeed) {
+IoHand::IoHand() : _error(0) {
 	_file = new Common::File();
 }
 
-IoHand::IoHand(const char *name, Crypt *crypt)
-		: _error(0), _crypt(crypt), _seed(kCryptSeed) {
+IoHand::IoHand(const char *name) : _error(0) {
 	_file = new Common::File();
 	_file->open(name);
 }
@@ -60,8 +59,7 @@ uint16 IoHand::read(void *buf, uint16 len) {
 	uint16 bytesRead = _file->read(buf, len);
 	if (!bytesRead)
 		error("Read %s - %d bytes", _file->getName(), len);
-	if (_crypt)
-		_seed = _crypt(buf, len);
+	XCrypt(buf, len);
 	return bytesRead;
 }
 
@@ -104,9 +102,8 @@ void BtPage::read(Common::ReadStream &s) {
 /*-----------------------------------------------------------------------
  * BtFile
  *-----------------------------------------------------------------------*/
-BtFile::BtFile(const char *name, Crypt *crpt)
-	: IoHand(name, crpt) {
-	debugC(1, kCGEDebugFile, "BtFile::BtFile(%s, crpt)", name);
+BtFile::BtFile(const char *name) : IoHand(name) {
+	debugC(1, kCGEDebugFile, "BtFile::BtFile(%s)", name);
 
 	for (int i = 0; i < kBtLevel; i++) {
 		_buff[i]._page = new BtPage;
diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h
index bc4fd0a..443cddd 100644
--- a/engines/cge/fileio.h
+++ b/engines/cge/fileio.h
@@ -62,15 +62,12 @@ struct Header {
 };
 
 class IoHand {
-protected:
-	uint16 _seed;
-	Crypt *_crypt;
 public:
 	Common::File *_file;
 	uint16 _error;
 
-	IoHand(const char *name, Crypt crypt);
-	IoHand(Crypt *crypt);
+	IoHand(const char *name);
+	IoHand();
 	virtual ~IoHand();
 	uint16 read(void *buf, uint16 len);
 	long mark();
@@ -101,7 +98,7 @@ class BtFile : public IoHand {
 
 	BtPage *getPage(int lev, uint16 pgn);
 public:
-	BtFile(const char *name, Crypt *crpt);
+	BtFile(const char *name);
 	virtual ~BtFile();
 	BtKeypack *find(const char *key);
 	bool exist(const char *name);






More information about the Scummvm-git-logs mailing list