aboutsummaryrefslogtreecommitdiff
path: root/engines/simon
diff options
context:
space:
mode:
authorMax Horn2006-04-26 14:35:53 +0000
committerMax Horn2006-04-26 14:35:53 +0000
commita4338aeb19dadb655fe3c29d2a95da196a6b07cd (patch)
tree5286f45152d7cecf236d106ab5289c7588857a74 /engines/simon
parentcd528083f955dece5bf1c97085efc1d8b0e5857f (diff)
downloadscummvm-rg350-a4338aeb19dadb655fe3c29d2a95da196a6b07cd.tar.gz
scummvm-rg350-a4338aeb19dadb655fe3c29d2a95da196a6b07cd.tar.bz2
scummvm-rg350-a4338aeb19dadb655fe3c29d2a95da196a6b07cd.zip
Use File::size to determine the size of a file, instead of doing a seek(0, SEEK_END)
svn-id: r22184
Diffstat (limited to 'engines/simon')
-rw-r--r--engines/simon/sound.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/engines/simon/sound.cpp b/engines/simon/sound.cpp
index 7f28dfdd56..f00ff4456c 100644
--- a/engines/simon/sound.cpp
+++ b/engines/simon/sound.cpp
@@ -109,8 +109,7 @@ BaseSound::BaseSound(Audio::Mixer *mixer, File *file, uint32 base, bool bigendia
}
// only needed for mp3
- _file->seek(0, SEEK_END);
- _offsets[res] = _file->pos();
+ _offsets[res] = _file->size();
}
BaseSound::BaseSound(Audio::Mixer *mixer, File *file, uint32 *offsets, bool bigendian) {
@@ -317,9 +316,7 @@ void Sound::loadVoiceFile(const GameSpecificSettings *gss) {
// for simon2 mac/amiga, only read index file
file->open("voices.idx");
if (file->isOpen() == true) {
- file->seek(0, SEEK_END);
- int end = file->pos();
- file->seek(0, SEEK_SET);
+ int end = file->size();
_filenums = (uint16 *)malloc((end / 6 + 1) * 2);
_offsets = (uint32 *)malloc((end / 6 + 1) * 4);