]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Add position information to sounds effects.
authorGuus Sliepen <guus@debian.org>
Sun, 9 Aug 2015 14:19:32 +0000 (16:19 +0200)
committerGuus Sliepen <guus@debian.org>
Sun, 9 Aug 2015 14:19:32 +0000 (16:19 +0200)
19 files changed:
src/aquaBoss.cpp
src/bosses.cpp
src/bullets.cpp
src/droidBoss.cpp
src/enemies.cpp
src/entities.cpp
src/explosions.cpp
src/finalBattle.cpp
src/galdov.cpp
src/game.cpp
src/items.cpp
src/map.cpp
src/mias.cpp
src/particles.cpp
src/switches.cpp
src/tankBoss.cpp
src/trains.cpp
src/traps.cpp
src/triggers.cpp

index 45e98178d35e6ac53ff03f057371821dbc041ace..466de929ddbf4b96e041b1d920e9e8a2241fa62b 100644 (file)
@@ -78,7 +78,7 @@ void aquaBossRecharge()
                                enemy->health = -1;
                                if (enemy->health % 10)
                                {
-                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                }
                                
                                Math::limitInt(&(++self->health), 0, self->maxHealth);
index 0af6d84d875dcb866100f3ce0c9f444abf595a0e..7c4c26a2a309cc5a39d68ae2d57bfa256e9d6dba 100644 (file)
@@ -438,7 +438,7 @@ bool isCorrectShieldFrequency(Entity *bullet)
                Math::removeBit(&bullet->flags, ENT_WEIGHTLESS);
                Math::removeBit(&bullet->flags, ENT_BOUNCES);
                
-               audio.playSound(SND_RICO1, CH_ANY);
+               audio.playSound(SND_RICO1, CH_ANY, bullet->x);
                
                return false;
        }
@@ -485,7 +485,7 @@ void checkBossBulletCollisions(Entity *bullet)
                                if (!(self->flags & ENT_IMMUNE))
                                {
                                        self->health -= bullet->damage;
-                                       audio.playSound(SND_CLANG, CH_ANY);
+                                       audio.playSound(SND_CLANG, CH_ANY, bullet->x);
                                        addColorParticles(bullet->x, bullet->y, Math::rrand(25, 75), -1);
                                        Math::removeBit(&bullet->flags, ENT_SPARKS);
                                        Math::removeBit(&bullet->flags, ENT_PUFFS);
index 522a262a44e3bbfb3d70b36b5dc38586230d03fa..88e288c8c91675d93e0fb842724c8cb70d7e2f6d 100644 (file)
@@ -81,7 +81,7 @@ void addBullet(Entity *owner, float dx, float dy)
 
        if (owner->currentWeapon->fireSound > -1)
        {
-               audio.playSound(owner->currentWeapon->fireSound, CH_WEAPON);
+               audio.playSound(owner->currentWeapon->fireSound, CH_WEAPON, owner->x);
        }
 
        if (owner->flags & ENT_AIMS)
@@ -133,7 +133,7 @@ void destroyBullet(Entity *bullet)
 
        if (bullet->flags & ENT_SPARKS)
        {
-               audio.playSound(bullet->deathSound, CH_TOUCH);
+               audio.playSound(bullet->deathSound, CH_TOUCH, bullet->x);
        }
 
        if (bullet->flags & ENT_EXPLODES)
@@ -183,7 +183,7 @@ void bounceBullet(Entity *bullet, float dx, float dy)
                if (bullet->id != WP_LASER)
                {
                        bullet->dx *= 0.75;
-                       audio.playSound(SND_GRBOUNCE, CH_TOUCH);
+                       audio.playSound(SND_GRBOUNCE, CH_TOUCH, bullet->x);
                }
                bullet->face = !bullet->face;
        }
