Removed error checking from magic tools as it was causing problems with --nosound

This commit is contained in:
Andrew Corcoran 2008-08-03 22:15:52 +00:00
parent a60c242972
commit a0cd6daeb5
8 changed files with 10 additions and 24 deletions

View file

@ -80,9 +80,6 @@ int alien_init(magic_api * api){
for (i = 0; i < alien_NUM_TOOLS; i++){
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, alien_snd_filenames[i]);
alien_snd_effect[i] = Mix_LoadWAV(fname);
if (alien_snd_effect[i]==NULL){
return(0);
}
}
return(1);
}
@ -176,6 +173,16 @@ void alien_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->h = (y + alien_RADIUS) - update_rect->y;
}
int use_sound = 1;
Mix_Chunk * magic_loadsound(char* file){
if (!use_sound){
return (Mix_Chunk*)-1;
}
Mix_Chunk * temp = Mix_LoadWAV(file);
return temp;
}
// Affect the canvas on click:
void alien_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * last,