2 "$Id: sound.c 9215 2008-06-02 18:31:04Z anmaster $";
86 static void play_sound(
int soundnum,
int soundtype,
int x,
int y)
90 if (fprintf(
sound_pipe,
"%4x %4x %4x %4x\n",soundnum,soundtype,x,y)<=0) {
108 fprintf(stderr,
"Got invalid length on sound command: %d\n", len);
117 fprintf(stderr,
"Playing sound %d (type %d), offset %d, %x\n",
125 uint8 x, y, dir, volume, type, len_action;
132 fprintf(stderr,
"Got too short length on sound2 command: %d\n", len);
140 len_action = data[5];
142 if (len_action >= (len-8)) {
143 fprintf(stderr,
"Bad length of \"len of action\" in sound2 command: %d\n", len);
146 if (len_action != 0) {
147 action = (
char*)data+6;
148 data[6+len_action]=
'\0';
151 len_name = data[6+len_action+1];
152 if (len_name >= (len-8-len_action)) {
153 fprintf(stderr,
"Bad length of \"len of name\" in sound2 command: %d\n", len);
157 name = (
char*)data+6+len_action+1;
158 data[6+len_action+1+len_name]=
'\0';
161 fprintf(stderr,
"Playing sound2 x=%hhd y=%hhd dir=%hhd volume=%hhd type=%hhd\n",
162 x, y, dir, volume, type);
163 fprintf(stderr,
" len_action=%hhd action=%s\n", len_action, action);
164 fprintf(stderr,
" len_name=%hhd name=%s\n", len_name, name);
165 fprintf(stderr,
"Please impement sound2!");
174 if (!strncmp(data,
"NONE", len)) {
177 fprintf(stderr,
"gtk::MusicCmd",
"music command: %s (Implement me!)\n", data);
short GetShort_String(const unsigned char *data)
void Sound2Cmd(unsigned char *data, int len)
static void play_sound(int soundnum, int soundtype, int x, int y)
void logChildPipe(ChildProcess *child, LogLevel level, int flag)
sint16 want_config[CONFIG_NUMS]
const char * rcsid_x11_sound_c
ChildProcess * sound_process
ChildProcess * raiseChild(char *name, int flag)
void MusicCmd(const char *data, int len)
void SoundCmd(unsigned char *data, int len)