 |
Crossfire Client, Trunk
|
Go to the documentation of this file.
24 #include "client-vala.h"
40 guint8 dir, vol, type, len_sound, len_source;
54 "gtk-v2::Sound2Cmd",
"Sound command too short: %d\n bytes", len);
68 if (6 + len_sound + 1 > len) {
70 "gtk-v2::Sound2Cmd",
"sound length check: %i len: %i\n",
75 len_source = data[6 + len_sound];
77 sound = (
char *) data + 6;
78 data[6 + len_sound] =
'\0';
84 if (6 + len_sound + 1 + len_source > len) {
86 "gtk-v2::Sound2Cmd",
"source length check: %i len: %i\n",
94 if (len_source != 0) {
95 source = (
char *) data + 6 + len_sound + 1;
96 data[6 + len_sound + 1 + len_source] =
'\0';
124 "Music command string is not null-terminated.");
@ LOG_WARNING
Warning that something might not work.
int cf_snd_init()
Initialize sound server.
void Sound2Cmd(unsigned char *data, int len)
Parse the data contained by a sound2 command coming from the server and handle playing the specified ...
void LOG(LogLevel level, const char *origin, const char *format,...)
Log messages of a certain importance to stderr.
void MusicCmd(const char *data, int len)
Parse the data contained by a music command coming from the server and pass the name along to cfsndse...
@ LOG_ERROR
Warning that something definitely didn't work.
void cf_play_sound(gint8 x, gint8 y, guint8 dir, guint8 vol, guint8 type, char const sound[static 1], char const source[static 1])
Play a sound effect using the SDL_mixer sound system.
gint16 use_config[CONFIG_NUMS]
void cf_play_music(const char *music_name)
Play a music file.