From c5ff6b431b960f599aee562baa1a15e0edcec451 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 16 Nov 2011 20:25:21 +0100 Subject: AGI: Change two local SharedPtr uses to ScopedPtr. I took the opportunity to add two CHECKMEs to the code, which seems to load a file into memory for no real apparent reason. --- engines/agi/sound_2gs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines/agi/sound_2gs.cpp') diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index c5cfa125d6..b15950f31d 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -719,7 +719,10 @@ bool SoundGen2GS::loadInstrumentHeaders(Common::String &exePath, const IIgsExeIn } // Read the whole executable file into memory - Common::SharedPtr data(file.readStream(file.size())); + // CHECKME: Why do we read the file into memory first? It does not seem to be + // kept outside of this function. Is the processing of the data too slow + // otherwise? + Common::ScopedPtr data(file.readStream(file.size())); file.close(); // Check that we got enough data to be able to parse the instruments @@ -769,8 +772,11 @@ bool SoundGen2GS::loadWaveFile(Common::String &wavePath, const IIgsExeInfo &exeI Common::File file; // Open the wave file and read it into memory + // CHECKME: Why do we read the file into memory first? It does not seem to be + // kept outside of this function. Is the processing of the data too slow + // otherwise? file.open(wavePath); - Common::SharedPtr uint8Wave(file.readStream(file.size())); + Common::ScopedPtr uint8Wave(file.readStream(file.size())); file.close(); // Check that we got the whole wave file -- cgit v1.2.3