mirror of
https://github.com/cxong/cdogs-sdl.git
synced 2025-07-23 07:23:01 +02:00
Add grenade bounce sound (#39)
This commit is contained in:
4
sounds/bounce.txt
Normal file
4
sounds/bounce.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Derived from pluck_can 09.wav by Ayavaron
|
||||
http://freesound.org/people/Ayavaron/sounds/126501/
|
||||
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
BIN
sounds/bounce.wav
Normal file
BIN
sounds/bounce.wav
Normal file
Binary file not shown.
@@ -728,6 +728,7 @@ void BulletInitialize(void)
|
||||
b->RangeLow = b->RangeHigh = 100;
|
||||
b->Power = 0;
|
||||
b->SparkType = BULLET_NONE;
|
||||
b->WallHitSound = SND_BOUNCE;
|
||||
b->Bounces = true;
|
||||
b->HitsObjects = false;
|
||||
b->Falling = true;
|
||||
@@ -740,6 +741,7 @@ void BulletInitialize(void)
|
||||
b->RangeLow = b->RangeHigh = 100;
|
||||
b->Power = 0;
|
||||
b->SparkType = BULLET_NONE;
|
||||
b->WallHitSound = SND_BOUNCE;
|
||||
b->Bounces = true;
|
||||
b->HitsObjects = false;
|
||||
b->Falling = true;
|
||||
@@ -767,6 +769,7 @@ void BulletInitialize(void)
|
||||
b->RangeLow = b->RangeHigh = 100;
|
||||
b->Power = 0;
|
||||
b->SparkType = BULLET_NONE;
|
||||
b->WallHitSound = SND_BOUNCE;
|
||||
b->Bounces = true;
|
||||
b->HitsObjects = false;
|
||||
b->Falling = true;
|
||||
@@ -779,6 +782,7 @@ void BulletInitialize(void)
|
||||
b->RangeLow = b->RangeHigh = 100;
|
||||
b->Power = 0;
|
||||
b->SparkType = BULLET_NONE;
|
||||
b->WallHitSound = SND_BOUNCE;
|
||||
b->Bounces = true;
|
||||
b->HitsObjects = false;
|
||||
b->Falling = true;
|
||||
|
@@ -72,7 +72,7 @@ SoundDevice gSoundDevice =
|
||||
{ 0, 0 },
|
||||
{ 0, 0 },
|
||||
{
|
||||
{"", 0, NULL},
|
||||
{NULL, 0, NULL},
|
||||
{"sounds/booom.wav", 0, NULL},
|
||||
{"sounds/launch.wav", 0, NULL},
|
||||
{"sounds/mg.wav", 0, NULL},
|
||||
@@ -104,6 +104,7 @@ SoundDevice gSoundDevice =
|
||||
{"sounds/hit_gas.wav", 0, NULL},
|
||||
{"sounds/hit_hard.wav", 0, NULL},
|
||||
{"sounds/hit_petrify.wav", 0, NULL},
|
||||
{"sounds/bounce.wav", 0, NULL},
|
||||
{"sounds/footstep.wav", 0, NULL},
|
||||
{"sounds/slide.wav", 0, NULL},
|
||||
{"sounds/health.wav", 0, NULL},
|
||||
@@ -138,25 +139,25 @@ int OpenAudio(int frequency, Uint16 format, int channels, int chunkSize)
|
||||
|
||||
void LoadSound(SoundData *sound)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
sound->isLoaded = 0;
|
||||
|
||||
// Check that file exists
|
||||
if (stat(GetDataFilePath(sound->name), &st) == -1)
|
||||
sound->isLoaded = false;
|
||||
if (sound->name)
|
||||
{
|
||||
printf("Error finding sample '%s'\n", GetDataFilePath(sound->name));
|
||||
return;
|
||||
}
|
||||
// Check that file exists
|
||||
struct stat st;
|
||||
if (stat(GetDataFilePath(sound->name), &st) == -1)
|
||||
{
|
||||
printf("Error finding sample '%s'\n", GetDataFilePath(sound->name));
|
||||
return;
|
||||
}
|
||||
|
||||
// Load file data
|
||||
if ((sound->data = Mix_LoadWAV(GetDataFilePath(sound->name))) == NULL)
|
||||
{
|
||||
printf("Error loading sample '%s'\n", GetDataFilePath(sound->name));
|
||||
return;
|
||||
// Load file data
|
||||
if ((sound->data = Mix_LoadWAV(GetDataFilePath(sound->name))) == NULL)
|
||||
{
|
||||
printf("Error loading sample '%s'\n", GetDataFilePath(sound->name));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sound->isLoaded = 1;
|
||||
sound->isLoaded = true;
|
||||
}
|
||||
|
||||
void SoundInitialize(SoundDevice *device, SoundConfig *config)
|
||||
|
@@ -91,6 +91,7 @@ typedef enum
|
||||
SND_HIT_GAS,
|
||||
SND_HIT_HARD,
|
||||
SND_HIT_PETRIFY,
|
||||
SND_BOUNCE,
|
||||
SND_FOOTSTEP,
|
||||
SND_SLIDE,
|
||||
SND_HEALTH,
|
||||
@@ -100,8 +101,8 @@ typedef enum
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[81];
|
||||
int isLoaded;
|
||||
const char *name;
|
||||
bool isLoaded;
|
||||
Mix_Chunk *data;
|
||||
} SoundData;
|
||||
|
||||
|
Reference in New Issue
Block a user