Add beep sound to platforms with no beep

This commit is contained in:
elasota
2021-05-09 23:45:27 -04:00
parent d54ad576bc
commit 24169507bd
21 changed files with 85 additions and 25 deletions

View File

@@ -249,7 +249,7 @@ void DoAboutOpenSource(void)
static const int kAboutOpenSourceDialogTemplateID = 2005;
const Rect windowRect = Rect::Create(0, 0, 324, 512);
const Rect windowRect = Rect::Create(0, 0, 348, 512);
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(windowRect, PortabilityLayer::WindowStyleFlags::kAlert, true, 0, 0, PSTR(""));

View File

@@ -115,7 +115,8 @@
#define kTransInSound 60 // <20><> <20><>
#define kBonusSound 61 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define kHissSound 62 //
#define kTriggerSound 63
#define kPingSound 63 //
#define kTriggerSound 64 // This must be the last one
#define kHitWallPriority 100 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define kScoreTikPriority 101 // <20><>
@@ -177,6 +178,7 @@
#define kFollowPriority 904
#define kTransInPriority 905
#define kTransOutPriority 906
#define kPingPriority 907
#define kTriggerPriority 999
#define kArrowCursor 0

View File

@@ -23,7 +23,7 @@
#define kBaseBufferSoundID 1000
#define kMaxSounds 64
#define kMaxSounds 65
void CallBack0 (PortabilityLayer::AudioChannel *);
@@ -38,7 +38,7 @@ IGpAudioBuffer *ParseAndConvertSound(const THandle<void> &handle);
PortabilityLayer::AudioChannel *channel0, *channel1, *channel2;
IGpAudioBuffer *theSoundData[kMaxSounds];
short numSoundsLoaded;
Boolean soundLoaded[kMaxSounds], dontLoadSounds;
Boolean dontLoadSounds;
Boolean channelOpen, isSoundOn, failedSound;
//============================================================== Functions
@@ -341,6 +341,14 @@ void CloseSoundChannels (void)
channelOpen = false;
}
//-------------------------------------------------------------- PingBeep
void PingBeep (int duration)
{
PlayPrioritySound(kPingSound, kPingPriority);
}
//-------------------------------------------------------------- InitSound
void InitSound (void)
@@ -376,6 +384,8 @@ void InitSound (void)
failedSound = true;
}
}
SetBeepFunction (PingBeep);
}
//-------------------------------------------------------------- KillSound