[Scummvm-cvs-logs] CVS: scummvm/scumm player_v2.cpp,2.55,2.56 player_v2.h,2.33,2.34 sound.cpp,1.412,1.413

Max Horn fingolfin at users.sourceforge.net
Fri Jan 28 15:53:56 CET 2005


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

Modified Files:
	player_v2.cpp player_v2.h sound.cpp 
Log Message:
Use class Mutex instead of MutexRef

Index: player_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.cpp,v
retrieving revision 2.55
retrieving revision 2.56
diff -u -d -r2.55 -r2.56
--- player_v2.cpp	10 Jan 2005 22:05:44 -0000	2.55
+++ player_v2.cpp	28 Jan 2005 22:05:43 -0000	2.56
@@ -22,7 +22,6 @@
 
 #include "stdafx.h"
 #include "base/engine.h"
-#include "common/system.h"
 #include "scumm/player_v2.h"
 #include "scumm/scumm.h"
 #include "sound/mididrv.h"
@@ -347,10 +346,8 @@
 
 	_isV3Game = (scumm->_version >= 3);
 	_vm = scumm;
-	_system = scumm->_system;
 	_mixer = scumm->_mixer;
 	_sample_rate = _mixer->getOutputRate();
-	_mutex = _system->createMutex();
 
 	_header_len = (scumm->_features & GF_OLD_BUNDLE) ? 4 : 6;
 
@@ -385,7 +382,6 @@
 	// Detach the premix callback handler
 	_mixer->setupPremix(0);
 	mutex_down();
-	_system->deleteMutex (_mutex);
 }
 
 void Player_V2::set_pcjr(bool pcjr) {
@@ -965,11 +961,11 @@
 }
 
 void Player_V2::mutex_up() {
-	_system->lockMutex (_mutex);
+	_mutex.lock();
 }
 
 void Player_V2::mutex_down() {
-	_system->unlockMutex (_mutex);
+	_mutex.unlock();
 }
 
 } // End of namespace Scumm

Index: player_v2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.h,v
retrieving revision 2.33
retrieving revision 2.34
diff -u -d -r2.33 -r2.34
--- player_v2.h	10 Jan 2005 22:05:45 -0000	2.33
+++ player_v2.h	28 Jan 2005 22:05:43 -0000	2.34
@@ -97,7 +97,6 @@
 protected:
 	bool _isV3Game;
 	SoundMixer *_mixer;
-	OSystem *_system;
 	ScummEngine *_vm;
 
 	bool _pcjr;
@@ -133,7 +132,7 @@
 
 	const uint16 *_freqs_table;
 
-	Common::MutexRef _mutex;
+	Common::Mutex _mutex;
 	ChannelInfo _channels[5];
 
 protected:

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.412
retrieving revision 1.413
diff -u -d -r1.412 -r1.413
--- sound.cpp	20 Jan 2005 12:56:24 -0000	1.412
+++ sound.cpp	28 Jan 2005 22:05:44 -0000	1.413
@@ -29,7 +29,6 @@
 #include "scumm/sound.h"
 
 #include "common/config-manager.h"
-#include "common/system.h"
 #include "common/timer.h"
 #include "common/util.h"
 
@@ -2249,7 +2248,7 @@
 template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
 class AppendableMemoryStream : public AppendableAudioStream {
 protected:
-	OSystem::MutexRef _mutex;
+	Common::Mutex _mutex;
 
 	byte *_bufferStart;
 	byte *_bufferEnd;
@@ -2287,14 +2286,11 @@
 	_bufferStart = (byte *)malloc(bufferSize);
 	_pos = _end = _bufferStart;
 	_bufferEnd = _bufferStart + bufferSize;
-
-	_mutex = g_system->createMutex();
 }
 
 template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
 AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::~AppendableMemoryStream() {
 	free(_bufferStart);
-	g_system->deleteMutex(_mutex);
 }
 
 template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>





More information about the Scummvm-git-logs mailing list