[Scummvm-cvs-logs] CVS: scummvm/sound audiostream.cpp,1.61,1.62 audiostream.h,1.35,1.36

Pawel Kolodziejski aquadran at users.sourceforge.net
Wed Jun 30 21:44:06 CEST 2004


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1751/scummvm/sound

Modified Files:
	audiostream.cpp audiostream.h 
Log Message:
getFreeSpace() is not longer used

Index: audiostream.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- audiostream.cpp	28 Jun 2004 22:35:20 -0000	1.61
+++ audiostream.cpp	1 Jul 2004 04:43:32 -0000	1.62
@@ -202,10 +202,8 @@
 	byte *_end;
 	bool _finalized;
 	const int _rate;
-	uint32 _freeSpace;
 
 	inline bool eosIntern() const { return _end == _pos; };
-	void updateFreeSpace();
 public:
 	AppendableMemoryStream(int rate, uint bufferSize);
 	~AppendableMemoryStream()		{ free(_bufferStart); }
@@ -220,21 +218,9 @@
 
 	void append(const byte *data, uint32 len);
 	void finish()				{ _finalized = true; }
-	uint32 getFreeSpace();
 };
 
 template<bool stereo, bool is16Bit, bool isUnsigned>
-void AppendableMemoryStream<stereo, is16Bit, isUnsigned>::updateFreeSpace() {
-	if (_pos <= _end) {
-		uint32 free_from_end = _bufferEnd - _end;
-		uint32 free_to_pos = _pos - _bufferStart;
-		_freeSpace = free_from_end + free_to_pos;
-	} else {
-		_freeSpace = _pos - _end;
-	}
-}
-
-template<bool stereo, bool is16Bit, bool isUnsigned>
 AppendableMemoryStream<stereo, is16Bit, isUnsigned>::AppendableMemoryStream(int rate, uint bufferSize)
  : _finalized(false), _rate(rate) {
 
@@ -247,8 +233,6 @@
 	_bufferStart = (byte *)malloc(bufferSize);
 	_pos = _end = _bufferStart;
 	_bufferEnd = _bufferStart + bufferSize;
-
-	updateFreeSpace();
 }
 
 template<bool stereo, bool is16Bit, bool isUnsigned>
@@ -262,8 +246,6 @@
 	int16 val = READSAMPLE(is16Bit, isUnsigned, _pos);
 	_pos += (is16Bit ? 2 : 1);
 
-	updateFreeSpace();
-
 	return val;
 }
 
@@ -284,8 +266,6 @@
 		}
 	}
 
-	updateFreeSpace();
-
 	return samples;
 }
 
@@ -320,12 +300,6 @@
 		memcpy(_end, data, len);
 		_end += len;
 	}
-	updateFreeSpace();
-}
-
-template<bool stereo, bool is16Bit, bool isUnsigned>
-uint32 AppendableMemoryStream<stereo, is16Bit, isUnsigned>::getFreeSpace() {
-	return _freeSpace;
 }
 
 #pragma mark -

Index: audiostream.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- audiostream.h	28 Jun 2004 22:35:21 -0000	1.35
+++ audiostream.h	1 Jul 2004 04:43:32 -0000	1.36
@@ -93,7 +93,6 @@
 public:
 	virtual void append(const byte *data, uint32 len) = 0;
 	virtual void finish() = 0;
-	virtual uint32 getFreeSpace() = 0;
 };
 
 class ZeroInputStream : public AudioStream {





More information about the Scummvm-git-logs mailing list