aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/loc.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2012-08-25 00:31:00 +0200
committerAlyssa Milburn2012-08-25 10:08:10 +0200
commitb14a616f3f7f667946f617facd301369a0996582 (patch)
tree32f5916d3c9e1d8d7beae7613e06845dbba3f399 /engines/tony/loc.cpp
parentb77306bfcc26d17b1fca71360d1fcbd2ebdbe0ee (diff)
downloadscummvm-rg350-b14a616f3f7f667946f617facd301369a0996582.tar.gz
scummvm-rg350-b14a616f3f7f667946f617facd301369a0996582.tar.bz2
scummvm-rg350-b14a616f3f7f667946f617facd301369a0996582.zip
TONY: Get rid of RMString.
Diffstat (limited to 'engines/tony/loc.cpp')
-rw-r--r--engines/tony/loc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp
index 9fba2dd51a..e767584e9b 100644
--- a/engines/tony/loc.cpp
+++ b/engines/tony/loc.cpp
@@ -145,7 +145,7 @@ void RMPattern::updateCoord() {
void RMPattern::stopSfx(RMSfx *sfx) {
for (int i = 0; i < _nSlots; i++) {
if (_slots[i]._type == SOUND) {
- if (sfx[_slots[i]._data]._name[0] == '_')
+ if (!sfx[_slots[i]._data]._name.empty() && sfx[_slots[i]._data]._name[0] == '_')
sfx[_slots[i]._data].stop();
else if (GLOBALS._bSkipSfxNoLoop)
sfx[_slots[i]._data].stop();
@@ -182,7 +182,7 @@ int RMPattern::init(RMSfx *sfx, bool bPlayP0, byte *bFlag) {
for (i = 0; i < _nSlots; i++) {
if (_slots[i]._type == SOUND) {
if (i == 0) {
- if (sfx[_slots[i]._data]._name[0] == '_') {
+ if (!sfx[_slots[i]._data]._name.empty() && sfx[_slots[i]._data]._name[0] == '_') {
sfx[_slots[i]._data].setVolume(_slots[i].pos()._x);
sfx[_slots[i]._data].play(true);
} else {
@@ -193,12 +193,12 @@ int RMPattern::init(RMSfx *sfx, bool bPlayP0, byte *bFlag) {
if (bPlayP0) {
sfx[_slots[i]._data].setVolume(_slots[i].pos()._x);
sfx[_slots[i]._data].play();
- } else if (sfx[_slots[i]._data]._name[0] == '_') {
+ } else if (!sfx[_slots[i]._data]._name.empty() && sfx[_slots[i]._data]._name[0] == '_') {
sfx[_slots[i]._data].setVolume(_slots[i].pos()._x);
sfx[_slots[i]._data].play(true);
}
} else {
- if (_bLoop && sfx[_slots[i]._data]._name[0] == '_') {
+ if (_bLoop && !sfx[_slots[i]._data]._name.empty() && sfx[_slots[i]._data]._name[0] == '_') {
sfx[_slots[i]._data].setVolume(_slots[i].pos()._x);
sfx[_slots[i]._data].play(true);
}
@@ -253,7 +253,7 @@ int RMPattern::update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) {
if (sfx != NULL) {
sfx[_slots[_nCurSlot]._data].setVolume(_slots[_nCurSlot].pos()._x);
- if (sfx[_slots[_nCurSlot]._data]._name[0] != '_')
+ if (sfx[_slots[_nCurSlot]._data]._name.empty() || sfx[_slots[_nCurSlot]._data]._name[0] != '_')
sfx[_slots[_nCurSlot]._data].play(false);
else
sfx[_slots[_nCurSlot]._data].play(true);
@@ -729,7 +729,7 @@ void RMItem::setPattern(int nPattern, bool bPlayP0) {
// Look for the sound effect for pattern 0
if (bPlayP0) {
for (int i = 0; i < _nSfx; i++) {
- if (strcmp(_sfx[i]._name, "p0") == 0)
+ if (_sfx[i]._name == "p0")
_sfx[i].play();
}
}