mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
Use File::size to determine the size of a file, instead of doing a seek(0, SEEK_END)
svn-id: r22184
This commit is contained in:
parent
cd528083f9
commit
a4338aeb19
@ -256,13 +256,10 @@ local uLong unzlocal_SearchCentralDir(Common::File &fin)
|
||||
uLong uMaxBack=0xffff; /* maximum size of global comment */
|
||||
uLong uPosFound=0;
|
||||
|
||||
fin.seek(0, SEEK_END);
|
||||
uSizeFile = fin.size();
|
||||
if (fin.ioFailed())
|
||||
return 0;
|
||||
|
||||
|
||||
uSizeFile = fin.pos();
|
||||
|
||||
if (uMaxBack>uSizeFile)
|
||||
uMaxBack = uSizeFile;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user