Go to the source code of this file.
Defines |
| #define | MAX_SOUND_DISTANCE 12 |
| #define | MAX_SOUND_DISTANCE_SQUARED POW2(MAX_SOUND_DISTANCE) |
Functions |
| void | play_sound_player_only (player *pl, int type, const char *filename, int x, int y, int loop, int volume) |
| void | play_sound_map (mapstruct *map, int type, const char *filename, int x, int y, int loop, int volume) |
Detailed Description
Sound related functions.
Definition in file sounds.c.
Define Documentation
| #define MAX_SOUND_DISTANCE 12 |
Maximum distance a player may hear a sound from.
This is only used for new client/server sound. If the sound source on the map is farther away than this, we don't sent it to the client.
Definition at line 37 of file sounds.c.
| #define MAX_SOUND_DISTANCE_SQUARED POW2(MAX_SOUND_DISTANCE) |
Squared maximum sound distance, using POW2.
Definition at line 39 of file sounds.c.
Function Documentation
| void play_sound_map |
( |
mapstruct * |
map, |
|
|
int |
type, |
|
|
const char * |
filename, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
loop, |
|
|
int |
volume |
|
) |
| |
Plays a sound on a map.
Considers tiled maps.
- Parameters:
-
| map | Map to play the sound on. |
| type | Type of the sound being played, one of Sound command types. |
| filename | Name of the sound to play. |
| x | X position where the sound is playing from. |
| y | Y position where the sound is playing from. |
| loop | How many times to loop the sound, -1 for infinite number. |
| volume | Volume adjustment. |
Definition at line 90 of file sounds.c.
| void play_sound_player_only |
( |
player * |
pl, |
|
|
int |
type, |
|
|
const char * |
filename, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
loop, |
|
|
int |
volume |
|
) |
| |
Plays a sound for specified player only.
- Parameters:
-
| pl | Player to play sound to. |
| type | Type of the sound being played, one of Sound command types. |
| filename | Name of the sound to play. |
| x | X position where the sound is playing from. |
| y | Y position where the sound is playing from. |
| loop | How many times to loop the sound, -1 for infinite number. |
| volume | Volume adjustment. |
Definition at line 50 of file sounds.c.