[Scummvm-cvs-logs] scummvm master -> 012367312d4cd92d59ddebf2460853f6947f1dc4

lordhoto lordhoto at gmail.com
Wed Nov 16 20:31:58 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c5ff6b431b AGI: Change two local SharedPtr uses to ScopedPtr.
012367312d DRACI: Update comment regarding SharedPtr/ScopedPtr.


Commit: c5ff6b431b960f599aee562baa1a15e0edcec451
    https://github.com/scummvm/scummvm/commit/c5ff6b431b960f599aee562baa1a15e0edcec451
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-11-16T11:31:22-08:00

Commit Message:
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.

Changed paths:
    engines/agi/sound_2gs.cpp



diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index c5cfa12..b15950f 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<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


Commit: 012367312d4cd92d59ddebf2460853f6947f1dc4
    https://github.com/scummvm/scummvm/commit/012367312d4cd92d59ddebf2460853f6947f1dc4
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-11-16T11:31:22-08:00

Commit Message:
DRACI: Update comment regarding SharedPtr/ScopedPtr.

Changed paths:
    engines/draci/draci.cpp



diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 67e0436..6aa8477 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -359,10 +359,11 @@ void DraciEngine::handleEvents() {
 DraciEngine::~DraciEngine() {
 	// Dispose your resources here
 
-	// If the common library supported STL's scoped_ptr<>, then wrapping
+	// If the common library supported Boost's scoped_ptr<>, then wrapping
 	// all the following pointers and many more would be appropriate.  So
 	// far, there is only SharedPtr, which I feel being an overkill for
 	// easy deallocation.
+	// TODO: We have ScopedPtr nowadays. Maybe should adapt this code then?
 	delete _smallFont;
 	delete _bigFont;
 






More information about the Scummvm-git-logs mailing list