@@ -201,7 +201,7 @@ void bounceBullet(Entity *bullet, float dx, float dy)
                if (bullet->id != WP_LASER)
                {
                        bullet->dy *= 0.75;
-                       audio.playSound(SND_GRBOUNCE, CH_TOUCH);
+                       audio.playSound(SND_GRBOUNCE, CH_TOUCH, bullet->x);
                }
 
                if ((bullet->dy > -2) && (bullet->dy <= 0)) bullet->dy = -2;
@@ -233,7 +233,7 @@ bool bulletHasCollided(Entity *bullet, float dx, float dy)
                                {
                                        Math::removeBit(&bullet->flags, ENT_BOUNCES);
                                        map.data[x][y] = MAP_AIR;
-                                       audio.playSound(SND_STONEBREAK, CH_EXPLODE);
+                                       audio.playSound(SND_STONEBREAK, CH_EXPLODE, bullet->x);
                                        throwBrickParticles(x << BRICKSHIFT, y << BRICKSHIFT);
                                }
                                else
@@ -241,7 +241,7 @@ bool bulletHasCollided(Entity *bullet, float dx, float dy)
                                        if ((Math::prand() % 2) == 0)
                                        {
                                                map.data[x][y] = MAP_AIR;
-                                               audio.playSound(SND_STONEBREAK, CH_EXPLODE);
+                                               audio.playSound(SND_STONEBREAK, CH_EXPLODE, bullet->x);
                                                throwBrickParticles(x << BRICKSHIFT, y << BRICKSHIFT);
                                        }
                                }
index 2f04f77569cba897e32239a1295283e39135d592..923fdb52a0b75c591c878645caeb955c68b68613 100644 (file)
@@ -130,7 +130,7 @@ void droidBossChangeFrequency()
                        break;
        }
        
-       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
+       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE, self->x);
 }
 
 void droidBossDie()
@@ -183,7 +183,7 @@ void droidBossReact()
        if ((Math::prand() % 10) == 0)
        {
                Math::addBit(&self->flags, ENT_IMMUNE);
-               audio.playSound(SND_BOSSCUSTOM2, CH_SPAWN);
+               audio.playSound(SND_BOSSCUSTOM2, CH_SPAWN, self->x);
                self->custom = 5;
                self->think = &droidGoCrazy;
                self->setActionFinished(2);
index 8f16847bd0377fa6cdac6b88f645a7d2667a5608..41d31e612ddbf0883c6d62622d0045a39d726af8 100644 (file)
@@ -422,7 +422,7 @@ void enemyBulletCollisions(Entity *bullet)
 
                                if (!(enemy->flags & ENT_EXPLODES))
                                {
-                                       audio.playSound(SND_HIT, CH_ANY);
+                                       audio.playSound(SND_HIT, CH_ANY, enemy->x);
                                        if (game.gore)
                                        {
                                                addBlood(enemy, bullet->dx / 4, Math::rrand(-6, -3), 1);
@@ -434,7 +434,7 @@ void enemyBulletCollisions(Entity *bullet)
                                }
                                else
                                {
-                                       audio.playSound(SND_CLANG, CH_ANY);
+                                       audio.playSound(SND_CLANG, CH_ANY, enemy->x);
                                        addColorParticles(bullet->x, bullet->y, Math::rrand(25, 75), -1);
                                }
 
@@ -470,11 +470,11 @@ void enemyBulletCollisions(Entity *bullet)
                                                        
                                                        if (enemy->flags & ENT_EXPLODES)
                                                        {
-                                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH);
+                                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                                        }
                                                        else if (game.gore)
                                                        {
-                                                               audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                                                               audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                                        }
                                                }
                                        }
@@ -494,11 +494,11 @@ void enemyBulletCollisions(Entity *bullet)
                                        
                                        if (enemy->flags & ENT_EXPLODES)
                                        {
-                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH);
+                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                        }
                                        else if (game.gore)
                                        {
-                                               audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                                               audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                        }
 
                                        if (bullet->owner == &player)
@@ -591,7 +591,7 @@ void gibEnemy(Entity *enemy)
                }
        }
        
