Atrinik Server 2.5
Defines | Functions
socket/sounds.c File Reference
#include <global.h>

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:
mapMap to play the sound on.
typeType of the sound being played, one of Sound command types.
filenameName of the sound to play.
xX position where the sound is playing from.
yY position where the sound is playing from.
loopHow many times to loop the sound, -1 for infinite number.
volumeVolume 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:
plPlayer to play sound to.
typeType of the sound being played, one of Sound command types.
filenameName of the sound to play.
xX position where the sound is playing from.
yY position where the sound is playing from.
loopHow many times to loop the sound, -1 for infinite number.
volumeVolume adjustment.

Definition at line 50 of file sounds.c.