Go to the documentation of this file.
35 #define MAX_SOUND_DISTANCE 10
61 if (!emitter->
map && !(emitter->
env && emitter->
env->
map))
64 source = emitter->
map ? emitter : emitter->
env;
67 int dx =
FABS(source->
x-
pl->ob->x),
69 int distance = (
MIN(dx, dy) * 3 +
FABS(dx-dy) * 2) / 2;
73 volume = distance ? volume / distance : volume;
75 pl->socket->sounds_this_tick++;
100 #define POW2(x) ((x)*(x))
117 if (!emitter->
map && !(emitter->
env && emitter->
env->
map))
120 source = emitter->
map ? emitter : emitter->
env;
132 if (
pl->ob->map == emitter->
map) {
133 int distance =
ihypot(
pl->ob->x-source->
x,
pl->ob->y-source->
y);
164 if (
map->background_music != NULL) {
165 return map->background_music;
const char * get_name_of_region_for_map(const mapstruct *m)
void player_update_bg_music(object *player)
void SockList_AddString(SockList *sl, const char *data)
#define MAX_SOUND_DISTANCE
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
void SockList_AddChar(SockList *sl, unsigned char c)
void send_background_music(player *pl, const char *music)
void SockList_Init(SockList *sl)
void SockList_Term(SockList *sl)
const typedef char * sstring
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
void play_sound_player_only(player *pl, int8_t sound_type, object *emitter, int dir, const char *action)
static char const * pick_bg_music(mapstruct *map)
void Send_With_Handling(socket_struct *ns, SockList *sl)