-       (game.gore) ? audio.playSound(SND_SPLAT, CH_ANY) : audio.playSound(SND_POP, CH_ANY);
+       (game.gore) ? audio.playSound(SND_SPLAT, CH_ANY) : audio.playSound(SND_POP, CH_ANY, enemy->x);
 }
 
 void doEnemies()
@@ -739,7 +739,7 @@ void doEnemies()
                                        {
                                                if (game.gore)
                                                {
-                                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                                }
                                        }
                                }
index 7ab691f881c7431901f84245476aec4c4a2023b7..25ae95409fb1951cb9f70a1597106eac7e5d626f 100644 (file)
@@ -30,7 +30,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
 
        if (!(ent->flags & ENT_EXPLODES))
        {
-               audio.playSound(SND_HIT, CH_ANY);
+               audio.playSound(SND_HIT, CH_ANY, ent->x);
                for (int i = 0 ; i < 4 ; i++)
                {
                        addBlood(ent, Math::rrand(-5, 5), Math::rrand(-6, -3), i);
@@ -38,7 +38,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
        }
        else
        {
-               audio.playSound(SND_CLANG, CH_ANY);
+               audio.playSound(SND_CLANG, CH_ANY, ent->x);
                addColorParticles(ent->x, ent->y, Math::rrand(25, 75), -1);
        }
 
@@ -62,7 +62,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
 
                if (player.health <= 0)
                {
-                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, player.x);
                        player.health = 0;
                }
 
index e380ca00511bb307d3321e04fd8c0f2efb28115d..86e119832fbc71889d6f4ab01bb26d9666f5dc09 100644 (file)
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 void addExplosion(float x, float y, int radius, Entity *owner)
 {
-       audio.playSound(SND_GRENADE, CH_EXPLODE);
+       audio.playSound(SND_GRENADE, CH_EXPLODE, x);
 
        float dx, dy;
        int distX, distY;
@@ -78,13 +78,13 @@ void addExplosion(float x, float y, int radius, Entity *owner)
                                {
                                        if (enemy->flags & ENT_EXPLODES)
                                        {
-                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH);
+                                               audio.playSound(SND_ELECDEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                        }
                                        else
                                        {
                                                if (game.gore)
                                                {
-                                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+                                                       audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, enemy->x);
                                                }
                                        }
                                }
index 3e846fbdb03a2a6b4bdb5a9d33d6db0836f91fc8..bec95120219e24d62b0ac42479e7432b1f463adc 100644 (file)
@@ -214,7 +214,7 @@ void galdovFinalDropCrystal()
                map.boss[0]->health = 30 * game.skill;
                map.boss[0]->setSprites(graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true));
                engine.setInfoMessage("Galdov has dropped the crystal! Quick! Get it!!", 99, INFO_HINT);
-               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
+               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE, x);
        }
 }
 
@@ -224,7 +224,7 @@ void galdovFinalDie()
        {
                game.missionOverReason = MIS_GAMECOMPLETE;
                audio.stopMusic();
-               audio.playSound(SND_BOSSCUSTOM3, CH_AMBIANCE);
+               audio.playSound(SND_BOSSCUSTOM3, CH_AMBIANCE, self->x);
                player.health = 10;
                self->dx = 5;
                self->dy = -6;
@@ -466,7 +466,7 @@ void galdovRejoin()
        self->think = &galdovFinalTeleport;
        self->currentWeapon = getRandomGaldovWeapon();
        
-       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
+       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE, self->x);
        
        map.setMainBossPart(map.boss[0]);
        
@@ -528,13 +528,14 @@ void galdovFinalSplit()
                addTeleportParticles(map.boss[i]->x + 10 + map.boss[i]->dx, map.boss[i]->y + 10 + map.boss[i]->dy, 75, -1);
        }
        
+       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE, map.boss[0]->x);
+
        map.boss[0]->place(9999, 9999);
        map.boss[0]->setThinkTime(2);
        map.boss[0]->setActionFinished(Math::rrand(10, 15) * 60);
        map.boss[0]->think = &galdovRejoin;
        map.boss[0]->active = true;
        
