+static void PlayTimeoutSound(int seconds_left)
+{
+ // will be played directly by BD engine (for classic bonus time sounds)
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD && checkBonusTime_BD())
+ return;
+
+ // try to use individual "running out of time" sound for each second left
+ int sound = SND_GAME_RUNNING_OUT_OF_TIME_0 - seconds_left;
+
+ // if special sound per second not defined, use default sound
+ if (getSoundInfoEntryFilename(sound) == NULL)
+ sound = SND_GAME_RUNNING_OUT_OF_TIME;
+
+ // if out of time, but player still alive, play special "timeout" sound, if defined
+ if (seconds_left == 0 && !checkGameFailed())
+ if (getSoundInfoEntryFilename(SND_GAME_TIMEOUT) != NULL)
+ sound = SND_GAME_TIMEOUT;
+
+ PlaySound(sound);
+}
+