[Scummvm-cvs-logs] scummvm master -> 918d79f10494ba815d3e2a4ee69f3092486d4be4

Strangerke Strangerke at scummvm.org
Sun Sep 11 22:34:03 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:
918d79f104 CGE: Remove some more uses of VFile. Fix a shadowed variable


Commit: 918d79f10494ba815d3e2a4ee69f3092486d4be4
    https://github.com/scummvm/scummvm/commit/918d79f10494ba815d3e2a4ee69f3092486d4be4
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-09-11T13:07:22-07:00

Commit Message:
CGE: Remove some more uses of VFile. Fix a shadowed variable

Changed paths:
    engines/cge/fileio.cpp
    engines/cge/fileio.h
    engines/cge/general.cpp
    engines/cge/sound.cpp
    engines/cge/sound.h
    engines/cge/text.cpp



diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index 34c7c65..024ea77 100644
--- a/engines/cge/fileio.cpp
+++ b/engines/cge/fileio.cpp
@@ -410,10 +410,18 @@ bool EncryptedStream::eos() {
 	return _readStream->eos();
 }
 
+bool EncryptedStream::seek(int32 offset) {
+	return _readStream->seek(offset);
+}
+
 Common::String EncryptedStream::readLine() {
 	return _readStream->readLine();
 }
 
+int32 EncryptedStream::size() {
+	return _readStream->size();
+}
+
 EncryptedStream::~EncryptedStream() {
 }
 
diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h
index 1f0756a..f6f0a98 100644
--- a/engines/cge/fileio.h
+++ b/engines/cge/fileio.h
@@ -156,6 +156,8 @@ public:
 	~EncryptedStream();
 	bool err();
 	bool eos();
+	bool seek(int32 offset);
+	int32 size();
 	uint32 read(void *dataPtr, uint32 dataSize);
 	Common::String readLine();
 };
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index 7db6181..5e32aa6 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -63,7 +63,7 @@ void sndSetVolume() {
 	// USeless for ScummVM
 }
 
-DataCk *loadWave(VFile *file) {
+DataCk *loadWave(EncryptedStream *file) {
 	byte *data = (byte *)malloc(file->size());
 	file->read(data, file->size());
 
diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp
index a7b2d34..e83a210 100644
--- a/engines/cge/sound.cpp
+++ b/engines/cge/sound.cpp
@@ -136,7 +136,7 @@ void Fx::preload(int ref0) {
 
 	for (int ref = ref0; ref < ref0 + 10; ref++) {
 		sprintf(filename, "FX%05d.WAV", ref);
-		VFile file = VFile(filename);
+		EncryptedStream file = filename;
 		DataCk *wav = loadWave(&file);
 		if (wav) {
 			Handler *p = &_cache[find(0)];
@@ -154,7 +154,7 @@ DataCk *Fx::load(int idx, int ref) {
 	char filename[12];
 	sprintf(filename, "FX%05d.WAV", ref);
 
-	VFile file = VFile(filename);
+	EncryptedStream file = filename;
 	DataCk *wav = loadWave(&file);
 	if (wav) {
 		Handler *p = &_cache[idx];
@@ -222,7 +222,7 @@ void MusicPlayer::loadMidi(int ref) {
 	killMidi();
 
 	// Read in the data for the file
-	VFile mid(filename.c_str());
+	EncryptedStream mid(filename.c_str());
 	_dataSize = mid.size();
 	_data = (byte *)malloc(_dataSize);
 	mid.read(_data, _dataSize);
diff --git a/engines/cge/sound.h b/engines/cge/sound.h
index 0a7d018..4441e24 100644
--- a/engines/cge/sound.h
+++ b/engines/cge/sound.h
@@ -57,7 +57,7 @@ public:
 	}
 };
 
-DataCk *loadWave(VFile *file);
+DataCk *loadWave(EncryptedStream *file);
 
 class Sound {
 public:
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index 71bb411..2b949ab 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -65,7 +65,8 @@ int16 Text::count() {
 
 	Common::String line;
 	char tmpStr[kLineMax + 1];
-	int n, count = 0;
+	
+	int n, counter = 0;
 
 	for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) {
 		n = line.size();
@@ -77,9 +78,9 @@ int16 Text::count() {
 		if (!isdigit(*s))
 			continue;
 
-		count++;
+		counter++;
 	}
-	return count;
+	return counter;
 }
 
 void Text::clear() {






More information about the Scummvm-git-logs mailing list