|
@@ -625,8 +625,6 @@ void OpenRaider::handleKeyPressEvent(unsigned int key, unsigned int mod)
|
625
|
625
|
switch (key)
|
626
|
626
|
{
|
627
|
627
|
case SYS_MOUSE_LEFT:
|
628
|
|
- mSound.play(m_testSFX);
|
629
|
|
-
|
630
|
628
|
if (LARA)
|
631
|
629
|
{
|
632
|
630
|
eventAnimTest(15);
|
|
@@ -672,7 +670,11 @@ void OpenRaider::handleKeyPressEvent(unsigned int key, unsigned int mod)
|
672
|
670
|
}
|
673
|
671
|
break;
|
674
|
672
|
case 'r':
|
675
|
|
- mSound.play(m_testSFX);
|
|
673
|
+ if (m_flags & OpenRaider_EnableSound) {
|
|
674
|
+ if (m_testSFX < mSound.registeredSources()) {
|
|
675
|
+ mSound.play(m_testSFX);
|
|
676
|
+ }
|
|
677
|
+ }
|
676
|
678
|
break;
|
677
|
679
|
}
|
678
|
680
|
}
|
|
@@ -1072,7 +1074,8 @@ void OpenRaider::gameFrame()
|
1072
|
1074
|
{
|
1073
|
1075
|
if (m_flags & OpenRaider_EnableSound)
|
1074
|
1076
|
{
|
1075
|
|
- mSound.play(TR_SOUND_FOOTSTEP0);
|
|
1077
|
+ if (TR_SOUND_FOOTSTEP0 < mSound.registeredSources())
|
|
1078
|
+ mSound.play(TR_SOUND_FOOTSTEP0);
|
1076
|
1079
|
}
|
1077
|
1080
|
}
|
1078
|
1081
|
else if (mdl->getAnimation() == 15)
|
|
@@ -1193,14 +1196,18 @@ void OpenRaider::processTextures()
|
1193
|
1196
|
|
1194
|
1197
|
void OpenRaider::soundEvent(int type, int id, vec3_t pos, vec3_t angles)
|
1195
|
1198
|
{
|
1196
|
|
- switch (type)
|
1197
|
|
- {
|
1198
|
|
- case 0: // Reset listener position
|
1199
|
|
- mSound.listenAt(pos, angles);
|
1200
|
|
- break;
|
1201
|
|
- default:
|
1202
|
|
- mSound.sourceAt(id, pos);
|
1203
|
|
- mSound.play(id);
|
|
1199
|
+ if (m_flags & OpenRaider_EnableSound) {
|
|
1200
|
+ switch (type)
|
|
1201
|
+ {
|
|
1202
|
+ case 0: // Reset listener position
|
|
1203
|
+ mSound.listenAt(pos, angles);
|
|
1204
|
+ break;
|
|
1205
|
+ default:
|
|
1206
|
+ if (id < mSound.registeredSources()) {
|
|
1207
|
+ mSound.sourceAt(id, pos);
|
|
1208
|
+ mSound.play(id);
|
|
1209
|
+ }
|
|
1210
|
+ }
|
1204
|
1211
|
}
|
1205
|
1212
|
}
|
1206
|
1213
|
|