-       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
        map.setMainBossPart(NULL);
        
        debug(("galdovFinalSplit: Done\n"));
@@ -655,13 +656,13 @@ void orbSeekGaldov()
                self->setActionFinished(60);
                self->setThinkTime(60);
                addExplosion(self->x, self->y, 75, &player);
+               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE, self->x);
                self->place(9999, 9999);
                map.boss[0]->setSprites(graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true));
                map.boss[0]->think = &galdovFinalPainThrow2;
                map.boss[0]->health -= (3 * game.skill);
                Math::removeBit(&map.boss[0]->flags, ENT_FLIES);
                Math::removeBit(&map.boss[0]->flags, ENT_FIRETRAIL);
-               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
        }
 }
 
index 8f1240c2c7301ae92fa4460e2bfbb7c07341d6e1..00bd898629e5fd6c49056de4f76f1e87c41ba48b 100644 (file)
@@ -131,7 +131,7 @@ void galdovReact()
 
 void galdovSplit(int i)
 {
-       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
+       audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE, map.boss[0]->x);
        
        map.boss[i]->active = true;
        map.boss[i]->health = 4 * game.skill;
@@ -389,7 +389,7 @@ void galdovDie()
        if (map.mainBossPart != NULL)
        {
                map.mainBossPart = NULL;
-               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
+               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE, self->x);
        }
        
        if ((self->health % 5) == 0)
index b78972de21a49eacdd248ba3cd2306380e7cf4da..7cb8c0f5844f7d1ec4869093f9b697e6493a0cd2 100644 (file)
@@ -529,7 +529,7 @@ void beamInPlayer()
        
        unsigned int frameLimit = SDL_GetTicks() + 16;
        
-       audio.playSound(SND_TELEPORT1, CH_ANY);
+       audio.playSound(SND_TELEPORT1, CH_ANY, player.x);
        
        engine.setPlayerPosition((int)player.x, (int)player.y, map.limitLeft, map.limitRight, map.limitUp, map.limitDown);
        
index 4c28235a3c4073832c949a215443a23be7a407fb..814deadef31fda0f8e91c27d3f00a63310c189b3 100644 (file)
@@ -235,7 +235,7 @@ void pickUpItem(Entity *item)
                case ITEM_SPREAD:
                        player.currentWeapon = &weapon[item->id];
                        game.currentWeapon = item->id;
-                       audio.playSound(SND_GETWEAPON, CH_ITEM);
+                       audio.playSound(SND_GETWEAPON, CH_ITEM, item->x);
                        break;
                case ITEM_POINTS:
                case ITEM_POINTS2:
@@ -245,18 +245,18 @@ void pickUpItem(Entity *item)
                case ITEM_POINTS6:
                case ITEM_POINTS7:
                        addPlayerScore(item->value);
-                       audio.playSound(SND_ITEM, CH_ITEM);
+                       audio.playSound(SND_ITEM, CH_ITEM, item->x);
                        break;
                case ITEM_CHERRY:
                case ITEM_DOUBLECHERRY:
                case ITEM_TRIPLECHERRY:
                        Math::limitInt(&(player.health += item->value), 0, MAX_HEALTH);
-                       audio.playSound(SND_GULP + (Math::prand() % 2), CH_ITEM);
+                       audio.playSound(SND_GULP + (Math::prand() % 2), CH_ITEM, item->x);
                        break;
                case ITEM_MISC:
                        item->owner = &player;
                case ITEM_MISC_NOSHOW:
-                       audio.playSound(SND_ITEM, CH_ITEM);
+                       audio.playSound(SND_ITEM, CH_ITEM, item->x);
                        break;
        }
 
index d0206ccc524584e33f0ab6487fa336c89cd52daf..e7d548f9d99ecca0036ed9daf81b48ae670a9115 100644 (file)
@@ -512,7 +512,7 @@ void evaluateMapAttribute(Entity *ent, int mapAttribute)
                                        
                                        if (ent->dy < 0)
                                        {
-                                               audio.playSound(SND_WATEROUT, CH_TOUCH);
+                                               audio.playSound(SND_WATEROUT, CH_TOUCH, ent->x);
                                        }
 
                                        ent->checkEnvironment();
