Add debugging output for playing sounds.

This commit is contained in:
Mark K. Kim 2018-06-26 22:59:24 -04:00
parent 19ae36662b
commit 1db3d431f5
2 changed files with 19 additions and 2 deletions

View file

@ -54,6 +54,10 @@ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y
if (!mute && use_sound && s != SND_NONE)
{
#ifdef DEBUG
printf("playsound #%d in channel %d, pos (%d,%d), %soverride, ptr=%p\n", s, chan, x, y, override ? "" : "no ", sounds[s]);
fflush(stdout);
#endif
if (override || !Mix_Playing(chan))
{
Mix_PlayChannel(chan, sounds[s], 0);
@ -91,8 +95,10 @@ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y
left = ((255 - dist) * ((screen->w - 1) - x)) / (screen->w - 1);
}
#ifdef DEBUG
printf("Panning of sound #%d in channel %d, left=%d, right=%d\n", s, chan, left, (255-dist)-left);
fflush(stdout);
#endif
Mix_SetPanning(chan, left, (255 - dist) - left);
}
}

View file

@ -11841,6 +11841,17 @@ static int do_prompt_image_flash_snd(const char *const text,
int val_x, val_y, motioner;
int valhat_x, valhat_y, hatmotioner;
#ifdef DEBUG
if(snd >= 0) {
printf("Prompt and play sound #%d: %s\n", snd, sound_fnames[snd]);
fflush(stdout);
}
else {
printf("Prompt without sound\n");
fflush(stdout);
}
#endif
val_x = val_y = motioner = 0;
valhat_x = valhat_y = hatmotioner = 0;
emulate_button_pressed = 0;