aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/player_v1.cpp
diff options
context:
space:
mode:
authorMax Horn2010-03-10 21:05:48 +0000
committerMax Horn2010-03-10 21:05:48 +0000
commit05b8c5b9c52f787caa865be99868c547cc714fa2 (patch)
treeb08d75c16839a6bf2d92969c9f6bd283e86e709c /engines/scumm/player_v1.cpp
parent43abd0e0192d290d3cf256bbc7cf16869031b98b (diff)
downloadscummvm-rg350-05b8c5b9c52f787caa865be99868c547cc714fa2.tar.gz
scummvm-rg350-05b8c5b9c52f787caa865be99868c547cc714fa2.tar.bz2
scummvm-rg350-05b8c5b9c52f787caa865be99868c547cc714fa2.zip
Replace mutex_up/mutex_down methods by Common::StackLock
svn-id: r48231
Diffstat (limited to 'engines/scumm/player_v1.cpp')
-rw-r--r--engines/scumm/player_v1.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/scumm/player_v1.cpp b/engines/scumm/player_v1.cpp
index 28cd37698c..f2487c0a57 100644
--- a/engines/scumm/player_v1.cpp
+++ b/engines/scumm/player_v1.cpp
@@ -68,11 +68,11 @@ void Player_V1::chainSound(int nr, byte *data) {
}
void Player_V1::startSound(int nr) {
+ Common::StackLock lock(_mutex);
+
byte *data = _vm->getResourceAddress(rtSound, nr);
assert(data);
- mutex_up();
-
int offset = _pcjr ? READ_LE_UINT16(data+4) : 6;
int cprio = _current_data ? *(_current_data) & 0x7f : 0;
int prio = *(data + offset) & 0x7f;
@@ -89,21 +89,21 @@ void Player_V1::startSound(int nr) {
chainSound(nr, data + offset);
}
- mutex_down();
}
void Player_V1::stopAllSounds() {
- mutex_up();
+ Common::StackLock lock(_mutex);
+
for (int i = 0; i < 4; i++)
clear_channel(i);
_repeat_chunk = _next_chunk = 0;
_next_nr = _current_nr = 0;
_next_data = _current_data = 0;
- mutex_down();
}
void Player_V1::stopSound(int nr) {
- mutex_up();
+ Common::StackLock lock(_mutex);
+
if (_next_nr == nr) {
_next_nr = 0;
_next_data = 0;
@@ -117,7 +117,6 @@ void Player_V1::stopSound(int nr) {
_current_data = 0;
chainNextSound();
}
- mutex_down();
}
void Player_V1::clear_channel(int i) {