mirror of
https://github.com/softdorothy/Pararena2.git
synced 2024-06-11 01:29:28 +00:00
1 line
7.8 KiB
C
1 line
7.8 KiB
C
|
/*============================================================*/
/*============================================================*/
/*== ==*/
/*== Sound Handling Routines ==*/
/*== ==*/
/*============================================================*/
/*============================================================*/
/*======================================================== Includes */
#include "Globals.h"
#include "UnivUtilities.h"
#include "SoundUtils.h"
#include "SMS.h"
/*======================================================== Functions */
/*======================================================== TurnSMSOn */
void TurnSMSOn (void)
{
if (!smsActivated)
{
SMSINIT();
SMSSETMODE(kFourChannel);
smsActivated = TRUE;
}
}
/*======================================================== TurnSMSOff */
void TurnSMSOff (void)
{
long dummyLong;
if (smsActivated)
{
SMSSTOP();
SMSEXIT();
Delay(2, &dummyLong);
smsActivated = FALSE;
}
}
/*======================================================== PlaySoundSMS */
void PlaySoundSMS (short theSoundID)
{
if ((netGameInSession) && (imTheMaster) && (theSoundID < kMaxNumberOfSounds) &&
(soundPriorities[theSoundID] > lastSoundPriority))
{
wasLastSound = theSoundID;
lastSoundPriority = soundPriorities[theSoundID];
}
if (smsActivated && soundLoaded[theSoundID] && soundOn)
{
switch (theSoundID)
{
case 0:
break;
case kClashSound:
case kRicochetSound:
case kBallPickUpSound:
case kBallDropSound:
case kBrakeSound:
if (collisionSoundOn)
{
SMSSTART(theSoundID);
}
break;
case kBallFiringSound:
case kBeamInSound:
case kBeamOutSound:
if (beamSoundOn)
{
SMSSTART(theSoundID);
}
break;
case kCrowdSound:
case kCrowdSwellSound:
case kApplauseSound:
case kCrowdFadeSound:
case kMobSwellSound:
case kMobSound:
case kMobFadeSound:
if (crowdSoundOn)
{
SMSSTART(theSoundID);
}
break;
default:
SMSSTART(theSoundID);
break;
}
}
}
/*======================================================== PlayIncidentSoundSMS */
void PlayIncidentSoundSMS (short theSoundID)
{
if ((smsActivated) && (soundOn) && (incidentSoundOn) &&
(incidentSoundLoaded[theSoundID - kMaxNumberOfSounds]))
{
if ((netGameInSession) && (imTheMaster) && (lastSoundPriority < 10))
{
wasLastSound = theSoundID;
lastSoundPriority = 10;
}
switch (theSoundID)
{
case 0:
break;
case kBeerManSound:
case kHotDogSound:
case kProgramSound:
if (soundFileRefNum != -1)
{
SMSSTART(theSoundID);
}
break;
default:
break;
}
}
}
/*======================================================== FlushSoundQueues */
void FlushSoundQueues (void)
{
crowdQueue.number = 0;
crowdQueue.when = 0;
crowdQueue.priority = 0;
incidentalQueue.number = 0;
incidentalQueue.when = 0;
incidentalQueue.priority = 0;
}
/*======================================================== BeginGamePointSound */
void BeginGamePointSound (void)
{
incidentalQueue.number = kGameSound;
incidentalQueue.when = 180;
incidentalQueue.priority = 100;
}
/*======================================================== BeginAllTiedSound */
void BeginAllTiedSound (void)
{
incidentalQueue.number = kAllSound;
incidentalQueue.when = 180;
incidentalQueue.priority = 100;
}
/*======================================================== StartCrowdSound */
void StartCrowdSound (void)
{
if ((smsActivated) && (crowdSoundOn) && (soundOn) && (whichGame > kPracticeScoring))
{
SMSSTARTCHAN(kCrowdSound, 3);
crowdQueue.number = 0;
crowdQueue.when = 0;
}
}
/*======================================================== StartApplauseSound */
void StartApplauseSound (void)
{
if ((smsActivated) && (crowdSoundOn) && (soundOn) && (whichGame > kPracticeScoring))
{
SMSSTARTCHAN(kCrowdSwellSound, 3);
crowdQueue.number = kApplauseSound;
crowdQueue.when = kApplauseSwellTicks;
}
}
/*================================================
|