@@ -529,7 +529,7 @@ void evaluateMapAttribute(Entity *ent, int mapAttribute)
 
                        if (ent->environment == ENV_AIR)
                        {
-                               audio.playSound(SND_WATERIN, CH_TOUCH);
+                               audio.playSound(SND_WATERIN, CH_TOUCH, ent->x);
                                if ((mapAttribute == MAP_SLIME) || (mapAttribute == MAP_LAVA))
                                        ent->thinktime = 1;
                        }
index 25d093b833b620b6942c04923afc73b8fa36bacf..2d4e263e08b620addfb4dbe239d0f114f9407825 100644 (file)
@@ -116,7 +116,7 @@ void doMIAs()
                                {
                                        Math::addBit(&mia->flags, ENT_WEIGHTLESS);
                                        Math::addBit(&mia->flags, ENT_DYING);
-                                       audio.playSound(SND_TELEPORT1, CH_ANY);
+                                       audio.playSound(SND_TELEPORT1, CH_ANY, mia->x);
                                }
                        }
                        
index 4416444caf98e13fb03c1fb545ff2ffd8fb2b436..942a79ddbad0243a4468f093da8e8230244a6ee2 100644 (file)
@@ -137,7 +137,7 @@ void addTeleportParticles(float x, float y, int amount, int soundToPlay)
 
        if (soundToPlay != -1)
        {
-               audio.playSound(soundToPlay, CH_SPAWN);
+               audio.playSound(soundToPlay, CH_SPAWN, x);
        }
 }
 
index 1ce0119c6535a1961307334a26910a50732ae268..2545f8b240d18fbdf7fb5ba3ebba498e5ace61cb 100644 (file)
@@ -85,7 +85,7 @@ void checkSwitchContact(Entity *ent)
                                {
                                        if ((swt->type == SWT_NORMAL) || (swt->type == SWT_WATERLEVEL))
                                        {
-                                               audio.playSound(SND_SWITCH1, CH_TOUCH);
+                                               audio.playSound(SND_SWITCH1, CH_TOUCH, swt->x);
                                                swt->activated = !swt->activated;
                                                activateTrigger(swt->linkName, swt->activateMessage, swt->activated);
                                                swt->health = 1;
@@ -93,20 +93,20 @@ void checkSwitchContact(Entity *ent)
                                        }
                                        else if (swt->type == SWT_TOGGLE)
                                        {
-                                               audio.playSound(SND_SWITCH1, CH_TOUCH);
+                                               audio.playSound(SND_SWITCH1, CH_TOUCH, swt->x);
                                                activateTrigger(swt->linkName, swt->activateMessage, !swt->activated);
                                                swt->activated = !swt->activated;
                                        }
                                        else if (swt->type == SWT_PRESSURE)
                                        {
-                                               audio.playSound(SND_SWITCH1, CH_TOUCH);
+                                               audio.playSound(SND_SWITCH1, CH_TOUCH, swt->x);
                                                swt->activated = true;
                                                activateTrigger(swt->linkName, swt->activateMessage, true);
                                                swt->health = 2;
                                        }
                                        else if ((swt->type == SWT_TIMED) || (swt->type == SWT_RESET))
                                        {
-                                               audio.playSound(SND_SWITCH1, CH_TOUCH);
+                                               audio.playSound(SND_SWITCH1, CH_TOUCH, swt->x);
                                                activateTrigger(swt->linkName, swt->activateMessage, true);
                                                swt->activated = !swt->activated;
                                                swt->health = 240;
index fac7b8f5252a15a87e0719ab7b12a7e0d7d3dfd8..59ed0f15c577b1c1c415e4f4c8866e75e60273a7 100644 (file)
@@ -173,7 +173,7 @@ void tankBossMGCannonChargeFire()
        if (self->custom == 0)
        {
                self->think = tankBossMGCannonFire;
-               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
+               audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE, self->x);
        }
 }
 
@@ -267,7 +267,7 @@ void tankBossMGAttack()
                self->think = &tankBossMGCannonChargeFire;
                self->setThinkTime(0);
                self->setActionFinished(2);
-               audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
+               audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE, self->x);
                Math::addBit(&self->flags, ENT_IMMUNE);
        }
        else
index f1cbb4f6c755ad3cc892c911ed6f3663b30901aa..2c7585f21157293c278188a7e5b79214ef8f2857 100644 (file)
@@ -63,7 +63,7 @@ void openDoor(Train *train)
 
        train->active = true;
 
-       audio.playSound(SND_OPENDOOR, CH_TOUCH);
+       audio.playSound(SND_OPENDOOR, CH_TOUCH, train->x);
 }
 
 /**
@@ -81,7 +81,7 @@ void trainBlockEntity(Entity *ent, const char *message, Train *train, int dir)
                if ((train->isReady()) && (!train->active))
                {
                        engine.setInfoMessage(message, 1, INFO_NORMAL);
-                       audio.playSound(SND_LOCKEDDOOR, CH_TOUCH);
+                       audio.playSound(SND_LOCKEDDOOR, CH_TOUCH, train->x);
                }
        }
        
@@ -355,7 +355,7 @@ void doTrains()
                                }
                                else if (playSound)
                                {
-                                       audio.playSound(SND_DOOROPENED, CH_TOUCH);
+                                       audio.playSound(SND_DOOROPENED, CH_TOUCH, train->x);
                                }
                        }
                }
index 842554ba62cac73f30658f409813b709e7169f37..33e0dd8dc75b8b295a080c4d36c83250acabc752 100644 (file)
@@ -219,24 +219,24 @@ void doTraps()
                                switch (trap->type)
                                {
                                        case TRAP_TYPE_MINE:
-                                               audio.playSound(SND_ROCKET, CH_SPAWN);
+                                               audio.playSound(SND_ROCKET, CH_SPAWN, trap->x);
                                                break;
                                        case TRAP_TYPE_SPIKE:
-                                               audio.playSound(SND_ROCKET, CH_SPAWN);
+                                               audio.playSound(SND_ROCKET, CH_SPAWN, trap->x);
                                                break;
                                        case TRAP_TYPE_SWING:
-                                               audio.playSound(SND_THROW, CH_SPAWN);
+                                               audio.playSound(SND_THROW, CH_SPAWN, trap->x);
                                                break;
                                        case TRAP_TYPE_BARRIER:
                                                if ((absX <= 640) && (absY <= 480))
                                                {
-                                                       audio.playSound(SND_ELECTRICITY1 + Math::prand() % 3, CH_SPAWN);
+                                                       audio.playSound(SND_ELECTRICITY1 + Math::prand() % 3, CH_SPAWN, trap->x);
                                                }
                                                break;
                                        case TRAP_TYPE_FLAME:
                                                if ((absX <= 640) && (absY <= 480))
                                                {
-                                                       audio.playSound(SND_FIRECRACKLE, CH_SPAWN);
+                                                       audio.playSound(SND_FIRECRACKLE, CH_SPAWN, trap->x);
                                                }
                                                break;
                                }
index 76f7935c3a9a7df19bdc6157037830a1c913afcf..9d9584e40a70315f47cd49063c4a58d06a3af921 100644 (file)
@@ -93,7 +93,7 @@ void activateTrigger(const char *linkName, const char *activateMessage, bool act
                                engine.setInfoMessage(activateMessage, 1, INFO_ACTIVATE);
 
                        if (train->type != TR_TRAIN)
-                               audio.playSound(SND_OPENDOOR, CH_TOUCH);
+                               audio.playSound(SND_OPENDOOR, CH_TOUCH, train->x);
 
                        linkOkay = true;
                }