Removed error checking from magic tools as it was causing problems with --nosound
This commit is contained in:
parent
a60c242972
commit
a0cd6daeb5
8 changed files with 10 additions and 24 deletions
|
|
@ -80,9 +80,6 @@ int alien_init(magic_api * api){
|
||||||
for (i = 0; i < alien_NUM_TOOLS; i++){
|
for (i = 0; i < alien_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, alien_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, alien_snd_filenames[i]);
|
||||||
alien_snd_effect[i] = Mix_LoadWAV(fname);
|
alien_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (alien_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(1);
|
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;
|
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:
|
// Affect the canvas on click:
|
||||||
void alien_click(magic_api * api, int which, int mode,
|
void alien_click(magic_api * api, int which, int mode,
|
||||||
SDL_Surface * canvas, SDL_Surface * last,
|
SDL_Surface * canvas, SDL_Surface * last,
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,6 @@ int blur_init(magic_api * api){
|
||||||
for (i = 0; i < blur_NUM_TOOLS; i++){
|
for (i = 0; i < blur_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, blur_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, blur_snd_filenames[i]);
|
||||||
blur_snd_effect[i] = Mix_LoadWAV(fname);
|
blur_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (blur_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,6 @@ int mosaic_init(magic_api * api){
|
||||||
for (i = 0; i < mosaic_NUM_TOOLS; i++){
|
for (i = 0; i < mosaic_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, mosaic_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, mosaic_snd_filenames[i]);
|
||||||
mosaic_snd_effect[i] = Mix_LoadWAV(fname);
|
mosaic_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (mosaic_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,6 @@ int noise_init(magic_api * api){
|
||||||
for (i = 0; i < noise_NUM_TOOLS; i++){
|
for (i = 0; i < noise_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, noise_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, noise_snd_filenames[i]);
|
||||||
noise_snd_effect[i] = Mix_LoadWAV(fname);
|
noise_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (noise_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,6 @@ int rain_init(magic_api * api){
|
||||||
for (i = 0; i < rain_NUM_TOOLS; i++){
|
for (i = 0; i < rain_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, rain_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, rain_snd_filenames[i]);
|
||||||
rain_snd_effect[i] = Mix_LoadWAV(fname);
|
rain_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (rain_snd_effect[i] == NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,6 @@ int sharpen_init(magic_api * api){
|
||||||
for (i = 0; i < sharpen_NUM_TOOLS; i++){
|
for (i = 0; i < sharpen_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, sharpen_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, sharpen_snd_filenames[i]);
|
||||||
sharpen_snd_effect[i] = Mix_LoadWAV(fname);
|
sharpen_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (sharpen_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
|
|
|
||||||
|
|
@ -98,9 +98,6 @@ int snow_init(magic_api * api){
|
||||||
for (i = 0; i < snow_NUM_TOOLS; i++){
|
for (i = 0; i < snow_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, snow_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, snow_snd_filenames[i]);
|
||||||
snow_snd_effect[i] = Mix_LoadWAV(fname);
|
snow_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (snow_snd_effect[i]==NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,6 @@ int tint_init(magic_api * api){
|
||||||
for (i = 0; i < tint_NUM_TOOLS; i++){
|
for (i = 0; i < tint_NUM_TOOLS; i++){
|
||||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, tint_snd_filenames[i]);
|
snprintf(fname, sizeof(fname), "%s/sounds/magic/%s", api->data_directory, tint_snd_filenames[i]);
|
||||||
tint_snd_effect[i] = Mix_LoadWAV(fname);
|
tint_snd_effect[i] = Mix_LoadWAV(fname);
|
||||||
if (tint_snd_effect[i] == NULL){
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue