diff options
author | Willem Jan Palenstijn | 2013-04-18 23:35:23 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:40:58 +0200 |
commit | 9c2341678ef4984bf92b3878295250faf980b066 (patch) | |
tree | 2fb4805e05e16b9924e80c9947e6bad723b28c4b /engines/agi/sound_2gs.cpp | |
parent | 8172d679df5148a4a32f46074b20cb6caf91844f (diff) | |
parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
download | scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2 scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip |
Merge branch 'master'
Diffstat (limited to 'engines/agi/sound_2gs.cpp')
-rw-r--r-- | engines/agi/sound_2gs.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index c5cfa125d6..bfc8d4d8f3 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -68,10 +68,10 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { static uint data_available = 0; static uint data_offset = 0; uint n = numSamples << 1; - uint8 *p = (uint8*)buffer; + uint8 *p = (uint8 *)buffer; while (n > data_available) { - memcpy(p, (uint8*)_out + data_offset, data_available); + memcpy(p, (uint8 *)_out + data_offset, data_available); p += data_available; n -= data_available; @@ -81,7 +81,7 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { data_offset = 0; } - memcpy(p, (uint8*)_out + data_offset, n); + memcpy(p, (uint8 *)_out + data_offset, n); data_offset += n; data_available -= n; @@ -719,7 +719,10 @@ bool SoundGen2GS::loadInstrumentHeaders(Common::String &exePath, const IIgsExeIn } // Read the whole executable file into memory - Common::SharedPtr<Common::SeekableReadStream> 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<Common::SeekableReadStream> 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<Common::SeekableReadStream> uint8Wave(file.readStream(file.size())); + Common::ScopedPtr<Common::SeekableReadStream> uint8Wave(file.readStream(file.size())); file.close(); // Check that we got the whole wave file |