aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-03-19 01:25:07 +0100
committerEugene Sandulenko2016-05-10 09:54:21 +0200
commit6b1a2f36498341ad409cdb8a9e0419e17ae0781c (patch)
treef23a469d87b2cb2a57c275b3505e8d68ff3e1fa2
parentd546847b5a02f020f816d556ca16ee0df8a04756 (diff)
downloadscummvm-rg350-6b1a2f36498341ad409cdb8a9e0419e17ae0781c.tar.gz
scummvm-rg350-6b1a2f36498341ad409cdb8a9e0419e17ae0781c.tar.bz2
scummvm-rg350-6b1a2f36498341ad409cdb8a9e0419e17ae0781c.zip
GNAP: rename SoundItem members
-rw-r--r--engines/gnap/sound.cpp20
-rw-r--r--engines/gnap/sound.h5
2 files changed, 13 insertions, 12 deletions
diff --git a/engines/gnap/sound.cpp b/engines/gnap/sound.cpp
index 9471d12a67..8fc216a880 100644
--- a/engines/gnap/sound.cpp
+++ b/engines/gnap/sound.cpp
@@ -35,13 +35,13 @@ SoundMan::~SoundMan() {
void SoundMan::playSound(int resourceId, bool looping) {
SoundItem soundItem;
- soundItem.resourceId = resourceId;
+ soundItem._resourceId = resourceId;
SoundResource *soundResource = _vm->_soundCache->get(resourceId);
Common::MemoryReadStream *stream = new Common::MemoryReadStream(soundResource->_data, soundResource->_size, DisposeAfterUse::NO);
Audio::AudioStream *audioStream = Audio::makeLoopingAudioStream(Audio::makeWAVStream(stream, DisposeAfterUse::YES), looping ? 0 : 1);
- _vm->_mixer->playStream(Audio::Mixer::kPlainSoundType, &soundItem.handle, audioStream);
+ _vm->_mixer->playStream(Audio::Mixer::kPlainSoundType, &soundItem._handle, audioStream);
_items.push_back(soundItem);
@@ -50,8 +50,8 @@ void SoundMan::playSound(int resourceId, bool looping) {
void SoundMan::stopSound(int resourceId) {
const int index = find(resourceId);
if (index >= 0) {
- _vm->_soundCache->release(_items[index].resourceId);
- _vm->_mixer->stopHandle(_items[index].handle);
+ _vm->_soundCache->release(_items[index]._resourceId);
+ _vm->_mixer->stopHandle(_items[index]._handle);
_items.remove_at(index);
}
}
@@ -62,20 +62,20 @@ void SoundMan::setSoundVolume(int resourceId, int volume) {
bool SoundMan::isSoundPlaying(int resourceId) {
const int index = find(resourceId);
- return index >= 0 && _vm->_mixer->isSoundHandleActive(_items[index].handle);
+ return index >= 0 && _vm->_mixer->isSoundHandleActive(_items[index]._handle);
}
void SoundMan::stopAll() {
for (int index = 0; index < (int)_items.size(); ++index) {
- _vm->_soundCache->release(_items[index].resourceId);
- _vm->_mixer->stopHandle(_items[index].handle);
+ _vm->_soundCache->release(_items[index]._resourceId);
+ _vm->_mixer->stopHandle(_items[index]._handle);
}
}
void SoundMan::update() {
for (int index = 0; index < (int)_items.size(); ++index)
- if (!_vm->_mixer->isSoundHandleActive(_items[index].handle)) {
- _vm->_soundCache->release(_items[index].resourceId);
+ if (!_vm->_mixer->isSoundHandleActive(_items[index]._handle)) {
+ _vm->_soundCache->release(_items[index]._resourceId);
_items.remove_at(index);
--index;
}
@@ -83,7 +83,7 @@ void SoundMan::update() {
int SoundMan::find(int resourceId) {
for (int index = 0; index < (int)_items.size(); ++index)
- if (_items[index].resourceId == resourceId)
+ if (_items[index]._resourceId == resourceId)
return index;
return -1;
}
diff --git a/engines/gnap/sound.h b/engines/gnap/sound.h
index ec5888ed1b..ced3deda62 100644
--- a/engines/gnap/sound.h
+++ b/engines/gnap/sound.h
@@ -31,8 +31,8 @@
namespace Gnap {
struct SoundItem {
- int resourceId;
- Audio::SoundHandle handle;
+ int _resourceId;
+ Audio::SoundHandle _handle;
};
class SoundMan {
@@ -48,6 +48,7 @@ public:
protected:
GnapEngine *_vm;
Common::Array<SoundItem> _items;
+
int find(int resourceId);
};