aboutsummaryrefslogtreecommitdiff
path: root/engines/cge
diff options
context:
space:
mode:
authorStrangerke2011-09-11 22:07:22 +0200
committerStrangerke2011-09-11 22:07:22 +0200
commit918d79f10494ba815d3e2a4ee69f3092486d4be4 (patch)
treedc8b35789033178b3074d1df8d64f1878661212d /engines/cge
parentf6f8b456e70fe7bcf24f4322f43644d4a4e34ba2 (diff)
downloadscummvm-rg350-918d79f10494ba815d3e2a4ee69f3092486d4be4.tar.gz
scummvm-rg350-918d79f10494ba815d3e2a4ee69f3092486d4be4.tar.bz2
scummvm-rg350-918d79f10494ba815d3e2a4ee69f3092486d4be4.zip
CGE: Remove some more uses of VFile. Fix a shadowed variable
Diffstat (limited to 'engines/cge')
-rw-r--r--engines/cge/fileio.cpp8
-rw-r--r--engines/cge/fileio.h2
-rw-r--r--engines/cge/general.cpp2
-rw-r--r--engines/cge/sound.cpp6
-rw-r--r--engines/cge/sound.h2
-rw-r--r--engines/cge/text.cpp7
6 files changed, 19 insertions, 8 deletions
diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index 34c7c6510f..024ea77693 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 1f0756a276..f6f0a98d54 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 7db61818ab..5e32aa63aa 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 a7b2d34b0b..e83a210e3e 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 0a7d018c81..4441e24179 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 71bb411f11..2b949ab701 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() {